diff --git a/.gitignore b/.gitignore index 549e00a..ff317e6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,15 @@ -HELP.md +###################################################################### +# Build Tools + +.gradle +/build/ +!gradle/wrapper/gradle-wrapper.jar + target/ !.mvn/wrapper/maven-wrapper.jar -!**/src/main/**/target/ -!**/src/test/**/target/ + +###################################################################### +# IDE ### STS ### .apt_generated @@ -11,7 +18,6 @@ target/ .project .settings .springBeans -.sts4-cache ### IntelliJ IDEA ### .idea @@ -19,15 +25,24 @@ target/ *.iml *.ipr +### JRebel ### +rebel.xml + ### NetBeans ### -/nbproject/private/ -/nbbuild/ -/dist/ -/nbdist/ -/.nb-gradle/ -build/ -!**/src/main/**/build/ -!**/src/test/**/build/ - -### VS Code ### -.vscode/ +nbproject/private/ +build/* +nbbuild/ +dist/ +nbdist/ +.nb-gradle/ + +###################################################################### +# Others +*.log +*.xml.versionsBackup +*.swp + +!*/build/*.java +!*/build/*.html +!*/build/*.xml +/custom-ui/node_modules diff --git a/LICENSE b/LICENSE index ca38718..8564f29 100644 --- a/LICENSE +++ b/LICENSE @@ -1,191 +1,20 @@ -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 2019-2020 Zheng Jie - - 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 +The MIT License (MIT) + +Copyright (c) 2018 RuoYi + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md index 484acf5..b129538 100644 --- a/README.md +++ b/README.md @@ -1,83 +1,45 @@ -

EL-ADMIN 后台管理系统

-
-#### 项目简介 -一个基于 Spring Boot 2.1.0 、 Spring Boot Jpa、 JWT、Spring Security、Redis、Vue的前后端分离的后台管理系统 - -**开发文档:** [https://el-admin.vip](https://el-admin.vip) - -**体验地址:** [https://el-admin.xin](https://el-admin.xin) - -**账号密码:** `admin / 123456` - -#### 项目源码 - -| | 后端源码 | 前端源码 | -|--- |--- | --- | -| github | https://github.com/elunez/eladmin | https://github.com/elunez/eladmin-web | -| 码云 | https://gitee.com/elunez/eladmin | https://gitee.com/elunez/eladmin-web | - -#### 主要特性 -- 使用最新技术栈,社区资源丰富。 -- 高效率开发,代码生成器可一键生成前后端代码 -- 支持数据字典,可方便地对一些状态进行管理 -- 支持接口限流,避免恶意请求导致服务层压力过大 -- 支持接口级别的功能权限与数据权限,可自定义操作 -- 自定义权限注解与匿名接口注解,可快速对接口拦截与放行 -- 对一些常用地前端组件封装:表格数据请求、数据字典等 -- 前后端统一异常拦截处理,统一输出异常,避免繁琐的判断 -- 支持在线用户管理与服务器性能监控,支持限制单用户登录 -- 支持运维管理,可方便地对远程服务器的应用进行部署与管理 - -#### 系统功能 -- 用户管理:提供用户的相关配置,新增用户后,默认密码为123456 -- 角色管理:对权限与菜单进行分配,可根据部门设置角色的数据权限 -- 菜单管理:已实现菜单动态路由,后端可配置化,支持多级菜单 -- 部门管理:可配置系统组织架构,树形表格展示 -- 岗位管理:配置各个部门的职位 -- 字典管理:可维护常用一些固定的数据,如:状态,性别等 -- 系统日志:记录用户操作日志与异常日志,方便开发人员定位排错 -- SQL监控:采用druid 监控数据库访问性能,默认用户名admin,密码123456 -- 定时任务:整合Quartz做定时任务,加入任务日志,任务运行情况一目了然 -- 代码生成:高灵活度生成前后端代码,减少大量重复的工作任务 -- 邮件工具:配合富文本,发送html格式的邮件 -- 七牛云存储:可同步七牛云存储的数据到系统,无需登录七牛云直接操作云数据 -- 支付宝支付:整合了支付宝支付并且提供了测试账号,可自行测试 -- 服务监控:监控服务器的负载情况 -- 运维管理:一键部署你的应用 - -#### 项目结构 -项目采用按功能分模块的开发方式,结构如下 - -- `capiltal-common` 为系统的公共模块,各种工具类,公共配置存在该模块 - -- `capiltal-client` 为客户端api模块,也是最终需要打包部署的模块 - -- `capiltal-system` 为系统核心模块也是项目入口模块,也是最终需要打包部署的模块 - -- `capiltal-logging` 为系统的日志模块,其他模块如果需要记录日志需要引入该模块 - -- `capiltal-tools` 为第三方工具模块,包含:图床、邮件、云存储、本地存储、支付宝 - -- `capiltal-generator` 为系统的代码生成模块,代码生成的模板在 system 模块中 - -#### 详细结构 - -``` -- capiltal-common 公共模块 - - annotation 为系统自定义注解 - - aspect 自定义注解的切面 - - base 提供了Entity、DTO基类和mapstruct的通用mapper - - config 自定义权限实现、redis配置、swagger配置、Rsa配置等 - - dao MybatiesPlus Dao - - mapper mybatiesPlus Mapper - - exception 项目统一异常的处理 - - utils 系统通用工具类 -- capiltal-system 系统核心模块(系统启动入口) - - config 配置跨域与静态资源,与数据权限 - - thread 线程池相关 - - modules 系统相关模块(登录授权、系统监控、定时任务、运维管理等) -- capiltal-logging 系统日志模块 -- capiltal-tools 系统第三方工具模块 -- capiltal-generator 系统代码生成模块 -``` - +## 内置功能 + +1. 用户管理:用户是系统操作者,该功能主要完成系统用户配置。 +2. 部门管理:配置系统组织机构(公司、部门、小组),树结构展现支持数据权限。 +3. 岗位管理:配置系统用户所属担任职务。 +4. 菜单管理:配置系统菜单,操作权限,按钮权限标识等。 +5. 角色管理:角色菜单权限分配、设置角色按机构进行数据范围权限划分。 +6. 字典管理:对系统中经常使用的一些较为固定的数据进行维护。 +7. 参数管理:对系统动态配置常用参数。 +8. 通知公告:系统通知公告信息发布维护。 +9. 操作日志:系统正常操作日志记录和查询;系统异常信息日志记录和查询。 +10. 登录日志:系统登录日志记录查询包含登录异常。 +11. 在线用户:当前系统中活跃用户状态监控。 +12. 定时任务:在线(添加、修改、删除)任务调度包含执行结果日志。 +13. 代码生成:前后端代码的生成(java、html、xml、sql)支持CRUD下载 。 +14. 系统接口:根据业务代码自动生成相关的api接口文档。 +15. 服务监控:监视当前系统CPU、内存、磁盘、堆栈等相关信息。 +16. 缓存监控:对系统的缓存信息查询,命令统计等。 +17. 在线构建器:拖动表单元素生成相应的HTML代码。 +18. 连接池监视:监视当前系统数据库连接池状态,可进行分析SQL找出系统性能瓶颈。 + + +前端开发 +# 克隆项目 +git clone https://gitee.com/y_project/RuoYi-Vue + +# 进入项目目录 +cd ruoyi-ui + +# 安装依赖 +npm install + +# 建议不要直接使用 cnpm 安装依赖,会有各种诡异的 bug。可以通过如下操作解决 npm 下载速度慢的问题 +npm install --registry=https://registry.npmmirror.com + +### 启动服务 +npm run dev + +### 发布 + +# 构建测试环境 +npm run build:stage + +# 构建生产环境 +npm run build:prod diff --git a/bin/clean.bat b/bin/clean.bat new file mode 100644 index 0000000..24c0974 --- /dev/null +++ b/bin/clean.bat @@ -0,0 +1,12 @@ +@echo off +echo. +echo [Ϣ] target· +echo. + +%~d0 +cd %~dp0 + +cd .. +call mvn clean + +pause \ No newline at end of file diff --git a/bin/package.bat b/bin/package.bat new file mode 100644 index 0000000..c693ec0 --- /dev/null +++ b/bin/package.bat @@ -0,0 +1,12 @@ +@echo off +echo. +echo [Ϣ] Weḅwar/jarļ +echo. + +%~d0 +cd %~dp0 + +cd .. +call mvn clean package -Dmaven.test.skip=true + +pause \ No newline at end of file diff --git a/bin/run.bat b/bin/run.bat new file mode 100644 index 0000000..41efbd0 --- /dev/null +++ b/bin/run.bat @@ -0,0 +1,14 @@ +@echo off +echo. +echo [Ϣ] ʹJarWeb̡ +echo. + +cd %~dp0 +cd ../ruoyi-admin/target + +set JAVA_OPTS=-Xms256m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m + +java -jar %JAVA_OPTS% ruoyi-admin.jar + +cd bin +pause \ No newline at end of file diff --git a/custom-ui/.editorconfig b/custom-ui/.editorconfig new file mode 100644 index 0000000..7034f9b --- /dev/null +++ b/custom-ui/.editorconfig @@ -0,0 +1,22 @@ +# 告诉EditorConfig插件,这是根文件,不用继续往上查找 +root = true + +# 匹配全部文件 +[*] +# 设置字符集 +charset = utf-8 +# 缩进风格,可选space、tab +indent_style = space +# 缩进的空格数 +indent_size = 2 +# 结尾换行符,可选lf、cr、crlf +end_of_line = lf +# 在文件结尾插入新行 +insert_final_newline = true +# 删除一行中的前后空格 +trim_trailing_whitespace = true + +# 匹配md结尾的文件 +[*.md] +insert_final_newline = false +trim_trailing_whitespace = false diff --git a/custom-ui/.env.development b/custom-ui/.env.development new file mode 100644 index 0000000..d74af37 --- /dev/null +++ b/custom-ui/.env.development @@ -0,0 +1,11 @@ +# 页面标题 +VUE_APP_TITLE = 后台管理系统 + +# 开发环境配置 +ENV = 'development' + +# 后台管理系统/开发环境 +VUE_APP_BASE_API = '/dev-api' + +# 路由懒加载 +VUE_CLI_BABEL_TRANSPILE_MODULES = true diff --git a/custom-ui/.env.production b/custom-ui/.env.production new file mode 100644 index 0000000..f617a43 --- /dev/null +++ b/custom-ui/.env.production @@ -0,0 +1,8 @@ +# 页面标题 +VUE_APP_TITLE = 后台管理系统 + +# 生产环境配置 +ENV = 'production' + +# 后台管理系统/生产环境 +VUE_APP_BASE_API = '/prod-api' diff --git a/custom-ui/.env.staging b/custom-ui/.env.staging new file mode 100644 index 0000000..42f8f78 --- /dev/null +++ b/custom-ui/.env.staging @@ -0,0 +1,10 @@ +# 页面标题 +VUE_APP_TITLE = 后台管理系统 + +NODE_ENV = production + +# 测试环境配置 +ENV = 'staging' + +# 后台管理系统/测试环境 +VUE_APP_BASE_API = '/stage-api' diff --git a/custom-ui/.eslintignore b/custom-ui/.eslintignore new file mode 100644 index 0000000..89be6f6 --- /dev/null +++ b/custom-ui/.eslintignore @@ -0,0 +1,10 @@ +# 忽略build目录下类型为js的文件的语法检查 +build/*.js +# 忽略src/assets目录下文件的语法检查 +src/assets +# 忽略public目录下文件的语法检查 +public +# 忽略当前目录下为js的文件的语法检查 +*.js +# 忽略当前目录下为vue的文件的语法检查 +*.vue \ No newline at end of file diff --git a/custom-ui/.eslintrc.js b/custom-ui/.eslintrc.js new file mode 100644 index 0000000..82bbdee --- /dev/null +++ b/custom-ui/.eslintrc.js @@ -0,0 +1,199 @@ +// ESlint 检查配置 +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/custom-ui/README.md b/custom-ui/README.md new file mode 100644 index 0000000..00c0ab8 --- /dev/null +++ b/custom-ui/README.md @@ -0,0 +1,30 @@ +## 开发 + +```bash +# 克隆项目 +git clone https://gitee.com/y_project/RuoYi-Vue + +# 进入项目目录 +cd ruoyi-ui + +# 安装依赖 +npm install + +# 建议不要直接使用 cnpm 安装依赖,会有各种诡异的 bug。可以通过如下操作解决 npm 下载速度慢的问题 +npm install --registry=https://registry.npmmirror.com + +# 启动服务 +npm run dev +``` + +浏览器访问 http://localhost:80 + +## 发布 + +```bash +# 构建测试环境 +npm run build:stage + +# 构建生产环境 +npm run build:prod +``` \ No newline at end of file diff --git a/custom-ui/babel.config.js b/custom-ui/babel.config.js new file mode 100644 index 0000000..c8267b2 --- /dev/null +++ b/custom-ui/babel.config.js @@ -0,0 +1,13 @@ +module.exports = { + presets: [ + // https://github.com/vuejs/vue-cli/tree/master/packages/@vue/babel-preset-app + '@vue/cli-plugin-babel/preset' + ], + 'env': { + 'development': { + // babel-plugin-dynamic-import-node plugin only does one thing by converting all import() to require(). + // This plugin can significantly increase the speed of hot updates, when you have a large number of pages. + 'plugins': ['dynamic-import-node'] + } + } +} \ No newline at end of file diff --git a/custom-ui/bin/build.bat b/custom-ui/bin/build.bat new file mode 100644 index 0000000..dda590d --- /dev/null +++ b/custom-ui/bin/build.bat @@ -0,0 +1,12 @@ +@echo off +echo. +echo [Ϣ] Weḅdistļ +echo. + +%~d0 +cd %~dp0 + +cd .. +npm run build:prod + +pause \ No newline at end of file diff --git a/custom-ui/bin/package.bat b/custom-ui/bin/package.bat new file mode 100644 index 0000000..0e5bc0f --- /dev/null +++ b/custom-ui/bin/package.bat @@ -0,0 +1,12 @@ +@echo off +echo. +echo [Ϣ] װWeḅnode_modulesļ +echo. + +%~d0 +cd %~dp0 + +cd .. +npm install --registry=https://registry.npmmirror.com + +pause \ No newline at end of file diff --git a/custom-ui/bin/run-web.bat b/custom-ui/bin/run-web.bat new file mode 100644 index 0000000..d30deae --- /dev/null +++ b/custom-ui/bin/run-web.bat @@ -0,0 +1,12 @@ +@echo off +echo. +echo [Ϣ] ʹ Vue CLI Web ̡ +echo. + +%~d0 +cd %~dp0 + +cd .. +npm run dev + +pause \ No newline at end of file diff --git a/custom-ui/build/index.js b/custom-ui/build/index.js new file mode 100644 index 0000000..0c57de2 --- /dev/null +++ b/custom-ui/build/index.js @@ -0,0 +1,35 @@ +const { run } = require('runjs') +const chalk = require('chalk') +const config = require('../vue.config.js') +const rawArgv = process.argv.slice(2) +const args = rawArgv.join(' ') + +if (process.env.npm_config_preview || rawArgv.includes('--preview')) { + const report = rawArgv.includes('--report') + + run(`vue-cli-service build ${args}`) + + const port = 9526 + const publicPath = config.publicPath + + var connect = require('connect') + var serveStatic = require('serve-static') + const app = connect() + + app.use( + publicPath, + serveStatic('./dist', { + index: ['index.html', '/'] + }) + ) + + app.listen(port, function () { + console.log(chalk.green(`> Preview at http://localhost:${port}${publicPath}`)) + if (report) { + console.log(chalk.green(`> Report at http://localhost:${port}${publicPath}report.html`)) + } + + }) +} else { + run(`vue-cli-service build ${args}`) +} diff --git a/custom-ui/package-lock.json b/custom-ui/package-lock.json new file mode 100644 index 0000000..78c1b48 --- /dev/null +++ b/custom-ui/package-lock.json @@ -0,0 +1,15631 @@ +{ + "name": "ruoyi", + "version": "3.8.5", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@achrinza/node-ipc": { + "version": "9.2.2", + "resolved": "https://registry.npmmirror.com/@achrinza/node-ipc/-/node-ipc-9.2.2.tgz", + "integrity": "sha512-b90U39dx0cU6emsOvy5hxU4ApNXnE3+Tuo8XQZfiKTGelDwpMwBVgBP7QX6dGTcJgu/miyJuNJ/2naFBliNWEw==", + "dev": true, + "requires": { + "@node-ipc/js-queue": "2.0.3", + "event-pubsub": "4.3.0", + "js-message": "1.0.7" + } + }, + "@ampproject/remapping": { + "version": "2.3.0", + "resolved": "https://registry.npmmirror.com/@ampproject/remapping/-/remapping-2.3.0.tgz", + "integrity": "sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==", + "dev": true, + "requires": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "@babel/code-frame": { + "version": "7.24.6", + "resolved": "https://registry.npmmirror.com/@babel/code-frame/-/code-frame-7.24.6.tgz", + "integrity": "sha512-ZJhac6FkEd1yhG2AHOmfcXG4ceoLltoCVJjN5XsWN9BifBQr+cHJbWi0h68HZuSORq+3WtJ2z0hwF2NG1b5kcA==", + "dev": true, + "requires": { + "@babel/highlight": "^7.24.6", + "picocolors": "^1.0.0" + } + }, + "@babel/compat-data": { + "version": "7.24.6", + "resolved": "https://registry.npmmirror.com/@babel/compat-data/-/compat-data-7.24.6.tgz", + "integrity": "sha512-aC2DGhBq5eEdyXWqrDInSqQjO0k8xtPRf5YylULqx8MCd6jBtzqfta/3ETMRpuKIc5hyswfO80ObyA1MvkCcUQ==", + "dev": true + }, + "@babel/core": { + "version": "7.24.6", + "resolved": "https://registry.npmmirror.com/@babel/core/-/core-7.24.6.tgz", + "integrity": "sha512-qAHSfAdVyFmIvl0VHELib8xar7ONuSHrE2hLnsaWkYNTI68dmi1x8GYDhJjMI/e7XWal9QBlZkwbOnkcw7Z8gQ==", + "dev": true, + "requires": { + "@ampproject/remapping": "^2.2.0", + "@babel/code-frame": "^7.24.6", + "@babel/generator": "^7.24.6", + "@babel/helper-compilation-targets": "^7.24.6", + "@babel/helper-module-transforms": "^7.24.6", + "@babel/helpers": "^7.24.6", + "@babel/parser": "^7.24.6", + "@babel/template": "^7.24.6", + "@babel/traverse": "^7.24.6", + "@babel/types": "^7.24.6", + "convert-source-map": "^2.0.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.3", + "semver": "^6.3.1" + }, + "dependencies": { + "semver": { + "version": "6.3.1", + "resolved": "https://registry.npmmirror.com/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true + } + } + }, + "@babel/generator": { + "version": "7.24.6", + "resolved": "https://registry.npmmirror.com/@babel/generator/-/generator-7.24.6.tgz", + "integrity": "sha512-S7m4eNa6YAPJRHmKsLHIDJhNAGNKoWNiWefz1MBbpnt8g9lvMDl1hir4P9bo/57bQEmuwEhnRU/AMWsD0G/Fbg==", + "dev": true, + "requires": { + "@babel/types": "^7.24.6", + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25", + "jsesc": "^2.5.1" + } + }, + "@babel/helper-annotate-as-pure": { + "version": "7.24.6", + "resolved": "https://registry.npmmirror.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.24.6.tgz", + "integrity": "sha512-DitEzDfOMnd13kZnDqns1ccmftwJTS9DMkyn9pYTxulS7bZxUxpMly3Nf23QQ6NwA4UB8lAqjbqWtyvElEMAkg==", + "dev": true, + "requires": { + "@babel/types": "^7.24.6" + } + }, + "@babel/helper-builder-binary-assignment-operator-visitor": { + "version": "7.24.6", + "resolved": "https://registry.npmmirror.com/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.24.6.tgz", + "integrity": "sha512-+wnfqc5uHiMYtvRX7qu80Toef8BXeh4HHR1SPeonGb1SKPniNEd4a/nlaJJMv/OIEYvIVavvo0yR7u10Gqz0Iw==", + "dev": true, + "requires": { + "@babel/types": "^7.24.6" + } + }, + "@babel/helper-compilation-targets": { + "version": "7.24.6", + "resolved": "https://registry.npmmirror.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.24.6.tgz", + "integrity": "sha512-VZQ57UsDGlX/5fFA7GkVPplZhHsVc+vuErWgdOiysI9Ksnw0Pbbd6pnPiR/mmJyKHgyIW0c7KT32gmhiF+cirg==", + "dev": true, + "requires": { + "@babel/compat-data": "^7.24.6", + "@babel/helper-validator-option": "^7.24.6", + "browserslist": "^4.22.2", + "lru-cache": "^5.1.1", + "semver": "^6.3.1" + }, + "dependencies": { + "lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmmirror.com/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, + "requires": { + "yallist": "^3.0.2" + } + }, + "semver": { + "version": "6.3.1", + "resolved": "https://registry.npmmirror.com/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true + }, + "yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmmirror.com/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true + } + } + }, + "@babel/helper-create-class-features-plugin": { + "version": "7.24.6", + "resolved": "https://registry.npmmirror.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.24.6.tgz", + "integrity": "sha512-djsosdPJVZE6Vsw3kk7IPRWethP94WHGOhQTc67SNXE0ZzMhHgALw8iGmYS0TD1bbMM0VDROy43od7/hN6WYcA==", + "dev": true, + "requires": { + "@babel/helper-annotate-as-pure": "^7.24.6", + "@babel/helper-environment-visitor": "^7.24.6", + "@babel/helper-function-name": "^7.24.6", + "@babel/helper-member-expression-to-functions": "^7.24.6", + "@babel/helper-optimise-call-expression": "^7.24.6", + "@babel/helper-replace-supers": "^7.24.6", + "@babel/helper-skip-transparent-expression-wrappers": "^7.24.6", + "@babel/helper-split-export-declaration": "^7.24.6", + "semver": "^6.3.1" + }, + "dependencies": { + "semver": { + "version": "6.3.1", + "resolved": "https://registry.npmmirror.com/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true + } + } + }, + "@babel/helper-create-regexp-features-plugin": { + "version": "7.24.6", + "resolved": "https://registry.npmmirror.com/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.24.6.tgz", + "integrity": "sha512-C875lFBIWWwyv6MHZUG9HmRrlTDgOsLWZfYR0nW69gaKJNe0/Mpxx5r0EID2ZdHQkdUmQo2t0uNckTL08/1BgA==", + "dev": true, + "requires": { + "@babel/helper-annotate-as-pure": "^7.24.6", + "regexpu-core": "^5.3.1", + "semver": "^6.3.1" + }, + "dependencies": { + "semver": { + "version": "6.3.1", + "resolved": "https://registry.npmmirror.com/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true + } + } + }, + "@babel/helper-define-polyfill-provider": { + "version": "0.6.2", + "resolved": "https://registry.npmmirror.com/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.6.2.tgz", + "integrity": "sha512-LV76g+C502biUK6AyZ3LK10vDpDyCzZnhZFXkH1L75zHPj68+qc8Zfpx2th+gzwA2MzyK+1g/3EPl62yFnVttQ==", + "dev": true, + "requires": { + "@babel/helper-compilation-targets": "^7.22.6", + "@babel/helper-plugin-utils": "^7.22.5", + "debug": "^4.1.1", + "lodash.debounce": "^4.0.8", + "resolve": "^1.14.2" + } + }, + "@babel/helper-environment-visitor": { + "version": "7.24.6", + "resolved": "https://registry.npmmirror.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.24.6.tgz", + "integrity": "sha512-Y50Cg3k0LKLMjxdPjIl40SdJgMB85iXn27Vk/qbHZCFx/o5XO3PSnpi675h1KEmmDb6OFArfd5SCQEQ5Q4H88g==", + "dev": true + }, + "@babel/helper-function-name": { + "version": "7.24.6", + "resolved": "https://registry.npmmirror.com/@babel/helper-function-name/-/helper-function-name-7.24.6.tgz", + "integrity": "sha512-xpeLqeeRkbxhnYimfr2PC+iA0Q7ljX/d1eZ9/inYbmfG2jpl8Lu3DyXvpOAnrS5kxkfOWJjioIMQsaMBXFI05w==", + "dev": true, + "requires": { + "@babel/template": "^7.24.6", + "@babel/types": "^7.24.6" + } + }, + "@babel/helper-hoist-variables": { + "version": "7.24.6", + "resolved": "https://registry.npmmirror.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.24.6.tgz", + "integrity": "sha512-SF/EMrC3OD7dSta1bLJIlrsVxwtd0UpjRJqLno6125epQMJ/kyFmpTT4pbvPbdQHzCHg+biQ7Syo8lnDtbR+uA==", + "dev": true, + "requires": { + "@babel/types": "^7.24.6" + } + }, + "@babel/helper-member-expression-to-functions": { + "version": "7.24.6", + "resolved": "https://registry.npmmirror.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.24.6.tgz", + "integrity": "sha512-OTsCufZTxDUsv2/eDXanw/mUZHWOxSbEmC3pP8cgjcy5rgeVPWWMStnv274DV60JtHxTk0adT0QrCzC4M9NWGg==", + "dev": true, + "requires": { + "@babel/types": "^7.24.6" + } + }, + "@babel/helper-module-imports": { + "version": "7.24.6", + "resolved": "https://registry.npmmirror.com/@babel/helper-module-imports/-/helper-module-imports-7.24.6.tgz", + "integrity": "sha512-a26dmxFJBF62rRO9mmpgrfTLsAuyHk4e1hKTUkD/fcMfynt8gvEKwQPQDVxWhca8dHoDck+55DFt42zV0QMw5g==", + "dev": true, + "requires": { + "@babel/types": "^7.24.6" + } + }, + "@babel/helper-module-transforms": { + "version": "7.24.6", + "resolved": "https://registry.npmmirror.com/@babel/helper-module-transforms/-/helper-module-transforms-7.24.6.tgz", + "integrity": "sha512-Y/YMPm83mV2HJTbX1Qh2sjgjqcacvOlhbzdCCsSlblOKjSYmQqEbO6rUniWQyRo9ncyfjT8hnUjlG06RXDEmcA==", + "dev": true, + "requires": { + "@babel/helper-environment-visitor": "^7.24.6", + "@babel/helper-module-imports": "^7.24.6", + "@babel/helper-simple-access": "^7.24.6", + "@babel/helper-split-export-declaration": "^7.24.6", + "@babel/helper-validator-identifier": "^7.24.6" + } + }, + "@babel/helper-optimise-call-expression": { + "version": "7.24.6", + "resolved": "https://registry.npmmirror.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.24.6.tgz", + "integrity": "sha512-3SFDJRbx7KuPRl8XDUr8O7GAEB8iGyWPjLKJh/ywP/Iy9WOmEfMrsWbaZpvBu2HSYn4KQygIsz0O7m8y10ncMA==", + "dev": true, + "requires": { + "@babel/types": "^7.24.6" + } + }, + "@babel/helper-plugin-utils": { + "version": "7.24.6", + "resolved": "https://registry.npmmirror.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.24.6.tgz", + "integrity": "sha512-MZG/JcWfxybKwsA9N9PmtF2lOSFSEMVCpIRrbxccZFLJPrJciJdG/UhSh5W96GEteJI2ARqm5UAHxISwRDLSNg==", + "dev": true + }, + "@babel/helper-remap-async-to-generator": { + "version": "7.24.6", + "resolved": "https://registry.npmmirror.com/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.24.6.tgz", + "integrity": "sha512-1Qursq9ArRZPAMOZf/nuzVW8HgJLkTB9y9LfP4lW2MVp4e9WkLJDovfKBxoDcCk6VuzIxyqWHyBoaCtSRP10yg==", + "dev": true, + "requires": { + "@babel/helper-annotate-as-pure": "^7.24.6", + "@babel/helper-environment-visitor": "^7.24.6", + "@babel/helper-wrap-function": "^7.24.6" + } + }, + "@babel/helper-replace-supers": { + "version": "7.24.6", + "resolved": "https://registry.npmmirror.com/@babel/helper-replace-supers/-/helper-replace-supers-7.24.6.tgz", + "integrity": "sha512-mRhfPwDqDpba8o1F8ESxsEkJMQkUF8ZIWrAc0FtWhxnjfextxMWxr22RtFizxxSYLjVHDeMgVsRq8BBZR2ikJQ==", + "dev": true, + "requires": { + "@babel/helper-environment-visitor": "^7.24.6", + "@babel/helper-member-expression-to-functions": "^7.24.6", + "@babel/helper-optimise-call-expression": "^7.24.6" + } + }, + "@babel/helper-simple-access": { + "version": "7.24.6", + "resolved": "https://registry.npmmirror.com/@babel/helper-simple-access/-/helper-simple-access-7.24.6.tgz", + "integrity": "sha512-nZzcMMD4ZhmB35MOOzQuiGO5RzL6tJbsT37Zx8M5L/i9KSrukGXWTjLe1knIbb/RmxoJE9GON9soq0c0VEMM5g==", + "dev": true, + "requires": { + "@babel/types": "^7.24.6" + } + }, + "@babel/helper-skip-transparent-expression-wrappers": { + "version": "7.24.6", + "resolved": "https://registry.npmmirror.com/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.24.6.tgz", + "integrity": "sha512-jhbbkK3IUKc4T43WadP96a27oYti9gEf1LdyGSP2rHGH77kwLwfhO7TgwnWvxxQVmke0ImmCSS47vcuxEMGD3Q==", + "dev": true, + "requires": { + "@babel/types": "^7.24.6" + } + }, + "@babel/helper-split-export-declaration": { + "version": "7.24.6", + "resolved": "https://registry.npmmirror.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.24.6.tgz", + "integrity": "sha512-CvLSkwXGWnYlF9+J3iZUvwgAxKiYzK3BWuo+mLzD/MDGOZDj7Gq8+hqaOkMxmJwmlv0iu86uH5fdADd9Hxkymw==", + "dev": true, + "requires": { + "@babel/types": "^7.24.6" + } + }, + "@babel/helper-string-parser": { + "version": "7.24.6", + "resolved": "https://registry.npmmirror.com/@babel/helper-string-parser/-/helper-string-parser-7.24.6.tgz", + "integrity": "sha512-WdJjwMEkmBicq5T9fm/cHND3+UlFa2Yj8ALLgmoSQAJZysYbBjw+azChSGPN4DSPLXOcooGRvDwZWMcF/mLO2Q==", + "dev": true + }, + "@babel/helper-validator-identifier": { + "version": "7.24.6", + "resolved": "https://registry.npmmirror.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.6.tgz", + "integrity": "sha512-4yA7s865JHaqUdRbnaxarZREuPTHrjpDT+pXoAZ1yhyo6uFnIEpS8VMu16siFOHDpZNKYv5BObhsB//ycbICyw==", + "dev": true + }, + "@babel/helper-validator-option": { + "version": "7.24.6", + "resolved": "https://registry.npmmirror.com/@babel/helper-validator-option/-/helper-validator-option-7.24.6.tgz", + "integrity": "sha512-Jktc8KkF3zIkePb48QO+IapbXlSapOW9S+ogZZkcO6bABgYAxtZcjZ/O005111YLf+j4M84uEgwYoidDkXbCkQ==", + "dev": true + }, + "@babel/helper-wrap-function": { + "version": "7.24.6", + "resolved": "https://registry.npmmirror.com/@babel/helper-wrap-function/-/helper-wrap-function-7.24.6.tgz", + "integrity": "sha512-f1JLrlw/jbiNfxvdrfBgio/gRBk3yTAEJWirpAkiJG2Hb22E7cEYKHWo0dFPTv/niPovzIdPdEDetrv6tC6gPQ==", + "dev": true, + "requires": { + "@babel/helper-function-name": "^7.24.6", + "@babel/template": "^7.24.6", + "@babel/types": "^7.24.6" + } + }, + "@babel/helpers": { + "version": "7.24.6", + "resolved": "https://registry.npmmirror.com/@babel/helpers/-/helpers-7.24.6.tgz", + "integrity": "sha512-V2PI+NqnyFu1i0GyTd/O/cTpxzQCYioSkUIRmgo7gFEHKKCg5w46+r/A6WeUR1+P3TeQ49dspGPNd/E3n9AnnA==", + "dev": true, + "requires": { + "@babel/template": "^7.24.6", + "@babel/types": "^7.24.6" + } + }, + "@babel/highlight": { + "version": "7.24.6", + "resolved": "https://registry.npmmirror.com/@babel/highlight/-/highlight-7.24.6.tgz", + "integrity": "sha512-2YnuOp4HAk2BsBrJJvYCbItHx0zWscI1C3zgWkz+wDyD9I7GIVrfnLyrR4Y1VR+7p+chAEcrgRQYZAGIKMV7vQ==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.24.6", + "chalk": "^2.4.2", + "js-tokens": "^4.0.0", + "picocolors": "^1.0.0" + }, + "dependencies": { + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmmirror.com/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + } + } + }, + "@babel/parser": { + "version": "7.24.6", + "resolved": "https://registry.npmmirror.com/@babel/parser/-/parser-7.24.6.tgz", + "integrity": "sha512-eNZXdfU35nJC2h24RznROuOpO94h6x8sg9ju0tT9biNtLZ2vuP8SduLqqV+/8+cebSLV9SJEAN5Z3zQbJG/M+Q==", + "dev": true + }, + "@babel/plugin-bugfix-firefox-class-in-computed-class-key": { + "version": "7.24.6", + "resolved": "https://registry.npmmirror.com/@babel/plugin-bugfix-firefox-class-in-computed-class-key/-/plugin-bugfix-firefox-class-in-computed-class-key-7.24.6.tgz", + "integrity": "sha512-bYndrJ6Ph6Ar+GaB5VAc0JPoP80bQCm4qon6JEzXfRl5QZyQ8Ur1K6k7htxWmPA5z+k7JQvaMUrtXlqclWYzKw==", + "dev": true, + "requires": { + "@babel/helper-environment-visitor": "^7.24.6", + "@babel/helper-plugin-utils": "^7.24.6" + } + }, + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": { + "version": "7.24.6", + "resolved": "https://registry.npmmirror.com/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.24.6.tgz", + "integrity": "sha512-iVuhb6poq5ikqRq2XWU6OQ+R5o9wF+r/or9CeUyovgptz0UlnK4/seOQ1Istu/XybYjAhQv1FRSSfHHufIku5Q==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.24.6" + } + }, + "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": { + "version": "7.24.6", + "resolved": "https://registry.npmmirror.com/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.24.6.tgz", + "integrity": "sha512-c8TER5xMDYzzFcGqOEp9l4hvB7dcbhcGjcLVwxWfe4P5DOafdwjsBJZKsmv+o3aXh7NhopvayQIovHrh2zSRUQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.24.6", + "@babel/helper-skip-transparent-expression-wrappers": "^7.24.6", + "@babel/plugin-transform-optional-chaining": "^7.24.6" + } + }, + "@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly": { + "version": "7.24.6", + "resolved": "https://registry.npmmirror.com/@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly/-/plugin-bugfix-v8-static-class-fields-redefine-readonly-7.24.6.tgz", + "integrity": "sha512-z8zEjYmwBUHN/pCF3NuWBhHQjJCrd33qAi8MgANfMrAvn72k2cImT8VjK9LJFu4ysOLJqhfkYYb3MvwANRUNZQ==", + "dev": true, + "requires": { + "@babel/helper-environment-visitor": "^7.24.6", + "@babel/helper-plugin-utils": "^7.24.6" + } + }, + "@babel/plugin-proposal-class-properties": { + "version": "7.18.6", + "resolved": "https://registry.npmmirror.com/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.18.6.tgz", + "integrity": "sha512-cumfXOF0+nzZrrN8Rf0t7M+tF6sZc7vhQwYQck9q1/5w2OExlD+b4v4RpMJFaV1Z7WcDRgO6FqvxqxGlwo+RHQ==", + "dev": true, + "requires": { + "@babel/helper-create-class-features-plugin": "^7.18.6", + "@babel/helper-plugin-utils": "^7.18.6" + } + }, + "@babel/plugin-proposal-decorators": { + "version": "7.24.6", + "resolved": "https://registry.npmmirror.com/@babel/plugin-proposal-decorators/-/plugin-proposal-decorators-7.24.6.tgz", + "integrity": "sha512-8DjR0/DzlBhz2SVi9a19/N2U5+C3y3rseXuyoKL9SP8vnbewscj1eHZtL6kpEn4UCuUmqEo0mvqyDYRFoN2gpA==", + "dev": true, + "requires": { + "@babel/helper-create-class-features-plugin": "^7.24.6", + "@babel/helper-plugin-utils": "^7.24.6", + "@babel/plugin-syntax-decorators": "^7.24.6" + } + }, + "@babel/plugin-proposal-private-property-in-object": { + "version": "7.21.0-placeholder-for-preset-env.2", + "resolved": "https://registry.npmmirror.com/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.21.0-placeholder-for-preset-env.2.tgz", + "integrity": "sha512-SOSkfJDddaM7mak6cPEpswyTRnuRltl429hMraQEglW+OkovnCzsiszTmsrlY//qLFjCpQDFRvjdm2wA5pPm9w==", + "dev": true + }, + "@babel/plugin-syntax-async-generators": { + "version": "7.8.4", + "resolved": "https://registry.npmmirror.com/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz", + "integrity": "sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-class-properties": { + "version": "7.12.13", + "resolved": "https://registry.npmmirror.com/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz", + "integrity": "sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.12.13" + } + }, + "@babel/plugin-syntax-class-static-block": { + "version": "7.14.5", + "resolved": "https://registry.npmmirror.com/@babel/plugin-syntax-class-static-block/-/plugin-syntax-class-static-block-7.14.5.tgz", + "integrity": "sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.14.5" + } + }, + "@babel/plugin-syntax-decorators": { + "version": "7.24.6", + "resolved": "https://registry.npmmirror.com/@babel/plugin-syntax-decorators/-/plugin-syntax-decorators-7.24.6.tgz", + "integrity": "sha512-gInH8LEqBp+wkwTVihCd/qf+4s28g81FZyvlIbAurHk9eSiItEKG7E0uNK2UdpgsD79aJVAW3R3c85h0YJ0jsw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.24.6" + } + }, + "@babel/plugin-syntax-dynamic-import": { + "version": "7.8.3", + "resolved": "https://registry.npmmirror.com/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz", + "integrity": "sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-export-namespace-from": { + "version": "7.8.3", + "resolved": "https://registry.npmmirror.com/@babel/plugin-syntax-export-namespace-from/-/plugin-syntax-export-namespace-from-7.8.3.tgz", + "integrity": "sha512-MXf5laXo6c1IbEbegDmzGPwGNTsHZmEy6QGznu5Sh2UCWvueywb2ee+CCE4zQiZstxU9BMoQO9i6zUFSY0Kj0Q==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.3" + } + }, + "@babel/plugin-syntax-import-assertions": { + "version": "7.24.6", + "resolved": "https://registry.npmmirror.com/@babel/plugin-syntax-import-assertions/-/plugin-syntax-import-assertions-7.24.6.tgz", + "integrity": "sha512-BE6o2BogJKJImTmGpkmOic4V0hlRRxVtzqxiSPa8TIFxyhi4EFjHm08nq1M4STK4RytuLMgnSz0/wfflvGFNOg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.24.6" + } + }, + "@babel/plugin-syntax-import-attributes": { + "version": "7.24.6", + "resolved": "https://registry.npmmirror.com/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.24.6.tgz", + "integrity": "sha512-D+CfsVZousPXIdudSII7RGy52+dYRtbyKAZcvtQKq/NpsivyMVduepzcLqG5pMBugtMdedxdC8Ramdpcne9ZWQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.24.6" + } + }, + "@babel/plugin-syntax-import-meta": { + "version": "7.10.4", + "resolved": "https://registry.npmmirror.com/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz", + "integrity": "sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-syntax-json-strings": { + "version": "7.8.3", + "resolved": "https://registry.npmmirror.com/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz", + "integrity": "sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-jsx": { + "version": "7.24.6", + "resolved": "https://registry.npmmirror.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.24.6.tgz", + "integrity": "sha512-lWfvAIFNWMlCsU0DRUun2GpFwZdGTukLaHJqRh1JRb80NdAP5Sb1HDHB5X9P9OtgZHQl089UzQkpYlBq2VTPRw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.24.6" + } + }, + "@babel/plugin-syntax-logical-assignment-operators": { + "version": "7.10.4", + "resolved": "https://registry.npmmirror.com/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz", + "integrity": "sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-syntax-nullish-coalescing-operator": { + "version": "7.8.3", + "resolved": "https://registry.npmmirror.com/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz", + "integrity": "sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-numeric-separator": { + "version": "7.10.4", + "resolved": "https://registry.npmmirror.com/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz", + "integrity": "sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-syntax-object-rest-spread": { + "version": "7.8.3", + "resolved": "https://registry.npmmirror.com/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz", + "integrity": "sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-optional-catch-binding": { + "version": "7.8.3", + "resolved": "https://registry.npmmirror.com/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz", + "integrity": "sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-optional-chaining": { + "version": "7.8.3", + "resolved": "https://registry.npmmirror.com/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz", + "integrity": "sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-private-property-in-object": { + "version": "7.14.5", + "resolved": "https://registry.npmmirror.com/@babel/plugin-syntax-private-property-in-object/-/plugin-syntax-private-property-in-object-7.14.5.tgz", + "integrity": "sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.14.5" + } + }, + "@babel/plugin-syntax-top-level-await": { + "version": "7.14.5", + "resolved": "https://registry.npmmirror.com/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz", + "integrity": "sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.14.5" + } + }, + "@babel/plugin-syntax-unicode-sets-regex": { + "version": "7.18.6", + "resolved": "https://registry.npmmirror.com/@babel/plugin-syntax-unicode-sets-regex/-/plugin-syntax-unicode-sets-regex-7.18.6.tgz", + "integrity": "sha512-727YkEAPwSIQTv5im8QHz3upqp92JTWhidIC81Tdx4VJYIte/VndKf1qKrfnnhPLiPghStWfvC/iFaMCQu7Nqg==", + "dev": true, + "requires": { + "@babel/helper-create-regexp-features-plugin": "^7.18.6", + "@babel/helper-plugin-utils": "^7.18.6" + } + }, + "@babel/plugin-transform-arrow-functions": { + "version": "7.24.6", + "resolved": "https://registry.npmmirror.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.24.6.tgz", + "integrity": "sha512-jSSSDt4ZidNMggcLx8SaKsbGNEfIl0PHx/4mFEulorE7bpYLbN0d3pDW3eJ7Y5Z3yPhy3L3NaPCYyTUY7TuugQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.24.6" + } + }, + "@babel/plugin-transform-async-generator-functions": { + "version": "7.24.6", + "resolved": "https://registry.npmmirror.com/@babel/plugin-transform-async-generator-functions/-/plugin-transform-async-generator-functions-7.24.6.tgz", + "integrity": "sha512-VEP2o4iR2DqQU6KPgizTW2mnMx6BG5b5O9iQdrW9HesLkv8GIA8x2daXBQxw1MrsIkFQGA/iJ204CKoQ8UcnAA==", + "dev": true, + "requires": { + "@babel/helper-environment-visitor": "^7.24.6", + "@babel/helper-plugin-utils": "^7.24.6", + "@babel/helper-remap-async-to-generator": "^7.24.6", + "@babel/plugin-syntax-async-generators": "^7.8.4" + } + }, + "@babel/plugin-transform-async-to-generator": { + "version": "7.24.6", + "resolved": "https://registry.npmmirror.com/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.24.6.tgz", + "integrity": "sha512-NTBA2SioI3OsHeIn6sQmhvXleSl9T70YY/hostQLveWs0ic+qvbA3fa0kwAwQ0OA/XGaAerNZRQGJyRfhbJK4g==", + "dev": true, + "requires": { + "@babel/helper-module-imports": "^7.24.6", + "@babel/helper-plugin-utils": "^7.24.6", + "@babel/helper-remap-async-to-generator": "^7.24.6" + } + }, + "@babel/plugin-transform-block-scoped-functions": { + "version": "7.24.6", + "resolved": "https://registry.npmmirror.com/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.24.6.tgz", + "integrity": "sha512-XNW7jolYHW9CwORrZgA/97tL/k05qe/HL0z/qqJq1mdWhwwCM6D4BJBV7wAz9HgFziN5dTOG31znkVIzwxv+vw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.24.6" + } + }, + "@babel/plugin-transform-block-scoping": { + "version": "7.24.6", + "resolved": "https://registry.npmmirror.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.24.6.tgz", + "integrity": "sha512-S/t1Xh4ehW7sGA7c1j/hiOBLnEYCp/c2sEG4ZkL8kI1xX9tW2pqJTCHKtdhe/jHKt8nG0pFCrDHUXd4DvjHS9w==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.24.6" + } + }, + "@babel/plugin-transform-class-properties": { + "version": "7.24.6", + "resolved": "https://registry.npmmirror.com/@babel/plugin-transform-class-properties/-/plugin-transform-class-properties-7.24.6.tgz", + "integrity": "sha512-j6dZ0Z2Z2slWLR3kt9aOmSIrBvnntWjMDN/TVcMPxhXMLmJVqX605CBRlcGI4b32GMbfifTEsdEjGjiE+j/c3A==", + "dev": true, + "requires": { + "@babel/helper-create-class-features-plugin": "^7.24.6", + "@babel/helper-plugin-utils": "^7.24.6" + } + }, + "@babel/plugin-transform-class-static-block": { + "version": "7.24.6", + "resolved": "https://registry.npmmirror.com/@babel/plugin-transform-class-static-block/-/plugin-transform-class-static-block-7.24.6.tgz", + "integrity": "sha512-1QSRfoPI9RoLRa8Mnakc6v3e0gJxiZQTYrMfLn+mD0sz5+ndSzwymp2hDcYJTyT0MOn0yuWzj8phlIvO72gTHA==", + "dev": true, + "requires": { + "@babel/helper-create-class-features-plugin": "^7.24.6", + "@babel/helper-plugin-utils": "^7.24.6", + "@babel/plugin-syntax-class-static-block": "^7.14.5" + } + }, + "@babel/plugin-transform-classes": { + "version": "7.24.6", + "resolved": "https://registry.npmmirror.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.24.6.tgz", + "integrity": "sha512-+fN+NO2gh8JtRmDSOB6gaCVo36ha8kfCW1nMq2Gc0DABln0VcHN4PrALDvF5/diLzIRKptC7z/d7Lp64zk92Fg==", + "dev": true, + "requires": { + "@babel/helper-annotate-as-pure": "^7.24.6", + "@babel/helper-compilation-targets": "^7.24.6", + "@babel/helper-environment-visitor": "^7.24.6", + "@babel/helper-function-name": "^7.24.6", + "@babel/helper-plugin-utils": "^7.24.6", + "@babel/helper-replace-supers": "^7.24.6", + "@babel/helper-split-export-declaration": "^7.24.6", + "globals": "^11.1.0" + } + }, + "@babel/plugin-transform-computed-properties": { + "version": "7.24.6", + "resolved": "https://registry.npmmirror.com/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.24.6.tgz", + "integrity": "sha512-cRzPobcfRP0ZtuIEkA8QzghoUpSB3X3qSH5W2+FzG+VjWbJXExtx0nbRqwumdBN1x/ot2SlTNQLfBCnPdzp6kg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.24.6", + "@babel/template": "^7.24.6" + } + }, + "@babel/plugin-transform-destructuring": { + "version": "7.24.6", + "resolved": "https://registry.npmmirror.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.24.6.tgz", + "integrity": "sha512-YLW6AE5LQpk5npNXL7i/O+U9CE4XsBCuRPgyjl1EICZYKmcitV+ayuuUGMJm2lC1WWjXYszeTnIxF/dq/GhIZQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.24.6" + } + }, + "@babel/plugin-transform-dotall-regex": { + "version": "7.24.6", + "resolved": "https://registry.npmmirror.com/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.24.6.tgz", + "integrity": "sha512-rCXPnSEKvkm/EjzOtLoGvKseK+dS4kZwx1HexO3BtRtgL0fQ34awHn34aeSHuXtZY2F8a1X8xqBBPRtOxDVmcA==", + "dev": true, + "requires": { + "@babel/helper-create-regexp-features-plugin": "^7.24.6", + "@babel/helper-plugin-utils": "^7.24.6" + } + }, + "@babel/plugin-transform-duplicate-keys": { + "version": "7.24.6", + "resolved": "https://registry.npmmirror.com/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.24.6.tgz", + "integrity": "sha512-/8Odwp/aVkZwPFJMllSbawhDAO3UJi65foB00HYnK/uXvvCPm0TAXSByjz1mpRmp0q6oX2SIxpkUOpPFHk7FLA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.24.6" + } + }, + "@babel/plugin-transform-dynamic-import": { + "version": "7.24.6", + "resolved": "https://registry.npmmirror.com/@babel/plugin-transform-dynamic-import/-/plugin-transform-dynamic-import-7.24.6.tgz", + "integrity": "sha512-vpq8SSLRTBLOHUZHSnBqVo0AKX3PBaoPs2vVzYVWslXDTDIpwAcCDtfhUcHSQQoYoUvcFPTdC8TZYXu9ZnLT/w==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.24.6", + "@babel/plugin-syntax-dynamic-import": "^7.8.3" + } + }, + "@babel/plugin-transform-exponentiation-operator": { + "version": "7.24.6", + "resolved": "https://registry.npmmirror.com/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.24.6.tgz", + "integrity": "sha512-EemYpHtmz0lHE7hxxxYEuTYOOBZ43WkDgZ4arQ4r+VX9QHuNZC+WH3wUWmRNvR8ECpTRne29aZV6XO22qpOtdA==", + "dev": true, + "requires": { + "@babel/helper-builder-binary-assignment-operator-visitor": "^7.24.6", + "@babel/helper-plugin-utils": "^7.24.6" + } + }, + "@babel/plugin-transform-export-namespace-from": { + "version": "7.24.6", + "resolved": "https://registry.npmmirror.com/@babel/plugin-transform-export-namespace-from/-/plugin-transform-export-namespace-from-7.24.6.tgz", + "integrity": "sha512-inXaTM1SVrIxCkIJ5gqWiozHfFMStuGbGJAxZFBoHcRRdDP0ySLb3jH6JOwmfiinPwyMZqMBX+7NBDCO4z0NSA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.24.6", + "@babel/plugin-syntax-export-namespace-from": "^7.8.3" + } + }, + "@babel/plugin-transform-for-of": { + "version": "7.24.6", + "resolved": "https://registry.npmmirror.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.24.6.tgz", + "integrity": "sha512-n3Sf72TnqK4nw/jziSqEl1qaWPbCRw2CziHH+jdRYvw4J6yeCzsj4jdw8hIntOEeDGTmHVe2w4MVL44PN0GMzg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.24.6", + "@babel/helper-skip-transparent-expression-wrappers": "^7.24.6" + } + }, + "@babel/plugin-transform-function-name": { + "version": "7.24.6", + "resolved": "https://registry.npmmirror.com/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.24.6.tgz", + "integrity": "sha512-sOajCu6V0P1KPljWHKiDq6ymgqB+vfo3isUS4McqW1DZtvSVU2v/wuMhmRmkg3sFoq6GMaUUf8W4WtoSLkOV/Q==", + "dev": true, + "requires": { + "@babel/helper-compilation-targets": "^7.24.6", + "@babel/helper-function-name": "^7.24.6", + "@babel/helper-plugin-utils": "^7.24.6" + } + }, + "@babel/plugin-transform-json-strings": { + "version": "7.24.6", + "resolved": "https://registry.npmmirror.com/@babel/plugin-transform-json-strings/-/plugin-transform-json-strings-7.24.6.tgz", + "integrity": "sha512-Uvgd9p2gUnzYJxVdBLcU0KurF8aVhkmVyMKW4MIY1/BByvs3EBpv45q01o7pRTVmTvtQq5zDlytP3dcUgm7v9w==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.24.6", + "@babel/plugin-syntax-json-strings": "^7.8.3" + } + }, + "@babel/plugin-transform-literals": { + "version": "7.24.6", + "resolved": "https://registry.npmmirror.com/@babel/plugin-transform-literals/-/plugin-transform-literals-7.24.6.tgz", + "integrity": "sha512-f2wHfR2HF6yMj+y+/y07+SLqnOSwRp8KYLpQKOzS58XLVlULhXbiYcygfXQxJlMbhII9+yXDwOUFLf60/TL5tw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.24.6" + } + }, + "@babel/plugin-transform-logical-assignment-operators": { + "version": "7.24.6", + "resolved": "https://registry.npmmirror.com/@babel/plugin-transform-logical-assignment-operators/-/plugin-transform-logical-assignment-operators-7.24.6.tgz", + "integrity": "sha512-EKaWvnezBCMkRIHxMJSIIylzhqK09YpiJtDbr2wsXTwnO0TxyjMUkaw4RlFIZMIS0iDj0KyIg7H7XCguHu/YDA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.24.6", + "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4" + } + }, + "@babel/plugin-transform-member-expression-literals": { + "version": "7.24.6", + "resolved": "https://registry.npmmirror.com/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.24.6.tgz", + "integrity": "sha512-9g8iV146szUo5GWgXpRbq/GALTnY+WnNuRTuRHWWFfWGbP9ukRL0aO/jpu9dmOPikclkxnNsjY8/gsWl6bmZJQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.24.6" + } + }, + "@babel/plugin-transform-modules-amd": { + "version": "7.24.6", + "resolved": "https://registry.npmmirror.com/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.24.6.tgz", + "integrity": "sha512-eAGogjZgcwqAxhyFgqghvoHRr+EYRQPFjUXrTYKBRb5qPnAVxOOglaxc4/byHqjvq/bqO2F3/CGwTHsgKJYHhQ==", + "dev": true, + "requires": { + "@babel/helper-module-transforms": "^7.24.6", + "@babel/helper-plugin-utils": "^7.24.6" + } + }, + "@babel/plugin-transform-modules-commonjs": { + "version": "7.24.6", + "resolved": "https://registry.npmmirror.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.24.6.tgz", + "integrity": "sha512-JEV8l3MHdmmdb7S7Cmx6rbNEjRCgTQMZxllveHO0mx6uiclB0NflCawlQQ6+o5ZrwjUBYPzHm2XoK4wqGVUFuw==", + "dev": true, + "requires": { + "@babel/helper-module-transforms": "^7.24.6", + "@babel/helper-plugin-utils": "^7.24.6", + "@babel/helper-simple-access": "^7.24.6" + } + }, + "@babel/plugin-transform-modules-systemjs": { + "version": "7.24.6", + "resolved": "https://registry.npmmirror.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.24.6.tgz", + "integrity": "sha512-xg1Z0J5JVYxtpX954XqaaAT6NpAY6LtZXvYFCJmGFJWwtlz2EmJoR8LycFRGNE8dBKizGWkGQZGegtkV8y8s+w==", + "dev": true, + "requires": { + "@babel/helper-hoist-variables": "^7.24.6", + "@babel/helper-module-transforms": "^7.24.6", + "@babel/helper-plugin-utils": "^7.24.6", + "@babel/helper-validator-identifier": "^7.24.6" + } + }, + "@babel/plugin-transform-modules-umd": { + "version": "7.24.6", + "resolved": "https://registry.npmmirror.com/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.24.6.tgz", + "integrity": "sha512-esRCC/KsSEUvrSjv5rFYnjZI6qv4R1e/iHQrqwbZIoRJqk7xCvEUiN7L1XrmW5QSmQe3n1XD88wbgDTWLbVSyg==", + "dev": true, + "requires": { + "@babel/helper-module-transforms": "^7.24.6", + "@babel/helper-plugin-utils": "^7.24.6" + } + }, + "@babel/plugin-transform-named-capturing-groups-regex": { + "version": "7.24.6", + "resolved": "https://registry.npmmirror.com/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.24.6.tgz", + "integrity": "sha512-6DneiCiu91wm3YiNIGDWZsl6GfTTbspuj/toTEqLh9d4cx50UIzSdg+T96p8DuT7aJOBRhFyaE9ZvTHkXrXr6Q==", + "dev": true, + "requires": { + "@babel/helper-create-regexp-features-plugin": "^7.24.6", + "@babel/helper-plugin-utils": "^7.24.6" + } + }, + "@babel/plugin-transform-new-target": { + "version": "7.24.6", + "resolved": "https://registry.npmmirror.com/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.24.6.tgz", + "integrity": "sha512-f8liz9JG2Va8A4J5ZBuaSdwfPqN6axfWRK+y66fjKYbwf9VBLuq4WxtinhJhvp1w6lamKUwLG0slK2RxqFgvHA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.24.6" + } + }, + "@babel/plugin-transform-nullish-coalescing-operator": { + "version": "7.24.6", + "resolved": "https://registry.npmmirror.com/@babel/plugin-transform-nullish-coalescing-operator/-/plugin-transform-nullish-coalescing-operator-7.24.6.tgz", + "integrity": "sha512-+QlAiZBMsBK5NqrBWFXCYeXyiU1y7BQ/OYaiPAcQJMomn5Tyg+r5WuVtyEuvTbpV7L25ZSLfE+2E9ywj4FD48A==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.24.6", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3" + } + }, + "@babel/plugin-transform-numeric-separator": { + "version": "7.24.6", + "resolved": "https://registry.npmmirror.com/@babel/plugin-transform-numeric-separator/-/plugin-transform-numeric-separator-7.24.6.tgz", + "integrity": "sha512-6voawq8T25Jvvnc4/rXcWZQKKxUNZcKMS8ZNrjxQqoRFernJJKjE3s18Qo6VFaatG5aiX5JV1oPD7DbJhn0a4Q==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.24.6", + "@babel/plugin-syntax-numeric-separator": "^7.10.4" + } + }, + "@babel/plugin-transform-object-rest-spread": { + "version": "7.24.6", + "resolved": "https://registry.npmmirror.com/@babel/plugin-transform-object-rest-spread/-/plugin-transform-object-rest-spread-7.24.6.tgz", + "integrity": "sha512-OKmi5wiMoRW5Smttne7BwHM8s/fb5JFs+bVGNSeHWzwZkWXWValR1M30jyXo1s/RaqgwwhEC62u4rFH/FBcBPg==", + "dev": true, + "requires": { + "@babel/helper-compilation-targets": "^7.24.6", + "@babel/helper-plugin-utils": "^7.24.6", + "@babel/plugin-syntax-object-rest-spread": "^7.8.3", + "@babel/plugin-transform-parameters": "^7.24.6" + } + }, + "@babel/plugin-transform-object-super": { + "version": "7.24.6", + "resolved": "https://registry.npmmirror.com/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.24.6.tgz", + "integrity": "sha512-N/C76ihFKlZgKfdkEYKtaRUtXZAgK7sOY4h2qrbVbVTXPrKGIi8aww5WGe/+Wmg8onn8sr2ut6FXlsbu/j6JHg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.24.6", + "@babel/helper-replace-supers": "^7.24.6" + } + }, + "@babel/plugin-transform-optional-catch-binding": { + "version": "7.24.6", + "resolved": "https://registry.npmmirror.com/@babel/plugin-transform-optional-catch-binding/-/plugin-transform-optional-catch-binding-7.24.6.tgz", + "integrity": "sha512-L5pZ+b3O1mSzJ71HmxSCmTVd03VOT2GXOigug6vDYJzE5awLI7P1g0wFcdmGuwSDSrQ0L2rDOe/hHws8J1rv3w==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.24.6", + "@babel/plugin-syntax-optional-catch-binding": "^7.8.3" + } + }, + "@babel/plugin-transform-optional-chaining": { + "version": "7.24.6", + "resolved": "https://registry.npmmirror.com/@babel/plugin-transform-optional-chaining/-/plugin-transform-optional-chaining-7.24.6.tgz", + "integrity": "sha512-cHbqF6l1QP11OkYTYQ+hhVx1E017O5ZcSPXk9oODpqhcAD1htsWG2NpHrrhthEO2qZomLK0FXS+u7NfrkF5aOQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.24.6", + "@babel/helper-skip-transparent-expression-wrappers": "^7.24.6", + "@babel/plugin-syntax-optional-chaining": "^7.8.3" + } + }, + "@babel/plugin-transform-parameters": { + "version": "7.24.6", + "resolved": "https://registry.npmmirror.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.24.6.tgz", + "integrity": "sha512-ST7guE8vLV+vI70wmAxuZpIKzVjvFX9Qs8bl5w6tN/6gOypPWUmMQL2p7LJz5E63vEGrDhAiYetniJFyBH1RkA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.24.6" + } + }, + "@babel/plugin-transform-private-methods": { + "version": "7.24.6", + "resolved": "https://registry.npmmirror.com/@babel/plugin-transform-private-methods/-/plugin-transform-private-methods-7.24.6.tgz", + "integrity": "sha512-T9LtDI0BgwXOzyXrvgLTT8DFjCC/XgWLjflczTLXyvxbnSR/gpv0hbmzlHE/kmh9nOvlygbamLKRo6Op4yB6aw==", + "dev": true, + "requires": { + "@babel/helper-create-class-features-plugin": "^7.24.6", + "@babel/helper-plugin-utils": "^7.24.6" + } + }, + "@babel/plugin-transform-private-property-in-object": { + "version": "7.24.6", + "resolved": "https://registry.npmmirror.com/@babel/plugin-transform-private-property-in-object/-/plugin-transform-private-property-in-object-7.24.6.tgz", + "integrity": "sha512-Qu/ypFxCY5NkAnEhCF86Mvg3NSabKsh/TPpBVswEdkGl7+FbsYHy1ziRqJpwGH4thBdQHh8zx+z7vMYmcJ7iaQ==", + "dev": true, + "requires": { + "@babel/helper-annotate-as-pure": "^7.24.6", + "@babel/helper-create-class-features-plugin": "^7.24.6", + "@babel/helper-plugin-utils": "^7.24.6", + "@babel/plugin-syntax-private-property-in-object": "^7.14.5" + } + }, + "@babel/plugin-transform-property-literals": { + "version": "7.24.6", + "resolved": "https://registry.npmmirror.com/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.24.6.tgz", + "integrity": "sha512-oARaglxhRsN18OYsnPTpb8TcKQWDYNsPNmTnx5++WOAsUJ0cSC/FZVlIJCKvPbU4yn/UXsS0551CFKJhN0CaMw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.24.6" + } + }, + "@babel/plugin-transform-regenerator": { + "version": "7.24.6", + "resolved": "https://registry.npmmirror.com/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.24.6.tgz", + "integrity": "sha512-SMDxO95I8WXRtXhTAc8t/NFQUT7VYbIWwJCJgEli9ml4MhqUMh4S6hxgH6SmAC3eAQNWCDJFxcFeEt9w2sDdXg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.24.6", + "regenerator-transform": "^0.15.2" + } + }, + "@babel/plugin-transform-reserved-words": { + "version": "7.24.6", + "resolved": "https://registry.npmmirror.com/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.24.6.tgz", + "integrity": "sha512-DcrgFXRRlK64dGE0ZFBPD5egM2uM8mgfrvTMOSB2yKzOtjpGegVYkzh3s1zZg1bBck3nkXiaOamJUqK3Syk+4A==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.24.6" + } + }, + "@babel/plugin-transform-runtime": { + "version": "7.24.6", + "resolved": "https://registry.npmmirror.com/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.24.6.tgz", + "integrity": "sha512-W3gQydMb0SY99y/2lV0Okx2xg/8KzmZLQsLaiCmwNRl1kKomz14VurEm+2TossUb+sRvBCnGe+wx8KtIgDtBbQ==", + "dev": true, + "requires": { + "@babel/helper-module-imports": "^7.24.6", + "@babel/helper-plugin-utils": "^7.24.6", + "babel-plugin-polyfill-corejs2": "^0.4.10", + "babel-plugin-polyfill-corejs3": "^0.10.1", + "babel-plugin-polyfill-regenerator": "^0.6.1", + "semver": "^6.3.1" + }, + "dependencies": { + "semver": { + "version": "6.3.1", + "resolved": "https://registry.npmmirror.com/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true + } + } + }, + "@babel/plugin-transform-shorthand-properties": { + "version": "7.24.6", + "resolved": "https://registry.npmmirror.com/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.24.6.tgz", + "integrity": "sha512-xnEUvHSMr9eOWS5Al2YPfc32ten7CXdH7Zwyyk7IqITg4nX61oHj+GxpNvl+y5JHjfN3KXE2IV55wAWowBYMVw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.24.6" + } + }, + "@babel/plugin-transform-spread": { + "version": "7.24.6", + "resolved": "https://registry.npmmirror.com/@babel/plugin-transform-spread/-/plugin-transform-spread-7.24.6.tgz", + "integrity": "sha512-h/2j7oIUDjS+ULsIrNZ6/TKG97FgmEk1PXryk/HQq6op4XUUUwif2f69fJrzK0wza2zjCS1xhXmouACaWV5uPA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.24.6", + "@babel/helper-skip-transparent-expression-wrappers": "^7.24.6" + } + }, + "@babel/plugin-transform-sticky-regex": { + "version": "7.24.6", + "resolved": "https://registry.npmmirror.com/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.24.6.tgz", + "integrity": "sha512-fN8OcTLfGmYv7FnDrsjodYBo1DhPL3Pze/9mIIE2MGCT1KgADYIOD7rEglpLHZj8PZlC/JFX5WcD+85FLAQusw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.24.6" + } + }, + "@babel/plugin-transform-template-literals": { + "version": "7.24.6", + "resolved": "https://registry.npmmirror.com/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.24.6.tgz", + "integrity": "sha512-BJbEqJIcKwrqUP+KfUIkxz3q8VzXe2R8Wv8TaNgO1cx+nNavxn/2+H8kp9tgFSOL6wYPPEgFvU6IKS4qoGqhmg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.24.6" + } + }, + "@babel/plugin-transform-typeof-symbol": { + "version": "7.24.6", + "resolved": "https://registry.npmmirror.com/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.24.6.tgz", + "integrity": "sha512-IshCXQ+G9JIFJI7bUpxTE/oA2lgVLAIK8q1KdJNoPXOpvRaNjMySGuvLfBw/Xi2/1lLo953uE8hyYSDW3TSYig==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.24.6" + } + }, + "@babel/plugin-transform-unicode-escapes": { + "version": "7.24.6", + "resolved": "https://registry.npmmirror.com/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.24.6.tgz", + "integrity": "sha512-bKl3xxcPbkQQo5eX9LjjDpU2xYHeEeNQbOhj0iPvetSzA+Tu9q/o5lujF4Sek60CM6MgYvOS/DJuwGbiEYAnLw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.24.6" + } + }, + "@babel/plugin-transform-unicode-property-regex": { + "version": "7.24.6", + "resolved": "https://registry.npmmirror.com/@babel/plugin-transform-unicode-property-regex/-/plugin-transform-unicode-property-regex-7.24.6.tgz", + "integrity": "sha512-8EIgImzVUxy15cZiPii9GvLZwsy7Vxc+8meSlR3cXFmBIl5W5Tn9LGBf7CDKkHj4uVfNXCJB8RsVfnmY61iedA==", + "dev": true, + "requires": { + "@babel/helper-create-regexp-features-plugin": "^7.24.6", + "@babel/helper-plugin-utils": "^7.24.6" + } + }, + "@babel/plugin-transform-unicode-regex": { + "version": "7.24.6", + "resolved": "https://registry.npmmirror.com/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.24.6.tgz", + "integrity": "sha512-pssN6ExsvxaKU638qcWb81RrvvgZom3jDgU/r5xFZ7TONkZGFf4MhI2ltMb8OcQWhHyxgIavEU+hgqtbKOmsPA==", + "dev": true, + "requires": { + "@babel/helper-create-regexp-features-plugin": "^7.24.6", + "@babel/helper-plugin-utils": "^7.24.6" + } + }, + "@babel/plugin-transform-unicode-sets-regex": { + "version": "7.24.6", + "resolved": "https://registry.npmmirror.com/@babel/plugin-transform-unicode-sets-regex/-/plugin-transform-unicode-sets-regex-7.24.6.tgz", + "integrity": "sha512-quiMsb28oXWIDK0gXLALOJRXLgICLiulqdZGOaPPd0vRT7fQp74NtdADAVu+D8s00C+0Xs0MxVP0VKF/sZEUgw==", + "dev": true, + "requires": { + "@babel/helper-create-regexp-features-plugin": "^7.24.6", + "@babel/helper-plugin-utils": "^7.24.6" + } + }, + "@babel/preset-env": { + "version": "7.24.6", + "resolved": "https://registry.npmmirror.com/@babel/preset-env/-/preset-env-7.24.6.tgz", + "integrity": "sha512-CrxEAvN7VxfjOG8JNF2Y/eMqMJbZPZ185amwGUBp8D9USK90xQmv7dLdFSa+VbD7fdIqcy/Mfv7WtzG8+/qxKg==", + "dev": true, + "requires": { + "@babel/compat-data": "^7.24.6", + "@babel/helper-compilation-targets": "^7.24.6", + "@babel/helper-plugin-utils": "^7.24.6", + "@babel/helper-validator-option": "^7.24.6", + "@babel/plugin-bugfix-firefox-class-in-computed-class-key": "^7.24.6", + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": "^7.24.6", + "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": "^7.24.6", + "@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly": "^7.24.6", + "@babel/plugin-proposal-private-property-in-object": "7.21.0-placeholder-for-preset-env.2", + "@babel/plugin-syntax-async-generators": "^7.8.4", + "@babel/plugin-syntax-class-properties": "^7.12.13", + "@babel/plugin-syntax-class-static-block": "^7.14.5", + "@babel/plugin-syntax-dynamic-import": "^7.8.3", + "@babel/plugin-syntax-export-namespace-from": "^7.8.3", + "@babel/plugin-syntax-import-assertions": "^7.24.6", + "@babel/plugin-syntax-import-attributes": "^7.24.6", + "@babel/plugin-syntax-import-meta": "^7.10.4", + "@babel/plugin-syntax-json-strings": "^7.8.3", + "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", + "@babel/plugin-syntax-numeric-separator": "^7.10.4", + "@babel/plugin-syntax-object-rest-spread": "^7.8.3", + "@babel/plugin-syntax-optional-catch-binding": "^7.8.3", + "@babel/plugin-syntax-optional-chaining": "^7.8.3", + "@babel/plugin-syntax-private-property-in-object": "^7.14.5", + "@babel/plugin-syntax-top-level-await": "^7.14.5", + "@babel/plugin-syntax-unicode-sets-regex": "^7.18.6", + "@babel/plugin-transform-arrow-functions": "^7.24.6", + "@babel/plugin-transform-async-generator-functions": "^7.24.6", + "@babel/plugin-transform-async-to-generator": "^7.24.6", + "@babel/plugin-transform-block-scoped-functions": "^7.24.6", + "@babel/plugin-transform-block-scoping": "^7.24.6", + "@babel/plugin-transform-class-properties": "^7.24.6", + "@babel/plugin-transform-class-static-block": "^7.24.6", + "@babel/plugin-transform-classes": "^7.24.6", + "@babel/plugin-transform-computed-properties": "^7.24.6", + "@babel/plugin-transform-destructuring": "^7.24.6", + "@babel/plugin-transform-dotall-regex": "^7.24.6", + "@babel/plugin-transform-duplicate-keys": "^7.24.6", + "@babel/plugin-transform-dynamic-import": "^7.24.6", + "@babel/plugin-transform-exponentiation-operator": "^7.24.6", + "@babel/plugin-transform-export-namespace-from": "^7.24.6", + "@babel/plugin-transform-for-of": "^7.24.6", + "@babel/plugin-transform-function-name": "^7.24.6", + "@babel/plugin-transform-json-strings": "^7.24.6", + "@babel/plugin-transform-literals": "^7.24.6", + "@babel/plugin-transform-logical-assignment-operators": "^7.24.6", + "@babel/plugin-transform-member-expression-literals": "^7.24.6", + "@babel/plugin-transform-modules-amd": "^7.24.6", + "@babel/plugin-transform-modules-commonjs": "^7.24.6", + "@babel/plugin-transform-modules-systemjs": "^7.24.6", + "@babel/plugin-transform-modules-umd": "^7.24.6", + "@babel/plugin-transform-named-capturing-groups-regex": "^7.24.6", + "@babel/plugin-transform-new-target": "^7.24.6", + "@babel/plugin-transform-nullish-coalescing-operator": "^7.24.6", + "@babel/plugin-transform-numeric-separator": "^7.24.6", + "@babel/plugin-transform-object-rest-spread": "^7.24.6", + "@babel/plugin-transform-object-super": "^7.24.6", + "@babel/plugin-transform-optional-catch-binding": "^7.24.6", + "@babel/plugin-transform-optional-chaining": "^7.24.6", + "@babel/plugin-transform-parameters": "^7.24.6", + "@babel/plugin-transform-private-methods": "^7.24.6", + "@babel/plugin-transform-private-property-in-object": "^7.24.6", + "@babel/plugin-transform-property-literals": "^7.24.6", + "@babel/plugin-transform-regenerator": "^7.24.6", + "@babel/plugin-transform-reserved-words": "^7.24.6", + "@babel/plugin-transform-shorthand-properties": "^7.24.6", + "@babel/plugin-transform-spread": "^7.24.6", + "@babel/plugin-transform-sticky-regex": "^7.24.6", + "@babel/plugin-transform-template-literals": "^7.24.6", + "@babel/plugin-transform-typeof-symbol": "^7.24.6", + "@babel/plugin-transform-unicode-escapes": "^7.24.6", + "@babel/plugin-transform-unicode-property-regex": "^7.24.6", + "@babel/plugin-transform-unicode-regex": "^7.24.6", + "@babel/plugin-transform-unicode-sets-regex": "^7.24.6", + "@babel/preset-modules": "0.1.6-no-external-plugins", + "babel-plugin-polyfill-corejs2": "^0.4.10", + "babel-plugin-polyfill-corejs3": "^0.10.4", + "babel-plugin-polyfill-regenerator": "^0.6.1", + "core-js-compat": "^3.31.0", + "semver": "^6.3.1" + }, + "dependencies": { + "semver": { + "version": "6.3.1", + "resolved": "https://registry.npmmirror.com/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true + } + } + }, + "@babel/preset-modules": { + "version": "0.1.6-no-external-plugins", + "resolved": "https://registry.npmmirror.com/@babel/preset-modules/-/preset-modules-0.1.6-no-external-plugins.tgz", + "integrity": "sha512-HrcgcIESLm9aIR842yhJ5RWan/gebQUJ6E/E5+rf0y9o6oj7w0Br+sWuL6kEQ/o/AdfvR1Je9jG18/gnpwjEyA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/types": "^7.4.4", + "esutils": "^2.0.2" + } + }, + "@babel/regjsgen": { + "version": "0.8.0", + "resolved": "https://registry.npmmirror.com/@babel/regjsgen/-/regjsgen-0.8.0.tgz", + "integrity": "sha512-x/rqGMdzj+fWZvCOYForTghzbtqPDZ5gPwaoNGHdgDfF2QA/XZbCBp4Moo5scrkAMPhB7z26XM/AaHuIJdgauA==", + "dev": true + }, + "@babel/runtime": { + "version": "7.24.6", + "resolved": "https://registry.npmmirror.com/@babel/runtime/-/runtime-7.24.6.tgz", + "integrity": "sha512-Ja18XcETdEl5mzzACGd+DKgaGJzPTCow7EglgwTmHdwokzDFYh/MHua6lU6DV/hjF2IaOJ4oX2nqnjG7RElKOw==", + "requires": { + "regenerator-runtime": "^0.14.0" + } + }, + "@babel/template": { + "version": "7.24.6", + "resolved": "https://registry.npmmirror.com/@babel/template/-/template-7.24.6.tgz", + "integrity": "sha512-3vgazJlLwNXi9jhrR1ef8qiB65L1RK90+lEQwv4OxveHnqC3BfmnHdgySwRLzf6akhlOYenT+b7AfWq+a//AHw==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.24.6", + "@babel/parser": "^7.24.6", + "@babel/types": "^7.24.6" + } + }, + "@babel/traverse": { + "version": "7.24.6", + "resolved": "https://registry.npmmirror.com/@babel/traverse/-/traverse-7.24.6.tgz", + "integrity": "sha512-OsNjaJwT9Zn8ozxcfoBc+RaHdj3gFmCmYoQLUII1o6ZrUwku0BMg80FoOTPx+Gi6XhcQxAYE4xyjPTo4SxEQqw==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.24.6", + "@babel/generator": "^7.24.6", + "@babel/helper-environment-visitor": "^7.24.6", + "@babel/helper-function-name": "^7.24.6", + "@babel/helper-hoist-variables": "^7.24.6", + "@babel/helper-split-export-declaration": "^7.24.6", + "@babel/parser": "^7.24.6", + "@babel/types": "^7.24.6", + "debug": "^4.3.1", + "globals": "^11.1.0" + } + }, + "@babel/types": { + "version": "7.24.6", + "resolved": "https://registry.npmmirror.com/@babel/types/-/types-7.24.6.tgz", + "integrity": "sha512-WaMsgi6Q8zMgMth93GvWPXkhAIEobfsIkLTacoVZoK1J0CevIPGYY2Vo5YvJGqyHqXM6P4ppOYGsIRU8MM9pFQ==", + "dev": true, + "requires": { + "@babel/helper-string-parser": "^7.24.6", + "@babel/helper-validator-identifier": "^7.24.6", + "to-fast-properties": "^2.0.0" + } + }, + "@eslint/eslintrc": { + "version": "0.2.2", + "resolved": "https://registry.npmmirror.com/@eslint/eslintrc/-/eslintrc-0.2.2.tgz", + "integrity": "sha512-EfB5OHNYp1F4px/LI/FEnGylop7nOqkQ1LRzCM0KccA2U8tvV8w01KBv37LbO7nW4H+YhKyo2LcJhRwjjV17QQ==", + "dev": true, + "requires": { + "ajv": "^6.12.4", + "debug": "^4.1.1", + "espree": "^7.3.0", + "globals": "^12.1.0", + "ignore": "^4.0.6", + "import-fresh": "^3.2.1", + "js-yaml": "^3.13.1", + "lodash": "^4.17.19", + "minimatch": "^3.0.4", + "strip-json-comments": "^3.1.1" + }, + "dependencies": { + "globals": { + "version": "12.4.0", + "resolved": "https://registry.npmmirror.com/globals/-/globals-12.4.0.tgz", + "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", + "dev": true, + "requires": { + "type-fest": "^0.8.1" + } + }, + "import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmmirror.com/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "dev": true, + "requires": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + } + }, + "resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmmirror.com/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true + }, + "type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmmirror.com/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "dev": true + } + } + }, + "@gar/promisify": { + "version": "1.1.3", + "resolved": "https://registry.npmmirror.com/@gar/promisify/-/promisify-1.1.3.tgz", + "integrity": "sha512-k2Ty1JcVojjJFwrg/ThKi2ujJ7XNLYaFGNB/bWT9wGR+oSMJHMa5w+CUq6p/pVrKeNNgA7pCqEcjSnHVoqJQFw==", + "dev": true + }, + "@hapi/address": { + "version": "2.1.4", + "resolved": "https://registry.npmmirror.com/@hapi/address/-/address-2.1.4.tgz", + "integrity": "sha512-QD1PhQk+s31P1ixsX0H0Suoupp3VMXzIVMSwobR3F3MSUO2YCV0B7xqLcUw/Bh8yuvd3LhpyqLQWTNcRmp6IdQ==", + "dev": true + }, + "@hapi/bourne": { + "version": "1.3.2", + "resolved": "https://registry.npmmirror.com/@hapi/bourne/-/bourne-1.3.2.tgz", + "integrity": "sha512-1dVNHT76Uu5N3eJNTYcvxee+jzX4Z9lfciqRRHCU27ihbUcYi+iSc2iml5Ke1LXe1SyJCLA0+14Jh4tXJgOppA==", + "dev": true + }, + "@hapi/hoek": { + "version": "8.5.1", + "resolved": "https://registry.npmmirror.com/@hapi/hoek/-/hoek-8.5.1.tgz", + "integrity": "sha512-yN7kbciD87WzLGc5539Tn0sApjyiGHAJgKvG9W8C7O+6c7qmoQMfVs0W4bX17eqz6C78QJqqFrtgdK5EWf6Qow==", + "dev": true + }, + "@hapi/joi": { + "version": "15.1.1", + "resolved": "https://registry.npmmirror.com/@hapi/joi/-/joi-15.1.1.tgz", + "integrity": "sha512-entf8ZMOK8sc+8YfeOlM8pCfg3b5+WZIKBfUaaJT8UsjAAPjartzxIYm3TIbjvA4u+u++KbcXD38k682nVHDAQ==", + "dev": true, + "requires": { + "@hapi/address": "2.x.x", + "@hapi/bourne": "1.x.x", + "@hapi/hoek": "8.x.x", + "@hapi/topo": "3.x.x" + } + }, + "@hapi/topo": { + "version": "3.1.6", + "resolved": "https://registry.npmmirror.com/@hapi/topo/-/topo-3.1.6.tgz", + "integrity": "sha512-tAag0jEcjwH+P2quUfipd7liWCNX2F8NvYjQp2wtInsZxnMlypdw0FtAOLxtvvkO+GSRRbmNi8m/5y42PQJYCQ==", + "dev": true, + "requires": { + "@hapi/hoek": "^8.3.0" + } + }, + "@intervolga/optimize-cssnano-plugin": { + "version": "1.0.6", + "resolved": "https://registry.npmmirror.com/@intervolga/optimize-cssnano-plugin/-/optimize-cssnano-plugin-1.0.6.tgz", + "integrity": "sha512-zN69TnSr0viRSU6cEDIcuPcP67QcpQ6uHACg58FiN9PDrU6SLyGW3MR4tiISbYxy1kDWAVPwD+XwQTWE5cigAA==", + "dev": true, + "requires": { + "cssnano": "^4.0.0", + "cssnano-preset-default": "^4.0.0", + "postcss": "^7.0.0" + }, + "dependencies": { + "picocolors": { + "version": "0.2.1", + "resolved": "https://registry.npmmirror.com/picocolors/-/picocolors-0.2.1.tgz", + "integrity": "sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA==", + "dev": true + }, + "postcss": { + "version": "7.0.39", + "resolved": "https://registry.npmmirror.com/postcss/-/postcss-7.0.39.tgz", + "integrity": "sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA==", + "dev": true, + "requires": { + "picocolors": "^0.2.1", + "source-map": "^0.6.1" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmmirror.com/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "@jridgewell/gen-mapping": { + "version": "0.3.5", + "resolved": "https://registry.npmmirror.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", + "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", + "dev": true, + "requires": { + "@jridgewell/set-array": "^1.2.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmmirror.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "dev": true + }, + "@jridgewell/set-array": { + "version": "1.2.1", + "resolved": "https://registry.npmmirror.com/@jridgewell/set-array/-/set-array-1.2.1.tgz", + "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", + "dev": true + }, + "@jridgewell/sourcemap-codec": { + "version": "1.4.15", + "resolved": "https://registry.npmmirror.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", + "dev": true + }, + "@jridgewell/trace-mapping": { + "version": "0.3.25", + "resolved": "https://registry.npmmirror.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", + "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", + "dev": true, + "requires": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "@mrmlnc/readdir-enhanced": { + "version": "2.2.1", + "resolved": "https://registry.npmmirror.com/@mrmlnc/readdir-enhanced/-/readdir-enhanced-2.2.1.tgz", + "integrity": "sha512-bPHp6Ji8b41szTOcaP63VlnbbO5Ny6dwAATtY6JTjh5N2OLrb5Qk/Th5cRkRQhkWCt+EJsYrNB0MiL+Gpn6e3g==", + "dev": true, + "requires": { + "call-me-maybe": "^1.0.1", + "glob-to-regexp": "^0.3.0" + } + }, + "@node-ipc/js-queue": { + "version": "2.0.3", + "resolved": "https://registry.npmmirror.com/@node-ipc/js-queue/-/js-queue-2.0.3.tgz", + "integrity": "sha512-fL1wpr8hhD5gT2dA1qifeVaoDFlQR5es8tFuKqjHX+kdOtdNHnxkVZbtIrR2rxnMFvehkjaZRNV2H/gPXlb0hw==", + "dev": true, + "requires": { + "easy-stack": "1.0.1" + } + }, + "@nodelib/fs.stat": { + "version": "1.1.3", + "resolved": "https://registry.npmmirror.com/@nodelib/fs.stat/-/fs.stat-1.1.3.tgz", + "integrity": "sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw==", + "dev": true + }, + "@npmcli/fs": { + "version": "1.1.1", + "resolved": "https://registry.npmmirror.com/@npmcli/fs/-/fs-1.1.1.tgz", + "integrity": "sha512-8KG5RD0GVP4ydEzRn/I4BNDuxDtqVbOdm8675T49OIG/NGhaK0pjPX7ZcDlvKYbA+ulvVK3ztfcF4uBdOxuJbQ==", + "dev": true, + "requires": { + "@gar/promisify": "^1.0.1", + "semver": "^7.3.5" + }, + "dependencies": { + "semver": { + "version": "7.6.2", + "resolved": "https://registry.npmmirror.com/semver/-/semver-7.6.2.tgz", + "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", + "dev": true + } + } + }, + "@npmcli/move-file": { + "version": "1.1.2", + "resolved": "https://registry.npmmirror.com/@npmcli/move-file/-/move-file-1.1.2.tgz", + "integrity": "sha512-1SUf/Cg2GzGDyaf15aR9St9TWlb+XvbZXWpDx8YKs7MLzMH/BCeopv+y9vzrzgkfykCGuWOlSu3mZhj2+FQcrg==", + "dev": true, + "requires": { + "mkdirp": "^1.0.4", + "rimraf": "^3.0.2" + }, + "dependencies": { + "rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmmirror.com/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + } + } + }, + "@riophae/vue-treeselect": { + "version": "0.4.0", + "resolved": "https://registry.npmmirror.com/@riophae/vue-treeselect/-/vue-treeselect-0.4.0.tgz", + "integrity": "sha512-J4atYmBqXQmiPFK/0B5sXKjtnGc21mBJEiyKIDZwk0Q9XuynVFX6IJ4EpaLmUgL5Tve7HAS7wkiGGSti6Uaxcg==", + "requires": { + "@babel/runtime": "^7.3.1", + "babel-helper-vue-jsx-merge-props": "^2.0.3", + "easings-css": "^1.0.0", + "fuzzysearch": "^1.0.3", + "is-promise": "^2.1.0", + "lodash": "^4.0.0", + "material-colors": "^1.2.6", + "watch-size": "^2.0.0" + } + }, + "@soda/friendly-errors-webpack-plugin": { + "version": "1.8.1", + "resolved": "https://registry.npmmirror.com/@soda/friendly-errors-webpack-plugin/-/friendly-errors-webpack-plugin-1.8.1.tgz", + "integrity": "sha512-h2ooWqP8XuFqTXT+NyAFbrArzfQA7R6HTezADrvD9Re8fxMLTPPniLdqVTdDaO0eIoLaAwKT+d6w+5GeTk7Vbg==", + "dev": true, + "requires": { + "chalk": "^3.0.0", + "error-stack-parser": "^2.0.6", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmmirror.com/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "3.0.0", + "resolved": "https://registry.npmmirror.com/chalk/-/chalk-3.0.0.tgz", + "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmmirror.com/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmmirror.com/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmmirror.com/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmmirror.com/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "@soda/get-current-script": { + "version": "1.0.2", + "resolved": "https://registry.npmmirror.com/@soda/get-current-script/-/get-current-script-1.0.2.tgz", + "integrity": "sha512-T7VNNlYVM1SgQ+VsMYhnDkcGmWhQdL0bDyGm5TlQ3GBXnJscEClUUOKduWTmm2zCnvNLC1hc3JpuXjs/nFOc5w==", + "dev": true + }, + "@types/glob": { + "version": "7.2.0", + "resolved": "https://registry.npmmirror.com/@types/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==", + "dev": true, + "requires": { + "@types/minimatch": "*", + "@types/node": "*" + } + }, + "@types/json-schema": { + "version": "7.0.15", + "resolved": "https://registry.npmmirror.com/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", + "dev": true + }, + "@types/minimatch": { + "version": "5.1.2", + "resolved": "https://registry.npmmirror.com/@types/minimatch/-/minimatch-5.1.2.tgz", + "integrity": "sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA==", + "dev": true + }, + "@types/node": { + "version": "20.12.12", + "resolved": "https://registry.npmmirror.com/@types/node/-/node-20.12.12.tgz", + "integrity": "sha512-eWLDGF/FOSPtAvEqeRAQ4C8LSA7M1I7i0ky1I8U7kD1J5ITyW3AsRhQrKVoWf5pFKZ2kILsEGJhsI9r93PYnOw==", + "dev": true, + "requires": { + "undici-types": "~5.26.4" + } + }, + "@types/normalize-package-data": { + "version": "2.4.4", + "resolved": "https://registry.npmmirror.com/@types/normalize-package-data/-/normalize-package-data-2.4.4.tgz", + "integrity": "sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==", + "dev": true + }, + "@types/parse-json": { + "version": "4.0.2", + "resolved": "https://registry.npmmirror.com/@types/parse-json/-/parse-json-4.0.2.tgz", + "integrity": "sha512-dISoDXWWQwUquiKsyZ4Ng+HX2KsPL7LyHKHQwgGFEA3IaKac4Obd+h2a/a6waisAoepJlBcx9paWqjA8/HVjCw==", + "dev": true + }, + "@types/q": { + "version": "1.5.8", + "resolved": "https://registry.npmmirror.com/@types/q/-/q-1.5.8.tgz", + "integrity": "sha512-hroOstUScF6zhIi+5+x0dzqrHA1EJi+Irri6b1fxolMTqqHIV/Cg77EtnQcZqZCu8hR3mX2BzIxN4/GzI68Kfw==", + "dev": true + }, + "@vue/babel-helper-vue-jsx-merge-props": { + "version": "1.4.0", + "resolved": "https://registry.npmmirror.com/@vue/babel-helper-vue-jsx-merge-props/-/babel-helper-vue-jsx-merge-props-1.4.0.tgz", + "integrity": "sha512-JkqXfCkUDp4PIlFdDQ0TdXoIejMtTHP67/pvxlgeY+u5k3LEdKuWZ3LK6xkxo52uDoABIVyRwqVkfLQJhk7VBA==", + "dev": true + }, + "@vue/babel-helper-vue-transform-on": { + "version": "1.2.2", + "resolved": "https://registry.npmmirror.com/@vue/babel-helper-vue-transform-on/-/babel-helper-vue-transform-on-1.2.2.tgz", + "integrity": "sha512-nOttamHUR3YzdEqdM/XXDyCSdxMA9VizUKoroLX6yTyRtggzQMHXcmwh8a7ZErcJttIBIc9s68a1B8GZ+Dmvsw==", + "dev": true + }, + "@vue/babel-plugin-jsx": { + "version": "1.2.2", + "resolved": "https://registry.npmmirror.com/@vue/babel-plugin-jsx/-/babel-plugin-jsx-1.2.2.tgz", + "integrity": "sha512-nYTkZUVTu4nhP199UoORePsql0l+wj7v/oyQjtThUVhJl1U+6qHuoVhIvR3bf7eVKjbCK+Cs2AWd7mi9Mpz9rA==", + "dev": true, + "requires": { + "@babel/helper-module-imports": "~7.22.15", + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/plugin-syntax-jsx": "^7.23.3", + "@babel/template": "^7.23.9", + "@babel/traverse": "^7.23.9", + "@babel/types": "^7.23.9", + "@vue/babel-helper-vue-transform-on": "1.2.2", + "@vue/babel-plugin-resolve-type": "1.2.2", + "camelcase": "^6.3.0", + "html-tags": "^3.3.1", + "svg-tags": "^1.0.0" + }, + "dependencies": { + "@babel/helper-module-imports": { + "version": "7.22.15", + "resolved": "https://registry.npmmirror.com/@babel/helper-module-imports/-/helper-module-imports-7.22.15.tgz", + "integrity": "sha512-0pYVBnDKZO2fnSPCrgM/6WMc7eS20Fbok+0r88fp+YtWVLZrp4CkafFGIp+W0VKw4a22sgebPT99y+FDNMdP4w==", + "dev": true, + "requires": { + "@babel/types": "^7.22.15" + } + } + } + }, + "@vue/babel-plugin-resolve-type": { + "version": "1.2.2", + "resolved": "https://registry.npmmirror.com/@vue/babel-plugin-resolve-type/-/babel-plugin-resolve-type-1.2.2.tgz", + "integrity": "sha512-EntyroPwNg5IPVdUJupqs0CFzuf6lUrVvCspmv2J1FITLeGnUCuoGNNk78dgCusxEiYj6RMkTJflGSxk5aIC4A==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.23.5", + "@babel/helper-module-imports": "~7.22.15", + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/parser": "^7.23.9", + "@vue/compiler-sfc": "^3.4.15" + }, + "dependencies": { + "@babel/helper-module-imports": { + "version": "7.22.15", + "resolved": "https://registry.npmmirror.com/@babel/helper-module-imports/-/helper-module-imports-7.22.15.tgz", + "integrity": "sha512-0pYVBnDKZO2fnSPCrgM/6WMc7eS20Fbok+0r88fp+YtWVLZrp4CkafFGIp+W0VKw4a22sgebPT99y+FDNMdP4w==", + "dev": true, + "requires": { + "@babel/types": "^7.22.15" + } + } + } + }, + "@vue/babel-plugin-transform-vue-jsx": { + "version": "1.4.0", + "resolved": "https://registry.npmmirror.com/@vue/babel-plugin-transform-vue-jsx/-/babel-plugin-transform-vue-jsx-1.4.0.tgz", + "integrity": "sha512-Fmastxw4MMx0vlgLS4XBX0XiBbUFzoMGeVXuMV08wyOfXdikAFqBTuYPR0tlk+XskL19EzHc39SgjrPGY23JnA==", + "dev": true, + "requires": { + "@babel/helper-module-imports": "^7.0.0", + "@babel/plugin-syntax-jsx": "^7.2.0", + "@vue/babel-helper-vue-jsx-merge-props": "^1.4.0", + "html-tags": "^2.0.0", + "lodash.kebabcase": "^4.1.1", + "svg-tags": "^1.0.0" + }, + "dependencies": { + "html-tags": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/html-tags/-/html-tags-2.0.0.tgz", + "integrity": "sha512-+Il6N8cCo2wB/Vd3gqy/8TZhTD3QvcVeQLCnZiGkGCH3JP28IgGAY41giccp2W4R3jfyJPAP318FQTa1yU7K7g==", + "dev": true + } + } + }, + "@vue/babel-preset-app": { + "version": "4.5.19", + "resolved": "https://registry.npmmirror.com/@vue/babel-preset-app/-/babel-preset-app-4.5.19.tgz", + "integrity": "sha512-VCNRiAt2P/bLo09rYt3DLe6xXUMlhJwrvU18Ddd/lYJgC7s8+wvhgYs+MTx4OiAXdu58drGwSBO9SPx7C6J82Q==", + "dev": true, + "requires": { + "@babel/core": "^7.11.0", + "@babel/helper-compilation-targets": "^7.9.6", + "@babel/helper-module-imports": "^7.8.3", + "@babel/plugin-proposal-class-properties": "^7.8.3", + "@babel/plugin-proposal-decorators": "^7.8.3", + "@babel/plugin-syntax-dynamic-import": "^7.8.3", + "@babel/plugin-syntax-jsx": "^7.8.3", + "@babel/plugin-transform-runtime": "^7.11.0", + "@babel/preset-env": "^7.11.0", + "@babel/runtime": "^7.11.0", + "@vue/babel-plugin-jsx": "^1.0.3", + "@vue/babel-preset-jsx": "^1.2.4", + "babel-plugin-dynamic-import-node": "^2.3.3", + "core-js": "^3.6.5", + "core-js-compat": "^3.6.5", + "semver": "^6.1.0" + }, + "dependencies": { + "semver": { + "version": "6.3.1", + "resolved": "https://registry.npmmirror.com/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true + } + } + }, + "@vue/babel-preset-jsx": { + "version": "1.4.0", + "resolved": "https://registry.npmmirror.com/@vue/babel-preset-jsx/-/babel-preset-jsx-1.4.0.tgz", + "integrity": "sha512-QmfRpssBOPZWL5xw7fOuHNifCQcNQC1PrOo/4fu6xlhlKJJKSA3HqX92Nvgyx8fqHZTUGMPHmFA+IDqwXlqkSA==", + "dev": true, + "requires": { + "@vue/babel-helper-vue-jsx-merge-props": "^1.4.0", + "@vue/babel-plugin-transform-vue-jsx": "^1.4.0", + "@vue/babel-sugar-composition-api-inject-h": "^1.4.0", + "@vue/babel-sugar-composition-api-render-instance": "^1.4.0", + "@vue/babel-sugar-functional-vue": "^1.4.0", + "@vue/babel-sugar-inject-h": "^1.4.0", + "@vue/babel-sugar-v-model": "^1.4.0", + "@vue/babel-sugar-v-on": "^1.4.0" + } + }, + "@vue/babel-sugar-composition-api-inject-h": { + "version": "1.4.0", + "resolved": "https://registry.npmmirror.com/@vue/babel-sugar-composition-api-inject-h/-/babel-sugar-composition-api-inject-h-1.4.0.tgz", + "integrity": "sha512-VQq6zEddJHctnG4w3TfmlVp5FzDavUSut/DwR0xVoe/mJKXyMcsIibL42wPntozITEoY90aBV0/1d2KjxHU52g==", + "dev": true, + "requires": { + "@babel/plugin-syntax-jsx": "^7.2.0" + } + }, + "@vue/babel-sugar-composition-api-render-instance": { + "version": "1.4.0", + "resolved": "https://registry.npmmirror.com/@vue/babel-sugar-composition-api-render-instance/-/babel-sugar-composition-api-render-instance-1.4.0.tgz", + "integrity": "sha512-6ZDAzcxvy7VcnCjNdHJ59mwK02ZFuP5CnucloidqlZwVQv5CQLijc3lGpR7MD3TWFi78J7+a8J56YxbCtHgT9Q==", + "dev": true, + "requires": { + "@babel/plugin-syntax-jsx": "^7.2.0" + } + }, + "@vue/babel-sugar-functional-vue": { + "version": "1.4.0", + "resolved": "https://registry.npmmirror.com/@vue/babel-sugar-functional-vue/-/babel-sugar-functional-vue-1.4.0.tgz", + "integrity": "sha512-lTEB4WUFNzYt2In6JsoF9sAYVTo84wC4e+PoZWSgM6FUtqRJz7wMylaEhSRgG71YF+wfLD6cc9nqVeXN2rwBvw==", + "dev": true, + "requires": { + "@babel/plugin-syntax-jsx": "^7.2.0" + } + }, + "@vue/babel-sugar-inject-h": { + "version": "1.4.0", + "resolved": "https://registry.npmmirror.com/@vue/babel-sugar-inject-h/-/babel-sugar-inject-h-1.4.0.tgz", + "integrity": "sha512-muwWrPKli77uO2fFM7eA3G1lAGnERuSz2NgAxuOLzrsTlQl8W4G+wwbM4nB6iewlKbwKRae3nL03UaF5ffAPMA==", + "dev": true, + "requires": { + "@babel/plugin-syntax-jsx": "^7.2.0" + } + }, + "@vue/babel-sugar-v-model": { + "version": "1.4.0", + "resolved": "https://registry.npmmirror.com/@vue/babel-sugar-v-model/-/babel-sugar-v-model-1.4.0.tgz", + "integrity": "sha512-0t4HGgXb7WHYLBciZzN5s0Hzqan4Ue+p/3FdQdcaHAb7s5D9WZFGoSxEZHrR1TFVZlAPu1bejTKGeAzaaG3NCQ==", + "dev": true, + "requires": { + "@babel/plugin-syntax-jsx": "^7.2.0", + "@vue/babel-helper-vue-jsx-merge-props": "^1.4.0", + "@vue/babel-plugin-transform-vue-jsx": "^1.4.0", + "camelcase": "^5.0.0", + "html-tags": "^2.0.0", + "svg-tags": "^1.0.0" + }, + "dependencies": { + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmmirror.com/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + }, + "html-tags": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/html-tags/-/html-tags-2.0.0.tgz", + "integrity": "sha512-+Il6N8cCo2wB/Vd3gqy/8TZhTD3QvcVeQLCnZiGkGCH3JP28IgGAY41giccp2W4R3jfyJPAP318FQTa1yU7K7g==", + "dev": true + } + } + }, + "@vue/babel-sugar-v-on": { + "version": "1.4.0", + "resolved": "https://registry.npmmirror.com/@vue/babel-sugar-v-on/-/babel-sugar-v-on-1.4.0.tgz", + "integrity": "sha512-m+zud4wKLzSKgQrWwhqRObWzmTuyzl6vOP7024lrpeJM4x2UhQtRDLgYjXAw9xBXjCwS0pP9kXjg91F9ZNo9JA==", + "dev": true, + "requires": { + "@babel/plugin-syntax-jsx": "^7.2.0", + "@vue/babel-plugin-transform-vue-jsx": "^1.4.0", + "camelcase": "^5.0.0" + }, + "dependencies": { + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmmirror.com/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + } + } + }, + "@vue/cli-overlay": { + "version": "4.5.19", + "resolved": "https://registry.npmmirror.com/@vue/cli-overlay/-/cli-overlay-4.5.19.tgz", + "integrity": "sha512-GdxvNSmOw7NHIazCO8gTK+xZbaOmScTtxj6eHVeMbYpDYVPJ+th3VMLWNpw/b6uOjwzzcyKlA5dRQ1DAb+gF/g==", + "dev": true + }, + "@vue/cli-plugin-babel": { + "version": "4.4.6", + "resolved": "https://registry.npmmirror.com/@vue/cli-plugin-babel/-/cli-plugin-babel-4.4.6.tgz", + "integrity": "sha512-9cX9mN+4DIbcqw3rV6UBOA0t5zikIkrBLQloUzsOBOu5Xb7/UoD7inInFj7bnyHUflr5LqbdWJ+etCQcWAIIXA==", + "dev": true, + "requires": { + "@babel/core": "^7.9.6", + "@vue/babel-preset-app": "^4.4.6", + "@vue/cli-shared-utils": "^4.4.6", + "babel-loader": "^8.1.0", + "cache-loader": "^4.1.0", + "thread-loader": "^2.1.3", + "webpack": "^4.0.0" + } + }, + "@vue/cli-plugin-eslint": { + "version": "4.4.6", + "resolved": "https://registry.npmmirror.com/@vue/cli-plugin-eslint/-/cli-plugin-eslint-4.4.6.tgz", + "integrity": "sha512-3a9rVpOKPQsDgAlRkhmBMHboGobivG/47BbQGE66Z8YJxrgF/AWikP3Jy67SmxtszRkyiWfw4aJFRV9r3MzffQ==", + "dev": true, + "requires": { + "@vue/cli-shared-utils": "^4.4.6", + "eslint-loader": "^2.2.1", + "globby": "^9.2.0", + "inquirer": "^7.1.0", + "webpack": "^4.0.0", + "yorkie": "^2.0.0" + } + }, + "@vue/cli-plugin-router": { + "version": "4.5.19", + "resolved": "https://registry.npmmirror.com/@vue/cli-plugin-router/-/cli-plugin-router-4.5.19.tgz", + "integrity": "sha512-3icGzH1IbVYmMMsOwYa0lal/gtvZLebFXdE5hcQJo2mnTwngXGMTyYAzL56EgHBPjbMmRpyj6Iw9k4aVInVX6A==", + "dev": true, + "requires": { + "@vue/cli-shared-utils": "^4.5.19" + } + }, + "@vue/cli-plugin-vuex": { + "version": "4.5.19", + "resolved": "https://registry.npmmirror.com/@vue/cli-plugin-vuex/-/cli-plugin-vuex-4.5.19.tgz", + "integrity": "sha512-DUmfdkG3pCdkP7Iznd87RfE9Qm42mgp2hcrNcYQYSru1W1gX2dG/JcW8bxmeGSa06lsxi9LEIc/QD1yPajSCZw==", + "dev": true + }, + "@vue/cli-service": { + "version": "4.4.6", + "resolved": "https://registry.npmmirror.com/@vue/cli-service/-/cli-service-4.4.6.tgz", + "integrity": "sha512-k5OFGh2NnvRymCyq9DfBiNJvECUuun3pl5KMm3557IZyA5E5csv+RHoSW3dX8HHe0zXq18g52VswP1llvR9POw==", + "dev": true, + "requires": { + "@intervolga/optimize-cssnano-plugin": "^1.0.5", + "@soda/friendly-errors-webpack-plugin": "^1.7.1", + "@soda/get-current-script": "^1.0.0", + "@vue/cli-overlay": "^4.4.6", + "@vue/cli-plugin-router": "^4.4.6", + "@vue/cli-plugin-vuex": "^4.4.6", + "@vue/cli-shared-utils": "^4.4.6", + "@vue/component-compiler-utils": "^3.1.2", + "@vue/preload-webpack-plugin": "^1.1.0", + "@vue/web-component-wrapper": "^1.2.0", + "acorn": "^7.2.0", + "acorn-walk": "^7.1.1", + "address": "^1.1.2", + "autoprefixer": "^9.8.0", + "browserslist": "^4.12.0", + "cache-loader": "^4.1.0", + "case-sensitive-paths-webpack-plugin": "^2.3.0", + "cli-highlight": "^2.1.4", + "clipboardy": "^2.3.0", + "cliui": "^6.0.0", + "copy-webpack-plugin": "^5.1.1", + "css-loader": "^3.5.3", + "cssnano": "^4.1.10", + "debug": "^4.1.1", + "default-gateway": "^5.0.5", + "dotenv": "^8.2.0", + "dotenv-expand": "^5.1.0", + "file-loader": "^4.2.0", + "fs-extra": "^7.0.1", + "globby": "^9.2.0", + "hash-sum": "^2.0.0", + "html-webpack-plugin": "^3.2.0", + "launch-editor-middleware": "^2.2.1", + "lodash.defaultsdeep": "^4.6.1", + "lodash.mapvalues": "^4.6.0", + "lodash.transform": "^4.6.0", + "mini-css-extract-plugin": "^0.9.0", + "minimist": "^1.2.5", + "pnp-webpack-plugin": "^1.6.4", + "portfinder": "^1.0.26", + "postcss-loader": "^3.0.0", + "ssri": "^7.1.0", + "terser-webpack-plugin": "^2.3.6", + "thread-loader": "^2.1.3", + "url-loader": "^2.2.0", + "vue-loader": "^15.9.2", + "vue-style-loader": "^4.1.2", + "webpack": "^4.0.0", + "webpack-bundle-analyzer": "^3.8.0", + "webpack-chain": "^6.4.0", + "webpack-dev-server": "^3.11.0", + "webpack-merge": "^4.2.2" + }, + "dependencies": { + "acorn": { + "version": "7.4.1", + "resolved": "https://registry.npmmirror.com/acorn/-/acorn-7.4.1.tgz", + "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", + "dev": true + }, + "cacache": { + "version": "13.0.1", + "resolved": "https://registry.npmmirror.com/cacache/-/cacache-13.0.1.tgz", + "integrity": "sha512-5ZvAxd05HDDU+y9BVvcqYu2LLXmPnQ0hW62h32g4xBTgL/MppR4/04NHfj/ycM2y6lmTnbw6HVi+1eN0Psba6w==", + "dev": true, + "requires": { + "chownr": "^1.1.2", + "figgy-pudding": "^3.5.1", + "fs-minipass": "^2.0.0", + "glob": "^7.1.4", + "graceful-fs": "^4.2.2", + "infer-owner": "^1.0.4", + "lru-cache": "^5.1.1", + "minipass": "^3.0.0", + "minipass-collect": "^1.0.2", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.2", + "mkdirp": "^0.5.1", + "move-concurrently": "^1.0.1", + "p-map": "^3.0.0", + "promise-inflight": "^1.0.1", + "rimraf": "^2.7.1", + "ssri": "^7.0.0", + "unique-filename": "^1.1.1" + } + }, + "lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmmirror.com/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, + "requires": { + "yallist": "^3.0.2" + } + }, + "mkdirp": { + "version": "0.5.6", + "resolved": "https://registry.npmmirror.com/mkdirp/-/mkdirp-0.5.6.tgz", + "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", + "dev": true, + "requires": { + "minimist": "^1.2.6" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmmirror.com/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "ssri": { + "version": "7.1.1", + "resolved": "https://registry.npmmirror.com/ssri/-/ssri-7.1.1.tgz", + "integrity": "sha512-w+daCzXN89PseTL99MkA+fxJEcU3wfaE/ah0i0lnOlpG1CYLJ2ZjzEry68YBKfLs4JfoTShrTEsJkAZuNZ/stw==", + "dev": true, + "requires": { + "figgy-pudding": "^3.5.1", + "minipass": "^3.1.1" + } + }, + "terser-webpack-plugin": { + "version": "2.3.8", + "resolved": "https://registry.npmmirror.com/terser-webpack-plugin/-/terser-webpack-plugin-2.3.8.tgz", + "integrity": "sha512-/fKw3R+hWyHfYx7Bv6oPqmk4HGQcrWLtV3X6ggvPuwPNHSnzvVV51z6OaaCOus4YLjutYGOz3pEpbhe6Up2s1w==", + "dev": true, + "requires": { + "cacache": "^13.0.1", + "find-cache-dir": "^3.3.1", + "jest-worker": "^25.4.0", + "p-limit": "^2.3.0", + "schema-utils": "^2.6.6", + "serialize-javascript": "^4.0.0", + "source-map": "^0.6.1", + "terser": "^4.6.12", + "webpack-sources": "^1.4.3" + } + }, + "yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmmirror.com/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true + } + } + }, + "@vue/cli-shared-utils": { + "version": "4.5.19", + "resolved": "https://registry.npmmirror.com/@vue/cli-shared-utils/-/cli-shared-utils-4.5.19.tgz", + "integrity": "sha512-JYpdsrC/d9elerKxbEUtmSSU6QRM60rirVubOewECHkBHj+tLNznWq/EhCjswywtePyLaMUK25eTqnTSZlEE+g==", + "dev": true, + "requires": { + "@achrinza/node-ipc": "9.2.2", + "@hapi/joi": "^15.0.1", + "chalk": "^2.4.2", + "execa": "^1.0.0", + "launch-editor": "^2.2.1", + "lru-cache": "^5.1.1", + "open": "^6.3.0", + "ora": "^3.4.0", + "read-pkg": "^5.1.1", + "request": "^2.88.2", + "semver": "^6.1.0", + "strip-ansi": "^6.0.0" + }, + "dependencies": { + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmmirror.com/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmmirror.com/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, + "requires": { + "yallist": "^3.0.2" + } + }, + "semver": { + "version": "6.3.1", + "resolved": "https://registry.npmmirror.com/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true + }, + "yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmmirror.com/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true + } + } + }, + "@vue/compiler-core": { + "version": "3.4.27", + "resolved": "https://registry.npmmirror.com/@vue/compiler-core/-/compiler-core-3.4.27.tgz", + "integrity": "sha512-E+RyqY24KnyDXsCuQrI+mlcdW3ALND6U7Gqa/+bVwbcpcR3BRRIckFoz7Qyd4TTlnugtwuI7YgjbvsLmxb+yvg==", + "dev": true, + "requires": { + "@babel/parser": "^7.24.4", + "@vue/shared": "3.4.27", + "entities": "^4.5.0", + "estree-walker": "^2.0.2", + "source-map-js": "^1.2.0" + } + }, + "@vue/compiler-dom": { + "version": "3.4.27", + "resolved": "https://registry.npmmirror.com/@vue/compiler-dom/-/compiler-dom-3.4.27.tgz", + "integrity": "sha512-kUTvochG/oVgE1w5ViSr3KUBh9X7CWirebA3bezTbB5ZKBQZwR2Mwj9uoSKRMFcz4gSMzzLXBPD6KpCLb9nvWw==", + "dev": true, + "requires": { + "@vue/compiler-core": "3.4.27", + "@vue/shared": "3.4.27" + } + }, + "@vue/compiler-sfc": { + "version": "3.4.27", + "resolved": "https://registry.npmmirror.com/@vue/compiler-sfc/-/compiler-sfc-3.4.27.tgz", + "integrity": "sha512-nDwntUEADssW8e0rrmE0+OrONwmRlegDA1pD6QhVeXxjIytV03yDqTey9SBDiALsvAd5U4ZrEKbMyVXhX6mCGA==", + "dev": true, + "requires": { + "@babel/parser": "^7.24.4", + "@vue/compiler-core": "3.4.27", + "@vue/compiler-dom": "3.4.27", + "@vue/compiler-ssr": "3.4.27", + "@vue/shared": "3.4.27", + "estree-walker": "^2.0.2", + "magic-string": "^0.30.10", + "postcss": "^8.4.38", + "source-map-js": "^1.2.0" + } + }, + "@vue/compiler-ssr": { + "version": "3.4.27", + "resolved": "https://registry.npmmirror.com/@vue/compiler-ssr/-/compiler-ssr-3.4.27.tgz", + "integrity": "sha512-CVRzSJIltzMG5FcidsW0jKNQnNRYC8bT21VegyMMtHmhW3UOI7knmUehzswXLrExDLE6lQCZdrhD4ogI7c+vuw==", + "dev": true, + "requires": { + "@vue/compiler-dom": "3.4.27", + "@vue/shared": "3.4.27" + } + }, + "@vue/component-compiler-utils": { + "version": "3.3.0", + "resolved": "https://registry.npmmirror.com/@vue/component-compiler-utils/-/component-compiler-utils-3.3.0.tgz", + "integrity": "sha512-97sfH2mYNU+2PzGrmK2haqffDpVASuib9/w2/noxiFi31Z54hW+q3izKQXXQZSNhtiUpAI36uSuYepeBe4wpHQ==", + "dev": true, + "requires": { + "consolidate": "^0.15.1", + "hash-sum": "^1.0.2", + "lru-cache": "^4.1.2", + "merge-source-map": "^1.1.0", + "postcss": "^7.0.36", + "postcss-selector-parser": "^6.0.2", + "prettier": "^1.18.2 || ^2.0.0", + "source-map": "~0.6.1", + "vue-template-es2015-compiler": "^1.9.0" + }, + "dependencies": { + "hash-sum": { + "version": "1.0.2", + "resolved": "https://registry.npmmirror.com/hash-sum/-/hash-sum-1.0.2.tgz", + "integrity": "sha512-fUs4B4L+mlt8/XAtSOGMUO1TXmAelItBPtJG7CyHJfYTdDjwisntGO2JQz7oUsatOY9o68+57eziUVNw/mRHmA==", + "dev": true + }, + "picocolors": { + "version": "0.2.1", + "resolved": "https://registry.npmmirror.com/picocolors/-/picocolors-0.2.1.tgz", + "integrity": "sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA==", + "dev": true + }, + "postcss": { + "version": "7.0.39", + "resolved": "https://registry.npmmirror.com/postcss/-/postcss-7.0.39.tgz", + "integrity": "sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA==", + "dev": true, + "requires": { + "picocolors": "^0.2.1", + "source-map": "^0.6.1" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmmirror.com/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "@vue/preload-webpack-plugin": { + "version": "1.1.2", + "resolved": "https://registry.npmmirror.com/@vue/preload-webpack-plugin/-/preload-webpack-plugin-1.1.2.tgz", + "integrity": "sha512-LIZMuJk38pk9U9Ur4YzHjlIyMuxPlACdBIHH9/nGYVTsaGKOSnSuELiE8vS9wa+dJpIYspYUOqk+L1Q4pgHQHQ==", + "dev": true + }, + "@vue/shared": { + "version": "3.4.27", + "resolved": "https://registry.npmmirror.com/@vue/shared/-/shared-3.4.27.tgz", + "integrity": "sha512-DL3NmY2OFlqmYYrzp39yi3LDkKxa5vZVwxWdQ3rG0ekuWscHraeIbnI8t+aZK7qhYqEqWKTUdijadunb9pnrgA==", + "dev": true + }, + "@vue/web-component-wrapper": { + "version": "1.3.0", + "resolved": "https://registry.npmmirror.com/@vue/web-component-wrapper/-/web-component-wrapper-1.3.0.tgz", + "integrity": "sha512-Iu8Tbg3f+emIIMmI2ycSI8QcEuAUgPTgHwesDU1eKMLE4YC/c/sFbGc70QgMq31ijRftV0R7vCm9co6rldCeOA==", + "dev": true + }, + "@webassemblyjs/ast": { + "version": "1.9.0", + "resolved": "https://registry.npmmirror.com/@webassemblyjs/ast/-/ast-1.9.0.tgz", + "integrity": "sha512-C6wW5L+b7ogSDVqymbkkvuW9kruN//YisMED04xzeBBqjHa2FYnmvOlS6Xj68xWQRgWvI9cIglsjFowH/RJyEA==", + "dev": true, + "requires": { + "@webassemblyjs/helper-module-context": "1.9.0", + "@webassemblyjs/helper-wasm-bytecode": "1.9.0", + "@webassemblyjs/wast-parser": "1.9.0" + } + }, + "@webassemblyjs/floating-point-hex-parser": { + "version": "1.9.0", + "resolved": "https://registry.npmmirror.com/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.9.0.tgz", + "integrity": "sha512-TG5qcFsS8QB4g4MhrxK5TqfdNe7Ey/7YL/xN+36rRjl/BlGE/NcBvJcqsRgCP6Z92mRE+7N50pRIi8SmKUbcQA==", + "dev": true + }, + "@webassemblyjs/helper-api-error": { + "version": "1.9.0", + "resolved": "https://registry.npmmirror.com/@webassemblyjs/helper-api-error/-/helper-api-error-1.9.0.tgz", + "integrity": "sha512-NcMLjoFMXpsASZFxJ5h2HZRcEhDkvnNFOAKneP5RbKRzaWJN36NC4jqQHKwStIhGXu5mUWlUUk7ygdtrO8lbmw==", + "dev": true + }, + "@webassemblyjs/helper-buffer": { + "version": "1.9.0", + "resolved": "https://registry.npmmirror.com/@webassemblyjs/helper-buffer/-/helper-buffer-1.9.0.tgz", + "integrity": "sha512-qZol43oqhq6yBPx7YM3m9Bv7WMV9Eevj6kMi6InKOuZxhw+q9hOkvq5e/PpKSiLfyetpaBnogSbNCfBwyB00CA==", + "dev": true + }, + "@webassemblyjs/helper-code-frame": { + "version": "1.9.0", + "resolved": "https://registry.npmmirror.com/@webassemblyjs/helper-code-frame/-/helper-code-frame-1.9.0.tgz", + "integrity": "sha512-ERCYdJBkD9Vu4vtjUYe8LZruWuNIToYq/ME22igL+2vj2dQ2OOujIZr3MEFvfEaqKoVqpsFKAGsRdBSBjrIvZA==", + "dev": true, + "requires": { + "@webassemblyjs/wast-printer": "1.9.0" + } + }, + "@webassemblyjs/helper-fsm": { + "version": "1.9.0", + "resolved": "https://registry.npmmirror.com/@webassemblyjs/helper-fsm/-/helper-fsm-1.9.0.tgz", + "integrity": "sha512-OPRowhGbshCb5PxJ8LocpdX9Kl0uB4XsAjl6jH/dWKlk/mzsANvhwbiULsaiqT5GZGT9qinTICdj6PLuM5gslw==", + "dev": true + }, + "@webassemblyjs/helper-module-context": { + "version": "1.9.0", + "resolved": "https://registry.npmmirror.com/@webassemblyjs/helper-module-context/-/helper-module-context-1.9.0.tgz", + "integrity": "sha512-MJCW8iGC08tMk2enck1aPW+BE5Cw8/7ph/VGZxwyvGbJwjktKkDK7vy7gAmMDx88D7mhDTCNKAW5tED+gZ0W8g==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.9.0" + } + }, + "@webassemblyjs/helper-wasm-bytecode": { + "version": "1.9.0", + "resolved": "https://registry.npmmirror.com/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.9.0.tgz", + "integrity": "sha512-R7FStIzyNcd7xKxCZH5lE0Bqy+hGTwS3LJjuv1ZVxd9O7eHCedSdrId/hMOd20I+v8wDXEn+bjfKDLzTepoaUw==", + "dev": true + }, + "@webassemblyjs/helper-wasm-section": { + "version": "1.9.0", + "resolved": "https://registry.npmmirror.com/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.9.0.tgz", + "integrity": "sha512-XnMB8l3ek4tvrKUUku+IVaXNHz2YsJyOOmz+MMkZvh8h1uSJpSen6vYnw3IoQ7WwEuAhL8Efjms1ZWjqh2agvw==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.9.0", + "@webassemblyjs/helper-buffer": "1.9.0", + "@webassemblyjs/helper-wasm-bytecode": "1.9.0", + "@webassemblyjs/wasm-gen": "1.9.0" + } + }, + "@webassemblyjs/ieee754": { + "version": "1.9.0", + "resolved": "https://registry.npmmirror.com/@webassemblyjs/ieee754/-/ieee754-1.9.0.tgz", + "integrity": "sha512-dcX8JuYU/gvymzIHc9DgxTzUUTLexWwt8uCTWP3otys596io0L5aW02Gb1RjYpx2+0Jus1h4ZFqjla7umFniTg==", + "dev": true, + "requires": { + "@xtuc/ieee754": "^1.2.0" + } + }, + "@webassemblyjs/leb128": { + "version": "1.9.0", + "resolved": "https://registry.npmmirror.com/@webassemblyjs/leb128/-/leb128-1.9.0.tgz", + "integrity": "sha512-ENVzM5VwV1ojs9jam6vPys97B/S65YQtv/aanqnU7D8aSoHFX8GyhGg0CMfyKNIHBuAVjy3tlzd5QMMINa7wpw==", + "dev": true, + "requires": { + "@xtuc/long": "4.2.2" + } + }, + "@webassemblyjs/utf8": { + "version": "1.9.0", + "resolved": "https://registry.npmmirror.com/@webassemblyjs/utf8/-/utf8-1.9.0.tgz", + "integrity": "sha512-GZbQlWtopBTP0u7cHrEx+73yZKrQoBMpwkGEIqlacljhXCkVM1kMQge/Mf+csMJAjEdSwhOyLAS0AoR3AG5P8w==", + "dev": true + }, + "@webassemblyjs/wasm-edit": { + "version": "1.9.0", + "resolved": "https://registry.npmmirror.com/@webassemblyjs/wasm-edit/-/wasm-edit-1.9.0.tgz", + "integrity": "sha512-FgHzBm80uwz5M8WKnMTn6j/sVbqilPdQXTWraSjBwFXSYGirpkSWE2R9Qvz9tNiTKQvoKILpCuTjBKzOIm0nxw==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.9.0", + "@webassemblyjs/helper-buffer": "1.9.0", + "@webassemblyjs/helper-wasm-bytecode": "1.9.0", + "@webassemblyjs/helper-wasm-section": "1.9.0", + "@webassemblyjs/wasm-gen": "1.9.0", + "@webassemblyjs/wasm-opt": "1.9.0", + "@webassemblyjs/wasm-parser": "1.9.0", + "@webassemblyjs/wast-printer": "1.9.0" + } + }, + "@webassemblyjs/wasm-gen": { + "version": "1.9.0", + "resolved": "https://registry.npmmirror.com/@webassemblyjs/wasm-gen/-/wasm-gen-1.9.0.tgz", + "integrity": "sha512-cPE3o44YzOOHvlsb4+E9qSqjc9Qf9Na1OO/BHFy4OI91XDE14MjFN4lTMezzaIWdPqHnsTodGGNP+iRSYfGkjA==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.9.0", + "@webassemblyjs/helper-wasm-bytecode": "1.9.0", + "@webassemblyjs/ieee754": "1.9.0", + "@webassemblyjs/leb128": "1.9.0", + "@webassemblyjs/utf8": "1.9.0" + } + }, + "@webassemblyjs/wasm-opt": { + "version": "1.9.0", + "resolved": "https://registry.npmmirror.com/@webassemblyjs/wasm-opt/-/wasm-opt-1.9.0.tgz", + "integrity": "sha512-Qkjgm6Anhm+OMbIL0iokO7meajkzQD71ioelnfPEj6r4eOFuqm4YC3VBPqXjFyyNwowzbMD+hizmprP/Fwkl2A==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.9.0", + "@webassemblyjs/helper-buffer": "1.9.0", + "@webassemblyjs/wasm-gen": "1.9.0", + "@webassemblyjs/wasm-parser": "1.9.0" + } + }, + "@webassemblyjs/wasm-parser": { + "version": "1.9.0", + "resolved": "https://registry.npmmirror.com/@webassemblyjs/wasm-parser/-/wasm-parser-1.9.0.tgz", + "integrity": "sha512-9+wkMowR2AmdSWQzsPEjFU7njh8HTO5MqO8vjwEHuM+AMHioNqSBONRdr0NQQ3dVQrzp0s8lTcYqzUdb7YgELA==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.9.0", + "@webassemblyjs/helper-api-error": "1.9.0", + "@webassemblyjs/helper-wasm-bytecode": "1.9.0", + "@webassemblyjs/ieee754": "1.9.0", + "@webassemblyjs/leb128": "1.9.0", + "@webassemblyjs/utf8": "1.9.0" + } + }, + "@webassemblyjs/wast-parser": { + "version": "1.9.0", + "resolved": "https://registry.npmmirror.com/@webassemblyjs/wast-parser/-/wast-parser-1.9.0.tgz", + "integrity": "sha512-qsqSAP3QQ3LyZjNC/0jBJ/ToSxfYJ8kYyuiGvtn/8MK89VrNEfwj7BPQzJVHi0jGTRK2dGdJ5PRqhtjzoww+bw==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.9.0", + "@webassemblyjs/floating-point-hex-parser": "1.9.0", + "@webassemblyjs/helper-api-error": "1.9.0", + "@webassemblyjs/helper-code-frame": "1.9.0", + "@webassemblyjs/helper-fsm": "1.9.0", + "@xtuc/long": "4.2.2" + } + }, + "@webassemblyjs/wast-printer": { + "version": "1.9.0", + "resolved": "https://registry.npmmirror.com/@webassemblyjs/wast-printer/-/wast-printer-1.9.0.tgz", + "integrity": "sha512-2J0nE95rHXHyQ24cWjMKJ1tqB/ds8z/cyeOZxJhcb+rW+SQASVjuznUSmdz5GpVJTzU8JkhYut0D3siFDD6wsA==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.9.0", + "@webassemblyjs/wast-parser": "1.9.0", + "@xtuc/long": "4.2.2" + } + }, + "@xtuc/ieee754": { + "version": "1.2.0", + "resolved": "https://registry.npmmirror.com/@xtuc/ieee754/-/ieee754-1.2.0.tgz", + "integrity": "sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==", + "dev": true + }, + "@xtuc/long": { + "version": "4.2.2", + "resolved": "https://registry.npmmirror.com/@xtuc/long/-/long-4.2.2.tgz", + "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==", + "dev": true + }, + "abbrev": { + "version": "1.1.1", + "resolved": "https://registry.npmmirror.com/abbrev/-/abbrev-1.1.1.tgz", + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==" + }, + "accepts": { + "version": "1.3.8", + "resolved": "https://registry.npmmirror.com/accepts/-/accepts-1.3.8.tgz", + "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", + "dev": true, + "requires": { + "mime-types": "~2.1.34", + "negotiator": "0.6.3" + } + }, + "acorn": { + "version": "6.4.2", + "resolved": "https://registry.npmmirror.com/acorn/-/acorn-6.4.2.tgz", + "integrity": "sha512-XtGIhXwF8YM8bJhGxG5kXgjkEuNGLTkoYqVE+KMR+aspr4KGYmKYg7yUe3KghyQ9yheNwLnjmzh/7+gfDBmHCQ==", + "dev": true + }, + "acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmmirror.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true + }, + "acorn-walk": { + "version": "7.2.0", + "resolved": "https://registry.npmmirror.com/acorn-walk/-/acorn-walk-7.2.0.tgz", + "integrity": "sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA==", + "dev": true + }, + "address": { + "version": "1.2.2", + "resolved": "https://registry.npmmirror.com/address/-/address-1.2.2.tgz", + "integrity": "sha512-4B/qKCfeE/ODUaAUpSwfzazo5x29WD4r3vXiWsB7I2mSDAihwEqKO+g8GELZUQSSAo5e1XTYh3ZVfLyxBc12nA==", + "dev": true + }, + "aggregate-error": { + "version": "3.1.0", + "resolved": "https://registry.npmmirror.com/aggregate-error/-/aggregate-error-3.1.0.tgz", + "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", + "dev": true, + "requires": { + "clean-stack": "^2.0.0", + "indent-string": "^4.0.0" + } + }, + "ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmmirror.com/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "ajv-errors": { + "version": "1.0.1", + "resolved": "https://registry.npmmirror.com/ajv-errors/-/ajv-errors-1.0.1.tgz", + "integrity": "sha512-DCRfO/4nQ+89p/RK43i8Ezd41EqdGIU4ld7nGF8OQ14oc/we5rEntLCUa7+jrn3nn83BosfwZA0wb4pon2o8iQ==", + "dev": true + }, + "ajv-keywords": { + "version": "3.5.2", + "resolved": "https://registry.npmmirror.com/ajv-keywords/-/ajv-keywords-3.5.2.tgz", + "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", + "dev": true + }, + "alphanum-sort": { + "version": "1.0.2", + "resolved": "https://registry.npmmirror.com/alphanum-sort/-/alphanum-sort-1.0.2.tgz", + "integrity": "sha512-0FcBfdcmaumGPQ0qPn7Q5qTgz/ooXgIyp1rf8ik5bGX8mpE2YHjC0P/eyQvxu1GURYQgq9ozf2mteQ5ZD9YiyQ==", + "dev": true + }, + "ansi-colors": { + "version": "3.2.4", + "resolved": "https://registry.npmmirror.com/ansi-colors/-/ansi-colors-3.2.4.tgz", + "integrity": "sha512-hHUXGagefjN2iRrID63xckIvotOXOojhQKWIPUZ4mNUZ9nLZW+7FMNoE1lOkEhNWYsx/7ysGIuJYCiMAA9FnrA==", + "dev": true + }, + "ansi-escapes": { + "version": "4.3.2", + "resolved": "https://registry.npmmirror.com/ansi-escapes/-/ansi-escapes-4.3.2.tgz", + "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", + "dev": true, + "requires": { + "type-fest": "^0.21.3" + }, + "dependencies": { + "type-fest": { + "version": "0.21.3", + "resolved": "https://registry.npmmirror.com/type-fest/-/type-fest-0.21.3.tgz", + "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", + "dev": true + } + } + }, + "ansi-html-community": { + "version": "0.0.8", + "resolved": "https://registry.npmmirror.com/ansi-html-community/-/ansi-html-community-0.0.8.tgz", + "integrity": "sha512-1APHAyr3+PCamwNw3bXCPp4HFLONZt/yIH0sZp0/469KWNTEy+qN5jQ3GVX6DMZ1UXAi34yVwtTeaG/HpBuuzw==", + "dev": true + }, + "ansi-regex": { + "version": "4.1.1", + "resolved": "https://registry.npmmirror.com/ansi-regex/-/ansi-regex-4.1.1.tgz", + "integrity": "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==", + "dev": true + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmmirror.com/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "any-promise": { + "version": "1.3.0", + "resolved": "https://registry.npmmirror.com/any-promise/-/any-promise-1.3.0.tgz", + "integrity": "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==", + "dev": true + }, + "anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmmirror.com/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "dev": true, + "requires": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + } + }, + "aproba": { + "version": "1.2.0", + "resolved": "https://registry.npmmirror.com/aproba/-/aproba-1.2.0.tgz", + "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", + "dev": true + }, + "arch": { + "version": "2.2.0", + "resolved": "https://registry.npmmirror.com/arch/-/arch-2.2.0.tgz", + "integrity": "sha512-Of/R0wqp83cgHozfIYLbBMnej79U/SVGOOyuB3VVFv1NRM/PSFMK12x9KVtiYzJqmnU5WR2qp0Z5rHb7sWGnFQ==", + "dev": true + }, + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmmirror.com/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "requires": { + "sprintf-js": "~1.0.2" + } + }, + "arr-diff": { + "version": "4.0.0", + "resolved": "https://registry.npmmirror.com/arr-diff/-/arr-diff-4.0.0.tgz", + "integrity": "sha512-YVIQ82gZPGBebQV/a8dar4AitzCQs0jjXwMPZllpXMaGjXPYVUawSxQrRsjhjupyVxEvbHgUmIhKVlND+j02kA==", + "dev": true + }, + "arr-flatten": { + "version": "1.1.0", + "resolved": "https://registry.npmmirror.com/arr-flatten/-/arr-flatten-1.1.0.tgz", + "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", + "dev": true + }, + "arr-union": { + "version": "3.1.0", + "resolved": "https://registry.npmmirror.com/arr-union/-/arr-union-3.1.0.tgz", + "integrity": "sha512-sKpyeERZ02v1FeCZT8lrfJq5u6goHCtpTAzPwJYe7c8SPFOboNjNg1vz2L4VTn9T4PQxEx13TbXLmYUcS6Ug7Q==", + "dev": true + }, + "array-buffer-byte-length": { + "version": "1.0.1", + "resolved": "https://registry.npmmirror.com/array-buffer-byte-length/-/array-buffer-byte-length-1.0.1.tgz", + "integrity": "sha512-ahC5W1xgou+KTXix4sAO8Ki12Q+jf4i0+tmk3sC+zgcynshkHxzpXdImBehiUYKKKDwvfFiJl1tZt6ewscS1Mg==", + "dev": true, + "requires": { + "call-bind": "^1.0.5", + "is-array-buffer": "^3.0.4" + } + }, + "array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmmirror.com/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==", + "dev": true + }, + "array-union": { + "version": "1.0.2", + "resolved": "https://registry.npmmirror.com/array-union/-/array-union-1.0.2.tgz", + "integrity": "sha512-Dxr6QJj/RdU/hCaBjOfxW+q6lyuVE6JFWIrAUpuOOhoJJoQ99cUn3igRaHVB5P9WrgFVN0FfArM3x0cueOU8ng==", + "dev": true, + "requires": { + "array-uniq": "^1.0.1" + } + }, + "array-uniq": { + "version": "1.0.3", + "resolved": "https://registry.npmmirror.com/array-uniq/-/array-uniq-1.0.3.tgz", + "integrity": "sha512-MNha4BWQ6JbwhFhj03YK552f7cb3AzoE8SzeljgChvL1dl3IcvggXVz1DilzySZkCja+CXuZbdW7yATchWn8/Q==", + "dev": true + }, + "array-unique": { + "version": "0.3.2", + "resolved": "https://registry.npmmirror.com/array-unique/-/array-unique-0.3.2.tgz", + "integrity": "sha512-SleRWjh9JUud2wH1hPs9rZBZ33H6T9HOiL0uwGnGx9FpE6wKGyfWugmbkEOIs6qWrZhg0LWeLziLrEwQJhs5mQ==", + "dev": true + }, + "array.prototype.reduce": { + "version": "1.0.7", + "resolved": "https://registry.npmmirror.com/array.prototype.reduce/-/array.prototype.reduce-1.0.7.tgz", + "integrity": "sha512-mzmiUCVwtiD4lgxYP8g7IYy8El8p2CSMePvIbTS7gchKir/L1fgJrk0yDKmAX6mnRQFKNADYIk8nNlTris5H1Q==", + "dev": true, + "requires": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-array-method-boxes-properly": "^1.0.0", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "is-string": "^1.0.7" + } + }, + "arraybuffer.prototype.slice": { + "version": "1.0.3", + "resolved": "https://registry.npmmirror.com/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.3.tgz", + "integrity": "sha512-bMxMKAjg13EBSVscxTaYA4mRc5t1UAXa2kXiGTNfZ079HIWXEkKmkgFrh/nJqamaLSrXO5H4WFFkPEaLJWbs3A==", + "dev": true, + "requires": { + "array-buffer-byte-length": "^1.0.1", + "call-bind": "^1.0.5", + "define-properties": "^1.2.1", + "es-abstract": "^1.22.3", + "es-errors": "^1.2.1", + "get-intrinsic": "^1.2.3", + "is-array-buffer": "^3.0.4", + "is-shared-array-buffer": "^1.0.2" + } + }, + "asn1": { + "version": "0.2.6", + "resolved": "https://registry.npmmirror.com/asn1/-/asn1-0.2.6.tgz", + "integrity": "sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ==", + "dev": true, + "requires": { + "safer-buffer": "~2.1.0" + } + }, + "asn1.js": { + "version": "4.10.1", + "resolved": "https://registry.npmmirror.com/asn1.js/-/asn1.js-4.10.1.tgz", + "integrity": "sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw==", + "dev": true, + "requires": { + "bn.js": "^4.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0" + }, + "dependencies": { + "bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmmirror.com/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", + "dev": true + } + } + }, + "assert": { + "version": "1.5.1", + "resolved": "https://registry.npmmirror.com/assert/-/assert-1.5.1.tgz", + "integrity": "sha512-zzw1uCAgLbsKwBfFc8CX78DDg+xZeBksSO3vwVIDDN5i94eOrPsSSyiVhmsSABFDM/OcpE2aagCat9dnWQLG1A==", + "dev": true, + "requires": { + "object.assign": "^4.1.4", + "util": "^0.10.4" + }, + "dependencies": { + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmmirror.com/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha512-x00IRNXNy63jwGkJmzPigoySHbaqpNuzKbBOmzK+g2OdZpQ9w+sxCN+VSB3ja7IAge2OP2qpfxTjeNcyjmW1uw==", + "dev": true + }, + "util": { + "version": "0.10.4", + "resolved": "https://registry.npmmirror.com/util/-/util-0.10.4.tgz", + "integrity": "sha512-0Pm9hTQ3se5ll1XihRic3FDIku70C+iHUdT/W926rSgHV5QgXsYbKZN8MSC3tJtSkhuROzvsQjAaFENRXr+19A==", + "dev": true, + "requires": { + "inherits": "2.0.3" + } + } + } + }, + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmmirror.com/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==", + "dev": true + }, + "assign-symbols": { + "version": "1.0.0", + "resolved": "https://registry.npmmirror.com/assign-symbols/-/assign-symbols-1.0.0.tgz", + "integrity": "sha512-Q+JC7Whu8HhmTdBph/Tq59IoRtoy6KAm5zzPv00WdujX82lbAL8K7WVjne7vdCsAmbF4AYaDOPyO3k0kl8qIrw==", + "dev": true + }, + "astral-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmmirror.com/astral-regex/-/astral-regex-1.0.0.tgz", + "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", + "dev": true + }, + "async": { + "version": "2.6.4", + "resolved": "https://registry.npmmirror.com/async/-/async-2.6.4.tgz", + "integrity": "sha512-mzo5dfJYwAn29PeiJ0zvwTo04zj8HDJj0Mn8TD7sno7q12prdbnasKJHhkm2c1LgrhlJ0teaea8860oxi51mGA==", + "dev": true, + "requires": { + "lodash": "^4.17.14" + } + }, + "async-each": { + "version": "1.0.6", + "resolved": "https://registry.npmmirror.com/async-each/-/async-each-1.0.6.tgz", + "integrity": "sha512-c646jH1avxr+aVpndVMeAfYw7wAa6idufrlN3LPA4PmKS0QEGp6PIC9nwz0WQkkvBGAMEki3pFdtxaF39J9vvg==", + "dev": true + }, + "async-limiter": { + "version": "1.0.1", + "resolved": "https://registry.npmmirror.com/async-limiter/-/async-limiter-1.0.1.tgz", + "integrity": "sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ==", + "dev": true + }, + "async-validator": { + "version": "1.8.5", + "resolved": "https://registry.npmmirror.com/async-validator/-/async-validator-1.8.5.tgz", + "integrity": "sha512-tXBM+1m056MAX0E8TL2iCjg8WvSyXu0Zc8LNtYqrVeyoL3+esHRZ4SieE9fKQyyU09uONjnMEjrNBMqT0mbvmA==", + "requires": { + "babel-runtime": "6.x" + } + }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmmirror.com/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "dev": true + }, + "atob": { + "version": "2.1.2", + "resolved": "https://registry.npmmirror.com/atob/-/atob-2.1.2.tgz", + "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", + "dev": true + }, + "autoprefixer": { + "version": "9.8.8", + "resolved": "https://registry.npmmirror.com/autoprefixer/-/autoprefixer-9.8.8.tgz", + "integrity": "sha512-eM9d/swFopRt5gdJ7jrpCwgvEMIayITpojhkkSMRsFHYuH5bkSQ4p/9qTEHtmNudUZh22Tehu7I6CxAW0IXTKA==", + "dev": true, + "requires": { + "browserslist": "^4.12.0", + "caniuse-lite": "^1.0.30001109", + "normalize-range": "^0.1.2", + "num2fraction": "^1.2.2", + "picocolors": "^0.2.1", + "postcss": "^7.0.32", + "postcss-value-parser": "^4.1.0" + }, + "dependencies": { + "picocolors": { + "version": "0.2.1", + "resolved": "https://registry.npmmirror.com/picocolors/-/picocolors-0.2.1.tgz", + "integrity": "sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA==", + "dev": true + }, + "postcss": { + "version": "7.0.39", + "resolved": "https://registry.npmmirror.com/postcss/-/postcss-7.0.39.tgz", + "integrity": "sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA==", + "dev": true, + "requires": { + "picocolors": "^0.2.1", + "source-map": "^0.6.1" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmmirror.com/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "available-typed-arrays": { + "version": "1.0.7", + "resolved": "https://registry.npmmirror.com/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", + "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==", + "dev": true, + "requires": { + "possible-typed-array-names": "^1.0.0" + } + }, + "aws-sign2": { + "version": "0.7.0", + "resolved": "https://registry.npmmirror.com/aws-sign2/-/aws-sign2-0.7.0.tgz", + "integrity": "sha512-08kcGqnYf/YmjoRhfxyu+CLxBjUtHLXLXX/vUfx9l2LYzG3c1m61nrpyFUZI6zeS+Li/wWMMidD9KgrqtGq3mA==", + "dev": true + }, + "aws4": { + "version": "1.13.0", + "resolved": "https://registry.npmmirror.com/aws4/-/aws4-1.13.0.tgz", + "integrity": "sha512-3AungXC4I8kKsS9PuS4JH2nc+0bVY/mjgrephHTIi8fpEeGsTHBUJeosp0Wc1myYMElmD0B3Oc4XL/HVJ4PV2g==", + "dev": true + }, + "axios": { + "version": "0.24.0", + "resolved": "https://registry.npmmirror.com/axios/-/axios-0.24.0.tgz", + "integrity": "sha512-Q6cWsys88HoPgAaFAVUb0WpPk0O8iTeisR9IMqy9G8AbO4NlpVknrnQS03zzF9PGAWgO3cgletO3VjV/P7VztA==", + "requires": { + "follow-redirects": "^1.14.4" + } + }, + "babel-eslint": { + "version": "10.1.0", + "resolved": "https://registry.npmmirror.com/babel-eslint/-/babel-eslint-10.1.0.tgz", + "integrity": "sha512-ifWaTHQ0ce+448CYop8AdrQiBsGrnC+bMgfyKFdi6EsPLTAWG+QfyDeM6OH+FmWnKvEq5NnBMLvlBUPKQZoDSg==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "@babel/parser": "^7.7.0", + "@babel/traverse": "^7.7.0", + "@babel/types": "^7.7.0", + "eslint-visitor-keys": "^1.0.0", + "resolve": "^1.12.0" + } + }, + "babel-helper-vue-jsx-merge-props": { + "version": "2.0.3", + "resolved": "https://registry.npmmirror.com/babel-helper-vue-jsx-merge-props/-/babel-helper-vue-jsx-merge-props-2.0.3.tgz", + "integrity": "sha512-gsLiKK7Qrb7zYJNgiXKpXblxbV5ffSwR0f5whkPAaBAR4fhi6bwRZxX9wBlIc5M/v8CCkXUbXZL4N/nSE97cqg==" + }, + "babel-loader": { + "version": "8.3.0", + "resolved": "https://registry.npmmirror.com/babel-loader/-/babel-loader-8.3.0.tgz", + "integrity": "sha512-H8SvsMF+m9t15HNLMipppzkC+Y2Yq+v3SonZyU70RBL/h1gxPkH08Ot8pEE9Z4Kd+czyWJClmFS8qzIP9OZ04Q==", + "dev": true, + "requires": { + "find-cache-dir": "^3.3.1", + "loader-utils": "^2.0.0", + "make-dir": "^3.1.0", + "schema-utils": "^2.6.5" + } + }, + "babel-plugin-dynamic-import-node": { + "version": "2.3.3", + "resolved": "https://registry.npmmirror.com/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.3.tgz", + "integrity": "sha512-jZVI+s9Zg3IqA/kdi0i6UDCybUI3aSBLnglhYbSSjKlV7yF1F/5LWv8MakQmvYpnbJDS6fcBL2KzHSxNCMtWSQ==", + "dev": true, + "requires": { + "object.assign": "^4.1.0" + } + }, + "babel-plugin-polyfill-corejs2": { + "version": "0.4.11", + "resolved": "https://registry.npmmirror.com/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.4.11.tgz", + "integrity": "sha512-sMEJ27L0gRHShOh5G54uAAPaiCOygY/5ratXuiyb2G46FmlSpc9eFCzYVyDiPxfNbwzA7mYahmjQc5q+CZQ09Q==", + "dev": true, + "requires": { + "@babel/compat-data": "^7.22.6", + "@babel/helper-define-polyfill-provider": "^0.6.2", + "semver": "^6.3.1" + }, + "dependencies": { + "semver": { + "version": "6.3.1", + "resolved": "https://registry.npmmirror.com/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true + } + } + }, + "babel-plugin-polyfill-corejs3": { + "version": "0.10.4", + "resolved": "https://registry.npmmirror.com/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.10.4.tgz", + "integrity": "sha512-25J6I8NGfa5YkCDogHRID3fVCadIR8/pGl1/spvCkzb6lVn6SR3ojpx9nOn9iEBcUsjY24AmdKm5khcfKdylcg==", + "dev": true, + "requires": { + "@babel/helper-define-polyfill-provider": "^0.6.1", + "core-js-compat": "^3.36.1" + } + }, + "babel-plugin-polyfill-regenerator": { + "version": "0.6.2", + "resolved": "https://registry.npmmirror.com/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.6.2.tgz", + "integrity": "sha512-2R25rQZWP63nGwaAswvDazbPXfrM3HwVoBXK6HcqeKrSrL/JqcC/rDcf95l4r7LXLyxDXc8uQDa064GubtCABg==", + "dev": true, + "requires": { + "@babel/helper-define-polyfill-provider": "^0.6.2" + } + }, + "babel-runtime": { + "version": "6.26.0", + "resolved": "https://registry.npmmirror.com/babel-runtime/-/babel-runtime-6.26.0.tgz", + "integrity": "sha512-ITKNuq2wKlW1fJg9sSW52eepoYgZBggvOAHC0u/CYu/qxQ9EVzThCgR69BnSXLHjy2f7SY5zaQ4yt7H9ZVxY2g==", + "requires": { + "core-js": "^2.4.0", + "regenerator-runtime": "^0.11.0" + }, + "dependencies": { + "core-js": { + "version": "2.6.12", + "resolved": "https://registry.npmmirror.com/core-js/-/core-js-2.6.12.tgz", + "integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==" + }, + "regenerator-runtime": { + "version": "0.11.1", + "resolved": "https://registry.npmmirror.com/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", + "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==" + } + } + }, + "balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmmirror.com/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" + }, + "base": { + "version": "0.11.2", + "resolved": "https://registry.npmmirror.com/base/-/base-0.11.2.tgz", + "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", + "dev": true, + "requires": { + "cache-base": "^1.0.1", + "class-utils": "^0.3.5", + "component-emitter": "^1.2.1", + "define-property": "^1.0.0", + "isobject": "^3.0.1", + "mixin-deep": "^1.2.0", + "pascalcase": "^0.1.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmmirror.com/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha512-cZTYKFWspt9jZsMscWo8sc/5lbPC9Q0N5nBLgb+Yd915iL3udB1uFgS3B8YCx66UVHq018DAVFoee7x+gxggeA==", + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "is-descriptor": { + "version": "1.0.3", + "resolved": "https://registry.npmmirror.com/is-descriptor/-/is-descriptor-1.0.3.tgz", + "integrity": "sha512-JCNNGbwWZEVaSPtS45mdtrneRWJFp07LLmykxeFV5F6oBvNF8vHSfJuJgoT472pSfk+Mf8VnlrspaFBHWM8JAw==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.1", + "is-data-descriptor": "^1.0.1" + } + } + } + }, + "base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmmirror.com/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "dev": true + }, + "batch": { + "version": "0.6.1", + "resolved": "https://registry.npmmirror.com/batch/-/batch-0.6.1.tgz", + "integrity": "sha512-x+VAiMRL6UPkx+kudNvxTl6hB2XNNCG2r+7wixVfIYwu/2HKRXimwQyaumLjMveWvT2Hkd/cAJw+QBMfJ/EKVw==", + "dev": true + }, + "bcrypt-pbkdf": { + "version": "1.0.2", + "resolved": "https://registry.npmmirror.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", + "integrity": "sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w==", + "dev": true, + "requires": { + "tweetnacl": "^0.14.3" + } + }, + "bfj": { + "version": "6.1.2", + "resolved": "https://registry.npmmirror.com/bfj/-/bfj-6.1.2.tgz", + "integrity": "sha512-BmBJa4Lip6BPRINSZ0BPEIfB1wUY/9rwbwvIHQA1KjX9om29B6id0wnWXq7m3bn5JrUVjeOTnVuhPT1FiHwPGw==", + "dev": true, + "requires": { + "bluebird": "^3.5.5", + "check-types": "^8.0.3", + "hoopy": "^0.1.4", + "tryer": "^1.0.1" + } + }, + "big.js": { + "version": "5.2.2", + "resolved": "https://registry.npmmirror.com/big.js/-/big.js-5.2.2.tgz", + "integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==", + "dev": true + }, + "binary-extensions": { + "version": "2.3.0", + "resolved": "https://registry.npmmirror.com/binary-extensions/-/binary-extensions-2.3.0.tgz", + "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==", + "dev": true + }, + "bluebird": { + "version": "3.7.2", + "resolved": "https://registry.npmmirror.com/bluebird/-/bluebird-3.7.2.tgz", + "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==", + "dev": true + }, + "bn.js": { + "version": "5.2.1", + "resolved": "https://registry.npmmirror.com/bn.js/-/bn.js-5.2.1.tgz", + "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==", + "dev": true + }, + "body-parser": { + "version": "1.20.2", + "resolved": "https://registry.npmmirror.com/body-parser/-/body-parser-1.20.2.tgz", + "integrity": "sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==", + "dev": true, + "requires": { + "bytes": "3.1.2", + "content-type": "~1.0.5", + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "on-finished": "2.4.1", + "qs": "6.11.0", + "raw-body": "2.5.2", + "type-is": "~1.6.18", + "unpipe": "1.0.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmmirror.com/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "dev": true + }, + "qs": { + "version": "6.11.0", + "resolved": "https://registry.npmmirror.com/qs/-/qs-6.11.0.tgz", + "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", + "dev": true, + "requires": { + "side-channel": "^1.0.4" + } + } + } + }, + "bonjour": { + "version": "3.5.0", + "resolved": "https://registry.npmmirror.com/bonjour/-/bonjour-3.5.0.tgz", + "integrity": "sha512-RaVTblr+OnEli0r/ud8InrU7D+G0y6aJhlxaLa6Pwty4+xoxboF1BsUI45tujvRpbj9dQVoglChqonGAsjEBYg==", + "dev": true, + "requires": { + "array-flatten": "^2.1.0", + "deep-equal": "^1.0.1", + "dns-equal": "^1.0.0", + "dns-txt": "^2.0.2", + "multicast-dns": "^6.0.1", + "multicast-dns-service-types": "^1.1.0" + }, + "dependencies": { + "array-flatten": { + "version": "2.1.2", + "resolved": "https://registry.npmmirror.com/array-flatten/-/array-flatten-2.1.2.tgz", + "integrity": "sha512-hNfzcOV8W4NdualtqBFPyVO+54DSJuZGY9qT4pRroB6S9e3iiido2ISIC5h9R2sPJ8H3FHCIiEnsv1lPXO3KtQ==", + "dev": true + } + } + }, + "boolbase": { + "version": "1.0.0", + "resolved": "https://registry.npmmirror.com/boolbase/-/boolbase-1.0.0.tgz", + "integrity": "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==", + "dev": true + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmmirror.com/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "2.3.2", + "resolved": "https://registry.npmmirror.com/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "dev": true, + "requires": { + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmmirror.com/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "brorand": { + "version": "1.1.0", + "resolved": "https://registry.npmmirror.com/brorand/-/brorand-1.1.0.tgz", + "integrity": "sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w==", + "dev": true + }, + "browserify-aes": { + "version": "1.2.0", + "resolved": "https://registry.npmmirror.com/browserify-aes/-/browserify-aes-1.2.0.tgz", + "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", + "dev": true, + "requires": { + "buffer-xor": "^1.0.3", + "cipher-base": "^1.0.0", + "create-hash": "^1.1.0", + "evp_bytestokey": "^1.0.3", + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "browserify-cipher": { + "version": "1.0.1", + "resolved": "https://registry.npmmirror.com/browserify-cipher/-/browserify-cipher-1.0.1.tgz", + "integrity": "sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w==", + "dev": true, + "requires": { + "browserify-aes": "^1.0.4", + "browserify-des": "^1.0.0", + "evp_bytestokey": "^1.0.0" + } + }, + "browserify-des": { + "version": "1.0.2", + "resolved": "https://registry.npmmirror.com/browserify-des/-/browserify-des-1.0.2.tgz", + "integrity": "sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A==", + "dev": true, + "requires": { + "cipher-base": "^1.0.1", + "des.js": "^1.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "browserify-rsa": { + "version": "4.1.0", + "resolved": "https://registry.npmmirror.com/browserify-rsa/-/browserify-rsa-4.1.0.tgz", + "integrity": "sha512-AdEER0Hkspgno2aR97SAf6vi0y0k8NuOpGnVH3O99rcA5Q6sh8QxcngtHuJ6uXwnfAXNM4Gn1Gb7/MV1+Ymbog==", + "dev": true, + "requires": { + "bn.js": "^5.0.0", + "randombytes": "^2.0.1" + } + }, + "browserify-sign": { + "version": "4.2.3", + "resolved": "https://registry.npmmirror.com/browserify-sign/-/browserify-sign-4.2.3.tgz", + "integrity": "sha512-JWCZW6SKhfhjJxO8Tyiiy+XYB7cqd2S5/+WeYHsKdNKFlCBhKbblba1A/HN/90YwtxKc8tCErjffZl++UNmGiw==", + "dev": true, + "requires": { + "bn.js": "^5.2.1", + "browserify-rsa": "^4.1.0", + "create-hash": "^1.2.0", + "create-hmac": "^1.1.7", + "elliptic": "^6.5.5", + "hash-base": "~3.0", + "inherits": "^2.0.4", + "parse-asn1": "^5.1.7", + "readable-stream": "^2.3.8", + "safe-buffer": "^5.2.1" + }, + "dependencies": { + "hash-base": { + "version": "3.0.4", + "resolved": "https://registry.npmmirror.com/hash-base/-/hash-base-3.0.4.tgz", + "integrity": "sha512-EeeoJKjTyt868liAlVmcv2ZsUfGHlE3Q+BICOXcZiwN3osr5Q/zFGYmTJpoIzuaSTAwndFy+GqhEwlU4L3j4Ow==", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + } + } + }, + "browserify-zlib": { + "version": "0.2.0", + "resolved": "https://registry.npmmirror.com/browserify-zlib/-/browserify-zlib-0.2.0.tgz", + "integrity": "sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA==", + "dev": true, + "requires": { + "pako": "~1.0.5" + } + }, + "browserslist": { + "version": "4.23.0", + "resolved": "https://registry.npmmirror.com/browserslist/-/browserslist-4.23.0.tgz", + "integrity": "sha512-QW8HiM1shhT2GuzkvklfjcKDiWFXHOeFCIA/huJPwHsslwcydgk7X+z2zXpEijP98UCY7HbubZt5J2Zgvf0CaQ==", + "dev": true, + "requires": { + "caniuse-lite": "^1.0.30001587", + "electron-to-chromium": "^1.4.668", + "node-releases": "^2.0.14", + "update-browserslist-db": "^1.0.13" + } + }, + "buffer": { + "version": "4.9.2", + "resolved": "https://registry.npmmirror.com/buffer/-/buffer-4.9.2.tgz", + "integrity": "sha512-xq+q3SRMOxGivLhBNaUdC64hDTQwejJ+H0T/NB1XMtTVEwNTrfFF3gAxiyW0Bu/xWEGhjVKgUcMhCrUy2+uCWg==", + "dev": true, + "requires": { + "base64-js": "^1.0.2", + "ieee754": "^1.1.4", + "isarray": "^1.0.0" + } + }, + "buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmmirror.com/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "dev": true + }, + "buffer-indexof": { + "version": "1.1.1", + "resolved": "https://registry.npmmirror.com/buffer-indexof/-/buffer-indexof-1.1.1.tgz", + "integrity": "sha512-4/rOEg86jivtPTeOUUT61jJO1Ya1TrR/OkqCSZDyq84WJh3LuuiphBYJN+fm5xufIk4XAFcEwte/8WzC8If/1g==", + "dev": true + }, + "buffer-json": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/buffer-json/-/buffer-json-2.0.0.tgz", + "integrity": "sha512-+jjPFVqyfF1esi9fvfUs3NqM0pH1ziZ36VP4hmA/y/Ssfo/5w5xHKfTw9BwQjoJ1w/oVtpLomqwUHKdefGyuHw==", + "dev": true + }, + "buffer-xor": { + "version": "1.0.3", + "resolved": "https://registry.npmmirror.com/buffer-xor/-/buffer-xor-1.0.3.tgz", + "integrity": "sha512-571s0T7nZWK6vB67HI5dyUF7wXiNcfaPPPTl6zYCNApANjIvYJTg7hlud/+cJpdAhS7dVzqMLmfhfHR3rAcOjQ==", + "dev": true + }, + "builtin-status-codes": { + "version": "3.0.0", + "resolved": "https://registry.npmmirror.com/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz", + "integrity": "sha512-HpGFw18DgFWlncDfjTa2rcQ4W88O1mC8e8yZ2AvQY5KDaktSTwo+KRf6nHK6FRI5FyRyb/5T6+TSxfP7QyGsmQ==", + "dev": true + }, + "bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmmirror.com/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "dev": true + }, + "cacache": { + "version": "12.0.4", + "resolved": "https://registry.npmmirror.com/cacache/-/cacache-12.0.4.tgz", + "integrity": "sha512-a0tMB40oefvuInr4Cwb3GerbL9xTj1D5yg0T5xrjGCGyfvbxseIXX7BAO/u/hIXdafzOI5JC3wDwHyf24buOAQ==", + "dev": true, + "requires": { + "bluebird": "^3.5.5", + "chownr": "^1.1.1", + "figgy-pudding": "^3.5.1", + "glob": "^7.1.4", + "graceful-fs": "^4.1.15", + "infer-owner": "^1.0.3", + "lru-cache": "^5.1.1", + "mississippi": "^3.0.0", + "mkdirp": "^0.5.1", + "move-concurrently": "^1.0.1", + "promise-inflight": "^1.0.1", + "rimraf": "^2.6.3", + "ssri": "^6.0.1", + "unique-filename": "^1.1.1", + "y18n": "^4.0.0" + }, + "dependencies": { + "lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmmirror.com/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, + "requires": { + "yallist": "^3.0.2" + } + }, + "mkdirp": { + "version": "0.5.6", + "resolved": "https://registry.npmmirror.com/mkdirp/-/mkdirp-0.5.6.tgz", + "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", + "dev": true, + "requires": { + "minimist": "^1.2.6" + } + }, + "yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmmirror.com/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true + } + } + }, + "cache-base": { + "version": "1.0.1", + "resolved": "https://registry.npmmirror.com/cache-base/-/cache-base-1.0.1.tgz", + "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", + "dev": true, + "requires": { + "collection-visit": "^1.0.0", + "component-emitter": "^1.2.1", + "get-value": "^2.0.6", + "has-value": "^1.0.0", + "isobject": "^3.0.1", + "set-value": "^2.0.0", + "to-object-path": "^0.3.0", + "union-value": "^1.0.0", + "unset-value": "^1.0.0" + } + }, + "cache-loader": { + "version": "4.1.0", + "resolved": "https://registry.npmmirror.com/cache-loader/-/cache-loader-4.1.0.tgz", + "integrity": "sha512-ftOayxve0PwKzBF/GLsZNC9fJBXl8lkZE3TOsjkboHfVHVkL39iUEs1FO07A33mizmci5Dudt38UZrrYXDtbhw==", + "dev": true, + "requires": { + "buffer-json": "^2.0.0", + "find-cache-dir": "^3.0.0", + "loader-utils": "^1.2.3", + "mkdirp": "^0.5.1", + "neo-async": "^2.6.1", + "schema-utils": "^2.0.0" + }, + "dependencies": { + "json5": { + "version": "1.0.2", + "resolved": "https://registry.npmmirror.com/json5/-/json5-1.0.2.tgz", + "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", + "dev": true, + "requires": { + "minimist": "^1.2.0" + } + }, + "loader-utils": { + "version": "1.4.2", + "resolved": "https://registry.npmmirror.com/loader-utils/-/loader-utils-1.4.2.tgz", + "integrity": "sha512-I5d00Pd/jwMD2QCduo657+YM/6L3KZu++pmX9VFncxaxvHcru9jx1lBaFft+r4Mt2jK0Yhp41XlRAihzPxHNCg==", + "dev": true, + "requires": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^1.0.1" + } + }, + "mkdirp": { + "version": "0.5.6", + "resolved": "https://registry.npmmirror.com/mkdirp/-/mkdirp-0.5.6.tgz", + "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", + "dev": true, + "requires": { + "minimist": "^1.2.6" + } + } + } + }, + "call-bind": { + "version": "1.0.7", + "resolved": "https://registry.npmmirror.com/call-bind/-/call-bind-1.0.7.tgz", + "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", + "requires": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.1" + } + }, + "call-me-maybe": { + "version": "1.0.2", + "resolved": "https://registry.npmmirror.com/call-me-maybe/-/call-me-maybe-1.0.2.tgz", + "integrity": "sha512-HpX65o1Hnr9HH25ojC1YGs7HCQLq0GCOibSaWER0eNpgJ/Z1MZv2mTc7+xh6WOPxbRVcmgbv4hGU+uSQ/2xFZQ==", + "dev": true + }, + "caller-callsite": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/caller-callsite/-/caller-callsite-2.0.0.tgz", + "integrity": "sha512-JuG3qI4QOftFsZyOn1qq87fq5grLIyk1JYd5lJmdA+fG7aQ9pA/i3JIJGcO3q0MrRcHlOt1U+ZeHW8Dq9axALQ==", + "dev": true, + "requires": { + "callsites": "^2.0.0" + } + }, + "caller-path": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/caller-path/-/caller-path-2.0.0.tgz", + "integrity": "sha512-MCL3sf6nCSXOwCTzvPKhN18TU7AHTvdtam8DAogxcrJ8Rjfbbg7Lgng64H9Iy+vUV6VGFClN/TyxBkAebLRR4A==", + "dev": true, + "requires": { + "caller-callsite": "^2.0.0" + } + }, + "callsites": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/callsites/-/callsites-2.0.0.tgz", + "integrity": "sha512-ksWePWBloaWPxJYQ8TL0JHvtci6G5QTKwQ95RcWAa/lzoAKuAOflGdAK92hpHXjkwb8zLxoLNUoNYZgVsaJzvQ==", + "dev": true + }, + "camel-case": { + "version": "3.0.0", + "resolved": "https://registry.npmmirror.com/camel-case/-/camel-case-3.0.0.tgz", + "integrity": "sha512-+MbKztAYHXPr1jNTSKQF52VpcFjwY5RkR7fxksV8Doo4KAYc5Fl4UJRgthBbTmEx8C54DqahhbLJkDwjI3PI/w==", + "dev": true, + "requires": { + "no-case": "^2.2.0", + "upper-case": "^1.1.1" + } + }, + "camelcase": { + "version": "6.3.0", + "resolved": "https://registry.npmmirror.com/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", + "dev": true + }, + "caniuse-api": { + "version": "3.0.0", + "resolved": "https://registry.npmmirror.com/caniuse-api/-/caniuse-api-3.0.0.tgz", + "integrity": "sha512-bsTwuIg/BZZK/vreVTYYbSWoe2F+71P7K5QGEX+pT250DZbfU1MQ5prOKpPR+LL6uWKK3KMwMCAS74QB3Um1uw==", + "dev": true, + "requires": { + "browserslist": "^4.0.0", + "caniuse-lite": "^1.0.0", + "lodash.memoize": "^4.1.2", + "lodash.uniq": "^4.5.0" + } + }, + "caniuse-lite": { + "version": "1.0.30001624", + "resolved": "https://registry.npmmirror.com/caniuse-lite/-/caniuse-lite-1.0.30001624.tgz", + "integrity": "sha512-0dWnQG87UevOCPYaOR49CBcLBwoZLpws+k6W37nLjWUhumP1Isusj0p2u+3KhjNloRWK9OKMgjBBzPujQHw4nA==", + "dev": true + }, + "case-sensitive-paths-webpack-plugin": { + "version": "2.4.0", + "resolved": "https://registry.npmmirror.com/case-sensitive-paths-webpack-plugin/-/case-sensitive-paths-webpack-plugin-2.4.0.tgz", + "integrity": "sha512-roIFONhcxog0JSSWbvVAh3OocukmSgpqOH6YpMkCvav/ySIV3JKg4Dc8vYtQjYi/UxpNE36r/9v+VqTQqgkYmw==", + "dev": true + }, + "caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmmirror.com/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==", + "dev": true + }, + "chalk": { + "version": "4.1.0", + "resolved": "https://registry.npmmirror.com/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmmirror.com/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmmirror.com/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmmirror.com/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmmirror.com/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmmirror.com/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "chardet": { + "version": "0.7.0", + "resolved": "https://registry.npmmirror.com/chardet/-/chardet-0.7.0.tgz", + "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", + "dev": true + }, + "check-types": { + "version": "8.0.3", + "resolved": "https://registry.npmmirror.com/check-types/-/check-types-8.0.3.tgz", + "integrity": "sha512-YpeKZngUmG65rLudJ4taU7VLkOCTMhNl/u4ctNC56LQS/zJTyNH0Lrtwm1tfTsbLlwvlfsA2d1c8vCf/Kh2KwQ==", + "dev": true + }, + "chokidar": { + "version": "3.6.0", + "resolved": "https://registry.npmmirror.com/chokidar/-/chokidar-3.6.0.tgz", + "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", + "dev": true, + "requires": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "fsevents": "~2.3.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "dependencies": { + "braces": { + "version": "3.0.3", + "resolved": "https://registry.npmmirror.com/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "dev": true, + "requires": { + "fill-range": "^7.1.1" + } + }, + "fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmmirror.com/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "dev": true, + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmmirror.com/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true + }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmmirror.com/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "requires": { + "is-number": "^7.0.0" + } + } + } + }, + "chownr": { + "version": "1.1.4", + "resolved": "https://registry.npmmirror.com/chownr/-/chownr-1.1.4.tgz", + "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==", + "dev": true + }, + "chrome-trace-event": { + "version": "1.0.3", + "resolved": "https://registry.npmmirror.com/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz", + "integrity": "sha512-p3KULyQg4S7NIHixdwbGX+nFHkoBiA4YQmyWtjb8XngSKV124nJmRysgAeujbUVb15vh+RvFUfCPqU7rXk+hZg==", + "dev": true + }, + "ci-info": { + "version": "1.6.0", + "resolved": "https://registry.npmmirror.com/ci-info/-/ci-info-1.6.0.tgz", + "integrity": "sha512-vsGdkwSCDpWmP80ncATX7iea5DWQemg1UgCW5J8tqjU3lYw4FBYuj89J0CTVomA7BEfvSZd84GmHko+MxFQU2A==", + "dev": true + }, + "cipher-base": { + "version": "1.0.4", + "resolved": "https://registry.npmmirror.com/cipher-base/-/cipher-base-1.0.4.tgz", + "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "class-utils": { + "version": "0.3.6", + "resolved": "https://registry.npmmirror.com/class-utils/-/class-utils-0.3.6.tgz", + "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", + "dev": true, + "requires": { + "arr-union": "^3.1.0", + "define-property": "^0.2.5", + "isobject": "^3.0.0", + "static-extend": "^0.1.1" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmmirror.com/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha512-Rr7ADjQZenceVOAKop6ALkkRAmH1A4Gx9hV/7ZujPUN2rkATqFO0JZLZInbAjpZYoJ1gUx8MRMQVkYemcbMSTA==", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + } + } + }, + "clean-css": { + "version": "4.2.4", + "resolved": "https://registry.npmmirror.com/clean-css/-/clean-css-4.2.4.tgz", + "integrity": "sha512-EJUDT7nDVFDvaQgAo2G/PJvxmp1o/c6iXLbswsBbUFXi1Nr+AjA2cKmfbKDMjMvzEe75g3P6JkaDDAKk96A85A==", + "dev": true, + "requires": { + "source-map": "~0.6.0" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmmirror.com/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "clean-stack": { + "version": "2.2.0", + "resolved": "https://registry.npmmirror.com/clean-stack/-/clean-stack-2.2.0.tgz", + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", + "dev": true + }, + "cli-cursor": { + "version": "2.1.0", + "resolved": "https://registry.npmmirror.com/cli-cursor/-/cli-cursor-2.1.0.tgz", + "integrity": "sha512-8lgKz8LmCRYZZQDpRyT2m5rKJ08TnU4tR9FFFW2rxpxR1FzWi4PQ/NfyODchAatHaUgnSPVcx/R5w6NuTBzFiw==", + "dev": true, + "requires": { + "restore-cursor": "^2.0.0" + } + }, + "cli-highlight": { + "version": "2.1.11", + "resolved": "https://registry.npmmirror.com/cli-highlight/-/cli-highlight-2.1.11.tgz", + "integrity": "sha512-9KDcoEVwyUXrjcJNvHD0NFc/hiwe/WPVYIleQh2O1N2Zro5gWJZ/K+3DGn8w8P/F6FxOgzyC5bxDyHIgCSPhGg==", + "dev": true, + "requires": { + "chalk": "^4.0.0", + "highlight.js": "^10.7.1", + "mz": "^2.4.0", + "parse5": "^5.1.1", + "parse5-htmlparser2-tree-adapter": "^6.0.0", + "yargs": "^16.0.0" + }, + "dependencies": { + "highlight.js": { + "version": "10.7.3", + "resolved": "https://registry.npmmirror.com/highlight.js/-/highlight.js-10.7.3.tgz", + "integrity": "sha512-tzcUFauisWKNHaRkN4Wjl/ZA07gENAjFl3J/c480dprkGTg5EQstgaNFqBfUqCq54kZRIEcreTsAgF/m2quD7A==", + "dev": true + } + } + }, + "cli-spinners": { + "version": "2.9.2", + "resolved": "https://registry.npmmirror.com/cli-spinners/-/cli-spinners-2.9.2.tgz", + "integrity": "sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==", + "dev": true + }, + "cli-truncate": { + "version": "2.1.0", + "resolved": "https://registry.npmmirror.com/cli-truncate/-/cli-truncate-2.1.0.tgz", + "integrity": "sha512-n8fOixwDD6b/ObinzTrp1ZKFzbgvKZvuz/TvejnLn1aQfC6r52XEx85FmuC+3HI+JM7coBRXUvNqEU2PHVrHpg==", + "dev": true, + "requires": { + "slice-ansi": "^3.0.0", + "string-width": "^4.2.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmmirror.com/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "astral-regex": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/astral-regex/-/astral-regex-2.0.0.tgz", + "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", + "dev": true + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmmirror.com/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmmirror.com/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "slice-ansi": { + "version": "3.0.0", + "resolved": "https://registry.npmmirror.com/slice-ansi/-/slice-ansi-3.0.0.tgz", + "integrity": "sha512-pSyv7bSTC7ig9Dcgbw9AuRNUb5k5V6oDudjZoMBSr13qpLBG7tB+zgCkARjq7xIUgdz5P1Qe8u+rSGdouOOIyQ==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "astral-regex": "^2.0.0", + "is-fullwidth-code-point": "^3.0.0" + } + } + } + }, + "cli-width": { + "version": "3.0.0", + "resolved": "https://registry.npmmirror.com/cli-width/-/cli-width-3.0.0.tgz", + "integrity": "sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw==", + "dev": true + }, + "clipboard": { + "version": "2.0.8", + "resolved": "https://registry.npmmirror.com/clipboard/-/clipboard-2.0.8.tgz", + "integrity": "sha512-Y6WO0unAIQp5bLmk1zdThRhgJt/x3ks6f30s3oE3H1mgIEU33XyQjEf8gsf6DxC7NPX8Y1SsNWjUjL/ywLnnbQ==", + "requires": { + "good-listener": "^1.2.2", + "select": "^1.1.2", + "tiny-emitter": "^2.0.0" + } + }, + "clipboardy": { + "version": "2.3.0", + "resolved": "https://registry.npmmirror.com/clipboardy/-/clipboardy-2.3.0.tgz", + "integrity": "sha512-mKhiIL2DrQIsuXMgBgnfEHOZOryC7kY7YO//TN6c63wlEm3NG5tz+YgY5rVi29KCmq/QQjKYvM7a19+MDOTHOQ==", + "dev": true, + "requires": { + "arch": "^2.1.1", + "execa": "^1.0.0", + "is-wsl": "^2.1.1" + }, + "dependencies": { + "is-wsl": { + "version": "2.2.0", + "resolved": "https://registry.npmmirror.com/is-wsl/-/is-wsl-2.2.0.tgz", + "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", + "dev": true, + "requires": { + "is-docker": "^2.0.0" + } + } + } + }, + "cliui": { + "version": "6.0.0", + "resolved": "https://registry.npmmirror.com/cliui/-/cliui-6.0.0.tgz", + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "dev": true, + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmmirror.com/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmmirror.com/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmmirror.com/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmmirror.com/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + } + } + } + }, + "clone": { + "version": "2.1.2", + "resolved": "https://registry.npmmirror.com/clone/-/clone-2.1.2.tgz", + "integrity": "sha512-3Pe/CF1Nn94hyhIYpjtiLhdCoEoz0DqQ+988E9gmeEdQZlojxnOb74wctFyuwWQHzqyf9X7C7MG8juUpqBJT8w==" + }, + "coa": { + "version": "2.0.2", + "resolved": "https://registry.npmmirror.com/coa/-/coa-2.0.2.tgz", + "integrity": "sha512-q5/jG+YQnSy4nRTV4F7lPepBJZ8qBNJJDBuJdoejDyLXgmL7IEo+Le2JDZudFTFt7mrCqIRaSjws4ygRCTCAXA==", + "dev": true, + "requires": { + "@types/q": "^1.5.1", + "chalk": "^2.4.1", + "q": "^1.1.2" + }, + "dependencies": { + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmmirror.com/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + } + } + }, + "collection-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmmirror.com/collection-visit/-/collection-visit-1.0.0.tgz", + "integrity": "sha512-lNkKvzEeMBBjUGHZ+q6z9pSJla0KWAQPvtzhEV9+iGyQYG+pBpl7xKDhxoNSOZH2hhv0v5k0y2yAM4o4SjoSkw==", + "dev": true, + "requires": { + "map-visit": "^1.0.0", + "object-visit": "^1.0.0" + } + }, + "color": { + "version": "3.2.1", + "resolved": "https://registry.npmmirror.com/color/-/color-3.2.1.tgz", + "integrity": "sha512-aBl7dZI9ENN6fUGC7mWpMTPNHmWUSNan9tuWN6ahh5ZLNk9baLJOnSMlrQkHcrfFgz2/RigjUVAjdx36VcemKA==", + "dev": true, + "requires": { + "color-convert": "^1.9.3", + "color-string": "^1.6.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmmirror.com/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmmirror.com/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true + }, + "color-string": { + "version": "1.9.1", + "resolved": "https://registry.npmmirror.com/color-string/-/color-string-1.9.1.tgz", + "integrity": "sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg==", + "dev": true, + "requires": { + "color-name": "^1.0.0", + "simple-swizzle": "^0.2.2" + } + }, + "colorette": { + "version": "2.0.20", + "resolved": "https://registry.npmmirror.com/colorette/-/colorette-2.0.20.tgz", + "integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==", + "dev": true + }, + "combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmmirror.com/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dev": true, + "requires": { + "delayed-stream": "~1.0.0" + } + }, + "commander": { + "version": "2.20.3", + "resolved": "https://registry.npmmirror.com/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" + }, + "commondir": { + "version": "1.0.1", + "resolved": "https://registry.npmmirror.com/commondir/-/commondir-1.0.1.tgz", + "integrity": "sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==", + "dev": true + }, + "component-emitter": { + "version": "1.3.1", + "resolved": "https://registry.npmmirror.com/component-emitter/-/component-emitter-1.3.1.tgz", + "integrity": "sha512-T0+barUSQRTUQASh8bx02dl+DhF54GtIDY13Y3m9oWTklKbb3Wv974meRpeZ3lp1JpLVECWWNHC4vaG2XHXouQ==", + "dev": true + }, + "compressible": { + "version": "2.0.18", + "resolved": "https://registry.npmmirror.com/compressible/-/compressible-2.0.18.tgz", + "integrity": "sha512-AF3r7P5dWxL8MxyITRMlORQNaOA2IkAFaTr4k7BUumjPtRpGDTZpl0Pb1XCO6JeDCBdp126Cgs9sMxqSjgYyRg==", + "dev": true, + "requires": { + "mime-db": ">= 1.43.0 < 2" + } + }, + "compression": { + "version": "1.7.4", + "resolved": "https://registry.npmmirror.com/compression/-/compression-1.7.4.tgz", + "integrity": "sha512-jaSIDzP9pZVS4ZfQ+TzvtiWhdpFhE2RDHz8QJkpX9SIpLq88VueF5jJw6t+6CUQcAoA6t+x89MLrWAqpfDE8iQ==", + "dev": true, + "requires": { + "accepts": "~1.3.5", + "bytes": "3.0.0", + "compressible": "~2.0.16", + "debug": "2.6.9", + "on-headers": "~1.0.2", + "safe-buffer": "5.1.2", + "vary": "~1.1.2" + }, + "dependencies": { + "bytes": { + "version": "3.0.0", + "resolved": "https://registry.npmmirror.com/bytes/-/bytes-3.0.0.tgz", + "integrity": "sha512-pMhOfFDPiv9t5jjIXkHosWmkSyQbvsgEVNkz0ERHbuLh2T/7j4Mqqpz523Fe8MVY89KC6Sh/QfS2sM+SjgFDcw==", + "dev": true + }, + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmmirror.com/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "dev": true + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmmirror.com/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + } + } + }, + "compression-webpack-plugin": { + "version": "5.0.2", + "resolved": "https://registry.npmmirror.com/compression-webpack-plugin/-/compression-webpack-plugin-5.0.2.tgz", + "integrity": "sha512-F2G4cQfsMZ6CiPlG22Q5EDUCqnfyZqTjyJP5cMgNYUbBg/dUzV3hto8yTFFIogDCTWooVbePHQE0qL6FrJUSsA==", + "dev": true, + "requires": { + "cacache": "^15.0.5", + "find-cache-dir": "^3.3.1", + "schema-utils": "^2.7.0", + "serialize-javascript": "^4.0.0", + "webpack-sources": "^1.4.3" + }, + "dependencies": { + "cacache": { + "version": "15.3.0", + "resolved": "https://registry.npmmirror.com/cacache/-/cacache-15.3.0.tgz", + "integrity": "sha512-VVdYzXEn+cnbXpFgWs5hTT7OScegHVmLhJIR8Ufqk3iFD6A6j5iSX1KuBTfNEv4tdJWE2PzA6IVFtcLC7fN9wQ==", + "dev": true, + "requires": { + "@npmcli/fs": "^1.0.0", + "@npmcli/move-file": "^1.0.1", + "chownr": "^2.0.0", + "fs-minipass": "^2.0.0", + "glob": "^7.1.4", + "infer-owner": "^1.0.4", + "lru-cache": "^6.0.0", + "minipass": "^3.1.1", + "minipass-collect": "^1.0.2", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.2", + "mkdirp": "^1.0.3", + "p-map": "^4.0.0", + "promise-inflight": "^1.0.1", + "rimraf": "^3.0.2", + "ssri": "^8.0.1", + "tar": "^6.0.2", + "unique-filename": "^1.1.1" + } + }, + "chownr": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/chownr/-/chownr-2.0.0.tgz", + "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", + "dev": true + }, + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmmirror.com/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "requires": { + "yallist": "^4.0.0" + } + }, + "p-map": { + "version": "4.0.0", + "resolved": "https://registry.npmmirror.com/p-map/-/p-map-4.0.0.tgz", + "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==", + "dev": true, + "requires": { + "aggregate-error": "^3.0.0" + } + }, + "rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmmirror.com/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, + "ssri": { + "version": "8.0.1", + "resolved": "https://registry.npmmirror.com/ssri/-/ssri-8.0.1.tgz", + "integrity": "sha512-97qShzy1AiyxvPNIkLWoGua7xoQzzPjQ0HAH4B0rWKo7SZ6USuPcrUiAFrws0UH8RrbWmgq3LMTObhPIHbbBeQ==", + "dev": true, + "requires": { + "minipass": "^3.1.1" + } + }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmmirror.com/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + } + } + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmmirror.com/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" + }, + "concat-stream": { + "version": "1.6.2", + "resolved": "https://registry.npmmirror.com/concat-stream/-/concat-stream-1.6.2.tgz", + "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" + } + }, + "config-chain": { + "version": "1.1.13", + "resolved": "https://registry.npmmirror.com/config-chain/-/config-chain-1.1.13.tgz", + "integrity": "sha512-qj+f8APARXHrM0hraqXYb2/bOVSV4PvJQlNZ/DVj0QrmNM2q2euizkeuVckQ57J+W0mRH6Hvi+k50M4Jul2VRQ==", + "requires": { + "ini": "^1.3.4", + "proto-list": "~1.2.1" + } + }, + "connect": { + "version": "3.6.6", + "resolved": "https://registry.npmmirror.com/connect/-/connect-3.6.6.tgz", + "integrity": "sha512-OO7axMmPpu/2XuX1+2Yrg0ddju31B6xLZMWkJ5rYBu4YRmRVlOjvlY6kw2FJKiAzyxGwnrDUAG4s1Pf0sbBMCQ==", + "dev": true, + "requires": { + "debug": "2.6.9", + "finalhandler": "1.1.0", + "parseurl": "~1.3.2", + "utils-merge": "1.0.1" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmmirror.com/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "finalhandler": { + "version": "1.1.0", + "resolved": "https://registry.npmmirror.com/finalhandler/-/finalhandler-1.1.0.tgz", + "integrity": "sha512-ejnvM9ZXYzp6PUPUyQBMBf0Co5VX2gr5H2VQe2Ui2jWXNlxv+PYZo8wpAymJNJdLsG1R4p+M4aynF8KuoUEwRw==", + "dev": true, + "requires": { + "debug": "2.6.9", + "encodeurl": "~1.0.1", + "escape-html": "~1.0.3", + "on-finished": "~2.3.0", + "parseurl": "~1.3.2", + "statuses": "~1.3.1", + "unpipe": "~1.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "dev": true + }, + "on-finished": { + "version": "2.3.0", + "resolved": "https://registry.npmmirror.com/on-finished/-/on-finished-2.3.0.tgz", + "integrity": "sha512-ikqdkGAAyf/X/gPhXGvfgAytDZtDbr+bkNUJ0N9h5MI/dmdgCs3l6hoHrcUv41sRKew3jIwrp4qQDXiK99Utww==", + "dev": true, + "requires": { + "ee-first": "1.1.1" + } + }, + "statuses": { + "version": "1.3.1", + "resolved": "https://registry.npmmirror.com/statuses/-/statuses-1.3.1.tgz", + "integrity": "sha512-wuTCPGlJONk/a1kqZ4fQM2+908lC7fa7nPYpTC1EhnvqLX/IICbeP1OZGDtA374trpSq68YubKUMo8oRhN46yg==", + "dev": true + } + } + }, + "connect-history-api-fallback": { + "version": "1.6.0", + "resolved": "https://registry.npmmirror.com/connect-history-api-fallback/-/connect-history-api-fallback-1.6.0.tgz", + "integrity": "sha512-e54B99q/OUoH64zYYRf3HBP5z24G38h5D3qXu23JGRoigpX5Ss4r9ZnDk3g0Z8uQC2x2lPaJ+UlWBc1ZWBWdLg==", + "dev": true + }, + "console-browserify": { + "version": "1.2.0", + "resolved": "https://registry.npmmirror.com/console-browserify/-/console-browserify-1.2.0.tgz", + "integrity": "sha512-ZMkYO/LkF17QvCPqM0gxw8yUzigAOZOSWSHg91FH6orS7vcEj5dVZTidN2fQ14yBSdg97RqhSNwLUXInd52OTA==", + "dev": true + }, + "consolidate": { + "version": "0.15.1", + "resolved": "https://registry.npmmirror.com/consolidate/-/consolidate-0.15.1.tgz", + "integrity": "sha512-DW46nrsMJgy9kqAbPt5rKaCr7uFtpo4mSUvLHIUbJEjm0vo+aY5QLwBUq3FK4tRnJr/X0Psc0C4jf/h+HtXSMw==", + "dev": true, + "requires": { + "bluebird": "^3.1.1" + } + }, + "constants-browserify": { + "version": "1.0.0", + "resolved": "https://registry.npmmirror.com/constants-browserify/-/constants-browserify-1.0.0.tgz", + "integrity": "sha512-xFxOwqIzR/e1k1gLiWEophSCMqXcwVHIH7akf7b/vxcUeGunlj3hvZaaqxwHsTgn+IndtkQJgSztIDWeumWJDQ==", + "dev": true + }, + "content-disposition": { + "version": "0.5.4", + "resolved": "https://registry.npmmirror.com/content-disposition/-/content-disposition-0.5.4.tgz", + "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", + "dev": true, + "requires": { + "safe-buffer": "5.2.1" + } + }, + "content-type": { + "version": "1.0.5", + "resolved": "https://registry.npmmirror.com/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", + "dev": true + }, + "convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true + }, + "cookie": { + "version": "0.6.0", + "resolved": "https://registry.npmmirror.com/cookie/-/cookie-0.6.0.tgz", + "integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==", + "dev": true + }, + "cookie-signature": { + "version": "1.0.6", + "resolved": "https://registry.npmmirror.com/cookie-signature/-/cookie-signature-1.0.6.tgz", + "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==", + "dev": true + }, + "copy-concurrently": { + "version": "1.0.5", + "resolved": "https://registry.npmmirror.com/copy-concurrently/-/copy-concurrently-1.0.5.tgz", + "integrity": "sha512-f2domd9fsVDFtaFcbaRZuYXwtdmnzqbADSwhSWYxYB/Q8zsdUUFMXVRwXGDMWmbEzAn1kdRrtI1T/KTFOL4X2A==", + "dev": true, + "requires": { + "aproba": "^1.1.1", + "fs-write-stream-atomic": "^1.0.8", + "iferr": "^0.1.5", + "mkdirp": "^0.5.1", + "rimraf": "^2.5.4", + "run-queue": "^1.0.0" + }, + "dependencies": { + "mkdirp": { + "version": "0.5.6", + "resolved": "https://registry.npmmirror.com/mkdirp/-/mkdirp-0.5.6.tgz", + "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", + "dev": true, + "requires": { + "minimist": "^1.2.6" + } + } + } + }, + "copy-descriptor": { + "version": "0.1.1", + "resolved": "https://registry.npmmirror.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz", + "integrity": "sha512-XgZ0pFcakEUlbwQEVNg3+QAis1FyTL3Qel9FYy8pSkQqoG3PNoT0bOCQtOXcOkur21r2Eq2kI+IE+gsmAEVlYw==", + "dev": true + }, + "copy-webpack-plugin": { + "version": "5.1.2", + "resolved": "https://registry.npmmirror.com/copy-webpack-plugin/-/copy-webpack-plugin-5.1.2.tgz", + "integrity": "sha512-Uh7crJAco3AjBvgAy9Z75CjK8IG+gxaErro71THQ+vv/bl4HaQcpkexAY8KVW/T6D2W2IRr+couF/knIRkZMIQ==", + "dev": true, + "requires": { + "cacache": "^12.0.3", + "find-cache-dir": "^2.1.0", + "glob-parent": "^3.1.0", + "globby": "^7.1.1", + "is-glob": "^4.0.1", + "loader-utils": "^1.2.3", + "minimatch": "^3.0.4", + "normalize-path": "^3.0.0", + "p-limit": "^2.2.1", + "schema-utils": "^1.0.0", + "serialize-javascript": "^4.0.0", + "webpack-log": "^2.0.0" + }, + "dependencies": { + "find-cache-dir": { + "version": "2.1.0", + "resolved": "https://registry.npmmirror.com/find-cache-dir/-/find-cache-dir-2.1.0.tgz", + "integrity": "sha512-Tq6PixE0w/VMFfCgbONnkiQIVol/JJL7nRMi20fqzA4NRs9AfeqMGeRdPi3wIhYkxjeBaWh2rxwapn5Tu3IqOQ==", + "dev": true, + "requires": { + "commondir": "^1.0.1", + "make-dir": "^2.0.0", + "pkg-dir": "^3.0.0" + } + }, + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmmirror.com/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "requires": { + "locate-path": "^3.0.0" + } + }, + "glob-parent": { + "version": "3.1.0", + "resolved": "https://registry.npmmirror.com/glob-parent/-/glob-parent-3.1.0.tgz", + "integrity": "sha512-E8Ak/2+dZY6fnzlR7+ueWvhsH1SjHr4jjss4YS/h4py44jY9MhK/VFdaZJAWDz6BbL21KeteKxFSFpq8OS5gVA==", + "dev": true, + "requires": { + "is-glob": "^3.1.0", + "path-dirname": "^1.0.0" + }, + "dependencies": { + "is-glob": { + "version": "3.1.0", + "resolved": "https://registry.npmmirror.com/is-glob/-/is-glob-3.1.0.tgz", + "integrity": "sha512-UFpDDrPgM6qpnFNI+rh/p3bUaq9hKLZN8bMUWzxmcnZVS3omf4IPK+BrewlnWjO1WmUsMYuSjKh4UJuV4+Lqmw==", + "dev": true, + "requires": { + "is-extglob": "^2.1.0" + } + } + } + }, + "globby": { + "version": "7.1.1", + "resolved": "https://registry.npmmirror.com/globby/-/globby-7.1.1.tgz", + "integrity": "sha512-yANWAN2DUcBtuus5Cpd+SKROzXHs2iVXFZt/Ykrfz6SAXqacLX25NZpltE+39ceMexYF4TtEadjuSTw8+3wX4g==", + "dev": true, + "requires": { + "array-union": "^1.0.1", + "dir-glob": "^2.0.0", + "glob": "^7.1.2", + "ignore": "^3.3.5", + "pify": "^3.0.0", + "slash": "^1.0.0" + }, + "dependencies": { + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmmirror.com/pify/-/pify-3.0.0.tgz", + "integrity": "sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==", + "dev": true + } + } + }, + "ignore": { + "version": "3.3.10", + "resolved": "https://registry.npmmirror.com/ignore/-/ignore-3.3.10.tgz", + "integrity": "sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug==", + "dev": true + }, + "json5": { + "version": "1.0.2", + "resolved": "https://registry.npmmirror.com/json5/-/json5-1.0.2.tgz", + "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", + "dev": true, + "requires": { + "minimist": "^1.2.0" + } + }, + "loader-utils": { + "version": "1.4.2", + "resolved": "https://registry.npmmirror.com/loader-utils/-/loader-utils-1.4.2.tgz", + "integrity": "sha512-I5d00Pd/jwMD2QCduo657+YM/6L3KZu++pmX9VFncxaxvHcru9jx1lBaFft+r4Mt2jK0Yhp41XlRAihzPxHNCg==", + "dev": true, + "requires": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^1.0.1" + } + }, + "locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmmirror.com/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "dev": true, + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + } + }, + "make-dir": { + "version": "2.1.0", + "resolved": "https://registry.npmmirror.com/make-dir/-/make-dir-2.1.0.tgz", + "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", + "dev": true, + "requires": { + "pify": "^4.0.1", + "semver": "^5.6.0" + } + }, + "p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmmirror.com/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "dev": true, + "requires": { + "p-limit": "^2.0.0" + } + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmmirror.com/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==", + "dev": true + }, + "pkg-dir": { + "version": "3.0.0", + "resolved": "https://registry.npmmirror.com/pkg-dir/-/pkg-dir-3.0.0.tgz", + "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==", + "dev": true, + "requires": { + "find-up": "^3.0.0" + } + }, + "schema-utils": { + "version": "1.0.0", + "resolved": "https://registry.npmmirror.com/schema-utils/-/schema-utils-1.0.0.tgz", + "integrity": "sha512-i27Mic4KovM/lnGsy8whRCHhc7VicJajAjTrYg11K9zfZXnYIt4k5F+kZkwjnrhKzLic/HLU4j11mjsz2G/75g==", + "dev": true, + "requires": { + "ajv": "^6.1.0", + "ajv-errors": "^1.0.0", + "ajv-keywords": "^3.1.0" + } + }, + "slash": { + "version": "1.0.0", + "resolved": "https://registry.npmmirror.com/slash/-/slash-1.0.0.tgz", + "integrity": "sha512-3TYDR7xWt4dIqV2JauJr+EJeW356RXijHeUlO+8djJ+uBXPn8/2dpzBc8yQhh583sVvc9CvFAeQVgijsH+PNNg==", + "dev": true + } + } + }, + "core-js": { + "version": "3.25.3", + "resolved": "https://registry.npmmirror.com/core-js/-/core-js-3.25.3.tgz", + "integrity": "sha512-y1hvKXmPHvm5B7w4ln1S4uc9eV/O5+iFExSRUimnvIph11uaizFR8LFMdONN8hG3P2pipUfX4Y/fR8rAEtcHcQ==" + }, + "core-js-compat": { + "version": "3.37.1", + "resolved": "https://registry.npmmirror.com/core-js-compat/-/core-js-compat-3.37.1.tgz", + "integrity": "sha512-9TNiImhKvQqSUkOvk/mMRZzOANTiEVC7WaBNhHcKM7x+/5E1l5NvsysR19zuDQScE8k+kfQXWRN3AtS/eOSHpg==", + "dev": true, + "requires": { + "browserslist": "^4.23.0" + } + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmmirror.com/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==", + "dev": true + }, + "cosmiconfig": { + "version": "5.2.1", + "resolved": "https://registry.npmmirror.com/cosmiconfig/-/cosmiconfig-5.2.1.tgz", + "integrity": "sha512-H65gsXo1SKjf8zmrJ67eJk8aIRKV5ff2D4uKZIBZShbhGSpEmsQOPW/SKMKYhSTrqR7ufy6RP69rPogdaPh/kA==", + "dev": true, + "requires": { + "import-fresh": "^2.0.0", + "is-directory": "^0.3.1", + "js-yaml": "^3.13.1", + "parse-json": "^4.0.0" + }, + "dependencies": { + "parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmmirror.com/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha512-aOIos8bujGN93/8Ox/jPLh7RwVnPEysynVFE+fQZyg6jKELEHwzgKdLRFHUgXJL6kylijVSBC4BvN9OmsB48Rw==", + "dev": true, + "requires": { + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" + } + } + } + }, + "create-ecdh": { + "version": "4.0.4", + "resolved": "https://registry.npmmirror.com/create-ecdh/-/create-ecdh-4.0.4.tgz", + "integrity": "sha512-mf+TCx8wWc9VpuxfP2ht0iSISLZnt0JgWlrOKZiNqyUZWnjIaCIVNQArMHnCZKfEYRg6IM7A+NeJoN8gf/Ws0A==", + "dev": true, + "requires": { + "bn.js": "^4.1.0", + "elliptic": "^6.5.3" + }, + "dependencies": { + "bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmmirror.com/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", + "dev": true + } + } + }, + "create-hash": { + "version": "1.2.0", + "resolved": "https://registry.npmmirror.com/create-hash/-/create-hash-1.2.0.tgz", + "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", + "dev": true, + "requires": { + "cipher-base": "^1.0.1", + "inherits": "^2.0.1", + "md5.js": "^1.3.4", + "ripemd160": "^2.0.1", + "sha.js": "^2.4.0" + } + }, + "create-hmac": { + "version": "1.1.7", + "resolved": "https://registry.npmmirror.com/create-hmac/-/create-hmac-1.1.7.tgz", + "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", + "dev": true, + "requires": { + "cipher-base": "^1.0.3", + "create-hash": "^1.1.0", + "inherits": "^2.0.1", + "ripemd160": "^2.0.0", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmmirror.com/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "requires": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, + "crypto-browserify": { + "version": "3.12.0", + "resolved": "https://registry.npmmirror.com/crypto-browserify/-/crypto-browserify-3.12.0.tgz", + "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", + "dev": true, + "requires": { + "browserify-cipher": "^1.0.0", + "browserify-sign": "^4.0.0", + "create-ecdh": "^4.0.0", + "create-hash": "^1.1.0", + "create-hmac": "^1.1.0", + "diffie-hellman": "^5.0.0", + "inherits": "^2.0.1", + "pbkdf2": "^3.0.3", + "public-encrypt": "^4.0.0", + "randombytes": "^2.0.0", + "randomfill": "^1.0.3" + } + }, + "css-color-names": { + "version": "0.0.4", + "resolved": "https://registry.npmmirror.com/css-color-names/-/css-color-names-0.0.4.tgz", + "integrity": "sha512-zj5D7X1U2h2zsXOAM8EyUREBnnts6H+Jm+d1M2DbiQQcUtnqgQsMrdo8JW9R80YFUmIdBZeMu5wvYM7hcgWP/Q==", + "dev": true + }, + "css-declaration-sorter": { + "version": "4.0.1", + "resolved": "https://registry.npmmirror.com/css-declaration-sorter/-/css-declaration-sorter-4.0.1.tgz", + "integrity": "sha512-BcxQSKTSEEQUftYpBVnsH4SF05NTuBokb19/sBt6asXGKZ/6VP7PLG1CBCkFDYOnhXhPh0jMhO6xZ71oYHXHBA==", + "dev": true, + "requires": { + "postcss": "^7.0.1", + "timsort": "^0.3.0" + }, + "dependencies": { + "picocolors": { + "version": "0.2.1", + "resolved": "https://registry.npmmirror.com/picocolors/-/picocolors-0.2.1.tgz", + "integrity": "sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA==", + "dev": true + }, + "postcss": { + "version": "7.0.39", + "resolved": "https://registry.npmmirror.com/postcss/-/postcss-7.0.39.tgz", + "integrity": "sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA==", + "dev": true, + "requires": { + "picocolors": "^0.2.1", + "source-map": "^0.6.1" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmmirror.com/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "css-loader": { + "version": "3.6.0", + "resolved": "https://registry.npmmirror.com/css-loader/-/css-loader-3.6.0.tgz", + "integrity": "sha512-M5lSukoWi1If8dhQAUCvj4H8vUt3vOnwbQBH9DdTm/s4Ym2B/3dPMtYZeJmq7Q3S3Pa+I94DcZ7pc9bP14cWIQ==", + "dev": true, + "requires": { + "camelcase": "^5.3.1", + "cssesc": "^3.0.0", + "icss-utils": "^4.1.1", + "loader-utils": "^1.2.3", + "normalize-path": "^3.0.0", + "postcss": "^7.0.32", + "postcss-modules-extract-imports": "^2.0.0", + "postcss-modules-local-by-default": "^3.0.2", + "postcss-modules-scope": "^2.2.0", + "postcss-modules-values": "^3.0.0", + "postcss-value-parser": "^4.1.0", + "schema-utils": "^2.7.0", + "semver": "^6.3.0" + }, + "dependencies": { + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmmirror.com/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + }, + "json5": { + "version": "1.0.2", + "resolved": "https://registry.npmmirror.com/json5/-/json5-1.0.2.tgz", + "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", + "dev": true, + "requires": { + "minimist": "^1.2.0" + } + }, + "loader-utils": { + "version": "1.4.2", + "resolved": "https://registry.npmmirror.com/loader-utils/-/loader-utils-1.4.2.tgz", + "integrity": "sha512-I5d00Pd/jwMD2QCduo657+YM/6L3KZu++pmX9VFncxaxvHcru9jx1lBaFft+r4Mt2jK0Yhp41XlRAihzPxHNCg==", + "dev": true, + "requires": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^1.0.1" + } + }, + "picocolors": { + "version": "0.2.1", + "resolved": "https://registry.npmmirror.com/picocolors/-/picocolors-0.2.1.tgz", + "integrity": "sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA==", + "dev": true + }, + "postcss": { + "version": "7.0.39", + "resolved": "https://registry.npmmirror.com/postcss/-/postcss-7.0.39.tgz", + "integrity": "sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA==", + "dev": true, + "requires": { + "picocolors": "^0.2.1", + "source-map": "^0.6.1" + } + }, + "semver": { + "version": "6.3.1", + "resolved": "https://registry.npmmirror.com/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmmirror.com/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "css-select": { + "version": "2.1.0", + "resolved": "https://registry.npmmirror.com/css-select/-/css-select-2.1.0.tgz", + "integrity": "sha512-Dqk7LQKpwLoH3VovzZnkzegqNSuAziQyNZUcrdDM401iY+R5NkGBXGmtO05/yaXQziALuPogeG0b7UAgjnTJTQ==", + "dev": true, + "requires": { + "boolbase": "^1.0.0", + "css-what": "^3.2.1", + "domutils": "^1.7.0", + "nth-check": "^1.0.2" + } + }, + "css-select-base-adapter": { + "version": "0.1.1", + "resolved": "https://registry.npmmirror.com/css-select-base-adapter/-/css-select-base-adapter-0.1.1.tgz", + "integrity": "sha512-jQVeeRG70QI08vSTwf1jHxp74JoZsr2XSgETae8/xC8ovSnL2WF87GTLO86Sbwdt2lK4Umg4HnnwMO4YF3Ce7w==", + "dev": true + }, + "css-tree": { + "version": "1.0.0-alpha.37", + "resolved": "https://registry.npmmirror.com/css-tree/-/css-tree-1.0.0-alpha.37.tgz", + "integrity": "sha512-DMxWJg0rnz7UgxKT0Q1HU/L9BeJI0M6ksor0OgqOnF+aRCDWg/N2641HmVyU9KVIu0OVVWOb2IpC9A+BJRnejg==", + "dev": true, + "requires": { + "mdn-data": "2.0.4", + "source-map": "^0.6.1" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmmirror.com/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "css-what": { + "version": "3.4.2", + "resolved": "https://registry.npmmirror.com/css-what/-/css-what-3.4.2.tgz", + "integrity": "sha512-ACUm3L0/jiZTqfzRM3Hi9Q8eZqd6IK37mMWPLz9PJxkLWllYeRf+EHUSHYEtFop2Eqytaq1FizFVh7XfBnXCDQ==", + "dev": true + }, + "cssesc": { + "version": "3.0.0", + "resolved": "https://registry.npmmirror.com/cssesc/-/cssesc-3.0.0.tgz", + "integrity": "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==", + "dev": true + }, + "cssnano": { + "version": "4.1.11", + "resolved": "https://registry.npmmirror.com/cssnano/-/cssnano-4.1.11.tgz", + "integrity": "sha512-6gZm2htn7xIPJOHY824ERgj8cNPgPxyCSnkXc4v7YvNW+TdVfzgngHcEhy/8D11kUWRUMbke+tC+AUcUsnMz2g==", + "dev": true, + "requires": { + "cosmiconfig": "^5.0.0", + "cssnano-preset-default": "^4.0.8", + "is-resolvable": "^1.0.0", + "postcss": "^7.0.0" + }, + "dependencies": { + "picocolors": { + "version": "0.2.1", + "resolved": "https://registry.npmmirror.com/picocolors/-/picocolors-0.2.1.tgz", + "integrity": "sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA==", + "dev": true + }, + "postcss": { + "version": "7.0.39", + "resolved": "https://registry.npmmirror.com/postcss/-/postcss-7.0.39.tgz", + "integrity": "sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA==", + "dev": true, + "requires": { + "picocolors": "^0.2.1", + "source-map": "^0.6.1" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmmirror.com/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "cssnano-preset-default": { + "version": "4.0.8", + "resolved": "https://registry.npmmirror.com/cssnano-preset-default/-/cssnano-preset-default-4.0.8.tgz", + "integrity": "sha512-LdAyHuq+VRyeVREFmuxUZR1TXjQm8QQU/ktoo/x7bz+SdOge1YKc5eMN6pRW7YWBmyq59CqYba1dJ5cUukEjLQ==", + "dev": true, + "requires": { + "css-declaration-sorter": "^4.0.1", + "cssnano-util-raw-cache": "^4.0.1", + "postcss": "^7.0.0", + "postcss-calc": "^7.0.1", + "postcss-colormin": "^4.0.3", + "postcss-convert-values": "^4.0.1", + "postcss-discard-comments": "^4.0.2", + "postcss-discard-duplicates": "^4.0.2", + "postcss-discard-empty": "^4.0.1", + "postcss-discard-overridden": "^4.0.1", + "postcss-merge-longhand": "^4.0.11", + "postcss-merge-rules": "^4.0.3", + "postcss-minify-font-values": "^4.0.2", + "postcss-minify-gradients": "^4.0.2", + "postcss-minify-params": "^4.0.2", + "postcss-minify-selectors": "^4.0.2", + "postcss-normalize-charset": "^4.0.1", + "postcss-normalize-display-values": "^4.0.2", + "postcss-normalize-positions": "^4.0.2", + "postcss-normalize-repeat-style": "^4.0.2", + "postcss-normalize-string": "^4.0.2", + "postcss-normalize-timing-functions": "^4.0.2", + "postcss-normalize-unicode": "^4.0.1", + "postcss-normalize-url": "^4.0.1", + "postcss-normalize-whitespace": "^4.0.2", + "postcss-ordered-values": "^4.1.2", + "postcss-reduce-initial": "^4.0.3", + "postcss-reduce-transforms": "^4.0.2", + "postcss-svgo": "^4.0.3", + "postcss-unique-selectors": "^4.0.1" + }, + "dependencies": { + "picocolors": { + "version": "0.2.1", + "resolved": "https://registry.npmmirror.com/picocolors/-/picocolors-0.2.1.tgz", + "integrity": "sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA==", + "dev": true + }, + "postcss": { + "version": "7.0.39", + "resolved": "https://registry.npmmirror.com/postcss/-/postcss-7.0.39.tgz", + "integrity": "sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA==", + "dev": true, + "requires": { + "picocolors": "^0.2.1", + "source-map": "^0.6.1" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmmirror.com/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "cssnano-util-get-arguments": { + "version": "4.0.0", + "resolved": "https://registry.npmmirror.com/cssnano-util-get-arguments/-/cssnano-util-get-arguments-4.0.0.tgz", + "integrity": "sha512-6RIcwmV3/cBMG8Aj5gucQRsJb4vv4I4rn6YjPbVWd5+Pn/fuG+YseGvXGk00XLkoZkaj31QOD7vMUpNPC4FIuw==", + "dev": true + }, + "cssnano-util-get-match": { + "version": "4.0.0", + "resolved": "https://registry.npmmirror.com/cssnano-util-get-match/-/cssnano-util-get-match-4.0.0.tgz", + "integrity": "sha512-JPMZ1TSMRUPVIqEalIBNoBtAYbi8okvcFns4O0YIhcdGebeYZK7dMyHJiQ6GqNBA9kE0Hym4Aqym5rPdsV/4Cw==", + "dev": true + }, + "cssnano-util-raw-cache": { + "version": "4.0.1", + "resolved": "https://registry.npmmirror.com/cssnano-util-raw-cache/-/cssnano-util-raw-cache-4.0.1.tgz", + "integrity": "sha512-qLuYtWK2b2Dy55I8ZX3ky1Z16WYsx544Q0UWViebptpwn/xDBmog2TLg4f+DBMg1rJ6JDWtn96WHbOKDWt1WQA==", + "dev": true, + "requires": { + "postcss": "^7.0.0" + }, + "dependencies": { + "picocolors": { + "version": "0.2.1", + "resolved": "https://registry.npmmirror.com/picocolors/-/picocolors-0.2.1.tgz", + "integrity": "sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA==", + "dev": true + }, + "postcss": { + "version": "7.0.39", + "resolved": "https://registry.npmmirror.com/postcss/-/postcss-7.0.39.tgz", + "integrity": "sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA==", + "dev": true, + "requires": { + "picocolors": "^0.2.1", + "source-map": "^0.6.1" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmmirror.com/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "cssnano-util-same-parent": { + "version": "4.0.1", + "resolved": "https://registry.npmmirror.com/cssnano-util-same-parent/-/cssnano-util-same-parent-4.0.1.tgz", + "integrity": "sha512-WcKx5OY+KoSIAxBW6UBBRay1U6vkYheCdjyVNDm85zt5K9mHoGOfsOsqIszfAqrQQFIIKgjh2+FDgIj/zsl21Q==", + "dev": true + }, + "csso": { + "version": "4.2.0", + "resolved": "https://registry.npmmirror.com/csso/-/csso-4.2.0.tgz", + "integrity": "sha512-wvlcdIbf6pwKEk7vHj8/Bkc0B4ylXZruLvOgs9doS5eOsOpuodOV2zJChSpkp+pRpYQLQMeF04nr3Z68Sta9jA==", + "dev": true, + "requires": { + "css-tree": "^1.1.2" + }, + "dependencies": { + "css-tree": { + "version": "1.1.3", + "resolved": "https://registry.npmmirror.com/css-tree/-/css-tree-1.1.3.tgz", + "integrity": "sha512-tRpdppF7TRazZrjJ6v3stzv93qxRcSsFmW6cX0Zm2NVKpxE1WV1HblnghVv9TreireHkqI/VDEsfolRF1p6y7Q==", + "dev": true, + "requires": { + "mdn-data": "2.0.14", + "source-map": "^0.6.1" + } + }, + "mdn-data": { + "version": "2.0.14", + "resolved": "https://registry.npmmirror.com/mdn-data/-/mdn-data-2.0.14.tgz", + "integrity": "sha512-dn6wd0uw5GsdswPFfsgMp5NSB0/aDe6fK94YJV/AJDYXL6HVLWBsxeq7js7Ad+mU2K9LAlwpk6kN2D5mwCPVow==", + "dev": true + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmmirror.com/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "cyclist": { + "version": "1.0.2", + "resolved": "https://registry.npmmirror.com/cyclist/-/cyclist-1.0.2.tgz", + "integrity": "sha512-0sVXIohTfLqVIW3kb/0n6IiWF3Ifj5nm2XaSrLq2DI6fKIGa2fYAZdk917rUneaeLVpYfFcyXE2ft0fe3remsA==", + "dev": true + }, + "dashdash": { + "version": "1.14.1", + "resolved": "https://registry.npmmirror.com/dashdash/-/dashdash-1.14.1.tgz", + "integrity": "sha512-jRFi8UDGo6j+odZiEpjazZaWqEal3w/basFjQHQEwVtZJGDpxbH1MeYluwCS8Xq5wmLJooDlMgvVarmWfGM44g==", + "dev": true, + "requires": { + "assert-plus": "^1.0.0" + } + }, + "data-view-buffer": { + "version": "1.0.1", + "resolved": "https://registry.npmmirror.com/data-view-buffer/-/data-view-buffer-1.0.1.tgz", + "integrity": "sha512-0lht7OugA5x3iJLOWFhWK/5ehONdprk0ISXqVFn/NFrDu+cuc8iADFrGQz5BnRK7LLU3JmkbXSxaqX+/mXYtUA==", + "dev": true, + "requires": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + } + }, + "data-view-byte-length": { + "version": "1.0.1", + "resolved": "https://registry.npmmirror.com/data-view-byte-length/-/data-view-byte-length-1.0.1.tgz", + "integrity": "sha512-4J7wRJD3ABAzr8wP+OcIcqq2dlUKp4DVflx++hs5h5ZKydWMI6/D/fAot+yh6g2tHh8fLFTvNOaVN357NvSrOQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + } + }, + "data-view-byte-offset": { + "version": "1.0.0", + "resolved": "https://registry.npmmirror.com/data-view-byte-offset/-/data-view-byte-offset-1.0.0.tgz", + "integrity": "sha512-t/Ygsytq+R995EJ5PZlD4Cu56sWa8InXySaViRzw9apusqsOO2bQP+SbYzAhR0pFKoB+43lYy8rWban9JSuXnA==", + "dev": true, + "requires": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + } + }, + "de-indent": { + "version": "1.0.2", + "resolved": "https://registry.npmmirror.com/de-indent/-/de-indent-1.0.2.tgz", + "integrity": "sha512-e/1zu3xH5MQryN2zdVaF0OrdNLUbvWxzMbi+iNA6Bky7l1RoP8a2fIbRocyHclXt/arDrrR6lL3TqFD9pMQTsg==", + "dev": true + }, + "debug": { + "version": "4.3.4", + "resolved": "https://registry.npmmirror.com/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmmirror.com/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==", + "dev": true + }, + "decode-uri-component": { + "version": "0.2.2", + "resolved": "https://registry.npmmirror.com/decode-uri-component/-/decode-uri-component-0.2.2.tgz", + "integrity": "sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ==", + "dev": true + }, + "dedent": { + "version": "0.7.0", + "resolved": "https://registry.npmmirror.com/dedent/-/dedent-0.7.0.tgz", + "integrity": "sha512-Q6fKUPqnAHAyhiUgFU7BUzLiv0kd8saH9al7tnu5Q/okj6dnupxyTgFIBjVzJATdfIAm9NAsvXNzjaKa+bxVyA==", + "dev": true + }, + "deep-equal": { + "version": "1.1.2", + "resolved": "https://registry.npmmirror.com/deep-equal/-/deep-equal-1.1.2.tgz", + "integrity": "sha512-5tdhKF6DbU7iIzrIOa1AOUt39ZRm13cmL1cGEh//aqR8x9+tNfbywRf0n5FD/18OKMdo7DNEtrX2t22ZAkI+eg==", + "requires": { + "is-arguments": "^1.1.1", + "is-date-object": "^1.0.5", + "is-regex": "^1.1.4", + "object-is": "^1.1.5", + "object-keys": "^1.1.1", + "regexp.prototype.flags": "^1.5.1" + } + }, + "deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmmirror.com/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true + }, + "deepmerge": { + "version": "1.5.2", + "resolved": "https://registry.npmmirror.com/deepmerge/-/deepmerge-1.5.2.tgz", + "integrity": "sha512-95k0GDqvBjZavkuvzx/YqVLv/6YYa17fz6ILMSf7neqQITCPbnfEnQvEgMPNjH4kgobe7+WIL0yJEHku+H3qtQ==" + }, + "default-gateway": { + "version": "5.0.5", + "resolved": "https://registry.npmmirror.com/default-gateway/-/default-gateway-5.0.5.tgz", + "integrity": "sha512-z2RnruVmj8hVMmAnEJMTIJNijhKCDiGjbLP+BHJFOT7ld3Bo5qcIBpVYDniqhbMIIf+jZDlkP2MkPXiQy/DBLA==", + "dev": true, + "requires": { + "execa": "^3.3.0" + }, + "dependencies": { + "cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmmirror.com/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + } + }, + "execa": { + "version": "3.4.0", + "resolved": "https://registry.npmmirror.com/execa/-/execa-3.4.0.tgz", + "integrity": "sha512-r9vdGQk4bmCuK1yKQu1KTwcT2zwfWdbdaXfCtAh+5nU/4fSX+JAb7vZGvI5naJrQlvONrEB20jeruESI69530g==", + "dev": true, + "requires": { + "cross-spawn": "^7.0.0", + "get-stream": "^5.0.0", + "human-signals": "^1.1.1", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.0", + "onetime": "^5.1.0", + "p-finally": "^2.0.0", + "signal-exit": "^3.0.2", + "strip-final-newline": "^2.0.0" + } + }, + "get-stream": { + "version": "5.2.0", + "resolved": "https://registry.npmmirror.com/get-stream/-/get-stream-5.2.0.tgz", + "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", + "dev": true, + "requires": { + "pump": "^3.0.0" + } + }, + "is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmmirror.com/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "dev": true + }, + "mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmmirror.com/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true + }, + "npm-run-path": { + "version": "4.0.1", + "resolved": "https://registry.npmmirror.com/npm-run-path/-/npm-run-path-4.0.1.tgz", + "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", + "dev": true, + "requires": { + "path-key": "^3.0.0" + } + }, + "onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmmirror.com/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "dev": true, + "requires": { + "mimic-fn": "^2.1.0" + } + }, + "p-finally": { + "version": "2.0.1", + "resolved": "https://registry.npmmirror.com/p-finally/-/p-finally-2.0.1.tgz", + "integrity": "sha512-vpm09aKwq6H9phqRQzecoDpD8TmVyGw70qmWlyq5onxY7tqyTTFVvxMykxQSQKILBSFlbXpypIw2T1Ml7+DDtw==", + "dev": true + }, + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmmirror.com/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true + }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmmirror.com/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmmirror.com/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + } + } + }, + "defaults": { + "version": "1.0.4", + "resolved": "https://registry.npmmirror.com/defaults/-/defaults-1.0.4.tgz", + "integrity": "sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==", + "dev": true, + "requires": { + "clone": "^1.0.2" + }, + "dependencies": { + "clone": { + "version": "1.0.4", + "resolved": "https://registry.npmmirror.com/clone/-/clone-1.0.4.tgz", + "integrity": "sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==", + "dev": true + } + } + }, + "define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmmirror.com/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "requires": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + } + }, + "define-properties": { + "version": "1.2.1", + "resolved": "https://registry.npmmirror.com/define-properties/-/define-properties-1.2.1.tgz", + "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", + "requires": { + "define-data-property": "^1.0.1", + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" + } + }, + "define-property": { + "version": "2.0.2", + "resolved": "https://registry.npmmirror.com/define-property/-/define-property-2.0.2.tgz", + "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", + "dev": true, + "requires": { + "is-descriptor": "^1.0.2", + "isobject": "^3.0.1" + }, + "dependencies": { + "is-descriptor": { + "version": "1.0.3", + "resolved": "https://registry.npmmirror.com/is-descriptor/-/is-descriptor-1.0.3.tgz", + "integrity": "sha512-JCNNGbwWZEVaSPtS45mdtrneRWJFp07LLmykxeFV5F6oBvNF8vHSfJuJgoT472pSfk+Mf8VnlrspaFBHWM8JAw==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.1", + "is-data-descriptor": "^1.0.1" + } + } + } + }, + "del": { + "version": "4.1.1", + "resolved": "https://registry.npmmirror.com/del/-/del-4.1.1.tgz", + "integrity": "sha512-QwGuEUouP2kVwQenAsOof5Fv8K9t3D8Ca8NxcXKrIpEHjTXK5J2nXLdP+ALI1cgv8wj7KuwBhTwBkOZSJKM5XQ==", + "dev": true, + "requires": { + "@types/glob": "^7.1.1", + "globby": "^6.1.0", + "is-path-cwd": "^2.0.0", + "is-path-in-cwd": "^2.0.0", + "p-map": "^2.0.0", + "pify": "^4.0.1", + "rimraf": "^2.6.3" + }, + "dependencies": { + "globby": { + "version": "6.1.0", + "resolved": "https://registry.npmmirror.com/globby/-/globby-6.1.0.tgz", + "integrity": "sha512-KVbFv2TQtbzCoxAnfD6JcHZTYCzyliEaaeM/gH8qQdkKr5s0OP9scEgvdcngyk7AVdY6YVW/TJHd+lQ/Df3Daw==", + "dev": true, + "requires": { + "array-union": "^1.0.1", + "glob": "^7.0.3", + "object-assign": "^4.0.1", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" + }, + "dependencies": { + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmmirror.com/pify/-/pify-2.3.0.tgz", + "integrity": "sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==", + "dev": true + } + } + }, + "p-map": { + "version": "2.1.0", + "resolved": "https://registry.npmmirror.com/p-map/-/p-map-2.1.0.tgz", + "integrity": "sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw==", + "dev": true + } + } + }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmmirror.com/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "dev": true + }, + "delegate": { + "version": "3.2.0", + "resolved": "https://registry.npmmirror.com/delegate/-/delegate-3.2.0.tgz", + "integrity": "sha512-IofjkYBZaZivn0V8nnsMJGBr4jVLxHDheKSW88PyxS5QC4Vo9ZbZVvhzlSxY87fVq3STR6r+4cGepyHkcWOQSw==" + }, + "depd": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "dev": true + }, + "des.js": { + "version": "1.1.0", + "resolved": "https://registry.npmmirror.com/des.js/-/des.js-1.1.0.tgz", + "integrity": "sha512-r17GxjhUCjSRy8aiJpr8/UadFIzMzJGexI3Nmz4ADi9LYSFx4gTBp80+NaX/YsXWWLhpZ7v/v/ubEc/bCNfKwg==", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0" + } + }, + "destroy": { + "version": "1.2.0", + "resolved": "https://registry.npmmirror.com/destroy/-/destroy-1.2.0.tgz", + "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", + "dev": true + }, + "detect-node": { + "version": "2.1.0", + "resolved": "https://registry.npmmirror.com/detect-node/-/detect-node-2.1.0.tgz", + "integrity": "sha512-T0NIuQpnTvFDATNuHN5roPwSBG83rFsuO+MXXH9/3N1eFbn4wcPjttvjMLEPWJ0RGUYgQE7cGgS3tNxbqCGM7g==", + "dev": true + }, + "diffie-hellman": { + "version": "5.0.3", + "resolved": "https://registry.npmmirror.com/diffie-hellman/-/diffie-hellman-5.0.3.tgz", + "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", + "dev": true, + "requires": { + "bn.js": "^4.1.0", + "miller-rabin": "^4.0.0", + "randombytes": "^2.0.0" + }, + "dependencies": { + "bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmmirror.com/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", + "dev": true + } + } + }, + "dir-glob": { + "version": "2.2.2", + "resolved": "https://registry.npmmirror.com/dir-glob/-/dir-glob-2.2.2.tgz", + "integrity": "sha512-f9LBi5QWzIW3I6e//uxZoLBlUt9kcp66qo0sSCxL6YZKc75R1c4MFCoe/LaZiBGmgujvQdxc5Bn3QhfyvK5Hsw==", + "dev": true, + "requires": { + "path-type": "^3.0.0" + } + }, + "dns-equal": { + "version": "1.0.0", + "resolved": "https://registry.npmmirror.com/dns-equal/-/dns-equal-1.0.0.tgz", + "integrity": "sha512-z+paD6YUQsk+AbGCEM4PrOXSss5gd66QfcVBFTKR/HpFL9jCqikS94HYwKww6fQyO7IxrIIyUu+g0Ka9tUS2Cg==", + "dev": true + }, + "dns-packet": { + "version": "1.3.4", + "resolved": "https://registry.npmmirror.com/dns-packet/-/dns-packet-1.3.4.tgz", + "integrity": "sha512-BQ6F4vycLXBvdrJZ6S3gZewt6rcrks9KBgM9vrhW+knGRqc8uEdT7fuCwloc7nny5xNoMJ17HGH0R/6fpo8ECA==", + "dev": true, + "requires": { + "ip": "^1.1.0", + "safe-buffer": "^5.0.1" + } + }, + "dns-txt": { + "version": "2.0.2", + "resolved": "https://registry.npmmirror.com/dns-txt/-/dns-txt-2.0.2.tgz", + "integrity": "sha512-Ix5PrWjphuSoUXV/Zv5gaFHjnaJtb02F2+Si3Ht9dyJ87+Z/lMmy+dpNHtTGraNK958ndXq2i+GLkWsWHcKaBQ==", + "dev": true, + "requires": { + "buffer-indexof": "^1.0.0" + } + }, + "doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmmirror.com/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "requires": { + "esutils": "^2.0.2" + } + }, + "dom-converter": { + "version": "0.2.0", + "resolved": "https://registry.npmmirror.com/dom-converter/-/dom-converter-0.2.0.tgz", + "integrity": "sha512-gd3ypIPfOMr9h5jIKq8E3sHOTCjeirnl0WK5ZdS1AW0Odt0b1PaWaHdJ4Qk4klv+YB9aJBS7mESXjFoDQPu6DA==", + "dev": true, + "requires": { + "utila": "~0.4" + } + }, + "dom-serializer": { + "version": "0.2.2", + "resolved": "https://registry.npmmirror.com/dom-serializer/-/dom-serializer-0.2.2.tgz", + "integrity": "sha512-2/xPb3ORsQ42nHYiSunXkDjPLBaEj/xTwUO4B7XCZQTRk7EBtTOPaygh10YAAh2OI1Qrp6NWfpAhzswj0ydt9g==", + "dev": true, + "requires": { + "domelementtype": "^2.0.1", + "entities": "^2.0.0" + }, + "dependencies": { + "domelementtype": { + "version": "2.3.0", + "resolved": "https://registry.npmmirror.com/domelementtype/-/domelementtype-2.3.0.tgz", + "integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==", + "dev": true + }, + "entities": { + "version": "2.2.0", + "resolved": "https://registry.npmmirror.com/entities/-/entities-2.2.0.tgz", + "integrity": "sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A==", + "dev": true + } + } + }, + "domain-browser": { + "version": "1.2.0", + "resolved": "https://registry.npmmirror.com/domain-browser/-/domain-browser-1.2.0.tgz", + "integrity": "sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA==", + "dev": true + }, + "domelementtype": { + "version": "1.3.1", + "resolved": "https://registry.npmmirror.com/domelementtype/-/domelementtype-1.3.1.tgz", + "integrity": "sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w==", + "dev": true + }, + "domhandler": { + "version": "4.3.1", + "resolved": "https://registry.npmmirror.com/domhandler/-/domhandler-4.3.1.tgz", + "integrity": "sha512-GrwoxYN+uWlzO8uhUXRl0P+kHE4GtVPfYzVLcUxPL7KNdHKj66vvlhiweIHqYYXWlw+T8iLMp42Lm67ghw4WMQ==", + "dev": true, + "requires": { + "domelementtype": "^2.2.0" + }, + "dependencies": { + "domelementtype": { + "version": "2.3.0", + "resolved": "https://registry.npmmirror.com/domelementtype/-/domelementtype-2.3.0.tgz", + "integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==", + "dev": true + } + } + }, + "domready": { + "version": "1.0.8", + "resolved": "https://registry.npmmirror.com/domready/-/domready-1.0.8.tgz", + "integrity": "sha512-uIzsOJUNk+AdGE9a6VDeessoMCzF8RrZvJCX/W8QtyfgdR6Uofn/MvRonih3OtCO79b2VDzDOymuiABrQ4z3XA==", + "dev": true + }, + "domutils": { + "version": "1.7.0", + "resolved": "https://registry.npmmirror.com/domutils/-/domutils-1.7.0.tgz", + "integrity": "sha512-Lgd2XcJ/NjEw+7tFvfKxOzCYKZsdct5lczQ2ZaQY8Djz7pfAD3Gbp8ySJWtreII/vDlMVmxwa6pHmdxIYgttDg==", + "dev": true, + "requires": { + "dom-serializer": "0", + "domelementtype": "1" + } + }, + "dot-prop": { + "version": "5.3.0", + "resolved": "https://registry.npmmirror.com/dot-prop/-/dot-prop-5.3.0.tgz", + "integrity": "sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==", + "dev": true, + "requires": { + "is-obj": "^2.0.0" + } + }, + "dotenv": { + "version": "8.6.0", + "resolved": "https://registry.npmmirror.com/dotenv/-/dotenv-8.6.0.tgz", + "integrity": "sha512-IrPdXQsk2BbzvCBGBOTmmSH5SodmqZNt4ERAZDmW4CT+tL8VtvinqywuANaFu4bOMWki16nqf0e4oC0QIaDr/g==", + "dev": true + }, + "dotenv-expand": { + "version": "5.1.0", + "resolved": "https://registry.npmmirror.com/dotenv-expand/-/dotenv-expand-5.1.0.tgz", + "integrity": "sha512-YXQl1DSa4/PQyRfgrv6aoNjhasp/p4qs9FjJ4q4cQk+8m4r6k4ZSiEyytKG8f8W9gi8WsQtIObNmKd+tMzNTmA==", + "dev": true + }, + "duplexer": { + "version": "0.1.2", + "resolved": "https://registry.npmmirror.com/duplexer/-/duplexer-0.1.2.tgz", + "integrity": "sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg==", + "dev": true + }, + "duplexify": { + "version": "3.7.1", + "resolved": "https://registry.npmmirror.com/duplexify/-/duplexify-3.7.1.tgz", + "integrity": "sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g==", + "dev": true, + "requires": { + "end-of-stream": "^1.0.0", + "inherits": "^2.0.1", + "readable-stream": "^2.0.0", + "stream-shift": "^1.0.0" + } + }, + "easings-css": { + "version": "1.0.0", + "resolved": "https://registry.npmmirror.com/easings-css/-/easings-css-1.0.0.tgz", + "integrity": "sha512-7Uq7NdazNfVtr0RNmPAys8it0zKCuaqxJStYKEl72D3j4gbvXhhaM7iWNbqhA4C94ygCye6VuyhzBRQC4szeBg==" + }, + "easy-stack": { + "version": "1.0.1", + "resolved": "https://registry.npmmirror.com/easy-stack/-/easy-stack-1.0.1.tgz", + "integrity": "sha512-wK2sCs4feiiJeFXn3zvY0p41mdU5VUgbgs1rNsc/y5ngFUijdWd+iIN8eoyuZHKB8xN6BL4PdWmzqFmxNg6V2w==", + "dev": true + }, + "ecc-jsbn": { + "version": "0.1.2", + "resolved": "https://registry.npmmirror.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", + "integrity": "sha512-eh9O+hwRHNbG4BLTjEl3nw044CkGm5X6LoaCf7LPp7UU8Qrt47JYNi6nPX8xjW97TKGKm1ouctg0QSpZe9qrnw==", + "dev": true, + "requires": { + "jsbn": "~0.1.0", + "safer-buffer": "^2.1.0" + } + }, + "echarts": { + "version": "5.4.0", + "resolved": "https://registry.npmmirror.com/echarts/-/echarts-5.4.0.tgz", + "integrity": "sha512-uPsO9VRUIKAdFOoH3B0aNg7NRVdN7aM39/OjovjO9MwmWsAkfGyeXJhK+dbRi51iDrQWliXV60/XwLA7kg3z0w==", + "requires": { + "tslib": "2.3.0", + "zrender": "5.4.0" + } + }, + "editorconfig": { + "version": "0.15.3", + "resolved": "https://registry.npmmirror.com/editorconfig/-/editorconfig-0.15.3.tgz", + "integrity": "sha512-M9wIMFx96vq0R4F+gRpY3o2exzb8hEj/n9S8unZtHSvYjibBp/iMufSzvmOcV/laG0ZtuTVGtiJggPOSW2r93g==", + "requires": { + "commander": "^2.19.0", + "lru-cache": "^4.1.5", + "semver": "^5.6.0", + "sigmund": "^1.0.1" + } + }, + "ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmmirror.com/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", + "dev": true + }, + "ejs": { + "version": "2.7.4", + "resolved": "https://registry.npmmirror.com/ejs/-/ejs-2.7.4.tgz", + "integrity": "sha512-7vmuyh5+kuUyJKePhQfRQBhXV5Ce+RnaeeQArKu1EAMpL3WbgMt5WG6uQZpEVvYSSsxMXRKOewtDk9RaTKXRlA==", + "dev": true + }, + "electron-to-chromium": { + "version": "1.4.783", + "resolved": "https://registry.npmmirror.com/electron-to-chromium/-/electron-to-chromium-1.4.783.tgz", + "integrity": "sha512-bT0jEz/Xz1fahQpbZ1D7LgmPYZ3iHVY39NcWWro1+hA2IvjiPeaXtfSqrQ+nXjApMvQRE2ASt1itSLRrebHMRQ==", + "dev": true + }, + "element-ui": { + "version": "2.15.12", + "resolved": "https://registry.npmmirror.com/element-ui/-/element-ui-2.15.12.tgz", + "integrity": "sha512-Y5FMT2BPOindU2GkDEQ5ZKUVxDawKONRNMh2eL3uBx1FOtvUJ+L6IxXLVsNxq4WnaX/UnVNgWXebl7DobygZMg==", + "requires": { + "async-validator": "~1.8.1", + "babel-helper-vue-jsx-merge-props": "^2.0.0", + "deepmerge": "^1.2.0", + "normalize-wheel": "^1.0.1", + "resize-observer-polyfill": "^1.5.0", + "throttle-debounce": "^1.0.1" + } + }, + "elliptic": { + "version": "6.5.5", + "resolved": "https://registry.npmmirror.com/elliptic/-/elliptic-6.5.5.tgz", + "integrity": "sha512-7EjbcmUm17NQFu4Pmgmq2olYMj8nwMnpcddByChSUjArp8F5DQWcIcpriwO4ZToLNAJig0yiyjswfyGNje/ixw==", + "dev": true, + "requires": { + "bn.js": "^4.11.9", + "brorand": "^1.1.0", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.1", + "inherits": "^2.0.4", + "minimalistic-assert": "^1.0.1", + "minimalistic-crypto-utils": "^1.0.1" + }, + "dependencies": { + "bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmmirror.com/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", + "dev": true + } + } + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmmirror.com/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "emojis-list": { + "version": "3.0.0", + "resolved": "https://registry.npmmirror.com/emojis-list/-/emojis-list-3.0.0.tgz", + "integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==", + "dev": true + }, + "encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmmirror.com/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", + "dev": true + }, + "end-of-stream": { + "version": "1.4.4", + "resolved": "https://registry.npmmirror.com/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "dev": true, + "requires": { + "once": "^1.4.0" + } + }, + "enhanced-resolve": { + "version": "4.5.0", + "resolved": "https://registry.npmmirror.com/enhanced-resolve/-/enhanced-resolve-4.5.0.tgz", + "integrity": "sha512-Nv9m36S/vxpsI+Hc4/ZGRs0n9mXqSWGGq49zxb/cJfPAQMbUtttJAlNPS4AQzaBdw/pKskw5bMbekT/Y7W/Wlg==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "memory-fs": "^0.5.0", + "tapable": "^1.0.0" + }, + "dependencies": { + "memory-fs": { + "version": "0.5.0", + "resolved": "https://registry.npmmirror.com/memory-fs/-/memory-fs-0.5.0.tgz", + "integrity": "sha512-jA0rdU5KoQMC0e6ppoNRtpp6vjFq6+NY7r8hywnC7V+1Xj/MtHwGIbB1QaK/dunyjWteJzmkpd7ooeWg10T7GA==", + "dev": true, + "requires": { + "errno": "^0.1.3", + "readable-stream": "^2.0.1" + } + } + } + }, + "enquirer": { + "version": "2.4.1", + "resolved": "https://registry.npmmirror.com/enquirer/-/enquirer-2.4.1.tgz", + "integrity": "sha512-rRqJg/6gd538VHvR3PSrdRBb/1Vy2YfzHqzvbhGIQpDRKIa4FgV/54b5Q1xYSxOOwKvjXweS26E0Q+nAMwp2pQ==", + "dev": true, + "requires": { + "ansi-colors": "^4.1.1", + "strip-ansi": "^6.0.1" + }, + "dependencies": { + "ansi-colors": { + "version": "4.1.3", + "resolved": "https://registry.npmmirror.com/ansi-colors/-/ansi-colors-4.1.3.tgz", + "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==", + "dev": true + } + } + }, + "entities": { + "version": "4.5.0", + "resolved": "https://registry.npmmirror.com/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "dev": true + }, + "errno": { + "version": "0.1.8", + "resolved": "https://registry.npmmirror.com/errno/-/errno-0.1.8.tgz", + "integrity": "sha512-dJ6oBr5SQ1VSd9qkk7ByRgb/1SH4JZjCHSW/mr63/QcXO9zLVxvJ6Oy13nio03rxpSnVDDjFor75SjVeZWPW/A==", + "dev": true, + "requires": { + "prr": "~1.0.1" + } + }, + "error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmmirror.com/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "requires": { + "is-arrayish": "^0.2.1" + } + }, + "error-stack-parser": { + "version": "2.1.4", + "resolved": "https://registry.npmmirror.com/error-stack-parser/-/error-stack-parser-2.1.4.tgz", + "integrity": "sha512-Sk5V6wVazPhq5MhpO+AUxJn5x7XSXGl1R93Vn7i+zS15KDVxQijejNCrz8340/2bgLBjR9GtEG8ZVKONDjcqGQ==", + "dev": true, + "requires": { + "stackframe": "^1.3.4" + } + }, + "es-abstract": { + "version": "1.23.3", + "resolved": "https://registry.npmmirror.com/es-abstract/-/es-abstract-1.23.3.tgz", + "integrity": "sha512-e+HfNH61Bj1X9/jLc5v1owaLYuHdeHHSQlkhCBiTK8rBvKaULl/beGMxwrMXjpYrv4pz22BlY570vVePA2ho4A==", + "dev": true, + "requires": { + "array-buffer-byte-length": "^1.0.1", + "arraybuffer.prototype.slice": "^1.0.3", + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", + "data-view-buffer": "^1.0.1", + "data-view-byte-length": "^1.0.1", + "data-view-byte-offset": "^1.0.0", + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "es-set-tostringtag": "^2.0.3", + "es-to-primitive": "^1.2.1", + "function.prototype.name": "^1.1.6", + "get-intrinsic": "^1.2.4", + "get-symbol-description": "^1.0.2", + "globalthis": "^1.0.3", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2", + "has-proto": "^1.0.3", + "has-symbols": "^1.0.3", + "hasown": "^2.0.2", + "internal-slot": "^1.0.7", + "is-array-buffer": "^3.0.4", + "is-callable": "^1.2.7", + "is-data-view": "^1.0.1", + "is-negative-zero": "^2.0.3", + "is-regex": "^1.1.4", + "is-shared-array-buffer": "^1.0.3", + "is-string": "^1.0.7", + "is-typed-array": "^1.1.13", + "is-weakref": "^1.0.2", + "object-inspect": "^1.13.1", + "object-keys": "^1.1.1", + "object.assign": "^4.1.5", + "regexp.prototype.flags": "^1.5.2", + "safe-array-concat": "^1.1.2", + "safe-regex-test": "^1.0.3", + "string.prototype.trim": "^1.2.9", + "string.prototype.trimend": "^1.0.8", + "string.prototype.trimstart": "^1.0.8", + "typed-array-buffer": "^1.0.2", + "typed-array-byte-length": "^1.0.1", + "typed-array-byte-offset": "^1.0.2", + "typed-array-length": "^1.0.6", + "unbox-primitive": "^1.0.2", + "which-typed-array": "^1.1.15" + } + }, + "es-array-method-boxes-properly": { + "version": "1.0.0", + "resolved": "https://registry.npmmirror.com/es-array-method-boxes-properly/-/es-array-method-boxes-properly-1.0.0.tgz", + "integrity": "sha512-wd6JXUmyHmt8T5a2xreUwKcGPq6f1f+WwIJkijUqiGcJz1qqnZgP6XIK+QyIWU5lT7imeNxUll48bziG+TSYcA==", + "dev": true + }, + "es-define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmmirror.com/es-define-property/-/es-define-property-1.0.0.tgz", + "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "requires": { + "get-intrinsic": "^1.2.4" + } + }, + "es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmmirror.com/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==" + }, + "es-object-atoms": { + "version": "1.0.0", + "resolved": "https://registry.npmmirror.com/es-object-atoms/-/es-object-atoms-1.0.0.tgz", + "integrity": "sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw==", + "dev": true, + "requires": { + "es-errors": "^1.3.0" + } + }, + "es-set-tostringtag": { + "version": "2.0.3", + "resolved": "https://registry.npmmirror.com/es-set-tostringtag/-/es-set-tostringtag-2.0.3.tgz", + "integrity": "sha512-3T8uNMC3OQTHkFUsFq8r/BwAXLHvU/9O9mE0fBc/MY5iq/8H7ncvO947LmYA6ldWw9Uh8Yhf25zu6n7nML5QWQ==", + "dev": true, + "requires": { + "get-intrinsic": "^1.2.4", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.1" + } + }, + "es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmmirror.com/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "dev": true, + "requires": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + } + }, + "escalade": { + "version": "3.1.2", + "resolved": "https://registry.npmmirror.com/escalade/-/escalade-3.1.2.tgz", + "integrity": "sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==", + "dev": true + }, + "escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmmirror.com/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", + "dev": true + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmmirror.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true + }, + "eslint": { + "version": "7.15.0", + "resolved": "https://registry.npmmirror.com/eslint/-/eslint-7.15.0.tgz", + "integrity": "sha512-Vr64xFDT8w30wFll643e7cGrIkPEU50yIiI36OdSIDoSGguIeaLzBo0vpGvzo9RECUqq7htURfwEtKqwytkqzA==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "@eslint/eslintrc": "^0.2.2", + "ajv": "^6.10.0", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.0.1", + "doctrine": "^3.0.0", + "enquirer": "^2.3.5", + "eslint-scope": "^5.1.1", + "eslint-utils": "^2.1.0", + "eslint-visitor-keys": "^2.0.0", + "espree": "^7.3.1", + "esquery": "^1.2.0", + "esutils": "^2.0.2", + "file-entry-cache": "^6.0.0", + "functional-red-black-tree": "^1.0.1", + "glob-parent": "^5.0.0", + "globals": "^12.1.0", + "ignore": "^4.0.6", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "js-yaml": "^3.13.1", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash": "^4.17.19", + "minimatch": "^3.0.4", + "natural-compare": "^1.4.0", + "optionator": "^0.9.1", + "progress": "^2.0.0", + "regexpp": "^3.1.0", + "semver": "^7.2.1", + "strip-ansi": "^6.0.0", + "strip-json-comments": "^3.1.0", + "table": "^5.2.3", + "text-table": "^0.2.0", + "v8-compile-cache": "^2.0.3" + }, + "dependencies": { + "cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmmirror.com/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + } + }, + "eslint-scope": { + "version": "5.1.1", + "resolved": "https://registry.npmmirror.com/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "dev": true, + "requires": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + } + }, + "eslint-visitor-keys": { + "version": "2.1.0", + "resolved": "https://registry.npmmirror.com/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", + "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", + "dev": true + }, + "globals": { + "version": "12.4.0", + "resolved": "https://registry.npmmirror.com/globals/-/globals-12.4.0.tgz", + "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", + "dev": true, + "requires": { + "type-fest": "^0.8.1" + } + }, + "import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmmirror.com/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "dev": true, + "requires": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + } + }, + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmmirror.com/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true + }, + "resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmmirror.com/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true + }, + "semver": { + "version": "7.6.2", + "resolved": "https://registry.npmmirror.com/semver/-/semver-7.6.2.tgz", + "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", + "dev": true + }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmmirror.com/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true + }, + "type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmmirror.com/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "dev": true + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmmirror.com/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + } + } + }, + "eslint-loader": { + "version": "2.2.1", + "resolved": "https://registry.npmmirror.com/eslint-loader/-/eslint-loader-2.2.1.tgz", + "integrity": "sha512-RLgV9hoCVsMLvOxCuNjdqOrUqIj9oJg8hF44vzJaYqsAHuY9G2YAeN3joQ9nxP0p5Th9iFSIpKo+SD8KISxXRg==", + "dev": true, + "requires": { + "loader-fs-cache": "^1.0.0", + "loader-utils": "^1.0.2", + "object-assign": "^4.0.1", + "object-hash": "^1.1.4", + "rimraf": "^2.6.1" + }, + "dependencies": { + "json5": { + "version": "1.0.2", + "resolved": "https://registry.npmmirror.com/json5/-/json5-1.0.2.tgz", + "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", + "dev": true, + "requires": { + "minimist": "^1.2.0" + } + }, + "loader-utils": { + "version": "1.4.2", + "resolved": "https://registry.npmmirror.com/loader-utils/-/loader-utils-1.4.2.tgz", + "integrity": "sha512-I5d00Pd/jwMD2QCduo657+YM/6L3KZu++pmX9VFncxaxvHcru9jx1lBaFft+r4Mt2jK0Yhp41XlRAihzPxHNCg==", + "dev": true, + "requires": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^1.0.1" + } + } + } + }, + "eslint-plugin-vue": { + "version": "7.2.0", + "resolved": "https://registry.npmmirror.com/eslint-plugin-vue/-/eslint-plugin-vue-7.2.0.tgz", + "integrity": "sha512-4mt0yIv6rBDNtvis/g22a0ozJ12GfcdEzX77u0ICYjKlxOVtGrKGEvo0cbOObHaKDg9a9kJcoaNodqE4TPfS2A==", + "dev": true, + "requires": { + "eslint-utils": "^2.1.0", + "natural-compare": "^1.4.0", + "semver": "^7.3.2", + "vue-eslint-parser": "^7.2.0" + }, + "dependencies": { + "semver": { + "version": "7.6.2", + "resolved": "https://registry.npmmirror.com/semver/-/semver-7.6.2.tgz", + "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", + "dev": true + } + } + }, + "eslint-scope": { + "version": "4.0.3", + "resolved": "https://registry.npmmirror.com/eslint-scope/-/eslint-scope-4.0.3.tgz", + "integrity": "sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg==", + "dev": true, + "requires": { + "esrecurse": "^4.1.0", + "estraverse": "^4.1.1" + } + }, + "eslint-utils": { + "version": "2.1.0", + "resolved": "https://registry.npmmirror.com/eslint-utils/-/eslint-utils-2.1.0.tgz", + "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^1.1.0" + } + }, + "eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmmirror.com/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "dev": true + }, + "espree": { + "version": "7.3.1", + "resolved": "https://registry.npmmirror.com/espree/-/espree-7.3.1.tgz", + "integrity": "sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==", + "dev": true, + "requires": { + "acorn": "^7.4.0", + "acorn-jsx": "^5.3.1", + "eslint-visitor-keys": "^1.3.0" + }, + "dependencies": { + "acorn": { + "version": "7.4.1", + "resolved": "https://registry.npmmirror.com/acorn/-/acorn-7.4.1.tgz", + "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", + "dev": true + } + } + }, + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmmirror.com/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true + }, + "esquery": { + "version": "1.5.0", + "resolved": "https://registry.npmmirror.com/esquery/-/esquery-1.5.0.tgz", + "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", + "dev": true, + "requires": { + "estraverse": "^5.1.0" + }, + "dependencies": { + "estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmmirror.com/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true + } + } + }, + "esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmmirror.com/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "requires": { + "estraverse": "^5.2.0" + }, + "dependencies": { + "estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmmirror.com/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true + } + } + }, + "estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmmirror.com/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true + }, + "estree-walker": { + "version": "2.0.2", + "resolved": "https://registry.npmmirror.com/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", + "dev": true + }, + "esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmmirror.com/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true + }, + "etag": { + "version": "1.8.1", + "resolved": "https://registry.npmmirror.com/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", + "dev": true + }, + "event-pubsub": { + "version": "4.3.0", + "resolved": "https://registry.npmmirror.com/event-pubsub/-/event-pubsub-4.3.0.tgz", + "integrity": "sha512-z7IyloorXvKbFx9Bpie2+vMJKKx1fH1EN5yiTfp8CiLOTptSYy1g8H4yDpGlEdshL1PBiFtBHepF2cNsqeEeFQ==", + "dev": true + }, + "eventemitter3": { + "version": "2.0.3", + "resolved": "https://registry.npmmirror.com/eventemitter3/-/eventemitter3-2.0.3.tgz", + "integrity": "sha512-jLN68Dx5kyFHaePoXWPsCGW5qdyZQtLYHkxkg02/Mz6g0kYpDx4FyP6XfArhQdlOC4b8Mv+EMxPo/8La7Tzghg==" + }, + "events": { + "version": "3.3.0", + "resolved": "https://registry.npmmirror.com/events/-/events-3.3.0.tgz", + "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", + "dev": true + }, + "eventsource": { + "version": "2.0.2", + "resolved": "https://registry.npmmirror.com/eventsource/-/eventsource-2.0.2.tgz", + "integrity": "sha512-IzUmBGPR3+oUG9dUeXynyNmf91/3zUSJg1lCktzKw47OXuhco54U3r9B7O4XX+Rb1Itm9OZ2b0RkTs10bICOxA==", + "dev": true + }, + "evp_bytestokey": { + "version": "1.0.3", + "resolved": "https://registry.npmmirror.com/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", + "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", + "dev": true, + "requires": { + "md5.js": "^1.3.4", + "safe-buffer": "^5.1.1" + } + }, + "execa": { + "version": "1.0.0", + "resolved": "https://registry.npmmirror.com/execa/-/execa-1.0.0.tgz", + "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", + "dev": true, + "requires": { + "cross-spawn": "^6.0.0", + "get-stream": "^4.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" + } + }, + "expand-brackets": { + "version": "2.1.4", + "resolved": "https://registry.npmmirror.com/expand-brackets/-/expand-brackets-2.1.4.tgz", + "integrity": "sha512-w/ozOKR9Obk3qoWeY/WDi6MFta9AoMR+zud60mdnbniMcBxRuFJyDt2LdX/14A1UABeqk+Uk+LDfUpvoGKppZA==", + "dev": true, + "requires": { + "debug": "^2.3.3", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "posix-character-classes": "^0.1.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmmirror.com/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmmirror.com/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha512-Rr7ADjQZenceVOAKop6ALkkRAmH1A4Gx9hV/7ZujPUN2rkATqFO0JZLZInbAjpZYoJ1gUx8MRMQVkYemcbMSTA==", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmmirror.com/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "dev": true + } + } + }, + "express": { + "version": "4.19.2", + "resolved": "https://registry.npmmirror.com/express/-/express-4.19.2.tgz", + "integrity": "sha512-5T6nhjsT+EOMzuck8JjBHARTHfMht0POzlA60WV2pMD3gyXw2LZnZ+ueGdNxG+0calOJcWKbpFcuzLZ91YWq9Q==", + "dev": true, + "requires": { + "accepts": "~1.3.8", + "array-flatten": "1.1.1", + "body-parser": "1.20.2", + "content-disposition": "0.5.4", + "content-type": "~1.0.4", + "cookie": "0.6.0", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "2.0.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "1.2.0", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "merge-descriptors": "1.0.1", + "methods": "~1.1.2", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "path-to-regexp": "0.1.7", + "proxy-addr": "~2.0.7", + "qs": "6.11.0", + "range-parser": "~1.2.1", + "safe-buffer": "5.2.1", + "send": "0.18.0", + "serve-static": "1.15.0", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "type-is": "~1.6.18", + "utils-merge": "1.0.1", + "vary": "~1.1.2" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmmirror.com/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "dev": true + }, + "qs": { + "version": "6.11.0", + "resolved": "https://registry.npmmirror.com/qs/-/qs-6.11.0.tgz", + "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", + "dev": true, + "requires": { + "side-channel": "^1.0.4" + } + } + } + }, + "extend": { + "version": "3.0.2", + "resolved": "https://registry.npmmirror.com/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" + }, + "extend-shallow": { + "version": "3.0.2", + "resolved": "https://registry.npmmirror.com/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha512-BwY5b5Ql4+qZoefgMj2NUmx+tehVTH/Kf4k1ZEtOHNFcm2wSxMRo992l6X3TIgni2eZVTZ85xMOjF31fwZAj6Q==", + "dev": true, + "requires": { + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmmirror.com/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, + "requires": { + "is-plain-object": "^2.0.4" + } + } + } + }, + "external-editor": { + "version": "3.1.0", + "resolved": "https://registry.npmmirror.com/external-editor/-/external-editor-3.1.0.tgz", + "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", + "dev": true, + "requires": { + "chardet": "^0.7.0", + "iconv-lite": "^0.4.24", + "tmp": "^0.0.33" + } + }, + "extglob": { + "version": "2.0.4", + "resolved": "https://registry.npmmirror.com/extglob/-/extglob-2.0.4.tgz", + "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", + "dev": true, + "requires": { + "array-unique": "^0.3.2", + "define-property": "^1.0.0", + "expand-brackets": "^2.1.4", + "extend-shallow": "^2.0.1", + "fragment-cache": "^0.2.1", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmmirror.com/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha512-cZTYKFWspt9jZsMscWo8sc/5lbPC9Q0N5nBLgb+Yd915iL3udB1uFgS3B8YCx66UVHq018DAVFoee7x+gxggeA==", + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmmirror.com/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "is-descriptor": { + "version": "1.0.3", + "resolved": "https://registry.npmmirror.com/is-descriptor/-/is-descriptor-1.0.3.tgz", + "integrity": "sha512-JCNNGbwWZEVaSPtS45mdtrneRWJFp07LLmykxeFV5F6oBvNF8vHSfJuJgoT472pSfk+Mf8VnlrspaFBHWM8JAw==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.1", + "is-data-descriptor": "^1.0.1" + } + } + } + }, + "extsprintf": { + "version": "1.3.0", + "resolved": "https://registry.npmmirror.com/extsprintf/-/extsprintf-1.3.0.tgz", + "integrity": "sha512-11Ndz7Nv+mvAC1j0ktTa7fAb0vLyGGX+rMHNBYQviQDGU0Hw7lhctJANqbPhu9nV9/izT/IntTgZ7Im/9LJs9g==", + "dev": true + }, + "fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmmirror.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "fast-diff": { + "version": "1.1.2", + "resolved": "https://registry.npmmirror.com/fast-diff/-/fast-diff-1.1.2.tgz", + "integrity": "sha512-KaJUt+M9t1qaIteSvjc6P3RbMdXsNhK61GRftR6SNxqmhthcd9MGIi4T+o0jD8LUSpSnSKXE20nLtJ3fOHxQig==" + }, + "fast-glob": { + "version": "2.2.7", + "resolved": "https://registry.npmmirror.com/fast-glob/-/fast-glob-2.2.7.tgz", + "integrity": "sha512-g1KuQwHOZAmOZMuBtHdxDtju+T2RT8jgCC9aANsbpdiDDTSnjgfuVsIBNKbUeJI3oKMRExcfNDtJl4OhbffMsw==", + "dev": true, + "requires": { + "@mrmlnc/readdir-enhanced": "^2.2.1", + "@nodelib/fs.stat": "^1.1.2", + "glob-parent": "^3.1.0", + "is-glob": "^4.0.0", + "merge2": "^1.2.3", + "micromatch": "^3.1.10" + }, + "dependencies": { + "glob-parent": { + "version": "3.1.0", + "resolved": "https://registry.npmmirror.com/glob-parent/-/glob-parent-3.1.0.tgz", + "integrity": "sha512-E8Ak/2+dZY6fnzlR7+ueWvhsH1SjHr4jjss4YS/h4py44jY9MhK/VFdaZJAWDz6BbL21KeteKxFSFpq8OS5gVA==", + "dev": true, + "requires": { + "is-glob": "^3.1.0", + "path-dirname": "^1.0.0" + }, + "dependencies": { + "is-glob": { + "version": "3.1.0", + "resolved": "https://registry.npmmirror.com/is-glob/-/is-glob-3.1.0.tgz", + "integrity": "sha512-UFpDDrPgM6qpnFNI+rh/p3bUaq9hKLZN8bMUWzxmcnZVS3omf4IPK+BrewlnWjO1WmUsMYuSjKh4UJuV4+Lqmw==", + "dev": true, + "requires": { + "is-extglob": "^2.1.0" + } + } + } + } + } + }, + "fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmmirror.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmmirror.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true + }, + "faye-websocket": { + "version": "0.11.4", + "resolved": "https://registry.npmmirror.com/faye-websocket/-/faye-websocket-0.11.4.tgz", + "integrity": "sha512-CzbClwlXAuiRQAlUyfqPgvPoNKTckTPGfwZV4ZdAhVcP2lh9KUxJg2b5GkE7XbjKQ3YJnQ9z6D9ntLAlB+tP8g==", + "dev": true, + "requires": { + "websocket-driver": ">=0.5.1" + } + }, + "figgy-pudding": { + "version": "3.5.2", + "resolved": "https://registry.npmmirror.com/figgy-pudding/-/figgy-pudding-3.5.2.tgz", + "integrity": "sha512-0btnI/H8f2pavGMN8w40mlSKOfTK2SVJmBfBeVIj3kNw0swwgzyRq0d5TJVOwodFmtvpPeWPN/MCcfuWF0Ezbw==", + "dev": true + }, + "figures": { + "version": "3.2.0", + "resolved": "https://registry.npmmirror.com/figures/-/figures-3.2.0.tgz", + "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", + "dev": true, + "requires": { + "escape-string-regexp": "^1.0.5" + } + }, + "file-entry-cache": { + "version": "6.0.1", + "resolved": "https://registry.npmmirror.com/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "dev": true, + "requires": { + "flat-cache": "^3.0.4" + } + }, + "file-loader": { + "version": "4.3.0", + "resolved": "https://registry.npmmirror.com/file-loader/-/file-loader-4.3.0.tgz", + "integrity": "sha512-aKrYPYjF1yG3oX0kWRrqrSMfgftm7oJW5M+m4owoldH5C51C0RkIwB++JbRvEW3IU6/ZG5n8UvEcdgwOt2UOWA==", + "dev": true, + "requires": { + "loader-utils": "^1.2.3", + "schema-utils": "^2.5.0" + }, + "dependencies": { + "json5": { + "version": "1.0.2", + "resolved": "https://registry.npmmirror.com/json5/-/json5-1.0.2.tgz", + "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", + "dev": true, + "requires": { + "minimist": "^1.2.0" + } + }, + "loader-utils": { + "version": "1.4.2", + "resolved": "https://registry.npmmirror.com/loader-utils/-/loader-utils-1.4.2.tgz", + "integrity": "sha512-I5d00Pd/jwMD2QCduo657+YM/6L3KZu++pmX9VFncxaxvHcru9jx1lBaFft+r4Mt2jK0Yhp41XlRAihzPxHNCg==", + "dev": true, + "requires": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^1.0.1" + } + } + } + }, + "file-saver": { + "version": "2.0.5", + "resolved": "https://registry.npmmirror.com/file-saver/-/file-saver-2.0.5.tgz", + "integrity": "sha512-P9bmyZ3h/PRG+Nzga+rbdI4OEpNDzAVyy74uVO9ATgzLK6VtAsYybF/+TOCvrc0MO793d6+42lLyZTw7/ArVzA==" + }, + "filesize": { + "version": "3.6.1", + "resolved": "https://registry.npmmirror.com/filesize/-/filesize-3.6.1.tgz", + "integrity": "sha512-7KjR1vv6qnicaPMi1iiTcI85CyYwRO/PSFCu6SvqL8jN2Wjt/NIYQTFtFs7fSDCYOstUkEWIQGFUg5YZQfjlcg==", + "dev": true + }, + "fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmmirror.com/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha512-VcpLTWqWDiTerugjj8e3+esbg+skS3M9e54UuR3iCeIDMXCLTsAH8hTSzDQU/X6/6t3eYkOKoZSef2PlU6U1XQ==", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmmirror.com/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "finalhandler": { + "version": "1.2.0", + "resolved": "https://registry.npmmirror.com/finalhandler/-/finalhandler-1.2.0.tgz", + "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", + "dev": true, + "requires": { + "debug": "2.6.9", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "statuses": "2.0.1", + "unpipe": "~1.0.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmmirror.com/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "dev": true + } + } + }, + "find-cache-dir": { + "version": "3.3.2", + "resolved": "https://registry.npmmirror.com/find-cache-dir/-/find-cache-dir-3.3.2.tgz", + "integrity": "sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig==", + "dev": true, + "requires": { + "commondir": "^1.0.1", + "make-dir": "^3.0.2", + "pkg-dir": "^4.1.0" + } + }, + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmmirror.com/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "flat-cache": { + "version": "3.2.0", + "resolved": "https://registry.npmmirror.com/flat-cache/-/flat-cache-3.2.0.tgz", + "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==", + "dev": true, + "requires": { + "flatted": "^3.2.9", + "keyv": "^4.5.3", + "rimraf": "^3.0.2" + }, + "dependencies": { + "rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmmirror.com/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + } + } + }, + "flatted": { + "version": "3.3.1", + "resolved": "https://registry.npmmirror.com/flatted/-/flatted-3.3.1.tgz", + "integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==", + "dev": true + }, + "flush-write-stream": { + "version": "1.1.1", + "resolved": "https://registry.npmmirror.com/flush-write-stream/-/flush-write-stream-1.1.1.tgz", + "integrity": "sha512-3Z4XhFZ3992uIq0XOqb9AreonueSYphE6oYbpt5+3u06JWklbsPkNv3ZKkP9Bz/r+1MWCaMoSQ28P85+1Yc77w==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "readable-stream": "^2.3.6" + } + }, + "follow-redirects": { + "version": "1.15.6", + "resolved": "https://registry.npmmirror.com/follow-redirects/-/follow-redirects-1.15.6.tgz", + "integrity": "sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==" + }, + "for-each": { + "version": "0.3.3", + "resolved": "https://registry.npmmirror.com/for-each/-/for-each-0.3.3.tgz", + "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", + "dev": true, + "requires": { + "is-callable": "^1.1.3" + } + }, + "for-in": { + "version": "1.0.2", + "resolved": "https://registry.npmmirror.com/for-in/-/for-in-1.0.2.tgz", + "integrity": "sha512-7EwmXrOjyL+ChxMhmG5lnW9MPt1aIeZEwKhQzoBUdTV0N3zuwWDZYVJatDvZ2OyzPUvdIAZDsCetk3coyMfcnQ==", + "dev": true + }, + "forever-agent": { + "version": "0.6.1", + "resolved": "https://registry.npmmirror.com/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw==", + "dev": true + }, + "form-data": { + "version": "2.3.3", + "resolved": "https://registry.npmmirror.com/form-data/-/form-data-2.3.3.tgz", + "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", + "dev": true, + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" + } + }, + "forwarded": { + "version": "0.2.0", + "resolved": "https://registry.npmmirror.com/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", + "dev": true + }, + "fragment-cache": { + "version": "0.2.1", + "resolved": "https://registry.npmmirror.com/fragment-cache/-/fragment-cache-0.2.1.tgz", + "integrity": "sha512-GMBAbW9antB8iZRHLoGw0b3HANt57diZYFO/HL1JGIC1MjKrdmhxvrJbupnVvpys0zsz7yBApXdQyfepKly2kA==", + "dev": true, + "requires": { + "map-cache": "^0.2.2" + } + }, + "fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmmirror.com/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", + "dev": true + }, + "from2": { + "version": "2.3.0", + "resolved": "https://registry.npmmirror.com/from2/-/from2-2.3.0.tgz", + "integrity": "sha512-OMcX/4IC/uqEPVgGeyfN22LJk6AZrMkRZHxcHBMBvHScDGgwTm2GT2Wkgtocyd3JfZffjj2kYUDXXII0Fk9W0g==", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "readable-stream": "^2.0.0" + } + }, + "fs-extra": { + "version": "7.0.1", + "resolved": "https://registry.npmmirror.com/fs-extra/-/fs-extra-7.0.1.tgz", + "integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "fs-minipass": { + "version": "2.1.0", + "resolved": "https://registry.npmmirror.com/fs-minipass/-/fs-minipass-2.1.0.tgz", + "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", + "dev": true, + "requires": { + "minipass": "^3.0.0" + } + }, + "fs-write-stream-atomic": { + "version": "1.0.10", + "resolved": "https://registry.npmmirror.com/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.10.tgz", + "integrity": "sha512-gehEzmPn2nAwr39eay+x3X34Ra+M2QlVUTLhkXPjWdeO8RF9kszk116avgBJM3ZyNHgHXBNx+VmPaFC36k0PzA==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "iferr": "^0.1.5", + "imurmurhash": "^0.1.4", + "readable-stream": "1 || 2" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmmirror.com/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" + }, + "fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmmirror.com/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "optional": true + }, + "function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmmirror.com/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==" + }, + "function.prototype.name": { + "version": "1.1.6", + "resolved": "https://registry.npmmirror.com/function.prototype.name/-/function.prototype.name-1.1.6.tgz", + "integrity": "sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "functions-have-names": "^1.2.3" + } + }, + "functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmmirror.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==", + "dev": true + }, + "functions-have-names": { + "version": "1.2.3", + "resolved": "https://registry.npmmirror.com/functions-have-names/-/functions-have-names-1.2.3.tgz", + "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==" + }, + "fuse.js": { + "version": "6.4.3", + "resolved": "https://registry.npmmirror.com/fuse.js/-/fuse.js-6.4.3.tgz", + "integrity": "sha512-JNgngolukIrqwayWnvy6NLH63hmwKPhm63o0uyBg51jPD0j09IvAzlV1rTXfAsgxpghI7khAo6Mv+EmvjDWXig==" + }, + "fuzzysearch": { + "version": "1.0.3", + "resolved": "https://registry.npmmirror.com/fuzzysearch/-/fuzzysearch-1.0.3.tgz", + "integrity": "sha512-s+kNWQuI3mo9OALw0HJ6YGmMbLqEufCh2nX/zzV5CrICQ/y4AwPxM+6TIiF9ItFCHXFCyM/BfCCmN57NTIJuPg==" + }, + "gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmmirror.com/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "dev": true + }, + "get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmmirror.com/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true + }, + "get-intrinsic": { + "version": "1.2.4", + "resolved": "https://registry.npmmirror.com/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", + "requires": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" + } + }, + "get-own-enumerable-property-symbols": { + "version": "3.0.2", + "resolved": "https://registry.npmmirror.com/get-own-enumerable-property-symbols/-/get-own-enumerable-property-symbols-3.0.2.tgz", + "integrity": "sha512-I0UBV/XOz1XkIJHEUDMZAbzCThU/H8DxmSfmdGcKPnVhu2VfFqr34jr9777IyaTYvxjedWhqVIilEDsCdP5G6g==", + "dev": true + }, + "get-stream": { + "version": "4.1.0", + "resolved": "https://registry.npmmirror.com/get-stream/-/get-stream-4.1.0.tgz", + "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", + "dev": true, + "requires": { + "pump": "^3.0.0" + } + }, + "get-symbol-description": { + "version": "1.0.2", + "resolved": "https://registry.npmmirror.com/get-symbol-description/-/get-symbol-description-1.0.2.tgz", + "integrity": "sha512-g0QYk1dZBxGwk+Ngc+ltRH2IBp2f7zBkBMBJZCDerh6EhlhSR6+9irMCuT/09zD6qkarHUSn529sK/yL4S27mg==", + "dev": true, + "requires": { + "call-bind": "^1.0.5", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4" + } + }, + "get-value": { + "version": "2.0.6", + "resolved": "https://registry.npmmirror.com/get-value/-/get-value-2.0.6.tgz", + "integrity": "sha512-Ln0UQDlxH1BapMu3GPtf7CuYNwRZf2gwCuPqbyG6pB8WfmFpzqcy4xtAaAMUhnNqjMKTiCPZG2oMT3YSx8U2NA==", + "dev": true + }, + "getpass": { + "version": "0.1.7", + "resolved": "https://registry.npmmirror.com/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha512-0fzj9JxOLfJ+XGLhR8ze3unN0KZCgZwiSSDz168VERjK8Wl8kVSdcu2kspd4s4wtAa1y/qrVRiAA0WclVsu0ng==", + "dev": true, + "requires": { + "assert-plus": "^1.0.0" + } + }, + "glob": { + "version": "7.2.3", + "resolved": "https://registry.npmmirror.com/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmmirror.com/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + }, + "glob-to-regexp": { + "version": "0.3.0", + "resolved": "https://registry.npmmirror.com/glob-to-regexp/-/glob-to-regexp-0.3.0.tgz", + "integrity": "sha512-Iozmtbqv0noj0uDDqoL0zNq0VBEfK2YFoMAZoxJe4cwphvLR+JskfF30QhXHOR4m3KrE6NLRYw+U9MRXvifyig==", + "dev": true + }, + "globals": { + "version": "11.12.0", + "resolved": "https://registry.npmmirror.com/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "dev": true + }, + "globalthis": { + "version": "1.0.4", + "resolved": "https://registry.npmmirror.com/globalthis/-/globalthis-1.0.4.tgz", + "integrity": "sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==", + "dev": true, + "requires": { + "define-properties": "^1.2.1", + "gopd": "^1.0.1" + } + }, + "globby": { + "version": "9.2.0", + "resolved": "https://registry.npmmirror.com/globby/-/globby-9.2.0.tgz", + "integrity": "sha512-ollPHROa5mcxDEkwg6bPt3QbEf4pDQSNtd6JPL1YvOvAo/7/0VAm9TccUeoTmarjPw4pfUthSCqcyfNB1I3ZSg==", + "dev": true, + "requires": { + "@types/glob": "^7.1.1", + "array-union": "^1.0.2", + "dir-glob": "^2.2.2", + "fast-glob": "^2.2.6", + "glob": "^7.1.3", + "ignore": "^4.0.3", + "pify": "^4.0.1", + "slash": "^2.0.0" + } + }, + "good-listener": { + "version": "1.2.2", + "resolved": "https://registry.npmmirror.com/good-listener/-/good-listener-1.2.2.tgz", + "integrity": "sha512-goW1b+d9q/HIwbVYZzZ6SsTr4IgE+WA44A0GmPIQstuOrgsFcT7VEJ48nmr9GaRtNu0XTKacFLGnBPAM6Afouw==", + "requires": { + "delegate": "^3.1.2" + } + }, + "gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmmirror.com/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "requires": { + "get-intrinsic": "^1.1.3" + } + }, + "graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmmirror.com/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true + }, + "gzip-size": { + "version": "5.1.1", + "resolved": "https://registry.npmmirror.com/gzip-size/-/gzip-size-5.1.1.tgz", + "integrity": "sha512-FNHi6mmoHvs1mxZAds4PpdCS6QG8B4C1krxJsMutgxl5t3+GlRTzzI3NEkifXx2pVsOvJdOGSmIgDhQ55FwdPA==", + "dev": true, + "requires": { + "duplexer": "^0.1.1", + "pify": "^4.0.1" + } + }, + "handle-thing": { + "version": "2.0.1", + "resolved": "https://registry.npmmirror.com/handle-thing/-/handle-thing-2.0.1.tgz", + "integrity": "sha512-9Qn4yBxelxoh2Ow62nP+Ka/kMnOXRi8BXnRaUwezLNhqelnN49xKz4F/dPP8OYLxLxq6JDtZb2i9XznUQbNPTg==", + "dev": true + }, + "har-schema": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/har-schema/-/har-schema-2.0.0.tgz", + "integrity": "sha512-Oqluz6zhGX8cyRaTQlFMPw80bSJVG2x/cFb8ZPhUILGgHka9SsokCCOQgpveePerqidZOrT14ipqfJb7ILcW5Q==", + "dev": true + }, + "har-validator": { + "version": "5.1.5", + "resolved": "https://registry.npmmirror.com/har-validator/-/har-validator-5.1.5.tgz", + "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==", + "dev": true, + "requires": { + "ajv": "^6.12.3", + "har-schema": "^2.0.0" + } + }, + "has": { + "version": "1.0.4", + "resolved": "https://registry.npmmirror.com/has/-/has-1.0.4.tgz", + "integrity": "sha512-qdSAmqLF6209RFj4VVItywPMbm3vWylknmB3nvNiUIs72xAimcM8nVYxYr7ncvZq5qzk9MKIZR8ijqD/1QuYjQ==", + "dev": true + }, + "has-ansi": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha512-C8vBJ8DwUCx19vhm7urhTuUsr4/IyP6l4VzNQDv+ryHQObW3TTTp9yB68WpYgRe2bbaGuZ/se74IqFeVnMnLZg==", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmmirror.com/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", + "dev": true + } + } + }, + "has-bigints": { + "version": "1.0.2", + "resolved": "https://registry.npmmirror.com/has-bigints/-/has-bigints-1.0.2.tgz", + "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==", + "dev": true + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmmirror.com/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true + }, + "has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://registry.npmmirror.com/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "requires": { + "es-define-property": "^1.0.0" + } + }, + "has-proto": { + "version": "1.0.3", + "resolved": "https://registry.npmmirror.com/has-proto/-/has-proto-1.0.3.tgz", + "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==" + }, + "has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmmirror.com/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==" + }, + "has-tostringtag": { + "version": "1.0.2", + "resolved": "https://registry.npmmirror.com/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "requires": { + "has-symbols": "^1.0.3" + } + }, + "has-value": { + "version": "1.0.0", + "resolved": "https://registry.npmmirror.com/has-value/-/has-value-1.0.0.tgz", + "integrity": "sha512-IBXk4GTsLYdQ7Rvt+GRBrFSVEkmuOUy4re0Xjd9kJSUQpnTrWR4/y9RpfexN9vkAPMFuQoeWKwqzPozRTlasGw==", + "dev": true, + "requires": { + "get-value": "^2.0.6", + "has-values": "^1.0.0", + "isobject": "^3.0.0" + } + }, + "has-values": { + "version": "1.0.0", + "resolved": "https://registry.npmmirror.com/has-values/-/has-values-1.0.0.tgz", + "integrity": "sha512-ODYZC64uqzmtfGMEAX/FvZiRyWLpAC3vYnNunURUnkGVTS+mI0smVsWaPydRBsE3g+ok7h960jChO8mFcWlHaQ==", + "dev": true, + "requires": { + "is-number": "^3.0.0", + "kind-of": "^4.0.0" + }, + "dependencies": { + "kind-of": { + "version": "4.0.0", + "resolved": "https://registry.npmmirror.com/kind-of/-/kind-of-4.0.0.tgz", + "integrity": "sha512-24XsCxmEbRwEDbz/qz3stgin8TTzZ1ESR56OMCN0ujYg+vRutNSiOj9bHH9u85DKgXguraugV5sFuvbD4FW/hw==", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "hash-base": { + "version": "3.1.0", + "resolved": "https://registry.npmmirror.com/hash-base/-/hash-base-3.1.0.tgz", + "integrity": "sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==", + "dev": true, + "requires": { + "inherits": "^2.0.4", + "readable-stream": "^3.6.0", + "safe-buffer": "^5.2.0" + }, + "dependencies": { + "readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmmirror.com/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + } + } + }, + "hash-sum": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/hash-sum/-/hash-sum-2.0.0.tgz", + "integrity": "sha512-WdZTbAByD+pHfl/g9QSsBIIwy8IT+EsPiKDs0KNX+zSHhdDLFKdZu0BQHljvO+0QI/BasbMSUa8wYNCZTvhslg==", + "dev": true + }, + "hash.js": { + "version": "1.1.7", + "resolved": "https://registry.npmmirror.com/hash.js/-/hash.js-1.1.7.tgz", + "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.1" + } + }, + "hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmmirror.com/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "requires": { + "function-bind": "^1.1.2" + } + }, + "he": { + "version": "1.2.0", + "resolved": "https://registry.npmmirror.com/he/-/he-1.2.0.tgz", + "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", + "dev": true + }, + "hex-color-regex": { + "version": "1.1.0", + "resolved": "https://registry.npmmirror.com/hex-color-regex/-/hex-color-regex-1.1.0.tgz", + "integrity": "sha512-l9sfDFsuqtOqKDsQdqrMRk0U85RZc0RtOR9yPI7mRVOa4FsR/BVnZ0shmQRM96Ji99kYZP/7hn1cedc1+ApsTQ==", + "dev": true + }, + "highlight.js": { + "version": "9.18.5", + "resolved": "https://registry.npmmirror.com/highlight.js/-/highlight.js-9.18.5.tgz", + "integrity": "sha512-a5bFyofd/BHCX52/8i8uJkjr9DYwXIPnM/plwI6W7ezItLGqzt7X2G2nXuYSfsIJdkwwj/g9DG1LkcGJI/dDoA==" + }, + "hmac-drbg": { + "version": "1.0.1", + "resolved": "https://registry.npmmirror.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz", + "integrity": "sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg==", + "dev": true, + "requires": { + "hash.js": "^1.0.3", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "hoopy": { + "version": "0.1.4", + "resolved": "https://registry.npmmirror.com/hoopy/-/hoopy-0.1.4.tgz", + "integrity": "sha512-HRcs+2mr52W0K+x8RzcLzuPPmVIKMSv97RGHy0Ea9y/mpcaK+xTrjICA04KAHi4GRzxliNqNJEFYWHghy3rSfQ==", + "dev": true + }, + "hosted-git-info": { + "version": "2.8.9", + "resolved": "https://registry.npmmirror.com/hosted-git-info/-/hosted-git-info-2.8.9.tgz", + "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", + "dev": true + }, + "hpack.js": { + "version": "2.1.6", + "resolved": "https://registry.npmmirror.com/hpack.js/-/hpack.js-2.1.6.tgz", + "integrity": "sha512-zJxVehUdMGIKsRaNt7apO2Gqp0BdqW5yaiGHXXmbpvxgBYVZnAql+BJb4RO5ad2MgpbZKn5G6nMnegrH1FcNYQ==", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "obuf": "^1.0.0", + "readable-stream": "^2.0.1", + "wbuf": "^1.1.0" + } + }, + "hsl-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmmirror.com/hsl-regex/-/hsl-regex-1.0.0.tgz", + "integrity": "sha512-M5ezZw4LzXbBKMruP+BNANf0k+19hDQMgpzBIYnya//Al+fjNct9Wf3b1WedLqdEs2hKBvxq/jh+DsHJLj0F9A==", + "dev": true + }, + "hsla-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmmirror.com/hsla-regex/-/hsla-regex-1.0.0.tgz", + "integrity": "sha512-7Wn5GMLuHBjZCb2bTmnDOycho0p/7UVaAeqXZGbHrBCl6Yd/xDhQJAXe6Ga9AXJH2I5zY1dEdYw2u1UptnSBJA==", + "dev": true + }, + "html-entities": { + "version": "1.4.0", + "resolved": "https://registry.npmmirror.com/html-entities/-/html-entities-1.4.0.tgz", + "integrity": "sha512-8nxjcBcd8wovbeKx7h3wTji4e6+rhaVuPNpMqwWgnHh+N9ToqsCs6XztWRBPQ+UtzsoMAdKZtUENoVzU/EMtZA==", + "dev": true + }, + "html-minifier": { + "version": "3.5.21", + "resolved": "https://registry.npmmirror.com/html-minifier/-/html-minifier-3.5.21.tgz", + "integrity": "sha512-LKUKwuJDhxNa3uf/LPR/KVjm/l3rBqtYeCOAekvG8F1vItxMUpueGd94i/asDDr8/1u7InxzFA5EeGjhhG5mMA==", + "dev": true, + "requires": { + "camel-case": "3.0.x", + "clean-css": "4.2.x", + "commander": "2.17.x", + "he": "1.2.x", + "param-case": "2.1.x", + "relateurl": "0.2.x", + "uglify-js": "3.4.x" + }, + "dependencies": { + "commander": { + "version": "2.17.1", + "resolved": "https://registry.npmmirror.com/commander/-/commander-2.17.1.tgz", + "integrity": "sha512-wPMUt6FnH2yzG95SA6mzjQOEKUU3aLaDEmzs1ti+1E9h+CsrZghRlqEM/EJ4KscsQVG8uNN4uVreUeT8+drlgg==", + "dev": true + } + } + }, + "html-tags": { + "version": "3.3.1", + "resolved": "https://registry.npmmirror.com/html-tags/-/html-tags-3.3.1.tgz", + "integrity": "sha512-ztqyC3kLto0e9WbNp0aeP+M3kTt+nbaIveGmUxAtZa+8iFgKLUOD4YKM5j+f3QD89bra7UeumolZHKuOXnTmeQ==", + "dev": true + }, + "html-webpack-plugin": { + "version": "3.2.0", + "resolved": "https://registry.npmmirror.com/html-webpack-plugin/-/html-webpack-plugin-3.2.0.tgz", + "integrity": "sha512-Br4ifmjQojUP4EmHnRBoUIYcZ9J7M4bTMcm7u6xoIAIuq2Nte4TzXX0533owvkQKQD1WeMTTTyD4Ni4QKxS0Bg==", + "dev": true, + "requires": { + "html-minifier": "^3.2.3", + "loader-utils": "^0.2.16", + "lodash": "^4.17.3", + "pretty-error": "^2.0.2", + "tapable": "^1.0.0", + "toposort": "^1.0.0", + "util.promisify": "1.0.0" + }, + "dependencies": { + "big.js": { + "version": "3.2.0", + "resolved": "https://registry.npmmirror.com/big.js/-/big.js-3.2.0.tgz", + "integrity": "sha512-+hN/Zh2D08Mx65pZ/4g5bsmNiZUuChDiQfTUQ7qJr4/kuopCr88xZsAXv6mBoZEsUI4OuGHlX59qE94K2mMW8Q==", + "dev": true + }, + "emojis-list": { + "version": "2.1.0", + "resolved": "https://registry.npmmirror.com/emojis-list/-/emojis-list-2.1.0.tgz", + "integrity": "sha512-knHEZMgs8BB+MInokmNTg/OyPlAddghe1YBgNwJBc5zsJi/uyIcXoSDsL/W9ymOsBoBGdPIHXYJ9+qKFwRwDng==", + "dev": true + }, + "json5": { + "version": "0.5.1", + "resolved": "https://registry.npmmirror.com/json5/-/json5-0.5.1.tgz", + "integrity": "sha512-4xrs1aW+6N5DalkqSVA8fxh458CXvR99WU8WLKmq4v8eWAL86Xo3BVqyd3SkA9wEVjCMqyvvRRkshAdOnBp5rw==", + "dev": true + }, + "loader-utils": { + "version": "0.2.17", + "resolved": "https://registry.npmmirror.com/loader-utils/-/loader-utils-0.2.17.tgz", + "integrity": "sha512-tiv66G0SmiOx+pLWMtGEkfSEejxvb6N6uRrQjfWJIT79W9GMpgKeCAmm9aVBKtd4WEgntciI8CsGqjpDoCWJug==", + "dev": true, + "requires": { + "big.js": "^3.1.3", + "emojis-list": "^2.0.0", + "json5": "^0.5.0", + "object-assign": "^4.0.1" + } + }, + "util.promisify": { + "version": "1.0.0", + "resolved": "https://registry.npmmirror.com/util.promisify/-/util.promisify-1.0.0.tgz", + "integrity": "sha512-i+6qA2MPhvoKLuxnJNpXAGhg7HphQOSUq2LKMZD0m15EiskXUkMvKdF4Uui0WYeCUGea+o2cw/ZuwehtfsrNkA==", + "dev": true, + "requires": { + "define-properties": "^1.1.2", + "object.getownpropertydescriptors": "^2.0.3" + } + } + } + }, + "htmlparser2": { + "version": "6.1.0", + "resolved": "https://registry.npmmirror.com/htmlparser2/-/htmlparser2-6.1.0.tgz", + "integrity": "sha512-gyyPk6rgonLFEDGoeRgQNaEUvdJ4ktTmmUh/h2t7s+M8oPpIPxgNACWa+6ESR57kXstwqPiCut0V8NRpcwgU7A==", + "dev": true, + "requires": { + "domelementtype": "^2.0.1", + "domhandler": "^4.0.0", + "domutils": "^2.5.2", + "entities": "^2.0.0" + }, + "dependencies": { + "dom-serializer": { + "version": "1.4.1", + "resolved": "https://registry.npmmirror.com/dom-serializer/-/dom-serializer-1.4.1.tgz", + "integrity": "sha512-VHwB3KfrcOOkelEG2ZOfxqLZdfkil8PtJi4P8N2MMXucZq2yLp75ClViUlOVwyoHEDjYU433Aq+5zWP61+RGag==", + "dev": true, + "requires": { + "domelementtype": "^2.0.1", + "domhandler": "^4.2.0", + "entities": "^2.0.0" + } + }, + "domelementtype": { + "version": "2.3.0", + "resolved": "https://registry.npmmirror.com/domelementtype/-/domelementtype-2.3.0.tgz", + "integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==", + "dev": true + }, + "domutils": { + "version": "2.8.0", + "resolved": "https://registry.npmmirror.com/domutils/-/domutils-2.8.0.tgz", + "integrity": "sha512-w96Cjofp72M5IIhpjgobBimYEfoPjx1Vx0BSX9P30WBdZW2WIKU0T1Bd0kz2eNZ9ikjKgHbEyKx8BB6H1L3h3A==", + "dev": true, + "requires": { + "dom-serializer": "^1.0.1", + "domelementtype": "^2.2.0", + "domhandler": "^4.2.0" + } + }, + "entities": { + "version": "2.2.0", + "resolved": "https://registry.npmmirror.com/entities/-/entities-2.2.0.tgz", + "integrity": "sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A==", + "dev": true + } + } + }, + "http-deceiver": { + "version": "1.2.7", + "resolved": "https://registry.npmmirror.com/http-deceiver/-/http-deceiver-1.2.7.tgz", + "integrity": "sha512-LmpOGxTfbpgtGVxJrj5k7asXHCgNZp5nLfp+hWc8QQRqtb7fUy6kRY3BO1h9ddF6yIPYUARgxGOwB42DnxIaNw==", + "dev": true + }, + "http-errors": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", + "dev": true, + "requires": { + "depd": "2.0.0", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "toidentifier": "1.0.1" + } + }, + "http-parser-js": { + "version": "0.5.8", + "resolved": "https://registry.npmmirror.com/http-parser-js/-/http-parser-js-0.5.8.tgz", + "integrity": "sha512-SGeBX54F94Wgu5RH3X5jsDtf4eHyRogWX1XGT3b4HuW3tQPM4AaBzoUji/4AAJNXCEOWZ5O0DgZmJw1947gD5Q==", + "dev": true + }, + "http-proxy": { + "version": "1.18.1", + "resolved": "https://registry.npmmirror.com/http-proxy/-/http-proxy-1.18.1.tgz", + "integrity": "sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ==", + "dev": true, + "requires": { + "eventemitter3": "^4.0.0", + "follow-redirects": "^1.0.0", + "requires-port": "^1.0.0" + }, + "dependencies": { + "eventemitter3": { + "version": "4.0.7", + "resolved": "https://registry.npmmirror.com/eventemitter3/-/eventemitter3-4.0.7.tgz", + "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==", + "dev": true + } + } + }, + "http-proxy-middleware": { + "version": "0.19.1", + "resolved": "https://registry.npmmirror.com/http-proxy-middleware/-/http-proxy-middleware-0.19.1.tgz", + "integrity": "sha512-yHYTgWMQO8VvwNS22eLLloAkvungsKdKTLO8AJlftYIKNfJr3GK3zK0ZCfzDDGUBttdGc8xFy1mCitvNKQtC3Q==", + "dev": true, + "requires": { + "http-proxy": "^1.17.0", + "is-glob": "^4.0.0", + "lodash": "^4.17.11", + "micromatch": "^3.1.10" + } + }, + "http-signature": { + "version": "1.2.0", + "resolved": "https://registry.npmmirror.com/http-signature/-/http-signature-1.2.0.tgz", + "integrity": "sha512-CAbnr6Rz4CYQkLYUtSNXxQPUH2gK8f3iWexVlsnMeD+GjlsQ0Xsy1cOX+mN3dtxYomRy21CiOzU8Uhw6OwncEQ==", + "dev": true, + "requires": { + "assert-plus": "^1.0.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" + } + }, + "https-browserify": { + "version": "1.0.0", + "resolved": "https://registry.npmmirror.com/https-browserify/-/https-browserify-1.0.0.tgz", + "integrity": "sha512-J+FkSdyD+0mA0N+81tMotaRMfSL9SGi+xpD3T6YApKsc3bGSXJlfXri3VyFOeYkfLRQisDk1W+jIFFKBeUBbBg==", + "dev": true + }, + "human-signals": { + "version": "1.1.1", + "resolved": "https://registry.npmmirror.com/human-signals/-/human-signals-1.1.1.tgz", + "integrity": "sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw==", + "dev": true + }, + "iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmmirror.com/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dev": true, + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, + "icss-utils": { + "version": "4.1.1", + "resolved": "https://registry.npmmirror.com/icss-utils/-/icss-utils-4.1.1.tgz", + "integrity": "sha512-4aFq7wvWyMHKgxsH8QQtGpvbASCf+eM3wPRLI6R+MgAnTCZ6STYsRvttLvRWK0Nfif5piF394St3HeJDaljGPA==", + "dev": true, + "requires": { + "postcss": "^7.0.14" + }, + "dependencies": { + "picocolors": { + "version": "0.2.1", + "resolved": "https://registry.npmmirror.com/picocolors/-/picocolors-0.2.1.tgz", + "integrity": "sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA==", + "dev": true + }, + "postcss": { + "version": "7.0.39", + "resolved": "https://registry.npmmirror.com/postcss/-/postcss-7.0.39.tgz", + "integrity": "sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA==", + "dev": true, + "requires": { + "picocolors": "^0.2.1", + "source-map": "^0.6.1" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmmirror.com/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmmirror.com/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "dev": true + }, + "iferr": { + "version": "0.1.5", + "resolved": "https://registry.npmmirror.com/iferr/-/iferr-0.1.5.tgz", + "integrity": "sha512-DUNFN5j7Tln0D+TxzloUjKB+CtVu6myn0JEFak6dG18mNt9YkQ6lzGCdafwofISZ1lLF3xRHJ98VKy9ynkcFaA==", + "dev": true + }, + "ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmmirror.com/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "dev": true + }, + "image-size": { + "version": "0.5.5", + "resolved": "https://registry.npmmirror.com/image-size/-/image-size-0.5.5.tgz", + "integrity": "sha512-6TDAlDPZxUFCv+fuOkIoXT/V/f3Qbq8e37p+YOiYrUv3v9cc3/6x78VdfPgFVaB9dZYeLUfKgHRebpkm/oP2VQ==", + "dev": true + }, + "import-cwd": { + "version": "2.1.0", + "resolved": "https://registry.npmmirror.com/import-cwd/-/import-cwd-2.1.0.tgz", + "integrity": "sha512-Ew5AZzJQFqrOV5BTW3EIoHAnoie1LojZLXKcCQ/yTRyVZosBhK1x1ViYjHGf5pAFOq8ZyChZp6m/fSN7pJyZtg==", + "dev": true, + "requires": { + "import-from": "^2.1.0" + } + }, + "import-fresh": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/import-fresh/-/import-fresh-2.0.0.tgz", + "integrity": "sha512-eZ5H8rcgYazHbKC3PG4ClHNykCSxtAhxSSEM+2mb+7evD2CKF5V7c0dNum7AdpDh0ZdICwZY9sRSn8f+KH96sg==", + "dev": true, + "requires": { + "caller-path": "^2.0.0", + "resolve-from": "^3.0.0" + } + }, + "import-from": { + "version": "2.1.0", + "resolved": "https://registry.npmmirror.com/import-from/-/import-from-2.1.0.tgz", + "integrity": "sha512-0vdnLL2wSGnhlRmzHJAg5JHjt1l2vYhzJ7tNLGbeVg0fse56tpGaH0uzH+r9Slej+BSXXEHvBKDEnVSLLE9/+w==", + "dev": true, + "requires": { + "resolve-from": "^3.0.0" + } + }, + "import-local": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/import-local/-/import-local-2.0.0.tgz", + "integrity": "sha512-b6s04m3O+s3CGSbqDIyP4R6aAwAeYlVq9+WUWep6iHa8ETRf9yei1U48C5MmfJmV9AiLYYBKPMq/W+/WRpQmCQ==", + "dev": true, + "requires": { + "pkg-dir": "^3.0.0", + "resolve-cwd": "^2.0.0" + }, + "dependencies": { + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmmirror.com/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "requires": { + "locate-path": "^3.0.0" + } + }, + "locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmmirror.com/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "dev": true, + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmmirror.com/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "dev": true, + "requires": { + "p-limit": "^2.0.0" + } + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmmirror.com/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==", + "dev": true + }, + "pkg-dir": { + "version": "3.0.0", + "resolved": "https://registry.npmmirror.com/pkg-dir/-/pkg-dir-3.0.0.tgz", + "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==", + "dev": true, + "requires": { + "find-up": "^3.0.0" + } + } + } + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmmirror.com/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "dev": true + }, + "indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmmirror.com/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "dev": true + }, + "indexes-of": { + "version": "1.0.1", + "resolved": "https://registry.npmmirror.com/indexes-of/-/indexes-of-1.0.1.tgz", + "integrity": "sha512-bup+4tap3Hympa+JBJUG7XuOsdNQ6fxt0MHyXMKuLBKn0OqsTfvUxkUrroEX1+B2VsSHvCjiIcZVxRtYa4nllA==", + "dev": true + }, + "infer-owner": { + "version": "1.0.4", + "resolved": "https://registry.npmmirror.com/infer-owner/-/infer-owner-1.0.4.tgz", + "integrity": "sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A==", + "dev": true + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmmirror.com/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmmirror.com/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "ini": { + "version": "1.3.8", + "resolved": "https://registry.npmmirror.com/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==" + }, + "inquirer": { + "version": "7.3.3", + "resolved": "https://registry.npmmirror.com/inquirer/-/inquirer-7.3.3.tgz", + "integrity": "sha512-JG3eIAj5V9CwcGvuOmoo6LB9kbAYT8HXffUl6memuszlwDC/qvFAJw49XJ5NROSFNPxp3iQg1GqkFhaY/CR0IA==", + "dev": true, + "requires": { + "ansi-escapes": "^4.2.1", + "chalk": "^4.1.0", + "cli-cursor": "^3.1.0", + "cli-width": "^3.0.0", + "external-editor": "^3.0.3", + "figures": "^3.0.0", + "lodash": "^4.17.19", + "mute-stream": "0.0.8", + "run-async": "^2.4.0", + "rxjs": "^6.6.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0", + "through": "^2.3.6" + }, + "dependencies": { + "cli-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmmirror.com/cli-cursor/-/cli-cursor-3.1.0.tgz", + "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", + "dev": true, + "requires": { + "restore-cursor": "^3.1.0" + } + }, + "mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmmirror.com/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true + }, + "onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmmirror.com/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "dev": true, + "requires": { + "mimic-fn": "^2.1.0" + } + }, + "restore-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmmirror.com/restore-cursor/-/restore-cursor-3.1.0.tgz", + "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", + "dev": true, + "requires": { + "onetime": "^5.1.0", + "signal-exit": "^3.0.2" + } + } + } + }, + "internal-ip": { + "version": "4.3.0", + "resolved": "https://registry.npmmirror.com/internal-ip/-/internal-ip-4.3.0.tgz", + "integrity": "sha512-S1zBo1D6zcsyuC6PMmY5+55YMILQ9av8lotMx447Bq6SAgo/sDK6y6uUKmuYhW7eacnIhFfsPmCNYdDzsnnDCg==", + "dev": true, + "requires": { + "default-gateway": "^4.2.0", + "ipaddr.js": "^1.9.0" + }, + "dependencies": { + "default-gateway": { + "version": "4.2.0", + "resolved": "https://registry.npmmirror.com/default-gateway/-/default-gateway-4.2.0.tgz", + "integrity": "sha512-h6sMrVB1VMWVrW13mSc6ia/DwYYw5MN6+exNu1OaJeFac5aSAvwM7lZ0NVfTABuSkQelr4h5oebg3KB1XPdjgA==", + "dev": true, + "requires": { + "execa": "^1.0.0", + "ip-regex": "^2.1.0" + } + } + } + }, + "internal-slot": { + "version": "1.0.7", + "resolved": "https://registry.npmmirror.com/internal-slot/-/internal-slot-1.0.7.tgz", + "integrity": "sha512-NGnrKwXzSms2qUUih/ILZ5JBqNTSa1+ZmP6flaIp6KmSElgE9qdndzS3cqjrDovwFdmwsGsLdeFgB6suw+1e9g==", + "dev": true, + "requires": { + "es-errors": "^1.3.0", + "hasown": "^2.0.0", + "side-channel": "^1.0.4" + } + }, + "ip": { + "version": "1.1.9", + "resolved": "https://registry.npmmirror.com/ip/-/ip-1.1.9.tgz", + "integrity": "sha512-cyRxvOEpNHNtchU3Ln9KC/auJgup87llfQpQ+t5ghoC/UhL16SWzbueiCsdTnWmqAWl7LadfuwhlqmtOaqMHdQ==", + "dev": true + }, + "ip-regex": { + "version": "2.1.0", + "resolved": "https://registry.npmmirror.com/ip-regex/-/ip-regex-2.1.0.tgz", + "integrity": "sha512-58yWmlHpp7VYfcdTwMTvwMmqx/Elfxjd9RXTDyMsbL7lLWmhMylLEqiYVLKuLzOZqVgiWXD9MfR62Vv89VRxkw==", + "dev": true + }, + "ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmmirror.com/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "dev": true + }, + "is-absolute-url": { + "version": "2.1.0", + "resolved": "https://registry.npmmirror.com/is-absolute-url/-/is-absolute-url-2.1.0.tgz", + "integrity": "sha512-vOx7VprsKyllwjSkLV79NIhpyLfr3jAp7VaTCMXOJHu4m0Ew1CZ2fcjASwmV1jI3BWuWHB013M48eyeldk9gYg==", + "dev": true + }, + "is-accessor-descriptor": { + "version": "1.0.1", + "resolved": "https://registry.npmmirror.com/is-accessor-descriptor/-/is-accessor-descriptor-1.0.1.tgz", + "integrity": "sha512-YBUanLI8Yoihw923YeFUS5fs0fF2f5TSFTNiYAAzhhDscDa3lEqYuz1pDOEP5KvX94I9ey3vsqjJcLVFVU+3QA==", + "dev": true, + "requires": { + "hasown": "^2.0.0" + } + }, + "is-arguments": { + "version": "1.1.1", + "resolved": "https://registry.npmmirror.com/is-arguments/-/is-arguments-1.1.1.tgz", + "integrity": "sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==", + "requires": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + } + }, + "is-array-buffer": { + "version": "3.0.4", + "resolved": "https://registry.npmmirror.com/is-array-buffer/-/is-array-buffer-3.0.4.tgz", + "integrity": "sha512-wcjaerHw0ydZwfhiKbXJWLDY8A7yV7KhjQOpb83hGgGfId/aQa4TOvwyzn2PuswW2gPCYEL/nEAiSVpdOj1lXw==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.2.1" + } + }, + "is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmmirror.com/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", + "dev": true + }, + "is-bigint": { + "version": "1.0.4", + "resolved": "https://registry.npmmirror.com/is-bigint/-/is-bigint-1.0.4.tgz", + "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", + "dev": true, + "requires": { + "has-bigints": "^1.0.1" + } + }, + "is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmmirror.com/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "requires": { + "binary-extensions": "^2.0.0" + } + }, + "is-boolean-object": { + "version": "1.1.2", + "resolved": "https://registry.npmmirror.com/is-boolean-object/-/is-boolean-object-1.1.2.tgz", + "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + } + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmmirror.com/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "is-callable": { + "version": "1.2.7", + "resolved": "https://registry.npmmirror.com/is-callable/-/is-callable-1.2.7.tgz", + "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", + "dev": true + }, + "is-ci": { + "version": "1.2.1", + "resolved": "https://registry.npmmirror.com/is-ci/-/is-ci-1.2.1.tgz", + "integrity": "sha512-s6tfsaQaQi3JNciBH6shVqEDvhGut0SUXr31ag8Pd8BBbVVlcGfWhpPmEOoM6RJ5TFhbypvf5yyRw/VXW1IiWg==", + "dev": true, + "requires": { + "ci-info": "^1.5.0" + } + }, + "is-color-stop": { + "version": "1.1.0", + "resolved": "https://registry.npmmirror.com/is-color-stop/-/is-color-stop-1.1.0.tgz", + "integrity": "sha512-H1U8Vz0cfXNujrJzEcvvwMDW9Ra+biSYA3ThdQvAnMLJkEHQXn6bWzLkxHtVYJ+Sdbx0b6finn3jZiaVe7MAHA==", + "dev": true, + "requires": { + "css-color-names": "^0.0.4", + "hex-color-regex": "^1.1.0", + "hsl-regex": "^1.0.0", + "hsla-regex": "^1.0.0", + "rgb-regex": "^1.0.1", + "rgba-regex": "^1.0.0" + } + }, + "is-core-module": { + "version": "2.13.1", + "resolved": "https://registry.npmmirror.com/is-core-module/-/is-core-module-2.13.1.tgz", + "integrity": "sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==", + "dev": true, + "requires": { + "hasown": "^2.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.1", + "resolved": "https://registry.npmmirror.com/is-data-descriptor/-/is-data-descriptor-1.0.1.tgz", + "integrity": "sha512-bc4NlCDiCr28U4aEsQ3Qs2491gVq4V8G7MQyws968ImqjKuYtTJXrl7Vq7jsN7Ly/C3xj5KWFrY7sHNeDkAzXw==", + "dev": true, + "requires": { + "hasown": "^2.0.0" + } + }, + "is-data-view": { + "version": "1.0.1", + "resolved": "https://registry.npmmirror.com/is-data-view/-/is-data-view-1.0.1.tgz", + "integrity": "sha512-AHkaJrsUVW6wq6JS8y3JnM/GJF/9cf+k20+iDzlSaJrinEo5+7vRiteOSwBhHRiAyQATN1AmY4hwzxJKPmYf+w==", + "dev": true, + "requires": { + "is-typed-array": "^1.1.13" + } + }, + "is-date-object": { + "version": "1.0.5", + "resolved": "https://registry.npmmirror.com/is-date-object/-/is-date-object-1.0.5.tgz", + "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", + "requires": { + "has-tostringtag": "^1.0.0" + } + }, + "is-descriptor": { + "version": "0.1.7", + "resolved": "https://registry.npmmirror.com/is-descriptor/-/is-descriptor-0.1.7.tgz", + "integrity": "sha512-C3grZTvObeN1xud4cRWl366OMXZTj0+HGyk4hvfpx4ZHt1Pb60ANSXqCK7pdOTeUQpRzECBSTphqvD7U+l22Eg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.1", + "is-data-descriptor": "^1.0.1" + } + }, + "is-directory": { + "version": "0.3.1", + "resolved": "https://registry.npmmirror.com/is-directory/-/is-directory-0.3.1.tgz", + "integrity": "sha512-yVChGzahRFvbkscn2MlwGismPO12i9+znNruC5gVEntG3qu0xQMzsGg/JFbrsqDOHtHFPci+V5aP5T9I+yeKqw==", + "dev": true + }, + "is-docker": { + "version": "2.2.1", + "resolved": "https://registry.npmmirror.com/is-docker/-/is-docker-2.2.1.tgz", + "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==", + "dev": true + }, + "is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmmirror.com/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==", + "dev": true + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmmirror.com/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmmirror.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, + "is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmmirror.com/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-negative-zero": { + "version": "2.0.3", + "resolved": "https://registry.npmmirror.com/is-negative-zero/-/is-negative-zero-2.0.3.tgz", + "integrity": "sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw==", + "dev": true + }, + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmmirror.com/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha512-4cboCqIpliH+mAvFNegjZQ4kgKc3ZUhQVr3HvWbSh5q3WH2v82ct+T2Y1hdU5Gdtorx/cLifQjqCbL7bpznLTg==", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmmirror.com/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-number-object": { + "version": "1.0.7", + "resolved": "https://registry.npmmirror.com/is-number-object/-/is-number-object-1.0.7.tgz", + "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==", + "dev": true, + "requires": { + "has-tostringtag": "^1.0.0" + } + }, + "is-obj": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/is-obj/-/is-obj-2.0.0.tgz", + "integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==", + "dev": true + }, + "is-path-cwd": { + "version": "2.2.0", + "resolved": "https://registry.npmmirror.com/is-path-cwd/-/is-path-cwd-2.2.0.tgz", + "integrity": "sha512-w942bTcih8fdJPJmQHFzkS76NEP8Kzzvmw92cXsazb8intwLqPibPPdXf4ANdKV3rYMuuQYGIWtvz9JilB3NFQ==", + "dev": true + }, + "is-path-in-cwd": { + "version": "2.1.0", + "resolved": "https://registry.npmmirror.com/is-path-in-cwd/-/is-path-in-cwd-2.1.0.tgz", + "integrity": "sha512-rNocXHgipO+rvnP6dk3zI20RpOtrAM/kzbB258Uw5BWr3TpXi861yzjo16Dn4hUox07iw5AyeMLHWsujkjzvRQ==", + "dev": true, + "requires": { + "is-path-inside": "^2.1.0" + } + }, + "is-path-inside": { + "version": "2.1.0", + "resolved": "https://registry.npmmirror.com/is-path-inside/-/is-path-inside-2.1.0.tgz", + "integrity": "sha512-wiyhTzfDWsvwAW53OBWF5zuvaOGlZ6PwYxAbPVDhpm+gM09xKQGjBq/8uYN12aDvMxnAnq3dxTyoSoRNmg5YFg==", + "dev": true, + "requires": { + "path-is-inside": "^1.0.2" + } + }, + "is-plain-obj": { + "version": "1.1.0", + "resolved": "https://registry.npmmirror.com/is-plain-obj/-/is-plain-obj-1.1.0.tgz", + "integrity": "sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg==", + "dev": true + }, + "is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmmirror.com/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "dev": true, + "requires": { + "isobject": "^3.0.1" + } + }, + "is-promise": { + "version": "2.2.2", + "resolved": "https://registry.npmmirror.com/is-promise/-/is-promise-2.2.2.tgz", + "integrity": "sha512-+lP4/6lKUBfQjZ2pdxThZvLUAafmZb8OAxFb8XXtiQmS35INgr85hdOGoEs124ez1FCnZJt6jau/T+alh58QFQ==" + }, + "is-regex": { + "version": "1.1.4", + "resolved": "https://registry.npmmirror.com/is-regex/-/is-regex-1.1.4.tgz", + "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", + "requires": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + } + }, + "is-regexp": { + "version": "1.0.0", + "resolved": "https://registry.npmmirror.com/is-regexp/-/is-regexp-1.0.0.tgz", + "integrity": "sha512-7zjFAPO4/gwyQAAgRRmqeEeyIICSdmCqa3tsVHMdBzaXXRiqopZL4Cyghg/XulGWrtABTpbnYYzzIRffLkP4oA==", + "dev": true + }, + "is-resolvable": { + "version": "1.1.0", + "resolved": "https://registry.npmmirror.com/is-resolvable/-/is-resolvable-1.1.0.tgz", + "integrity": "sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg==", + "dev": true + }, + "is-shared-array-buffer": { + "version": "1.0.3", + "resolved": "https://registry.npmmirror.com/is-shared-array-buffer/-/is-shared-array-buffer-1.0.3.tgz", + "integrity": "sha512-nA2hv5XIhLR3uVzDDfCIknerhx8XUKnstuOERPNNIinXG7v9u+ohXF67vxm4TPTEPU6lm61ZkwP3c9PCB97rhg==", + "dev": true, + "requires": { + "call-bind": "^1.0.7" + } + }, + "is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmmirror.com/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha512-uQPm8kcs47jx38atAcWTVxyltQYoPT68y9aWYdV6yWXSyW8mzSat0TL6CiWdZeCdF3KrAvpVtnHbTv4RN+rqdQ==", + "dev": true + }, + "is-string": { + "version": "1.0.7", + "resolved": "https://registry.npmmirror.com/is-string/-/is-string-1.0.7.tgz", + "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==", + "dev": true, + "requires": { + "has-tostringtag": "^1.0.0" + } + }, + "is-symbol": { + "version": "1.0.4", + "resolved": "https://registry.npmmirror.com/is-symbol/-/is-symbol-1.0.4.tgz", + "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", + "dev": true, + "requires": { + "has-symbols": "^1.0.2" + } + }, + "is-typed-array": { + "version": "1.1.13", + "resolved": "https://registry.npmmirror.com/is-typed-array/-/is-typed-array-1.1.13.tgz", + "integrity": "sha512-uZ25/bUAlUY5fR4OKT4rZQEBrzQWYV9ZJYGGsUmEJ6thodVJ1HX64ePQ6Z0qPWP+m+Uq6e9UugrE38jeYsDSMw==", + "dev": true, + "requires": { + "which-typed-array": "^1.1.14" + } + }, + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmmirror.com/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==", + "dev": true + }, + "is-unicode-supported": { + "version": "0.1.0", + "resolved": "https://registry.npmmirror.com/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", + "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", + "dev": true + }, + "is-weakref": { + "version": "1.0.2", + "resolved": "https://registry.npmmirror.com/is-weakref/-/is-weakref-1.0.2.tgz", + "integrity": "sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.2" + } + }, + "is-windows": { + "version": "1.0.2", + "resolved": "https://registry.npmmirror.com/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", + "dev": true + }, + "is-wsl": { + "version": "1.1.0", + "resolved": "https://registry.npmmirror.com/is-wsl/-/is-wsl-1.1.0.tgz", + "integrity": "sha512-gfygJYZ2gLTDlmbWMI0CE2MwnFzSN/2SZfkMlItC4K/JBlsWVDB0bO6XhqcY13YXE7iMcAJnzTCJjPiTeJJ0Mw==", + "dev": true + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmmirror.com/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", + "dev": true + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmmirror.com/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==", + "dev": true + }, + "isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmmirror.com/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g==", + "dev": true + }, + "javascript-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmmirror.com/javascript-stringify/-/javascript-stringify-2.1.0.tgz", + "integrity": "sha512-JVAfqNPTvNq3sB/VHQJAFxN/sPgKnsKrCwyRt15zwNCdrMMJDdcEOdubuy+DuJYYdm0ox1J4uzEuYKkN+9yhVg==", + "dev": true + }, + "jest-worker": { + "version": "25.5.0", + "resolved": "https://registry.npmmirror.com/jest-worker/-/jest-worker-25.5.0.tgz", + "integrity": "sha512-/dsSmUkIy5EBGfv/IjjqmFxrNAUpBERfGs1oHROyD7yxjG/w+t0GOJDX8O1k32ySmd7+a5IhnJU2qQFcJ4n1vw==", + "dev": true, + "requires": { + "merge-stream": "^2.0.0", + "supports-color": "^7.0.0" + }, + "dependencies": { + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmmirror.com/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmmirror.com/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "js-base64": { + "version": "2.6.4", + "resolved": "https://registry.npmmirror.com/js-base64/-/js-base64-2.6.4.tgz", + "integrity": "sha512-pZe//GGmwJndub7ZghVHz7vjb2LgC1m8B07Au3eYqeqv9emhESByMXxaEgkUkEqJe87oBbSniGYoQNIBklc7IQ==", + "dev": true + }, + "js-beautify": { + "version": "1.13.0", + "resolved": "https://registry.npmmirror.com/js-beautify/-/js-beautify-1.13.0.tgz", + "integrity": "sha512-/Tbp1OVzZjbwzwJQFIlYLm9eWQ+3aYbBXLSaqb1mEJzhcQAfrqMMQYtjb6io+U6KpD0ID4F+Id3/xcjH3l/sqA==", + "requires": { + "config-chain": "^1.1.12", + "editorconfig": "^0.15.3", + "glob": "^7.1.3", + "mkdirp": "^1.0.4", + "nopt": "^5.0.0" + } + }, + "js-cookie": { + "version": "3.0.1", + "resolved": "https://registry.npmmirror.com/js-cookie/-/js-cookie-3.0.1.tgz", + "integrity": "sha512-+0rgsUXZu4ncpPxRL+lNEptWMOWl9etvPHc/koSRp6MPwpRYAhmk0dUG00J4bxVV3r9uUzfo24wW0knS07SKSw==" + }, + "js-message": { + "version": "1.0.7", + "resolved": "https://registry.npmmirror.com/js-message/-/js-message-1.0.7.tgz", + "integrity": "sha512-efJLHhLjIyKRewNS9EGZ4UpI8NguuL6fKkhRxVuMmrGV2xN/0APGdQYwLFky5w9naebSZ0OwAGp0G6/2Cg90rA==", + "dev": true + }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmmirror.com/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "js-yaml": { + "version": "3.14.1", + "resolved": "https://registry.npmmirror.com/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, + "jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmmirror.com/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg==", + "dev": true + }, + "jsencrypt": { + "version": "3.0.0-rc.1", + "resolved": "https://registry.npmmirror.com/jsencrypt/-/jsencrypt-3.0.0-rc.1.tgz", + "integrity": "sha512-gcvGaqerlUJy1Kq6tNgPYteVEoWNemu+9hBe2CdsCIz4rVcwjoTQ72iD1W76/PRMlnkzG0yVh7nwOOMOOUfKmg==" + }, + "jsesc": { + "version": "2.5.2", + "resolved": "https://registry.npmmirror.com/jsesc/-/jsesc-2.5.2.tgz", + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "dev": true + }, + "json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmmirror.com/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true + }, + "json-parse-better-errors": { + "version": "1.0.2", + "resolved": "https://registry.npmmirror.com/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", + "dev": true + }, + "json-parse-even-better-errors": { + "version": "2.3.1", + "resolved": "https://registry.npmmirror.com/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", + "dev": true + }, + "json-schema": { + "version": "0.4.0", + "resolved": "https://registry.npmmirror.com/json-schema/-/json-schema-0.4.0.tgz", + "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==", + "dev": true + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmmirror.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmmirror.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true + }, + "json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmmirror.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==", + "dev": true + }, + "json5": { + "version": "2.2.3", + "resolved": "https://registry.npmmirror.com/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "dev": true + }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmmirror.com/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "jsprim": { + "version": "1.4.2", + "resolved": "https://registry.npmmirror.com/jsprim/-/jsprim-1.4.2.tgz", + "integrity": "sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw==", + "dev": true, + "requires": { + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.4.0", + "verror": "1.10.0" + } + }, + "keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmmirror.com/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "dev": true, + "requires": { + "json-buffer": "3.0.1" + } + }, + "killable": { + "version": "1.0.1", + "resolved": "https://registry.npmmirror.com/killable/-/killable-1.0.1.tgz", + "integrity": "sha512-LzqtLKlUwirEUyl/nicirVmNiPvYs7l5n8wOPP7fyJVpUPkvCnW/vuiXGpylGUlnPDnB7311rARzAt3Mhswpjg==", + "dev": true + }, + "kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmmirror.com/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true + }, + "klona": { + "version": "2.0.6", + "resolved": "https://registry.npmmirror.com/klona/-/klona-2.0.6.tgz", + "integrity": "sha512-dhG34DXATL5hSxJbIexCft8FChFXtmskoZYnoPWjXQuebWYCNkVeV3KkGegCK9CP1oswI/vQibS2GY7Em/sJJA==", + "dev": true + }, + "launch-editor": { + "version": "2.6.1", + "resolved": "https://registry.npmmirror.com/launch-editor/-/launch-editor-2.6.1.tgz", + "integrity": "sha512-eB/uXmFVpY4zezmGp5XtU21kwo7GBbKB+EQ+UZeWtGb9yAM5xt/Evk+lYH3eRNAtId+ej4u7TYPFZ07w4s7rRw==", + "dev": true, + "requires": { + "picocolors": "^1.0.0", + "shell-quote": "^1.8.1" + } + }, + "launch-editor-middleware": { + "version": "2.6.1", + "resolved": "https://registry.npmmirror.com/launch-editor-middleware/-/launch-editor-middleware-2.6.1.tgz", + "integrity": "sha512-Fg/xYhf7ARmRp40n18wIfJyuAMEjXo67Yull7uF7d0OJ3qA4EYJISt1XfPPn69IIJ5jKgQwzcg6DqHYo95LL/g==", + "dev": true, + "requires": { + "launch-editor": "^2.6.1" + } + }, + "levn": { + "version": "0.4.1", + "resolved": "https://registry.npmmirror.com/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "requires": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + } + }, + "lines-and-columns": { + "version": "1.2.4", + "resolved": "https://registry.npmmirror.com/lines-and-columns/-/lines-and-columns-1.2.4.tgz", + "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", + "dev": true + }, + "lint-staged": { + "version": "10.5.3", + "resolved": "https://registry.npmmirror.com/lint-staged/-/lint-staged-10.5.3.tgz", + "integrity": "sha512-TanwFfuqUBLufxCc3RUtFEkFraSPNR3WzWcGF39R3f2J7S9+iF9W0KTVLfSy09lYGmZS5NDCxjNvhGMSJyFCWg==", + "dev": true, + "requires": { + "chalk": "^4.1.0", + "cli-truncate": "^2.1.0", + "commander": "^6.2.0", + "cosmiconfig": "^7.0.0", + "debug": "^4.2.0", + "dedent": "^0.7.0", + "enquirer": "^2.3.6", + "execa": "^4.1.0", + "listr2": "^3.2.2", + "log-symbols": "^4.0.0", + "micromatch": "^4.0.2", + "normalize-path": "^3.0.0", + "please-upgrade-node": "^3.2.0", + "string-argv": "0.3.1", + "stringify-object": "^3.3.0" + }, + "dependencies": { + "braces": { + "version": "3.0.3", + "resolved": "https://registry.npmmirror.com/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "dev": true, + "requires": { + "fill-range": "^7.1.1" + } + }, + "commander": { + "version": "6.2.1", + "resolved": "https://registry.npmmirror.com/commander/-/commander-6.2.1.tgz", + "integrity": "sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==", + "dev": true + }, + "cosmiconfig": { + "version": "7.1.0", + "resolved": "https://registry.npmmirror.com/cosmiconfig/-/cosmiconfig-7.1.0.tgz", + "integrity": "sha512-AdmX6xUzdNASswsFtmwSt7Vj8po9IuqXm0UXz7QKPuEUmPB4XyjGfaAr2PSuELMwkRMVH1EpIkX5bTZGRB3eCA==", + "dev": true, + "requires": { + "@types/parse-json": "^4.0.0", + "import-fresh": "^3.2.1", + "parse-json": "^5.0.0", + "path-type": "^4.0.0", + "yaml": "^1.10.0" + } + }, + "cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmmirror.com/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + } + }, + "execa": { + "version": "4.1.0", + "resolved": "https://registry.npmmirror.com/execa/-/execa-4.1.0.tgz", + "integrity": "sha512-j5W0//W7f8UxAn8hXVnwG8tLwdiUy4FJLcSupCg6maBYZDpyBvTApK7KyuI4bKj8KOh1r2YH+6ucuYtJv1bTZA==", + "dev": true, + "requires": { + "cross-spawn": "^7.0.0", + "get-stream": "^5.0.0", + "human-signals": "^1.1.1", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.0", + "onetime": "^5.1.0", + "signal-exit": "^3.0.2", + "strip-final-newline": "^2.0.0" + } + }, + "fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmmirror.com/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "dev": true, + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "get-stream": { + "version": "5.2.0", + "resolved": "https://registry.npmmirror.com/get-stream/-/get-stream-5.2.0.tgz", + "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", + "dev": true, + "requires": { + "pump": "^3.0.0" + } + }, + "import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmmirror.com/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "dev": true, + "requires": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + } + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmmirror.com/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true + }, + "is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmmirror.com/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "dev": true + }, + "log-symbols": { + "version": "4.1.0", + "resolved": "https://registry.npmmirror.com/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", + "dev": true, + "requires": { + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" + } + }, + "micromatch": { + "version": "4.0.7", + "resolved": "https://registry.npmmirror.com/micromatch/-/micromatch-4.0.7.tgz", + "integrity": "sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==", + "dev": true, + "requires": { + "braces": "^3.0.3", + "picomatch": "^2.3.1" + } + }, + "mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmmirror.com/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true + }, + "npm-run-path": { + "version": "4.0.1", + "resolved": "https://registry.npmmirror.com/npm-run-path/-/npm-run-path-4.0.1.tgz", + "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", + "dev": true, + "requires": { + "path-key": "^3.0.0" + } + }, + "onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmmirror.com/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "dev": true, + "requires": { + "mimic-fn": "^2.1.0" + } + }, + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmmirror.com/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true + }, + "path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmmirror.com/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true + }, + "resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmmirror.com/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true + }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmmirror.com/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true + }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmmirror.com/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "requires": { + "is-number": "^7.0.0" + } + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmmirror.com/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + } + } + }, + "listr2": { + "version": "3.14.0", + "resolved": "https://registry.npmmirror.com/listr2/-/listr2-3.14.0.tgz", + "integrity": "sha512-TyWI8G99GX9GjE54cJ+RrNMcIFBfwMPxc3XTFiAYGN4s10hWROGtOg7+O6u6LE3mNkyld7RSLE6nrKBvTfcs3g==", + "dev": true, + "requires": { + "cli-truncate": "^2.1.0", + "colorette": "^2.0.16", + "log-update": "^4.0.0", + "p-map": "^4.0.0", + "rfdc": "^1.3.0", + "rxjs": "^7.5.1", + "through": "^2.3.8", + "wrap-ansi": "^7.0.0" + }, + "dependencies": { + "p-map": { + "version": "4.0.0", + "resolved": "https://registry.npmmirror.com/p-map/-/p-map-4.0.0.tgz", + "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==", + "dev": true, + "requires": { + "aggregate-error": "^3.0.0" + } + }, + "rxjs": { + "version": "7.8.1", + "resolved": "https://registry.npmmirror.com/rxjs/-/rxjs-7.8.1.tgz", + "integrity": "sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==", + "dev": true, + "requires": { + "tslib": "^2.1.0" + } + } + } + }, + "loader-fs-cache": { + "version": "1.0.3", + "resolved": "https://registry.npmmirror.com/loader-fs-cache/-/loader-fs-cache-1.0.3.tgz", + "integrity": "sha512-ldcgZpjNJj71n+2Mf6yetz+c9bM4xpKtNds4LbqXzU/PTdeAX0g3ytnU1AJMEcTk2Lex4Smpe3Q/eCTsvUBxbA==", + "dev": true, + "requires": { + "find-cache-dir": "^0.1.1", + "mkdirp": "^0.5.1" + }, + "dependencies": { + "find-cache-dir": { + "version": "0.1.1", + "resolved": "https://registry.npmmirror.com/find-cache-dir/-/find-cache-dir-0.1.1.tgz", + "integrity": "sha512-Z9XSBoNE7xQiV6MSgPuCfyMokH2K7JdpRkOYE1+mu3d4BFJtx3GW+f6Bo4q8IX6rlf5MYbLBKW0pjl2cWdkm2A==", + "dev": true, + "requires": { + "commondir": "^1.0.1", + "mkdirp": "^0.5.1", + "pkg-dir": "^1.0.0" + } + }, + "find-up": { + "version": "1.1.2", + "resolved": "https://registry.npmmirror.com/find-up/-/find-up-1.1.2.tgz", + "integrity": "sha512-jvElSjyuo4EMQGoTwo1uJU5pQMwTW5lS1x05zzfJuTIyLR3zwO27LYrxNg+dlvKpGOuGy/MzBdXh80g0ve5+HA==", + "dev": true, + "requires": { + "path-exists": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + }, + "mkdirp": { + "version": "0.5.6", + "resolved": "https://registry.npmmirror.com/mkdirp/-/mkdirp-0.5.6.tgz", + "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", + "dev": true, + "requires": { + "minimist": "^1.2.6" + } + }, + "path-exists": { + "version": "2.1.0", + "resolved": "https://registry.npmmirror.com/path-exists/-/path-exists-2.1.0.tgz", + "integrity": "sha512-yTltuKuhtNeFJKa1PiRzfLAU5182q1y4Eb4XCJ3PBqyzEDkAZRzBrKKBct682ls9reBVHf9udYLN5Nd+K1B9BQ==", + "dev": true, + "requires": { + "pinkie-promise": "^2.0.0" + } + }, + "pkg-dir": { + "version": "1.0.0", + "resolved": "https://registry.npmmirror.com/pkg-dir/-/pkg-dir-1.0.0.tgz", + "integrity": "sha512-c6pv3OE78mcZ92ckebVDqg0aWSoKhOTbwCV6qbCWMk546mAL9pZln0+QsN/yQ7fkucd4+yJPLrCBXNt8Ruk+Eg==", + "dev": true, + "requires": { + "find-up": "^1.0.0" + } + } + } + }, + "loader-runner": { + "version": "2.4.0", + "resolved": "https://registry.npmmirror.com/loader-runner/-/loader-runner-2.4.0.tgz", + "integrity": "sha512-Jsmr89RcXGIwivFY21FcRrisYZfvLMTWx5kOLc+JTxtpBOG6xML0vzbc6SEQG2FO9/4Fc3wW4LVcB5DmGflaRw==", + "dev": true + }, + "loader-utils": { + "version": "2.0.4", + "resolved": "https://registry.npmmirror.com/loader-utils/-/loader-utils-2.0.4.tgz", + "integrity": "sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==", + "dev": true, + "requires": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^2.1.2" + } + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmmirror.com/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmmirror.com/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + }, + "lodash.debounce": { + "version": "4.0.8", + "resolved": "https://registry.npmmirror.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz", + "integrity": "sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==", + "dev": true + }, + "lodash.defaultsdeep": { + "version": "4.6.1", + "resolved": "https://registry.npmmirror.com/lodash.defaultsdeep/-/lodash.defaultsdeep-4.6.1.tgz", + "integrity": "sha512-3j8wdDzYuWO3lM3Reg03MuQR957t287Rpcxp1njpEa8oDrikb+FwGdW3n+FELh/A6qib6yPit0j/pv9G/yeAqA==", + "dev": true + }, + "lodash.kebabcase": { + "version": "4.1.1", + "resolved": "https://registry.npmmirror.com/lodash.kebabcase/-/lodash.kebabcase-4.1.1.tgz", + "integrity": "sha512-N8XRTIMMqqDgSy4VLKPnJ/+hpGZN+PHQiJnSenYqPaVV/NCqEogTnAdZLQiGKhxX+JCs8waWq2t1XHWKOmlY8g==", + "dev": true + }, + "lodash.mapvalues": { + "version": "4.6.0", + "resolved": "https://registry.npmmirror.com/lodash.mapvalues/-/lodash.mapvalues-4.6.0.tgz", + "integrity": "sha512-JPFqXFeZQ7BfS00H58kClY7SPVeHertPE0lNuCyZ26/XlN8TvakYD7b9bGyNmXbT/D3BbtPAAmq90gPWqLkxlQ==", + "dev": true + }, + "lodash.memoize": { + "version": "4.1.2", + "resolved": "https://registry.npmmirror.com/lodash.memoize/-/lodash.memoize-4.1.2.tgz", + "integrity": "sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==", + "dev": true + }, + "lodash.padend": { + "version": "4.6.1", + "resolved": "https://registry.npmmirror.com/lodash.padend/-/lodash.padend-4.6.1.tgz", + "integrity": "sha512-sOQs2aqGpbl27tmCS1QNZA09Uqp01ZzWfDUoD+xzTii0E7dSQfRKcRetFwa+uXaxaqL+TKm7CgD2JdKP7aZBSw==", + "dev": true + }, + "lodash.transform": { + "version": "4.6.0", + "resolved": "https://registry.npmmirror.com/lodash.transform/-/lodash.transform-4.6.0.tgz", + "integrity": "sha512-LO37ZnhmBVx0GvOU/caQuipEh4GN82TcWv3yHlebGDgOxbxiwwzW5Pcx2AcvpIv2WmvmSMoC492yQFNhy/l/UQ==", + "dev": true + }, + "lodash.uniq": { + "version": "4.5.0", + "resolved": "https://registry.npmmirror.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz", + "integrity": "sha512-xfBaXQd9ryd9dlSDvnvI0lvxfLJlYAZzXomUYzLKtUeOQvOP5piqAWuGtrhWeqaXK9hhoM/iyJc5AV+XfsX3HQ==", + "dev": true + }, + "log-symbols": { + "version": "2.2.0", + "resolved": "https://registry.npmmirror.com/log-symbols/-/log-symbols-2.2.0.tgz", + "integrity": "sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg==", + "dev": true, + "requires": { + "chalk": "^2.0.1" + }, + "dependencies": { + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmmirror.com/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + } + } + }, + "log-update": { + "version": "4.0.0", + "resolved": "https://registry.npmmirror.com/log-update/-/log-update-4.0.0.tgz", + "integrity": "sha512-9fkkDevMefjg0mmzWFBW8YkFP91OrizzkW3diF7CpG+S2EYdy4+TVfGwz1zeF8x7hCx1ovSPTOE9Ngib74qqUg==", + "dev": true, + "requires": { + "ansi-escapes": "^4.3.0", + "cli-cursor": "^3.1.0", + "slice-ansi": "^4.0.0", + "wrap-ansi": "^6.2.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmmirror.com/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "astral-regex": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/astral-regex/-/astral-regex-2.0.0.tgz", + "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", + "dev": true + }, + "cli-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmmirror.com/cli-cursor/-/cli-cursor-3.1.0.tgz", + "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", + "dev": true, + "requires": { + "restore-cursor": "^3.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmmirror.com/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmmirror.com/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmmirror.com/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true + }, + "onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmmirror.com/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "dev": true, + "requires": { + "mimic-fn": "^2.1.0" + } + }, + "restore-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmmirror.com/restore-cursor/-/restore-cursor-3.1.0.tgz", + "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", + "dev": true, + "requires": { + "onetime": "^5.1.0", + "signal-exit": "^3.0.2" + } + }, + "slice-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmmirror.com/slice-ansi/-/slice-ansi-4.0.0.tgz", + "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "astral-regex": "^2.0.0", + "is-fullwidth-code-point": "^3.0.0" + } + }, + "wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmmirror.com/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + } + } + } + }, + "loglevel": { + "version": "1.9.1", + "resolved": "https://registry.npmmirror.com/loglevel/-/loglevel-1.9.1.tgz", + "integrity": "sha512-hP3I3kCrDIMuRwAwHltphhDM1r8i55H33GgqjXbrisuJhF4kRhW1dNuxsRklp4bXl8DSdLaNLuiL4A/LWRfxvg==", + "dev": true + }, + "lower-case": { + "version": "1.1.4", + "resolved": "https://registry.npmmirror.com/lower-case/-/lower-case-1.1.4.tgz", + "integrity": "sha512-2Fgx1Ycm599x+WGpIYwJOvsjmXFzTSc34IwDWALRA/8AopUKAVPwfJ+h5+f85BCp0PWmmJcWzEpxOpoXycMpdA==", + "dev": true + }, + "lru-cache": { + "version": "4.1.5", + "resolved": "https://registry.npmmirror.com/lru-cache/-/lru-cache-4.1.5.tgz", + "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", + "requires": { + "pseudomap": "^1.0.2", + "yallist": "^2.1.2" + } + }, + "magic-string": { + "version": "0.30.10", + "resolved": "https://registry.npmmirror.com/magic-string/-/magic-string-0.30.10.tgz", + "integrity": "sha512-iIRwTIf0QKV3UAnYK4PU8uiEc4SRh5jX0mwpIwETPpHdhVM4f53RSwS/vXvN1JhGX+Cs7B8qIq3d6AH49O5fAQ==", + "dev": true, + "requires": { + "@jridgewell/sourcemap-codec": "^1.4.15" + } + }, + "make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmmirror.com/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "dev": true, + "requires": { + "semver": "^6.0.0" + }, + "dependencies": { + "semver": { + "version": "6.3.1", + "resolved": "https://registry.npmmirror.com/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true + } + } + }, + "map-cache": { + "version": "0.2.2", + "resolved": "https://registry.npmmirror.com/map-cache/-/map-cache-0.2.2.tgz", + "integrity": "sha512-8y/eV9QQZCiyn1SprXSrCmqJN0yNRATe+PO8ztwqrvrbdRLA3eYJF0yaR0YayLWkMbsQSKWS9N2gPcGEc4UsZg==", + "dev": true + }, + "map-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmmirror.com/map-visit/-/map-visit-1.0.0.tgz", + "integrity": "sha512-4y7uGv8bd2WdM9vpQsiQNo41Ln1NvhvDRuVt0k2JZQ+ezN2uaQes7lZeZ+QQUHOLQAtDaBJ+7wCbi+ab/KFs+w==", + "dev": true, + "requires": { + "object-visit": "^1.0.0" + } + }, + "material-colors": { + "version": "1.2.6", + "resolved": "https://registry.npmmirror.com/material-colors/-/material-colors-1.2.6.tgz", + "integrity": "sha512-6qE4B9deFBIa9YSpOc9O0Sgc43zTeVYbgDT5veRKSlB2+ZuHNoVVxA1L/ckMUayV9Ay9y7Z/SZCLcGteW9i7bg==" + }, + "md5.js": { + "version": "1.3.5", + "resolved": "https://registry.npmmirror.com/md5.js/-/md5.js-1.3.5.tgz", + "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", + "dev": true, + "requires": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "mdn-data": { + "version": "2.0.4", + "resolved": "https://registry.npmmirror.com/mdn-data/-/mdn-data-2.0.4.tgz", + "integrity": "sha512-iV3XNKw06j5Q7mi6h+9vbx23Tv7JkjEVgKHW4pimwyDGWm0OIQntJJ+u1C6mg6mK1EaTv42XQ7w76yuzH7M2cA==", + "dev": true + }, + "media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmmirror.com/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", + "dev": true + }, + "memory-fs": { + "version": "0.4.1", + "resolved": "https://registry.npmmirror.com/memory-fs/-/memory-fs-0.4.1.tgz", + "integrity": "sha512-cda4JKCxReDXFXRqOHPQscuIYg1PvxbE2S2GP45rnwfEK+vZaXC8C1OFvdHIbgw0DLzowXGVoxLaAmlgRy14GQ==", + "dev": true, + "requires": { + "errno": "^0.1.3", + "readable-stream": "^2.0.1" + } + }, + "merge-descriptors": { + "version": "1.0.1", + "resolved": "https://registry.npmmirror.com/merge-descriptors/-/merge-descriptors-1.0.1.tgz", + "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==", + "dev": true + }, + "merge-options": { + "version": "1.0.1", + "resolved": "https://registry.npmmirror.com/merge-options/-/merge-options-1.0.1.tgz", + "integrity": "sha512-iuPV41VWKWBIOpBsjoxjDZw8/GbSfZ2mk7N1453bwMrfzdrIk7EzBd+8UVR6rkw67th7xnk9Dytl3J+lHPdxvg==", + "dev": true, + "requires": { + "is-plain-obj": "^1.1" + } + }, + "merge-source-map": { + "version": "1.1.0", + "resolved": "https://registry.npmmirror.com/merge-source-map/-/merge-source-map-1.1.0.tgz", + "integrity": "sha512-Qkcp7P2ygktpMPh2mCQZaf3jhN6D3Z/qVZHSdWvQ+2Ef5HgRAPBO57A77+ENm0CPx2+1Ce/MYKi3ymqdfuqibw==", + "dev": true, + "requires": { + "source-map": "^0.6.1" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmmirror.com/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true + }, + "merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmmirror.com/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true + }, + "methods": { + "version": "1.1.2", + "resolved": "https://registry.npmmirror.com/methods/-/methods-1.1.2.tgz", + "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", + "dev": true + }, + "microargs": { + "version": "1.1.2", + "resolved": "https://registry.npmmirror.com/microargs/-/microargs-1.1.2.tgz", + "integrity": "sha512-fUrX9ozzzUX6JlDoNXmUM5i4B0uBF5xPznZ0Y/izM9wOtAaTf44V2vUCRgGBLUq/SeGIcDgfnEZDVoT92HId0g==", + "dev": true + }, + "microcli": { + "version": "1.3.3", + "resolved": "https://registry.npmmirror.com/microcli/-/microcli-1.3.3.tgz", + "integrity": "sha512-1isRaEBpfRC8vJMJymKknAH8CdPFABuWPVc18rlRWHOCcHLYEkJxcoH7FNkX7AuTGrB4Uf1ve6B0s/FfwzGWKg==", + "dev": true, + "requires": { + "lodash": "4.17.11", + "microargs": "1.1.2" + }, + "dependencies": { + "lodash": { + "version": "4.17.11", + "resolved": "https://registry.npmmirror.com/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", + "dev": true + } + } + }, + "micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmmirror.com/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + } + }, + "miller-rabin": { + "version": "4.0.1", + "resolved": "https://registry.npmmirror.com/miller-rabin/-/miller-rabin-4.0.1.tgz", + "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", + "dev": true, + "requires": { + "bn.js": "^4.0.0", + "brorand": "^1.0.1" + }, + "dependencies": { + "bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmmirror.com/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", + "dev": true + } + } + }, + "mime": { + "version": "2.6.0", + "resolved": "https://registry.npmmirror.com/mime/-/mime-2.6.0.tgz", + "integrity": "sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg==", + "dev": true + }, + "mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmmirror.com/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "dev": true + }, + "mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmmirror.com/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dev": true, + "requires": { + "mime-db": "1.52.0" + } + }, + "mimic-fn": { + "version": "1.2.0", + "resolved": "https://registry.npmmirror.com/mimic-fn/-/mimic-fn-1.2.0.tgz", + "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", + "dev": true + }, + "mini-css-extract-plugin": { + "version": "0.9.0", + "resolved": "https://registry.npmmirror.com/mini-css-extract-plugin/-/mini-css-extract-plugin-0.9.0.tgz", + "integrity": "sha512-lp3GeY7ygcgAmVIcRPBVhIkf8Us7FZjA+ILpal44qLdSu11wmjKQ3d9k15lfD7pO4esu9eUIAW7qiYIBppv40A==", + "dev": true, + "requires": { + "loader-utils": "^1.1.0", + "normalize-url": "1.9.1", + "schema-utils": "^1.0.0", + "webpack-sources": "^1.1.0" + }, + "dependencies": { + "json5": { + "version": "1.0.2", + "resolved": "https://registry.npmmirror.com/json5/-/json5-1.0.2.tgz", + "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", + "dev": true, + "requires": { + "minimist": "^1.2.0" + } + }, + "loader-utils": { + "version": "1.4.2", + "resolved": "https://registry.npmmirror.com/loader-utils/-/loader-utils-1.4.2.tgz", + "integrity": "sha512-I5d00Pd/jwMD2QCduo657+YM/6L3KZu++pmX9VFncxaxvHcru9jx1lBaFft+r4Mt2jK0Yhp41XlRAihzPxHNCg==", + "dev": true, + "requires": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^1.0.1" + } + }, + "normalize-url": { + "version": "1.9.1", + "resolved": "https://registry.npmmirror.com/normalize-url/-/normalize-url-1.9.1.tgz", + "integrity": "sha512-A48My/mtCklowHBlI8Fq2jFWK4tX4lJ5E6ytFsSOq1fzpvT0SQSgKhSg7lN5c2uYFOrUAOQp6zhhJnpp1eMloQ==", + "dev": true, + "requires": { + "object-assign": "^4.0.1", + "prepend-http": "^1.0.0", + "query-string": "^4.1.0", + "sort-keys": "^1.0.0" + } + }, + "schema-utils": { + "version": "1.0.0", + "resolved": "https://registry.npmmirror.com/schema-utils/-/schema-utils-1.0.0.tgz", + "integrity": "sha512-i27Mic4KovM/lnGsy8whRCHhc7VicJajAjTrYg11K9zfZXnYIt4k5F+kZkwjnrhKzLic/HLU4j11mjsz2G/75g==", + "dev": true, + "requires": { + "ajv": "^6.1.0", + "ajv-errors": "^1.0.0", + "ajv-keywords": "^3.1.0" + } + } + } + }, + "minimalistic-assert": { + "version": "1.0.1", + "resolved": "https://registry.npmmirror.com/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", + "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", + "dev": true + }, + "minimalistic-crypto-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmmirror.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", + "integrity": "sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg==", + "dev": true + }, + "minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmmirror.com/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmmirror.com/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "dev": true + }, + "minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmmirror.com/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "dev": true, + "requires": { + "yallist": "^4.0.0" + }, + "dependencies": { + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmmirror.com/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + } + } + }, + "minipass-collect": { + "version": "1.0.2", + "resolved": "https://registry.npmmirror.com/minipass-collect/-/minipass-collect-1.0.2.tgz", + "integrity": "sha512-6T6lH0H8OG9kITm/Jm6tdooIbogG9e0tLgpY6mphXSm/A9u8Nq1ryBG+Qspiub9LjWlBPsPS3tWQ/Botq4FdxA==", + "dev": true, + "requires": { + "minipass": "^3.0.0" + } + }, + "minipass-flush": { + "version": "1.0.5", + "resolved": "https://registry.npmmirror.com/minipass-flush/-/minipass-flush-1.0.5.tgz", + "integrity": "sha512-JmQSYYpPUqX5Jyn1mXaRwOda1uQ8HP5KAT/oDSLCzt1BYRhQU0/hDtsB1ufZfEEzMZ9aAVmsBw8+FWsIXlClWw==", + "dev": true, + "requires": { + "minipass": "^3.0.0" + } + }, + "minipass-pipeline": { + "version": "1.2.4", + "resolved": "https://registry.npmmirror.com/minipass-pipeline/-/minipass-pipeline-1.2.4.tgz", + "integrity": "sha512-xuIq7cIOt09RPRJ19gdi4b+RiNvDFYe5JH+ggNvBqGqpQXcru3PcRmOZuHBKWK1Txf9+cQ+HMVN4d6z46LZP7A==", + "dev": true, + "requires": { + "minipass": "^3.0.0" + } + }, + "minizlib": { + "version": "2.1.2", + "resolved": "https://registry.npmmirror.com/minizlib/-/minizlib-2.1.2.tgz", + "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", + "dev": true, + "requires": { + "minipass": "^3.0.0", + "yallist": "^4.0.0" + }, + "dependencies": { + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmmirror.com/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + } + } + }, + "mississippi": { + "version": "3.0.0", + "resolved": "https://registry.npmmirror.com/mississippi/-/mississippi-3.0.0.tgz", + "integrity": "sha512-x471SsVjUtBRtcvd4BzKE9kFC+/2TeWgKCgw0bZcw1b9l2X3QX5vCWgF+KaZaYm87Ss//rHnWryupDrgLvmSkA==", + "dev": true, + "requires": { + "concat-stream": "^1.5.0", + "duplexify": "^3.4.2", + "end-of-stream": "^1.1.0", + "flush-write-stream": "^1.0.0", + "from2": "^2.1.0", + "parallel-transform": "^1.1.0", + "pump": "^3.0.0", + "pumpify": "^1.3.3", + "stream-each": "^1.1.0", + "through2": "^2.0.0" + } + }, + "mitt": { + "version": "1.1.2", + "resolved": "https://registry.npmmirror.com/mitt/-/mitt-1.1.2.tgz", + "integrity": "sha512-3btxP0O9iGADGWAkteQ8mzDtEspZqu4I32y4GZYCV5BrwtzdcRpF4dQgNdJadCrbBx7Lu6Sq9AVrerMHR0Hkmw==", + "dev": true + }, + "mixin-deep": { + "version": "1.3.2", + "resolved": "https://registry.npmmirror.com/mixin-deep/-/mixin-deep-1.3.2.tgz", + "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==", + "dev": true, + "requires": { + "for-in": "^1.0.2", + "is-extendable": "^1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmmirror.com/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, + "requires": { + "is-plain-object": "^2.0.4" + } + } + } + }, + "mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmmirror.com/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==" + }, + "move-concurrently": { + "version": "1.0.1", + "resolved": "https://registry.npmmirror.com/move-concurrently/-/move-concurrently-1.0.1.tgz", + "integrity": "sha512-hdrFxZOycD/g6A6SoI2bB5NA/5NEqD0569+S47WZhPvm46sD50ZHdYaFmnua5lndde9rCHGjmfK7Z8BuCt/PcQ==", + "dev": true, + "requires": { + "aproba": "^1.1.1", + "copy-concurrently": "^1.0.0", + "fs-write-stream-atomic": "^1.0.8", + "mkdirp": "^0.5.1", + "rimraf": "^2.5.4", + "run-queue": "^1.0.3" + }, + "dependencies": { + "mkdirp": { + "version": "0.5.6", + "resolved": "https://registry.npmmirror.com/mkdirp/-/mkdirp-0.5.6.tgz", + "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", + "dev": true, + "requires": { + "minimist": "^1.2.6" + } + } + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmmirror.com/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "multicast-dns": { + "version": "6.2.3", + "resolved": "https://registry.npmmirror.com/multicast-dns/-/multicast-dns-6.2.3.tgz", + "integrity": "sha512-ji6J5enbMyGRHIAkAOu3WdV8nggqviKCEKtXcOqfphZZtQrmHKycfynJ2V7eVPUA4NhJ6V7Wf4TmGbTwKE9B6g==", + "dev": true, + "requires": { + "dns-packet": "^1.3.1", + "thunky": "^1.0.2" + } + }, + "multicast-dns-service-types": { + "version": "1.1.0", + "resolved": "https://registry.npmmirror.com/multicast-dns-service-types/-/multicast-dns-service-types-1.1.0.tgz", + "integrity": "sha512-cnAsSVxIDsYt0v7HmC0hWZFwwXSh+E6PgCrREDuN/EsjgLwA5XRmlMHhSiDPrt6HxY1gTivEa/Zh7GtODoLevQ==", + "dev": true + }, + "mute-stream": { + "version": "0.0.8", + "resolved": "https://registry.npmmirror.com/mute-stream/-/mute-stream-0.0.8.tgz", + "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==", + "dev": true + }, + "mz": { + "version": "2.7.0", + "resolved": "https://registry.npmmirror.com/mz/-/mz-2.7.0.tgz", + "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==", + "dev": true, + "requires": { + "any-promise": "^1.0.0", + "object-assign": "^4.0.1", + "thenify-all": "^1.0.0" + } + }, + "nanoid": { + "version": "3.3.7", + "resolved": "https://registry.npmmirror.com/nanoid/-/nanoid-3.3.7.tgz", + "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==", + "dev": true + }, + "nanomatch": { + "version": "1.2.13", + "resolved": "https://registry.npmmirror.com/nanomatch/-/nanomatch-1.2.13.tgz", + "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "fragment-cache": "^0.2.1", + "is-windows": "^1.0.2", + "kind-of": "^6.0.2", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + } + }, + "natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmmirror.com/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "dev": true + }, + "negotiator": { + "version": "0.6.3", + "resolved": "https://registry.npmmirror.com/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", + "dev": true + }, + "neo-async": { + "version": "2.6.2", + "resolved": "https://registry.npmmirror.com/neo-async/-/neo-async-2.6.2.tgz", + "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", + "dev": true + }, + "nice-try": { + "version": "1.0.5", + "resolved": "https://registry.npmmirror.com/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "dev": true + }, + "no-case": { + "version": "2.3.2", + "resolved": "https://registry.npmmirror.com/no-case/-/no-case-2.3.2.tgz", + "integrity": "sha512-rmTZ9kz+f3rCvK2TD1Ue/oZlns7OGoIWP4fc3llxxRXlOkHKoWPPWJOfFYpITabSow43QJbRIoHQXtt10VldyQ==", + "dev": true, + "requires": { + "lower-case": "^1.1.1" + } + }, + "node-forge": { + "version": "0.10.0", + "resolved": "https://registry.npmmirror.com/node-forge/-/node-forge-0.10.0.tgz", + "integrity": "sha512-PPmu8eEeG9saEUvI97fm4OYxXVB6bFvyNTyiUOBichBpFG8A1Ljw3bY62+5oOjDEMHRnd0Y7HQ+x7uzxOzC6JA==", + "dev": true + }, + "node-libs-browser": { + "version": "2.2.1", + "resolved": "https://registry.npmmirror.com/node-libs-browser/-/node-libs-browser-2.2.1.tgz", + "integrity": "sha512-h/zcD8H9kaDZ9ALUWwlBUDo6TKF8a7qBSCSEGfjTVIYeqsioSKaAX+BN7NgiMGp6iSIXZ3PxgCu8KS3b71YK5Q==", + "dev": true, + "requires": { + "assert": "^1.1.1", + "browserify-zlib": "^0.2.0", + "buffer": "^4.3.0", + "console-browserify": "^1.1.0", + "constants-browserify": "^1.0.0", + "crypto-browserify": "^3.11.0", + "domain-browser": "^1.1.1", + "events": "^3.0.0", + "https-browserify": "^1.0.0", + "os-browserify": "^0.3.0", + "path-browserify": "0.0.1", + "process": "^0.11.10", + "punycode": "^1.2.4", + "querystring-es3": "^0.2.0", + "readable-stream": "^2.3.3", + "stream-browserify": "^2.0.1", + "stream-http": "^2.7.2", + "string_decoder": "^1.0.0", + "timers-browserify": "^2.0.4", + "tty-browserify": "0.0.0", + "url": "^0.11.0", + "util": "^0.11.0", + "vm-browserify": "^1.0.1" + }, + "dependencies": { + "punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmmirror.com/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha512-jmYNElW7yvO7TV33CjSmvSiE2yco3bV2czu/OzDKdMNVZQWfxCblURLhf+47syQRBntjfLdd/H0egrzIG+oaFQ==", + "dev": true + } + } + }, + "node-releases": { + "version": "2.0.14", + "resolved": "https://registry.npmmirror.com/node-releases/-/node-releases-2.0.14.tgz", + "integrity": "sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==", + "dev": true + }, + "nopt": { + "version": "5.0.0", + "resolved": "https://registry.npmmirror.com/nopt/-/nopt-5.0.0.tgz", + "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==", + "requires": { + "abbrev": "1" + } + }, + "normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmmirror.com/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "dev": true, + "requires": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, + "normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmmirror.com/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true + }, + "normalize-range": { + "version": "0.1.2", + "resolved": "https://registry.npmmirror.com/normalize-range/-/normalize-range-0.1.2.tgz", + "integrity": "sha512-bdok/XvKII3nUpklnV6P2hxtMNrCboOjAcyBuQnWEhO665FwrSNRxU+AqpsyvO6LgGYPspN+lu5CLtw4jPRKNA==", + "dev": true + }, + "normalize-url": { + "version": "3.3.0", + "resolved": "https://registry.npmmirror.com/normalize-url/-/normalize-url-3.3.0.tgz", + "integrity": "sha512-U+JJi7duF1o+u2pynbp2zXDW2/PADgC30f0GsHZtRh+HOcXHnw137TrNlyxxRvWW5fjKd3bcLHPxofWuCjaeZg==", + "dev": true + }, + "normalize-wheel": { + "version": "1.0.1", + "resolved": "https://registry.npmmirror.com/normalize-wheel/-/normalize-wheel-1.0.1.tgz", + "integrity": "sha512-1OnlAPZ3zgrk8B91HyRj+eVv+kS5u+Z0SCsak6Xil/kmgEia50ga7zfkumayonZrImffAxPU/5WcyGhzetHNPA==" + }, + "npm-run-path": { + "version": "2.0.2", + "resolved": "https://registry.npmmirror.com/npm-run-path/-/npm-run-path-2.0.2.tgz", + "integrity": "sha512-lJxZYlT4DW/bRUtFh1MQIWqmLwQfAxnqWG4HhEdjMlkrJYnJn0Jrr2u3mgxqaWsdiBc76TYkTG/mhrnYTuzfHw==", + "dev": true, + "requires": { + "path-key": "^2.0.0" + } + }, + "nprogress": { + "version": "0.2.0", + "resolved": "https://registry.npmmirror.com/nprogress/-/nprogress-0.2.0.tgz", + "integrity": "sha512-I19aIingLgR1fmhftnbWWO3dXc0hSxqHQHQb3H8m+K3TnEn/iSeTZZOyvKXWqQESMwuUVnatlCnZdLBZZt2VSA==" + }, + "nth-check": { + "version": "1.0.2", + "resolved": "https://registry.npmmirror.com/nth-check/-/nth-check-1.0.2.tgz", + "integrity": "sha512-WeBOdju8SnzPN5vTUJYxYUxLeXpCaVP5i5e0LF8fg7WORF2Wd7wFX/pk0tYZk7s8T+J7VLy0Da6J1+wCT0AtHg==", + "dev": true, + "requires": { + "boolbase": "~1.0.0" + } + }, + "num2fraction": { + "version": "1.2.2", + "resolved": "https://registry.npmmirror.com/num2fraction/-/num2fraction-1.2.2.tgz", + "integrity": "sha512-Y1wZESM7VUThYY+4W+X4ySH2maqcA+p7UR+w8VWNWVAd6lwuXXWz/w/Cz43J/dI2I+PS6wD5N+bJUF+gjWvIqg==", + "dev": true + }, + "oauth-sign": { + "version": "0.9.0", + "resolved": "https://registry.npmmirror.com/oauth-sign/-/oauth-sign-0.9.0.tgz", + "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", + "dev": true + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmmirror.com/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "dev": true + }, + "object-copy": { + "version": "0.1.0", + "resolved": "https://registry.npmmirror.com/object-copy/-/object-copy-0.1.0.tgz", + "integrity": "sha512-79LYn6VAb63zgtmAteVOWo9Vdj71ZVBy3Pbse+VqxDpEP83XuujMrGqHIwAXJ5I/aM0zU7dIyIAhifVTPrNItQ==", + "dev": true, + "requires": { + "copy-descriptor": "^0.1.0", + "define-property": "^0.2.5", + "kind-of": "^3.0.3" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmmirror.com/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha512-Rr7ADjQZenceVOAKop6ALkkRAmH1A4Gx9hV/7ZujPUN2rkATqFO0JZLZInbAjpZYoJ1gUx8MRMQVkYemcbMSTA==", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmmirror.com/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "object-hash": { + "version": "1.3.1", + "resolved": "https://registry.npmmirror.com/object-hash/-/object-hash-1.3.1.tgz", + "integrity": "sha512-OSuu/pU4ENM9kmREg0BdNrUDIl1heYa4mBZacJc+vVWz4GtAwu7jO8s4AIt2aGRUTqxykpWzI3Oqnsm13tTMDA==", + "dev": true + }, + "object-inspect": { + "version": "1.13.1", + "resolved": "https://registry.npmmirror.com/object-inspect/-/object-inspect-1.13.1.tgz", + "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==", + "dev": true + }, + "object-is": { + "version": "1.1.6", + "resolved": "https://registry.npmmirror.com/object-is/-/object-is-1.1.6.tgz", + "integrity": "sha512-F8cZ+KfGlSGi09lJT7/Nd6KJZ9ygtvYC0/UYYLI9nmQKLMnydpB9yvbv9K1uSkEu7FU9vYPmVwLg328tX+ot3Q==", + "requires": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1" + } + }, + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmmirror.com/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==" + }, + "object-visit": { + "version": "1.0.1", + "resolved": "https://registry.npmmirror.com/object-visit/-/object-visit-1.0.1.tgz", + "integrity": "sha512-GBaMwwAVK9qbQN3Scdo0OyvgPW7l3lnaVMj84uTOZlswkX0KpF6fyDBJhtTthf7pymztoN36/KEr1DyhF96zEA==", + "dev": true, + "requires": { + "isobject": "^3.0.0" + } + }, + "object.assign": { + "version": "4.1.5", + "resolved": "https://registry.npmmirror.com/object.assign/-/object.assign-4.1.5.tgz", + "integrity": "sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.5", + "define-properties": "^1.2.1", + "has-symbols": "^1.0.3", + "object-keys": "^1.1.1" + } + }, + "object.getownpropertydescriptors": { + "version": "2.1.8", + "resolved": "https://registry.npmmirror.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.8.tgz", + "integrity": "sha512-qkHIGe4q0lSYMv0XI4SsBTJz3WaURhLvd0lKSgtVuOsJ2krg4SgMw3PIRQFMp07yi++UR3se2mkcLqsBNpBb/A==", + "dev": true, + "requires": { + "array.prototype.reduce": "^1.0.6", + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-object-atoms": "^1.0.0", + "gopd": "^1.0.1", + "safe-array-concat": "^1.1.2" + } + }, + "object.pick": { + "version": "1.3.0", + "resolved": "https://registry.npmmirror.com/object.pick/-/object.pick-1.3.0.tgz", + "integrity": "sha512-tqa/UMy/CCoYmj+H5qc07qvSL9dqcs/WZENZ1JbtWBlATP+iVOe778gE6MSijnyCnORzDuX6hU+LA4SZ09YjFQ==", + "dev": true, + "requires": { + "isobject": "^3.0.1" + } + }, + "object.values": { + "version": "1.2.0", + "resolved": "https://registry.npmmirror.com/object.values/-/object.values-1.2.0.tgz", + "integrity": "sha512-yBYjY9QX2hnRmZHAjG/f13MzmBzxzYgQhFrke06TTyKY5zSTEqkOeukBzIdVA3j3ulu8Qa3MbVFShV7T2RmGtQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + } + }, + "obuf": { + "version": "1.1.2", + "resolved": "https://registry.npmmirror.com/obuf/-/obuf-1.1.2.tgz", + "integrity": "sha512-PX1wu0AmAdPqOL1mWhqmlOd8kOIZQwGZw6rh7uby9fTc5lhaOWFLX3I6R1hrF9k3zUY40e6igsLGkDXK92LJNg==", + "dev": true + }, + "omelette": { + "version": "0.4.5", + "resolved": "https://registry.npmmirror.com/omelette/-/omelette-0.4.5.tgz", + "integrity": "sha512-b0k9uqwF60u15KmVkneVw96VYRtZu2QCbXUQ26SgdyVUgMBzctzIfhNPKAWl4oqJEKpe52CzBYSS+HIKtiK8sw==", + "dev": true + }, + "on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmmirror.com/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "dev": true, + "requires": { + "ee-first": "1.1.1" + } + }, + "on-headers": { + "version": "1.0.2", + "resolved": "https://registry.npmmirror.com/on-headers/-/on-headers-1.0.2.tgz", + "integrity": "sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==", + "dev": true + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmmirror.com/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "requires": { + "wrappy": "1" + } + }, + "onetime": { + "version": "2.0.1", + "resolved": "https://registry.npmmirror.com/onetime/-/onetime-2.0.1.tgz", + "integrity": "sha512-oyyPpiMaKARvvcgip+JV+7zci5L8D1W9RZIz2l1o08AM3pfspitVWnPt3mzHcBPp12oYMTy0pqrFs/C+m3EwsQ==", + "dev": true, + "requires": { + "mimic-fn": "^1.0.0" + } + }, + "open": { + "version": "6.4.0", + "resolved": "https://registry.npmmirror.com/open/-/open-6.4.0.tgz", + "integrity": "sha512-IFenVPgF70fSm1keSd2iDBIDIBZkroLeuffXq+wKTzTJlBpesFWojV9lb8mzOfaAzM1sr7HQHuO0vtV0zYekGg==", + "dev": true, + "requires": { + "is-wsl": "^1.1.0" + } + }, + "opener": { + "version": "1.5.2", + "resolved": "https://registry.npmmirror.com/opener/-/opener-1.5.2.tgz", + "integrity": "sha512-ur5UIdyw5Y7yEj9wLzhqXiy6GZ3Mwx0yGI+5sMn2r0N0v3cKJvUmFH5yPP+WXh9e0xfyzyJX95D8l088DNFj7A==", + "dev": true + }, + "opn": { + "version": "5.5.0", + "resolved": "https://registry.npmmirror.com/opn/-/opn-5.5.0.tgz", + "integrity": "sha512-PqHpggC9bLV0VeWcdKhkpxY+3JTzetLSqTCWL/z/tFIbI6G8JCjondXklT1JinczLz2Xib62sSp0T/gKT4KksA==", + "dev": true, + "requires": { + "is-wsl": "^1.1.0" + } + }, + "optionator": { + "version": "0.9.4", + "resolved": "https://registry.npmmirror.com/optionator/-/optionator-0.9.4.tgz", + "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", + "dev": true, + "requires": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.5" + } + }, + "ora": { + "version": "3.4.0", + "resolved": "https://registry.npmmirror.com/ora/-/ora-3.4.0.tgz", + "integrity": "sha512-eNwHudNbO1folBP3JsZ19v9azXWtQZjICdr3Q0TDPIaeBQ3mXLrh54wM+er0+hSp+dWKf+Z8KM58CYzEyIYxYg==", + "dev": true, + "requires": { + "chalk": "^2.4.2", + "cli-cursor": "^2.1.0", + "cli-spinners": "^2.0.0", + "log-symbols": "^2.2.0", + "strip-ansi": "^5.2.0", + "wcwidth": "^1.0.1" + }, + "dependencies": { + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmmirror.com/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmmirror.com/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + } + } + }, + "os-browserify": { + "version": "0.3.0", + "resolved": "https://registry.npmmirror.com/os-browserify/-/os-browserify-0.3.0.tgz", + "integrity": "sha512-gjcpUc3clBf9+210TRaDWbf+rZZZEshZ+DlXMRCeAjp0xhTrnQsKHypIy1J3d5hKdUzj69t708EHtU8P6bUn0A==", + "dev": true + }, + "os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmmirror.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==", + "dev": true + }, + "p-finally": { + "version": "1.0.0", + "resolved": "https://registry.npmmirror.com/p-finally/-/p-finally-1.0.0.tgz", + "integrity": "sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow==", + "dev": true + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmmirror.com/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmmirror.com/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, + "p-map": { + "version": "3.0.0", + "resolved": "https://registry.npmmirror.com/p-map/-/p-map-3.0.0.tgz", + "integrity": "sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==", + "dev": true, + "requires": { + "aggregate-error": "^3.0.0" + } + }, + "p-retry": { + "version": "3.0.1", + "resolved": "https://registry.npmmirror.com/p-retry/-/p-retry-3.0.1.tgz", + "integrity": "sha512-XE6G4+YTTkT2a0UWb2kjZe8xNwf8bIbnqpc/IS/idOBVhyves0mK5OJgeocjx7q5pvX/6m23xuzVPYT1uGM73w==", + "dev": true, + "requires": { + "retry": "^0.12.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmmirror.com/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + }, + "pako": { + "version": "1.0.11", + "resolved": "https://registry.npmmirror.com/pako/-/pako-1.0.11.tgz", + "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==", + "dev": true + }, + "parallel-transform": { + "version": "1.2.0", + "resolved": "https://registry.npmmirror.com/parallel-transform/-/parallel-transform-1.2.0.tgz", + "integrity": "sha512-P2vSmIu38uIlvdcU7fDkyrxj33gTUy/ABO5ZUbGowxNCopBq/OoD42bP4UmMrJoPyk4Uqf0mu3mtWBhHCZD8yg==", + "dev": true, + "requires": { + "cyclist": "^1.0.1", + "inherits": "^2.0.3", + "readable-stream": "^2.1.5" + } + }, + "param-case": { + "version": "2.1.1", + "resolved": "https://registry.npmmirror.com/param-case/-/param-case-2.1.1.tgz", + "integrity": "sha512-eQE845L6ot89sk2N8liD8HAuH4ca6Vvr7VWAWwt7+kvvG5aBcPmmphQ68JsEG2qa9n1TykS2DLeMt363AAH8/w==", + "dev": true, + "requires": { + "no-case": "^2.2.0" + } + }, + "parchment": { + "version": "1.1.4", + "resolved": "https://registry.npmmirror.com/parchment/-/parchment-1.1.4.tgz", + "integrity": "sha512-J5FBQt/pM2inLzg4hEWmzQx/8h8D0CiDxaG3vyp9rKrQRSDgBlhjdP5jQGgosEajXPSQouXGHOmVdgo7QmJuOg==" + }, + "parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmmirror.com/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "requires": { + "callsites": "^3.0.0" + }, + "dependencies": { + "callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmmirror.com/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true + } + } + }, + "parse-asn1": { + "version": "5.1.7", + "resolved": "https://registry.npmmirror.com/parse-asn1/-/parse-asn1-5.1.7.tgz", + "integrity": "sha512-CTM5kuWR3sx9IFamcl5ErfPl6ea/N8IYwiJ+vpeB2g+1iknv7zBl5uPwbMbRVznRVbrNY6lGuDoE5b30grmbqg==", + "dev": true, + "requires": { + "asn1.js": "^4.10.1", + "browserify-aes": "^1.2.0", + "evp_bytestokey": "^1.0.3", + "hash-base": "~3.0", + "pbkdf2": "^3.1.2", + "safe-buffer": "^5.2.1" + }, + "dependencies": { + "hash-base": { + "version": "3.0.4", + "resolved": "https://registry.npmmirror.com/hash-base/-/hash-base-3.0.4.tgz", + "integrity": "sha512-EeeoJKjTyt868liAlVmcv2ZsUfGHlE3Q+BICOXcZiwN3osr5Q/zFGYmTJpoIzuaSTAwndFy+GqhEwlU4L3j4Ow==", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + } + } + }, + "parse-json": { + "version": "5.2.0", + "resolved": "https://registry.npmmirror.com/parse-json/-/parse-json-5.2.0.tgz", + "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-even-better-errors": "^2.3.0", + "lines-and-columns": "^1.1.6" + } + }, + "parse5": { + "version": "5.1.1", + "resolved": "https://registry.npmmirror.com/parse5/-/parse5-5.1.1.tgz", + "integrity": "sha512-ugq4DFI0Ptb+WWjAdOK16+u/nHfiIrcE+sh8kZMaM0WllQKLI9rOUq6c2b7cwPkXdzfQESqvoqK6ug7U/Yyzug==", + "dev": true + }, + "parse5-htmlparser2-tree-adapter": { + "version": "6.0.1", + "resolved": "https://registry.npmmirror.com/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-6.0.1.tgz", + "integrity": "sha512-qPuWvbLgvDGilKc5BoicRovlT4MtYT6JfJyBOMDsKoiT+GiuP5qyrPCnR9HcPECIJJmZh5jRndyNThnhhb/vlA==", + "dev": true, + "requires": { + "parse5": "^6.0.1" + }, + "dependencies": { + "parse5": { + "version": "6.0.1", + "resolved": "https://registry.npmmirror.com/parse5/-/parse5-6.0.1.tgz", + "integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==", + "dev": true + } + } + }, + "parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmmirror.com/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "dev": true + }, + "pascalcase": { + "version": "0.1.1", + "resolved": "https://registry.npmmirror.com/pascalcase/-/pascalcase-0.1.1.tgz", + "integrity": "sha512-XHXfu/yOQRy9vYOtUDVMN60OEJjW013GoObG1o+xwQTpB9eYJX/BjXMsdW13ZDPruFhYYn0AG22w0xgQMwl3Nw==", + "dev": true + }, + "path-browserify": { + "version": "0.0.1", + "resolved": "https://registry.npmmirror.com/path-browserify/-/path-browserify-0.0.1.tgz", + "integrity": "sha512-BapA40NHICOS+USX9SN4tyhq+A2RrN/Ws5F0Z5aMHDp98Fl86lX8Oti8B7uN93L4Ifv4fHOEA+pQw87gmMO/lQ==", + "dev": true + }, + "path-dirname": { + "version": "1.0.2", + "resolved": "https://registry.npmmirror.com/path-dirname/-/path-dirname-1.0.2.tgz", + "integrity": "sha512-ALzNPpyNq9AqXMBjeymIjFDAkAFH06mHJH/cSBHAgU0s4vfpBn6b2nf8tiRLvagKD8RbTpq2FKTBg7cl9l3c7Q==", + "dev": true + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmmirror.com/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmmirror.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==" + }, + "path-is-inside": { + "version": "1.0.2", + "resolved": "https://registry.npmmirror.com/path-is-inside/-/path-is-inside-1.0.2.tgz", + "integrity": "sha512-DUWJr3+ULp4zXmol/SZkFf3JGsS9/SIv+Y3Rt93/UjPpDpklB5f1er4O3POIbUuUJ3FXgqte2Q7SrU6zAqwk8w==", + "dev": true + }, + "path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmmirror.com/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw==", + "dev": true + }, + "path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmmirror.com/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true + }, + "path-to-regexp": { + "version": "0.1.7", + "resolved": "https://registry.npmmirror.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz", + "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==", + "dev": true + }, + "path-type": { + "version": "3.0.0", + "resolved": "https://registry.npmmirror.com/path-type/-/path-type-3.0.0.tgz", + "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", + "dev": true, + "requires": { + "pify": "^3.0.0" + }, + "dependencies": { + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmmirror.com/pify/-/pify-3.0.0.tgz", + "integrity": "sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==", + "dev": true + } + } + }, + "pbkdf2": { + "version": "3.1.2", + "resolved": "https://registry.npmmirror.com/pbkdf2/-/pbkdf2-3.1.2.tgz", + "integrity": "sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA==", + "dev": true, + "requires": { + "create-hash": "^1.1.2", + "create-hmac": "^1.1.4", + "ripemd160": "^2.0.1", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "performance-now": { + "version": "2.1.0", + "resolved": "https://registry.npmmirror.com/performance-now/-/performance-now-2.1.0.tgz", + "integrity": "sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==", + "dev": true + }, + "picocolors": { + "version": "1.0.1", + "resolved": "https://registry.npmmirror.com/picocolors/-/picocolors-1.0.1.tgz", + "integrity": "sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==", + "dev": true + }, + "picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmmirror.com/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true + }, + "pify": { + "version": "4.0.1", + "resolved": "https://registry.npmmirror.com/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", + "dev": true + }, + "pinkie": { + "version": "2.0.4", + "resolved": "https://registry.npmmirror.com/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha512-MnUuEycAemtSaeFSjXKW/aroV7akBbY+Sv+RkyqFjgAe73F+MR0TBWKBRDkmfWq/HiFmdavfZ1G7h4SPZXaCSg==", + "dev": true + }, + "pinkie-promise": { + "version": "2.0.1", + "resolved": "https://registry.npmmirror.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha512-0Gni6D4UcLTbv9c57DfxDGdr41XfgUjqWZu492f0cIGr16zDU06BWP/RAEvOuo7CQ0CNjHaLlM59YJJFm3NWlw==", + "dev": true, + "requires": { + "pinkie": "^2.0.0" + } + }, + "pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmmirror.com/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "dev": true, + "requires": { + "find-up": "^4.0.0" + } + }, + "please-upgrade-node": { + "version": "3.2.0", + "resolved": "https://registry.npmmirror.com/please-upgrade-node/-/please-upgrade-node-3.2.0.tgz", + "integrity": "sha512-gQR3WpIgNIKwBMVLkpMUeR3e1/E1y42bqDQZfql+kDeXd8COYfM8PQA4X6y7a8u9Ua9FHmsrrmirW2vHs45hWg==", + "dev": true, + "requires": { + "semver-compare": "^1.0.0" + } + }, + "pnp-webpack-plugin": { + "version": "1.7.0", + "resolved": "https://registry.npmmirror.com/pnp-webpack-plugin/-/pnp-webpack-plugin-1.7.0.tgz", + "integrity": "sha512-2Rb3vm+EXble/sMXNSu6eoBx8e79gKqhNq9F5ZWW6ERNCTE/Q0wQNne5541tE5vKjfM8hpNCYL+LGc1YTfI0dg==", + "dev": true, + "requires": { + "ts-pnp": "^1.1.6" + } + }, + "portfinder": { + "version": "1.0.32", + "resolved": "https://registry.npmmirror.com/portfinder/-/portfinder-1.0.32.tgz", + "integrity": "sha512-on2ZJVVDXRADWE6jnQaX0ioEylzgBpQk8r55NE4wjXW1ZxO+BgDlY6DXwj20i0V8eB4SenDQ00WEaxfiIQPcxg==", + "dev": true, + "requires": { + "async": "^2.6.4", + "debug": "^3.2.7", + "mkdirp": "^0.5.6" + }, + "dependencies": { + "debug": { + "version": "3.2.7", + "resolved": "https://registry.npmmirror.com/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "mkdirp": { + "version": "0.5.6", + "resolved": "https://registry.npmmirror.com/mkdirp/-/mkdirp-0.5.6.tgz", + "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", + "dev": true, + "requires": { + "minimist": "^1.2.6" + } + } + } + }, + "posix-character-classes": { + "version": "0.1.1", + "resolved": "https://registry.npmmirror.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz", + "integrity": "sha512-xTgYBc3fuo7Yt7JbiuFxSYGToMoz8fLoE6TC9Wx1P/u+LfeThMOAqmuyECnlBaaJb+u1m9hHiXUEtwW4OzfUJg==", + "dev": true + }, + "possible-typed-array-names": { + "version": "1.0.0", + "resolved": "https://registry.npmmirror.com/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz", + "integrity": "sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==", + "dev": true + }, + "postcss": { + "version": "8.4.38", + "resolved": "https://registry.npmmirror.com/postcss/-/postcss-8.4.38.tgz", + "integrity": "sha512-Wglpdk03BSfXkHoQa3b/oulrotAkwrlLDRSOb9D0bN86FdRyE9lppSp33aHNPgBa0JKCoB+drFLZkQoRRYae5A==", + "dev": true, + "requires": { + "nanoid": "^3.3.7", + "picocolors": "^1.0.0", + "source-map-js": "^1.2.0" + } + }, + "postcss-calc": { + "version": "7.0.5", + "resolved": "https://registry.npmmirror.com/postcss-calc/-/postcss-calc-7.0.5.tgz", + "integrity": "sha512-1tKHutbGtLtEZF6PT4JSihCHfIVldU72mZ8SdZHIYriIZ9fh9k9aWSppaT8rHsyI3dX+KSR+W+Ix9BMY3AODrg==", + "dev": true, + "requires": { + "postcss": "^7.0.27", + "postcss-selector-parser": "^6.0.2", + "postcss-value-parser": "^4.0.2" + }, + "dependencies": { + "picocolors": { + "version": "0.2.1", + "resolved": "https://registry.npmmirror.com/picocolors/-/picocolors-0.2.1.tgz", + "integrity": "sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA==", + "dev": true + }, + "postcss": { + "version": "7.0.39", + "resolved": "https://registry.npmmirror.com/postcss/-/postcss-7.0.39.tgz", + "integrity": "sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA==", + "dev": true, + "requires": { + "picocolors": "^0.2.1", + "source-map": "^0.6.1" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmmirror.com/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "postcss-colormin": { + "version": "4.0.3", + "resolved": "https://registry.npmmirror.com/postcss-colormin/-/postcss-colormin-4.0.3.tgz", + "integrity": "sha512-WyQFAdDZpExQh32j0U0feWisZ0dmOtPl44qYmJKkq9xFWY3p+4qnRzCHeNrkeRhwPHz9bQ3mo0/yVkaply0MNw==", + "dev": true, + "requires": { + "browserslist": "^4.0.0", + "color": "^3.0.0", + "has": "^1.0.0", + "postcss": "^7.0.0", + "postcss-value-parser": "^3.0.0" + }, + "dependencies": { + "picocolors": { + "version": "0.2.1", + "resolved": "https://registry.npmmirror.com/picocolors/-/picocolors-0.2.1.tgz", + "integrity": "sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA==", + "dev": true + }, + "postcss": { + "version": "7.0.39", + "resolved": "https://registry.npmmirror.com/postcss/-/postcss-7.0.39.tgz", + "integrity": "sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA==", + "dev": true, + "requires": { + "picocolors": "^0.2.1", + "source-map": "^0.6.1" + } + }, + "postcss-value-parser": { + "version": "3.3.1", + "resolved": "https://registry.npmmirror.com/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", + "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==", + "dev": true + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmmirror.com/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "postcss-convert-values": { + "version": "4.0.1", + "resolved": "https://registry.npmmirror.com/postcss-convert-values/-/postcss-convert-values-4.0.1.tgz", + "integrity": "sha512-Kisdo1y77KUC0Jmn0OXU/COOJbzM8cImvw1ZFsBgBgMgb1iL23Zs/LXRe3r+EZqM3vGYKdQ2YJVQ5VkJI+zEJQ==", + "dev": true, + "requires": { + "postcss": "^7.0.0", + "postcss-value-parser": "^3.0.0" + }, + "dependencies": { + "picocolors": { + "version": "0.2.1", + "resolved": "https://registry.npmmirror.com/picocolors/-/picocolors-0.2.1.tgz", + "integrity": "sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA==", + "dev": true + }, + "postcss": { + "version": "7.0.39", + "resolved": "https://registry.npmmirror.com/postcss/-/postcss-7.0.39.tgz", + "integrity": "sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA==", + "dev": true, + "requires": { + "picocolors": "^0.2.1", + "source-map": "^0.6.1" + } + }, + "postcss-value-parser": { + "version": "3.3.1", + "resolved": "https://registry.npmmirror.com/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", + "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==", + "dev": true + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmmirror.com/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "postcss-discard-comments": { + "version": "4.0.2", + "resolved": "https://registry.npmmirror.com/postcss-discard-comments/-/postcss-discard-comments-4.0.2.tgz", + "integrity": "sha512-RJutN259iuRf3IW7GZyLM5Sw4GLTOH8FmsXBnv8Ab/Tc2k4SR4qbV4DNbyyY4+Sjo362SyDmW2DQ7lBSChrpkg==", + "dev": true, + "requires": { + "postcss": "^7.0.0" + }, + "dependencies": { + "picocolors": { + "version": "0.2.1", + "resolved": "https://registry.npmmirror.com/picocolors/-/picocolors-0.2.1.tgz", + "integrity": "sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA==", + "dev": true + }, + "postcss": { + "version": "7.0.39", + "resolved": "https://registry.npmmirror.com/postcss/-/postcss-7.0.39.tgz", + "integrity": "sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA==", + "dev": true, + "requires": { + "picocolors": "^0.2.1", + "source-map": "^0.6.1" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmmirror.com/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "postcss-discard-duplicates": { + "version": "4.0.2", + "resolved": "https://registry.npmmirror.com/postcss-discard-duplicates/-/postcss-discard-duplicates-4.0.2.tgz", + "integrity": "sha512-ZNQfR1gPNAiXZhgENFfEglF93pciw0WxMkJeVmw8eF+JZBbMD7jp6C67GqJAXVZP2BWbOztKfbsdmMp/k8c6oQ==", + "dev": true, + "requires": { + "postcss": "^7.0.0" + }, + "dependencies": { + "picocolors": { + "version": "0.2.1", + "resolved": "https://registry.npmmirror.com/picocolors/-/picocolors-0.2.1.tgz", + "integrity": "sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA==", + "dev": true + }, + "postcss": { + "version": "7.0.39", + "resolved": "https://registry.npmmirror.com/postcss/-/postcss-7.0.39.tgz", + "integrity": "sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA==", + "dev": true, + "requires": { + "picocolors": "^0.2.1", + "source-map": "^0.6.1" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmmirror.com/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "postcss-discard-empty": { + "version": "4.0.1", + "resolved": "https://registry.npmmirror.com/postcss-discard-empty/-/postcss-discard-empty-4.0.1.tgz", + "integrity": "sha512-B9miTzbznhDjTfjvipfHoqbWKwd0Mj+/fL5s1QOz06wufguil+Xheo4XpOnc4NqKYBCNqqEzgPv2aPBIJLox0w==", + "dev": true, + "requires": { + "postcss": "^7.0.0" + }, + "dependencies": { + "picocolors": { + "version": "0.2.1", + "resolved": "https://registry.npmmirror.com/picocolors/-/picocolors-0.2.1.tgz", + "integrity": "sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA==", + "dev": true + }, + "postcss": { + "version": "7.0.39", + "resolved": "https://registry.npmmirror.com/postcss/-/postcss-7.0.39.tgz", + "integrity": "sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA==", + "dev": true, + "requires": { + "picocolors": "^0.2.1", + "source-map": "^0.6.1" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmmirror.com/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "postcss-discard-overridden": { + "version": "4.0.1", + "resolved": "https://registry.npmmirror.com/postcss-discard-overridden/-/postcss-discard-overridden-4.0.1.tgz", + "integrity": "sha512-IYY2bEDD7g1XM1IDEsUT4//iEYCxAmP5oDSFMVU/JVvT7gh+l4fmjciLqGgwjdWpQIdb0Che2VX00QObS5+cTg==", + "dev": true, + "requires": { + "postcss": "^7.0.0" + }, + "dependencies": { + "picocolors": { + "version": "0.2.1", + "resolved": "https://registry.npmmirror.com/picocolors/-/picocolors-0.2.1.tgz", + "integrity": "sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA==", + "dev": true + }, + "postcss": { + "version": "7.0.39", + "resolved": "https://registry.npmmirror.com/postcss/-/postcss-7.0.39.tgz", + "integrity": "sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA==", + "dev": true, + "requires": { + "picocolors": "^0.2.1", + "source-map": "^0.6.1" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmmirror.com/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "postcss-load-config": { + "version": "2.1.2", + "resolved": "https://registry.npmmirror.com/postcss-load-config/-/postcss-load-config-2.1.2.tgz", + "integrity": "sha512-/rDeGV6vMUo3mwJZmeHfEDvwnTKKqQ0S7OHUi/kJvvtx3aWtyWG2/0ZWnzCt2keEclwN6Tf0DST2v9kITdOKYw==", + "dev": true, + "requires": { + "cosmiconfig": "^5.0.0", + "import-cwd": "^2.0.0" + } + }, + "postcss-loader": { + "version": "3.0.0", + "resolved": "https://registry.npmmirror.com/postcss-loader/-/postcss-loader-3.0.0.tgz", + "integrity": "sha512-cLWoDEY5OwHcAjDnkyRQzAXfs2jrKjXpO/HQFcc5b5u/r7aa471wdmChmwfnv7x2u840iat/wi0lQ5nbRgSkUA==", + "dev": true, + "requires": { + "loader-utils": "^1.1.0", + "postcss": "^7.0.0", + "postcss-load-config": "^2.0.0", + "schema-utils": "^1.0.0" + }, + "dependencies": { + "json5": { + "version": "1.0.2", + "resolved": "https://registry.npmmirror.com/json5/-/json5-1.0.2.tgz", + "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", + "dev": true, + "requires": { + "minimist": "^1.2.0" + } + }, + "loader-utils": { + "version": "1.4.2", + "resolved": "https://registry.npmmirror.com/loader-utils/-/loader-utils-1.4.2.tgz", + "integrity": "sha512-I5d00Pd/jwMD2QCduo657+YM/6L3KZu++pmX9VFncxaxvHcru9jx1lBaFft+r4Mt2jK0Yhp41XlRAihzPxHNCg==", + "dev": true, + "requires": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^1.0.1" + } + }, + "picocolors": { + "version": "0.2.1", + "resolved": "https://registry.npmmirror.com/picocolors/-/picocolors-0.2.1.tgz", + "integrity": "sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA==", + "dev": true + }, + "postcss": { + "version": "7.0.39", + "resolved": "https://registry.npmmirror.com/postcss/-/postcss-7.0.39.tgz", + "integrity": "sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA==", + "dev": true, + "requires": { + "picocolors": "^0.2.1", + "source-map": "^0.6.1" + } + }, + "schema-utils": { + "version": "1.0.0", + "resolved": "https://registry.npmmirror.com/schema-utils/-/schema-utils-1.0.0.tgz", + "integrity": "sha512-i27Mic4KovM/lnGsy8whRCHhc7VicJajAjTrYg11K9zfZXnYIt4k5F+kZkwjnrhKzLic/HLU4j11mjsz2G/75g==", + "dev": true, + "requires": { + "ajv": "^6.1.0", + "ajv-errors": "^1.0.0", + "ajv-keywords": "^3.1.0" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmmirror.com/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "postcss-merge-longhand": { + "version": "4.0.11", + "resolved": "https://registry.npmmirror.com/postcss-merge-longhand/-/postcss-merge-longhand-4.0.11.tgz", + "integrity": "sha512-alx/zmoeXvJjp7L4mxEMjh8lxVlDFX1gqWHzaaQewwMZiVhLo42TEClKaeHbRf6J7j82ZOdTJ808RtN0ZOZwvw==", + "dev": true, + "requires": { + "css-color-names": "0.0.4", + "postcss": "^7.0.0", + "postcss-value-parser": "^3.0.0", + "stylehacks": "^4.0.0" + }, + "dependencies": { + "picocolors": { + "version": "0.2.1", + "resolved": "https://registry.npmmirror.com/picocolors/-/picocolors-0.2.1.tgz", + "integrity": "sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA==", + "dev": true + }, + "postcss": { + "version": "7.0.39", + "resolved": "https://registry.npmmirror.com/postcss/-/postcss-7.0.39.tgz", + "integrity": "sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA==", + "dev": true, + "requires": { + "picocolors": "^0.2.1", + "source-map": "^0.6.1" + } + }, + "postcss-value-parser": { + "version": "3.3.1", + "resolved": "https://registry.npmmirror.com/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", + "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==", + "dev": true + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmmirror.com/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "postcss-merge-rules": { + "version": "4.0.3", + "resolved": "https://registry.npmmirror.com/postcss-merge-rules/-/postcss-merge-rules-4.0.3.tgz", + "integrity": "sha512-U7e3r1SbvYzO0Jr3UT/zKBVgYYyhAz0aitvGIYOYK5CPmkNih+WDSsS5tvPrJ8YMQYlEMvsZIiqmn7HdFUaeEQ==", + "dev": true, + "requires": { + "browserslist": "^4.0.0", + "caniuse-api": "^3.0.0", + "cssnano-util-same-parent": "^4.0.0", + "postcss": "^7.0.0", + "postcss-selector-parser": "^3.0.0", + "vendors": "^1.0.0" + }, + "dependencies": { + "picocolors": { + "version": "0.2.1", + "resolved": "https://registry.npmmirror.com/picocolors/-/picocolors-0.2.1.tgz", + "integrity": "sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA==", + "dev": true + }, + "postcss": { + "version": "7.0.39", + "resolved": "https://registry.npmmirror.com/postcss/-/postcss-7.0.39.tgz", + "integrity": "sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA==", + "dev": true, + "requires": { + "picocolors": "^0.2.1", + "source-map": "^0.6.1" + } + }, + "postcss-selector-parser": { + "version": "3.1.2", + "resolved": "https://registry.npmmirror.com/postcss-selector-parser/-/postcss-selector-parser-3.1.2.tgz", + "integrity": "sha512-h7fJ/5uWuRVyOtkO45pnt1Ih40CEleeyCHzipqAZO2e5H20g25Y48uYnFUiShvY4rZWNJ/Bib/KVPmanaCtOhA==", + "dev": true, + "requires": { + "dot-prop": "^5.2.0", + "indexes-of": "^1.0.1", + "uniq": "^1.0.1" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmmirror.com/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "postcss-minify-font-values": { + "version": "4.0.2", + "resolved": "https://registry.npmmirror.com/postcss-minify-font-values/-/postcss-minify-font-values-4.0.2.tgz", + "integrity": "sha512-j85oO6OnRU9zPf04+PZv1LYIYOprWm6IA6zkXkrJXyRveDEuQggG6tvoy8ir8ZwjLxLuGfNkCZEQG7zan+Hbtg==", + "dev": true, + "requires": { + "postcss": "^7.0.0", + "postcss-value-parser": "^3.0.0" + }, + "dependencies": { + "picocolors": { + "version": "0.2.1", + "resolved": "https://registry.npmmirror.com/picocolors/-/picocolors-0.2.1.tgz", + "integrity": "sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA==", + "dev": true + }, + "postcss": { + "version": "7.0.39", + "resolved": "https://registry.npmmirror.com/postcss/-/postcss-7.0.39.tgz", + "integrity": "sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA==", + "dev": true, + "requires": { + "picocolors": "^0.2.1", + "source-map": "^0.6.1" + } + }, + "postcss-value-parser": { + "version": "3.3.1", + "resolved": "https://registry.npmmirror.com/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", + "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==", + "dev": true + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmmirror.com/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "postcss-minify-gradients": { + "version": "4.0.2", + "resolved": "https://registry.npmmirror.com/postcss-minify-gradients/-/postcss-minify-gradients-4.0.2.tgz", + "integrity": "sha512-qKPfwlONdcf/AndP1U8SJ/uzIJtowHlMaSioKzebAXSG4iJthlWC9iSWznQcX4f66gIWX44RSA841HTHj3wK+Q==", + "dev": true, + "requires": { + "cssnano-util-get-arguments": "^4.0.0", + "is-color-stop": "^1.0.0", + "postcss": "^7.0.0", + "postcss-value-parser": "^3.0.0" + }, + "dependencies": { + "picocolors": { + "version": "0.2.1", + "resolved": "https://registry.npmmirror.com/picocolors/-/picocolors-0.2.1.tgz", + "integrity": "sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA==", + "dev": true + }, + "postcss": { + "version": "7.0.39", + "resolved": "https://registry.npmmirror.com/postcss/-/postcss-7.0.39.tgz", + "integrity": "sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA==", + "dev": true, + "requires": { + "picocolors": "^0.2.1", + "source-map": "^0.6.1" + } + }, + "postcss-value-parser": { + "version": "3.3.1", + "resolved": "https://registry.npmmirror.com/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", + "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==", + "dev": true + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmmirror.com/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "postcss-minify-params": { + "version": "4.0.2", + "resolved": "https://registry.npmmirror.com/postcss-minify-params/-/postcss-minify-params-4.0.2.tgz", + "integrity": "sha512-G7eWyzEx0xL4/wiBBJxJOz48zAKV2WG3iZOqVhPet/9geefm/Px5uo1fzlHu+DOjT+m0Mmiz3jkQzVHe6wxAWg==", + "dev": true, + "requires": { + "alphanum-sort": "^1.0.0", + "browserslist": "^4.0.0", + "cssnano-util-get-arguments": "^4.0.0", + "postcss": "^7.0.0", + "postcss-value-parser": "^3.0.0", + "uniqs": "^2.0.0" + }, + "dependencies": { + "picocolors": { + "version": "0.2.1", + "resolved": "https://registry.npmmirror.com/picocolors/-/picocolors-0.2.1.tgz", + "integrity": "sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA==", + "dev": true + }, + "postcss": { + "version": "7.0.39", + "resolved": "https://registry.npmmirror.com/postcss/-/postcss-7.0.39.tgz", + "integrity": "sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA==", + "dev": true, + "requires": { + "picocolors": "^0.2.1", + "source-map": "^0.6.1" + } + }, + "postcss-value-parser": { + "version": "3.3.1", + "resolved": "https://registry.npmmirror.com/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", + "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==", + "dev": true + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmmirror.com/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "postcss-minify-selectors": { + "version": "4.0.2", + "resolved": "https://registry.npmmirror.com/postcss-minify-selectors/-/postcss-minify-selectors-4.0.2.tgz", + "integrity": "sha512-D5S1iViljXBj9kflQo4YutWnJmwm8VvIsU1GeXJGiG9j8CIg9zs4voPMdQDUmIxetUOh60VilsNzCiAFTOqu3g==", + "dev": true, + "requires": { + "alphanum-sort": "^1.0.0", + "has": "^1.0.0", + "postcss": "^7.0.0", + "postcss-selector-parser": "^3.0.0" + }, + "dependencies": { + "picocolors": { + "version": "0.2.1", + "resolved": "https://registry.npmmirror.com/picocolors/-/picocolors-0.2.1.tgz", + "integrity": "sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA==", + "dev": true + }, + "postcss": { + "version": "7.0.39", + "resolved": "https://registry.npmmirror.com/postcss/-/postcss-7.0.39.tgz", + "integrity": "sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA==", + "dev": true, + "requires": { + "picocolors": "^0.2.1", + "source-map": "^0.6.1" + } + }, + "postcss-selector-parser": { + "version": "3.1.2", + "resolved": "https://registry.npmmirror.com/postcss-selector-parser/-/postcss-selector-parser-3.1.2.tgz", + "integrity": "sha512-h7fJ/5uWuRVyOtkO45pnt1Ih40CEleeyCHzipqAZO2e5H20g25Y48uYnFUiShvY4rZWNJ/Bib/KVPmanaCtOhA==", + "dev": true, + "requires": { + "dot-prop": "^5.2.0", + "indexes-of": "^1.0.1", + "uniq": "^1.0.1" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmmirror.com/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "postcss-modules-extract-imports": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/postcss-modules-extract-imports/-/postcss-modules-extract-imports-2.0.0.tgz", + "integrity": "sha512-LaYLDNS4SG8Q5WAWqIJgdHPJrDDr/Lv775rMBFUbgjTz6j34lUznACHcdRWroPvXANP2Vj7yNK57vp9eFqzLWQ==", + "dev": true, + "requires": { + "postcss": "^7.0.5" + }, + "dependencies": { + "picocolors": { + "version": "0.2.1", + "resolved": "https://registry.npmmirror.com/picocolors/-/picocolors-0.2.1.tgz", + "integrity": "sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA==", + "dev": true + }, + "postcss": { + "version": "7.0.39", + "resolved": "https://registry.npmmirror.com/postcss/-/postcss-7.0.39.tgz", + "integrity": "sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA==", + "dev": true, + "requires": { + "picocolors": "^0.2.1", + "source-map": "^0.6.1" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmmirror.com/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "postcss-modules-local-by-default": { + "version": "3.0.3", + "resolved": "https://registry.npmmirror.com/postcss-modules-local-by-default/-/postcss-modules-local-by-default-3.0.3.tgz", + "integrity": "sha512-e3xDq+LotiGesympRlKNgaJ0PCzoUIdpH0dj47iWAui/kyTgh3CiAr1qP54uodmJhl6p9rN6BoNcdEDVJx9RDw==", + "dev": true, + "requires": { + "icss-utils": "^4.1.1", + "postcss": "^7.0.32", + "postcss-selector-parser": "^6.0.2", + "postcss-value-parser": "^4.1.0" + }, + "dependencies": { + "picocolors": { + "version": "0.2.1", + "resolved": "https://registry.npmmirror.com/picocolors/-/picocolors-0.2.1.tgz", + "integrity": "sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA==", + "dev": true + }, + "postcss": { + "version": "7.0.39", + "resolved": "https://registry.npmmirror.com/postcss/-/postcss-7.0.39.tgz", + "integrity": "sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA==", + "dev": true, + "requires": { + "picocolors": "^0.2.1", + "source-map": "^0.6.1" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmmirror.com/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "postcss-modules-scope": { + "version": "2.2.0", + "resolved": "https://registry.npmmirror.com/postcss-modules-scope/-/postcss-modules-scope-2.2.0.tgz", + "integrity": "sha512-YyEgsTMRpNd+HmyC7H/mh3y+MeFWevy7V1evVhJWewmMbjDHIbZbOXICC2y+m1xI1UVfIT1HMW/O04Hxyu9oXQ==", + "dev": true, + "requires": { + "postcss": "^7.0.6", + "postcss-selector-parser": "^6.0.0" + }, + "dependencies": { + "picocolors": { + "version": "0.2.1", + "resolved": "https://registry.npmmirror.com/picocolors/-/picocolors-0.2.1.tgz", + "integrity": "sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA==", + "dev": true + }, + "postcss": { + "version": "7.0.39", + "resolved": "https://registry.npmmirror.com/postcss/-/postcss-7.0.39.tgz", + "integrity": "sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA==", + "dev": true, + "requires": { + "picocolors": "^0.2.1", + "source-map": "^0.6.1" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmmirror.com/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "postcss-modules-values": { + "version": "3.0.0", + "resolved": "https://registry.npmmirror.com/postcss-modules-values/-/postcss-modules-values-3.0.0.tgz", + "integrity": "sha512-1//E5jCBrZ9DmRX+zCtmQtRSV6PV42Ix7Bzj9GbwJceduuf7IqP8MgeTXuRDHOWj2m0VzZD5+roFWDuU8RQjcg==", + "dev": true, + "requires": { + "icss-utils": "^4.0.0", + "postcss": "^7.0.6" + }, + "dependencies": { + "picocolors": { + "version": "0.2.1", + "resolved": "https://registry.npmmirror.com/picocolors/-/picocolors-0.2.1.tgz", + "integrity": "sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA==", + "dev": true + }, + "postcss": { + "version": "7.0.39", + "resolved": "https://registry.npmmirror.com/postcss/-/postcss-7.0.39.tgz", + "integrity": "sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA==", + "dev": true, + "requires": { + "picocolors": "^0.2.1", + "source-map": "^0.6.1" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmmirror.com/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "postcss-normalize-charset": { + "version": "4.0.1", + "resolved": "https://registry.npmmirror.com/postcss-normalize-charset/-/postcss-normalize-charset-4.0.1.tgz", + "integrity": "sha512-gMXCrrlWh6G27U0hF3vNvR3w8I1s2wOBILvA87iNXaPvSNo5uZAMYsZG7XjCUf1eVxuPfyL4TJ7++SGZLc9A3g==", + "dev": true, + "requires": { + "postcss": "^7.0.0" + }, + "dependencies": { + "picocolors": { + "version": "0.2.1", + "resolved": "https://registry.npmmirror.com/picocolors/-/picocolors-0.2.1.tgz", + "integrity": "sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA==", + "dev": true + }, + "postcss": { + "version": "7.0.39", + "resolved": "https://registry.npmmirror.com/postcss/-/postcss-7.0.39.tgz", + "integrity": "sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA==", + "dev": true, + "requires": { + "picocolors": "^0.2.1", + "source-map": "^0.6.1" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmmirror.com/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "postcss-normalize-display-values": { + "version": "4.0.2", + "resolved": "https://registry.npmmirror.com/postcss-normalize-display-values/-/postcss-normalize-display-values-4.0.2.tgz", + "integrity": "sha512-3F2jcsaMW7+VtRMAqf/3m4cPFhPD3EFRgNs18u+k3lTJJlVe7d0YPO+bnwqo2xg8YiRpDXJI2u8A0wqJxMsQuQ==", + "dev": true, + "requires": { + "cssnano-util-get-match": "^4.0.0", + "postcss": "^7.0.0", + "postcss-value-parser": "^3.0.0" + }, + "dependencies": { + "picocolors": { + "version": "0.2.1", + "resolved": "https://registry.npmmirror.com/picocolors/-/picocolors-0.2.1.tgz", + "integrity": "sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA==", + "dev": true + }, + "postcss": { + "version": "7.0.39", + "resolved": "https://registry.npmmirror.com/postcss/-/postcss-7.0.39.tgz", + "integrity": "sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA==", + "dev": true, + "requires": { + "picocolors": "^0.2.1", + "source-map": "^0.6.1" + } + }, + "postcss-value-parser": { + "version": "3.3.1", + "resolved": "https://registry.npmmirror.com/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", + "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==", + "dev": true + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmmirror.com/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "postcss-normalize-positions": { + "version": "4.0.2", + "resolved": "https://registry.npmmirror.com/postcss-normalize-positions/-/postcss-normalize-positions-4.0.2.tgz", + "integrity": "sha512-Dlf3/9AxpxE+NF1fJxYDeggi5WwV35MXGFnnoccP/9qDtFrTArZ0D0R+iKcg5WsUd8nUYMIl8yXDCtcrT8JrdA==", + "dev": true, + "requires": { + "cssnano-util-get-arguments": "^4.0.0", + "has": "^1.0.0", + "postcss": "^7.0.0", + "postcss-value-parser": "^3.0.0" + }, + "dependencies": { + "picocolors": { + "version": "0.2.1", + "resolved": "https://registry.npmmirror.com/picocolors/-/picocolors-0.2.1.tgz", + "integrity": "sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA==", + "dev": true + }, + "postcss": { + "version": "7.0.39", + "resolved": "https://registry.npmmirror.com/postcss/-/postcss-7.0.39.tgz", + "integrity": "sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA==", + "dev": true, + "requires": { + "picocolors": "^0.2.1", + "source-map": "^0.6.1" + } + }, + "postcss-value-parser": { + "version": "3.3.1", + "resolved": "https://registry.npmmirror.com/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", + "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==", + "dev": true + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmmirror.com/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "postcss-normalize-repeat-style": { + "version": "4.0.2", + "resolved": "https://registry.npmmirror.com/postcss-normalize-repeat-style/-/postcss-normalize-repeat-style-4.0.2.tgz", + "integrity": "sha512-qvigdYYMpSuoFs3Is/f5nHdRLJN/ITA7huIoCyqqENJe9PvPmLhNLMu7QTjPdtnVf6OcYYO5SHonx4+fbJE1+Q==", + "dev": true, + "requires": { + "cssnano-util-get-arguments": "^4.0.0", + "cssnano-util-get-match": "^4.0.0", + "postcss": "^7.0.0", + "postcss-value-parser": "^3.0.0" + }, + "dependencies": { + "picocolors": { + "version": "0.2.1", + "resolved": "https://registry.npmmirror.com/picocolors/-/picocolors-0.2.1.tgz", + "integrity": "sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA==", + "dev": true + }, + "postcss": { + "version": "7.0.39", + "resolved": "https://registry.npmmirror.com/postcss/-/postcss-7.0.39.tgz", + "integrity": "sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA==", + "dev": true, + "requires": { + "picocolors": "^0.2.1", + "source-map": "^0.6.1" + } + }, + "postcss-value-parser": { + "version": "3.3.1", + "resolved": "https://registry.npmmirror.com/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", + "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==", + "dev": true + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmmirror.com/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "postcss-normalize-string": { + "version": "4.0.2", + "resolved": "https://registry.npmmirror.com/postcss-normalize-string/-/postcss-normalize-string-4.0.2.tgz", + "integrity": "sha512-RrERod97Dnwqq49WNz8qo66ps0swYZDSb6rM57kN2J+aoyEAJfZ6bMx0sx/F9TIEX0xthPGCmeyiam/jXif0eA==", + "dev": true, + "requires": { + "has": "^1.0.0", + "postcss": "^7.0.0", + "postcss-value-parser": "^3.0.0" + }, + "dependencies": { + "picocolors": { + "version": "0.2.1", + "resolved": "https://registry.npmmirror.com/picocolors/-/picocolors-0.2.1.tgz", + "integrity": "sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA==", + "dev": true + }, + "postcss": { + "version": "7.0.39", + "resolved": "https://registry.npmmirror.com/postcss/-/postcss-7.0.39.tgz", + "integrity": "sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA==", + "dev": true, + "requires": { + "picocolors": "^0.2.1", + "source-map": "^0.6.1" + } + }, + "postcss-value-parser": { + "version": "3.3.1", + "resolved": "https://registry.npmmirror.com/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", + "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==", + "dev": true + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmmirror.com/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "postcss-normalize-timing-functions": { + "version": "4.0.2", + "resolved": "https://registry.npmmirror.com/postcss-normalize-timing-functions/-/postcss-normalize-timing-functions-4.0.2.tgz", + "integrity": "sha512-acwJY95edP762e++00Ehq9L4sZCEcOPyaHwoaFOhIwWCDfik6YvqsYNxckee65JHLKzuNSSmAdxwD2Cud1Z54A==", + "dev": true, + "requires": { + "cssnano-util-get-match": "^4.0.0", + "postcss": "^7.0.0", + "postcss-value-parser": "^3.0.0" + }, + "dependencies": { + "picocolors": { + "version": "0.2.1", + "resolved": "https://registry.npmmirror.com/picocolors/-/picocolors-0.2.1.tgz", + "integrity": "sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA==", + "dev": true + }, + "postcss": { + "version": "7.0.39", + "resolved": "https://registry.npmmirror.com/postcss/-/postcss-7.0.39.tgz", + "integrity": "sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA==", + "dev": true, + "requires": { + "picocolors": "^0.2.1", + "source-map": "^0.6.1" + } + }, + "postcss-value-parser": { + "version": "3.3.1", + "resolved": "https://registry.npmmirror.com/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", + "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==", + "dev": true + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmmirror.com/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "postcss-normalize-unicode": { + "version": "4.0.1", + "resolved": "https://registry.npmmirror.com/postcss-normalize-unicode/-/postcss-normalize-unicode-4.0.1.tgz", + "integrity": "sha512-od18Uq2wCYn+vZ/qCOeutvHjB5jm57ToxRaMeNuf0nWVHaP9Hua56QyMF6fs/4FSUnVIw0CBPsU0K4LnBPwYwg==", + "dev": true, + "requires": { + "browserslist": "^4.0.0", + "postcss": "^7.0.0", + "postcss-value-parser": "^3.0.0" + }, + "dependencies": { + "picocolors": { + "version": "0.2.1", + "resolved": "https://registry.npmmirror.com/picocolors/-/picocolors-0.2.1.tgz", + "integrity": "sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA==", + "dev": true + }, + "postcss": { + "version": "7.0.39", + "resolved": "https://registry.npmmirror.com/postcss/-/postcss-7.0.39.tgz", + "integrity": "sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA==", + "dev": true, + "requires": { + "picocolors": "^0.2.1", + "source-map": "^0.6.1" + } + }, + "postcss-value-parser": { + "version": "3.3.1", + "resolved": "https://registry.npmmirror.com/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", + "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==", + "dev": true + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmmirror.com/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "postcss-normalize-url": { + "version": "4.0.1", + "resolved": "https://registry.npmmirror.com/postcss-normalize-url/-/postcss-normalize-url-4.0.1.tgz", + "integrity": "sha512-p5oVaF4+IHwu7VpMan/SSpmpYxcJMtkGppYf0VbdH5B6hN8YNmVyJLuY9FmLQTzY3fag5ESUUHDqM+heid0UVA==", + "dev": true, + "requires": { + "is-absolute-url": "^2.0.0", + "normalize-url": "^3.0.0", + "postcss": "^7.0.0", + "postcss-value-parser": "^3.0.0" + }, + "dependencies": { + "picocolors": { + "version": "0.2.1", + "resolved": "https://registry.npmmirror.com/picocolors/-/picocolors-0.2.1.tgz", + "integrity": "sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA==", + "dev": true + }, + "postcss": { + "version": "7.0.39", + "resolved": "https://registry.npmmirror.com/postcss/-/postcss-7.0.39.tgz", + "integrity": "sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA==", + "dev": true, + "requires": { + "picocolors": "^0.2.1", + "source-map": "^0.6.1" + } + }, + "postcss-value-parser": { + "version": "3.3.1", + "resolved": "https://registry.npmmirror.com/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", + "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==", + "dev": true + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmmirror.com/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "postcss-normalize-whitespace": { + "version": "4.0.2", + "resolved": "https://registry.npmmirror.com/postcss-normalize-whitespace/-/postcss-normalize-whitespace-4.0.2.tgz", + "integrity": "sha512-tO8QIgrsI3p95r8fyqKV+ufKlSHh9hMJqACqbv2XknufqEDhDvbguXGBBqxw9nsQoXWf0qOqppziKJKHMD4GtA==", + "dev": true, + "requires": { + "postcss": "^7.0.0", + "postcss-value-parser": "^3.0.0" + }, + "dependencies": { + "picocolors": { + "version": "0.2.1", + "resolved": "https://registry.npmmirror.com/picocolors/-/picocolors-0.2.1.tgz", + "integrity": "sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA==", + "dev": true + }, + "postcss": { + "version": "7.0.39", + "resolved": "https://registry.npmmirror.com/postcss/-/postcss-7.0.39.tgz", + "integrity": "sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA==", + "dev": true, + "requires": { + "picocolors": "^0.2.1", + "source-map": "^0.6.1" + } + }, + "postcss-value-parser": { + "version": "3.3.1", + "resolved": "https://registry.npmmirror.com/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", + "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==", + "dev": true + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmmirror.com/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "postcss-ordered-values": { + "version": "4.1.2", + "resolved": "https://registry.npmmirror.com/postcss-ordered-values/-/postcss-ordered-values-4.1.2.tgz", + "integrity": "sha512-2fCObh5UanxvSxeXrtLtlwVThBvHn6MQcu4ksNT2tsaV2Fg76R2CV98W7wNSlX+5/pFwEyaDwKLLoEV7uRybAw==", + "dev": true, + "requires": { + "cssnano-util-get-arguments": "^4.0.0", + "postcss": "^7.0.0", + "postcss-value-parser": "^3.0.0" + }, + "dependencies": { + "picocolors": { + "version": "0.2.1", + "resolved": "https://registry.npmmirror.com/picocolors/-/picocolors-0.2.1.tgz", + "integrity": "sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA==", + "dev": true + }, + "postcss": { + "version": "7.0.39", + "resolved": "https://registry.npmmirror.com/postcss/-/postcss-7.0.39.tgz", + "integrity": "sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA==", + "dev": true, + "requires": { + "picocolors": "^0.2.1", + "source-map": "^0.6.1" + } + }, + "postcss-value-parser": { + "version": "3.3.1", + "resolved": "https://registry.npmmirror.com/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", + "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==", + "dev": true + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmmirror.com/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "postcss-prefix-selector": { + "version": "1.16.1", + "resolved": "https://registry.npmmirror.com/postcss-prefix-selector/-/postcss-prefix-selector-1.16.1.tgz", + "integrity": "sha512-Umxu+FvKMwlY6TyDzGFoSUnzW+NOfMBLyC1tAkIjgX+Z/qGspJeRjVC903D7mx7TuBpJlwti2ibXtWuA7fKMeQ==", + "dev": true + }, + "postcss-reduce-initial": { + "version": "4.0.3", + "resolved": "https://registry.npmmirror.com/postcss-reduce-initial/-/postcss-reduce-initial-4.0.3.tgz", + "integrity": "sha512-gKWmR5aUulSjbzOfD9AlJiHCGH6AEVLaM0AV+aSioxUDd16qXP1PCh8d1/BGVvpdWn8k/HiK7n6TjeoXN1F7DA==", + "dev": true, + "requires": { + "browserslist": "^4.0.0", + "caniuse-api": "^3.0.0", + "has": "^1.0.0", + "postcss": "^7.0.0" + }, + "dependencies": { + "picocolors": { + "version": "0.2.1", + "resolved": "https://registry.npmmirror.com/picocolors/-/picocolors-0.2.1.tgz", + "integrity": "sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA==", + "dev": true + }, + "postcss": { + "version": "7.0.39", + "resolved": "https://registry.npmmirror.com/postcss/-/postcss-7.0.39.tgz", + "integrity": "sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA==", + "dev": true, + "requires": { + "picocolors": "^0.2.1", + "source-map": "^0.6.1" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmmirror.com/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "postcss-reduce-transforms": { + "version": "4.0.2", + "resolved": "https://registry.npmmirror.com/postcss-reduce-transforms/-/postcss-reduce-transforms-4.0.2.tgz", + "integrity": "sha512-EEVig1Q2QJ4ELpJXMZR8Vt5DQx8/mo+dGWSR7vWXqcob2gQLyQGsionYcGKATXvQzMPn6DSN1vTN7yFximdIAg==", + "dev": true, + "requires": { + "cssnano-util-get-match": "^4.0.0", + "has": "^1.0.0", + "postcss": "^7.0.0", + "postcss-value-parser": "^3.0.0" + }, + "dependencies": { + "picocolors": { + "version": "0.2.1", + "resolved": "https://registry.npmmirror.com/picocolors/-/picocolors-0.2.1.tgz", + "integrity": "sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA==", + "dev": true + }, + "postcss": { + "version": "7.0.39", + "resolved": "https://registry.npmmirror.com/postcss/-/postcss-7.0.39.tgz", + "integrity": "sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA==", + "dev": true, + "requires": { + "picocolors": "^0.2.1", + "source-map": "^0.6.1" + } + }, + "postcss-value-parser": { + "version": "3.3.1", + "resolved": "https://registry.npmmirror.com/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", + "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==", + "dev": true + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmmirror.com/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "postcss-selector-parser": { + "version": "6.1.0", + "resolved": "https://registry.npmmirror.com/postcss-selector-parser/-/postcss-selector-parser-6.1.0.tgz", + "integrity": "sha512-UMz42UD0UY0EApS0ZL9o1XnLhSTtvvvLe5Dc2H2O56fvRZi+KulDyf5ctDhhtYJBGKStV2FL1fy6253cmLgqVQ==", + "dev": true, + "requires": { + "cssesc": "^3.0.0", + "util-deprecate": "^1.0.2" + } + }, + "postcss-svgo": { + "version": "4.0.3", + "resolved": "https://registry.npmmirror.com/postcss-svgo/-/postcss-svgo-4.0.3.tgz", + "integrity": "sha512-NoRbrcMWTtUghzuKSoIm6XV+sJdvZ7GZSc3wdBN0W19FTtp2ko8NqLsgoh/m9CzNhU3KLPvQmjIwtaNFkaFTvw==", + "dev": true, + "requires": { + "postcss": "^7.0.0", + "postcss-value-parser": "^3.0.0", + "svgo": "^1.0.0" + }, + "dependencies": { + "picocolors": { + "version": "0.2.1", + "resolved": "https://registry.npmmirror.com/picocolors/-/picocolors-0.2.1.tgz", + "integrity": "sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA==", + "dev": true + }, + "postcss": { + "version": "7.0.39", + "resolved": "https://registry.npmmirror.com/postcss/-/postcss-7.0.39.tgz", + "integrity": "sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA==", + "dev": true, + "requires": { + "picocolors": "^0.2.1", + "source-map": "^0.6.1" + } + }, + "postcss-value-parser": { + "version": "3.3.1", + "resolved": "https://registry.npmmirror.com/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", + "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==", + "dev": true + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmmirror.com/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "postcss-unique-selectors": { + "version": "4.0.1", + "resolved": "https://registry.npmmirror.com/postcss-unique-selectors/-/postcss-unique-selectors-4.0.1.tgz", + "integrity": "sha512-+JanVaryLo9QwZjKrmJgkI4Fn8SBgRO6WXQBJi7KiAVPlmxikB5Jzc4EvXMT2H0/m0RjrVVm9rGNhZddm/8Spg==", + "dev": true, + "requires": { + "alphanum-sort": "^1.0.0", + "postcss": "^7.0.0", + "uniqs": "^2.0.0" + }, + "dependencies": { + "picocolors": { + "version": "0.2.1", + "resolved": "https://registry.npmmirror.com/picocolors/-/picocolors-0.2.1.tgz", + "integrity": "sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA==", + "dev": true + }, + "postcss": { + "version": "7.0.39", + "resolved": "https://registry.npmmirror.com/postcss/-/postcss-7.0.39.tgz", + "integrity": "sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA==", + "dev": true, + "requires": { + "picocolors": "^0.2.1", + "source-map": "^0.6.1" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmmirror.com/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "postcss-value-parser": { + "version": "4.2.0", + "resolved": "https://registry.npmmirror.com/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz", + "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==", + "dev": true + }, + "posthtml": { + "version": "0.9.2", + "resolved": "https://registry.npmmirror.com/posthtml/-/posthtml-0.9.2.tgz", + "integrity": "sha512-spBB5sgC4cv2YcW03f/IAUN1pgDJWNWD8FzkyY4mArLUMJW+KlQhlmUdKAHQuPfb00Jl5xIfImeOsf6YL8QK7Q==", + "dev": true, + "requires": { + "posthtml-parser": "^0.2.0", + "posthtml-render": "^1.0.5" + } + }, + "posthtml-parser": { + "version": "0.2.1", + "resolved": "https://registry.npmmirror.com/posthtml-parser/-/posthtml-parser-0.2.1.tgz", + "integrity": "sha512-nPC53YMqJnc/+1x4fRYFfm81KV2V+G9NZY+hTohpYg64Ay7NemWWcV4UWuy/SgMupqQ3kJ88M/iRfZmSnxT+pw==", + "dev": true, + "requires": { + "htmlparser2": "^3.8.3", + "isobject": "^2.1.0" + }, + "dependencies": { + "domhandler": { + "version": "2.4.2", + "resolved": "https://registry.npmmirror.com/domhandler/-/domhandler-2.4.2.tgz", + "integrity": "sha512-JiK04h0Ht5u/80fdLMCEmV4zkNh2BcoMFBmZ/91WtYZ8qVXSKjiw7fXMgFPnHcSZgOo3XdinHvmnDUeMf5R4wA==", + "dev": true, + "requires": { + "domelementtype": "1" + } + }, + "entities": { + "version": "1.1.2", + "resolved": "https://registry.npmmirror.com/entities/-/entities-1.1.2.tgz", + "integrity": "sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w==", + "dev": true + }, + "htmlparser2": { + "version": "3.10.1", + "resolved": "https://registry.npmmirror.com/htmlparser2/-/htmlparser2-3.10.1.tgz", + "integrity": "sha512-IgieNijUMbkDovyoKObU1DUhm1iwNYE/fuifEoEHfd1oZKZDaONBSkal7Y01shxsM49R4XaMdGez3WnF9UfiCQ==", + "dev": true, + "requires": { + "domelementtype": "^1.3.1", + "domhandler": "^2.3.0", + "domutils": "^1.5.1", + "entities": "^1.1.1", + "inherits": "^2.0.1", + "readable-stream": "^3.1.1" + } + }, + "isobject": { + "version": "2.1.0", + "resolved": "https://registry.npmmirror.com/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha512-+OUdGJlgjOBZDfxnDjYYG6zp487z0JGNQq3cYQYg5f5hKR+syHMsaztzGeml/4kGG55CSpKSpWTY+jYGgsHLgA==", + "dev": true, + "requires": { + "isarray": "1.0.0" + } + }, + "readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmmirror.com/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + } + } + }, + "posthtml-rename-id": { + "version": "1.0.12", + "resolved": "https://registry.npmmirror.com/posthtml-rename-id/-/posthtml-rename-id-1.0.12.tgz", + "integrity": "sha512-UKXf9OF/no8WZo9edRzvuMenb6AD5hDLzIepJW+a4oJT+T/Lx7vfMYWT4aWlGNQh0WMhnUx1ipN9OkZ9q+ddEw==", + "dev": true, + "requires": { + "escape-string-regexp": "1.0.5" + } + }, + "posthtml-render": { + "version": "1.4.0", + "resolved": "https://registry.npmmirror.com/posthtml-render/-/posthtml-render-1.4.0.tgz", + "integrity": "sha512-W1779iVHGfq0Fvh2PROhCe2QhB8mEErgqzo1wpIt36tCgChafP+hbXIhLDOM8ePJrZcFs0vkNEtdibEWVqChqw==", + "dev": true + }, + "posthtml-svg-mode": { + "version": "1.0.3", + "resolved": "https://registry.npmmirror.com/posthtml-svg-mode/-/posthtml-svg-mode-1.0.3.tgz", + "integrity": "sha512-hEqw9NHZ9YgJ2/0G7CECOeuLQKZi8HjWLkBaSVtOWjygQ9ZD8P7tqeowYs7WrFdKsWEKG7o+IlsPY8jrr0CJpQ==", + "dev": true, + "requires": { + "merge-options": "1.0.1", + "posthtml": "^0.9.2", + "posthtml-parser": "^0.2.1", + "posthtml-render": "^1.0.6" + } + }, + "prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmmirror.com/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true + }, + "prepend-http": { + "version": "1.0.4", + "resolved": "https://registry.npmmirror.com/prepend-http/-/prepend-http-1.0.4.tgz", + "integrity": "sha512-PhmXi5XmoyKw1Un4E+opM2KcsJInDvKyuOumcjjw3waw86ZNjHwVUOOWLc4bCzLdcKNaWBH9e99sbWzDQsVaYg==", + "dev": true + }, + "prettier": { + "version": "2.8.8", + "resolved": "https://registry.npmmirror.com/prettier/-/prettier-2.8.8.tgz", + "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", + "dev": true, + "optional": true + }, + "pretty-error": { + "version": "2.1.2", + "resolved": "https://registry.npmmirror.com/pretty-error/-/pretty-error-2.1.2.tgz", + "integrity": "sha512-EY5oDzmsX5wvuynAByrmY0P0hcp+QpnAKbJng2A2MPjVKXCxrDSUkzghVJ4ZGPIv+JC4gX8fPUWscC0RtjsWGw==", + "dev": true, + "requires": { + "lodash": "^4.17.20", + "renderkid": "^2.0.4" + } + }, + "process": { + "version": "0.11.10", + "resolved": "https://registry.npmmirror.com/process/-/process-0.11.10.tgz", + "integrity": "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==", + "dev": true + }, + "process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmmirror.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "dev": true + }, + "progress": { + "version": "2.0.3", + "resolved": "https://registry.npmmirror.com/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", + "dev": true + }, + "promise-inflight": { + "version": "1.0.1", + "resolved": "https://registry.npmmirror.com/promise-inflight/-/promise-inflight-1.0.1.tgz", + "integrity": "sha512-6zWPyEOFaQBJYcGMHBKTKJ3u6TBsnMFOIZSa6ce1e/ZrrsOlnHRHbabMjLiBYKp+n44X9eUI6VUPaukCXHuG4g==", + "dev": true + }, + "proto-list": { + "version": "1.2.4", + "resolved": "https://registry.npmmirror.com/proto-list/-/proto-list-1.2.4.tgz", + "integrity": "sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA==" + }, + "proxy-addr": { + "version": "2.0.7", + "resolved": "https://registry.npmmirror.com/proxy-addr/-/proxy-addr-2.0.7.tgz", + "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", + "dev": true, + "requires": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + } + }, + "prr": { + "version": "1.0.1", + "resolved": "https://registry.npmmirror.com/prr/-/prr-1.0.1.tgz", + "integrity": "sha512-yPw4Sng1gWghHQWj0B3ZggWUm4qVbPwPFcRG8KyxiU7J2OHFSoEHKS+EZ3fv5l1t9CyCiop6l/ZYeWbrgoQejw==", + "dev": true + }, + "pseudomap": { + "version": "1.0.2", + "resolved": "https://registry.npmmirror.com/pseudomap/-/pseudomap-1.0.2.tgz", + "integrity": "sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ==" + }, + "psl": { + "version": "1.9.0", + "resolved": "https://registry.npmmirror.com/psl/-/psl-1.9.0.tgz", + "integrity": "sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==", + "dev": true + }, + "public-encrypt": { + "version": "4.0.3", + "resolved": "https://registry.npmmirror.com/public-encrypt/-/public-encrypt-4.0.3.tgz", + "integrity": "sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q==", + "dev": true, + "requires": { + "bn.js": "^4.1.0", + "browserify-rsa": "^4.0.0", + "create-hash": "^1.1.0", + "parse-asn1": "^5.0.0", + "randombytes": "^2.0.1", + "safe-buffer": "^5.1.2" + }, + "dependencies": { + "bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmmirror.com/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", + "dev": true + } + } + }, + "pump": { + "version": "3.0.0", + "resolved": "https://registry.npmmirror.com/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "dev": true, + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "pumpify": { + "version": "1.5.1", + "resolved": "https://registry.npmmirror.com/pumpify/-/pumpify-1.5.1.tgz", + "integrity": "sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ==", + "dev": true, + "requires": { + "duplexify": "^3.6.0", + "inherits": "^2.0.3", + "pump": "^2.0.0" + }, + "dependencies": { + "pump": { + "version": "2.0.1", + "resolved": "https://registry.npmmirror.com/pump/-/pump-2.0.1.tgz", + "integrity": "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==", + "dev": true, + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + } + } + }, + "punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmmirror.com/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true + }, + "q": { + "version": "1.5.1", + "resolved": "https://registry.npmmirror.com/q/-/q-1.5.1.tgz", + "integrity": "sha512-kV/CThkXo6xyFEZUugw/+pIOywXcDbFYgSct5cT3gqlbkBE1SJdwy6UQoZvodiWF/ckQLZyDE/Bu1M6gVu5lVw==", + "dev": true + }, + "qs": { + "version": "6.5.3", + "resolved": "https://registry.npmmirror.com/qs/-/qs-6.5.3.tgz", + "integrity": "sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA==", + "dev": true + }, + "query-string": { + "version": "4.3.4", + "resolved": "https://registry.npmmirror.com/query-string/-/query-string-4.3.4.tgz", + "integrity": "sha512-O2XLNDBIg1DnTOa+2XrIwSiXEV8h2KImXUnjhhn2+UsvZ+Es2uyd5CCRTNQlDGbzUQOW3aYCBx9rVA6dzsiY7Q==", + "dev": true, + "requires": { + "object-assign": "^4.1.0", + "strict-uri-encode": "^1.0.0" + } + }, + "querystring-es3": { + "version": "0.2.1", + "resolved": "https://registry.npmmirror.com/querystring-es3/-/querystring-es3-0.2.1.tgz", + "integrity": "sha512-773xhDQnZBMFobEiztv8LIl70ch5MSF/jUQVlhwFyBILqq96anmoctVIYz+ZRp0qbCKATTn6ev02M3r7Ga5vqA==", + "dev": true + }, + "querystringify": { + "version": "2.2.0", + "resolved": "https://registry.npmmirror.com/querystringify/-/querystringify-2.2.0.tgz", + "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==", + "dev": true + }, + "quill": { + "version": "1.3.7", + "resolved": "https://registry.npmmirror.com/quill/-/quill-1.3.7.tgz", + "integrity": "sha512-hG/DVzh/TiknWtE6QmWAF/pxoZKYxfe3J/d/+ShUWkDvvkZQVTPeVmUJVu1uE6DDooC4fWTiCLh84ul89oNz5g==", + "requires": { + "clone": "^2.1.1", + "deep-equal": "^1.0.1", + "eventemitter3": "^2.0.3", + "extend": "^3.0.2", + "parchment": "^1.1.4", + "quill-delta": "^3.6.2" + } + }, + "quill-delta": { + "version": "3.6.3", + "resolved": "https://registry.npmmirror.com/quill-delta/-/quill-delta-3.6.3.tgz", + "integrity": "sha512-wdIGBlcX13tCHOXGMVnnTVFtGRLoP0imqxM696fIPwIf5ODIYUHIvHbZcyvGlZFiFhK5XzDC2lpjbxRhnM05Tg==", + "requires": { + "deep-equal": "^1.0.1", + "extend": "^3.0.2", + "fast-diff": "1.1.2" + } + }, + "randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmmirror.com/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dev": true, + "requires": { + "safe-buffer": "^5.1.0" + } + }, + "randomfill": { + "version": "1.0.4", + "resolved": "https://registry.npmmirror.com/randomfill/-/randomfill-1.0.4.tgz", + "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", + "dev": true, + "requires": { + "randombytes": "^2.0.5", + "safe-buffer": "^5.1.0" + } + }, + "range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmmirror.com/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "dev": true + }, + "raw-body": { + "version": "2.5.2", + "resolved": "https://registry.npmmirror.com/raw-body/-/raw-body-2.5.2.tgz", + "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", + "dev": true, + "requires": { + "bytes": "3.1.2", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + } + }, + "read-pkg": { + "version": "5.2.0", + "resolved": "https://registry.npmmirror.com/read-pkg/-/read-pkg-5.2.0.tgz", + "integrity": "sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==", + "dev": true, + "requires": { + "@types/normalize-package-data": "^2.4.0", + "normalize-package-data": "^2.5.0", + "parse-json": "^5.0.0", + "type-fest": "^0.6.0" + } + }, + "readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmmirror.com/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmmirror.com/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + } + } + }, + "readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmmirror.com/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dev": true, + "requires": { + "picomatch": "^2.2.1" + } + }, + "regenerate": { + "version": "1.4.2", + "resolved": "https://registry.npmmirror.com/regenerate/-/regenerate-1.4.2.tgz", + "integrity": "sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A==", + "dev": true + }, + "regenerate-unicode-properties": { + "version": "10.1.1", + "resolved": "https://registry.npmmirror.com/regenerate-unicode-properties/-/regenerate-unicode-properties-10.1.1.tgz", + "integrity": "sha512-X007RyZLsCJVVrjgEFVpLUTZwyOZk3oiL75ZcuYjlIWd6rNJtOjkBwQc5AsRrpbKVkxN6sklw/k/9m2jJYOf8Q==", + "dev": true, + "requires": { + "regenerate": "^1.4.2" + } + }, + "regenerator-runtime": { + "version": "0.14.1", + "resolved": "https://registry.npmmirror.com/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz", + "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==" + }, + "regenerator-transform": { + "version": "0.15.2", + "resolved": "https://registry.npmmirror.com/regenerator-transform/-/regenerator-transform-0.15.2.tgz", + "integrity": "sha512-hfMp2BoF0qOk3uc5V20ALGDS2ddjQaLrdl7xrGXvAIow7qeWRM2VA2HuCHkUKk9slq3VwEwLNK3DFBqDfPGYtg==", + "dev": true, + "requires": { + "@babel/runtime": "^7.8.4" + } + }, + "regex-not": { + "version": "1.0.2", + "resolved": "https://registry.npmmirror.com/regex-not/-/regex-not-1.0.2.tgz", + "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", + "dev": true, + "requires": { + "extend-shallow": "^3.0.2", + "safe-regex": "^1.1.0" + } + }, + "regexp.prototype.flags": { + "version": "1.5.2", + "resolved": "https://registry.npmmirror.com/regexp.prototype.flags/-/regexp.prototype.flags-1.5.2.tgz", + "integrity": "sha512-NcDiDkTLuPR+++OCKB0nWafEmhg/Da8aUPLPMQbK+bxKKCm1/S5he+AqYa4PlMCVBalb4/yxIRub6qkEx5yJbw==", + "requires": { + "call-bind": "^1.0.6", + "define-properties": "^1.2.1", + "es-errors": "^1.3.0", + "set-function-name": "^2.0.1" + } + }, + "regexpp": { + "version": "3.2.0", + "resolved": "https://registry.npmmirror.com/regexpp/-/regexpp-3.2.0.tgz", + "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", + "dev": true + }, + "regexpu-core": { + "version": "5.3.2", + "resolved": "https://registry.npmmirror.com/regexpu-core/-/regexpu-core-5.3.2.tgz", + "integrity": "sha512-RAM5FlZz+Lhmo7db9L298p2vHP5ZywrVXmVXpmAD9GuL5MPH6t9ROw1iA/wfHkQ76Qe7AaPF0nGuim96/IrQMQ==", + "dev": true, + "requires": { + "@babel/regjsgen": "^0.8.0", + "regenerate": "^1.4.2", + "regenerate-unicode-properties": "^10.1.0", + "regjsparser": "^0.9.1", + "unicode-match-property-ecmascript": "^2.0.0", + "unicode-match-property-value-ecmascript": "^2.1.0" + } + }, + "regjsparser": { + "version": "0.9.1", + "resolved": "https://registry.npmmirror.com/regjsparser/-/regjsparser-0.9.1.tgz", + "integrity": "sha512-dQUtn90WanSNl+7mQKcXAgZxvUe7Z0SqXlgzv0za4LwiUhyzBC58yQO3liFoUgu8GiJVInAhJjkj1N0EtQ5nkQ==", + "dev": true, + "requires": { + "jsesc": "~0.5.0" + }, + "dependencies": { + "jsesc": { + "version": "0.5.0", + "resolved": "https://registry.npmmirror.com/jsesc/-/jsesc-0.5.0.tgz", + "integrity": "sha512-uZz5UnB7u4T9LvwmFqXii7pZSouaRPorGs5who1Ip7VO0wxanFvBL7GkM6dTHlgX+jhBApRetaWpnDabOeTcnA==", + "dev": true + } + } + }, + "relateurl": { + "version": "0.2.7", + "resolved": "https://registry.npmmirror.com/relateurl/-/relateurl-0.2.7.tgz", + "integrity": "sha512-G08Dxvm4iDN3MLM0EsP62EDV9IuhXPR6blNz6Utcp7zyV3tr4HVNINt6MpaRWbxoOHT3Q7YN2P+jaHX8vUbgog==", + "dev": true + }, + "remove-trailing-separator": { + "version": "1.1.0", + "resolved": "https://registry.npmmirror.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", + "integrity": "sha512-/hS+Y0u3aOfIETiaiirUFwDBDzmXPvO+jAfKTitUngIPzdKc6Z0LoFjM/CK5PL4C+eKwHohlHAb6H0VFfmmUsw==", + "dev": true + }, + "renderkid": { + "version": "2.0.7", + "resolved": "https://registry.npmmirror.com/renderkid/-/renderkid-2.0.7.tgz", + "integrity": "sha512-oCcFyxaMrKsKcTY59qnCAtmDVSLfPbrv6A3tVbPdFMMrv5jaK10V6m40cKsoPNhAqN6rmHW9sswW4o3ruSrwUQ==", + "dev": true, + "requires": { + "css-select": "^4.1.3", + "dom-converter": "^0.2.0", + "htmlparser2": "^6.1.0", + "lodash": "^4.17.21", + "strip-ansi": "^3.0.1" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmmirror.com/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", + "dev": true + }, + "css-select": { + "version": "4.3.0", + "resolved": "https://registry.npmmirror.com/css-select/-/css-select-4.3.0.tgz", + "integrity": "sha512-wPpOYtnsVontu2mODhA19JrqWxNsfdatRKd64kmpRbQgh1KtItko5sTnEpPdpSaJszTOhEMlF/RPz28qj4HqhQ==", + "dev": true, + "requires": { + "boolbase": "^1.0.0", + "css-what": "^6.0.1", + "domhandler": "^4.3.1", + "domutils": "^2.8.0", + "nth-check": "^2.0.1" + } + }, + "css-what": { + "version": "6.1.0", + "resolved": "https://registry.npmmirror.com/css-what/-/css-what-6.1.0.tgz", + "integrity": "sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==", + "dev": true + }, + "dom-serializer": { + "version": "1.4.1", + "resolved": "https://registry.npmmirror.com/dom-serializer/-/dom-serializer-1.4.1.tgz", + "integrity": "sha512-VHwB3KfrcOOkelEG2ZOfxqLZdfkil8PtJi4P8N2MMXucZq2yLp75ClViUlOVwyoHEDjYU433Aq+5zWP61+RGag==", + "dev": true, + "requires": { + "domelementtype": "^2.0.1", + "domhandler": "^4.2.0", + "entities": "^2.0.0" + } + }, + "domelementtype": { + "version": "2.3.0", + "resolved": "https://registry.npmmirror.com/domelementtype/-/domelementtype-2.3.0.tgz", + "integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==", + "dev": true + }, + "domutils": { + "version": "2.8.0", + "resolved": "https://registry.npmmirror.com/domutils/-/domutils-2.8.0.tgz", + "integrity": "sha512-w96Cjofp72M5IIhpjgobBimYEfoPjx1Vx0BSX9P30WBdZW2WIKU0T1Bd0kz2eNZ9ikjKgHbEyKx8BB6H1L3h3A==", + "dev": true, + "requires": { + "dom-serializer": "^1.0.1", + "domelementtype": "^2.2.0", + "domhandler": "^4.2.0" + } + }, + "entities": { + "version": "2.2.0", + "resolved": "https://registry.npmmirror.com/entities/-/entities-2.2.0.tgz", + "integrity": "sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A==", + "dev": true + }, + "nth-check": { + "version": "2.1.1", + "resolved": "https://registry.npmmirror.com/nth-check/-/nth-check-2.1.1.tgz", + "integrity": "sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==", + "dev": true, + "requires": { + "boolbase": "^1.0.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmmirror.com/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + } + } + }, + "repeat-element": { + "version": "1.1.4", + "resolved": "https://registry.npmmirror.com/repeat-element/-/repeat-element-1.1.4.tgz", + "integrity": "sha512-LFiNfRcSu7KK3evMyYOuCzv3L10TW7yC1G2/+StMjK8Y6Vqd2MG7r/Qjw4ghtuCOjFvlnms/iMmLqpvW/ES/WQ==", + "dev": true + }, + "repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmmirror.com/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha512-PV0dzCYDNfRi1jCDbJzpW7jNNDRuCOG/jI5ctQcGKt/clZD+YcPS3yIlWuTJMmESC8aevCFmWJy5wjAFgNqN6w==", + "dev": true + }, + "request": { + "version": "2.88.2", + "resolved": "https://registry.npmmirror.com/request/-/request-2.88.2.tgz", + "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", + "dev": true, + "requires": { + "aws-sign2": "~0.7.0", + "aws4": "^1.8.0", + "caseless": "~0.12.0", + "combined-stream": "~1.0.6", + "extend": "~3.0.2", + "forever-agent": "~0.6.1", + "form-data": "~2.3.2", + "har-validator": "~5.1.3", + "http-signature": "~1.2.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.19", + "oauth-sign": "~0.9.0", + "performance-now": "^2.1.0", + "qs": "~6.5.2", + "safe-buffer": "^5.1.2", + "tough-cookie": "~2.5.0", + "tunnel-agent": "^0.6.0", + "uuid": "^3.3.2" + } + }, + "require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmmirror.com/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "dev": true + }, + "require-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", + "dev": true + }, + "requires-port": { + "version": "1.0.0", + "resolved": "https://registry.npmmirror.com/requires-port/-/requires-port-1.0.0.tgz", + "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", + "dev": true + }, + "resize-observer-polyfill": { + "version": "1.5.1", + "resolved": "https://registry.npmmirror.com/resize-observer-polyfill/-/resize-observer-polyfill-1.5.1.tgz", + "integrity": "sha512-LwZrotdHOo12nQuZlHEmtuXdqGoOD0OhaxopaNFxWzInpEgaLWoVuAMbTzixuosCx2nEG58ngzW3vxdWoxIgdg==" + }, + "resolve": { + "version": "1.22.8", + "resolved": "https://registry.npmmirror.com/resolve/-/resolve-1.22.8.tgz", + "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", + "dev": true, + "requires": { + "is-core-module": "^2.13.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + } + }, + "resolve-cwd": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/resolve-cwd/-/resolve-cwd-2.0.0.tgz", + "integrity": "sha512-ccu8zQTrzVr954472aUVPLEcB3YpKSYR3cg/3lo1okzobPBM+1INXBbBZlDbnI/hbEocnf8j0QVo43hQKrbchg==", + "dev": true, + "requires": { + "resolve-from": "^3.0.0" + } + }, + "resolve-from": { + "version": "3.0.0", + "resolved": "https://registry.npmmirror.com/resolve-from/-/resolve-from-3.0.0.tgz", + "integrity": "sha512-GnlH6vxLymXJNMBo7XP1fJIzBFbdYt49CuTwmB/6N53t+kMPRMFKz783LlQ4tv28XoQfMWinAJX6WCGf2IlaIw==", + "dev": true + }, + "resolve-url": { + "version": "0.2.1", + "resolved": "https://registry.npmmirror.com/resolve-url/-/resolve-url-0.2.1.tgz", + "integrity": "sha512-ZuF55hVUQaaczgOIwqWzkEcEidmlD/xl44x1UZnhOXcYuFN2S6+rcxpG+C1N3So0wvNI3DmJICUFfu2SxhBmvg==", + "dev": true + }, + "restore-cursor": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/restore-cursor/-/restore-cursor-2.0.0.tgz", + "integrity": "sha512-6IzJLuGi4+R14vwagDHX+JrXmPVtPpn4mffDJ1UdR7/Edm87fl6yi8mMBIVvFtJaNTUvjughmW4hwLhRG7gC1Q==", + "dev": true, + "requires": { + "onetime": "^2.0.0", + "signal-exit": "^3.0.2" + } + }, + "ret": { + "version": "0.1.15", + "resolved": "https://registry.npmmirror.com/ret/-/ret-0.1.15.tgz", + "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", + "dev": true + }, + "retry": { + "version": "0.12.0", + "resolved": "https://registry.npmmirror.com/retry/-/retry-0.12.0.tgz", + "integrity": "sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==", + "dev": true + }, + "rfdc": { + "version": "1.3.1", + "resolved": "https://registry.npmmirror.com/rfdc/-/rfdc-1.3.1.tgz", + "integrity": "sha512-r5a3l5HzYlIC68TpmYKlxWjmOP6wiPJ1vWv2HeLhNsRZMrCkxeqxiHlQ21oXmQ4F3SiryXBHhAD7JZqvOJjFmg==", + "dev": true + }, + "rgb-regex": { + "version": "1.0.1", + "resolved": "https://registry.npmmirror.com/rgb-regex/-/rgb-regex-1.0.1.tgz", + "integrity": "sha512-gDK5mkALDFER2YLqH6imYvK6g02gpNGM4ILDZ472EwWfXZnC2ZEpoB2ECXTyOVUKuk/bPJZMzwQPBYICzP+D3w==", + "dev": true + }, + "rgba-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmmirror.com/rgba-regex/-/rgba-regex-1.0.0.tgz", + "integrity": "sha512-zgn5OjNQXLUTdq8m17KdaicF6w89TZs8ZU8y0AYENIU6wG8GG6LLm0yLSiPY8DmaYmHdgRW8rnApjoT0fQRfMg==", + "dev": true + }, + "rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmmirror.com/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, + "ripemd160": { + "version": "2.0.2", + "resolved": "https://registry.npmmirror.com/ripemd160/-/ripemd160-2.0.2.tgz", + "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", + "dev": true, + "requires": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1" + } + }, + "run-async": { + "version": "2.4.1", + "resolved": "https://registry.npmmirror.com/run-async/-/run-async-2.4.1.tgz", + "integrity": "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==", + "dev": true + }, + "run-queue": { + "version": "1.0.3", + "resolved": "https://registry.npmmirror.com/run-queue/-/run-queue-1.0.3.tgz", + "integrity": "sha512-ntymy489o0/QQplUDnpYAYUsO50K9SBrIVaKCWDOJzYJts0f9WH9RFJkyagebkw5+y1oi00R7ynNW/d12GBumg==", + "dev": true, + "requires": { + "aproba": "^1.1.1" + } + }, + "runjs": { + "version": "4.4.2", + "resolved": "https://registry.npmmirror.com/runjs/-/runjs-4.4.2.tgz", + "integrity": "sha512-/DB54HRJnxfGA/a9QLZMyAn8H84SMt8oVGF7Vz+OS4BMCve312DXNRpy6Z8yohLuoMctoalXQtvmpd2ChQYD4Q==", + "dev": true, + "requires": { + "chalk": "2.3.0", + "lodash.padend": "4.6.1", + "microcli": "1.3.3", + "omelette": "0.4.5" + }, + "dependencies": { + "chalk": { + "version": "2.3.0", + "resolved": "https://registry.npmmirror.com/chalk/-/chalk-2.3.0.tgz", + "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "dev": true, + "requires": { + "ansi-styles": "^3.1.0", + "escape-string-regexp": "^1.0.5", + "supports-color": "^4.0.0" + } + }, + "has-flag": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/has-flag/-/has-flag-2.0.0.tgz", + "integrity": "sha512-P+1n3MnwjR/Epg9BBo1KT8qbye2g2Ou4sFumihwt6I4tsUX7jnLcX4BTOSKg/B1ZrIYMN9FcEnG4x5a7NB8Eng==", + "dev": true + }, + "supports-color": { + "version": "4.5.0", + "resolved": "https://registry.npmmirror.com/supports-color/-/supports-color-4.5.0.tgz", + "integrity": "sha512-ycQR/UbvI9xIlEdQT1TQqwoXtEldExbCEAJgRo5YXlmSKjv6ThHnP9/vwGa1gr19Gfw+LkFd7KqYMhzrRC5JYw==", + "dev": true, + "requires": { + "has-flag": "^2.0.0" + } + } + } + }, + "rxjs": { + "version": "6.6.7", + "resolved": "https://registry.npmmirror.com/rxjs/-/rxjs-6.6.7.tgz", + "integrity": "sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==", + "dev": true, + "requires": { + "tslib": "^1.9.0" + }, + "dependencies": { + "tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmmirror.com/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + } + } + }, + "safe-array-concat": { + "version": "1.1.2", + "resolved": "https://registry.npmmirror.com/safe-array-concat/-/safe-array-concat-1.1.2.tgz", + "integrity": "sha512-vj6RsCsWBCf19jIeHEfkRMw8DPiBb+DMXklQ/1SGDHOMlHdPUkZXFQ2YdplS23zESTijAcurb1aSgJA3AgMu1Q==", + "dev": true, + "requires": { + "call-bind": "^1.0.7", + "get-intrinsic": "^1.2.4", + "has-symbols": "^1.0.3", + "isarray": "^2.0.5" + }, + "dependencies": { + "isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmmirror.com/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true + } + } + }, + "safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmmirror.com/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true + }, + "safe-regex": { + "version": "1.1.0", + "resolved": "https://registry.npmmirror.com/safe-regex/-/safe-regex-1.1.0.tgz", + "integrity": "sha512-aJXcif4xnaNUzvUuC5gcb46oTS7zvg4jpMTnuqtrEPlR3vFr4pxtdTwaF1Qs3Enjn9HK+ZlwQui+a7z0SywIzg==", + "dev": true, + "requires": { + "ret": "~0.1.10" + } + }, + "safe-regex-test": { + "version": "1.0.3", + "resolved": "https://registry.npmmirror.com/safe-regex-test/-/safe-regex-test-1.0.3.tgz", + "integrity": "sha512-CdASjNJPvRa7roO6Ra/gLYBTzYzzPyyBXxIMdGW3USQLyjWEls2RgW5UBTXaQVp+OrpeCK3bLem8smtmheoRuw==", + "dev": true, + "requires": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-regex": "^1.1.4" + } + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmmirror.com/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true + }, + "sass": { + "version": "1.32.13", + "resolved": "https://registry.npmmirror.com/sass/-/sass-1.32.13.tgz", + "integrity": "sha512-dEgI9nShraqP7cXQH+lEXVf73WOPCse0QlFzSD8k+1TcOxCMwVXfQlr0jtoluZysQOyJGnfr21dLvYKDJq8HkA==", + "dev": true, + "requires": { + "chokidar": ">=3.0.0 <4.0.0" + } + }, + "sass-loader": { + "version": "10.1.1", + "resolved": "https://registry.npmmirror.com/sass-loader/-/sass-loader-10.1.1.tgz", + "integrity": "sha512-W6gVDXAd5hR/WHsPicvZdjAWHBcEJ44UahgxcIE196fW2ong0ZHMPO1kZuI5q0VlvMQZh32gpv69PLWQm70qrw==", + "dev": true, + "requires": { + "klona": "^2.0.4", + "loader-utils": "^2.0.0", + "neo-async": "^2.6.2", + "schema-utils": "^3.0.0", + "semver": "^7.3.2" + }, + "dependencies": { + "schema-utils": { + "version": "3.3.0", + "resolved": "https://registry.npmmirror.com/schema-utils/-/schema-utils-3.3.0.tgz", + "integrity": "sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg==", + "dev": true, + "requires": { + "@types/json-schema": "^7.0.8", + "ajv": "^6.12.5", + "ajv-keywords": "^3.5.2" + } + }, + "semver": { + "version": "7.6.2", + "resolved": "https://registry.npmmirror.com/semver/-/semver-7.6.2.tgz", + "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", + "dev": true + } + } + }, + "sax": { + "version": "1.2.4", + "resolved": "https://registry.npmmirror.com/sax/-/sax-1.2.4.tgz", + "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", + "dev": true + }, + "schema-utils": { + "version": "2.7.1", + "resolved": "https://registry.npmmirror.com/schema-utils/-/schema-utils-2.7.1.tgz", + "integrity": "sha512-SHiNtMOUGWBQJwzISiVYKu82GiV4QYGePp3odlY1tuKO7gPtphAT5R/py0fA6xtbgLL/RvtJZnU9b8s0F1q0Xg==", + "dev": true, + "requires": { + "@types/json-schema": "^7.0.5", + "ajv": "^6.12.4", + "ajv-keywords": "^3.5.2" + } + }, + "screenfull": { + "version": "5.0.2", + "resolved": "https://registry.npmmirror.com/screenfull/-/screenfull-5.0.2.tgz", + "integrity": "sha512-cCF2b+L/mnEiORLN5xSAz6H3t18i2oHh9BA8+CQlAh5DRw2+NFAGQJOSYbcGw8B2k04g/lVvFcfZ83b3ysH5UQ==" + }, + "script-ext-html-webpack-plugin": { + "version": "2.1.5", + "resolved": "https://registry.npmmirror.com/script-ext-html-webpack-plugin/-/script-ext-html-webpack-plugin-2.1.5.tgz", + "integrity": "sha512-nMjd5dtsnoB8dS+pVM9ZL4mC9O1uVtTxrDS99OGZsZxFbkZE6pw0HCMued/cncDrKivIShO9vwoyOTvsGqQHEQ==", + "dev": true, + "requires": { + "debug": "^4.2.0" + } + }, + "select": { + "version": "1.1.2", + "resolved": "https://registry.npmmirror.com/select/-/select-1.1.2.tgz", + "integrity": "sha512-OwpTSOfy6xSs1+pwcNrv0RBMOzI39Lp3qQKUTPVVPRjCdNa5JH/oPRiqsesIskK8TVgmRiHwO4KXlV2Li9dANA==" + }, + "select-hose": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/select-hose/-/select-hose-2.0.0.tgz", + "integrity": "sha512-mEugaLK+YfkijB4fx0e6kImuJdCIt2LxCRcbEYPqRGCs4F2ogyfZU5IAZRdjCP8JPq2AtdNoC/Dux63d9Kiryg==", + "dev": true + }, + "selfsigned": { + "version": "1.10.14", + "resolved": "https://registry.npmmirror.com/selfsigned/-/selfsigned-1.10.14.tgz", + "integrity": "sha512-lkjaiAye+wBZDCBsu5BGi0XiLRxeUlsGod5ZP924CRSEoGuZAw/f7y9RKu28rwTfiHVhdavhB0qH0INV6P1lEA==", + "dev": true, + "requires": { + "node-forge": "^0.10.0" + } + }, + "semver": { + "version": "5.7.2", + "resolved": "https://registry.npmmirror.com/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==" + }, + "semver-compare": { + "version": "1.0.0", + "resolved": "https://registry.npmmirror.com/semver-compare/-/semver-compare-1.0.0.tgz", + "integrity": "sha512-YM3/ITh2MJ5MtzaM429anh+x2jiLVjqILF4m4oyQB18W7Ggea7BfqdH/wGMK7dDiMghv/6WG7znWMwUDzJiXow==", + "dev": true + }, + "send": { + "version": "0.18.0", + "resolved": "https://registry.npmmirror.com/send/-/send-0.18.0.tgz", + "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", + "dev": true, + "requires": { + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "mime": "1.6.0", + "ms": "2.1.3", + "on-finished": "2.4.1", + "range-parser": "~1.2.1", + "statuses": "2.0.1" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmmirror.com/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + }, + "dependencies": { + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "dev": true + } + } + }, + "mime": { + "version": "1.6.0", + "resolved": "https://registry.npmmirror.com/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "dev": true + }, + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmmirror.com/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + } + } + }, + "serialize-javascript": { + "version": "4.0.0", + "resolved": "https://registry.npmmirror.com/serialize-javascript/-/serialize-javascript-4.0.0.tgz", + "integrity": "sha512-GaNA54380uFefWghODBWEGisLZFj00nS5ACs6yHa9nLqlLpVLO8ChDGeKRjZnV4Nh4n0Qi7nhYZD/9fCPzEqkw==", + "dev": true, + "requires": { + "randombytes": "^2.1.0" + } + }, + "serve-index": { + "version": "1.9.1", + "resolved": "https://registry.npmmirror.com/serve-index/-/serve-index-1.9.1.tgz", + "integrity": "sha512-pXHfKNP4qujrtteMrSBb0rc8HJ9Ms/GrXwcUtUtD5s4ewDJI8bT3Cz2zTVRMKtri49pLx2e0Ya8ziP5Ya2pZZw==", + "dev": true, + "requires": { + "accepts": "~1.3.4", + "batch": "0.6.1", + "debug": "2.6.9", + "escape-html": "~1.0.3", + "http-errors": "~1.6.2", + "mime-types": "~2.1.17", + "parseurl": "~1.3.2" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmmirror.com/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "depd": { + "version": "1.1.2", + "resolved": "https://registry.npmmirror.com/depd/-/depd-1.1.2.tgz", + "integrity": "sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ==", + "dev": true + }, + "http-errors": { + "version": "1.6.3", + "resolved": "https://registry.npmmirror.com/http-errors/-/http-errors-1.6.3.tgz", + "integrity": "sha512-lks+lVC8dgGyh97jxvxeYTWQFvh4uw4yC12gVl63Cg30sjPX4wuGcdkICVXDAESr6OJGjqGA8Iz5mkeN6zlD7A==", + "dev": true, + "requires": { + "depd": "~1.1.2", + "inherits": "2.0.3", + "setprototypeof": "1.1.0", + "statuses": ">= 1.4.0 < 2" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmmirror.com/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha512-x00IRNXNy63jwGkJmzPigoySHbaqpNuzKbBOmzK+g2OdZpQ9w+sxCN+VSB3ja7IAge2OP2qpfxTjeNcyjmW1uw==", + "dev": true + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "dev": true + }, + "setprototypeof": { + "version": "1.1.0", + "resolved": "https://registry.npmmirror.com/setprototypeof/-/setprototypeof-1.1.0.tgz", + "integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==", + "dev": true + }, + "statuses": { + "version": "1.5.0", + "resolved": "https://registry.npmmirror.com/statuses/-/statuses-1.5.0.tgz", + "integrity": "sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==", + "dev": true + } + } + }, + "serve-static": { + "version": "1.15.0", + "resolved": "https://registry.npmmirror.com/serve-static/-/serve-static-1.15.0.tgz", + "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", + "dev": true, + "requires": { + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "0.18.0" + } + }, + "set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==", + "dev": true + }, + "set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmmirror.com/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "requires": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + } + }, + "set-function-name": { + "version": "2.0.2", + "resolved": "https://registry.npmmirror.com/set-function-name/-/set-function-name-2.0.2.tgz", + "integrity": "sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==", + "requires": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "functions-have-names": "^1.2.3", + "has-property-descriptors": "^1.0.2" + } + }, + "set-value": { + "version": "2.0.1", + "resolved": "https://registry.npmmirror.com/set-value/-/set-value-2.0.1.tgz", + "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.3", + "split-string": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmmirror.com/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "setimmediate": { + "version": "1.0.5", + "resolved": "https://registry.npmmirror.com/setimmediate/-/setimmediate-1.0.5.tgz", + "integrity": "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==", + "dev": true + }, + "setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmmirror.com/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", + "dev": true + }, + "sha.js": { + "version": "2.4.11", + "resolved": "https://registry.npmmirror.com/sha.js/-/sha.js-2.4.11.tgz", + "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmmirror.com/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==", + "dev": true, + "requires": { + "shebang-regex": "^1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmmirror.com/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==", + "dev": true + }, + "shell-quote": { + "version": "1.8.1", + "resolved": "https://registry.npmmirror.com/shell-quote/-/shell-quote-1.8.1.tgz", + "integrity": "sha512-6j1W9l1iAs/4xYBI1SYOVZyFcCis9b4KCLQ8fgAGG07QvzaRLVVRQvAy85yNmmZSjYjg4MWh4gNvlPujU/5LpA==", + "dev": true + }, + "side-channel": { + "version": "1.0.6", + "resolved": "https://registry.npmmirror.com/side-channel/-/side-channel-1.0.6.tgz", + "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", + "dev": true, + "requires": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4", + "object-inspect": "^1.13.1" + } + }, + "sigmund": { + "version": "1.0.1", + "resolved": "https://registry.npmmirror.com/sigmund/-/sigmund-1.0.1.tgz", + "integrity": "sha512-fCvEXfh6NWpm+YSuY2bpXb/VIihqWA6hLsgboC+0nl71Q7N7o2eaCW8mJa/NLvQhs6jpd3VZV4UiUQlV6+lc8g==" + }, + "signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmmirror.com/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true + }, + "simple-swizzle": { + "version": "0.2.2", + "resolved": "https://registry.npmmirror.com/simple-swizzle/-/simple-swizzle-0.2.2.tgz", + "integrity": "sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==", + "dev": true, + "requires": { + "is-arrayish": "^0.3.1" + }, + "dependencies": { + "is-arrayish": { + "version": "0.3.2", + "resolved": "https://registry.npmmirror.com/is-arrayish/-/is-arrayish-0.3.2.tgz", + "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==", + "dev": true + } + } + }, + "slash": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/slash/-/slash-2.0.0.tgz", + "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==", + "dev": true + }, + "slice-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmmirror.com/slice-ansi/-/slice-ansi-2.1.0.tgz", + "integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.0", + "astral-regex": "^1.0.0", + "is-fullwidth-code-point": "^2.0.0" + }, + "dependencies": { + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==", + "dev": true + } + } + }, + "snapdragon": { + "version": "0.8.2", + "resolved": "https://registry.npmmirror.com/snapdragon/-/snapdragon-0.8.2.tgz", + "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", + "dev": true, + "requires": { + "base": "^0.11.1", + "debug": "^2.2.0", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "map-cache": "^0.2.2", + "source-map": "^0.5.6", + "source-map-resolve": "^0.5.0", + "use": "^3.1.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmmirror.com/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmmirror.com/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha512-Rr7ADjQZenceVOAKop6ALkkRAmH1A4Gx9hV/7ZujPUN2rkATqFO0JZLZInbAjpZYoJ1gUx8MRMQVkYemcbMSTA==", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmmirror.com/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "dev": true + } + } + }, + "snapdragon-node": { + "version": "2.1.1", + "resolved": "https://registry.npmmirror.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz", + "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", + "dev": true, + "requires": { + "define-property": "^1.0.0", + "isobject": "^3.0.0", + "snapdragon-util": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmmirror.com/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha512-cZTYKFWspt9jZsMscWo8sc/5lbPC9Q0N5nBLgb+Yd915iL3udB1uFgS3B8YCx66UVHq018DAVFoee7x+gxggeA==", + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "is-descriptor": { + "version": "1.0.3", + "resolved": "https://registry.npmmirror.com/is-descriptor/-/is-descriptor-1.0.3.tgz", + "integrity": "sha512-JCNNGbwWZEVaSPtS45mdtrneRWJFp07LLmykxeFV5F6oBvNF8vHSfJuJgoT472pSfk+Mf8VnlrspaFBHWM8JAw==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.1", + "is-data-descriptor": "^1.0.1" + } + } + } + }, + "snapdragon-util": { + "version": "3.0.1", + "resolved": "https://registry.npmmirror.com/snapdragon-util/-/snapdragon-util-3.0.1.tgz", + "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", + "dev": true, + "requires": { + "kind-of": "^3.2.0" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmmirror.com/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "sockjs": { + "version": "0.3.24", + "resolved": "https://registry.npmmirror.com/sockjs/-/sockjs-0.3.24.tgz", + "integrity": "sha512-GJgLTZ7vYb/JtPSSZ10hsOYIvEYsjbNU+zPdIHcUaWVNUEPivzxku31865sSSud0Da0W4lEeOPlmw93zLQchuQ==", + "dev": true, + "requires": { + "faye-websocket": "^0.11.3", + "uuid": "^8.3.2", + "websocket-driver": "^0.7.4" + }, + "dependencies": { + "uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmmirror.com/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "dev": true + } + } + }, + "sockjs-client": { + "version": "1.6.1", + "resolved": "https://registry.npmmirror.com/sockjs-client/-/sockjs-client-1.6.1.tgz", + "integrity": "sha512-2g0tjOR+fRs0amxENLi/q5TiJTqY+WXFOzb5UwXndlK6TO3U/mirZznpx6w34HVMoc3g7cY24yC/ZMIYnDlfkw==", + "dev": true, + "requires": { + "debug": "^3.2.7", + "eventsource": "^2.0.2", + "faye-websocket": "^0.11.4", + "inherits": "^2.0.4", + "url-parse": "^1.5.10" + }, + "dependencies": { + "debug": { + "version": "3.2.7", + "resolved": "https://registry.npmmirror.com/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + } + } + }, + "sort-keys": { + "version": "1.1.2", + "resolved": "https://registry.npmmirror.com/sort-keys/-/sort-keys-1.1.2.tgz", + "integrity": "sha512-vzn8aSqKgytVik0iwdBEi+zevbTYZogewTUM6dtpmGwEcdzbub/TX4bCzRhebDCRC3QzXgJsLRKB2V/Oof7HXg==", + "dev": true, + "requires": { + "is-plain-obj": "^1.0.0" + } + }, + "sortablejs": { + "version": "1.10.2", + "resolved": "https://registry.npmmirror.com/sortablejs/-/sortablejs-1.10.2.tgz", + "integrity": "sha512-YkPGufevysvfwn5rfdlGyrGjt7/CRHwvRPogD/lC+TnvcN29jDpCifKP+rBqf+LRldfXSTh+0CGLcSg0VIxq3A==" + }, + "source-list-map": { + "version": "2.0.1", + "resolved": "https://registry.npmmirror.com/source-list-map/-/source-list-map-2.0.1.tgz", + "integrity": "sha512-qnQ7gVMxGNxsiL4lEuJwe/To8UnK7fAnmbGEEH8RpLouuKbeEm0lhbQVFIrNSuB+G7tVrAlVsZgETT5nljf+Iw==", + "dev": true + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmmirror.com/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==", + "dev": true + }, + "source-map-js": { + "version": "1.2.0", + "resolved": "https://registry.npmmirror.com/source-map-js/-/source-map-js-1.2.0.tgz", + "integrity": "sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==", + "dev": true + }, + "source-map-resolve": { + "version": "0.5.3", + "resolved": "https://registry.npmmirror.com/source-map-resolve/-/source-map-resolve-0.5.3.tgz", + "integrity": "sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw==", + "dev": true, + "requires": { + "atob": "^2.1.2", + "decode-uri-component": "^0.2.0", + "resolve-url": "^0.2.1", + "source-map-url": "^0.4.0", + "urix": "^0.1.0" + } + }, + "source-map-support": { + "version": "0.5.21", + "resolved": "https://registry.npmmirror.com/source-map-support/-/source-map-support-0.5.21.tgz", + "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmmirror.com/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "source-map-url": { + "version": "0.4.1", + "resolved": "https://registry.npmmirror.com/source-map-url/-/source-map-url-0.4.1.tgz", + "integrity": "sha512-cPiFOTLUKvJFIg4SKVScy4ilPPW6rFgMgfuZJPNoDuMs3nC1HbMUycBoJw77xFIp6z1UJQJOfx6C9GMH80DiTw==", + "dev": true + }, + "spdx-correct": { + "version": "3.2.0", + "resolved": "https://registry.npmmirror.com/spdx-correct/-/spdx-correct-3.2.0.tgz", + "integrity": "sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==", + "dev": true, + "requires": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-exceptions": { + "version": "2.5.0", + "resolved": "https://registry.npmmirror.com/spdx-exceptions/-/spdx-exceptions-2.5.0.tgz", + "integrity": "sha512-PiU42r+xO4UbUS1buo3LPJkjlO7430Xn5SVAhdpzzsPHsjbYVflnnFdATgabnLude+Cqu25p6N+g2lw/PFsa4w==", + "dev": true + }, + "spdx-expression-parse": { + "version": "3.0.1", + "resolved": "https://registry.npmmirror.com/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", + "dev": true, + "requires": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-license-ids": { + "version": "3.0.18", + "resolved": "https://registry.npmmirror.com/spdx-license-ids/-/spdx-license-ids-3.0.18.tgz", + "integrity": "sha512-xxRs31BqRYHwiMzudOrpSiHtZ8i/GeionCBDSilhYRj+9gIcI8wCZTlXZKu9vZIVqViP3dcp9qE5G6AlIaD+TQ==", + "dev": true + }, + "spdy": { + "version": "4.0.2", + "resolved": "https://registry.npmmirror.com/spdy/-/spdy-4.0.2.tgz", + "integrity": "sha512-r46gZQZQV+Kl9oItvl1JZZqJKGr+oEkB08A6BzkiR7593/7IbtuncXHd2YoYeTsG4157ZssMu9KYvUHLcjcDoA==", + "dev": true, + "requires": { + "debug": "^4.1.0", + "handle-thing": "^2.0.0", + "http-deceiver": "^1.2.7", + "select-hose": "^2.0.0", + "spdy-transport": "^3.0.0" + } + }, + "spdy-transport": { + "version": "3.0.0", + "resolved": "https://registry.npmmirror.com/spdy-transport/-/spdy-transport-3.0.0.tgz", + "integrity": "sha512-hsLVFE5SjA6TCisWeJXFKniGGOpBgMLmerfO2aCyCU5s7nJ/rpAepqmFifv/GCbSbueEeAJJnmSQ2rKC/g8Fcw==", + "dev": true, + "requires": { + "debug": "^4.1.0", + "detect-node": "^2.0.4", + "hpack.js": "^2.1.6", + "obuf": "^1.1.2", + "readable-stream": "^3.0.6", + "wbuf": "^1.7.3" + }, + "dependencies": { + "readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmmirror.com/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + } + } + }, + "split-string": { + "version": "3.1.0", + "resolved": "https://registry.npmmirror.com/split-string/-/split-string-3.1.0.tgz", + "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", + "dev": true, + "requires": { + "extend-shallow": "^3.0.0" + } + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmmirror.com/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", + "dev": true + }, + "sshpk": { + "version": "1.18.0", + "resolved": "https://registry.npmmirror.com/sshpk/-/sshpk-1.18.0.tgz", + "integrity": "sha512-2p2KJZTSqQ/I3+HX42EpYOa2l3f8Erv8MWKsy2I9uf4wA7yFIkXRffYdsx86y6z4vHtV8u7g+pPlr8/4ouAxsQ==", + "dev": true, + "requires": { + "asn1": "~0.2.3", + "assert-plus": "^1.0.0", + "bcrypt-pbkdf": "^1.0.0", + "dashdash": "^1.12.0", + "ecc-jsbn": "~0.1.1", + "getpass": "^0.1.1", + "jsbn": "~0.1.0", + "safer-buffer": "^2.0.2", + "tweetnacl": "~0.14.0" + } + }, + "ssri": { + "version": "6.0.2", + "resolved": "https://registry.npmmirror.com/ssri/-/ssri-6.0.2.tgz", + "integrity": "sha512-cepbSq/neFK7xB6A50KHN0xHDotYzq58wWCa5LeWqnPrHG8GzfEjO/4O8kpmcGW+oaxkvhEJCWgbgNk4/ZV93Q==", + "dev": true, + "requires": { + "figgy-pudding": "^3.5.1" + } + }, + "stable": { + "version": "0.1.8", + "resolved": "https://registry.npmmirror.com/stable/-/stable-0.1.8.tgz", + "integrity": "sha512-ji9qxRnOVfcuLDySj9qzhGSEFVobyt1kIOSkj1qZzYLzq7Tos/oUUWvotUPQLlrsidqsK6tBH89Bc9kL5zHA6w==", + "dev": true + }, + "stackframe": { + "version": "1.3.4", + "resolved": "https://registry.npmmirror.com/stackframe/-/stackframe-1.3.4.tgz", + "integrity": "sha512-oeVtt7eWQS+Na6F//S4kJ2K2VbRlS9D43mAlMyVpVWovy9o+jfgH8O9agzANzaiLjclA0oYzUXEM4PurhSUChw==", + "dev": true + }, + "static-extend": { + "version": "0.1.2", + "resolved": "https://registry.npmmirror.com/static-extend/-/static-extend-0.1.2.tgz", + "integrity": "sha512-72E9+uLc27Mt718pMHt9VMNiAL4LMsmDbBva8mxWUCkT07fSzEGMYUCk0XWY6lp0j6RBAG4cJ3mWuZv2OE3s0g==", + "dev": true, + "requires": { + "define-property": "^0.2.5", + "object-copy": "^0.1.0" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmmirror.com/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha512-Rr7ADjQZenceVOAKop6ALkkRAmH1A4Gx9hV/7ZujPUN2rkATqFO0JZLZInbAjpZYoJ1gUx8MRMQVkYemcbMSTA==", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + } + } + }, + "statuses": { + "version": "2.0.1", + "resolved": "https://registry.npmmirror.com/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", + "dev": true + }, + "stream-browserify": { + "version": "2.0.2", + "resolved": "https://registry.npmmirror.com/stream-browserify/-/stream-browserify-2.0.2.tgz", + "integrity": "sha512-nX6hmklHs/gr2FuxYDltq8fJA1GDlxKQCz8O/IM4atRqBH8OORmBNgfvW5gG10GT/qQ9u0CzIvr2X5Pkt6ntqg==", + "dev": true, + "requires": { + "inherits": "~2.0.1", + "readable-stream": "^2.0.2" + } + }, + "stream-each": { + "version": "1.2.3", + "resolved": "https://registry.npmmirror.com/stream-each/-/stream-each-1.2.3.tgz", + "integrity": "sha512-vlMC2f8I2u/bZGqkdfLQW/13Zihpej/7PmSiMQsbYddxuTsJp8vRe2x2FvVExZg7FaOds43ROAuFJwPR4MTZLw==", + "dev": true, + "requires": { + "end-of-stream": "^1.1.0", + "stream-shift": "^1.0.0" + } + }, + "stream-http": { + "version": "2.8.3", + "resolved": "https://registry.npmmirror.com/stream-http/-/stream-http-2.8.3.tgz", + "integrity": "sha512-+TSkfINHDo4J+ZobQLWiMouQYB+UVYFttRA94FpEzzJ7ZdqcL4uUUQ7WkdkI4DSozGmgBUE/a47L+38PenXhUw==", + "dev": true, + "requires": { + "builtin-status-codes": "^3.0.0", + "inherits": "^2.0.1", + "readable-stream": "^2.3.6", + "to-arraybuffer": "^1.0.0", + "xtend": "^4.0.0" + } + }, + "stream-shift": { + "version": "1.0.3", + "resolved": "https://registry.npmmirror.com/stream-shift/-/stream-shift-1.0.3.tgz", + "integrity": "sha512-76ORR0DO1o1hlKwTbi/DM3EXWGf3ZJYO8cXX5RJwnul2DEg2oyoZyjLNoQM8WsvZiFKCRfC1O0J7iCvie3RZmQ==", + "dev": true + }, + "strict-uri-encode": { + "version": "1.1.0", + "resolved": "https://registry.npmmirror.com/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz", + "integrity": "sha512-R3f198pcvnB+5IpnBlRkphuE9n46WyVl8I39W/ZUTZLz4nqSP/oLYUrcnJrw462Ds8he4YKMov2efsTIw1BDGQ==", + "dev": true + }, + "string-argv": { + "version": "0.3.1", + "resolved": "https://registry.npmmirror.com/string-argv/-/string-argv-0.3.1.tgz", + "integrity": "sha512-a1uQGz7IyVy9YwhqjZIZu1c8JO8dNIe20xBmSS6qu9kv++k3JGzCVmprbNN5Kn+BgzD5E7YYwg1CcjuJMRNsvg==", + "dev": true + }, + "string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmmirror.com/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + } + }, + "string.prototype.trim": { + "version": "1.2.9", + "resolved": "https://registry.npmmirror.com/string.prototype.trim/-/string.prototype.trim-1.2.9.tgz", + "integrity": "sha512-klHuCNxiMZ8MlsOihJhJEBJAiMVqU3Z2nEXWfWnIqjN0gEFS9J9+IxKozWWtQGcgoa1WUZzLjKPTr4ZHNFTFxw==", + "dev": true, + "requires": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.0", + "es-object-atoms": "^1.0.0" + } + }, + "string.prototype.trimend": { + "version": "1.0.8", + "resolved": "https://registry.npmmirror.com/string.prototype.trimend/-/string.prototype.trimend-1.0.8.tgz", + "integrity": "sha512-p73uL5VCHCO2BZZ6krwwQE3kCzM7NKmis8S//xEC6fQonchbum4eP6kR4DLEjQFO3Wnj3Fuo8NM0kOSjVdHjZQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + } + }, + "string.prototype.trimstart": { + "version": "1.0.8", + "resolved": "https://registry.npmmirror.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.8.tgz", + "integrity": "sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg==", + "dev": true, + "requires": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmmirror.com/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmmirror.com/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + } + } + }, + "stringify-object": { + "version": "3.3.0", + "resolved": "https://registry.npmmirror.com/stringify-object/-/stringify-object-3.3.0.tgz", + "integrity": "sha512-rHqiFh1elqCQ9WPLIC8I0Q/g/wj5J1eMkyoiD6eoQApWHP0FtlK7rqnhmabL5VUY9JQCcqwwvlOaSuutekgyrw==", + "dev": true, + "requires": { + "get-own-enumerable-property-symbols": "^3.0.0", + "is-obj": "^1.0.1", + "is-regexp": "^1.0.0" + }, + "dependencies": { + "is-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmmirror.com/is-obj/-/is-obj-1.0.1.tgz", + "integrity": "sha512-l4RyHgRqGN4Y3+9JHVrNqO+tN0rV5My76uW5/nuO4K1b6vw5G8d/cmFjP9tRfEsdhZNt0IFdZuK/c2Vr4Nb+Qg==", + "dev": true + } + } + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmmirror.com/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.1" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmmirror.com/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true + } + } + }, + "strip-eof": { + "version": "1.0.0", + "resolved": "https://registry.npmmirror.com/strip-eof/-/strip-eof-1.0.0.tgz", + "integrity": "sha512-7FCwGGmx8mD5xQd3RPUvnSpUXHM3BWuzjtpD4TXsfcZ9EL4azvVVUscFYwD9nx8Kh+uCBC00XBtAykoMHwTh8Q==", + "dev": true + }, + "strip-final-newline": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/strip-final-newline/-/strip-final-newline-2.0.0.tgz", + "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", + "dev": true + }, + "strip-indent": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/strip-indent/-/strip-indent-2.0.0.tgz", + "integrity": "sha512-RsSNPLpq6YUL7QYy44RnPVTn/lcVZtb48Uof3X5JLbF4zD/Gs7ZFDv2HWol+leoQN2mT86LAzSshGfkTlSOpsA==", + "dev": true + }, + "strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmmirror.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true + }, + "stylehacks": { + "version": "4.0.3", + "resolved": "https://registry.npmmirror.com/stylehacks/-/stylehacks-4.0.3.tgz", + "integrity": "sha512-7GlLk9JwlElY4Y6a/rmbH2MhVlTyVmiJd1PfTCqFaIBEGMYNsrO/v3SeGTdhBThLg4Z+NbOk/qFMwCa+J+3p/g==", + "dev": true, + "requires": { + "browserslist": "^4.0.0", + "postcss": "^7.0.0", + "postcss-selector-parser": "^3.0.0" + }, + "dependencies": { + "picocolors": { + "version": "0.2.1", + "resolved": "https://registry.npmmirror.com/picocolors/-/picocolors-0.2.1.tgz", + "integrity": "sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA==", + "dev": true + }, + "postcss": { + "version": "7.0.39", + "resolved": "https://registry.npmmirror.com/postcss/-/postcss-7.0.39.tgz", + "integrity": "sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA==", + "dev": true, + "requires": { + "picocolors": "^0.2.1", + "source-map": "^0.6.1" + } + }, + "postcss-selector-parser": { + "version": "3.1.2", + "resolved": "https://registry.npmmirror.com/postcss-selector-parser/-/postcss-selector-parser-3.1.2.tgz", + "integrity": "sha512-h7fJ/5uWuRVyOtkO45pnt1Ih40CEleeyCHzipqAZO2e5H20g25Y48uYnFUiShvY4rZWNJ/Bib/KVPmanaCtOhA==", + "dev": true, + "requires": { + "dot-prop": "^5.2.0", + "indexes-of": "^1.0.1", + "uniq": "^1.0.1" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmmirror.com/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmmirror.com/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + }, + "supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmmirror.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true + }, + "svg-baker": { + "version": "1.7.0", + "resolved": "https://registry.npmmirror.com/svg-baker/-/svg-baker-1.7.0.tgz", + "integrity": "sha512-nibslMbkXOIkqKVrfcncwha45f97fGuAOn1G99YwnwTj8kF9YiM6XexPcUso97NxOm6GsP0SIvYVIosBis1xLg==", + "dev": true, + "requires": { + "bluebird": "^3.5.0", + "clone": "^2.1.1", + "he": "^1.1.1", + "image-size": "^0.5.1", + "loader-utils": "^1.1.0", + "merge-options": "1.0.1", + "micromatch": "3.1.0", + "postcss": "^5.2.17", + "postcss-prefix-selector": "^1.6.0", + "posthtml-rename-id": "^1.0", + "posthtml-svg-mode": "^1.0.3", + "query-string": "^4.3.2", + "traverse": "^0.6.6" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmmirror.com/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", + "dev": true + }, + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmmirror.com/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha512-kmCevFghRiWM7HB5zTPULl4r9bVFSWjz62MhqizDGUrq2NWuNMQyuv4tHHoKJHs69M/MF64lEcHdYIocrdWQYA==", + "dev": true + }, + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmmirror.com/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha512-U3lRVLMSlsCfjqYPbLyVv11M9CPW4I728d6TCKMAOJueEeB9/8o+eSsMnxPJD+Q+K909sdESg7C+tIkoH6on1A==", + "dev": true, + "requires": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + }, + "dependencies": { + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha512-KKNVtd6pCYgPIKU4cp2733HWYCpplQhddZLBUryaAHou723x+FRzQ5Df824Fj+IyyuiQTRoub4SnIFfIcrp70g==", + "dev": true + } + } + }, + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmmirror.com/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha512-cZTYKFWspt9jZsMscWo8sc/5lbPC9Q0N5nBLgb+Yd915iL3udB1uFgS3B8YCx66UVHq018DAVFoee7x+gxggeA==", + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmmirror.com/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "has-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmmirror.com/has-flag/-/has-flag-1.0.0.tgz", + "integrity": "sha512-DyYHfIYwAJmjAjSSPKANxI8bFY9YtFrgkAfinBojQ8YJTOuOuav64tMUJv584SES4xl74PmuaevIyaLESHdTAA==", + "dev": true + }, + "is-descriptor": { + "version": "1.0.3", + "resolved": "https://registry.npmmirror.com/is-descriptor/-/is-descriptor-1.0.3.tgz", + "integrity": "sha512-JCNNGbwWZEVaSPtS45mdtrneRWJFp07LLmykxeFV5F6oBvNF8vHSfJuJgoT472pSfk+Mf8VnlrspaFBHWM8JAw==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.1", + "is-data-descriptor": "^1.0.1" + } + }, + "json5": { + "version": "1.0.2", + "resolved": "https://registry.npmmirror.com/json5/-/json5-1.0.2.tgz", + "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", + "dev": true, + "requires": { + "minimist": "^1.2.0" + } + }, + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmmirror.com/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true + }, + "loader-utils": { + "version": "1.4.2", + "resolved": "https://registry.npmmirror.com/loader-utils/-/loader-utils-1.4.2.tgz", + "integrity": "sha512-I5d00Pd/jwMD2QCduo657+YM/6L3KZu++pmX9VFncxaxvHcru9jx1lBaFft+r4Mt2jK0Yhp41XlRAihzPxHNCg==", + "dev": true, + "requires": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^1.0.1" + } + }, + "micromatch": { + "version": "3.1.0", + "resolved": "https://registry.npmmirror.com/micromatch/-/micromatch-3.1.0.tgz", + "integrity": "sha512-3StSelAE+hnRvMs8IdVW7Uhk8CVed5tp+kLLGlBP6WiRAXS21GPGu/Nat4WNPXj2Eoc24B02SaeoyozPMfj0/g==", + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.2.2", + "define-property": "^1.0.0", + "extend-shallow": "^2.0.1", + "extglob": "^2.0.2", + "fragment-cache": "^0.2.1", + "kind-of": "^5.0.2", + "nanomatch": "^1.2.1", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + } + }, + "postcss": { + "version": "5.2.18", + "resolved": "https://registry.npmmirror.com/postcss/-/postcss-5.2.18.tgz", + "integrity": "sha512-zrUjRRe1bpXKsX1qAJNJjqZViErVuyEkMTRrwu4ud4sbTtIBRmtaYDrHmcGgmrbsW3MHfmtIf+vJumgQn+PrXg==", + "dev": true, + "requires": { + "chalk": "^1.1.3", + "js-base64": "^2.1.9", + "source-map": "^0.5.6", + "supports-color": "^3.2.3" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmmirror.com/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "supports-color": { + "version": "3.2.3", + "resolved": "https://registry.npmmirror.com/supports-color/-/supports-color-3.2.3.tgz", + "integrity": "sha512-Jds2VIYDrlp5ui7t8abHN2bjAu4LV/q4N2KivFPpGH0lrka0BMq/33AmECUXlKPcHigkNaqfXRENFju+rlcy+A==", + "dev": true, + "requires": { + "has-flag": "^1.0.0" + } + } + } + }, + "svg-baker-runtime": { + "version": "1.4.7", + "resolved": "https://registry.npmmirror.com/svg-baker-runtime/-/svg-baker-runtime-1.4.7.tgz", + "integrity": "sha512-Zorfwwj5+lWjk/oxwSMsRdS2sPQQdTmmsvaSpzU+i9ZWi3zugHLt6VckWfnswphQP0LmOel3nggpF5nETbt6xw==", + "dev": true, + "requires": { + "deepmerge": "1.3.2", + "mitt": "1.1.2", + "svg-baker": "^1.7.0" + }, + "dependencies": { + "deepmerge": { + "version": "1.3.2", + "resolved": "https://registry.npmmirror.com/deepmerge/-/deepmerge-1.3.2.tgz", + "integrity": "sha512-qjMjTrk+RKv/sp4RPDpV5CnKhxjFI9p+GkLBOls5A8EEElldYWCWA9zceAkmfd0xIo2aU1nxiaLFoiya2sb6Cg==", + "dev": true + } + } + }, + "svg-sprite-loader": { + "version": "5.1.1", + "resolved": "https://registry.npmmirror.com/svg-sprite-loader/-/svg-sprite-loader-5.1.1.tgz", + "integrity": "sha512-oRjDBw3AtZOb+XTx7XE3HcVju9RdnfdXttT3ZJB/vmWGJ+SM+xfXzh3yuVPIpySO8FjGhH5BtU63lGMI9WgYzA==", + "dev": true, + "requires": { + "bluebird": "^3.5.0", + "deepmerge": "1.3.2", + "domready": "1.0.8", + "escape-string-regexp": "1.0.5", + "html-webpack-plugin": "^3.2.0", + "loader-utils": "^1.1.0", + "svg-baker": "^1.5.0", + "svg-baker-runtime": "^1.4.7", + "url-slug": "2.0.0" + }, + "dependencies": { + "deepmerge": { + "version": "1.3.2", + "resolved": "https://registry.npmmirror.com/deepmerge/-/deepmerge-1.3.2.tgz", + "integrity": "sha512-qjMjTrk+RKv/sp4RPDpV5CnKhxjFI9p+GkLBOls5A8EEElldYWCWA9zceAkmfd0xIo2aU1nxiaLFoiya2sb6Cg==", + "dev": true + }, + "json5": { + "version": "1.0.2", + "resolved": "https://registry.npmmirror.com/json5/-/json5-1.0.2.tgz", + "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", + "dev": true, + "requires": { + "minimist": "^1.2.0" + } + }, + "loader-utils": { + "version": "1.4.2", + "resolved": "https://registry.npmmirror.com/loader-utils/-/loader-utils-1.4.2.tgz", + "integrity": "sha512-I5d00Pd/jwMD2QCduo657+YM/6L3KZu++pmX9VFncxaxvHcru9jx1lBaFft+r4Mt2jK0Yhp41XlRAihzPxHNCg==", + "dev": true, + "requires": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^1.0.1" + } + } + } + }, + "svg-tags": { + "version": "1.0.0", + "resolved": "https://registry.npmmirror.com/svg-tags/-/svg-tags-1.0.0.tgz", + "integrity": "sha512-ovssysQTa+luh7A5Weu3Rta6FJlFBBbInjOh722LIt6klpU2/HtdUbszju/G4devcvk8PGt7FCLv5wftu3THUA==", + "dev": true + }, + "svgo": { + "version": "1.3.2", + "resolved": "https://registry.npmmirror.com/svgo/-/svgo-1.3.2.tgz", + "integrity": "sha512-yhy/sQYxR5BkC98CY7o31VGsg014AKLEPxdfhora76l36hD9Rdy5NZA/Ocn6yayNPgSamYdtX2rFJdcv07AYVw==", + "dev": true, + "requires": { + "chalk": "^2.4.1", + "coa": "^2.0.2", + "css-select": "^2.0.0", + "css-select-base-adapter": "^0.1.1", + "css-tree": "1.0.0-alpha.37", + "csso": "^4.0.2", + "js-yaml": "^3.13.1", + "mkdirp": "~0.5.1", + "object.values": "^1.1.0", + "sax": "~1.2.4", + "stable": "^0.1.8", + "unquote": "~1.1.1", + "util.promisify": "~1.0.0" + }, + "dependencies": { + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmmirror.com/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "mkdirp": { + "version": "0.5.6", + "resolved": "https://registry.npmmirror.com/mkdirp/-/mkdirp-0.5.6.tgz", + "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", + "dev": true, + "requires": { + "minimist": "^1.2.6" + } + } + } + }, + "table": { + "version": "5.4.6", + "resolved": "https://registry.npmmirror.com/table/-/table-5.4.6.tgz", + "integrity": "sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug==", + "dev": true, + "requires": { + "ajv": "^6.10.2", + "lodash": "^4.17.14", + "slice-ansi": "^2.1.0", + "string-width": "^3.0.0" + }, + "dependencies": { + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmmirror.com/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==", + "dev": true + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmmirror.com/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmmirror.com/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + } + } + }, + "tapable": { + "version": "1.1.3", + "resolved": "https://registry.npmmirror.com/tapable/-/tapable-1.1.3.tgz", + "integrity": "sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA==", + "dev": true + }, + "tar": { + "version": "6.2.1", + "resolved": "https://registry.npmmirror.com/tar/-/tar-6.2.1.tgz", + "integrity": "sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==", + "dev": true, + "requires": { + "chownr": "^2.0.0", + "fs-minipass": "^2.0.0", + "minipass": "^5.0.0", + "minizlib": "^2.1.1", + "mkdirp": "^1.0.3", + "yallist": "^4.0.0" + }, + "dependencies": { + "chownr": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/chownr/-/chownr-2.0.0.tgz", + "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", + "dev": true + }, + "minipass": { + "version": "5.0.0", + "resolved": "https://registry.npmmirror.com/minipass/-/minipass-5.0.0.tgz", + "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", + "dev": true + }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmmirror.com/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + } + } + }, + "terser": { + "version": "4.8.1", + "resolved": "https://registry.npmmirror.com/terser/-/terser-4.8.1.tgz", + "integrity": "sha512-4GnLC0x667eJG0ewJTa6z/yXrbLGv80D9Ru6HIpCQmO+Q4PfEtBFi0ObSckqwL6VyQv/7ENJieXHo2ANmdQwgw==", + "dev": true, + "requires": { + "commander": "^2.20.0", + "source-map": "~0.6.1", + "source-map-support": "~0.5.12" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmmirror.com/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "terser-webpack-plugin": { + "version": "1.4.5", + "resolved": "https://registry.npmmirror.com/terser-webpack-plugin/-/terser-webpack-plugin-1.4.5.tgz", + "integrity": "sha512-04Rfe496lN8EYruwi6oPQkG0vo8C+HT49X687FZnpPF0qMAIHONI6HEXYPKDOE8e5HjXTyKfqRd/agHtH0kOtw==", + "dev": true, + "requires": { + "cacache": "^12.0.2", + "find-cache-dir": "^2.1.0", + "is-wsl": "^1.1.0", + "schema-utils": "^1.0.0", + "serialize-javascript": "^4.0.0", + "source-map": "^0.6.1", + "terser": "^4.1.2", + "webpack-sources": "^1.4.0", + "worker-farm": "^1.7.0" + }, + "dependencies": { + "find-cache-dir": { + "version": "2.1.0", + "resolved": "https://registry.npmmirror.com/find-cache-dir/-/find-cache-dir-2.1.0.tgz", + "integrity": "sha512-Tq6PixE0w/VMFfCgbONnkiQIVol/JJL7nRMi20fqzA4NRs9AfeqMGeRdPi3wIhYkxjeBaWh2rxwapn5Tu3IqOQ==", + "dev": true, + "requires": { + "commondir": "^1.0.1", + "make-dir": "^2.0.0", + "pkg-dir": "^3.0.0" + } + }, + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmmirror.com/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "requires": { + "locate-path": "^3.0.0" + } + }, + "locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmmirror.com/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "dev": true, + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + } + }, + "make-dir": { + "version": "2.1.0", + "resolved": "https://registry.npmmirror.com/make-dir/-/make-dir-2.1.0.tgz", + "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", + "dev": true, + "requires": { + "pify": "^4.0.1", + "semver": "^5.6.0" + } + }, + "p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmmirror.com/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "dev": true, + "requires": { + "p-limit": "^2.0.0" + } + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmmirror.com/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==", + "dev": true + }, + "pkg-dir": { + "version": "3.0.0", + "resolved": "https://registry.npmmirror.com/pkg-dir/-/pkg-dir-3.0.0.tgz", + "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==", + "dev": true, + "requires": { + "find-up": "^3.0.0" + } + }, + "schema-utils": { + "version": "1.0.0", + "resolved": "https://registry.npmmirror.com/schema-utils/-/schema-utils-1.0.0.tgz", + "integrity": "sha512-i27Mic4KovM/lnGsy8whRCHhc7VicJajAjTrYg11K9zfZXnYIt4k5F+kZkwjnrhKzLic/HLU4j11mjsz2G/75g==", + "dev": true, + "requires": { + "ajv": "^6.1.0", + "ajv-errors": "^1.0.0", + "ajv-keywords": "^3.1.0" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmmirror.com/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmmirror.com/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", + "dev": true + }, + "thenify": { + "version": "3.3.1", + "resolved": "https://registry.npmmirror.com/thenify/-/thenify-3.3.1.tgz", + "integrity": "sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==", + "dev": true, + "requires": { + "any-promise": "^1.0.0" + } + }, + "thenify-all": { + "version": "1.6.0", + "resolved": "https://registry.npmmirror.com/thenify-all/-/thenify-all-1.6.0.tgz", + "integrity": "sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==", + "dev": true, + "requires": { + "thenify": ">= 3.1.0 < 4" + } + }, + "thread-loader": { + "version": "2.1.3", + "resolved": "https://registry.npmmirror.com/thread-loader/-/thread-loader-2.1.3.tgz", + "integrity": "sha512-wNrVKH2Lcf8ZrWxDF/khdlLlsTMczdcwPA9VEK4c2exlEPynYWxi9op3nPTo5lAnDIkE0rQEB3VBP+4Zncc9Hg==", + "dev": true, + "requires": { + "loader-runner": "^2.3.1", + "loader-utils": "^1.1.0", + "neo-async": "^2.6.0" + }, + "dependencies": { + "json5": { + "version": "1.0.2", + "resolved": "https://registry.npmmirror.com/json5/-/json5-1.0.2.tgz", + "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", + "dev": true, + "requires": { + "minimist": "^1.2.0" + } + }, + "loader-utils": { + "version": "1.4.2", + "resolved": "https://registry.npmmirror.com/loader-utils/-/loader-utils-1.4.2.tgz", + "integrity": "sha512-I5d00Pd/jwMD2QCduo657+YM/6L3KZu++pmX9VFncxaxvHcru9jx1lBaFft+r4Mt2jK0Yhp41XlRAihzPxHNCg==", + "dev": true, + "requires": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^1.0.1" + } + } + } + }, + "throttle-debounce": { + "version": "1.1.0", + "resolved": "https://registry.npmmirror.com/throttle-debounce/-/throttle-debounce-1.1.0.tgz", + "integrity": "sha512-XH8UiPCQcWNuk2LYePibW/4qL97+ZQ1AN3FNXwZRBNPPowo/NRU5fAlDCSNBJIYCKbioZfuYtMhG4quqoJhVzg==" + }, + "through": { + "version": "2.3.8", + "resolved": "https://registry.npmmirror.com/through/-/through-2.3.8.tgz", + "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==", + "dev": true + }, + "through2": { + "version": "2.0.5", + "resolved": "https://registry.npmmirror.com/through2/-/through2-2.0.5.tgz", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", + "dev": true, + "requires": { + "readable-stream": "~2.3.6", + "xtend": "~4.0.1" + } + }, + "thunky": { + "version": "1.1.0", + "resolved": "https://registry.npmmirror.com/thunky/-/thunky-1.1.0.tgz", + "integrity": "sha512-eHY7nBftgThBqOyHGVN+l8gF0BucP09fMo0oO/Lb0w1OF80dJv+lDVpXG60WMQvkcxAkNybKsrEIE3ZtKGmPrA==", + "dev": true + }, + "timers-browserify": { + "version": "2.0.12", + "resolved": "https://registry.npmmirror.com/timers-browserify/-/timers-browserify-2.0.12.tgz", + "integrity": "sha512-9phl76Cqm6FhSX9Xe1ZUAMLtm1BLkKj2Qd5ApyWkXzsMRaA7dgr81kf4wJmQf/hAvg8EEyJxDo3du/0KlhPiKQ==", + "dev": true, + "requires": { + "setimmediate": "^1.0.4" + } + }, + "timsort": { + "version": "0.3.0", + "resolved": "https://registry.npmmirror.com/timsort/-/timsort-0.3.0.tgz", + "integrity": "sha512-qsdtZH+vMoCARQtyod4imc2nIJwg9Cc7lPRrw9CzF8ZKR0khdr8+2nX80PBhET3tcyTtJDxAffGh2rXH4tyU8A==", + "dev": true + }, + "tiny-emitter": { + "version": "2.1.0", + "resolved": "https://registry.npmmirror.com/tiny-emitter/-/tiny-emitter-2.1.0.tgz", + "integrity": "sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q==" + }, + "tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmmirror.com/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "dev": true, + "requires": { + "os-tmpdir": "~1.0.2" + } + }, + "to-arraybuffer": { + "version": "1.0.1", + "resolved": "https://registry.npmmirror.com/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz", + "integrity": "sha512-okFlQcoGTi4LQBG/PgSYblw9VOyptsz2KJZqc6qtgGdes8VktzUQkj4BI2blit072iS8VODNcMA+tvnS9dnuMA==", + "dev": true + }, + "to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==", + "dev": true + }, + "to-object-path": { + "version": "0.3.0", + "resolved": "https://registry.npmmirror.com/to-object-path/-/to-object-path-0.3.0.tgz", + "integrity": "sha512-9mWHdnGRuh3onocaHzukyvCZhzvr6tiflAy/JRFXcJX0TjgfWA9pk9t8CMbzmBE4Jfw58pXbkngtBtqYxzNEyg==", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmmirror.com/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "to-regex": { + "version": "3.0.2", + "resolved": "https://registry.npmmirror.com/to-regex/-/to-regex-3.0.2.tgz", + "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", + "dev": true, + "requires": { + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "regex-not": "^1.0.2", + "safe-regex": "^1.1.0" + } + }, + "to-regex-range": { + "version": "2.1.1", + "resolved": "https://registry.npmmirror.com/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha512-ZZWNfCjUokXXDGXFpZehJIkZqq91BcULFq/Pi7M5i4JnxXdhMKAK682z8bCW3o8Hj1wuuzoKcW3DfVzaP6VuNg==", + "dev": true, + "requires": { + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" + } + }, + "toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmmirror.com/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "dev": true + }, + "toposort": { + "version": "1.0.7", + "resolved": "https://registry.npmmirror.com/toposort/-/toposort-1.0.7.tgz", + "integrity": "sha512-FclLrw8b9bMWf4QlCJuHBEVhSRsqDj6u3nIjAzPeJvgl//1hBlffdlk0MALceL14+koWEdU4ofRAXofbODxQzg==", + "dev": true + }, + "tough-cookie": { + "version": "2.5.0", + "resolved": "https://registry.npmmirror.com/tough-cookie/-/tough-cookie-2.5.0.tgz", + "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", + "dev": true, + "requires": { + "psl": "^1.1.28", + "punycode": "^2.1.1" + } + }, + "traverse": { + "version": "0.6.9", + "resolved": "https://registry.npmmirror.com/traverse/-/traverse-0.6.9.tgz", + "integrity": "sha512-7bBrcF+/LQzSgFmT0X5YclVqQxtv7TDJ1f8Wj7ibBu/U6BMLeOpUxuZjV7rMc44UtKxlnMFigdhFAIszSX1DMg==", + "dev": true, + "requires": { + "gopd": "^1.0.1", + "typedarray.prototype.slice": "^1.0.3", + "which-typed-array": "^1.1.15" + } + }, + "tryer": { + "version": "1.0.1", + "resolved": "https://registry.npmmirror.com/tryer/-/tryer-1.0.1.tgz", + "integrity": "sha512-c3zayb8/kWWpycWYg87P71E1S1ZL6b6IJxfb5fvsUgsf0S2MVGaDhDXXjDMpdCpfWXqptc+4mXwmiy1ypXqRAA==", + "dev": true + }, + "ts-pnp": { + "version": "1.2.0", + "resolved": "https://registry.npmmirror.com/ts-pnp/-/ts-pnp-1.2.0.tgz", + "integrity": "sha512-csd+vJOb/gkzvcCHgTGSChYpy5f1/XKNsmvBGO4JXS+z1v2HobugDz4s1IeFXM3wZB44uczs+eazB5Q/ccdhQw==", + "dev": true + }, + "tslib": { + "version": "2.3.0", + "resolved": "https://registry.npmmirror.com/tslib/-/tslib-2.3.0.tgz", + "integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==" + }, + "tty-browserify": { + "version": "0.0.0", + "resolved": "https://registry.npmmirror.com/tty-browserify/-/tty-browserify-0.0.0.tgz", + "integrity": "sha512-JVa5ijo+j/sOoHGjw0sxw734b1LhBkQ3bvUGNdxnVXDCX81Yx7TFgnZygxrIIWn23hbfTaMYLwRmAxFyDuFmIw==", + "dev": true + }, + "tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmmirror.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==", + "dev": true, + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmmirror.com/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA==", + "dev": true + }, + "type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmmirror.com/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "requires": { + "prelude-ls": "^1.2.1" + } + }, + "type-fest": { + "version": "0.6.0", + "resolved": "https://registry.npmmirror.com/type-fest/-/type-fest-0.6.0.tgz", + "integrity": "sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==", + "dev": true + }, + "type-is": { + "version": "1.6.18", + "resolved": "https://registry.npmmirror.com/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "dev": true, + "requires": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + } + }, + "typed-array-buffer": { + "version": "1.0.2", + "resolved": "https://registry.npmmirror.com/typed-array-buffer/-/typed-array-buffer-1.0.2.tgz", + "integrity": "sha512-gEymJYKZtKXzzBzM4jqa9w6Q1Jjm7x2d+sh19AdsD4wqnMPDYyvwpsIc2Q/835kHuo3BEQ7CjelGhfTsoBb2MQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "is-typed-array": "^1.1.13" + } + }, + "typed-array-byte-length": { + "version": "1.0.1", + "resolved": "https://registry.npmmirror.com/typed-array-byte-length/-/typed-array-byte-length-1.0.1.tgz", + "integrity": "sha512-3iMJ9q0ao7WE9tWcaYKIptkNBuOIcZCCT0d4MRvuuH88fEoEH62IuQe0OtraD3ebQEoTRk8XCBoknUNc1Y67pw==", + "dev": true, + "requires": { + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13" + } + }, + "typed-array-byte-offset": { + "version": "1.0.2", + "resolved": "https://registry.npmmirror.com/typed-array-byte-offset/-/typed-array-byte-offset-1.0.2.tgz", + "integrity": "sha512-Ous0vodHa56FviZucS2E63zkgtgrACj7omjwd/8lTEMEPFFyjfixMZ1ZXenpgCFBBt4EC1J2XsyVS2gkG0eTFA==", + "dev": true, + "requires": { + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13" + } + }, + "typed-array-length": { + "version": "1.0.6", + "resolved": "https://registry.npmmirror.com/typed-array-length/-/typed-array-length-1.0.6.tgz", + "integrity": "sha512-/OxDN6OtAk5KBpGb28T+HZc2M+ADtvRxXrKKbUwtsLgdoxgX13hyy7ek6bFRl5+aBs2yZzB0c4CnQfAtVypW/g==", + "dev": true, + "requires": { + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13", + "possible-typed-array-names": "^1.0.0" + } + }, + "typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmmirror.com/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==", + "dev": true + }, + "typedarray.prototype.slice": { + "version": "1.0.3", + "resolved": "https://registry.npmmirror.com/typedarray.prototype.slice/-/typedarray.prototype.slice-1.0.3.tgz", + "integrity": "sha512-8WbVAQAUlENo1q3c3zZYuy5k9VzBQvp8AX9WOtbvyWlLM1v5JaSRmjubLjzHF4JFtptjH/5c/i95yaElvcjC0A==", + "dev": true, + "requires": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.0", + "es-errors": "^1.3.0", + "typed-array-buffer": "^1.0.2", + "typed-array-byte-offset": "^1.0.2" + } + }, + "uglify-js": { + "version": "3.4.10", + "resolved": "https://registry.npmmirror.com/uglify-js/-/uglify-js-3.4.10.tgz", + "integrity": "sha512-Y2VsbPVs0FIshJztycsO2SfPk7/KAF/T72qzv9u5EpQ4kB2hQoHlhNQTsNyy6ul7lQtqJN/AoWeS23OzEiEFxw==", + "dev": true, + "requires": { + "commander": "~2.19.0", + "source-map": "~0.6.1" + }, + "dependencies": { + "commander": { + "version": "2.19.0", + "resolved": "https://registry.npmmirror.com/commander/-/commander-2.19.0.tgz", + "integrity": "sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg==", + "dev": true + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmmirror.com/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "unbox-primitive": { + "version": "1.0.2", + "resolved": "https://registry.npmmirror.com/unbox-primitive/-/unbox-primitive-1.0.2.tgz", + "integrity": "sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "has-bigints": "^1.0.2", + "has-symbols": "^1.0.3", + "which-boxed-primitive": "^1.0.2" + } + }, + "undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmmirror.com/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true + }, + "unicode-canonical-property-names-ecmascript": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz", + "integrity": "sha512-yY5PpDlfVIU5+y/BSCxAJRBIS1Zc2dDG3Ujq+sR0U+JjUevW2JhocOF+soROYDSaAezOzOKuyyixhD6mBknSmQ==", + "dev": true + }, + "unicode-match-property-ecmascript": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-2.0.0.tgz", + "integrity": "sha512-5kaZCrbp5mmbz5ulBkDkbY0SsPOjKqVS35VpL9ulMPfSl0J0Xsm+9Evphv9CoIZFwre7aJoa94AY6seMKGVN5Q==", + "dev": true, + "requires": { + "unicode-canonical-property-names-ecmascript": "^2.0.0", + "unicode-property-aliases-ecmascript": "^2.0.0" + } + }, + "unicode-match-property-value-ecmascript": { + "version": "2.1.0", + "resolved": "https://registry.npmmirror.com/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-2.1.0.tgz", + "integrity": "sha512-qxkjQt6qjg/mYscYMC0XKRn3Rh0wFPlfxB0xkt9CfyTvpX1Ra0+rAmdX2QyAobptSEvuy4RtpPRui6XkV+8wjA==", + "dev": true + }, + "unicode-property-aliases-ecmascript": { + "version": "2.1.0", + "resolved": "https://registry.npmmirror.com/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-2.1.0.tgz", + "integrity": "sha512-6t3foTQI9qne+OZoVQB/8x8rk2k1eVy1gRXhV3oFQ5T6R1dqQ1xtin3XqSlx3+ATBkliTaR/hHyJBm+LVPNM8w==", + "dev": true + }, + "unidecode": { + "version": "0.1.8", + "resolved": "https://registry.npmmirror.com/unidecode/-/unidecode-0.1.8.tgz", + "integrity": "sha512-SdoZNxCWpN2tXTCrGkPF/0rL2HEq+i2gwRG1ReBvx8/0yTzC3enHfugOf8A9JBShVwwrRIkLX0YcDUGbzjbVCA==", + "dev": true + }, + "union-value": { + "version": "1.0.1", + "resolved": "https://registry.npmmirror.com/union-value/-/union-value-1.0.1.tgz", + "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==", + "dev": true, + "requires": { + "arr-union": "^3.1.0", + "get-value": "^2.0.6", + "is-extendable": "^0.1.1", + "set-value": "^2.0.1" + } + }, + "uniq": { + "version": "1.0.1", + "resolved": "https://registry.npmmirror.com/uniq/-/uniq-1.0.1.tgz", + "integrity": "sha512-Gw+zz50YNKPDKXs+9d+aKAjVwpjNwqzvNpLigIruT4HA9lMZNdMqs9x07kKHB/L9WRzqp4+DlTU5s4wG2esdoA==", + "dev": true + }, + "uniqs": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/uniqs/-/uniqs-2.0.0.tgz", + "integrity": "sha512-mZdDpf3vBV5Efh29kMw5tXoup/buMgxLzOt/XKFKcVmi+15ManNQWr6HfZ2aiZTYlYixbdNJ0KFmIZIv52tHSQ==", + "dev": true + }, + "unique-filename": { + "version": "1.1.1", + "resolved": "https://registry.npmmirror.com/unique-filename/-/unique-filename-1.1.1.tgz", + "integrity": "sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ==", + "dev": true, + "requires": { + "unique-slug": "^2.0.0" + } + }, + "unique-slug": { + "version": "2.0.2", + "resolved": "https://registry.npmmirror.com/unique-slug/-/unique-slug-2.0.2.tgz", + "integrity": "sha512-zoWr9ObaxALD3DOPfjPSqxt4fnZiWblxHIgeWqW8x7UqDzEtHEQLzji2cuJYQFCU6KmoJikOYAZlrTHHebjx2w==", + "dev": true, + "requires": { + "imurmurhash": "^0.1.4" + } + }, + "universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmmirror.com/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true + }, + "unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmmirror.com/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "dev": true + }, + "unquote": { + "version": "1.1.1", + "resolved": "https://registry.npmmirror.com/unquote/-/unquote-1.1.1.tgz", + "integrity": "sha512-vRCqFv6UhXpWxZPyGDh/F3ZpNv8/qo7w6iufLpQg9aKnQ71qM4B5KiI7Mia9COcjEhrO9LueHpMYjYzsWH3OIg==", + "dev": true + }, + "unset-value": { + "version": "1.0.0", + "resolved": "https://registry.npmmirror.com/unset-value/-/unset-value-1.0.0.tgz", + "integrity": "sha512-PcA2tsuGSF9cnySLHTLSh2qrQiJ70mn+r+Glzxv2TWZblxsxCC52BDlZoPCsz7STd9pN7EZetkWZBAvk4cgZdQ==", + "dev": true, + "requires": { + "has-value": "^0.3.1", + "isobject": "^3.0.0" + }, + "dependencies": { + "has-value": { + "version": "0.3.1", + "resolved": "https://registry.npmmirror.com/has-value/-/has-value-0.3.1.tgz", + "integrity": "sha512-gpG936j8/MzaeID5Yif+577c17TxaDmhuyVgSwtnL/q8UUTySg8Mecb+8Cf1otgLoD7DDH75axp86ER7LFsf3Q==", + "dev": true, + "requires": { + "get-value": "^2.0.3", + "has-values": "^0.1.4", + "isobject": "^2.0.0" + }, + "dependencies": { + "isobject": { + "version": "2.1.0", + "resolved": "https://registry.npmmirror.com/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha512-+OUdGJlgjOBZDfxnDjYYG6zp487z0JGNQq3cYQYg5f5hKR+syHMsaztzGeml/4kGG55CSpKSpWTY+jYGgsHLgA==", + "dev": true, + "requires": { + "isarray": "1.0.0" + } + } + } + }, + "has-values": { + "version": "0.1.4", + "resolved": "https://registry.npmmirror.com/has-values/-/has-values-0.1.4.tgz", + "integrity": "sha512-J8S0cEdWuQbqD9//tlZxiMuMNmxB8PlEwvYwuxsTmR1G5RXUePEX/SJn7aD0GMLieuZYSwNH0cQuJGwnYunXRQ==", + "dev": true + } + } + }, + "upath": { + "version": "1.2.0", + "resolved": "https://registry.npmmirror.com/upath/-/upath-1.2.0.tgz", + "integrity": "sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg==", + "dev": true + }, + "update-browserslist-db": { + "version": "1.0.16", + "resolved": "https://registry.npmmirror.com/update-browserslist-db/-/update-browserslist-db-1.0.16.tgz", + "integrity": "sha512-KVbTxlBYlckhF5wgfyZXTWnMn7MMZjMu9XG8bPlliUOP9ThaF4QnhP8qrjrH7DRzHfSk0oQv1wToW+iA5GajEQ==", + "dev": true, + "requires": { + "escalade": "^3.1.2", + "picocolors": "^1.0.1" + } + }, + "upper-case": { + "version": "1.1.3", + "resolved": "https://registry.npmmirror.com/upper-case/-/upper-case-1.1.3.tgz", + "integrity": "sha512-WRbjgmYzgXkCV7zNVpy5YgrHgbBv126rMALQQMrmzOVC4GM2waQ9x7xtm8VU+1yF2kWyPzI9zbZ48n4vSxwfSA==", + "dev": true + }, + "uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmmirror.com/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "requires": { + "punycode": "^2.1.0" + } + }, + "urix": { + "version": "0.1.0", + "resolved": "https://registry.npmmirror.com/urix/-/urix-0.1.0.tgz", + "integrity": "sha512-Am1ousAhSLBeB9cG/7k7r2R0zj50uDRlZHPGbazid5s9rlF1F/QKYObEKSIunSjIOkJZqwRRLpvewjEkM7pSqg==", + "dev": true + }, + "url": { + "version": "0.11.3", + "resolved": "https://registry.npmmirror.com/url/-/url-0.11.3.tgz", + "integrity": "sha512-6hxOLGfZASQK/cijlZnZJTq8OXAkt/3YGfQX45vvMYXpZoo8NdWZcY73K108Jf759lS1Bv/8wXnHDTSz17dSRw==", + "dev": true, + "requires": { + "punycode": "^1.4.1", + "qs": "^6.11.2" + }, + "dependencies": { + "punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmmirror.com/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha512-jmYNElW7yvO7TV33CjSmvSiE2yco3bV2czu/OzDKdMNVZQWfxCblURLhf+47syQRBntjfLdd/H0egrzIG+oaFQ==", + "dev": true + }, + "qs": { + "version": "6.12.1", + "resolved": "https://registry.npmmirror.com/qs/-/qs-6.12.1.tgz", + "integrity": "sha512-zWmv4RSuB9r2mYQw3zxQuHWeU+42aKi1wWig/j4ele4ygELZ7PEO6MM7rim9oAQH2A5MWfsAVf/jPvTPgCbvUQ==", + "dev": true, + "requires": { + "side-channel": "^1.0.6" + } + } + } + }, + "url-loader": { + "version": "2.3.0", + "resolved": "https://registry.npmmirror.com/url-loader/-/url-loader-2.3.0.tgz", + "integrity": "sha512-goSdg8VY+7nPZKUEChZSEtW5gjbS66USIGCeSJ1OVOJ7Yfuh/36YxCwMi5HVEJh6mqUYOoy3NJ0vlOMrWsSHog==", + "dev": true, + "requires": { + "loader-utils": "^1.2.3", + "mime": "^2.4.4", + "schema-utils": "^2.5.0" + }, + "dependencies": { + "json5": { + "version": "1.0.2", + "resolved": "https://registry.npmmirror.com/json5/-/json5-1.0.2.tgz", + "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", + "dev": true, + "requires": { + "minimist": "^1.2.0" + } + }, + "loader-utils": { + "version": "1.4.2", + "resolved": "https://registry.npmmirror.com/loader-utils/-/loader-utils-1.4.2.tgz", + "integrity": "sha512-I5d00Pd/jwMD2QCduo657+YM/6L3KZu++pmX9VFncxaxvHcru9jx1lBaFft+r4Mt2jK0Yhp41XlRAihzPxHNCg==", + "dev": true, + "requires": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^1.0.1" + } + } + } + }, + "url-parse": { + "version": "1.5.10", + "resolved": "https://registry.npmmirror.com/url-parse/-/url-parse-1.5.10.tgz", + "integrity": "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==", + "dev": true, + "requires": { + "querystringify": "^2.1.1", + "requires-port": "^1.0.0" + } + }, + "url-slug": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/url-slug/-/url-slug-2.0.0.tgz", + "integrity": "sha512-aiNmSsVgrjCiJ2+KWPferjT46YFKoE8i0YX04BlMVDue022Xwhg/zYlnZ6V9/mP3p8Wj7LEp0myiTkC/p6sxew==", + "dev": true, + "requires": { + "unidecode": "0.1.8" + } + }, + "use": { + "version": "3.1.1", + "resolved": "https://registry.npmmirror.com/use/-/use-3.1.1.tgz", + "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", + "dev": true + }, + "util": { + "version": "0.11.1", + "resolved": "https://registry.npmmirror.com/util/-/util-0.11.1.tgz", + "integrity": "sha512-HShAsny+zS2TZfaXxD9tYj4HQGlBezXZMZuM/S5PKLLoZkShZiGk9o5CzukI1LVHZvjdvZ2Sj1aW/Ndn2NB/HQ==", + "dev": true, + "requires": { + "inherits": "2.0.3" + }, + "dependencies": { + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmmirror.com/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha512-x00IRNXNy63jwGkJmzPigoySHbaqpNuzKbBOmzK+g2OdZpQ9w+sxCN+VSB3ja7IAge2OP2qpfxTjeNcyjmW1uw==", + "dev": true + } + } + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmmirror.com/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "dev": true + }, + "util.promisify": { + "version": "1.0.1", + "resolved": "https://registry.npmmirror.com/util.promisify/-/util.promisify-1.0.1.tgz", + "integrity": "sha512-g9JpC/3He3bm38zsLupWryXHoEcS22YHthuPQSJdMy6KNrzIRzWqcsHzD/WUnqe45whVou4VIsPew37DoXWNrA==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.2", + "has-symbols": "^1.0.1", + "object.getownpropertydescriptors": "^2.1.0" + } + }, + "utila": { + "version": "0.4.0", + "resolved": "https://registry.npmmirror.com/utila/-/utila-0.4.0.tgz", + "integrity": "sha512-Z0DbgELS9/L/75wZbro8xAnT50pBVFQZ+hUEueGDU5FN51YSCYM+jdxsfCiHjwNP/4LCDD0i/graKpeBnOXKRA==", + "dev": true + }, + "utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmmirror.com/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", + "dev": true + }, + "uuid": { + "version": "3.4.0", + "resolved": "https://registry.npmmirror.com/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", + "dev": true + }, + "v8-compile-cache": { + "version": "2.4.0", + "resolved": "https://registry.npmmirror.com/v8-compile-cache/-/v8-compile-cache-2.4.0.tgz", + "integrity": "sha512-ocyWc3bAHBB/guyqJQVI5o4BZkPhznPYUG2ea80Gond/BgNWpap8TOmLSeeQG7bnh2KMISxskdADG59j7zruhw==", + "dev": true + }, + "validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmmirror.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dev": true, + "requires": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "vary": { + "version": "1.1.2", + "resolved": "https://registry.npmmirror.com/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", + "dev": true + }, + "vendors": { + "version": "1.0.4", + "resolved": "https://registry.npmmirror.com/vendors/-/vendors-1.0.4.tgz", + "integrity": "sha512-/juG65kTL4Cy2su4P8HjtkTxk6VmJDiOPBufWniqQ6wknac6jNiXS9vU+hO3wgusiyqWlzTbVHi0dyJqRONg3w==", + "dev": true + }, + "verror": { + "version": "1.10.0", + "resolved": "https://registry.npmmirror.com/verror/-/verror-1.10.0.tgz", + "integrity": "sha512-ZZKSmDAEFOijERBLkmYfJ+vmk3w+7hOLYDNkRCuRuMJGEmqYNCNLyBBFwWKVMhfwaEF3WOd0Zlw86U/WC/+nYw==", + "dev": true, + "requires": { + "assert-plus": "^1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "^1.2.0" + } + }, + "vm-browserify": { + "version": "1.1.2", + "resolved": "https://registry.npmmirror.com/vm-browserify/-/vm-browserify-1.1.2.tgz", + "integrity": "sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ==", + "dev": true + }, + "vue": { + "version": "2.6.12", + "resolved": "https://registry.npmmirror.com/vue/-/vue-2.6.12.tgz", + "integrity": "sha512-uhmLFETqPPNyuLLbsKz6ioJ4q7AZHzD8ZVFNATNyICSZouqP2Sz0rotWQC8UNBF6VGSCs5abnKJoStA6JbCbfg==" + }, + "vue-count-to": { + "version": "1.0.13", + "resolved": "https://registry.npmmirror.com/vue-count-to/-/vue-count-to-1.0.13.tgz", + "integrity": "sha512-6R4OVBVNtQTlcbXu6SJ8ENR35M2/CdWt3Jmv57jOUM+1ojiFmjVGvZPH8DfHpMDSA+ITs+EW5V6qthADxeyYOQ==" + }, + "vue-cropper": { + "version": "0.5.5", + "resolved": "https://registry.npmmirror.com/vue-cropper/-/vue-cropper-0.5.5.tgz", + "integrity": "sha512-5mGaBlS1EwLxUFwHHX2Q8zOZSiVfBUjOfolR+ZNKwu7Rh3u+GhwHYOyFkgZHhhoQBBNdyVB28O6W+MpMimhCbA==" + }, + "vue-eslint-parser": { + "version": "7.11.0", + "resolved": "https://registry.npmmirror.com/vue-eslint-parser/-/vue-eslint-parser-7.11.0.tgz", + "integrity": "sha512-qh3VhDLeh773wjgNTl7ss0VejY9bMMa0GoDG2fQVyDzRFdiU3L7fw74tWZDHNQXdZqxO3EveQroa9ct39D2nqg==", + "dev": true, + "requires": { + "debug": "^4.1.1", + "eslint-scope": "^5.1.1", + "eslint-visitor-keys": "^1.1.0", + "espree": "^6.2.1", + "esquery": "^1.4.0", + "lodash": "^4.17.21", + "semver": "^6.3.0" + }, + "dependencies": { + "acorn": { + "version": "7.4.1", + "resolved": "https://registry.npmmirror.com/acorn/-/acorn-7.4.1.tgz", + "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", + "dev": true + }, + "eslint-scope": { + "version": "5.1.1", + "resolved": "https://registry.npmmirror.com/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "dev": true, + "requires": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + } + }, + "espree": { + "version": "6.2.1", + "resolved": "https://registry.npmmirror.com/espree/-/espree-6.2.1.tgz", + "integrity": "sha512-ysCxRQY3WaXJz9tdbWOwuWr5Y/XrPTGX9Kiz3yoUXwW0VZ4w30HTkQLaGx/+ttFjF8i+ACbArnB4ce68a9m5hw==", + "dev": true, + "requires": { + "acorn": "^7.1.1", + "acorn-jsx": "^5.2.0", + "eslint-visitor-keys": "^1.1.0" + } + }, + "semver": { + "version": "6.3.1", + "resolved": "https://registry.npmmirror.com/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true + } + } + }, + "vue-hot-reload-api": { + "version": "2.3.4", + "resolved": "https://registry.npmmirror.com/vue-hot-reload-api/-/vue-hot-reload-api-2.3.4.tgz", + "integrity": "sha512-BXq3jwIagosjgNVae6tkHzzIk6a8MHFtzAdwhnV5VlvPTFxDCvIttgSiHWjdGoTJvXtmRu5HacExfdarRcFhog==", + "dev": true + }, + "vue-loader": { + "version": "15.11.1", + "resolved": "https://registry.npmmirror.com/vue-loader/-/vue-loader-15.11.1.tgz", + "integrity": "sha512-0iw4VchYLePqJfJu9s62ACWUXeSqM30SQqlIftbYWM3C+jpPcEHKSPUZBLjSF9au4HTHQ/naF6OGnO3Q/qGR3Q==", + "dev": true, + "requires": { + "@vue/component-compiler-utils": "^3.1.0", + "hash-sum": "^1.0.2", + "loader-utils": "^1.1.0", + "vue-hot-reload-api": "^2.3.0", + "vue-style-loader": "^4.1.0" + }, + "dependencies": { + "hash-sum": { + "version": "1.0.2", + "resolved": "https://registry.npmmirror.com/hash-sum/-/hash-sum-1.0.2.tgz", + "integrity": "sha512-fUs4B4L+mlt8/XAtSOGMUO1TXmAelItBPtJG7CyHJfYTdDjwisntGO2JQz7oUsatOY9o68+57eziUVNw/mRHmA==", + "dev": true + }, + "json5": { + "version": "1.0.2", + "resolved": "https://registry.npmmirror.com/json5/-/json5-1.0.2.tgz", + "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", + "dev": true, + "requires": { + "minimist": "^1.2.0" + } + }, + "loader-utils": { + "version": "1.4.2", + "resolved": "https://registry.npmmirror.com/loader-utils/-/loader-utils-1.4.2.tgz", + "integrity": "sha512-I5d00Pd/jwMD2QCduo657+YM/6L3KZu++pmX9VFncxaxvHcru9jx1lBaFft+r4Mt2jK0Yhp41XlRAihzPxHNCg==", + "dev": true, + "requires": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^1.0.1" + } + } + } + }, + "vue-meta": { + "version": "2.4.0", + "resolved": "https://registry.npmmirror.com/vue-meta/-/vue-meta-2.4.0.tgz", + "integrity": "sha512-XEeZUmlVeODclAjCNpWDnjgw+t3WA6gdzs6ENoIAgwO1J1d5p1tezDhtteLUFwcaQaTtayRrsx7GL6oXp/m2Jw==", + "requires": { + "deepmerge": "^4.2.2" + }, + "dependencies": { + "deepmerge": { + "version": "4.3.1", + "resolved": "https://registry.npmmirror.com/deepmerge/-/deepmerge-4.3.1.tgz", + "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==" + } + } + }, + "vue-router": { + "version": "3.4.9", + "resolved": "https://registry.npmmirror.com/vue-router/-/vue-router-3.4.9.tgz", + "integrity": "sha512-CGAKWN44RqXW06oC+u4mPgHLQQi2t6vLD/JbGRDAXm0YpMv0bgpKuU5bBd7AvMgfTz9kXVRIWKHqRwGEb8xFkA==" + }, + "vue-style-loader": { + "version": "4.1.3", + "resolved": "https://registry.npmmirror.com/vue-style-loader/-/vue-style-loader-4.1.3.tgz", + "integrity": "sha512-sFuh0xfbtpRlKfm39ss/ikqs9AbKCoXZBpHeVZ8Tx650o0k0q/YCM7FRvigtxpACezfq6af+a7JeqVTWvncqDg==", + "dev": true, + "requires": { + "hash-sum": "^1.0.2", + "loader-utils": "^1.0.2" + }, + "dependencies": { + "hash-sum": { + "version": "1.0.2", + "resolved": "https://registry.npmmirror.com/hash-sum/-/hash-sum-1.0.2.tgz", + "integrity": "sha512-fUs4B4L+mlt8/XAtSOGMUO1TXmAelItBPtJG7CyHJfYTdDjwisntGO2JQz7oUsatOY9o68+57eziUVNw/mRHmA==", + "dev": true + }, + "json5": { + "version": "1.0.2", + "resolved": "https://registry.npmmirror.com/json5/-/json5-1.0.2.tgz", + "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", + "dev": true, + "requires": { + "minimist": "^1.2.0" + } + }, + "loader-utils": { + "version": "1.4.2", + "resolved": "https://registry.npmmirror.com/loader-utils/-/loader-utils-1.4.2.tgz", + "integrity": "sha512-I5d00Pd/jwMD2QCduo657+YM/6L3KZu++pmX9VFncxaxvHcru9jx1lBaFft+r4Mt2jK0Yhp41XlRAihzPxHNCg==", + "dev": true, + "requires": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^1.0.1" + } + } + } + }, + "vue-template-compiler": { + "version": "2.6.12", + "resolved": "https://registry.npmmirror.com/vue-template-compiler/-/vue-template-compiler-2.6.12.tgz", + "integrity": "sha512-OzzZ52zS41YUbkCBfdXShQTe69j1gQDZ9HIX8miuC9C3rBCk9wIRjLiZZLrmX9V+Ftq/YEyv1JaVr5Y/hNtByg==", + "dev": true, + "requires": { + "de-indent": "^1.0.2", + "he": "^1.1.0" + } + }, + "vue-template-es2015-compiler": { + "version": "1.9.1", + "resolved": "https://registry.npmmirror.com/vue-template-es2015-compiler/-/vue-template-es2015-compiler-1.9.1.tgz", + "integrity": "sha512-4gDntzrifFnCEvyoO8PqyJDmguXgVPxKiIxrBKjIowvL9l+N66196+72XVYR8BBf1Uv1Fgt3bGevJ+sEmxfZzw==", + "dev": true + }, + "vuedraggable": { + "version": "2.24.3", + "resolved": "https://registry.npmmirror.com/vuedraggable/-/vuedraggable-2.24.3.tgz", + "integrity": "sha512-6/HDXi92GzB+Hcs9fC6PAAozK1RLt1ewPTLjK0anTYguXLAeySDmcnqE8IC0xa7shvSzRjQXq3/+dsZ7ETGF3g==", + "requires": { + "sortablejs": "1.10.2" + } + }, + "vuex": { + "version": "3.6.0", + "resolved": "https://registry.npmmirror.com/vuex/-/vuex-3.6.0.tgz", + "integrity": "sha512-W74OO2vCJPs9/YjNjW8lLbj+jzT24waTo2KShI8jLvJW8OaIkgb3wuAMA7D+ZiUxDOx3ubwSZTaJBip9G8a3aQ==" + }, + "watch-size": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/watch-size/-/watch-size-2.0.0.tgz", + "integrity": "sha512-M92R89dNoTPWyCD+HuUEDdhaDnh9jxPGOwlDc0u51jAgmjUvzqaEMynXSr3BaWs+QdHYk4KzibPy1TFtjLmOZQ==" + }, + "watchpack": { + "version": "1.7.5", + "resolved": "https://registry.npmmirror.com/watchpack/-/watchpack-1.7.5.tgz", + "integrity": "sha512-9P3MWk6SrKjHsGkLT2KHXdQ/9SNkyoJbabxnKOoJepsvJjJG8uYTR3yTPxPQvNDI3w4Nz1xnE0TLHK4RIVe/MQ==", + "dev": true, + "requires": { + "chokidar": "^3.4.1", + "graceful-fs": "^4.1.2", + "neo-async": "^2.5.0", + "watchpack-chokidar2": "^2.0.1" + } + }, + "watchpack-chokidar2": { + "version": "2.0.1", + "resolved": "https://registry.npmmirror.com/watchpack-chokidar2/-/watchpack-chokidar2-2.0.1.tgz", + "integrity": "sha512-nCFfBIPKr5Sh61s4LPpy1Wtfi0HE8isJ3d2Yb5/Ppw2P2B/3eVSEBjKfN0fmHJSK14+31KwMKmcrzs2GM4P0Ww==", + "dev": true, + "optional": true, + "requires": { + "chokidar": "^2.1.8" + }, + "dependencies": { + "anymatch": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/anymatch/-/anymatch-2.0.0.tgz", + "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", + "dev": true, + "optional": true, + "requires": { + "micromatch": "^3.1.4", + "normalize-path": "^2.1.1" + }, + "dependencies": { + "normalize-path": { + "version": "2.1.1", + "resolved": "https://registry.npmmirror.com/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha512-3pKJwH184Xo/lnH6oyP1q2pMd7HcypqqmRs91/6/i2CGtWwIKGCkOOMTm/zXbgTEWHw1uNpNi/igc3ePOYHb6w==", + "dev": true, + "optional": true, + "requires": { + "remove-trailing-separator": "^1.0.1" + } + } + } + }, + "binary-extensions": { + "version": "1.13.1", + "resolved": "https://registry.npmmirror.com/binary-extensions/-/binary-extensions-1.13.1.tgz", + "integrity": "sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw==", + "dev": true, + "optional": true + }, + "chokidar": { + "version": "2.1.8", + "resolved": "https://registry.npmmirror.com/chokidar/-/chokidar-2.1.8.tgz", + "integrity": "sha512-ZmZUazfOzf0Nve7duiCKD23PFSCs4JPoYyccjUFF3aQkQadqBhfzhjkwBH2mNOG9cTBwhamM37EIsIkZw3nRgg==", + "dev": true, + "optional": true, + "requires": { + "anymatch": "^2.0.0", + "async-each": "^1.0.1", + "braces": "^2.3.2", + "fsevents": "^1.2.7", + "glob-parent": "^3.1.0", + "inherits": "^2.0.3", + "is-binary-path": "^1.0.0", + "is-glob": "^4.0.0", + "normalize-path": "^3.0.0", + "path-is-absolute": "^1.0.0", + "readdirp": "^2.2.1", + "upath": "^1.1.1" + } + }, + "fsevents": { + "version": "1.2.13", + "resolved": "https://registry.npmmirror.com/fsevents/-/fsevents-1.2.13.tgz", + "integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==", + "dev": true, + "optional": true + }, + "glob-parent": { + "version": "3.1.0", + "resolved": "https://registry.npmmirror.com/glob-parent/-/glob-parent-3.1.0.tgz", + "integrity": "sha512-E8Ak/2+dZY6fnzlR7+ueWvhsH1SjHr4jjss4YS/h4py44jY9MhK/VFdaZJAWDz6BbL21KeteKxFSFpq8OS5gVA==", + "dev": true, + "optional": true, + "requires": { + "is-glob": "^3.1.0", + "path-dirname": "^1.0.0" + }, + "dependencies": { + "is-glob": { + "version": "3.1.0", + "resolved": "https://registry.npmmirror.com/is-glob/-/is-glob-3.1.0.tgz", + "integrity": "sha512-UFpDDrPgM6qpnFNI+rh/p3bUaq9hKLZN8bMUWzxmcnZVS3omf4IPK+BrewlnWjO1WmUsMYuSjKh4UJuV4+Lqmw==", + "dev": true, + "optional": true, + "requires": { + "is-extglob": "^2.1.0" + } + } + } + }, + "is-binary-path": { + "version": "1.0.1", + "resolved": "https://registry.npmmirror.com/is-binary-path/-/is-binary-path-1.0.1.tgz", + "integrity": "sha512-9fRVlXc0uCxEDj1nQzaWONSpbTfx0FmJfzHF7pwlI8DkWGoHBBea4Pg5Ky0ojwwxQmnSifgbKkI06Qv0Ljgj+Q==", + "dev": true, + "optional": true, + "requires": { + "binary-extensions": "^1.0.0" + } + }, + "readdirp": { + "version": "2.2.1", + "resolved": "https://registry.npmmirror.com/readdirp/-/readdirp-2.2.1.tgz", + "integrity": "sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==", + "dev": true, + "optional": true, + "requires": { + "graceful-fs": "^4.1.11", + "micromatch": "^3.1.10", + "readable-stream": "^2.0.2" + } + } + } + }, + "wbuf": { + "version": "1.7.3", + "resolved": "https://registry.npmmirror.com/wbuf/-/wbuf-1.7.3.tgz", + "integrity": "sha512-O84QOnr0icsbFGLS0O3bI5FswxzRr8/gHwWkDlQFskhSPryQXvrTMxjxGP4+iWYoauLoBvfDpkrOauZ+0iZpDA==", + "dev": true, + "requires": { + "minimalistic-assert": "^1.0.0" + } + }, + "wcwidth": { + "version": "1.0.1", + "resolved": "https://registry.npmmirror.com/wcwidth/-/wcwidth-1.0.1.tgz", + "integrity": "sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==", + "dev": true, + "requires": { + "defaults": "^1.0.3" + } + }, + "webpack": { + "version": "4.47.0", + "resolved": "https://registry.npmmirror.com/webpack/-/webpack-4.47.0.tgz", + "integrity": "sha512-td7fYwgLSrky3fI1EuU5cneU4+pbH6GgOfuKNS1tNPcfdGinGELAqsb/BP4nnvZyKSG2i/xFGU7+n2PvZA8HJQ==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.9.0", + "@webassemblyjs/helper-module-context": "1.9.0", + "@webassemblyjs/wasm-edit": "1.9.0", + "@webassemblyjs/wasm-parser": "1.9.0", + "acorn": "^6.4.1", + "ajv": "^6.10.2", + "ajv-keywords": "^3.4.1", + "chrome-trace-event": "^1.0.2", + "enhanced-resolve": "^4.5.0", + "eslint-scope": "^4.0.3", + "json-parse-better-errors": "^1.0.2", + "loader-runner": "^2.4.0", + "loader-utils": "^1.2.3", + "memory-fs": "^0.4.1", + "micromatch": "^3.1.10", + "mkdirp": "^0.5.3", + "neo-async": "^2.6.1", + "node-libs-browser": "^2.2.1", + "schema-utils": "^1.0.0", + "tapable": "^1.1.3", + "terser-webpack-plugin": "^1.4.3", + "watchpack": "^1.7.4", + "webpack-sources": "^1.4.1" + }, + "dependencies": { + "json5": { + "version": "1.0.2", + "resolved": "https://registry.npmmirror.com/json5/-/json5-1.0.2.tgz", + "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", + "dev": true, + "requires": { + "minimist": "^1.2.0" + } + }, + "loader-utils": { + "version": "1.4.2", + "resolved": "https://registry.npmmirror.com/loader-utils/-/loader-utils-1.4.2.tgz", + "integrity": "sha512-I5d00Pd/jwMD2QCduo657+YM/6L3KZu++pmX9VFncxaxvHcru9jx1lBaFft+r4Mt2jK0Yhp41XlRAihzPxHNCg==", + "dev": true, + "requires": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^1.0.1" + } + }, + "mkdirp": { + "version": "0.5.6", + "resolved": "https://registry.npmmirror.com/mkdirp/-/mkdirp-0.5.6.tgz", + "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", + "dev": true, + "requires": { + "minimist": "^1.2.6" + } + }, + "schema-utils": { + "version": "1.0.0", + "resolved": "https://registry.npmmirror.com/schema-utils/-/schema-utils-1.0.0.tgz", + "integrity": "sha512-i27Mic4KovM/lnGsy8whRCHhc7VicJajAjTrYg11K9zfZXnYIt4k5F+kZkwjnrhKzLic/HLU4j11mjsz2G/75g==", + "dev": true, + "requires": { + "ajv": "^6.1.0", + "ajv-errors": "^1.0.0", + "ajv-keywords": "^3.1.0" + } + } + } + }, + "webpack-bundle-analyzer": { + "version": "3.9.0", + "resolved": "https://registry.npmmirror.com/webpack-bundle-analyzer/-/webpack-bundle-analyzer-3.9.0.tgz", + "integrity": "sha512-Ob8amZfCm3rMB1ScjQVlbYYUEJyEjdEtQ92jqiFUYt5VkEeO2v5UMbv49P/gnmCZm3A6yaFQzCBvpZqN4MUsdA==", + "dev": true, + "requires": { + "acorn": "^7.1.1", + "acorn-walk": "^7.1.1", + "bfj": "^6.1.1", + "chalk": "^2.4.1", + "commander": "^2.18.0", + "ejs": "^2.6.1", + "express": "^4.16.3", + "filesize": "^3.6.1", + "gzip-size": "^5.0.0", + "lodash": "^4.17.19", + "mkdirp": "^0.5.1", + "opener": "^1.5.1", + "ws": "^6.0.0" + }, + "dependencies": { + "acorn": { + "version": "7.4.1", + "resolved": "https://registry.npmmirror.com/acorn/-/acorn-7.4.1.tgz", + "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", + "dev": true + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmmirror.com/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "mkdirp": { + "version": "0.5.6", + "resolved": "https://registry.npmmirror.com/mkdirp/-/mkdirp-0.5.6.tgz", + "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", + "dev": true, + "requires": { + "minimist": "^1.2.6" + } + } + } + }, + "webpack-chain": { + "version": "6.5.1", + "resolved": "https://registry.npmmirror.com/webpack-chain/-/webpack-chain-6.5.1.tgz", + "integrity": "sha512-7doO/SRtLu8q5WM0s7vPKPWX580qhi0/yBHkOxNkv50f6qB76Zy9o2wRTrrPULqYTvQlVHuvbA8v+G5ayuUDsA==", + "dev": true, + "requires": { + "deepmerge": "^1.5.2", + "javascript-stringify": "^2.0.1" + } + }, + "webpack-dev-middleware": { + "version": "3.7.3", + "resolved": "https://registry.npmmirror.com/webpack-dev-middleware/-/webpack-dev-middleware-3.7.3.tgz", + "integrity": "sha512-djelc/zGiz9nZj/U7PTBi2ViorGJXEWo/3ltkPbDyxCXhhEXkW0ce99falaok4TPj+AsxLiXJR0EBOb0zh9fKQ==", + "dev": true, + "requires": { + "memory-fs": "^0.4.1", + "mime": "^2.4.4", + "mkdirp": "^0.5.1", + "range-parser": "^1.2.1", + "webpack-log": "^2.0.0" + }, + "dependencies": { + "mkdirp": { + "version": "0.5.6", + "resolved": "https://registry.npmmirror.com/mkdirp/-/mkdirp-0.5.6.tgz", + "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", + "dev": true, + "requires": { + "minimist": "^1.2.6" + } + } + } + }, + "webpack-dev-server": { + "version": "3.11.3", + "resolved": "https://registry.npmmirror.com/webpack-dev-server/-/webpack-dev-server-3.11.3.tgz", + "integrity": "sha512-3x31rjbEQWKMNzacUZRE6wXvUFuGpH7vr0lIEbYpMAG9BOxi0928QU1BBswOAP3kg3H1O4hiS+sq4YyAn6ANnA==", + "dev": true, + "requires": { + "ansi-html-community": "0.0.8", + "bonjour": "^3.5.0", + "chokidar": "^2.1.8", + "compression": "^1.7.4", + "connect-history-api-fallback": "^1.6.0", + "debug": "^4.1.1", + "del": "^4.1.1", + "express": "^4.17.1", + "html-entities": "^1.3.1", + "http-proxy-middleware": "0.19.1", + "import-local": "^2.0.0", + "internal-ip": "^4.3.0", + "ip": "^1.1.5", + "is-absolute-url": "^3.0.3", + "killable": "^1.0.1", + "loglevel": "^1.6.8", + "opn": "^5.5.0", + "p-retry": "^3.0.1", + "portfinder": "^1.0.26", + "schema-utils": "^1.0.0", + "selfsigned": "^1.10.8", + "semver": "^6.3.0", + "serve-index": "^1.9.1", + "sockjs": "^0.3.21", + "sockjs-client": "^1.5.0", + "spdy": "^4.0.2", + "strip-ansi": "^3.0.1", + "supports-color": "^6.1.0", + "url": "^0.11.0", + "webpack-dev-middleware": "^3.7.2", + "webpack-log": "^2.0.0", + "ws": "^6.2.1", + "yargs": "^13.3.2" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmmirror.com/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", + "dev": true + }, + "anymatch": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/anymatch/-/anymatch-2.0.0.tgz", + "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", + "dev": true, + "requires": { + "micromatch": "^3.1.4", + "normalize-path": "^2.1.1" + }, + "dependencies": { + "normalize-path": { + "version": "2.1.1", + "resolved": "https://registry.npmmirror.com/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha512-3pKJwH184Xo/lnH6oyP1q2pMd7HcypqqmRs91/6/i2CGtWwIKGCkOOMTm/zXbgTEWHw1uNpNi/igc3ePOYHb6w==", + "dev": true, + "requires": { + "remove-trailing-separator": "^1.0.1" + } + } + } + }, + "binary-extensions": { + "version": "1.13.1", + "resolved": "https://registry.npmmirror.com/binary-extensions/-/binary-extensions-1.13.1.tgz", + "integrity": "sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw==", + "dev": true + }, + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmmirror.com/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + }, + "chokidar": { + "version": "2.1.8", + "resolved": "https://registry.npmmirror.com/chokidar/-/chokidar-2.1.8.tgz", + "integrity": "sha512-ZmZUazfOzf0Nve7duiCKD23PFSCs4JPoYyccjUFF3aQkQadqBhfzhjkwBH2mNOG9cTBwhamM37EIsIkZw3nRgg==", + "dev": true, + "requires": { + "anymatch": "^2.0.0", + "async-each": "^1.0.1", + "braces": "^2.3.2", + "fsevents": "^1.2.7", + "glob-parent": "^3.1.0", + "inherits": "^2.0.3", + "is-binary-path": "^1.0.0", + "is-glob": "^4.0.0", + "normalize-path": "^3.0.0", + "path-is-absolute": "^1.0.0", + "readdirp": "^2.2.1", + "upath": "^1.1.1" + } + }, + "cliui": { + "version": "5.0.0", + "resolved": "https://registry.npmmirror.com/cliui/-/cliui-5.0.0.tgz", + "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", + "dev": true, + "requires": { + "string-width": "^3.1.0", + "strip-ansi": "^5.2.0", + "wrap-ansi": "^5.1.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.1", + "resolved": "https://registry.npmmirror.com/ansi-regex/-/ansi-regex-4.1.1.tgz", + "integrity": "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==", + "dev": true + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmmirror.com/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + } + } + }, + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmmirror.com/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true + }, + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmmirror.com/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "requires": { + "locate-path": "^3.0.0" + } + }, + "fsevents": { + "version": "1.2.13", + "resolved": "https://registry.npmmirror.com/fsevents/-/fsevents-1.2.13.tgz", + "integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==", + "dev": true, + "optional": true + }, + "glob-parent": { + "version": "3.1.0", + "resolved": "https://registry.npmmirror.com/glob-parent/-/glob-parent-3.1.0.tgz", + "integrity": "sha512-E8Ak/2+dZY6fnzlR7+ueWvhsH1SjHr4jjss4YS/h4py44jY9MhK/VFdaZJAWDz6BbL21KeteKxFSFpq8OS5gVA==", + "dev": true, + "requires": { + "is-glob": "^3.1.0", + "path-dirname": "^1.0.0" + }, + "dependencies": { + "is-glob": { + "version": "3.1.0", + "resolved": "https://registry.npmmirror.com/is-glob/-/is-glob-3.1.0.tgz", + "integrity": "sha512-UFpDDrPgM6qpnFNI+rh/p3bUaq9hKLZN8bMUWzxmcnZVS3omf4IPK+BrewlnWjO1WmUsMYuSjKh4UJuV4+Lqmw==", + "dev": true, + "requires": { + "is-extglob": "^2.1.0" + } + } + } + }, + "is-absolute-url": { + "version": "3.0.3", + "resolved": "https://registry.npmmirror.com/is-absolute-url/-/is-absolute-url-3.0.3.tgz", + "integrity": "sha512-opmNIX7uFnS96NtPmhWQgQx6/NYFgsUXYMllcfzwWKUMwfo8kku1TvE6hkNcH+Q1ts5cMVrsY7j0bxXQDciu9Q==", + "dev": true + }, + "is-binary-path": { + "version": "1.0.1", + "resolved": "https://registry.npmmirror.com/is-binary-path/-/is-binary-path-1.0.1.tgz", + "integrity": "sha512-9fRVlXc0uCxEDj1nQzaWONSpbTfx0FmJfzHF7pwlI8DkWGoHBBea4Pg5Ky0ojwwxQmnSifgbKkI06Qv0Ljgj+Q==", + "dev": true, + "requires": { + "binary-extensions": "^1.0.0" + } + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==", + "dev": true + }, + "locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmmirror.com/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "dev": true, + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmmirror.com/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "dev": true, + "requires": { + "p-limit": "^2.0.0" + } + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmmirror.com/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==", + "dev": true + }, + "readdirp": { + "version": "2.2.1", + "resolved": "https://registry.npmmirror.com/readdirp/-/readdirp-2.2.1.tgz", + "integrity": "sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.11", + "micromatch": "^3.1.10", + "readable-stream": "^2.0.2" + } + }, + "schema-utils": { + "version": "1.0.0", + "resolved": "https://registry.npmmirror.com/schema-utils/-/schema-utils-1.0.0.tgz", + "integrity": "sha512-i27Mic4KovM/lnGsy8whRCHhc7VicJajAjTrYg11K9zfZXnYIt4k5F+kZkwjnrhKzLic/HLU4j11mjsz2G/75g==", + "dev": true, + "requires": { + "ajv": "^6.1.0", + "ajv-errors": "^1.0.0", + "ajv-keywords": "^3.1.0" + } + }, + "semver": { + "version": "6.3.1", + "resolved": "https://registry.npmmirror.com/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmmirror.com/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.1", + "resolved": "https://registry.npmmirror.com/ansi-regex/-/ansi-regex-4.1.1.tgz", + "integrity": "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==", + "dev": true + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmmirror.com/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + } + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmmirror.com/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "supports-color": { + "version": "6.1.0", + "resolved": "https://registry.npmmirror.com/supports-color/-/supports-color-6.1.0.tgz", + "integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + }, + "wrap-ansi": { + "version": "5.1.0", + "resolved": "https://registry.npmmirror.com/wrap-ansi/-/wrap-ansi-5.1.0.tgz", + "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.0", + "string-width": "^3.0.0", + "strip-ansi": "^5.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.1", + "resolved": "https://registry.npmmirror.com/ansi-regex/-/ansi-regex-4.1.1.tgz", + "integrity": "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==", + "dev": true + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmmirror.com/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + } + } + }, + "yargs": { + "version": "13.3.2", + "resolved": "https://registry.npmmirror.com/yargs/-/yargs-13.3.2.tgz", + "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==", + "dev": true, + "requires": { + "cliui": "^5.0.0", + "find-up": "^3.0.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^3.0.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^13.1.2" + } + }, + "yargs-parser": { + "version": "13.1.2", + "resolved": "https://registry.npmmirror.com/yargs-parser/-/yargs-parser-13.1.2.tgz", + "integrity": "sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + } + } + }, + "webpack-log": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/webpack-log/-/webpack-log-2.0.0.tgz", + "integrity": "sha512-cX8G2vR/85UYG59FgkoMamwHUIkSSlV3bBMRsbxVXVUk2j6NleCKjQ/WE9eYg9WY4w25O9w8wKP4rzNZFmUcUg==", + "dev": true, + "requires": { + "ansi-colors": "^3.0.0", + "uuid": "^3.3.2" + } + }, + "webpack-merge": { + "version": "4.2.2", + "resolved": "https://registry.npmmirror.com/webpack-merge/-/webpack-merge-4.2.2.tgz", + "integrity": "sha512-TUE1UGoTX2Cd42j3krGYqObZbOD+xF7u28WB7tfUordytSjbWTIjK/8V0amkBfTYN4/pB/GIDlJZZ657BGG19g==", + "dev": true, + "requires": { + "lodash": "^4.17.15" + } + }, + "webpack-sources": { + "version": "1.4.3", + "resolved": "https://registry.npmmirror.com/webpack-sources/-/webpack-sources-1.4.3.tgz", + "integrity": "sha512-lgTS3Xhv1lCOKo7SA5TjKXMjpSM4sBjNV5+q2bqesbSPs5FjGmU6jjtBSkX9b4qW87vDIsCIlUPOEhbZrMdjeQ==", + "dev": true, + "requires": { + "source-list-map": "^2.0.0", + "source-map": "~0.6.1" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmmirror.com/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "websocket-driver": { + "version": "0.7.4", + "resolved": "https://registry.npmmirror.com/websocket-driver/-/websocket-driver-0.7.4.tgz", + "integrity": "sha512-b17KeDIQVjvb0ssuSDF2cYXSg2iztliJ4B9WdsuB6J952qCPKmnVq4DyW5motImXHDC1cBT/1UezrJVsKw5zjg==", + "dev": true, + "requires": { + "http-parser-js": ">=0.5.1", + "safe-buffer": ">=5.1.0", + "websocket-extensions": ">=0.1.1" + } + }, + "websocket-extensions": { + "version": "0.1.4", + "resolved": "https://registry.npmmirror.com/websocket-extensions/-/websocket-extensions-0.1.4.tgz", + "integrity": "sha512-OqedPIGOfsDlo31UNwYbCFMSaO9m9G/0faIHj5/dZFDMFqPTcx6UwqyOy3COEaEOg/9VsGIpdqn62W5KhoKSpg==", + "dev": true + }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmmirror.com/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "which-boxed-primitive": { + "version": "1.0.2", + "resolved": "https://registry.npmmirror.com/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", + "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", + "dev": true, + "requires": { + "is-bigint": "^1.0.1", + "is-boolean-object": "^1.1.0", + "is-number-object": "^1.0.4", + "is-string": "^1.0.5", + "is-symbol": "^1.0.3" + } + }, + "which-module": { + "version": "2.0.1", + "resolved": "https://registry.npmmirror.com/which-module/-/which-module-2.0.1.tgz", + "integrity": "sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==", + "dev": true + }, + "which-typed-array": { + "version": "1.1.15", + "resolved": "https://registry.npmmirror.com/which-typed-array/-/which-typed-array-1.1.15.tgz", + "integrity": "sha512-oV0jmFtUky6CXfkqehVvBP/LSWJ2sy4vWMioiENyJLePrBO/yKyV9OyJySfAKosh+RYkIl5zJCNZ8/4JncrpdA==", + "dev": true, + "requires": { + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-tostringtag": "^1.0.2" + } + }, + "word-wrap": { + "version": "1.2.5", + "resolved": "https://registry.npmmirror.com/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", + "dev": true + }, + "worker-farm": { + "version": "1.7.0", + "resolved": "https://registry.npmmirror.com/worker-farm/-/worker-farm-1.7.0.tgz", + "integrity": "sha512-rvw3QTZc8lAxyVrqcSGVm5yP/IJ2UcB3U0graE3LCFoZ0Yn2x4EoVSqJKdB/T5M+FLcRPjz4TDacRf3OCfNUzw==", + "dev": true, + "requires": { + "errno": "~0.1.7" + } + }, + "wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmmirror.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmmirror.com/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmmirror.com/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmmirror.com/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + } + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmmirror.com/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" + }, + "ws": { + "version": "6.2.2", + "resolved": "https://registry.npmmirror.com/ws/-/ws-6.2.2.tgz", + "integrity": "sha512-zmhltoSR8u1cnDsD43TX59mzoMZsLKqUweyYBAIvTngR3shc0W6aOZylZmq/7hqyVxPdi+5Ud2QInblgyE72fw==", + "dev": true, + "requires": { + "async-limiter": "~1.0.0" + } + }, + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmmirror.com/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "dev": true + }, + "y18n": { + "version": "4.0.3", + "resolved": "https://registry.npmmirror.com/y18n/-/y18n-4.0.3.tgz", + "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", + "dev": true + }, + "yallist": { + "version": "2.1.2", + "resolved": "https://registry.npmmirror.com/yallist/-/yallist-2.1.2.tgz", + "integrity": "sha512-ncTzHV7NvsQZkYe1DW7cbDLm0YpzHmZF5r/iyP3ZnQtMiJ+pjzisCiMNI+Sj+xQF5pXhSHxSB3uDbsBTzY/c2A==" + }, + "yaml": { + "version": "1.10.2", + "resolved": "https://registry.npmmirror.com/yaml/-/yaml-1.10.2.tgz", + "integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==", + "dev": true + }, + "yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmmirror.com/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "dev": true, + "requires": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + }, + "dependencies": { + "cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmmirror.com/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "dev": true, + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmmirror.com/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true + } + } + }, + "yargs-parser": { + "version": "20.2.9", + "resolved": "https://registry.npmmirror.com/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "dev": true + }, + "yorkie": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/yorkie/-/yorkie-2.0.0.tgz", + "integrity": "sha512-jcKpkthap6x63MB4TxwCyuIGkV0oYP/YRyuQU5UO0Yz/E/ZAu+653/uov+phdmO54n6BcvFRyyt0RRrWdN2mpw==", + "dev": true, + "requires": { + "execa": "^0.8.0", + "is-ci": "^1.0.10", + "normalize-path": "^1.0.0", + "strip-indent": "^2.0.0" + }, + "dependencies": { + "cross-spawn": { + "version": "5.1.0", + "resolved": "https://registry.npmmirror.com/cross-spawn/-/cross-spawn-5.1.0.tgz", + "integrity": "sha512-pTgQJ5KC0d2hcY8eyL1IzlBPYjTkyH72XRZPnLyKus2mBfNjQs3klqbJU2VILqZryAZUt9JOb3h/mWMy23/f5A==", + "dev": true, + "requires": { + "lru-cache": "^4.0.1", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, + "execa": { + "version": "0.8.0", + "resolved": "https://registry.npmmirror.com/execa/-/execa-0.8.0.tgz", + "integrity": "sha512-zDWS+Rb1E8BlqqhALSt9kUhss8Qq4nN3iof3gsOdyINksElaPyNBtKUMTR62qhvgVWR0CqCX7sdnKe4MnUbFEA==", + "dev": true, + "requires": { + "cross-spawn": "^5.0.1", + "get-stream": "^3.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" + } + }, + "get-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmmirror.com/get-stream/-/get-stream-3.0.0.tgz", + "integrity": "sha512-GlhdIUuVakc8SJ6kK0zAFbiGzRFzNnY4jUuEbV9UROo4Y+0Ny4fjvcZFVTeDA4odpFyOQzaw6hXukJSq/f28sQ==", + "dev": true + }, + "normalize-path": { + "version": "1.0.0", + "resolved": "https://registry.npmmirror.com/normalize-path/-/normalize-path-1.0.0.tgz", + "integrity": "sha512-7WyT0w8jhpDStXRq5836AMmihQwq2nrUVQrgjvUo/p/NZf9uy/MeJ246lBJVmWuYXMlJuG9BNZHF0hWjfTbQUA==", + "dev": true + } + } + }, + "zrender": { + "version": "5.4.0", + "resolved": "https://registry.npmmirror.com/zrender/-/zrender-5.4.0.tgz", + "integrity": "sha512-rOS09Z2HSVGFs2dn/TuYk5BlCaZcVe8UDLLjj1ySYF828LATKKdxuakSZMvrDz54yiKPDYVfjdKqcX8Jky3BIA==", + "requires": { + "tslib": "2.3.0" + } + } + } +} diff --git a/custom-ui/package.json b/custom-ui/package.json new file mode 100644 index 0000000..e4d2180 --- /dev/null +++ b/custom-ui/package.json @@ -0,0 +1,90 @@ +{ + "name": "ruoyi", + "version": "3.8.5", + "description": "后台管理系统", + "author": "若依", + "license": "MIT", + "scripts": { + "dev": "vue-cli-service serve", + "build:prod": "vue-cli-service build", + "build:stage": "vue-cli-service build --mode staging", + "preview": "node build/index.js --preview", + "lint": "eslint --ext .js,.vue src" + }, + "husky": { + "hooks": { + "pre-commit": "lint-staged" + } + }, + "lint-staged": { + "src/**/*.{js,vue}": [ + "eslint --fix", + "git add" + ] + }, + "keywords": [ + "vue", + "admin", + "dashboard", + "element-ui", + "boilerplate", + "admin-template", + "management-system" + ], + "repository": { + "type": "git", + "url": "https://gitee.com/y_project/RuoYi-Vue.git" + }, + "dependencies": { + "@riophae/vue-treeselect": "0.4.0", + "axios": "0.24.0", + "clipboard": "2.0.8", + "core-js": "3.25.3", + "echarts": "5.4.0", + "element-ui": "2.15.12", + "file-saver": "2.0.5", + "fuse.js": "6.4.3", + "highlight.js": "9.18.5", + "js-beautify": "1.13.0", + "js-cookie": "3.0.1", + "jsencrypt": "3.0.0-rc.1", + "nprogress": "0.2.0", + "quill": "1.3.7", + "screenfull": "5.0.2", + "sortablejs": "1.10.2", + "vue": "2.6.12", + "vue-count-to": "1.0.13", + "vue-cropper": "0.5.5", + "vue-meta": "2.4.0", + "vue-router": "3.4.9", + "vuedraggable": "2.24.3", + "vuex": "3.6.0" + }, + "devDependencies": { + "@vue/cli-plugin-babel": "4.4.6", + "@vue/cli-plugin-eslint": "4.4.6", + "@vue/cli-service": "4.4.6", + "babel-eslint": "10.1.0", + "babel-plugin-dynamic-import-node": "2.3.3", + "chalk": "4.1.0", + "compression-webpack-plugin": "5.0.2", + "connect": "3.6.6", + "eslint": "7.15.0", + "eslint-plugin-vue": "7.2.0", + "lint-staged": "10.5.3", + "runjs": "4.4.2", + "sass": "1.32.13", + "sass-loader": "10.1.1", + "script-ext-html-webpack-plugin": "2.1.5", + "svg-sprite-loader": "5.1.1", + "vue-template-compiler": "2.6.12" + }, + "engines": { + "node": ">=8.9", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions" + ] +} diff --git a/custom-ui/public/favicon.ico b/custom-ui/public/favicon.ico new file mode 100644 index 0000000..e263760 Binary files /dev/null and b/custom-ui/public/favicon.ico differ diff --git a/custom-ui/public/html/ie.html b/custom-ui/public/html/ie.html new file mode 100644 index 0000000..052ffcd --- /dev/null +++ b/custom-ui/public/html/ie.html @@ -0,0 +1,46 @@ + + + + + + 请升级您的浏览器 + + + + + + +

请升级您的浏览器,以便我们更好的为您提供服务!

+

您正在使用 Internet Explorer 的早期版本(IE11以下版本或使用该内核的浏览器)。这意味着在升级浏览器前,您将无法访问此网站。

+
+

请注意:微软公司对Windows XP 及 Internet Explorer 早期版本的支持已经结束

+

自 2016 年 1 月 12 日起,Microsoft 不再为 IE 11 以下版本提供相应支持和更新。没有关键的浏览器安全更新,您的电脑可能易受有害病毒、间谍软件和其他恶意软件的攻击,它们可以窃取或损害您的业务数据和信息。请参阅 微软对 Internet Explorer 早期版本的支持将于 2016 年 1 月 12 日结束的说明

+
+

您可以选择更先进的浏览器

+

推荐使用以下浏览器的最新版本。如果您的电脑已有以下浏览器的最新版本则直接使用该浏览器访问即可。

+ +
+ + \ No newline at end of file diff --git a/custom-ui/public/index.html b/custom-ui/public/index.html new file mode 100644 index 0000000..925455c --- /dev/null +++ b/custom-ui/public/index.html @@ -0,0 +1,208 @@ + + + + + + + + + <%= webpackConfig.name %> + + + + +
+
+
+
+
+
正在加载系统资源,请耐心等待
+
+
+ + diff --git a/custom-ui/public/robots.txt b/custom-ui/public/robots.txt new file mode 100644 index 0000000..77470cb --- /dev/null +++ b/custom-ui/public/robots.txt @@ -0,0 +1,2 @@ +User-agent: * +Disallow: / \ No newline at end of file diff --git a/custom-ui/src/App.vue b/custom-ui/src/App.vue new file mode 100644 index 0000000..29de49f --- /dev/null +++ b/custom-ui/src/App.vue @@ -0,0 +1,28 @@ + + + + diff --git a/custom-ui/src/api/business/survey.js b/custom-ui/src/api/business/survey.js new file mode 100644 index 0000000..bf50234 --- /dev/null +++ b/custom-ui/src/api/business/survey.js @@ -0,0 +1,53 @@ +import request from '@/utils/request' + +// 查询模版属性列表 +export function listBySurveyId(surveyId) { + return request({ + url: '/business/survey/listBySurveyId?surveyId=' + surveyId, + method: 'get', + }) +} + + +// 查询调查问卷管理列表 +export function listSurvey(query) { + return request({ + url: '/business/survey/list', + method: 'get', + params: query + }) +} + +// 查询调查问卷管理详细 +export function getSurvey(id) { + return request({ + url: '/business/survey/' + id, + method: 'get' + }) +} + +// 新增调查问卷管理 +export function addSurvey(data) { + return request({ + url: '/business/survey', + method: 'post', + data: data + }) +} + +// 修改调查问卷管理 +export function updateSurvey(data) { + return request({ + url: '/business/survey', + method: 'put', + data: data + }) +} + +// 删除调查问卷管理 +export function delSurvey(id) { + return request({ + url: '/business/survey/' + id, + method: 'delete' + }) +} diff --git a/custom-ui/src/api/business/template.js b/custom-ui/src/api/business/template.js new file mode 100644 index 0000000..4f7b0c1 --- /dev/null +++ b/custom-ui/src/api/business/template.js @@ -0,0 +1,54 @@ +import request from '@/utils/request' + +// 查询模版管理列表 +export function listTemplate(query) { + return request({ + url: '/business/template/list', + method: 'get', + params: query + }) +} + + +// 查询模版管理列表 +export function listAll(query) { + return request({ + url: '/business/template/listAll', + method: 'get', + params: query + }) +} + +// 查询模版管理详细 +export function getTemplate(id) { + return request({ + url: '/business/template/' + id, + method: 'get' + }) +} + +// 新增模版管理 +export function addTemplate(data) { + return request({ + url: '/business/template', + method: 'post', + data: data + }) +} + +// 修改模版管理 +export function updateTemplate(data) { + return request({ + url: '/business/template', + method: 'put', + data: data + }) +} + +// 删除模版管理 +export function delTemplate(id) { + return request({ + url: '/business/template/' + id, + method: 'delete' + }) +} diff --git a/custom-ui/src/api/business/templateProp.js b/custom-ui/src/api/business/templateProp.js new file mode 100644 index 0000000..6b237bf --- /dev/null +++ b/custom-ui/src/api/business/templateProp.js @@ -0,0 +1,45 @@ +import request from '@/utils/request' + + +// 查询模版管理列表 +export function listTemplateProp(query) { + return request({ + url: '/business/templateProp/list', + method: 'get', + params: query + }) +} + +// 查询模版属性详细 +export function getTemplateProp(id) { + return request({ + url: '/business/templateProp/' + id, + method: 'get' + }) +} + +// 新增模版属性 +export function addTemplateProp(data) { + return request({ + url: '/business/templateProp', + method: 'post', + data: data + }) +} + +// 修改模版属性 +export function updateTemplateProp(data) { + return request({ + url: '/business/templateProp', + method: 'put', + data: data + }) +} + +// 删除模版属性 +export function delTemplateProp(id) { + return request({ + url: '/business/templateProp/' + id, + method: 'delete' + }) +} diff --git a/custom-ui/src/api/business/templatePropValue.js b/custom-ui/src/api/business/templatePropValue.js new file mode 100644 index 0000000..bb6eda9 --- /dev/null +++ b/custom-ui/src/api/business/templatePropValue.js @@ -0,0 +1,61 @@ +import request from '@/utils/request' + +// 统计数据 +export function countGroup(surveyId) { + return request({ + url: '/business/templatePropValue/countGroup?surveyId=' + surveyId, + method: 'get', + }) +} + +// 查询模版属性值列表 +export function listTemplatePropValue(query) { + return request({ + url: '/business/templatePropValue/list', + method: 'get', + params: query + }) +} + +// 查询模版属性值详细 +export function getTemplatePropValue(id) { + return request({ + url: '/business/templatePropValue/' + id, + method: 'get' + }) +} + +// 新增模版属性值 +export function addTemplatePropValue(data) { + return request({ + url: '/business/templatePropValue', + method: 'post', + data: data + }) +} + +// 新增模版属性值 +export function addList(data) { + return request({ + url: '/business/templatePropValue/addList', + method: 'post', + data: data + }) +} + +// 修改模版属性值 +export function updateTemplatePropValue(data) { + return request({ + url: '/business/templatePropValue', + method: 'put', + data: data + }) +} + +// 删除模版属性值 +export function delTemplatePropValue(id) { + return request({ + url: '/business/templatePropValue/' + id, + method: 'delete' + }) +} diff --git a/custom-ui/src/api/login.js b/custom-ui/src/api/login.js new file mode 100644 index 0000000..4578559 --- /dev/null +++ b/custom-ui/src/api/login.js @@ -0,0 +1,70 @@ +import request from '@/utils/request' + +// 登录方法 +export function login(username, password, code, uuid) { + const data = { + username, + password, + code, + uuid + } + return request({ + url: '/login', + headers: { + isToken: false + }, + method: 'post', + data: data + }) +} + +// 注册方法 +export function register(data) { + return request({ + url: '/register', + headers: { + isToken: false + }, + method: 'post', + data: data + }) +} + +// 获取用户详细信息 +export function getInfo() { + return request({ + url: '/getInfo', + method: 'get' + }) +} + +// 退出方法 +export function logout() { + return request({ + url: '/logout', + method: 'post' + }) +} + +// 获取验证码 +export function getCodeImg() { + return request({ + url: '/captchaImage', + headers: { + isToken: false + }, + method: 'get', + timeout: 20000 + }) +} + +// 查询是否允许注册 +export function getConfigKey(configKey) { + return request({ + url: '/system/config/configKey/' + configKey, + headers: { + isToken: false + }, + method: 'get' + }) +} \ No newline at end of file diff --git a/custom-ui/src/api/menu.js b/custom-ui/src/api/menu.js new file mode 100644 index 0000000..faef101 --- /dev/null +++ b/custom-ui/src/api/menu.js @@ -0,0 +1,9 @@ +import request from '@/utils/request' + +// 获取路由 +export const getRouters = () => { + return request({ + url: '/getRouters', + method: 'get' + }) +} \ No newline at end of file diff --git a/custom-ui/src/api/monitor/cache.js b/custom-ui/src/api/monitor/cache.js new file mode 100644 index 0000000..72c5f6a --- /dev/null +++ b/custom-ui/src/api/monitor/cache.js @@ -0,0 +1,57 @@ +import request from '@/utils/request' + +// 查询缓存详细 +export function getCache() { + return request({ + url: '/monitor/cache', + method: 'get' + }) +} + +// 查询缓存名称列表 +export function listCacheName() { + return request({ + url: '/monitor/cache/getNames', + method: 'get' + }) +} + +// 查询缓存键名列表 +export function listCacheKey(cacheName) { + return request({ + url: '/monitor/cache/getKeys/' + cacheName, + method: 'get' + }) +} + +// 查询缓存内容 +export function getCacheValue(cacheName, cacheKey) { + return request({ + url: '/monitor/cache/getValue/' + cacheName + '/' + cacheKey, + method: 'get' + }) +} + +// 清理指定名称缓存 +export function clearCacheName(cacheName) { + return request({ + url: '/monitor/cache/clearCacheName/' + cacheName, + method: 'delete' + }) +} + +// 清理指定键名缓存 +export function clearCacheKey(cacheKey) { + return request({ + url: '/monitor/cache/clearCacheKey/' + cacheKey, + method: 'delete' + }) +} + +// 清理全部缓存 +export function clearCacheAll() { + return request({ + url: '/monitor/cache/clearCacheAll', + method: 'delete' + }) +} diff --git a/custom-ui/src/api/monitor/job.js b/custom-ui/src/api/monitor/job.js new file mode 100644 index 0000000..3815569 --- /dev/null +++ b/custom-ui/src/api/monitor/job.js @@ -0,0 +1,71 @@ +import request from '@/utils/request' + +// 查询定时任务调度列表 +export function listJob(query) { + return request({ + url: '/monitor/job/list', + method: 'get', + params: query + }) +} + +// 查询定时任务调度详细 +export function getJob(jobId) { + return request({ + url: '/monitor/job/' + jobId, + method: 'get' + }) +} + +// 新增定时任务调度 +export function addJob(data) { + return request({ + url: '/monitor/job', + method: 'post', + data: data + }) +} + +// 修改定时任务调度 +export function updateJob(data) { + return request({ + url: '/monitor/job', + method: 'put', + data: data + }) +} + +// 删除定时任务调度 +export function delJob(jobId) { + return request({ + url: '/monitor/job/' + jobId, + method: 'delete' + }) +} + +// 任务状态修改 +export function changeJobStatus(jobId, status) { + const data = { + jobId, + status + } + return request({ + url: '/monitor/job/changeStatus', + method: 'put', + data: data + }) +} + + +// 定时任务立即执行一次 +export function runJob(jobId, jobGroup) { + const data = { + jobId, + jobGroup + } + return request({ + url: '/monitor/job/run', + method: 'put', + data: data + }) +} \ No newline at end of file diff --git a/custom-ui/src/api/monitor/jobLog.js b/custom-ui/src/api/monitor/jobLog.js new file mode 100644 index 0000000..6e0be61 --- /dev/null +++ b/custom-ui/src/api/monitor/jobLog.js @@ -0,0 +1,26 @@ +import request from '@/utils/request' + +// 查询调度日志列表 +export function listJobLog(query) { + return request({ + url: '/monitor/jobLog/list', + method: 'get', + params: query + }) +} + +// 删除调度日志 +export function delJobLog(jobLogId) { + return request({ + url: '/monitor/jobLog/' + jobLogId, + method: 'delete' + }) +} + +// 清空调度日志 +export function cleanJobLog() { + return request({ + url: '/monitor/jobLog/clean', + method: 'delete' + }) +} diff --git a/custom-ui/src/api/monitor/logininfor.js b/custom-ui/src/api/monitor/logininfor.js new file mode 100644 index 0000000..4d112b7 --- /dev/null +++ b/custom-ui/src/api/monitor/logininfor.js @@ -0,0 +1,34 @@ +import request from '@/utils/request' + +// 查询登录日志列表 +export function list(query) { + return request({ + url: '/monitor/logininfor/list', + method: 'get', + params: query + }) +} + +// 删除登录日志 +export function delLogininfor(infoId) { + return request({ + url: '/monitor/logininfor/' + infoId, + method: 'delete' + }) +} + +// 解锁用户登录状态 +export function unlockLogininfor(userName) { + return request({ + url: '/monitor/logininfor/unlock/' + userName, + method: 'get' + }) +} + +// 清空登录日志 +export function cleanLogininfor() { + return request({ + url: '/monitor/logininfor/clean', + method: 'delete' + }) +} diff --git a/custom-ui/src/api/monitor/online.js b/custom-ui/src/api/monitor/online.js new file mode 100644 index 0000000..bd22137 --- /dev/null +++ b/custom-ui/src/api/monitor/online.js @@ -0,0 +1,18 @@ +import request from '@/utils/request' + +// 查询在线用户列表 +export function list(query) { + return request({ + url: '/monitor/online/list', + method: 'get', + params: query + }) +} + +// 强退用户 +export function forceLogout(tokenId) { + return request({ + url: '/monitor/online/' + tokenId, + method: 'delete' + }) +} diff --git a/custom-ui/src/api/monitor/operlog.js b/custom-ui/src/api/monitor/operlog.js new file mode 100644 index 0000000..a04bca8 --- /dev/null +++ b/custom-ui/src/api/monitor/operlog.js @@ -0,0 +1,26 @@ +import request from '@/utils/request' + +// 查询操作日志列表 +export function list(query) { + return request({ + url: '/monitor/operlog/list', + method: 'get', + params: query + }) +} + +// 删除操作日志 +export function delOperlog(operId) { + return request({ + url: '/monitor/operlog/' + operId, + method: 'delete' + }) +} + +// 清空操作日志 +export function cleanOperlog() { + return request({ + url: '/monitor/operlog/clean', + method: 'delete' + }) +} diff --git a/custom-ui/src/api/monitor/server.js b/custom-ui/src/api/monitor/server.js new file mode 100644 index 0000000..e1f9ca2 --- /dev/null +++ b/custom-ui/src/api/monitor/server.js @@ -0,0 +1,9 @@ +import request from '@/utils/request' + +// 获取服务信息 +export function getServer() { + return request({ + url: '/monitor/server', + method: 'get' + }) +} \ No newline at end of file diff --git a/custom-ui/src/api/system/config.js b/custom-ui/src/api/system/config.js new file mode 100644 index 0000000..a404d82 --- /dev/null +++ b/custom-ui/src/api/system/config.js @@ -0,0 +1,60 @@ +import request from '@/utils/request' + +// 查询参数列表 +export function listConfig(query) { + return request({ + url: '/system/config/list', + method: 'get', + params: query + }) +} + +// 查询参数详细 +export function getConfig(configId) { + return request({ + url: '/system/config/' + configId, + method: 'get' + }) +} + +// 根据参数键名查询参数值 +export function getConfigKey(configKey) { + return request({ + url: '/system/config/configKey/' + configKey, + method: 'get' + }) +} + +// 新增参数配置 +export function addConfig(data) { + return request({ + url: '/system/config', + method: 'post', + data: data + }) +} + +// 修改参数配置 +export function updateConfig(data) { + return request({ + url: '/system/config', + method: 'put', + data: data + }) +} + +// 删除参数配置 +export function delConfig(configId) { + return request({ + url: '/system/config/' + configId, + method: 'delete' + }) +} + +// 刷新参数缓存 +export function refreshCache() { + return request({ + url: '/system/config/refreshCache', + method: 'delete' + }) +} diff --git a/custom-ui/src/api/system/dept.js b/custom-ui/src/api/system/dept.js new file mode 100644 index 0000000..fc943cd --- /dev/null +++ b/custom-ui/src/api/system/dept.js @@ -0,0 +1,52 @@ +import request from '@/utils/request' + +// 查询部门列表 +export function listDept(query) { + return request({ + url: '/system/dept/list', + method: 'get', + params: query + }) +} + +// 查询部门列表(排除节点) +export function listDeptExcludeChild(deptId) { + return request({ + url: '/system/dept/list/exclude/' + deptId, + method: 'get' + }) +} + +// 查询部门详细 +export function getDept(deptId) { + return request({ + url: '/system/dept/' + deptId, + method: 'get' + }) +} + +// 新增部门 +export function addDept(data) { + return request({ + url: '/system/dept', + method: 'post', + data: data + }) +} + +// 修改部门 +export function updateDept(data) { + return request({ + url: '/system/dept', + method: 'put', + data: data + }) +} + +// 删除部门 +export function delDept(deptId) { + return request({ + url: '/system/dept/' + deptId, + method: 'delete' + }) +} \ No newline at end of file diff --git a/custom-ui/src/api/system/dict/data.js b/custom-ui/src/api/system/dict/data.js new file mode 100644 index 0000000..6c9eb79 --- /dev/null +++ b/custom-ui/src/api/system/dict/data.js @@ -0,0 +1,52 @@ +import request from '@/utils/request' + +// 查询字典数据列表 +export function listData(query) { + return request({ + url: '/system/dict/data/list', + method: 'get', + params: query + }) +} + +// 查询字典数据详细 +export function getData(dictCode) { + return request({ + url: '/system/dict/data/' + dictCode, + method: 'get' + }) +} + +// 根据字典类型查询字典数据信息 +export function getDicts(dictType) { + return request({ + url: '/system/dict/data/type/' + dictType, + method: 'get' + }) +} + +// 新增字典数据 +export function addData(data) { + return request({ + url: '/system/dict/data', + method: 'post', + data: data + }) +} + +// 修改字典数据 +export function updateData(data) { + return request({ + url: '/system/dict/data', + method: 'put', + data: data + }) +} + +// 删除字典数据 +export function delData(dictCode) { + return request({ + url: '/system/dict/data/' + dictCode, + method: 'delete' + }) +} diff --git a/custom-ui/src/api/system/dict/type.js b/custom-ui/src/api/system/dict/type.js new file mode 100644 index 0000000..a7a6e01 --- /dev/null +++ b/custom-ui/src/api/system/dict/type.js @@ -0,0 +1,60 @@ +import request from '@/utils/request' + +// 查询字典类型列表 +export function listType(query) { + return request({ + url: '/system/dict/type/list', + method: 'get', + params: query + }) +} + +// 查询字典类型详细 +export function getType(dictId) { + return request({ + url: '/system/dict/type/' + dictId, + method: 'get' + }) +} + +// 新增字典类型 +export function addType(data) { + return request({ + url: '/system/dict/type', + method: 'post', + data: data + }) +} + +// 修改字典类型 +export function updateType(data) { + return request({ + url: '/system/dict/type', + method: 'put', + data: data + }) +} + +// 删除字典类型 +export function delType(dictId) { + return request({ + url: '/system/dict/type/' + dictId, + method: 'delete' + }) +} + +// 刷新字典缓存 +export function refreshCache() { + return request({ + url: '/system/dict/type/refreshCache', + method: 'delete' + }) +} + +// 获取字典选择框列表 +export function optionselect() { + return request({ + url: '/system/dict/type/optionselect', + method: 'get' + }) +} \ No newline at end of file diff --git a/custom-ui/src/api/system/menu.js b/custom-ui/src/api/system/menu.js new file mode 100644 index 0000000..f6415c6 --- /dev/null +++ b/custom-ui/src/api/system/menu.js @@ -0,0 +1,60 @@ +import request from '@/utils/request' + +// 查询菜单列表 +export function listMenu(query) { + return request({ + url: '/system/menu/list', + method: 'get', + params: query + }) +} + +// 查询菜单详细 +export function getMenu(menuId) { + return request({ + url: '/system/menu/' + menuId, + method: 'get' + }) +} + +// 查询菜单下拉树结构 +export function treeselect() { + return request({ + url: '/system/menu/treeselect', + method: 'get' + }) +} + +// 根据角色ID查询菜单下拉树结构 +export function roleMenuTreeselect(roleId) { + return request({ + url: '/system/menu/roleMenuTreeselect/' + roleId, + method: 'get' + }) +} + +// 新增菜单 +export function addMenu(data) { + return request({ + url: '/system/menu', + method: 'post', + data: data + }) +} + +// 修改菜单 +export function updateMenu(data) { + return request({ + url: '/system/menu', + method: 'put', + data: data + }) +} + +// 删除菜单 +export function delMenu(menuId) { + return request({ + url: '/system/menu/' + menuId, + method: 'delete' + }) +} \ No newline at end of file diff --git a/custom-ui/src/api/system/notice.js b/custom-ui/src/api/system/notice.js new file mode 100644 index 0000000..c274ea5 --- /dev/null +++ b/custom-ui/src/api/system/notice.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询公告列表 +export function listNotice(query) { + return request({ + url: '/system/notice/list', + method: 'get', + params: query + }) +} + +// 查询公告详细 +export function getNotice(noticeId) { + return request({ + url: '/system/notice/' + noticeId, + method: 'get' + }) +} + +// 新增公告 +export function addNotice(data) { + return request({ + url: '/system/notice', + method: 'post', + data: data + }) +} + +// 修改公告 +export function updateNotice(data) { + return request({ + url: '/system/notice', + method: 'put', + data: data + }) +} + +// 删除公告 +export function delNotice(noticeId) { + return request({ + url: '/system/notice/' + noticeId, + method: 'delete' + }) +} \ No newline at end of file diff --git a/custom-ui/src/api/system/post.js b/custom-ui/src/api/system/post.js new file mode 100644 index 0000000..1a8e9ca --- /dev/null +++ b/custom-ui/src/api/system/post.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询岗位列表 +export function listPost(query) { + return request({ + url: '/system/post/list', + method: 'get', + params: query + }) +} + +// 查询岗位详细 +export function getPost(postId) { + return request({ + url: '/system/post/' + postId, + method: 'get' + }) +} + +// 新增岗位 +export function addPost(data) { + return request({ + url: '/system/post', + method: 'post', + data: data + }) +} + +// 修改岗位 +export function updatePost(data) { + return request({ + url: '/system/post', + method: 'put', + data: data + }) +} + +// 删除岗位 +export function delPost(postId) { + return request({ + url: '/system/post/' + postId, + method: 'delete' + }) +} diff --git a/custom-ui/src/api/system/role.js b/custom-ui/src/api/system/role.js new file mode 100644 index 0000000..f13e6f4 --- /dev/null +++ b/custom-ui/src/api/system/role.js @@ -0,0 +1,119 @@ +import request from '@/utils/request' + +// 查询角色列表 +export function listRole(query) { + return request({ + url: '/system/role/list', + method: 'get', + params: query + }) +} + +// 查询角色详细 +export function getRole(roleId) { + return request({ + url: '/system/role/' + roleId, + method: 'get' + }) +} + +// 新增角色 +export function addRole(data) { + return request({ + url: '/system/role', + method: 'post', + data: data + }) +} + +// 修改角色 +export function updateRole(data) { + return request({ + url: '/system/role', + method: 'put', + data: data + }) +} + +// 角色数据权限 +export function dataScope(data) { + return request({ + url: '/system/role/dataScope', + method: 'put', + data: data + }) +} + +// 角色状态修改 +export function changeRoleStatus(roleId, status) { + const data = { + roleId, + status + } + return request({ + url: '/system/role/changeStatus', + method: 'put', + data: data + }) +} + +// 删除角色 +export function delRole(roleId) { + return request({ + url: '/system/role/' + roleId, + method: 'delete' + }) +} + +// 查询角色已授权用户列表 +export function allocatedUserList(query) { + return request({ + url: '/system/role/authUser/allocatedList', + method: 'get', + params: query + }) +} + +// 查询角色未授权用户列表 +export function unallocatedUserList(query) { + return request({ + url: '/system/role/authUser/unallocatedList', + method: 'get', + params: query + }) +} + +// 取消用户授权角色 +export function authUserCancel(data) { + return request({ + url: '/system/role/authUser/cancel', + method: 'put', + data: data + }) +} + +// 批量取消用户授权角色 +export function authUserCancelAll(data) { + return request({ + url: '/system/role/authUser/cancelAll', + method: 'put', + params: data + }) +} + +// 授权用户选择 +export function authUserSelectAll(data) { + return request({ + url: '/system/role/authUser/selectAll', + method: 'put', + params: data + }) +} + +// 根据角色ID查询部门树结构 +export function deptTreeSelect(roleId) { + return request({ + url: '/system/role/deptTree/' + roleId, + method: 'get' + }) +} diff --git a/custom-ui/src/api/system/user.js b/custom-ui/src/api/system/user.js new file mode 100644 index 0000000..f2f76ef --- /dev/null +++ b/custom-ui/src/api/system/user.js @@ -0,0 +1,135 @@ +import request from '@/utils/request' +import { parseStrEmpty } from "@/utils/ruoyi"; + +// 查询用户列表 +export function listUser(query) { + return request({ + url: '/system/user/list', + method: 'get', + params: query + }) +} + +// 查询用户详细 +export function getUser(userId) { + return request({ + url: '/system/user/' + parseStrEmpty(userId), + method: 'get' + }) +} + +// 新增用户 +export function addUser(data) { + return request({ + url: '/system/user', + method: 'post', + data: data + }) +} + +// 修改用户 +export function updateUser(data) { + return request({ + url: '/system/user', + method: 'put', + data: data + }) +} + +// 删除用户 +export function delUser(userId) { + return request({ + url: '/system/user/' + userId, + method: 'delete' + }) +} + +// 用户密码重置 +export function resetUserPwd(userId, password) { + const data = { + userId, + password + } + return request({ + url: '/system/user/resetPwd', + method: 'put', + data: data + }) +} + +// 用户状态修改 +export function changeUserStatus(userId, status) { + const data = { + userId, + status + } + return request({ + url: '/system/user/changeStatus', + method: 'put', + data: data + }) +} + +// 查询用户个人信息 +export function getUserProfile() { + return request({ + url: '/system/user/profile', + method: 'get' + }) +} + +// 修改用户个人信息 +export function updateUserProfile(data) { + return request({ + url: '/system/user/profile', + method: 'put', + data: data + }) +} + +// 用户密码重置 +export function updateUserPwd(oldPassword, newPassword) { + const data = { + oldPassword, + newPassword + } + return request({ + url: '/system/user/profile/updatePwd', + method: 'put', + params: data + }) +} + +// 用户头像上传 +export function uploadAvatar(data) { + return request({ + url: '/system/user/profile/avatar', + method: 'post', + data: data + }) +} + +// 查询授权角色 +export function getAuthRole(userId) { + return request({ + url: '/system/user/authRole/' + userId, + method: 'get' + }) +} + +// 保存授权角色 +export function updateAuthRole(data) { + return request({ + url: '/system/user/authRole', + method: 'put', + params: data + }) +} + +// 查询部门下拉树结构 +export function deptTreeSelect() { + return request({ + url: '/system/user/deptTree', + method: 'get' + }) +} diff --git a/custom-ui/src/api/tool/gen.js b/custom-ui/src/api/tool/gen.js new file mode 100644 index 0000000..4506927 --- /dev/null +++ b/custom-ui/src/api/tool/gen.js @@ -0,0 +1,76 @@ +import request from '@/utils/request' + +// 查询生成表数据 +export function listTable(query) { + return request({ + url: '/tool/gen/list', + method: 'get', + params: query + }) +} +// 查询db数据库列表 +export function listDbTable(query) { + return request({ + url: '/tool/gen/db/list', + method: 'get', + params: query + }) +} + +// 查询表详细信息 +export function getGenTable(tableId) { + return request({ + url: '/tool/gen/' + tableId, + method: 'get' + }) +} + +// 修改代码生成信息 +export function updateGenTable(data) { + return request({ + url: '/tool/gen', + method: 'put', + data: data + }) +} + +// 导入表 +export function importTable(data) { + return request({ + url: '/tool/gen/importTable', + method: 'post', + params: data + }) +} + +// 预览生成代码 +export function previewTable(tableId) { + return request({ + url: '/tool/gen/preview/' + tableId, + method: 'get' + }) +} + +// 删除表数据 +export function delTable(tableId) { + return request({ + url: '/tool/gen/' + tableId, + method: 'delete' + }) +} + +// 生成代码(自定义路径) +export function genCode(tableName) { + return request({ + url: '/tool/gen/genCode/' + tableName, + method: 'get' + }) +} + +// 同步数据库 +export function synchDb(tableName) { + return request({ + url: '/tool/gen/synchDb/' + tableName, + method: 'get' + }) +} diff --git a/custom-ui/src/assets/401_images/401.gif b/custom-ui/src/assets/401_images/401.gif new file mode 100644 index 0000000..cd6e0d9 Binary files /dev/null and b/custom-ui/src/assets/401_images/401.gif differ diff --git a/custom-ui/src/assets/404_images/404.png b/custom-ui/src/assets/404_images/404.png new file mode 100644 index 0000000..3d8e230 Binary files /dev/null and b/custom-ui/src/assets/404_images/404.png differ diff --git a/custom-ui/src/assets/404_images/404_cloud.png b/custom-ui/src/assets/404_images/404_cloud.png new file mode 100644 index 0000000..c6281d0 Binary files /dev/null and b/custom-ui/src/assets/404_images/404_cloud.png differ diff --git a/custom-ui/src/assets/icons/index.js b/custom-ui/src/assets/icons/index.js new file mode 100644 index 0000000..2c6b309 --- /dev/null +++ b/custom-ui/src/assets/icons/index.js @@ -0,0 +1,9 @@ +import Vue from 'vue' +import SvgIcon from '@/components/SvgIcon'// svg component + +// register globally +Vue.component('svg-icon', SvgIcon) + +const req = require.context('./svg', false, /\.svg$/) +const requireAll = requireContext => requireContext.keys().map(requireContext) +requireAll(req) diff --git a/custom-ui/src/assets/icons/svg/404.svg b/custom-ui/src/assets/icons/svg/404.svg new file mode 100644 index 0000000..6df5019 --- /dev/null +++ b/custom-ui/src/assets/icons/svg/404.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/custom-ui/src/assets/icons/svg/bug.svg b/custom-ui/src/assets/icons/svg/bug.svg new file mode 100644 index 0000000..05a150d --- /dev/null +++ b/custom-ui/src/assets/icons/svg/bug.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/custom-ui/src/assets/icons/svg/build.svg b/custom-ui/src/assets/icons/svg/build.svg new file mode 100644 index 0000000..97c4688 --- /dev/null +++ b/custom-ui/src/assets/icons/svg/build.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/custom-ui/src/assets/icons/svg/button.svg b/custom-ui/src/assets/icons/svg/button.svg new file mode 100644 index 0000000..904fddc --- /dev/null +++ b/custom-ui/src/assets/icons/svg/button.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/custom-ui/src/assets/icons/svg/cascader.svg b/custom-ui/src/assets/icons/svg/cascader.svg new file mode 100644 index 0000000..e256024 --- /dev/null +++ b/custom-ui/src/assets/icons/svg/cascader.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/custom-ui/src/assets/icons/svg/chart.svg b/custom-ui/src/assets/icons/svg/chart.svg new file mode 100644 index 0000000..27728fb --- /dev/null +++ b/custom-ui/src/assets/icons/svg/chart.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/custom-ui/src/assets/icons/svg/checkbox.svg b/custom-ui/src/assets/icons/svg/checkbox.svg new file mode 100644 index 0000000..013fd3a --- /dev/null +++ b/custom-ui/src/assets/icons/svg/checkbox.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/custom-ui/src/assets/icons/svg/clipboard.svg b/custom-ui/src/assets/icons/svg/clipboard.svg new file mode 100644 index 0000000..90923ff --- /dev/null +++ b/custom-ui/src/assets/icons/svg/clipboard.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/custom-ui/src/assets/icons/svg/code.svg b/custom-ui/src/assets/icons/svg/code.svg new file mode 100644 index 0000000..5f9c5ab --- /dev/null +++ b/custom-ui/src/assets/icons/svg/code.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/custom-ui/src/assets/icons/svg/color.svg b/custom-ui/src/assets/icons/svg/color.svg new file mode 100644 index 0000000..44a81aa --- /dev/null +++ b/custom-ui/src/assets/icons/svg/color.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/custom-ui/src/assets/icons/svg/component.svg b/custom-ui/src/assets/icons/svg/component.svg new file mode 100644 index 0000000..29c3458 --- /dev/null +++ b/custom-ui/src/assets/icons/svg/component.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/custom-ui/src/assets/icons/svg/dashboard.svg b/custom-ui/src/assets/icons/svg/dashboard.svg new file mode 100644 index 0000000..5317d37 --- /dev/null +++ b/custom-ui/src/assets/icons/svg/dashboard.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/custom-ui/src/assets/icons/svg/date-range.svg b/custom-ui/src/assets/icons/svg/date-range.svg new file mode 100644 index 0000000..fda571e --- /dev/null +++ b/custom-ui/src/assets/icons/svg/date-range.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/custom-ui/src/assets/icons/svg/date.svg b/custom-ui/src/assets/icons/svg/date.svg new file mode 100644 index 0000000..52dc73e --- /dev/null +++ b/custom-ui/src/assets/icons/svg/date.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/custom-ui/src/assets/icons/svg/dict.svg b/custom-ui/src/assets/icons/svg/dict.svg new file mode 100644 index 0000000..4849377 --- /dev/null +++ b/custom-ui/src/assets/icons/svg/dict.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/custom-ui/src/assets/icons/svg/documentation.svg b/custom-ui/src/assets/icons/svg/documentation.svg new file mode 100644 index 0000000..7043122 --- /dev/null +++ b/custom-ui/src/assets/icons/svg/documentation.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/custom-ui/src/assets/icons/svg/download.svg b/custom-ui/src/assets/icons/svg/download.svg new file mode 100644 index 0000000..c896951 --- /dev/null +++ b/custom-ui/src/assets/icons/svg/download.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/custom-ui/src/assets/icons/svg/drag.svg b/custom-ui/src/assets/icons/svg/drag.svg new file mode 100644 index 0000000..4185d3c --- /dev/null +++ b/custom-ui/src/assets/icons/svg/drag.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/custom-ui/src/assets/icons/svg/druid.svg b/custom-ui/src/assets/icons/svg/druid.svg new file mode 100644 index 0000000..a2b4b4e --- /dev/null +++ b/custom-ui/src/assets/icons/svg/druid.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/custom-ui/src/assets/icons/svg/edit.svg b/custom-ui/src/assets/icons/svg/edit.svg new file mode 100644 index 0000000..d26101f --- /dev/null +++ b/custom-ui/src/assets/icons/svg/edit.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/custom-ui/src/assets/icons/svg/education.svg b/custom-ui/src/assets/icons/svg/education.svg new file mode 100644 index 0000000..7bfb01d --- /dev/null +++ b/custom-ui/src/assets/icons/svg/education.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/custom-ui/src/assets/icons/svg/email.svg b/custom-ui/src/assets/icons/svg/email.svg new file mode 100644 index 0000000..74d25e2 --- /dev/null +++ b/custom-ui/src/assets/icons/svg/email.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/custom-ui/src/assets/icons/svg/example.svg b/custom-ui/src/assets/icons/svg/example.svg new file mode 100644 index 0000000..46f42b5 --- /dev/null +++ b/custom-ui/src/assets/icons/svg/example.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/custom-ui/src/assets/icons/svg/excel.svg b/custom-ui/src/assets/icons/svg/excel.svg new file mode 100644 index 0000000..74d97b8 --- /dev/null +++ b/custom-ui/src/assets/icons/svg/excel.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/custom-ui/src/assets/icons/svg/exit-fullscreen.svg b/custom-ui/src/assets/icons/svg/exit-fullscreen.svg new file mode 100644 index 0000000..485c128 --- /dev/null +++ b/custom-ui/src/assets/icons/svg/exit-fullscreen.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/custom-ui/src/assets/icons/svg/eye-open.svg b/custom-ui/src/assets/icons/svg/eye-open.svg new file mode 100644 index 0000000..88dcc98 --- /dev/null +++ b/custom-ui/src/assets/icons/svg/eye-open.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/custom-ui/src/assets/icons/svg/eye.svg b/custom-ui/src/assets/icons/svg/eye.svg new file mode 100644 index 0000000..16ed2d8 --- /dev/null +++ b/custom-ui/src/assets/icons/svg/eye.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/custom-ui/src/assets/icons/svg/form.svg b/custom-ui/src/assets/icons/svg/form.svg new file mode 100644 index 0000000..dcbaa18 --- /dev/null +++ b/custom-ui/src/assets/icons/svg/form.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/custom-ui/src/assets/icons/svg/fullscreen.svg b/custom-ui/src/assets/icons/svg/fullscreen.svg new file mode 100644 index 0000000..0e86b6f --- /dev/null +++ b/custom-ui/src/assets/icons/svg/fullscreen.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/custom-ui/src/assets/icons/svg/github.svg b/custom-ui/src/assets/icons/svg/github.svg new file mode 100644 index 0000000..db0a0d4 --- /dev/null +++ b/custom-ui/src/assets/icons/svg/github.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/custom-ui/src/assets/icons/svg/guide.svg b/custom-ui/src/assets/icons/svg/guide.svg new file mode 100644 index 0000000..b271001 --- /dev/null +++ b/custom-ui/src/assets/icons/svg/guide.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/custom-ui/src/assets/icons/svg/icon.svg b/custom-ui/src/assets/icons/svg/icon.svg new file mode 100644 index 0000000..82be8ee --- /dev/null +++ b/custom-ui/src/assets/icons/svg/icon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/custom-ui/src/assets/icons/svg/input.svg b/custom-ui/src/assets/icons/svg/input.svg new file mode 100644 index 0000000..ab91381 --- /dev/null +++ b/custom-ui/src/assets/icons/svg/input.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/custom-ui/src/assets/icons/svg/international.svg b/custom-ui/src/assets/icons/svg/international.svg new file mode 100644 index 0000000..e9b56ee --- /dev/null +++ b/custom-ui/src/assets/icons/svg/international.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/custom-ui/src/assets/icons/svg/job.svg b/custom-ui/src/assets/icons/svg/job.svg new file mode 100644 index 0000000..2a93a25 --- /dev/null +++ b/custom-ui/src/assets/icons/svg/job.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/custom-ui/src/assets/icons/svg/language.svg b/custom-ui/src/assets/icons/svg/language.svg new file mode 100644 index 0000000..0082b57 --- /dev/null +++ b/custom-ui/src/assets/icons/svg/language.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/custom-ui/src/assets/icons/svg/link.svg b/custom-ui/src/assets/icons/svg/link.svg new file mode 100644 index 0000000..48197ba --- /dev/null +++ b/custom-ui/src/assets/icons/svg/link.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/custom-ui/src/assets/icons/svg/list.svg b/custom-ui/src/assets/icons/svg/list.svg new file mode 100644 index 0000000..20259ed --- /dev/null +++ b/custom-ui/src/assets/icons/svg/list.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/custom-ui/src/assets/icons/svg/lock.svg b/custom-ui/src/assets/icons/svg/lock.svg new file mode 100644 index 0000000..74fee54 --- /dev/null +++ b/custom-ui/src/assets/icons/svg/lock.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/custom-ui/src/assets/icons/svg/log.svg b/custom-ui/src/assets/icons/svg/log.svg new file mode 100644 index 0000000..d879d33 --- /dev/null +++ b/custom-ui/src/assets/icons/svg/log.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/custom-ui/src/assets/icons/svg/logininfor.svg b/custom-ui/src/assets/icons/svg/logininfor.svg new file mode 100644 index 0000000..267f844 --- /dev/null +++ b/custom-ui/src/assets/icons/svg/logininfor.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/custom-ui/src/assets/icons/svg/message.svg b/custom-ui/src/assets/icons/svg/message.svg new file mode 100644 index 0000000..14ca817 --- /dev/null +++ b/custom-ui/src/assets/icons/svg/message.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/custom-ui/src/assets/icons/svg/money.svg b/custom-ui/src/assets/icons/svg/money.svg new file mode 100644 index 0000000..c1580de --- /dev/null +++ b/custom-ui/src/assets/icons/svg/money.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/custom-ui/src/assets/icons/svg/monitor.svg b/custom-ui/src/assets/icons/svg/monitor.svg new file mode 100644 index 0000000..bc308cb --- /dev/null +++ b/custom-ui/src/assets/icons/svg/monitor.svg @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/custom-ui/src/assets/icons/svg/nested.svg b/custom-ui/src/assets/icons/svg/nested.svg new file mode 100644 index 0000000..06713a8 --- /dev/null +++ b/custom-ui/src/assets/icons/svg/nested.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/custom-ui/src/assets/icons/svg/number.svg b/custom-ui/src/assets/icons/svg/number.svg new file mode 100644 index 0000000..ad5ce9a --- /dev/null +++ b/custom-ui/src/assets/icons/svg/number.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/custom-ui/src/assets/icons/svg/online.svg b/custom-ui/src/assets/icons/svg/online.svg new file mode 100644 index 0000000..330a202 --- /dev/null +++ b/custom-ui/src/assets/icons/svg/online.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/custom-ui/src/assets/icons/svg/password.svg b/custom-ui/src/assets/icons/svg/password.svg new file mode 100644 index 0000000..6c64def --- /dev/null +++ b/custom-ui/src/assets/icons/svg/password.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/custom-ui/src/assets/icons/svg/pdf.svg b/custom-ui/src/assets/icons/svg/pdf.svg new file mode 100644 index 0000000..957aa0c --- /dev/null +++ b/custom-ui/src/assets/icons/svg/pdf.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/custom-ui/src/assets/icons/svg/people.svg b/custom-ui/src/assets/icons/svg/people.svg new file mode 100644 index 0000000..2bd54ae --- /dev/null +++ b/custom-ui/src/assets/icons/svg/people.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/custom-ui/src/assets/icons/svg/peoples.svg b/custom-ui/src/assets/icons/svg/peoples.svg new file mode 100644 index 0000000..aab852e --- /dev/null +++ b/custom-ui/src/assets/icons/svg/peoples.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/custom-ui/src/assets/icons/svg/phone.svg b/custom-ui/src/assets/icons/svg/phone.svg new file mode 100644 index 0000000..ab8e8c4 --- /dev/null +++ b/custom-ui/src/assets/icons/svg/phone.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/custom-ui/src/assets/icons/svg/post.svg b/custom-ui/src/assets/icons/svg/post.svg new file mode 100644 index 0000000..2922c61 --- /dev/null +++ b/custom-ui/src/assets/icons/svg/post.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/custom-ui/src/assets/icons/svg/qq.svg b/custom-ui/src/assets/icons/svg/qq.svg new file mode 100644 index 0000000..ee13d4e --- /dev/null +++ b/custom-ui/src/assets/icons/svg/qq.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/custom-ui/src/assets/icons/svg/question.svg b/custom-ui/src/assets/icons/svg/question.svg new file mode 100644 index 0000000..cf75bd4 --- /dev/null +++ b/custom-ui/src/assets/icons/svg/question.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/custom-ui/src/assets/icons/svg/radio.svg b/custom-ui/src/assets/icons/svg/radio.svg new file mode 100644 index 0000000..0cde345 --- /dev/null +++ b/custom-ui/src/assets/icons/svg/radio.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/custom-ui/src/assets/icons/svg/rate.svg b/custom-ui/src/assets/icons/svg/rate.svg new file mode 100644 index 0000000..aa3b14d --- /dev/null +++ b/custom-ui/src/assets/icons/svg/rate.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/custom-ui/src/assets/icons/svg/redis-list.svg b/custom-ui/src/assets/icons/svg/redis-list.svg new file mode 100644 index 0000000..98a15b2 --- /dev/null +++ b/custom-ui/src/assets/icons/svg/redis-list.svg @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/custom-ui/src/assets/icons/svg/redis.svg b/custom-ui/src/assets/icons/svg/redis.svg new file mode 100644 index 0000000..2f1d62d --- /dev/null +++ b/custom-ui/src/assets/icons/svg/redis.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/custom-ui/src/assets/icons/svg/row.svg b/custom-ui/src/assets/icons/svg/row.svg new file mode 100644 index 0000000..0780992 --- /dev/null +++ b/custom-ui/src/assets/icons/svg/row.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/custom-ui/src/assets/icons/svg/search.svg b/custom-ui/src/assets/icons/svg/search.svg new file mode 100644 index 0000000..84233dd --- /dev/null +++ b/custom-ui/src/assets/icons/svg/search.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/custom-ui/src/assets/icons/svg/select.svg b/custom-ui/src/assets/icons/svg/select.svg new file mode 100644 index 0000000..d628382 --- /dev/null +++ b/custom-ui/src/assets/icons/svg/select.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/custom-ui/src/assets/icons/svg/server.svg b/custom-ui/src/assets/icons/svg/server.svg new file mode 100644 index 0000000..eb287e3 --- /dev/null +++ b/custom-ui/src/assets/icons/svg/server.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/custom-ui/src/assets/icons/svg/shopping.svg b/custom-ui/src/assets/icons/svg/shopping.svg new file mode 100644 index 0000000..87513e7 --- /dev/null +++ b/custom-ui/src/assets/icons/svg/shopping.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/custom-ui/src/assets/icons/svg/size.svg b/custom-ui/src/assets/icons/svg/size.svg new file mode 100644 index 0000000..ddb25b8 --- /dev/null +++ b/custom-ui/src/assets/icons/svg/size.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/custom-ui/src/assets/icons/svg/skill.svg b/custom-ui/src/assets/icons/svg/skill.svg new file mode 100644 index 0000000..a3b7312 --- /dev/null +++ b/custom-ui/src/assets/icons/svg/skill.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/custom-ui/src/assets/icons/svg/slider.svg b/custom-ui/src/assets/icons/svg/slider.svg new file mode 100644 index 0000000..fbe4f39 --- /dev/null +++ b/custom-ui/src/assets/icons/svg/slider.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/custom-ui/src/assets/icons/svg/star.svg b/custom-ui/src/assets/icons/svg/star.svg new file mode 100644 index 0000000..6cf86e6 --- /dev/null +++ b/custom-ui/src/assets/icons/svg/star.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/custom-ui/src/assets/icons/svg/swagger.svg b/custom-ui/src/assets/icons/svg/swagger.svg new file mode 100644 index 0000000..05d4e7b --- /dev/null +++ b/custom-ui/src/assets/icons/svg/swagger.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/custom-ui/src/assets/icons/svg/switch.svg b/custom-ui/src/assets/icons/svg/switch.svg new file mode 100644 index 0000000..0ba61e3 --- /dev/null +++ b/custom-ui/src/assets/icons/svg/switch.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/custom-ui/src/assets/icons/svg/system.svg b/custom-ui/src/assets/icons/svg/system.svg new file mode 100644 index 0000000..5992593 --- /dev/null +++ b/custom-ui/src/assets/icons/svg/system.svg @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/custom-ui/src/assets/icons/svg/tab.svg b/custom-ui/src/assets/icons/svg/tab.svg new file mode 100644 index 0000000..b4b48e4 --- /dev/null +++ b/custom-ui/src/assets/icons/svg/tab.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/custom-ui/src/assets/icons/svg/table.svg b/custom-ui/src/assets/icons/svg/table.svg new file mode 100644 index 0000000..0e3dc9d --- /dev/null +++ b/custom-ui/src/assets/icons/svg/table.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/custom-ui/src/assets/icons/svg/textarea.svg b/custom-ui/src/assets/icons/svg/textarea.svg new file mode 100644 index 0000000..2709f29 --- /dev/null +++ b/custom-ui/src/assets/icons/svg/textarea.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/custom-ui/src/assets/icons/svg/theme.svg b/custom-ui/src/assets/icons/svg/theme.svg new file mode 100644 index 0000000..5982a2f --- /dev/null +++ b/custom-ui/src/assets/icons/svg/theme.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/custom-ui/src/assets/icons/svg/time-range.svg b/custom-ui/src/assets/icons/svg/time-range.svg new file mode 100644 index 0000000..13c1202 --- /dev/null +++ b/custom-ui/src/assets/icons/svg/time-range.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/custom-ui/src/assets/icons/svg/time.svg b/custom-ui/src/assets/icons/svg/time.svg new file mode 100644 index 0000000..b376e32 --- /dev/null +++ b/custom-ui/src/assets/icons/svg/time.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/custom-ui/src/assets/icons/svg/tool.svg b/custom-ui/src/assets/icons/svg/tool.svg new file mode 100644 index 0000000..48e0e35 --- /dev/null +++ b/custom-ui/src/assets/icons/svg/tool.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/custom-ui/src/assets/icons/svg/tree-table.svg b/custom-ui/src/assets/icons/svg/tree-table.svg new file mode 100644 index 0000000..8aafdb8 --- /dev/null +++ b/custom-ui/src/assets/icons/svg/tree-table.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/custom-ui/src/assets/icons/svg/tree.svg b/custom-ui/src/assets/icons/svg/tree.svg new file mode 100644 index 0000000..dd4b7dd --- /dev/null +++ b/custom-ui/src/assets/icons/svg/tree.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/custom-ui/src/assets/icons/svg/upload.svg b/custom-ui/src/assets/icons/svg/upload.svg new file mode 100644 index 0000000..bae49c0 --- /dev/null +++ b/custom-ui/src/assets/icons/svg/upload.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/custom-ui/src/assets/icons/svg/user.svg b/custom-ui/src/assets/icons/svg/user.svg new file mode 100644 index 0000000..0ba0716 --- /dev/null +++ b/custom-ui/src/assets/icons/svg/user.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/custom-ui/src/assets/icons/svg/validCode.svg b/custom-ui/src/assets/icons/svg/validCode.svg new file mode 100644 index 0000000..cfb1021 --- /dev/null +++ b/custom-ui/src/assets/icons/svg/validCode.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/custom-ui/src/assets/icons/svg/wechat.svg b/custom-ui/src/assets/icons/svg/wechat.svg new file mode 100644 index 0000000..c586e55 --- /dev/null +++ b/custom-ui/src/assets/icons/svg/wechat.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/custom-ui/src/assets/icons/svg/zip.svg b/custom-ui/src/assets/icons/svg/zip.svg new file mode 100644 index 0000000..f806fc4 --- /dev/null +++ b/custom-ui/src/assets/icons/svg/zip.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/custom-ui/src/assets/icons/svgo.yml b/custom-ui/src/assets/icons/svgo.yml new file mode 100644 index 0000000..d11906a --- /dev/null +++ b/custom-ui/src/assets/icons/svgo.yml @@ -0,0 +1,22 @@ +# replace default config + +# multipass: true +# full: true + +plugins: + + # - name + # + # or: + # - name: false + # - name: true + # + # or: + # - name: + # param1: 1 + # param2: 2 + +- removeAttrs: + attrs: + - 'fill' + - 'fill-rule' diff --git a/custom-ui/src/assets/images/dark.svg b/custom-ui/src/assets/images/dark.svg new file mode 100644 index 0000000..f646bd7 --- /dev/null +++ b/custom-ui/src/assets/images/dark.svg @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/custom-ui/src/assets/images/light.svg b/custom-ui/src/assets/images/light.svg new file mode 100644 index 0000000..ab7cc08 --- /dev/null +++ b/custom-ui/src/assets/images/light.svg @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/custom-ui/src/assets/images/login-background.jpg b/custom-ui/src/assets/images/login-background.jpg new file mode 100644 index 0000000..8a89eb8 Binary files /dev/null and b/custom-ui/src/assets/images/login-background.jpg differ diff --git a/custom-ui/src/assets/images/profile.jpg b/custom-ui/src/assets/images/profile.jpg new file mode 100644 index 0000000..b3a940b Binary files /dev/null and b/custom-ui/src/assets/images/profile.jpg differ diff --git a/custom-ui/src/assets/logo/logo.png b/custom-ui/src/assets/logo/logo.png new file mode 100644 index 0000000..e263760 Binary files /dev/null and b/custom-ui/src/assets/logo/logo.png differ diff --git a/custom-ui/src/assets/styles/btn.scss b/custom-ui/src/assets/styles/btn.scss new file mode 100644 index 0000000..e6ba1a8 --- /dev/null +++ b/custom-ui/src/assets/styles/btn.scss @@ -0,0 +1,99 @@ +@import './variables.scss'; + +@mixin colorBtn($color) { + background: $color; + + &:hover { + color: $color; + + &:before, + &:after { + background: $color; + } + } +} + +.blue-btn { + @include colorBtn($blue) +} + +.light-blue-btn { + @include colorBtn($light-blue) +} + +.red-btn { + @include colorBtn($red) +} + +.pink-btn { + @include colorBtn($pink) +} + +.green-btn { + @include colorBtn($green) +} + +.tiffany-btn { + @include colorBtn($tiffany) +} + +.yellow-btn { + @include colorBtn($yellow) +} + +.pan-btn { + font-size: 14px; + color: #fff; + padding: 14px 36px; + border-radius: 8px; + border: none; + outline: none; + transition: 600ms ease all; + position: relative; + display: inline-block; + + &:hover { + background: #fff; + + &:before, + &:after { + width: 100%; + transition: 600ms ease all; + } + } + + &:before, + &:after { + content: ''; + position: absolute; + top: 0; + right: 0; + height: 2px; + width: 0; + transition: 400ms ease all; + } + + &::after { + right: inherit; + top: inherit; + left: 0; + bottom: 0; + } +} + +.custom-button { + display: inline-block; + line-height: 1; + white-space: nowrap; + cursor: pointer; + background: #fff; + color: #fff; + -webkit-appearance: none; + text-align: center; + box-sizing: border-box; + outline: 0; + margin: 0; + padding: 10px 15px; + font-size: 14px; + border-radius: 4px; +} diff --git a/custom-ui/src/assets/styles/element-ui.scss b/custom-ui/src/assets/styles/element-ui.scss new file mode 100644 index 0000000..363092a --- /dev/null +++ b/custom-ui/src/assets/styles/element-ui.scss @@ -0,0 +1,92 @@ +// cover some element-ui styles + +.el-breadcrumb__inner, +.el-breadcrumb__inner a { + font-weight: 400 !important; +} + +.el-upload { + input[type="file"] { + display: none !important; + } +} + +.el-upload__input { + display: none; +} + +.cell { + .el-tag { + margin-right: 0px; + } +} + +.small-padding { + .cell { + padding-left: 5px; + padding-right: 5px; + } +} + +.fixed-width { + .el-button--mini { + padding: 7px 10px; + width: 60px; + } +} + +.status-col { + .cell { + padding: 0 10px; + text-align: center; + + .el-tag { + margin-right: 0px; + } + } +} + +// to fixed https://github.com/ElemeFE/element/issues/2461 +.el-dialog { + transform: none; + left: 0; + position: relative; + margin: 0 auto; +} + +// refine element ui upload +.upload-container { + .el-upload { + width: 100%; + + .el-upload-dragger { + width: 100%; + height: 200px; + } + } +} + +// dropdown +.el-dropdown-menu { + a { + display: block + } +} + +// fix date-picker ui bug in filter-item +.el-range-editor.el-input__inner { + display: inline-flex !important; +} + +// to fix el-date-picker css style +.el-range-separator { + box-sizing: content-box; +} + +.el-menu--collapse + > div + > .el-submenu + > .el-submenu__title + .el-submenu__icon-arrow { + display: none; +} \ No newline at end of file diff --git a/custom-ui/src/assets/styles/element-variables.scss b/custom-ui/src/assets/styles/element-variables.scss new file mode 100644 index 0000000..1615ff2 --- /dev/null +++ b/custom-ui/src/assets/styles/element-variables.scss @@ -0,0 +1,31 @@ +/** +* I think element-ui's default theme color is too light for long-term use. +* So I modified the default color and you can modify it to your liking. +**/ + +/* theme color */ +$--color-primary: #1890ff; +$--color-success: #13ce66; +$--color-warning: #ffba00; +$--color-danger: #ff4949; +// $--color-info: #1E1E1E; + +$--button-font-weight: 400; + +// $--color-text-regular: #1f2d3d; + +$--border-color-light: #dfe4ed; +$--border-color-lighter: #e6ebf5; + +$--table-border: 1px solid #dfe6ec; + +/* icon font path, required */ +$--font-path: '~element-ui/lib/theme-chalk/fonts'; + +@import "~element-ui/packages/theme-chalk/src/index"; + +// the :export directive is the magic sauce for webpack +// https://www.bluematador.com/blog/how-to-share-variables-between-js-and-sass +:export { + theme: $--color-primary; +} diff --git a/custom-ui/src/assets/styles/index.scss b/custom-ui/src/assets/styles/index.scss new file mode 100644 index 0000000..96095ef --- /dev/null +++ b/custom-ui/src/assets/styles/index.scss @@ -0,0 +1,191 @@ +@import './variables.scss'; +@import './mixin.scss'; +@import './transition.scss'; +@import './element-ui.scss'; +@import './sidebar.scss'; +@import './btn.scss'; + +body { + height: 100%; + -moz-osx-font-smoothing: grayscale; + -webkit-font-smoothing: antialiased; + text-rendering: optimizeLegibility; + font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Arial, sans-serif; +} + +label { + font-weight: 700; +} + +html { + height: 100%; + box-sizing: border-box; +} + +#app { + height: 100%; +} + +*, +*:before, +*:after { + box-sizing: inherit; +} + +.no-padding { + padding: 0px !important; +} + +.padding-content { + padding: 4px 0; +} + +a:focus, +a:active { + outline: none; +} + +a, +a:focus, +a:hover { + cursor: pointer; + color: inherit; + text-decoration: none; +} + +div:focus { + outline: none; +} + +.fr { + float: right; +} + +.fl { + float: left; +} + +.pr-5 { + padding-right: 5px; +} + +.pl-5 { + padding-left: 5px; +} + +.block { + display: block; +} + +.pointer { + cursor: pointer; +} + +.inlineBlock { + display: block; +} + +.clearfix { + &:after { + visibility: hidden; + display: block; + font-size: 0; + content: " "; + clear: both; + height: 0; + } +} + +aside { + background: #eef1f6; + padding: 8px 24px; + margin-bottom: 20px; + border-radius: 2px; + display: block; + line-height: 32px; + font-size: 16px; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; + color: #2c3e50; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + + a { + color: #337ab7; + cursor: pointer; + + &:hover { + color: rgb(32, 160, 255); + } + } +} + +//main-container全局样式 +.app-container { + padding: 20px; +} + +.components-container { + margin: 30px 50px; + position: relative; +} + +.pagination-container { + margin-top: 30px; +} + +.text-center { + text-align: center +} + +.sub-navbar { + height: 50px; + line-height: 50px; + position: relative; + width: 100%; + text-align: right; + padding-right: 20px; + transition: 600ms ease position; + background: linear-gradient(90deg, rgba(32, 182, 249, 1) 0%, rgba(32, 182, 249, 1) 0%, rgba(33, 120, 241, 1) 100%, rgba(33, 120, 241, 1) 100%); + + .subtitle { + font-size: 20px; + color: #fff; + } + + &.draft { + background: #d0d0d0; + } + + &.deleted { + background: #d0d0d0; + } +} + +.link-type, +.link-type:focus { + color: #337ab7; + cursor: pointer; + + &:hover { + color: rgb(32, 160, 255); + } +} + +.filter-container { + padding-bottom: 10px; + + .filter-item { + display: inline-block; + vertical-align: middle; + margin-bottom: 10px; + } +} + +//refine vue-multiselect plugin +.multiselect { + line-height: 16px; +} + +.multiselect--active { + z-index: 1000 !important; +} diff --git a/custom-ui/src/assets/styles/mixin.scss b/custom-ui/src/assets/styles/mixin.scss new file mode 100644 index 0000000..06fa061 --- /dev/null +++ b/custom-ui/src/assets/styles/mixin.scss @@ -0,0 +1,66 @@ +@mixin clearfix { + &:after { + content: ""; + display: table; + clear: both; + } +} + +@mixin scrollBar { + &::-webkit-scrollbar-track-piece { + background: #d3dce6; + } + + &::-webkit-scrollbar { + width: 6px; + } + + &::-webkit-scrollbar-thumb { + background: #99a9bf; + border-radius: 20px; + } +} + +@mixin relative { + position: relative; + width: 100%; + height: 100%; +} + +@mixin pct($pct) { + width: #{$pct}; + position: relative; + margin: 0 auto; +} + +@mixin triangle($width, $height, $color, $direction) { + $width: $width/2; + $color-border-style: $height solid $color; + $transparent-border-style: $width solid transparent; + height: 0; + width: 0; + + @if $direction==up { + border-bottom: $color-border-style; + border-left: $transparent-border-style; + border-right: $transparent-border-style; + } + + @else if $direction==right { + border-left: $color-border-style; + border-top: $transparent-border-style; + border-bottom: $transparent-border-style; + } + + @else if $direction==down { + border-top: $color-border-style; + border-left: $transparent-border-style; + border-right: $transparent-border-style; + } + + @else if $direction==left { + border-right: $color-border-style; + border-top: $transparent-border-style; + border-bottom: $transparent-border-style; + } +} diff --git a/custom-ui/src/assets/styles/ruoyi.scss b/custom-ui/src/assets/styles/ruoyi.scss new file mode 100644 index 0000000..db8c29b --- /dev/null +++ b/custom-ui/src/assets/styles/ruoyi.scss @@ -0,0 +1,277 @@ + /** + * 通用css样式布局处理 + * Copyright (c) 2019 ruoyi + */ + + /** 基础通用 **/ +.pt5 { + padding-top: 5px; +} +.pr5 { + padding-right: 5px; +} +.pb5 { + padding-bottom: 5px; +} +.mt5 { + margin-top: 5px; +} +.mr5 { + margin-right: 5px; +} +.mb5 { + margin-bottom: 5px; +} +.mb8 { + margin-bottom: 8px; +} +.ml5 { + margin-left: 5px; +} +.mt10 { + margin-top: 10px; +} +.mr10 { + margin-right: 10px; +} +.mb10 { + margin-bottom: 10px; +} +.ml10 { + margin-left: 10px; +} +.mt20 { + margin-top: 20px; +} +.mr20 { + margin-right: 20px; +} +.mb20 { + margin-bottom: 20px; +} +.ml20 { + margin-left: 20px; +} + +.h1, .h2, .h3, .h4, .h5, .h6, h1, h2, h3, h4, h5, h6 { + font-family: inherit; + font-weight: 500; + line-height: 1.1; + color: inherit; +} + +.el-message-box__status + .el-message-box__message{ + word-break: break-word; +} + +.el-dialog:not(.is-fullscreen) { + margin-top: 6vh !important; +} + +.el-dialog__wrapper.scrollbar .el-dialog .el-dialog__body { + overflow: auto; + overflow-x: hidden; + max-height: 70vh; + padding: 10px 20px 0; +} + +.el-table { + .el-table__header-wrapper, .el-table__fixed-header-wrapper { + th { + word-break: break-word; + background-color: #f8f8f9; + color: #515a6e; + height: 40px; + font-size: 13px; + } + } + .el-table__body-wrapper { + .el-button [class*="el-icon-"] + span { + margin-left: 1px; + } + } +} + +/** 表单布局 **/ +.form-header { + font-size:15px; + color:#6379bb; + border-bottom:1px solid #ddd; + margin:8px 10px 25px 10px; + padding-bottom:5px +} + +/** 表格布局 **/ +.pagination-container { + position: relative; + height: 25px; + margin-bottom: 10px; + margin-top: 15px; + padding: 10px 20px !important; +} + +/* tree border */ +.tree-border { + margin-top: 5px; + border: 1px solid #e5e6e7; + background: #FFFFFF none; + border-radius:4px; +} + +.pagination-container .el-pagination { + right: 0; + position: absolute; +} + +@media ( max-width : 768px) { + .pagination-container .el-pagination > .el-pagination__jump { + display: none !important; + } + .pagination-container .el-pagination > .el-pagination__sizes { + display: none !important; + } +} + +.el-table .fixed-width .el-button--mini { + padding-left: 0; + padding-right: 0; + width: inherit; +} + +/** 表格更多操作下拉样式 */ +.el-table .el-dropdown-link,.el-table .el-dropdown-selfdefine { + cursor: pointer; + margin-left: 5px; +} + +.el-table .el-dropdown, .el-icon-arrow-down { + font-size: 12px; +} + +.el-tree-node__content > .el-checkbox { + margin-right: 8px; +} + +.list-group-striped > .list-group-item { + border-left: 0; + border-right: 0; + border-radius: 0; + padding-left: 0; + padding-right: 0; +} + +.list-group { + padding-left: 0px; + list-style: none; +} + +.list-group-item { + border-bottom: 1px solid #e7eaec; + border-top: 1px solid #e7eaec; + margin-bottom: -1px; + padding: 11px 0px; + font-size: 13px; +} + +.pull-right { + float: right !important; +} + +.el-card__header { + padding: 14px 15px 7px; + min-height: 40px; +} + +.el-card__body { + padding: 15px 20px 20px 20px; +} + +.card-box { + padding-right: 15px; + padding-left: 15px; + margin-bottom: 10px; +} + +/* button color */ +.el-button--cyan.is-active, +.el-button--cyan:active { + background: #20B2AA; + border-color: #20B2AA; + color: #FFFFFF; +} + +.el-button--cyan:focus, +.el-button--cyan:hover { + background: #48D1CC; + border-color: #48D1CC; + color: #FFFFFF; +} + +.el-button--cyan { + background-color: #20B2AA; + border-color: #20B2AA; + color: #FFFFFF; +} + +/* text color */ +.text-navy { + color: #1ab394; +} + +.text-primary { + color: inherit; +} + +.text-success { + color: #1c84c6; +} + +.text-info { + color: #23c6c8; +} + +.text-warning { + color: #f8ac59; +} + +.text-danger { + color: #ed5565; +} + +.text-muted { + color: #888888; +} + +/* image */ +.img-circle { + border-radius: 50%; +} + +.img-lg { + width: 120px; + height: 120px; +} + +.avatar-upload-preview { + position: relative; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 200px; + height: 200px; + border-radius: 50%; + box-shadow: 0 0 4px #ccc; + overflow: hidden; +} + +/* 拖拽列样式 */ +.sortable-ghost{ + opacity: .8; + color: #fff!important; + background: #42b983!important; +} + +.top-right-btn { + position: relative; + float: right; +} diff --git a/custom-ui/src/assets/styles/sidebar.scss b/custom-ui/src/assets/styles/sidebar.scss new file mode 100644 index 0000000..ed308b8 --- /dev/null +++ b/custom-ui/src/assets/styles/sidebar.scss @@ -0,0 +1,227 @@ +#app { + + .main-container { + min-height: 100%; + transition: margin-left .28s; + margin-left: $base-sidebar-width; + position: relative; + } + + .sidebarHide { + margin-left: 0!important; + } + + .sidebar-container { + -webkit-transition: width .28s; + transition: width 0.28s; + width: $base-sidebar-width !important; + background-color: $base-menu-background; + height: 100%; + position: fixed; + font-size: 0px; + top: 0; + bottom: 0; + left: 0; + z-index: 1001; + overflow: hidden; + -webkit-box-shadow: 2px 0 6px rgba(0,21,41,.35); + box-shadow: 2px 0 6px rgba(0,21,41,.35); + + // reset element-ui css + .horizontal-collapse-transition { + transition: 0s width ease-in-out, 0s padding-left ease-in-out, 0s padding-right ease-in-out; + } + + .scrollbar-wrapper { + overflow-x: hidden !important; + } + + .el-scrollbar__bar.is-vertical { + right: 0px; + } + + .el-scrollbar { + height: 100%; + } + + &.has-logo { + .el-scrollbar { + height: calc(100% - 50px); + } + } + + .is-horizontal { + display: none; + } + + a { + display: inline-block; + width: 100%; + overflow: hidden; + } + + .svg-icon { + margin-right: 16px; + } + + .el-menu { + border: none; + height: 100%; + width: 100% !important; + } + + .el-menu-item, .el-submenu__title { + overflow: hidden !important; + text-overflow: ellipsis !important; + white-space: nowrap !important; + } + + // menu hover + .submenu-title-noDropdown, + .el-submenu__title { + &:hover { + background-color: rgba(0, 0, 0, 0.06) !important; + } + } + + & .theme-dark .is-active > .el-submenu__title { + color: $base-menu-color-active !important; + } + + & .nest-menu .el-submenu>.el-submenu__title, + & .el-submenu .el-menu-item { + min-width: $base-sidebar-width !important; + + &:hover { + background-color: rgba(0, 0, 0, 0.06) !important; + } + } + + & .theme-dark .nest-menu .el-submenu>.el-submenu__title, + & .theme-dark .el-submenu .el-menu-item { + background-color: $base-sub-menu-background !important; + + &:hover { + background-color: $base-sub-menu-hover !important; + } + } + } + + .hideSidebar { + .sidebar-container { + width: 54px !important; + } + + .main-container { + margin-left: 54px; + } + + .submenu-title-noDropdown { + padding: 0 !important; + position: relative; + + .el-tooltip { + padding: 0 !important; + + .svg-icon { + margin-left: 20px; + } + } + } + + .el-submenu { + overflow: hidden; + + &>.el-submenu__title { + padding: 0 !important; + + .svg-icon { + margin-left: 20px; + } + + } + } + + .el-menu--collapse { + .el-submenu { + &>.el-submenu__title { + &>span { + height: 0; + width: 0; + overflow: hidden; + visibility: hidden; + display: inline-block; + } + } + } + } + } + + .el-menu--collapse .el-menu .el-submenu { + min-width: $base-sidebar-width !important; + } + + // mobile responsive + .mobile { + .main-container { + margin-left: 0px; + } + + .sidebar-container { + transition: transform .28s; + width: $base-sidebar-width !important; + } + + &.hideSidebar { + .sidebar-container { + pointer-events: none; + transition-duration: 0.3s; + transform: translate3d(-$base-sidebar-width, 0, 0); + } + } + } + + .withoutAnimation { + + .main-container, + .sidebar-container { + transition: none; + } + } +} + +// when menu collapsed +.el-menu--vertical { + &>.el-menu { + .svg-icon { + margin-right: 16px; + } + } + + .nest-menu .el-submenu>.el-submenu__title, + .el-menu-item { + &:hover { + // you can use $subMenuHover + background-color: rgba(0, 0, 0, 0.06) !important; + } + } + + // the scroll bar appears when the subMenu is too long + >.el-menu--popup { + max-height: 100vh; + overflow-y: auto; + + &::-webkit-scrollbar-track-piece { + background: #d3dce6; + } + + &::-webkit-scrollbar { + width: 6px; + } + + &::-webkit-scrollbar-thumb { + background: #99a9bf; + border-radius: 20px; + } + } +} diff --git a/custom-ui/src/assets/styles/transition.scss b/custom-ui/src/assets/styles/transition.scss new file mode 100644 index 0000000..eb49895 --- /dev/null +++ b/custom-ui/src/assets/styles/transition.scss @@ -0,0 +1,53 @@ +// global transition css + +/* fade */ +.fade-enter-active, +.fade-leave-active { + transition: opacity 0.28s; +} + +.fade-enter, +.fade-leave-active { + opacity: 0; +} + +/* fade-transform */ +.fade-transform--move, +.fade-transform-leave-active, +.fade-transform-enter-active { + transition: all .5s; +} + +.fade-transform-leave-active { + position: absolute; +} + +.fade-transform-enter { + opacity: 0; + transform: translateX(-30px); +} + +.fade-transform-leave-to { + opacity: 0; + transform: translateX(30px); +} + +/* breadcrumb transition */ +.breadcrumb-enter-active, +.breadcrumb-leave-active { + transition: all .5s; +} + +.breadcrumb-enter, +.breadcrumb-leave-active { + opacity: 0; + transform: translateX(20px); +} + +.breadcrumb-move { + transition: all .5s; +} + +.breadcrumb-leave-active { + position: absolute; +} diff --git a/custom-ui/src/assets/styles/variables.scss b/custom-ui/src/assets/styles/variables.scss new file mode 100644 index 0000000..34484d4 --- /dev/null +++ b/custom-ui/src/assets/styles/variables.scss @@ -0,0 +1,54 @@ +// base color +$blue:#324157; +$light-blue:#3A71A8; +$red:#C03639; +$pink: #E65D6E; +$green: #30B08F; +$tiffany: #4AB7BD; +$yellow:#FEC171; +$panGreen: #30B08F; + +// 默认菜单主题风格 +$base-menu-color:#bfcbd9; +$base-menu-color-active:#f4f4f5; +$base-menu-background:#304156; +$base-logo-title-color: #ffffff; + +$base-menu-light-color:rgba(0,0,0,.70); +$base-menu-light-background:#ffffff; +$base-logo-light-title-color: #001529; + +$base-sub-menu-background:#1f2d3d; +$base-sub-menu-hover:#001528; + +// 自定义暗色菜单风格 +/** +$base-menu-color:hsla(0,0%,100%,.65); +$base-menu-color-active:#fff; +$base-menu-background:#001529; +$base-logo-title-color: #ffffff; + +$base-menu-light-color:rgba(0,0,0,.70); +$base-menu-light-background:#ffffff; +$base-logo-light-title-color: #001529; + +$base-sub-menu-background:#000c17; +$base-sub-menu-hover:#001528; +*/ + +$base-sidebar-width: 200px; + +// the :export directive is the magic sauce for webpack +// https://www.bluematador.com/blog/how-to-share-variables-between-js-and-sass +:export { + menuColor: $base-menu-color; + menuLightColor: $base-menu-light-color; + menuColorActive: $base-menu-color-active; + menuBackground: $base-menu-background; + menuLightBackground: $base-menu-light-background; + subMenuBackground: $base-sub-menu-background; + subMenuHover: $base-sub-menu-hover; + sideBarWidth: $base-sidebar-width; + logoTitleColor: $base-logo-title-color; + logoLightTitleColor: $base-logo-light-title-color +} diff --git a/custom-ui/src/components/Breadcrumb/index.vue b/custom-ui/src/components/Breadcrumb/index.vue new file mode 100644 index 0000000..1696f54 --- /dev/null +++ b/custom-ui/src/components/Breadcrumb/index.vue @@ -0,0 +1,74 @@ + + + + + diff --git a/custom-ui/src/components/Crontab/day.vue b/custom-ui/src/components/Crontab/day.vue new file mode 100644 index 0000000..fe3eaf0 --- /dev/null +++ b/custom-ui/src/components/Crontab/day.vue @@ -0,0 +1,161 @@ + + + diff --git a/custom-ui/src/components/Crontab/hour.vue b/custom-ui/src/components/Crontab/hour.vue new file mode 100644 index 0000000..4b1f1fc --- /dev/null +++ b/custom-ui/src/components/Crontab/hour.vue @@ -0,0 +1,114 @@ + + + diff --git a/custom-ui/src/components/Crontab/index.vue b/custom-ui/src/components/Crontab/index.vue new file mode 100644 index 0000000..3963df2 --- /dev/null +++ b/custom-ui/src/components/Crontab/index.vue @@ -0,0 +1,430 @@ + + + + diff --git a/custom-ui/src/components/Crontab/min.vue b/custom-ui/src/components/Crontab/min.vue new file mode 100644 index 0000000..43cab90 --- /dev/null +++ b/custom-ui/src/components/Crontab/min.vue @@ -0,0 +1,116 @@ + + + \ No newline at end of file diff --git a/custom-ui/src/components/Crontab/month.vue b/custom-ui/src/components/Crontab/month.vue new file mode 100644 index 0000000..fd0ac38 --- /dev/null +++ b/custom-ui/src/components/Crontab/month.vue @@ -0,0 +1,114 @@ + + + diff --git a/custom-ui/src/components/Crontab/result.vue b/custom-ui/src/components/Crontab/result.vue new file mode 100644 index 0000000..aea6e0e --- /dev/null +++ b/custom-ui/src/components/Crontab/result.vue @@ -0,0 +1,559 @@ + + + diff --git a/custom-ui/src/components/Crontab/second.vue b/custom-ui/src/components/Crontab/second.vue new file mode 100644 index 0000000..e7b7761 --- /dev/null +++ b/custom-ui/src/components/Crontab/second.vue @@ -0,0 +1,117 @@ + + + diff --git a/custom-ui/src/components/Crontab/week.vue b/custom-ui/src/components/Crontab/week.vue new file mode 100644 index 0000000..1cec700 --- /dev/null +++ b/custom-ui/src/components/Crontab/week.vue @@ -0,0 +1,202 @@ + + + diff --git a/custom-ui/src/components/Crontab/year.vue b/custom-ui/src/components/Crontab/year.vue new file mode 100644 index 0000000..5487a6c --- /dev/null +++ b/custom-ui/src/components/Crontab/year.vue @@ -0,0 +1,131 @@ + + + diff --git a/custom-ui/src/components/DictData/index.js b/custom-ui/src/components/DictData/index.js new file mode 100644 index 0000000..7b85d4a --- /dev/null +++ b/custom-ui/src/components/DictData/index.js @@ -0,0 +1,49 @@ +import Vue from 'vue' +import store from '@/store' +import DataDict from '@/utils/dict' +import { getDicts as getDicts } from '@/api/system/dict/data' + +function searchDictByKey(dict, key) { + if (key == null && key == "") { + return null + } + try { + for (let i = 0; i < dict.length; i++) { + if (dict[i].key == key) { + return dict[i].value + } + } + } catch (e) { + return null + } +} + +function install() { + Vue.use(DataDict, { + metas: { + '*': { + labelField: 'dictLabel', + valueField: 'dictValue', + request(dictMeta) { + const storeDict = searchDictByKey(store.getters.dict, dictMeta.type) + if (storeDict) { + return new Promise(resolve => { resolve(storeDict) }) + } else { + return new Promise((resolve, reject) => { + getDicts(dictMeta.type).then(res => { + store.dispatch('dict/setDict', { key: dictMeta.type, value: res.data }) + resolve(res.data) + }).catch(error => { + reject(error) + }) + }) + } + }, + }, + }, + }) +} + +export default { + install, +} \ No newline at end of file diff --git a/custom-ui/src/components/DictTag/index.vue b/custom-ui/src/components/DictTag/index.vue new file mode 100644 index 0000000..4c196c4 --- /dev/null +++ b/custom-ui/src/components/DictTag/index.vue @@ -0,0 +1,52 @@ + + + + \ No newline at end of file diff --git a/custom-ui/src/components/Editor/index.vue b/custom-ui/src/components/Editor/index.vue new file mode 100644 index 0000000..6bb5a18 --- /dev/null +++ b/custom-ui/src/components/Editor/index.vue @@ -0,0 +1,272 @@ + + + + + diff --git a/custom-ui/src/components/FileUpload/index.vue b/custom-ui/src/components/FileUpload/index.vue new file mode 100644 index 0000000..6c583cf --- /dev/null +++ b/custom-ui/src/components/FileUpload/index.vue @@ -0,0 +1,215 @@ + + + + + diff --git a/custom-ui/src/components/Hamburger/index.vue b/custom-ui/src/components/Hamburger/index.vue new file mode 100644 index 0000000..368b002 --- /dev/null +++ b/custom-ui/src/components/Hamburger/index.vue @@ -0,0 +1,44 @@ + + + + + diff --git a/custom-ui/src/components/HeaderSearch/index.vue b/custom-ui/src/components/HeaderSearch/index.vue new file mode 100644 index 0000000..c4d76bb --- /dev/null +++ b/custom-ui/src/components/HeaderSearch/index.vue @@ -0,0 +1,189 @@ + + + + + diff --git a/custom-ui/src/components/IconSelect/index.vue b/custom-ui/src/components/IconSelect/index.vue new file mode 100644 index 0000000..b0ec9fa --- /dev/null +++ b/custom-ui/src/components/IconSelect/index.vue @@ -0,0 +1,68 @@ + + + + + + diff --git a/custom-ui/src/components/IconSelect/requireIcons.js b/custom-ui/src/components/IconSelect/requireIcons.js new file mode 100644 index 0000000..99e5c54 --- /dev/null +++ b/custom-ui/src/components/IconSelect/requireIcons.js @@ -0,0 +1,11 @@ + +const req = require.context('../../assets/icons/svg', false, /\.svg$/) +const requireAll = requireContext => requireContext.keys() + +const re = /\.\/(.*)\.svg/ + +const icons = requireAll(req).map(i => { + return i.match(re)[1] +}) + +export default icons diff --git a/custom-ui/src/components/ImagePreview/index.vue b/custom-ui/src/components/ImagePreview/index.vue new file mode 100644 index 0000000..3c770c7 --- /dev/null +++ b/custom-ui/src/components/ImagePreview/index.vue @@ -0,0 +1,90 @@ + + + + + diff --git a/custom-ui/src/components/ImageUpload/index.vue b/custom-ui/src/components/ImageUpload/index.vue new file mode 100644 index 0000000..b57a15e --- /dev/null +++ b/custom-ui/src/components/ImageUpload/index.vue @@ -0,0 +1,226 @@ + + + + + diff --git a/custom-ui/src/components/Pagination/index.vue b/custom-ui/src/components/Pagination/index.vue new file mode 100644 index 0000000..56f5a6b --- /dev/null +++ b/custom-ui/src/components/Pagination/index.vue @@ -0,0 +1,114 @@ + + + + + diff --git a/custom-ui/src/components/PanThumb/index.vue b/custom-ui/src/components/PanThumb/index.vue new file mode 100644 index 0000000..1bcf417 --- /dev/null +++ b/custom-ui/src/components/PanThumb/index.vue @@ -0,0 +1,142 @@ + + + + + diff --git a/custom-ui/src/components/ParentView/index.vue b/custom-ui/src/components/ParentView/index.vue new file mode 100644 index 0000000..7bf6148 --- /dev/null +++ b/custom-ui/src/components/ParentView/index.vue @@ -0,0 +1,3 @@ + diff --git a/custom-ui/src/components/RightPanel/index.vue b/custom-ui/src/components/RightPanel/index.vue new file mode 100644 index 0000000..5abeecb --- /dev/null +++ b/custom-ui/src/components/RightPanel/index.vue @@ -0,0 +1,106 @@ + + + + + diff --git a/custom-ui/src/components/RightToolbar/index.vue b/custom-ui/src/components/RightToolbar/index.vue new file mode 100644 index 0000000..527e07c --- /dev/null +++ b/custom-ui/src/components/RightToolbar/index.vue @@ -0,0 +1,104 @@ + + + diff --git a/custom-ui/src/components/RuoYi/Doc/index.vue b/custom-ui/src/components/RuoYi/Doc/index.vue new file mode 100644 index 0000000..75fa864 --- /dev/null +++ b/custom-ui/src/components/RuoYi/Doc/index.vue @@ -0,0 +1,21 @@ + + + \ No newline at end of file diff --git a/custom-ui/src/components/RuoYi/Git/index.vue b/custom-ui/src/components/RuoYi/Git/index.vue new file mode 100644 index 0000000..bdafbae --- /dev/null +++ b/custom-ui/src/components/RuoYi/Git/index.vue @@ -0,0 +1,21 @@ + + + \ No newline at end of file diff --git a/custom-ui/src/components/Screenfull/index.vue b/custom-ui/src/components/Screenfull/index.vue new file mode 100644 index 0000000..d4e539c --- /dev/null +++ b/custom-ui/src/components/Screenfull/index.vue @@ -0,0 +1,57 @@ + + + + + diff --git a/custom-ui/src/components/SizeSelect/index.vue b/custom-ui/src/components/SizeSelect/index.vue new file mode 100644 index 0000000..069b5de --- /dev/null +++ b/custom-ui/src/components/SizeSelect/index.vue @@ -0,0 +1,56 @@ + + + diff --git a/custom-ui/src/components/SvgIcon/index.vue b/custom-ui/src/components/SvgIcon/index.vue new file mode 100644 index 0000000..e4bf5ad --- /dev/null +++ b/custom-ui/src/components/SvgIcon/index.vue @@ -0,0 +1,61 @@ + + + + + diff --git a/custom-ui/src/components/ThemePicker/index.vue b/custom-ui/src/components/ThemePicker/index.vue new file mode 100644 index 0000000..1714e1f --- /dev/null +++ b/custom-ui/src/components/ThemePicker/index.vue @@ -0,0 +1,173 @@ + + + + + diff --git a/custom-ui/src/components/TopNav/index.vue b/custom-ui/src/components/TopNav/index.vue new file mode 100644 index 0000000..5f0edbe --- /dev/null +++ b/custom-ui/src/components/TopNav/index.vue @@ -0,0 +1,185 @@ + + + + + diff --git a/custom-ui/src/components/iFrame/index.vue b/custom-ui/src/components/iFrame/index.vue new file mode 100644 index 0000000..426857f --- /dev/null +++ b/custom-ui/src/components/iFrame/index.vue @@ -0,0 +1,36 @@ + + + diff --git a/custom-ui/src/layout/components/Navbar.vue b/custom-ui/src/layout/components/Navbar.vue new file mode 100644 index 0000000..34095fd --- /dev/null +++ b/custom-ui/src/layout/components/Navbar.vue @@ -0,0 +1,192 @@ + + + + + diff --git a/custom-ui/src/layout/components/Settings/index.vue b/custom-ui/src/layout/components/Settings/index.vue new file mode 100644 index 0000000..8b49842 --- /dev/null +++ b/custom-ui/src/layout/components/Settings/index.vue @@ -0,0 +1,260 @@ + + + + + diff --git a/custom-ui/src/layout/components/Sidebar/FixiOSBug.js b/custom-ui/src/layout/components/Sidebar/FixiOSBug.js new file mode 100644 index 0000000..6823726 --- /dev/null +++ b/custom-ui/src/layout/components/Sidebar/FixiOSBug.js @@ -0,0 +1,25 @@ +export default { + computed: { + device() { + return this.$store.state.app.device + } + }, + mounted() { + // In order to fix the click on menu on the ios device will trigger the mouseleave bug + this.fixBugIniOS() + }, + methods: { + fixBugIniOS() { + const $subMenu = this.$refs.subMenu + if ($subMenu) { + const handleMouseleave = $subMenu.handleMouseleave + $subMenu.handleMouseleave = (e) => { + if (this.device === 'mobile') { + return + } + handleMouseleave(e) + } + } + } + } +} diff --git a/custom-ui/src/layout/components/Sidebar/Item.vue b/custom-ui/src/layout/components/Sidebar/Item.vue new file mode 100644 index 0000000..be3285d --- /dev/null +++ b/custom-ui/src/layout/components/Sidebar/Item.vue @@ -0,0 +1,33 @@ + diff --git a/custom-ui/src/layout/components/Sidebar/Link.vue b/custom-ui/src/layout/components/Sidebar/Link.vue new file mode 100644 index 0000000..8b0bc93 --- /dev/null +++ b/custom-ui/src/layout/components/Sidebar/Link.vue @@ -0,0 +1,43 @@ + + + diff --git a/custom-ui/src/layout/components/Sidebar/Logo.vue b/custom-ui/src/layout/components/Sidebar/Logo.vue new file mode 100644 index 0000000..b1e8482 --- /dev/null +++ b/custom-ui/src/layout/components/Sidebar/Logo.vue @@ -0,0 +1,93 @@ + + + + + diff --git a/custom-ui/src/layout/components/Sidebar/SidebarItem.vue b/custom-ui/src/layout/components/Sidebar/SidebarItem.vue new file mode 100644 index 0000000..4853fbb --- /dev/null +++ b/custom-ui/src/layout/components/Sidebar/SidebarItem.vue @@ -0,0 +1,100 @@ + + + diff --git a/custom-ui/src/layout/components/Sidebar/index.vue b/custom-ui/src/layout/components/Sidebar/index.vue new file mode 100644 index 0000000..51d0839 --- /dev/null +++ b/custom-ui/src/layout/components/Sidebar/index.vue @@ -0,0 +1,57 @@ + + + diff --git a/custom-ui/src/layout/components/TagsView/ScrollPane.vue b/custom-ui/src/layout/components/TagsView/ScrollPane.vue new file mode 100644 index 0000000..bb753a1 --- /dev/null +++ b/custom-ui/src/layout/components/TagsView/ScrollPane.vue @@ -0,0 +1,94 @@ + + + + + diff --git a/custom-ui/src/layout/components/TagsView/index.vue b/custom-ui/src/layout/components/TagsView/index.vue new file mode 100644 index 0000000..cc98071 --- /dev/null +++ b/custom-ui/src/layout/components/TagsView/index.vue @@ -0,0 +1,332 @@ + + + + + + + diff --git a/custom-ui/src/layout/components/index.js b/custom-ui/src/layout/components/index.js new file mode 100644 index 0000000..104bd3a --- /dev/null +++ b/custom-ui/src/layout/components/index.js @@ -0,0 +1,5 @@ +export { default as AppMain } from './AppMain' +export { default as Navbar } from './Navbar' +export { default as Settings } from './Settings' +export { default as Sidebar } from './Sidebar/index.vue' +export { default as TagsView } from './TagsView/index.vue' diff --git a/custom-ui/src/layout/index.vue b/custom-ui/src/layout/index.vue new file mode 100644 index 0000000..f048657 --- /dev/null +++ b/custom-ui/src/layout/index.vue @@ -0,0 +1,111 @@ + + + + + diff --git a/custom-ui/src/layout/mixin/ResizeHandler.js b/custom-ui/src/layout/mixin/ResizeHandler.js new file mode 100644 index 0000000..e8d0df8 --- /dev/null +++ b/custom-ui/src/layout/mixin/ResizeHandler.js @@ -0,0 +1,45 @@ +import store from '@/store' + +const { body } = document +const WIDTH = 992 // refer to Bootstrap's responsive design + +export default { + watch: { + $route(route) { + if (this.device === 'mobile' && this.sidebar.opened) { + store.dispatch('app/closeSideBar', { withoutAnimation: false }) + } + } + }, + beforeMount() { + window.addEventListener('resize', this.$_resizeHandler) + }, + beforeDestroy() { + window.removeEventListener('resize', this.$_resizeHandler) + }, + mounted() { + const isMobile = this.$_isMobile() + if (isMobile) { + store.dispatch('app/toggleDevice', 'mobile') + store.dispatch('app/closeSideBar', { withoutAnimation: true }) + } + }, + methods: { + // use $_ for mixins properties + // https://vuejs.org/v2/style-guide/index.html#Private-property-names-essential + $_isMobile() { + const rect = body.getBoundingClientRect() + return rect.width - 1 < WIDTH + }, + $_resizeHandler() { + if (!document.hidden) { + const isMobile = this.$_isMobile() + store.dispatch('app/toggleDevice', isMobile ? 'mobile' : 'desktop') + + if (isMobile) { + store.dispatch('app/closeSideBar', { withoutAnimation: true }) + } + } + } + } +} diff --git a/custom-ui/src/main.js b/custom-ui/src/main.js new file mode 100644 index 0000000..13c6cf2 --- /dev/null +++ b/custom-ui/src/main.js @@ -0,0 +1,86 @@ +import Vue from 'vue' + +import Cookies from 'js-cookie' + +import Element from 'element-ui' +import './assets/styles/element-variables.scss' + +import '@/assets/styles/index.scss' // global css +import '@/assets/styles/ruoyi.scss' // ruoyi css +import App from './App' +import store from './store' +import router from './router' +import directive from './directive' // directive +import plugins from './plugins' // plugins +import { download } from '@/utils/request' + +import './assets/icons' // icon +import './permission' // permission control +import { getDicts } from "@/api/system/dict/data"; +import { getConfigKey } from "@/api/system/config"; +import { parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, handleTree } from "@/utils/ruoyi"; +// 分页组件 +import Pagination from "@/components/Pagination"; +// 自定义表格工具组件 +import RightToolbar from "@/components/RightToolbar" +// 富文本组件 +import Editor from "@/components/Editor" +// 文件上传组件 +import FileUpload from "@/components/FileUpload" +// 图片上传组件 +import ImageUpload from "@/components/ImageUpload" +// 图片预览组件 +import ImagePreview from "@/components/ImagePreview" +// 字典标签组件 +import DictTag from '@/components/DictTag' +// 头部标签组件 +import VueMeta from 'vue-meta' +// 字典数据组件 +import DictData from '@/components/DictData' + +// 全局方法挂载 +Vue.prototype.getDicts = getDicts +Vue.prototype.getConfigKey = getConfigKey +Vue.prototype.parseTime = parseTime +Vue.prototype.resetForm = resetForm +Vue.prototype.addDateRange = addDateRange +Vue.prototype.selectDictLabel = selectDictLabel +Vue.prototype.selectDictLabels = selectDictLabels +Vue.prototype.download = download +Vue.prototype.handleTree = handleTree + +// 全局组件挂载 +Vue.component('DictTag', DictTag) +Vue.component('Pagination', Pagination) +Vue.component('RightToolbar', RightToolbar) +Vue.component('Editor', Editor) +Vue.component('FileUpload', FileUpload) +Vue.component('ImageUpload', ImageUpload) +Vue.component('ImagePreview', ImagePreview) + +Vue.use(directive) +Vue.use(plugins) +Vue.use(VueMeta) +DictData.install() + +/** + * If you don't want to use mock-server + * you want to use MockJs for mock api + * you can execute: mockXHR() + * + * Currently MockJs will be used in the production environment, + * please remove it before going online! ! ! + */ + +Vue.use(Element, { + size: Cookies.get('size') || 'medium' // set element-ui default size +}) + +Vue.config.productionTip = false + +new Vue({ + el: '#app', + router, + store, + render: h => h(App) +}) diff --git a/custom-ui/src/permission.js b/custom-ui/src/permission.js new file mode 100644 index 0000000..6bb0a1f --- /dev/null +++ b/custom-ui/src/permission.js @@ -0,0 +1,56 @@ +import router from './router' +import store from './store' +import { Message } from 'element-ui' +import NProgress from 'nprogress' +import 'nprogress/nprogress.css' +import { getToken } from '@/utils/auth' +import { isRelogin } from '@/utils/request' + +NProgress.configure({ showSpinner: false }) + +const whiteList = ['/login', '/auth-redirect', '/bind', '/register'] + +router.beforeEach((to, from, next) => { + NProgress.start() + if (getToken()) { + to.meta.title && store.dispatch('settings/setTitle', to.meta.title) + /* has token*/ + if (to.path === '/login') { + next({ path: '/' }) + NProgress.done() + } else { + if (store.getters.roles.length === 0) { + isRelogin.show = true + // 判断当前用户是否已拉取完user_info信息 + store.dispatch('GetInfo').then(() => { + isRelogin.show = false + store.dispatch('GenerateRoutes').then(accessRoutes => { + // 根据roles权限生成可访问的路由表 + router.addRoutes(accessRoutes) // 动态添加可访问路由表 + next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 + }) + }).catch(err => { + store.dispatch('LogOut').then(() => { + Message.error(err) + next({ path: '/' }) + }) + }) + } else { + next() + } + } + } else { + // 没有token + if (whiteList.indexOf(to.path) !== -1) { + // 在免登录白名单,直接进入 + next() + } else { + next(`/login?redirect=${to.fullPath}`) // 否则全部重定向到登录页 + NProgress.done() + } + } +}) + +router.afterEach(() => { + NProgress.done() +}) diff --git a/custom-ui/src/plugins/auth.js b/custom-ui/src/plugins/auth.js new file mode 100644 index 0000000..6c6bc24 --- /dev/null +++ b/custom-ui/src/plugins/auth.js @@ -0,0 +1,60 @@ +import store from '@/store' + +function authPermission(permission) { + const all_permission = "*:*:*"; + const permissions = store.getters && store.getters.permissions + if (permission && permission.length > 0) { + return permissions.some(v => { + return all_permission === v || v === permission + }) + } else { + return false + } +} + +function authRole(role) { + const super_admin = "admin"; + const roles = store.getters && store.getters.roles + if (role && role.length > 0) { + return roles.some(v => { + return super_admin === v || v === role + }) + } else { + return false + } +} + +export default { + // 验证用户是否具备某权限 + hasPermi(permission) { + return authPermission(permission); + }, + // 验证用户是否含有指定权限,只需包含其中一个 + hasPermiOr(permissions) { + return permissions.some(item => { + return authPermission(item) + }) + }, + // 验证用户是否含有指定权限,必须全部拥有 + hasPermiAnd(permissions) { + return permissions.every(item => { + return authPermission(item) + }) + }, + // 验证用户是否具备某角色 + hasRole(role) { + return authRole(role); + }, + // 验证用户是否含有指定角色,只需包含其中一个 + hasRoleOr(roles) { + return roles.some(item => { + return authRole(item) + }) + }, + // 验证用户是否含有指定角色,必须全部拥有 + hasRoleAnd(roles) { + return roles.every(item => { + return authRole(item) + }) + } +} diff --git a/custom-ui/src/plugins/cache.js b/custom-ui/src/plugins/cache.js new file mode 100644 index 0000000..6b5c00b --- /dev/null +++ b/custom-ui/src/plugins/cache.js @@ -0,0 +1,77 @@ +const sessionCache = { + set (key, value) { + if (!sessionStorage) { + return + } + if (key != null && value != null) { + sessionStorage.setItem(key, value) + } + }, + get (key) { + if (!sessionStorage) { + return null + } + if (key == null) { + return null + } + return sessionStorage.getItem(key) + }, + setJSON (key, jsonValue) { + if (jsonValue != null) { + this.set(key, JSON.stringify(jsonValue)) + } + }, + getJSON (key) { + const value = this.get(key) + if (value != null) { + return JSON.parse(value) + } + }, + remove (key) { + sessionStorage.removeItem(key); + } +} +const localCache = { + set (key, value) { + if (!localStorage) { + return + } + if (key != null && value != null) { + localStorage.setItem(key, value) + } + }, + get (key) { + if (!localStorage) { + return null + } + if (key == null) { + return null + } + return localStorage.getItem(key) + }, + setJSON (key, jsonValue) { + if (jsonValue != null) { + this.set(key, JSON.stringify(jsonValue)) + } + }, + getJSON (key) { + const value = this.get(key) + if (value != null) { + return JSON.parse(value) + } + }, + remove (key) { + localStorage.removeItem(key); + } +} + +export default { + /** + * 会话级缓存 + */ + session: sessionCache, + /** + * 本地缓存 + */ + local: localCache +} diff --git a/custom-ui/src/plugins/download.js b/custom-ui/src/plugins/download.js new file mode 100644 index 0000000..a3bb8c4 --- /dev/null +++ b/custom-ui/src/plugins/download.js @@ -0,0 +1,72 @@ +import axios from 'axios' +import { Message } from 'element-ui' +import { saveAs } from 'file-saver' +import { getToken } from '@/utils/auth' +import errorCode from '@/utils/errorCode' +import { blobValidate } from "@/utils/ruoyi"; + +const baseURL = process.env.VUE_APP_BASE_API + +export default { + name(name, isDelete = true) { + var url = baseURL + "/common/download?fileName=" + encodeURIComponent(name) + "&delete=" + isDelete + axios({ + method: 'get', + url: url, + responseType: 'blob', + headers: { 'Authorization': 'Bearer ' + getToken() } + }).then(async (res) => { + const isLogin = await blobValidate(res.data); + if (isLogin) { + const blob = new Blob([res.data]) + this.saveAs(blob, decodeURIComponent(res.headers['download-filename'])) + } else { + this.printErrMsg(res.data); + } + }) + }, + resource(resource) { + var url = baseURL + "/common/download/resource?resource=" + encodeURIComponent(resource); + axios({ + method: 'get', + url: url, + responseType: 'blob', + headers: { 'Authorization': 'Bearer ' + getToken() } + }).then(async (res) => { + const isLogin = await blobValidate(res.data); + if (isLogin) { + const blob = new Blob([res.data]) + this.saveAs(blob, decodeURIComponent(res.headers['download-filename'])) + } else { + this.printErrMsg(res.data); + } + }) + }, + zip(url, name) { + var url = baseURL + url + axios({ + method: 'get', + url: url, + responseType: 'blob', + headers: { 'Authorization': 'Bearer ' + getToken() } + }).then(async (res) => { + const isLogin = await blobValidate(res.data); + if (isLogin) { + const blob = new Blob([res.data], { type: 'application/zip' }) + this.saveAs(blob, name) + } else { + this.printErrMsg(res.data); + } + }) + }, + saveAs(text, name, opts) { + saveAs(text, name, opts); + }, + async printErrMsg(data) { + const resText = await data.text(); + const rspObj = JSON.parse(resText); + const errMsg = errorCode[rspObj.code] || rspObj.msg || errorCode['default'] + Message.error(errMsg); + } +} + diff --git a/custom-ui/src/plugins/index.js b/custom-ui/src/plugins/index.js new file mode 100644 index 0000000..d000f2d --- /dev/null +++ b/custom-ui/src/plugins/index.js @@ -0,0 +1,20 @@ +import tab from './tab' +import auth from './auth' +import cache from './cache' +import modal from './modal' +import download from './download' + +export default { + install(Vue) { + // 页签操作 + Vue.prototype.$tab = tab + // 认证对象 + Vue.prototype.$auth = auth + // 缓存对象 + Vue.prototype.$cache = cache + // 模态框对象 + Vue.prototype.$modal = modal + // 下载文件 + Vue.prototype.$download = download + } +} diff --git a/custom-ui/src/plugins/modal.js b/custom-ui/src/plugins/modal.js new file mode 100644 index 0000000..b37ca14 --- /dev/null +++ b/custom-ui/src/plugins/modal.js @@ -0,0 +1,83 @@ +import { Message, MessageBox, Notification, Loading } from 'element-ui' + +let loadingInstance; + +export default { + // 消息提示 + msg(content) { + Message.info(content) + }, + // 错误消息 + msgError(content) { + Message.error(content) + }, + // 成功消息 + msgSuccess(content) { + Message.success(content) + }, + // 警告消息 + msgWarning(content) { + Message.warning(content) + }, + // 弹出提示 + alert(content) { + MessageBox.alert(content, "系统提示") + }, + // 错误提示 + alertError(content) { + MessageBox.alert(content, "系统提示", { type: 'error' }) + }, + // 成功提示 + alertSuccess(content) { + MessageBox.alert(content, "系统提示", { type: 'success' }) + }, + // 警告提示 + alertWarning(content) { + MessageBox.alert(content, "系统提示", { type: 'warning' }) + }, + // 通知提示 + notify(content) { + Notification.info(content) + }, + // 错误通知 + notifyError(content) { + Notification.error(content); + }, + // 成功通知 + notifySuccess(content) { + Notification.success(content) + }, + // 警告通知 + notifyWarning(content) { + Notification.warning(content) + }, + // 确认窗体 + confirm(content) { + return MessageBox.confirm(content, "系统提示", { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: "warning", + }) + }, + // 提交内容 + prompt(content) { + return MessageBox.prompt(content, "系统提示", { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: "warning", + }) + }, + // 打开遮罩层 + loading(content) { + loadingInstance = Loading.service({ + lock: true, + text: content, + spinner: "el-icon-loading", + background: "rgba(0, 0, 0, 0.7)", + }) + }, + // 关闭遮罩层 + closeLoading() { + loadingInstance.close(); + } +} diff --git a/custom-ui/src/plugins/tab.js b/custom-ui/src/plugins/tab.js new file mode 100644 index 0000000..cade9f7 --- /dev/null +++ b/custom-ui/src/plugins/tab.js @@ -0,0 +1,67 @@ +import store from '@/store' +import router from '@/router'; + +export default { + // 刷新当前tab页签 + refreshPage(obj) { + const { path, query, matched } = router.currentRoute; + if (obj === undefined) { + matched.forEach((m) => { + if (m.components && m.components.default && m.components.default.name) { + if (!['Layout', 'ParentView'].includes(m.components.default.name)) { + obj = { name: m.components.default.name, path: path, query: query }; + } + } + }); + } + return store.dispatch('tagsView/delCachedView', obj).then(() => { + const { path, query } = obj + router.replace({ + path: '/redirect' + path, + query: query + }) + }) + }, + // 关闭当前tab页签,打开新页签 + closeOpenPage(obj) { + store.dispatch("tagsView/delView", router.currentRoute); + if (obj !== undefined) { + return router.push(obj); + } + }, + // 关闭指定tab页签 + closePage(obj) { + if (obj === undefined) { + return store.dispatch('tagsView/delView', router.currentRoute).then(({ lastPath }) => { + return router.push(lastPath || '/'); + }); + } + return store.dispatch('tagsView/delView', obj); + }, + // 关闭所有tab页签 + closeAllPage() { + return store.dispatch('tagsView/delAllViews'); + }, + // 关闭左侧tab页签 + closeLeftPage(obj) { + return store.dispatch('tagsView/delLeftTags', obj || router.currentRoute); + }, + // 关闭右侧tab页签 + closeRightPage(obj) { + return store.dispatch('tagsView/delRightTags', obj || router.currentRoute); + }, + // 关闭其他tab页签 + closeOtherPage(obj) { + return store.dispatch('tagsView/delOthersViews', obj || router.currentRoute); + }, + // 添加tab页签 + openPage(title, url, params) { + var obj = { path: url, meta: { title: title } } + store.dispatch('tagsView/addView', obj); + return router.push({ path: url, query: params }); + }, + // 修改tab页签 + updatePage(obj) { + return store.dispatch('tagsView/updateVisitedView', obj); + } +} diff --git a/custom-ui/src/router/index.js b/custom-ui/src/router/index.js new file mode 100644 index 0000000..b370bdd --- /dev/null +++ b/custom-ui/src/router/index.js @@ -0,0 +1,177 @@ +import Vue from 'vue' +import Router from 'vue-router' + +Vue.use(Router) + +/* Layout */ +import Layout from '@/layout' + +/** + * Note: 路由配置项 + * + * hidden: true // 当设置 true 的时候该路由不会再侧边栏出现 如401,login等页面,或者如一些编辑页面/edit/1 + * alwaysShow: true // 当你一个路由下面的 children 声明的路由大于1个时,自动会变成嵌套的模式--如组件页面 + * // 只有一个时,会将那个子路由当做根路由显示在侧边栏--如引导页面 + * // 若你想不管路由下面的 children 声明的个数都显示你的根路由 + * // 你可以设置 alwaysShow: true,这样它就会忽略之前定义的规则,一直显示根路由 + * redirect: noRedirect // 当设置 noRedirect 的时候该路由在面包屑导航中不可被点击 + * name:'router-name' // 设定路由的名字,一定要填写不然使用时会出现各种问题 + * query: '{"id": 1, "name": "ry"}' // 访问路由的默认传递参数 + * roles: ['admin', 'common'] // 访问路由的角色权限 + * permissions: ['a:a:a', 'b:b:b'] // 访问路由的菜单权限 + * meta : { + noCache: true // 如果设置为true,则不会被 缓存(默认 false) + title: 'title' // 设置该路由在侧边栏和面包屑中展示的名字 + icon: 'svg-name' // 设置该路由的图标,对应路径src/assets/icons/svg + breadcrumb: false // 如果设置为false,则不会在breadcrumb面包屑中显示 + activeMenu: '/system/user' // 当路由设置了该属性,则会高亮相对应的侧边栏。 + } + */ + +// 公共路由 +export const constantRoutes = [ + { + path: '/redirect', + component: Layout, + hidden: true, + children: [ + { + path: '/redirect/:path(.*)', + component: () => import('@/views/redirect') + } + ] + }, + { + path: '/login', + component: () => import('@/views/login'), + hidden: true + }, + { + path: '/register', + component: () => import('@/views/register'), + hidden: true + }, + { + path: '/404', + component: () => import('@/views/error/404'), + hidden: true + }, + { + path: '/401', + component: () => import('@/views/error/401'), + hidden: true + }, + { + path: '', + component: Layout, + redirect: 'index', + children: [ + { + path: 'index', + component: () => import('@/views/index'), + name: 'Index', + meta: { title: '首页', icon: 'dashboard', affix: true } + } + ] + }, + { + path: '/user', + component: Layout, + hidden: true, + redirect: 'noredirect', + children: [ + { + path: 'profile', + component: () => import('@/views/system/user/profile/index'), + name: 'Profile', + meta: { title: '个人中心', icon: 'user' } + } + ] + } +] + +// 动态路由,基于用户权限动态去加载 +export const dynamicRoutes = [ + { + path: '/system/user-auth', + component: Layout, + hidden: true, + permissions: ['system:user:edit'], + children: [ + { + path: 'role/:userId(\\d+)', + component: () => import('@/views/system/user/authRole'), + name: 'AuthRole', + meta: { title: '分配角色', activeMenu: '/system/user' } + } + ] + }, + { + path: '/system/role-auth', + component: Layout, + hidden: true, + permissions: ['system:role:edit'], + children: [ + { + path: 'user/:roleId(\\d+)', + component: () => import('@/views/system/role/authUser'), + name: 'AuthUser', + meta: { title: '分配用户', activeMenu: '/system/role' } + } + ] + }, + { + path: '/system/dict-data', + component: Layout, + hidden: true, + permissions: ['system:dict:list'], + children: [ + { + path: 'index/:dictId(\\d+)', + component: () => import('@/views/system/dict/data'), + name: 'Data', + meta: { title: '字典数据', activeMenu: '/system/dict' } + } + ] + }, + { + path: '/monitor/job-log', + component: Layout, + hidden: true, + permissions: ['monitor:job:list'], + children: [ + { + path: 'index/:jobId(\\d+)', + component: () => import('@/views/monitor/job/log'), + name: 'JobLog', + meta: { title: '调度日志', activeMenu: '/monitor/job' } + } + ] + }, + { + path: '/tool/gen-edit', + component: Layout, + hidden: true, + permissions: ['tool:gen:edit'], + children: [ + { + path: 'index/:tableId(\\d+)', + component: () => import('@/views/tool/gen/editTable'), + name: 'GenEdit', + meta: { title: '修改生成配置', activeMenu: '/tool/gen' } + } + ] + } +] + +// 防止连续点击多次路由报错 +let routerPush = Router.prototype.push; +Router.prototype.push = function push(location) { + return routerPush.call(this, location).catch(err => err) +} + +export default new Router({ + mode: 'history', // 去掉url中的# + scrollBehavior: () => ({ y: 0 }), + routes: constantRoutes +}) diff --git a/custom-ui/src/settings.js b/custom-ui/src/settings.js new file mode 100644 index 0000000..6a0b09f --- /dev/null +++ b/custom-ui/src/settings.js @@ -0,0 +1,44 @@ +module.exports = { + /** + * 侧边栏主题 深色主题theme-dark,浅色主题theme-light + */ + sideTheme: 'theme-dark', + + /** + * 是否系统布局配置 + */ + showSettings: false, + + /** + * 是否显示顶部导航 + */ + topNav: false, + + /** + * 是否显示 tagsView + */ + tagsView: true, + + /** + * 是否固定头部 + */ + fixedHeader: false, + + /** + * 是否显示logo + */ + sidebarLogo: true, + + /** + * 是否显示动态标题 + */ + dynamicTitle: false, + + /** + * @type {string | array} 'production' | ['production', 'development'] + * @description Need show err logs component. + * The default is only used in the production env + * If you want to also use it in dev, you can pass ['production', 'development'] + */ + errorLog: 'production' +} diff --git a/custom-ui/src/store/getters.js b/custom-ui/src/store/getters.js new file mode 100644 index 0000000..8adb1b6 --- /dev/null +++ b/custom-ui/src/store/getters.js @@ -0,0 +1,19 @@ +const getters = { + sidebar: state => state.app.sidebar, + size: state => state.app.size, + device: state => state.app.device, + dict: state => state.dict.dict, + visitedViews: state => state.tagsView.visitedViews, + cachedViews: state => state.tagsView.cachedViews, + token: state => state.user.token, + avatar: state => state.user.avatar, + name: state => state.user.name, + introduction: state => state.user.introduction, + roles: state => state.user.roles, + permissions: state => state.user.permissions, + permission_routes: state => state.permission.routes, + topbarRouters:state => state.permission.topbarRouters, + defaultRoutes:state => state.permission.defaultRoutes, + sidebarRouters:state => state.permission.sidebarRouters, +} +export default getters diff --git a/custom-ui/src/store/index.js b/custom-ui/src/store/index.js new file mode 100644 index 0000000..97aaef8 --- /dev/null +++ b/custom-ui/src/store/index.js @@ -0,0 +1,25 @@ +import Vue from 'vue' +import Vuex from 'vuex' +import app from './modules/app' +import dict from './modules/dict' +import user from './modules/user' +import tagsView from './modules/tagsView' +import permission from './modules/permission' +import settings from './modules/settings' +import getters from './getters' + +Vue.use(Vuex) + +const store = new Vuex.Store({ + modules: { + app, + dict, + user, + tagsView, + permission, + settings + }, + getters +}) + +export default store diff --git a/custom-ui/src/store/modules/app.js b/custom-ui/src/store/modules/app.js new file mode 100644 index 0000000..3e22d1c --- /dev/null +++ b/custom-ui/src/store/modules/app.js @@ -0,0 +1,66 @@ +import Cookies from 'js-cookie' + +const state = { + sidebar: { + opened: Cookies.get('sidebarStatus') ? !!+Cookies.get('sidebarStatus') : true, + withoutAnimation: false, + hide: false + }, + device: 'desktop', + size: Cookies.get('size') || 'medium' +} + +const mutations = { + TOGGLE_SIDEBAR: state => { + if (state.sidebar.hide) { + return false; + } + state.sidebar.opened = !state.sidebar.opened + state.sidebar.withoutAnimation = false + if (state.sidebar.opened) { + Cookies.set('sidebarStatus', 1) + } else { + Cookies.set('sidebarStatus', 0) + } + }, + CLOSE_SIDEBAR: (state, withoutAnimation) => { + Cookies.set('sidebarStatus', 0) + state.sidebar.opened = false + state.sidebar.withoutAnimation = withoutAnimation + }, + TOGGLE_DEVICE: (state, device) => { + state.device = device + }, + SET_SIZE: (state, size) => { + state.size = size + Cookies.set('size', size) + }, + SET_SIDEBAR_HIDE: (state, status) => { + state.sidebar.hide = status + } +} + +const actions = { + toggleSideBar({ commit }) { + commit('TOGGLE_SIDEBAR') + }, + closeSideBar({ commit }, { withoutAnimation }) { + commit('CLOSE_SIDEBAR', withoutAnimation) + }, + toggleDevice({ commit }, device) { + commit('TOGGLE_DEVICE', device) + }, + setSize({ commit }, size) { + commit('SET_SIZE', size) + }, + toggleSideBarHide({ commit }, status) { + commit('SET_SIDEBAR_HIDE', status) + } +} + +export default { + namespaced: true, + state, + mutations, + actions +} diff --git a/custom-ui/src/store/modules/dict.js b/custom-ui/src/store/modules/dict.js new file mode 100644 index 0000000..f95bead --- /dev/null +++ b/custom-ui/src/store/modules/dict.js @@ -0,0 +1,50 @@ +const state = { + dict: new Array() +} +const mutations = { + SET_DICT: (state, { key, value }) => { + if (key !== null && key !== "") { + state.dict.push({ + key: key, + value: value + }) + } + }, + REMOVE_DICT: (state, key) => { + try { + for (let i = 0; i < state.dict.length; i++) { + if (state.dict[i].key == key) { + state.dict.splice(i, i) + return true + } + } + } catch (e) { + } + }, + CLEAN_DICT: (state) => { + state.dict = new Array() + } +} + +const actions = { + // 设置字典 + setDict({ commit }, data) { + commit('SET_DICT', data) + }, + // 删除字典 + removeDict({ commit }, key) { + commit('REMOVE_DICT', key) + }, + // 清空字典 + cleanDict({ commit }) { + commit('CLEAN_DICT') + } +} + +export default { + namespaced: true, + state, + mutations, + actions +} + diff --git a/custom-ui/src/store/modules/permission.js b/custom-ui/src/store/modules/permission.js new file mode 100644 index 0000000..2287665 --- /dev/null +++ b/custom-ui/src/store/modules/permission.js @@ -0,0 +1,133 @@ +import auth from '@/plugins/auth' +import router, { constantRoutes, dynamicRoutes } from '@/router' +import { getRouters } from '@/api/menu' +import Layout from '@/layout/index' +import ParentView from '@/components/ParentView' +import InnerLink from '@/layout/components/InnerLink' + +const permission = { + state: { + routes: [], + addRoutes: [], + defaultRoutes: [], + topbarRouters: [], + sidebarRouters: [] + }, + mutations: { + SET_ROUTES: (state, routes) => { + state.addRoutes = routes + state.routes = constantRoutes.concat(routes) + }, + SET_DEFAULT_ROUTES: (state, routes) => { + state.defaultRoutes = constantRoutes.concat(routes) + }, + SET_TOPBAR_ROUTES: (state, routes) => { + state.topbarRouters = routes + }, + SET_SIDEBAR_ROUTERS: (state, routes) => { + state.sidebarRouters = routes + }, + }, + actions: { + // 生成路由 + GenerateRoutes({ commit }) { + return new Promise(resolve => { + // 向后端请求路由数据 + getRouters().then(res => { + const sdata = JSON.parse(JSON.stringify(res.data)) + const rdata = JSON.parse(JSON.stringify(res.data)) + const sidebarRoutes = filterAsyncRouter(sdata) + const rewriteRoutes = filterAsyncRouter(rdata, false, true) + const asyncRoutes = filterDynamicRoutes(dynamicRoutes); + rewriteRoutes.push({ path: '*', redirect: '/404', hidden: true }) + router.addRoutes(asyncRoutes); + commit('SET_ROUTES', rewriteRoutes) + commit('SET_SIDEBAR_ROUTERS', constantRoutes.concat(sidebarRoutes)) + commit('SET_DEFAULT_ROUTES', sidebarRoutes) + commit('SET_TOPBAR_ROUTES', sidebarRoutes) + resolve(rewriteRoutes) + }) + }) + } + } +} + +// 遍历后台传来的路由字符串,转换为组件对象 +function filterAsyncRouter(asyncRouterMap, lastRouter = false, type = false) { + return asyncRouterMap.filter(route => { + if (type && route.children) { + route.children = filterChildren(route.children) + } + if (route.component) { + // Layout ParentView 组件特殊处理 + if (route.component === 'Layout') { + route.component = Layout + } else if (route.component === 'ParentView') { + route.component = ParentView + } else if (route.component === 'InnerLink') { + route.component = InnerLink + } else { + route.component = loadView(route.component) + } + } + if (route.children != null && route.children && route.children.length) { + route.children = filterAsyncRouter(route.children, route, type) + } else { + delete route['children'] + delete route['redirect'] + } + return true + }) +} + +function filterChildren(childrenMap, lastRouter = false) { + var children = [] + childrenMap.forEach((el, index) => { + if (el.children && el.children.length) { + if (el.component === 'ParentView' && !lastRouter) { + el.children.forEach(c => { + c.path = el.path + '/' + c.path + if (c.children && c.children.length) { + children = children.concat(filterChildren(c.children, c)) + return + } + children.push(c) + }) + return + } + } + if (lastRouter) { + el.path = lastRouter.path + '/' + el.path + } + children = children.concat(el) + }) + return children +} + +// 动态路由遍历,验证是否具备权限 +export function filterDynamicRoutes(routes) { + const res = [] + routes.forEach(route => { + if (route.permissions) { + if (auth.hasPermiOr(route.permissions)) { + res.push(route) + } + } else if (route.roles) { + if (auth.hasRoleOr(route.roles)) { + res.push(route) + } + } + }) + return res +} + +export const loadView = (view) => { + if (process.env.NODE_ENV === 'development') { + return (resolve) => require([`@/views/${view}`], resolve) + } else { + // 使用 import 实现生产环境的路由懒加载 + return () => import(`@/views/${view}`) + } +} + +export default permission diff --git a/custom-ui/src/store/modules/settings.js b/custom-ui/src/store/modules/settings.js new file mode 100644 index 0000000..2455a1e --- /dev/null +++ b/custom-ui/src/store/modules/settings.js @@ -0,0 +1,42 @@ +import defaultSettings from '@/settings' + +const { sideTheme, showSettings, topNav, tagsView, fixedHeader, sidebarLogo, dynamicTitle } = defaultSettings + +const storageSetting = JSON.parse(localStorage.getItem('layout-setting')) || '' +const state = { + title: '', + theme: storageSetting.theme || '#409EFF', + sideTheme: storageSetting.sideTheme || sideTheme, + showSettings: showSettings, + topNav: storageSetting.topNav === undefined ? topNav : storageSetting.topNav, + tagsView: storageSetting.tagsView === undefined ? tagsView : storageSetting.tagsView, + fixedHeader: storageSetting.fixedHeader === undefined ? fixedHeader : storageSetting.fixedHeader, + sidebarLogo: storageSetting.sidebarLogo === undefined ? sidebarLogo : storageSetting.sidebarLogo, + dynamicTitle: storageSetting.dynamicTitle === undefined ? dynamicTitle : storageSetting.dynamicTitle +} +const mutations = { + CHANGE_SETTING: (state, { key, value }) => { + if (state.hasOwnProperty(key)) { + state[key] = value + } + } +} + +const actions = { + // 修改布局设置 + changeSetting({ commit }, data) { + commit('CHANGE_SETTING', data) + }, + // 设置网页标题 + setTitle({ commit }, title) { + state.title = title + } +} + +export default { + namespaced: true, + state, + mutations, + actions +} + diff --git a/custom-ui/src/store/modules/tagsView.js b/custom-ui/src/store/modules/tagsView.js new file mode 100644 index 0000000..5fc011c --- /dev/null +++ b/custom-ui/src/store/modules/tagsView.js @@ -0,0 +1,228 @@ +const state = { + visitedViews: [], + cachedViews: [], + iframeViews: [] +} + +const mutations = { + ADD_IFRAME_VIEW: (state, view) => { + if (state.iframeViews.some(v => v.path === view.path)) return + state.iframeViews.push( + Object.assign({}, view, { + title: view.meta.title || 'no-name' + }) + ) + }, + ADD_VISITED_VIEW: (state, view) => { + if (state.visitedViews.some(v => v.path === view.path)) return + state.visitedViews.push( + Object.assign({}, view, { + title: view.meta.title || 'no-name' + }) + ) + }, + ADD_CACHED_VIEW: (state, view) => { + if (state.cachedViews.includes(view.name)) return + if (view.meta && !view.meta.noCache) { + state.cachedViews.push(view.name) + } + }, + DEL_VISITED_VIEW: (state, view) => { + for (const [i, v] of state.visitedViews.entries()) { + if (v.path === view.path) { + state.visitedViews.splice(i, 1) + break + } + } + state.iframeViews = state.iframeViews.filter(item => item.path !== view.path) + }, + DEL_IFRAME_VIEW: (state, view) => { + state.iframeViews = state.iframeViews.filter(item => item.path !== view.path) + }, + DEL_CACHED_VIEW: (state, view) => { + const index = state.cachedViews.indexOf(view.name) + index > -1 && state.cachedViews.splice(index, 1) + }, + + DEL_OTHERS_VISITED_VIEWS: (state, view) => { + state.visitedViews = state.visitedViews.filter(v => { + return v.meta.affix || v.path === view.path + }) + state.iframeViews = state.iframeViews.filter(item => item.path === view.path) + }, + DEL_OTHERS_CACHED_VIEWS: (state, view) => { + const index = state.cachedViews.indexOf(view.name) + if (index > -1) { + state.cachedViews = state.cachedViews.slice(index, index + 1) + } else { + state.cachedViews = [] + } + }, + DEL_ALL_VISITED_VIEWS: state => { + // keep affix tags + const affixTags = state.visitedViews.filter(tag => tag.meta.affix) + state.visitedViews = affixTags + state.iframeViews = [] + }, + DEL_ALL_CACHED_VIEWS: state => { + state.cachedViews = [] + }, + UPDATE_VISITED_VIEW: (state, view) => { + for (let v of state.visitedViews) { + if (v.path === view.path) { + v = Object.assign(v, view) + break + } + } + }, + DEL_RIGHT_VIEWS: (state, view) => { + const index = state.visitedViews.findIndex(v => v.path === view.path) + if (index === -1) { + return + } + state.visitedViews = state.visitedViews.filter((item, idx) => { + if (idx <= index || (item.meta && item.meta.affix)) { + return true + } + const i = state.cachedViews.indexOf(item.name) + if (i > -1) { + state.cachedViews.splice(i, 1) + } + if(item.meta.link) { + const fi = state.iframeViews.findIndex(v => v.path === item.path) + state.iframeViews.splice(fi, 1) + } + return false + }) + }, + DEL_LEFT_VIEWS: (state, view) => { + const index = state.visitedViews.findIndex(v => v.path === view.path) + if (index === -1) { + return + } + state.visitedViews = state.visitedViews.filter((item, idx) => { + if (idx >= index || (item.meta && item.meta.affix)) { + return true + } + const i = state.cachedViews.indexOf(item.name) + if (i > -1) { + state.cachedViews.splice(i, 1) + } + if(item.meta.link) { + const fi = state.iframeViews.findIndex(v => v.path === item.path) + state.iframeViews.splice(fi, 1) + } + return false + }) + } +} + +const actions = { + addView({ dispatch }, view) { + dispatch('addVisitedView', view) + dispatch('addCachedView', view) + }, + addIframeView({ commit }, view) { + commit('ADD_IFRAME_VIEW', view) + }, + addVisitedView({ commit }, view) { + commit('ADD_VISITED_VIEW', view) + }, + addCachedView({ commit }, view) { + commit('ADD_CACHED_VIEW', view) + }, + delView({ dispatch, state }, view) { + return new Promise(resolve => { + dispatch('delVisitedView', view) + dispatch('delCachedView', view) + resolve({ + visitedViews: [...state.visitedViews], + cachedViews: [...state.cachedViews] + }) + }) + }, + delVisitedView({ commit, state }, view) { + return new Promise(resolve => { + commit('DEL_VISITED_VIEW', view) + resolve([...state.visitedViews]) + }) + }, + delIframeView({ commit, state }, view) { + return new Promise(resolve => { + commit('DEL_IFRAME_VIEW', view) + resolve([...state.iframeViews]) + }) + }, + delCachedView({ commit, state }, view) { + return new Promise(resolve => { + commit('DEL_CACHED_VIEW', view) + resolve([...state.cachedViews]) + }) + }, + delOthersViews({ dispatch, state }, view) { + return new Promise(resolve => { + dispatch('delOthersVisitedViews', view) + dispatch('delOthersCachedViews', view) + resolve({ + visitedViews: [...state.visitedViews], + cachedViews: [...state.cachedViews] + }) + }) + }, + delOthersVisitedViews({ commit, state }, view) { + return new Promise(resolve => { + commit('DEL_OTHERS_VISITED_VIEWS', view) + resolve([...state.visitedViews]) + }) + }, + delOthersCachedViews({ commit, state }, view) { + return new Promise(resolve => { + commit('DEL_OTHERS_CACHED_VIEWS', view) + resolve([...state.cachedViews]) + }) + }, + delAllViews({ dispatch, state }, view) { + return new Promise(resolve => { + dispatch('delAllVisitedViews', view) + dispatch('delAllCachedViews', view) + resolve({ + visitedViews: [...state.visitedViews], + cachedViews: [...state.cachedViews] + }) + }) + }, + delAllVisitedViews({ commit, state }) { + return new Promise(resolve => { + commit('DEL_ALL_VISITED_VIEWS') + resolve([...state.visitedViews]) + }) + }, + delAllCachedViews({ commit, state }) { + return new Promise(resolve => { + commit('DEL_ALL_CACHED_VIEWS') + resolve([...state.cachedViews]) + }) + }, + updateVisitedView({ commit }, view) { + commit('UPDATE_VISITED_VIEW', view) + }, + delRightTags({ commit }, view) { + return new Promise(resolve => { + commit('DEL_RIGHT_VIEWS', view) + resolve([...state.visitedViews]) + }) + }, + delLeftTags({ commit }, view) { + return new Promise(resolve => { + commit('DEL_LEFT_VIEWS', view) + resolve([...state.visitedViews]) + }) + }, +} + +export default { + namespaced: true, + state, + mutations, + actions +} diff --git a/custom-ui/src/store/modules/user.js b/custom-ui/src/store/modules/user.js new file mode 100644 index 0000000..ab0a6fe --- /dev/null +++ b/custom-ui/src/store/modules/user.js @@ -0,0 +1,96 @@ +import { login, logout, getInfo } from '@/api/login' +import { getToken, setToken, removeToken } from '@/utils/auth' + +const user = { + state: { + token: getToken(), + name: '', + avatar: '', + roles: [], + permissions: [] + }, + + mutations: { + SET_TOKEN: (state, token) => { + state.token = token + }, + SET_NAME: (state, name) => { + state.name = name + }, + SET_AVATAR: (state, avatar) => { + state.avatar = avatar + }, + SET_ROLES: (state, roles) => { + state.roles = roles + }, + SET_PERMISSIONS: (state, permissions) => { + state.permissions = permissions + } + }, + + actions: { + // 登录 + Login({ commit }, userInfo) { + const username = userInfo.username.trim() + const password = userInfo.password + const code = userInfo.code + const uuid = userInfo.uuid + return new Promise((resolve, reject) => { + login(username, password, code, uuid).then(res => { + setToken(res.token) + commit('SET_TOKEN', res.token) + resolve() + }).catch(error => { + reject(error) + }) + }) + }, + + // 获取用户信息 + GetInfo({ commit, state }) { + return new Promise((resolve, reject) => { + getInfo().then(res => { + const user = res.user + const avatar = (user.avatar == "" || user.avatar == null) ? require("@/assets/images/profile.jpg") : process.env.VUE_APP_BASE_API + user.avatar; + if (res.roles && res.roles.length > 0) { // 验证返回的roles是否是一个非空数组 + commit('SET_ROLES', res.roles) + commit('SET_PERMISSIONS', res.permissions) + } else { + commit('SET_ROLES', ['ROLE_DEFAULT']) + } + commit('SET_NAME', user.userName) + commit('SET_AVATAR', avatar) + resolve(res) + }).catch(error => { + reject(error) + }) + }) + }, + + // 退出系统 + LogOut({ commit, state }) { + return new Promise((resolve, reject) => { + logout(state.token).then(() => { + commit('SET_TOKEN', '') + commit('SET_ROLES', []) + commit('SET_PERMISSIONS', []) + removeToken() + resolve() + }).catch(error => { + reject(error) + }) + }) + }, + + // 前端 登出 + FedLogOut({ commit }) { + return new Promise(resolve => { + commit('SET_TOKEN', '') + removeToken() + resolve() + }) + } + } +} + +export default user diff --git a/custom-ui/src/utils/auth.js b/custom-ui/src/utils/auth.js new file mode 100644 index 0000000..08a43d6 --- /dev/null +++ b/custom-ui/src/utils/auth.js @@ -0,0 +1,15 @@ +import Cookies from 'js-cookie' + +const TokenKey = 'Admin-Token' + +export function getToken() { + return Cookies.get(TokenKey) +} + +export function setToken(token) { + return Cookies.set(TokenKey, token) +} + +export function removeToken() { + return Cookies.remove(TokenKey) +} diff --git a/custom-ui/src/utils/dict/Dict.js b/custom-ui/src/utils/dict/Dict.js new file mode 100644 index 0000000..104bd6e --- /dev/null +++ b/custom-ui/src/utils/dict/Dict.js @@ -0,0 +1,82 @@ +import Vue from 'vue' +import { mergeRecursive } from "@/utils/ruoyi"; +import DictMeta from './DictMeta' +import DictData from './DictData' + +const DEFAULT_DICT_OPTIONS = { + types: [], +} + +/** + * @classdesc 字典 + * @property {Object} label 标签对象,内部属性名为字典类型名称 + * @property {Object} dict 字段数组,内部属性名为字典类型名称 + * @property {Array.} _dictMetas 字典元数据数组 + */ +export default class Dict { + constructor() { + this.owner = null + this.label = {} + this.type = {} + } + + init(options) { + if (options instanceof Array) { + options = { types: options } + } + const opts = mergeRecursive(DEFAULT_DICT_OPTIONS, options) + if (opts.types === undefined) { + throw new Error('need dict types') + } + const ps = [] + this._dictMetas = opts.types.map(t => DictMeta.parse(t)) + this._dictMetas.forEach(dictMeta => { + const type = dictMeta.type + Vue.set(this.label, type, {}) + Vue.set(this.type, type, []) + if (dictMeta.lazy) { + return + } + ps.push(loadDict(this, dictMeta)) + }) + return Promise.all(ps) + } + + /** + * 重新加载字典 + * @param {String} type 字典类型 + */ + reloadDict(type) { + const dictMeta = this._dictMetas.find(e => e.type === type) + if (dictMeta === undefined) { + return Promise.reject(`the dict meta of ${type} was not found`) + } + return loadDict(this, dictMeta) + } +} + +/** + * 加载字典 + * @param {Dict} dict 字典 + * @param {DictMeta} dictMeta 字典元数据 + * @returns {Promise} + */ +function loadDict(dict, dictMeta) { + return dictMeta.request(dictMeta) + .then(response => { + const type = dictMeta.type + let dicts = dictMeta.responseConverter(response, dictMeta) + if (!(dicts instanceof Array)) { + console.error('the return of responseConverter must be Array.') + dicts = [] + } else if (dicts.filter(d => d instanceof DictData).length !== dicts.length) { + console.error('the type of elements in dicts must be DictData') + dicts = [] + } + dict.type[type].splice(0, Number.MAX_SAFE_INTEGER, ...dicts) + dicts.forEach(d => { + Vue.set(dict.label[type], d.value, d.label) + }) + return dicts + }) +} diff --git a/custom-ui/src/utils/dict/DictConverter.js b/custom-ui/src/utils/dict/DictConverter.js new file mode 100644 index 0000000..0cf5df8 --- /dev/null +++ b/custom-ui/src/utils/dict/DictConverter.js @@ -0,0 +1,17 @@ +import DictOptions from './DictOptions' +import DictData from './DictData' + +export default function(dict, dictMeta) { + const label = determineDictField(dict, dictMeta.labelField, ...DictOptions.DEFAULT_LABEL_FIELDS) + const value = determineDictField(dict, dictMeta.valueField, ...DictOptions.DEFAULT_VALUE_FIELDS) + return new DictData(dict[label], dict[value], dict) +} + +/** + * 确定字典字段 + * @param {DictData} dict + * @param {...String} fields + */ +function determineDictField(dict, ...fields) { + return fields.find(f => Object.prototype.hasOwnProperty.call(dict, f)) +} diff --git a/custom-ui/src/utils/dict/DictData.js b/custom-ui/src/utils/dict/DictData.js new file mode 100644 index 0000000..afc763e --- /dev/null +++ b/custom-ui/src/utils/dict/DictData.js @@ -0,0 +1,13 @@ +/** + * @classdesc 字典数据 + * @property {String} label 标签 + * @property {*} value 标签 + * @property {Object} raw 原始数据 + */ +export default class DictData { + constructor(label, value, raw) { + this.label = label + this.value = value + this.raw = raw + } +} diff --git a/custom-ui/src/utils/dict/DictMeta.js b/custom-ui/src/utils/dict/DictMeta.js new file mode 100644 index 0000000..9779daa --- /dev/null +++ b/custom-ui/src/utils/dict/DictMeta.js @@ -0,0 +1,38 @@ +import { mergeRecursive } from "@/utils/ruoyi"; +import DictOptions from './DictOptions' + +/** + * @classdesc 字典元数据 + * @property {String} type 类型 + * @property {Function} request 请求 + * @property {String} label 标签字段 + * @property {String} value 值字段 + */ +export default class DictMeta { + constructor(options) { + this.type = options.type + this.request = options.request + this.responseConverter = options.responseConverter + this.labelField = options.labelField + this.valueField = options.valueField + this.lazy = options.lazy === true + } +} + + +/** + * 解析字典元数据 + * @param {Object} options + * @returns {DictMeta} + */ +DictMeta.parse= function(options) { + let opts = null + if (typeof options === 'string') { + opts = DictOptions.metas[options] || {} + opts.type = options + } else if (typeof options === 'object') { + opts = options + } + opts = mergeRecursive(DictOptions.metas['*'], opts) + return new DictMeta(opts) +} diff --git a/custom-ui/src/utils/dict/DictOptions.js b/custom-ui/src/utils/dict/DictOptions.js new file mode 100644 index 0000000..338a94e --- /dev/null +++ b/custom-ui/src/utils/dict/DictOptions.js @@ -0,0 +1,51 @@ +import { mergeRecursive } from "@/utils/ruoyi"; +import dictConverter from './DictConverter' + +export const options = { + metas: { + '*': { + /** + * 字典请求,方法签名为function(dictMeta: DictMeta): Promise + */ + request: (dictMeta) => { + console.log(`load dict ${dictMeta.type}`) + return Promise.resolve([]) + }, + /** + * 字典响应数据转换器,方法签名为function(response: Object, dictMeta: DictMeta): DictData + */ + responseConverter, + labelField: 'label', + valueField: 'value', + }, + }, + /** + * 默认标签字段 + */ + DEFAULT_LABEL_FIELDS: ['label', 'name', 'title'], + /** + * 默认值字段 + */ + DEFAULT_VALUE_FIELDS: ['value', 'id', 'uid', 'key'], +} + +/** + * 映射字典 + * @param {Object} response 字典数据 + * @param {DictMeta} dictMeta 字典元数据 + * @returns {DictData} + */ +function responseConverter(response, dictMeta) { + const dicts = response.content instanceof Array ? response.content : response + if (dicts === undefined) { + console.warn(`no dict data of "${dictMeta.type}" found in the response`) + return [] + } + return dicts.map(d => dictConverter(d, dictMeta)) +} + +export function mergeOptions(src) { + mergeRecursive(options, src) +} + +export default options diff --git a/custom-ui/src/utils/dict/index.js b/custom-ui/src/utils/dict/index.js new file mode 100644 index 0000000..215eb9e --- /dev/null +++ b/custom-ui/src/utils/dict/index.js @@ -0,0 +1,33 @@ +import Dict from './Dict' +import { mergeOptions } from './DictOptions' + +export default function(Vue, options) { + mergeOptions(options) + Vue.mixin({ + data() { + if (this.$options === undefined || this.$options.dicts === undefined || this.$options.dicts === null) { + return {} + } + const dict = new Dict() + dict.owner = this + return { + dict + } + }, + created() { + if (!(this.dict instanceof Dict)) { + return + } + options.onCreated && options.onCreated(this.dict) + this.dict.init(this.$options.dicts).then(() => { + options.onReady && options.onReady(this.dict) + this.$nextTick(() => { + this.$emit('dictReady', this.dict) + if (this.$options.methods && this.$options.methods.onDictReady instanceof Function) { + this.$options.methods.onDictReady.call(this, this.dict) + } + }) + }) + }, + }) +} diff --git a/custom-ui/src/utils/errorCode.js b/custom-ui/src/utils/errorCode.js new file mode 100644 index 0000000..d2111ee --- /dev/null +++ b/custom-ui/src/utils/errorCode.js @@ -0,0 +1,6 @@ +export default { + '401': '认证失败,无法访问系统资源', + '403': '当前操作没有权限', + '404': '访问资源不存在', + 'default': '系统未知错误,请反馈给管理员' +} diff --git a/custom-ui/src/utils/generator/config.js b/custom-ui/src/utils/generator/config.js new file mode 100644 index 0000000..7abf227 --- /dev/null +++ b/custom-ui/src/utils/generator/config.js @@ -0,0 +1,438 @@ +export const formConf = { + formRef: 'elForm', + formModel: 'formData', + size: 'medium', + labelPosition: 'right', + labelWidth: 100, + formRules: 'rules', + gutter: 15, + disabled: false, + span: 24, + formBtns: true +} + +export const inputComponents = [ + { + label: '单行文本', + tag: 'el-input', + tagIcon: 'input', + placeholder: '请输入', + defaultValue: undefined, + span: 24, + labelWidth: null, + style: { width: '100%' }, + clearable: true, + prepend: '', + append: '', + 'prefix-icon': '', + 'suffix-icon': '', + maxlength: null, + 'show-word-limit': false, + readonly: false, + disabled: false, + required: true, + regList: [], + changeTag: true, + document: 'https://element.eleme.cn/#/zh-CN/component/input' + }, + { + label: '多行文本', + tag: 'el-input', + tagIcon: 'textarea', + type: 'textarea', + placeholder: '请输入', + defaultValue: undefined, + span: 24, + labelWidth: null, + autosize: { + minRows: 4, + maxRows: 4 + }, + style: { width: '100%' }, + maxlength: null, + 'show-word-limit': false, + readonly: false, + disabled: false, + required: true, + regList: [], + changeTag: true, + document: 'https://element.eleme.cn/#/zh-CN/component/input' + }, + { + label: '密码', + tag: 'el-input', + tagIcon: 'password', + placeholder: '请输入', + defaultValue: undefined, + span: 24, + 'show-password': true, + labelWidth: null, + style: { width: '100%' }, + clearable: true, + prepend: '', + append: '', + 'prefix-icon': '', + 'suffix-icon': '', + maxlength: null, + 'show-word-limit': false, + readonly: false, + disabled: false, + required: true, + regList: [], + changeTag: true, + document: 'https://element.eleme.cn/#/zh-CN/component/input' + }, + { + label: '计数器', + tag: 'el-input-number', + tagIcon: 'number', + placeholder: '', + defaultValue: undefined, + span: 24, + labelWidth: null, + min: undefined, + max: undefined, + step: undefined, + 'step-strictly': false, + precision: undefined, + 'controls-position': '', + disabled: false, + required: true, + regList: [], + changeTag: true, + document: 'https://element.eleme.cn/#/zh-CN/component/input-number' + } +] + +export const selectComponents = [ + { + label: '下拉选择', + tag: 'el-select', + tagIcon: 'select', + placeholder: '请选择', + defaultValue: undefined, + span: 24, + labelWidth: null, + style: { width: '100%' }, + clearable: true, + disabled: false, + required: true, + filterable: false, + multiple: false, + options: [{ + label: '选项一', + value: 1 + }, { + label: '选项二', + value: 2 + }], + regList: [], + changeTag: true, + document: 'https://element.eleme.cn/#/zh-CN/component/select' + }, + { + label: '级联选择', + tag: 'el-cascader', + tagIcon: 'cascader', + placeholder: '请选择', + defaultValue: [], + span: 24, + labelWidth: null, + style: { width: '100%' }, + props: { + props: { + multiple: false + } + }, + 'show-all-levels': true, + disabled: false, + clearable: true, + filterable: false, + required: true, + options: [{ + id: 1, + value: 1, + label: '选项1', + children: [{ + id: 2, + value: 2, + label: '选项1-1' + }] + }], + dataType: 'dynamic', + labelKey: 'label', + valueKey: 'value', + childrenKey: 'children', + separator: '/', + regList: [], + changeTag: true, + document: 'https://element.eleme.cn/#/zh-CN/component/cascader' + }, + { + label: '单选框组', + tag: 'el-radio-group', + tagIcon: 'radio', + defaultValue: undefined, + span: 24, + labelWidth: null, + style: {}, + optionType: 'default', + border: false, + size: 'medium', + disabled: false, + required: true, + options: [{ + label: '选项一', + value: 1 + }, { + label: '选项二', + value: 2 + }], + regList: [], + changeTag: true, + document: 'https://element.eleme.cn/#/zh-CN/component/radio' + }, + { + label: '多选框组', + tag: 'el-checkbox-group', + tagIcon: 'checkbox', + defaultValue: [], + span: 24, + labelWidth: null, + style: {}, + optionType: 'default', + border: false, + size: 'medium', + disabled: false, + required: true, + options: [{ + label: '选项一', + value: 1 + }, { + label: '选项二', + value: 2 + }], + regList: [], + changeTag: true, + document: 'https://element.eleme.cn/#/zh-CN/component/checkbox' + }, + { + label: '开关', + tag: 'el-switch', + tagIcon: 'switch', + defaultValue: false, + span: 24, + labelWidth: null, + style: {}, + disabled: false, + required: true, + 'active-text': '', + 'inactive-text': '', + 'active-color': null, + 'inactive-color': null, + 'active-value': true, + 'inactive-value': false, + regList: [], + changeTag: true, + document: 'https://element.eleme.cn/#/zh-CN/component/switch' + }, + { + label: '滑块', + tag: 'el-slider', + tagIcon: 'slider', + defaultValue: null, + span: 24, + labelWidth: null, + disabled: false, + required: true, + min: 0, + max: 100, + step: 1, + 'show-stops': false, + range: false, + regList: [], + changeTag: true, + document: 'https://element.eleme.cn/#/zh-CN/component/slider' + }, + { + label: '时间选择', + tag: 'el-time-picker', + tagIcon: 'time', + placeholder: '请选择', + defaultValue: null, + span: 24, + labelWidth: null, + style: { width: '100%' }, + disabled: false, + clearable: true, + required: true, + 'picker-options': { + selectableRange: '00:00:00-23:59:59' + }, + format: 'HH:mm:ss', + 'value-format': 'HH:mm:ss', + regList: [], + changeTag: true, + document: 'https://element.eleme.cn/#/zh-CN/component/time-picker' + }, + { + label: '时间范围', + tag: 'el-time-picker', + tagIcon: 'time-range', + defaultValue: null, + span: 24, + labelWidth: null, + style: { width: '100%' }, + disabled: false, + clearable: true, + required: true, + 'is-range': true, + 'range-separator': '至', + 'start-placeholder': '开始时间', + 'end-placeholder': '结束时间', + format: 'HH:mm:ss', + 'value-format': 'HH:mm:ss', + regList: [], + changeTag: true, + document: 'https://element.eleme.cn/#/zh-CN/component/time-picker' + }, + { + label: '日期选择', + tag: 'el-date-picker', + tagIcon: 'date', + placeholder: '请选择', + defaultValue: null, + type: 'date', + span: 24, + labelWidth: null, + style: { width: '100%' }, + disabled: false, + clearable: true, + required: true, + format: 'yyyy-MM-dd', + 'value-format': 'yyyy-MM-dd', + readonly: false, + regList: [], + changeTag: true, + document: 'https://element.eleme.cn/#/zh-CN/component/date-picker' + }, + { + label: '日期范围', + tag: 'el-date-picker', + tagIcon: 'date-range', + defaultValue: null, + span: 24, + labelWidth: null, + style: { width: '100%' }, + type: 'daterange', + 'range-separator': '至', + 'start-placeholder': '开始日期', + 'end-placeholder': '结束日期', + disabled: false, + clearable: true, + required: true, + format: 'yyyy-MM-dd', + 'value-format': 'yyyy-MM-dd', + readonly: false, + regList: [], + changeTag: true, + document: 'https://element.eleme.cn/#/zh-CN/component/date-picker' + }, + { + label: '评分', + tag: 'el-rate', + tagIcon: 'rate', + defaultValue: 0, + span: 24, + labelWidth: null, + style: {}, + max: 5, + 'allow-half': false, + 'show-text': false, + 'show-score': false, + disabled: false, + required: true, + regList: [], + changeTag: true, + document: 'https://element.eleme.cn/#/zh-CN/component/rate' + }, + { + label: '颜色选择', + tag: 'el-color-picker', + tagIcon: 'color', + defaultValue: null, + labelWidth: null, + 'show-alpha': false, + 'color-format': '', + disabled: false, + required: true, + size: 'medium', + regList: [], + changeTag: true, + document: 'https://element.eleme.cn/#/zh-CN/component/color-picker' + }, + { + label: '上传', + tag: 'el-upload', + tagIcon: 'upload', + action: 'https://jsonplaceholder.typicode.com/posts/', + defaultValue: null, + labelWidth: null, + disabled: false, + required: true, + accept: '', + name: 'file', + 'auto-upload': true, + showTip: false, + buttonText: '点击上传', + fileSize: 2, + sizeUnit: 'MB', + 'list-type': 'text', + multiple: false, + regList: [], + changeTag: true, + document: 'https://element.eleme.cn/#/zh-CN/component/upload' + } +] + +export const layoutComponents = [ + { + layout: 'rowFormItem', + tagIcon: 'row', + type: 'default', + justify: 'start', + align: 'top', + label: '行容器', + layoutTree: true, + children: [], + document: 'https://element.eleme.cn/#/zh-CN/component/layout' + }, + { + layout: 'colFormItem', + label: '按钮', + changeTag: true, + labelWidth: null, + tag: 'el-button', + tagIcon: 'button', + span: 24, + default: '主要按钮', + type: 'primary', + icon: 'el-icon-search', + size: 'medium', + disabled: false, + document: 'https://element.eleme.cn/#/zh-CN/component/button' + } +] + +// 组件rule的触发方式,无触发方式的组件不生成rule +export const trigger = { + 'el-input': 'blur', + 'el-input-number': 'blur', + 'el-select': 'change', + 'el-radio-group': 'change', + 'el-checkbox-group': 'change', + 'el-cascader': 'change', + 'el-time-picker': 'change', + 'el-date-picker': 'change', + 'el-rate': 'change' +} diff --git a/custom-ui/src/utils/generator/css.js b/custom-ui/src/utils/generator/css.js new file mode 100644 index 0000000..c1c62e6 --- /dev/null +++ b/custom-ui/src/utils/generator/css.js @@ -0,0 +1,18 @@ +const styles = { + 'el-rate': '.el-rate{display: inline-block; vertical-align: text-top;}', + 'el-upload': '.el-upload__tip{line-height: 1.2;}' +} + +function addCss(cssList, el) { + const css = styles[el.tag] + css && cssList.indexOf(css) === -1 && cssList.push(css) + if (el.children) { + el.children.forEach(el2 => addCss(cssList, el2)) + } +} + +export function makeUpCss(conf) { + const cssList = [] + conf.fields.forEach(el => addCss(cssList, el)) + return cssList.join('\n') +} diff --git a/custom-ui/src/utils/generator/drawingDefault.js b/custom-ui/src/utils/generator/drawingDefault.js new file mode 100644 index 0000000..09f133c --- /dev/null +++ b/custom-ui/src/utils/generator/drawingDefault.js @@ -0,0 +1,29 @@ +export default [ + { + layout: 'colFormItem', + tagIcon: 'input', + label: '手机号', + vModel: 'mobile', + formId: 6, + tag: 'el-input', + placeholder: '请输入手机号', + defaultValue: '', + span: 24, + style: { width: '100%' }, + clearable: true, + prepend: '', + append: '', + 'prefix-icon': 'el-icon-mobile', + 'suffix-icon': '', + maxlength: 11, + 'show-word-limit': true, + readonly: false, + disabled: false, + required: true, + changeTag: true, + regList: [{ + pattern: '/^1(3|4|5|7|8|9)\\d{9}$/', + message: '手机号格式错误' + }] + } +] diff --git a/custom-ui/src/utils/generator/html.js b/custom-ui/src/utils/generator/html.js new file mode 100644 index 0000000..9bcc536 --- /dev/null +++ b/custom-ui/src/utils/generator/html.js @@ -0,0 +1,359 @@ +/* eslint-disable max-len */ +import { trigger } from './config' + +let confGlobal +let someSpanIsNot24 + +export function dialogWrapper(str) { + return ` + ${str} +
+ 取消 + 确定 +
+
` +} + +export function vueTemplate(str) { + return `` +} + +export function vueScript(str) { + return `` +} + +export function cssStyle(cssStr) { + return `` +} + +function buildFormTemplate(conf, child, type) { + let labelPosition = '' + if (conf.labelPosition !== 'right') { + labelPosition = `label-position="${conf.labelPosition}"` + } + const disabled = conf.disabled ? `:disabled="${conf.disabled}"` : '' + let str = ` + ${child} + ${buildFromBtns(conf, type)} + ` + if (someSpanIsNot24) { + str = ` + ${str} + ` + } + return str +} + +function buildFromBtns(conf, type) { + let str = '' + if (conf.formBtns && type === 'file') { + str = ` + 提交 + 重置 + ` + if (someSpanIsNot24) { + str = ` + ${str} + ` + } + } + return str +} + +// span不为24的用el-col包裹 +function colWrapper(element, str) { + if (someSpanIsNot24 || element.span !== 24) { + return ` + ${str} + ` + } + return str +} + +const layouts = { + colFormItem(element) { + let labelWidth = '' + if (element.labelWidth && element.labelWidth !== confGlobal.labelWidth) { + labelWidth = `label-width="${element.labelWidth}px"` + } + const required = !trigger[element.tag] && element.required ? 'required' : '' + const tagDom = tags[element.tag] ? tags[element.tag](element) : null + let str = ` + ${tagDom} + ` + str = colWrapper(element, str) + return str + }, + rowFormItem(element) { + const type = element.type === 'default' ? '' : `type="${element.type}"` + const justify = element.type === 'default' ? '' : `justify="${element.justify}"` + const align = element.type === 'default' ? '' : `align="${element.align}"` + const gutter = element.gutter ? `gutter="${element.gutter}"` : '' + const children = element.children.map(el => layouts[el.layout](el)) + let str = ` + ${children.join('\n')} + ` + str = colWrapper(element, str) + return str + } +} + +const tags = { + 'el-button': el => { + const { + tag, disabled + } = attrBuilder(el) + const type = el.type ? `type="${el.type}"` : '' + const icon = el.icon ? `icon="${el.icon}"` : '' + const size = el.size ? `size="${el.size}"` : '' + let child = buildElButtonChild(el) + + if (child) child = `\n${child}\n` // 换行 + return `<${el.tag} ${type} ${icon} ${size} ${disabled}>${child}` + }, + 'el-input': el => { + const { + disabled, vModel, clearable, placeholder, width + } = attrBuilder(el) + const maxlength = el.maxlength ? `:maxlength="${el.maxlength}"` : '' + const showWordLimit = el['show-word-limit'] ? 'show-word-limit' : '' + const readonly = el.readonly ? 'readonly' : '' + const prefixIcon = el['prefix-icon'] ? `prefix-icon='${el['prefix-icon']}'` : '' + const suffixIcon = el['suffix-icon'] ? `suffix-icon='${el['suffix-icon']}'` : '' + const showPassword = el['show-password'] ? 'show-password' : '' + const type = el.type ? `type="${el.type}"` : '' + const autosize = el.autosize && el.autosize.minRows + ? `:autosize="{minRows: ${el.autosize.minRows}, maxRows: ${el.autosize.maxRows}}"` + : '' + let child = buildElInputChild(el) + + if (child) child = `\n${child}\n` // 换行 + return `<${el.tag} ${vModel} ${type} ${placeholder} ${maxlength} ${showWordLimit} ${readonly} ${disabled} ${clearable} ${prefixIcon} ${suffixIcon} ${showPassword} ${autosize} ${width}>${child}` + }, + 'el-input-number': el => { + const { disabled, vModel, placeholder } = attrBuilder(el) + const controlsPosition = el['controls-position'] ? `controls-position=${el['controls-position']}` : '' + const min = el.min ? `:min='${el.min}'` : '' + const max = el.max ? `:max='${el.max}'` : '' + const step = el.step ? `:step='${el.step}'` : '' + const stepStrictly = el['step-strictly'] ? 'step-strictly' : '' + const precision = el.precision ? `:precision='${el.precision}'` : '' + + return `<${el.tag} ${vModel} ${placeholder} ${step} ${stepStrictly} ${precision} ${controlsPosition} ${min} ${max} ${disabled}>` + }, + 'el-select': el => { + const { + disabled, vModel, clearable, placeholder, width + } = attrBuilder(el) + const filterable = el.filterable ? 'filterable' : '' + const multiple = el.multiple ? 'multiple' : '' + let child = buildElSelectChild(el) + + if (child) child = `\n${child}\n` // 换行 + return `<${el.tag} ${vModel} ${placeholder} ${disabled} ${multiple} ${filterable} ${clearable} ${width}>${child}` + }, + 'el-radio-group': el => { + const { disabled, vModel } = attrBuilder(el) + const size = `size="${el.size}"` + let child = buildElRadioGroupChild(el) + + if (child) child = `\n${child}\n` // 换行 + return `<${el.tag} ${vModel} ${size} ${disabled}>${child}` + }, + 'el-checkbox-group': el => { + const { disabled, vModel } = attrBuilder(el) + const size = `size="${el.size}"` + const min = el.min ? `:min="${el.min}"` : '' + const max = el.max ? `:max="${el.max}"` : '' + let child = buildElCheckboxGroupChild(el) + + if (child) child = `\n${child}\n` // 换行 + return `<${el.tag} ${vModel} ${min} ${max} ${size} ${disabled}>${child}` + }, + 'el-switch': el => { + const { disabled, vModel } = attrBuilder(el) + const activeText = el['active-text'] ? `active-text="${el['active-text']}"` : '' + const inactiveText = el['inactive-text'] ? `inactive-text="${el['inactive-text']}"` : '' + const activeColor = el['active-color'] ? `active-color="${el['active-color']}"` : '' + const inactiveColor = el['inactive-color'] ? `inactive-color="${el['inactive-color']}"` : '' + const activeValue = el['active-value'] !== true ? `:active-value='${JSON.stringify(el['active-value'])}'` : '' + const inactiveValue = el['inactive-value'] !== false ? `:inactive-value='${JSON.stringify(el['inactive-value'])}'` : '' + + return `<${el.tag} ${vModel} ${activeText} ${inactiveText} ${activeColor} ${inactiveColor} ${activeValue} ${inactiveValue} ${disabled}>` + }, + 'el-cascader': el => { + const { + disabled, vModel, clearable, placeholder, width + } = attrBuilder(el) + const options = el.options ? `:options="${el.vModel}Options"` : '' + const props = el.props ? `:props="${el.vModel}Props"` : '' + const showAllLevels = el['show-all-levels'] ? '' : ':show-all-levels="false"' + const filterable = el.filterable ? 'filterable' : '' + const separator = el.separator === '/' ? '' : `separator="${el.separator}"` + + return `<${el.tag} ${vModel} ${options} ${props} ${width} ${showAllLevels} ${placeholder} ${separator} ${filterable} ${clearable} ${disabled}>` + }, + 'el-slider': el => { + const { disabled, vModel } = attrBuilder(el) + const min = el.min ? `:min='${el.min}'` : '' + const max = el.max ? `:max='${el.max}'` : '' + const step = el.step ? `:step='${el.step}'` : '' + const range = el.range ? 'range' : '' + const showStops = el['show-stops'] ? `:show-stops="${el['show-stops']}"` : '' + + return `<${el.tag} ${min} ${max} ${step} ${vModel} ${range} ${showStops} ${disabled}>` + }, + 'el-time-picker': el => { + const { + disabled, vModel, clearable, placeholder, width + } = attrBuilder(el) + const startPlaceholder = el['start-placeholder'] ? `start-placeholder="${el['start-placeholder']}"` : '' + const endPlaceholder = el['end-placeholder'] ? `end-placeholder="${el['end-placeholder']}"` : '' + const rangeSeparator = el['range-separator'] ? `range-separator="${el['range-separator']}"` : '' + const isRange = el['is-range'] ? 'is-range' : '' + const format = el.format ? `format="${el.format}"` : '' + const valueFormat = el['value-format'] ? `value-format="${el['value-format']}"` : '' + const pickerOptions = el['picker-options'] ? `:picker-options='${JSON.stringify(el['picker-options'])}'` : '' + + return `<${el.tag} ${vModel} ${isRange} ${format} ${valueFormat} ${pickerOptions} ${width} ${placeholder} ${startPlaceholder} ${endPlaceholder} ${rangeSeparator} ${clearable} ${disabled}>` + }, + 'el-date-picker': el => { + const { + disabled, vModel, clearable, placeholder, width + } = attrBuilder(el) + const startPlaceholder = el['start-placeholder'] ? `start-placeholder="${el['start-placeholder']}"` : '' + const endPlaceholder = el['end-placeholder'] ? `end-placeholder="${el['end-placeholder']}"` : '' + const rangeSeparator = el['range-separator'] ? `range-separator="${el['range-separator']}"` : '' + const format = el.format ? `format="${el.format}"` : '' + const valueFormat = el['value-format'] ? `value-format="${el['value-format']}"` : '' + const type = el.type === 'date' ? '' : `type="${el.type}"` + const readonly = el.readonly ? 'readonly' : '' + + return `<${el.tag} ${type} ${vModel} ${format} ${valueFormat} ${width} ${placeholder} ${startPlaceholder} ${endPlaceholder} ${rangeSeparator} ${clearable} ${readonly} ${disabled}>` + }, + 'el-rate': el => { + const { disabled, vModel } = attrBuilder(el) + const max = el.max ? `:max='${el.max}'` : '' + const allowHalf = el['allow-half'] ? 'allow-half' : '' + const showText = el['show-text'] ? 'show-text' : '' + const showScore = el['show-score'] ? 'show-score' : '' + + return `<${el.tag} ${vModel} ${allowHalf} ${showText} ${showScore} ${disabled}>` + }, + 'el-color-picker': el => { + const { disabled, vModel } = attrBuilder(el) + const size = `size="${el.size}"` + const showAlpha = el['show-alpha'] ? 'show-alpha' : '' + const colorFormat = el['color-format'] ? `color-format="${el['color-format']}"` : '' + + return `<${el.tag} ${vModel} ${size} ${showAlpha} ${colorFormat} ${disabled}>` + }, + 'el-upload': el => { + const disabled = el.disabled ? ':disabled=\'true\'' : '' + const action = el.action ? `:action="${el.vModel}Action"` : '' + const multiple = el.multiple ? 'multiple' : '' + const listType = el['list-type'] !== 'text' ? `list-type="${el['list-type']}"` : '' + const accept = el.accept ? `accept="${el.accept}"` : '' + const name = el.name !== 'file' ? `name="${el.name}"` : '' + const autoUpload = el['auto-upload'] === false ? ':auto-upload="false"' : '' + const beforeUpload = `:before-upload="${el.vModel}BeforeUpload"` + const fileList = `:file-list="${el.vModel}fileList"` + const ref = `ref="${el.vModel}"` + let child = buildElUploadChild(el) + + if (child) child = `\n${child}\n` // 换行 + return `<${el.tag} ${ref} ${fileList} ${action} ${autoUpload} ${multiple} ${beforeUpload} ${listType} ${accept} ${name} ${disabled}>${child}` + } +} + +function attrBuilder(el) { + return { + vModel: `v-model="${confGlobal.formModel}.${el.vModel}"`, + clearable: el.clearable ? 'clearable' : '', + placeholder: el.placeholder ? `placeholder="${el.placeholder}"` : '', + width: el.style && el.style.width ? ':style="{width: \'100%\'}"' : '', + disabled: el.disabled ? ':disabled=\'true\'' : '' + } +} + +// el-buttin 子级 +function buildElButtonChild(conf) { + const children = [] + if (conf.default) { + children.push(conf.default) + } + return children.join('\n') +} + +// el-input innerHTML +function buildElInputChild(conf) { + const children = [] + if (conf.prepend) { + children.push(``) + } + if (conf.append) { + children.push(``) + } + return children.join('\n') +} + +function buildElSelectChild(conf) { + const children = [] + if (conf.options && conf.options.length) { + children.push(``) + } + return children.join('\n') +} + +function buildElRadioGroupChild(conf) { + const children = [] + if (conf.options && conf.options.length) { + const tag = conf.optionType === 'button' ? 'el-radio-button' : 'el-radio' + const border = conf.border ? 'border' : '' + children.push(`<${tag} v-for="(item, index) in ${conf.vModel}Options" :key="index" :label="item.value" :disabled="item.disabled" ${border}>{{item.label}}`) + } + return children.join('\n') +} + +function buildElCheckboxGroupChild(conf) { + const children = [] + if (conf.options && conf.options.length) { + const tag = conf.optionType === 'button' ? 'el-checkbox-button' : 'el-checkbox' + const border = conf.border ? 'border' : '' + children.push(`<${tag} v-for="(item, index) in ${conf.vModel}Options" :key="index" :label="item.value" :disabled="item.disabled" ${border}>{{item.label}}`) + } + return children.join('\n') +} + +function buildElUploadChild(conf) { + const list = [] + if (conf['list-type'] === 'picture-card') list.push('') + else list.push(`${conf.buttonText}`) + if (conf.showTip) list.push(`
只能上传不超过 ${conf.fileSize}${conf.sizeUnit} 的${conf.accept}文件
`) + return list.join('\n') +} + +export function makeUpHtml(conf, type) { + const htmlList = [] + confGlobal = conf + someSpanIsNot24 = conf.fields.some(item => item.span !== 24) + conf.fields.forEach(el => { + htmlList.push(layouts[el.layout](el)) + }) + const htmlStr = htmlList.join('\n') + + let temp = buildFormTemplate(conf, htmlStr, type) + if (type === 'dialog') { + temp = dialogWrapper(temp) + } + confGlobal = null + return temp +} diff --git a/custom-ui/src/utils/generator/icon.json b/custom-ui/src/utils/generator/icon.json new file mode 100644 index 0000000..2d9999a --- /dev/null +++ b/custom-ui/src/utils/generator/icon.json @@ -0,0 +1 @@ +["platform-eleme","eleme","delete-solid","delete","s-tools","setting","user-solid","user","phone","phone-outline","more","more-outline","star-on","star-off","s-goods","goods","warning","warning-outline","question","info","remove","circle-plus","success","error","zoom-in","zoom-out","remove-outline","circle-plus-outline","circle-check","circle-close","s-help","help","minus","plus","check","close","picture","picture-outline","picture-outline-round","upload","upload2","download","camera-solid","camera","video-camera-solid","video-camera","message-solid","bell","s-cooperation","s-order","s-platform","s-fold","s-unfold","s-operation","s-promotion","s-home","s-release","s-ticket","s-management","s-open","s-shop","s-marketing","s-flag","s-comment","s-finance","s-claim","s-custom","s-opportunity","s-data","s-check","s-grid","menu","share","d-caret","caret-left","caret-right","caret-bottom","caret-top","bottom-left","bottom-right","back","right","bottom","top","top-left","top-right","arrow-left","arrow-right","arrow-down","arrow-up","d-arrow-left","d-arrow-right","video-pause","video-play","refresh","refresh-right","refresh-left","finished","sort","sort-up","sort-down","rank","loading","view","c-scale-to-original","date","edit","edit-outline","folder","folder-opened","folder-add","folder-remove","folder-delete","folder-checked","tickets","document-remove","document-delete","document-copy","document-checked","document","document-add","printer","paperclip","takeaway-box","search","monitor","attract","mobile","scissors","umbrella","headset","brush","mouse","coordinate","magic-stick","reading","data-line","data-board","pie-chart","data-analysis","collection-tag","film","suitcase","suitcase-1","receiving","collection","files","notebook-1","notebook-2","toilet-paper","office-building","school","table-lamp","house","no-smoking","smoking","shopping-cart-full","shopping-cart-1","shopping-cart-2","shopping-bag-1","shopping-bag-2","sold-out","sell","present","box","bank-card","money","coin","wallet","discount","price-tag","news","guide","male","female","thumb","cpu","link","connection","open","turn-off","set-up","chat-round","chat-line-round","chat-square","chat-dot-round","chat-dot-square","chat-line-square","message","postcard","position","turn-off-microphone","microphone","close-notification","bangzhu","time","odometer","crop","aim","switch-button","full-screen","copy-document","mic","stopwatch","medal-1","medal","trophy","trophy-1","first-aid-kit","discover","place","location","location-outline","location-information","add-location","delete-location","map-location","alarm-clock","timer","watch-1","watch","lock","unlock","key","service","mobile-phone","bicycle","truck","ship","basketball","football","soccer","baseball","wind-power","light-rain","lightning","heavy-rain","sunrise","sunrise-1","sunset","sunny","cloudy","partly-cloudy","cloudy-and-sunny","moon","moon-night","dish","dish-1","food","chicken","fork-spoon","knife-fork","burger","tableware","sugar","dessert","ice-cream","hot-water","water-cup","coffee-cup","cold-drink","goblet","goblet-full","goblet-square","goblet-square-full","refrigerator","grape","watermelon","cherry","apple","pear","orange","coffee","ice-tea","ice-drink","milk-tea","potato-strips","lollipop","ice-cream-square","ice-cream-round"] \ No newline at end of file diff --git a/custom-ui/src/utils/generator/js.js b/custom-ui/src/utils/generator/js.js new file mode 100644 index 0000000..35e3e21 --- /dev/null +++ b/custom-ui/src/utils/generator/js.js @@ -0,0 +1,236 @@ +import { isArray } from 'util' +import { exportDefault, titleCase } from '@/utils/index' +import { trigger } from './config' + +const units = { + KB: '1024', + MB: '1024 / 1024', + GB: '1024 / 1024 / 1024' +} +let confGlobal +const inheritAttrs = { + file: '', + dialog: 'inheritAttrs: false,' +} + + +export function makeUpJs(conf, type) { + confGlobal = conf = JSON.parse(JSON.stringify(conf)) + const dataList = [] + const ruleList = [] + const optionsList = [] + const propsList = [] + const methodList = mixinMethod(type) + const uploadVarList = [] + + conf.fields.forEach(el => { + buildAttributes(el, dataList, ruleList, optionsList, methodList, propsList, uploadVarList) + }) + + const script = buildexport( + conf, + type, + dataList.join('\n'), + ruleList.join('\n'), + optionsList.join('\n'), + uploadVarList.join('\n'), + propsList.join('\n'), + methodList.join('\n') + ) + confGlobal = null + return script +} + +function buildAttributes(el, dataList, ruleList, optionsList, methodList, propsList, uploadVarList) { + buildData(el, dataList) + buildRules(el, ruleList) + + if (el.options && el.options.length) { + buildOptions(el, optionsList) + if (el.dataType === 'dynamic') { + const model = `${el.vModel}Options` + const options = titleCase(model) + buildOptionMethod(`get${options}`, model, methodList) + } + } + + if (el.props && el.props.props) { + buildProps(el, propsList) + } + + if (el.action && el.tag === 'el-upload') { + uploadVarList.push( + `${el.vModel}Action: '${el.action}', + ${el.vModel}fileList: [],` + ) + methodList.push(buildBeforeUpload(el)) + if (!el['auto-upload']) { + methodList.push(buildSubmitUpload(el)) + } + } + + if (el.children) { + el.children.forEach(el2 => { + buildAttributes(el2, dataList, ruleList, optionsList, methodList, propsList, uploadVarList) + }) + } +} + +function mixinMethod(type) { + const list = []; const + minxins = { + file: confGlobal.formBtns ? { + submitForm: `submitForm() { + this.$refs['${confGlobal.formRef}'].validate(valid => { + if(!valid) return + // TODO 提交表单 + }) + },`, + resetForm: `resetForm() { + this.$refs['${confGlobal.formRef}'].resetFields() + },` + } : null, + dialog: { + onOpen: 'onOpen() {},', + onClose: `onClose() { + this.$refs['${confGlobal.formRef}'].resetFields() + },`, + close: `close() { + this.$emit('update:visible', false) + },`, + handleConfirm: `handleConfirm() { + this.$refs['${confGlobal.formRef}'].validate(valid => { + if(!valid) return + this.close() + }) + },` + } + } + + const methods = minxins[type] + if (methods) { + Object.keys(methods).forEach(key => { + list.push(methods[key]) + }) + } + + return list +} + +function buildData(conf, dataList) { + if (conf.vModel === undefined) return + let defaultValue + if (typeof (conf.defaultValue) === 'string' && !conf.multiple) { + defaultValue = `'${conf.defaultValue}'` + } else { + defaultValue = `${JSON.stringify(conf.defaultValue)}` + } + dataList.push(`${conf.vModel}: ${defaultValue},`) +} + +function buildRules(conf, ruleList) { + if (conf.vModel === undefined) return + const rules = [] + if (trigger[conf.tag]) { + if (conf.required) { + const type = isArray(conf.defaultValue) ? 'type: \'array\',' : '' + let message = isArray(conf.defaultValue) ? `请至少选择一个${conf.vModel}` : conf.placeholder + if (message === undefined) message = `${conf.label}不能为空` + rules.push(`{ required: true, ${type} message: '${message}', trigger: '${trigger[conf.tag]}' }`) + } + if (conf.regList && isArray(conf.regList)) { + conf.regList.forEach(item => { + if (item.pattern) { + rules.push(`{ pattern: ${eval(item.pattern)}, message: '${item.message}', trigger: '${trigger[conf.tag]}' }`) + } + }) + } + ruleList.push(`${conf.vModel}: [${rules.join(',')}],`) + } +} + +function buildOptions(conf, optionsList) { + if (conf.vModel === undefined) return + if (conf.dataType === 'dynamic') { conf.options = [] } + const str = `${conf.vModel}Options: ${JSON.stringify(conf.options)},` + optionsList.push(str) +} + +function buildProps(conf, propsList) { + if (conf.dataType === 'dynamic') { + conf.valueKey !== 'value' && (conf.props.props.value = conf.valueKey) + conf.labelKey !== 'label' && (conf.props.props.label = conf.labelKey) + conf.childrenKey !== 'children' && (conf.props.props.children = conf.childrenKey) + } + const str = `${conf.vModel}Props: ${JSON.stringify(conf.props.props)},` + propsList.push(str) +} + +function buildBeforeUpload(conf) { + const unitNum = units[conf.sizeUnit]; let rightSizeCode = ''; let acceptCode = ''; const + returnList = [] + if (conf.fileSize) { + rightSizeCode = `let isRightSize = file.size / ${unitNum} < ${conf.fileSize} + if(!isRightSize){ + this.$message.error('文件大小超过 ${conf.fileSize}${conf.sizeUnit}') + }` + returnList.push('isRightSize') + } + if (conf.accept) { + acceptCode = `let isAccept = new RegExp('${conf.accept}').test(file.type) + if(!isAccept){ + this.$message.error('应该选择${conf.accept}类型的文件') + }` + returnList.push('isAccept') + } + const str = `${conf.vModel}BeforeUpload(file) { + ${rightSizeCode} + ${acceptCode} + return ${returnList.join('&&')} + },` + return returnList.length ? str : '' +} + +function buildSubmitUpload(conf) { + const str = `submitUpload() { + this.$refs['${conf.vModel}'].submit() + },` + return str +} + +function buildOptionMethod(methodName, model, methodList) { + const str = `${methodName}() { + // TODO 发起请求获取数据 + this.${model} + },` + methodList.push(str) +} + +function buildexport(conf, type, data, rules, selectOptions, uploadVar, props, methods) { + const str = `${exportDefault}{ + ${inheritAttrs[type]} + components: {}, + props: [], + data () { + return { + ${conf.formModel}: { + ${data} + }, + ${conf.formRules}: { + ${rules} + }, + ${uploadVar} + ${selectOptions} + ${props} + } + }, + computed: {}, + watch: {}, + created () {}, + mounted () {}, + methods: { + ${methods} + } +}` + return str +} diff --git a/custom-ui/src/utils/generator/render.js b/custom-ui/src/utils/generator/render.js new file mode 100644 index 0000000..e8640f0 --- /dev/null +++ b/custom-ui/src/utils/generator/render.js @@ -0,0 +1,126 @@ +import { makeMap } from '@/utils/index' + +// 参考https://github.com/vuejs/vue/blob/v2.6.10/src/platforms/web/server/util.js +const isAttr = makeMap( + 'accept,accept-charset,accesskey,action,align,alt,async,autocomplete,' + + 'autofocus,autoplay,autosave,bgcolor,border,buffered,challenge,charset,' + + 'checked,cite,class,code,codebase,color,cols,colspan,content,http-equiv,' + + 'name,contenteditable,contextmenu,controls,coords,data,datetime,default,' + + 'defer,dir,dirname,disabled,download,draggable,dropzone,enctype,method,for,' + + 'form,formaction,headers,height,hidden,high,href,hreflang,http-equiv,' + + 'icon,id,ismap,itemprop,keytype,kind,label,lang,language,list,loop,low,' + + 'manifest,max,maxlength,media,method,GET,POST,min,multiple,email,file,' + + 'muted,name,novalidate,open,optimum,pattern,ping,placeholder,poster,' + + 'preload,radiogroup,readonly,rel,required,reversed,rows,rowspan,sandbox,' + + 'scope,scoped,seamless,selected,shape,size,type,text,password,sizes,span,' + + 'spellcheck,src,srcdoc,srclang,srcset,start,step,style,summary,tabindex,' + + 'target,title,type,usemap,value,width,wrap' +) + +function vModel(self, dataObject, defaultValue) { + dataObject.props.value = defaultValue + + dataObject.on.input = val => { + self.$emit('input', val) + } +} + +const componentChild = { + 'el-button': { + default(h, conf, key) { + return conf[key] + }, + }, + 'el-input': { + prepend(h, conf, key) { + return + }, + append(h, conf, key) { + return + } + }, + 'el-select': { + options(h, conf, key) { + const list = [] + conf.options.forEach(item => { + list.push() + }) + return list + } + }, + 'el-radio-group': { + options(h, conf, key) { + const list = [] + conf.options.forEach(item => { + if (conf.optionType === 'button') list.push({item.label}) + else list.push({item.label}) + }) + return list + } + }, + 'el-checkbox-group': { + options(h, conf, key) { + const list = [] + conf.options.forEach(item => { + if (conf.optionType === 'button') { + list.push({item.label}) + } else { + list.push({item.label}) + } + }) + return list + } + }, + 'el-upload': { + 'list-type': (h, conf, key) => { + const list = [] + if (conf['list-type'] === 'picture-card') { + list.push() + } else { + list.push({conf.buttonText}) + } + if (conf.showTip) { + list.push(
只能上传不超过 {conf.fileSize}{conf.sizeUnit} 的{conf.accept}文件
) + } + return list + } + } +} + +export default { + render(h) { + const dataObject = { + attrs: {}, + props: {}, + on: {}, + style: {} + } + const confClone = JSON.parse(JSON.stringify(this.conf)) + const children = [] + + const childObjs = componentChild[confClone.tag] + if (childObjs) { + Object.keys(childObjs).forEach(key => { + const childFunc = childObjs[key] + if (confClone[key]) { + children.push(childFunc(h, confClone, key)) + } + }) + } + + Object.keys(confClone).forEach(key => { + const val = confClone[key] + if (key === 'vModel') { + vModel(this, dataObject, confClone.defaultValue) + } else if (dataObject[key]) { + dataObject[key] = val + } else if (!isAttr(key)) { + dataObject.props[key] = val + } else { + dataObject.attrs[key] = val + } + }) + return h(this.conf.tag, dataObject, children) + }, + props: ['conf'] +} diff --git a/custom-ui/src/utils/index.js b/custom-ui/src/utils/index.js new file mode 100644 index 0000000..4e65504 --- /dev/null +++ b/custom-ui/src/utils/index.js @@ -0,0 +1,390 @@ +import { parseTime } from './ruoyi' + +/** + * 表格时间格式化 + */ +export function formatDate(cellValue) { + if (cellValue == null || cellValue == "") return ""; + var date = new Date(cellValue) + var year = date.getFullYear() + var month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1 + var day = date.getDate() < 10 ? '0' + date.getDate() : date.getDate() + var hours = date.getHours() < 10 ? '0' + date.getHours() : date.getHours() + var minutes = date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes() + var seconds = date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds() + return year + '-' + month + '-' + day + ' ' + hours + ':' + minutes + ':' + seconds +} + +/** + * @param {number} time + * @param {string} option + * @returns {string} + */ +export function formatTime(time, option) { + if (('' + time).length === 10) { + time = parseInt(time) * 1000 + } else { + time = +time + } + const d = new Date(time) + const now = Date.now() + + const diff = (now - d) / 1000 + + if (diff < 30) { + return '刚刚' + } else if (diff < 3600) { + // less 1 hour + return Math.ceil(diff / 60) + '分钟前' + } else if (diff < 3600 * 24) { + return Math.ceil(diff / 3600) + '小时前' + } else if (diff < 3600 * 24 * 2) { + return '1天前' + } + if (option) { + return parseTime(time, option) + } else { + return ( + d.getMonth() + + 1 + + '月' + + d.getDate() + + '日' + + d.getHours() + + '时' + + d.getMinutes() + + '分' + ) + } +} + +/** + * @param {string} url + * @returns {Object} + */ +export function getQueryObject(url) { + url = url == null ? window.location.href : url + const search = url.substring(url.lastIndexOf('?') + 1) + const obj = {} + const reg = /([^?&=]+)=([^?&=]*)/g + search.replace(reg, (rs, $1, $2) => { + const name = decodeURIComponent($1) + let val = decodeURIComponent($2) + val = String(val) + obj[name] = val + return rs + }) + return obj +} + +/** + * @param {string} input value + * @returns {number} output value + */ +export function byteLength(str) { + // returns the byte length of an utf8 string + let s = str.length + for (var i = str.length - 1; i >= 0; i--) { + const code = str.charCodeAt(i) + if (code > 0x7f && code <= 0x7ff) s++ + else if (code > 0x7ff && code <= 0xffff) s += 2 + if (code >= 0xDC00 && code <= 0xDFFF) i-- + } + return s +} + +/** + * @param {Array} actual + * @returns {Array} + */ +export function cleanArray(actual) { + const newArray = [] + for (let i = 0; i < actual.length; i++) { + if (actual[i]) { + newArray.push(actual[i]) + } + } + return newArray +} + +/** + * @param {Object} json + * @returns {Array} + */ +export function param(json) { + if (!json) return '' + return cleanArray( + Object.keys(json).map(key => { + if (json[key] === undefined) return '' + return encodeURIComponent(key) + '=' + encodeURIComponent(json[key]) + }) + ).join('&') +} + +/** + * @param {string} url + * @returns {Object} + */ +export function param2Obj(url) { + const search = decodeURIComponent(url.split('?')[1]).replace(/\+/g, ' ') + if (!search) { + return {} + } + const obj = {} + const searchArr = search.split('&') + searchArr.forEach(v => { + const index = v.indexOf('=') + if (index !== -1) { + const name = v.substring(0, index) + const val = v.substring(index + 1, v.length) + obj[name] = val + } + }) + return obj +} + +/** + * @param {string} val + * @returns {string} + */ +export function html2Text(val) { + const div = document.createElement('div') + div.innerHTML = val + return div.textContent || div.innerText +} + +/** + * Merges two objects, giving the last one precedence + * @param {Object} target + * @param {(Object|Array)} source + * @returns {Object} + */ +export function objectMerge(target, source) { + if (typeof target !== 'object') { + target = {} + } + if (Array.isArray(source)) { + return source.slice() + } + Object.keys(source).forEach(property => { + const sourceProperty = source[property] + if (typeof sourceProperty === 'object') { + target[property] = objectMerge(target[property], sourceProperty) + } else { + target[property] = sourceProperty + } + }) + return target +} + +/** + * @param {HTMLElement} element + * @param {string} className + */ +export function toggleClass(element, className) { + if (!element || !className) { + return + } + let classString = element.className + const nameIndex = classString.indexOf(className) + if (nameIndex === -1) { + classString += '' + className + } else { + classString = + classString.substr(0, nameIndex) + + classString.substr(nameIndex + className.length) + } + element.className = classString +} + +/** + * @param {string} type + * @returns {Date} + */ +export function getTime(type) { + if (type === 'start') { + return new Date().getTime() - 3600 * 1000 * 24 * 90 + } else { + return new Date(new Date().toDateString()) + } +} + +/** + * @param {Function} func + * @param {number} wait + * @param {boolean} immediate + * @return {*} + */ +export function debounce(func, wait, immediate) { + let timeout, args, context, timestamp, result + + const later = function() { + // 据上一次触发时间间隔 + const last = +new Date() - timestamp + + // 上次被包装函数被调用时间间隔 last 小于设定时间间隔 wait + if (last < wait && last > 0) { + timeout = setTimeout(later, wait - last) + } else { + timeout = null + // 如果设定为immediate===true,因为开始边界已经调用过了此处无需调用 + if (!immediate) { + result = func.apply(context, args) + if (!timeout) context = args = null + } + } + } + + return function(...args) { + context = this + timestamp = +new Date() + const callNow = immediate && !timeout + // 如果延时不存在,重新设定延时 + if (!timeout) timeout = setTimeout(later, wait) + if (callNow) { + result = func.apply(context, args) + context = args = null + } + + return result + } +} + +/** + * This is just a simple version of deep copy + * Has a lot of edge cases bug + * If you want to use a perfect deep copy, use lodash's _.cloneDeep + * @param {Object} source + * @returns {Object} + */ +export function deepClone(source) { + if (!source && typeof source !== 'object') { + throw new Error('error arguments', 'deepClone') + } + const targetObj = source.constructor === Array ? [] : {} + Object.keys(source).forEach(keys => { + if (source[keys] && typeof source[keys] === 'object') { + targetObj[keys] = deepClone(source[keys]) + } else { + targetObj[keys] = source[keys] + } + }) + return targetObj +} + +/** + * @param {Array} arr + * @returns {Array} + */ +export function uniqueArr(arr) { + return Array.from(new Set(arr)) +} + +/** + * @returns {string} + */ +export function createUniqueString() { + const timestamp = +new Date() + '' + const randomNum = parseInt((1 + Math.random()) * 65536) + '' + return (+(randomNum + timestamp)).toString(32) +} + +/** + * Check if an element has a class + * @param {HTMLElement} elm + * @param {string} cls + * @returns {boolean} + */ +export function hasClass(ele, cls) { + return !!ele.className.match(new RegExp('(\\s|^)' + cls + '(\\s|$)')) +} + +/** + * Add class to element + * @param {HTMLElement} elm + * @param {string} cls + */ +export function addClass(ele, cls) { + if (!hasClass(ele, cls)) ele.className += ' ' + cls +} + +/** + * Remove class from element + * @param {HTMLElement} elm + * @param {string} cls + */ +export function removeClass(ele, cls) { + if (hasClass(ele, cls)) { + const reg = new RegExp('(\\s|^)' + cls + '(\\s|$)') + ele.className = ele.className.replace(reg, ' ') + } +} + +export function makeMap(str, expectsLowerCase) { + const map = Object.create(null) + const list = str.split(',') + for (let i = 0; i < list.length; i++) { + map[list[i]] = true + } + return expectsLowerCase + ? val => map[val.toLowerCase()] + : val => map[val] +} + +export const exportDefault = 'export default ' + +export const beautifierConf = { + html: { + indent_size: '2', + indent_char: ' ', + max_preserve_newlines: '-1', + preserve_newlines: false, + keep_array_indentation: false, + break_chained_methods: false, + indent_scripts: 'separate', + brace_style: 'end-expand', + space_before_conditional: true, + unescape_strings: false, + jslint_happy: false, + end_with_newline: true, + wrap_line_length: '110', + indent_inner_html: true, + comma_first: false, + e4x: true, + indent_empty_lines: true + }, + js: { + indent_size: '2', + indent_char: ' ', + max_preserve_newlines: '-1', + preserve_newlines: false, + keep_array_indentation: false, + break_chained_methods: false, + indent_scripts: 'normal', + brace_style: 'end-expand', + space_before_conditional: true, + unescape_strings: false, + jslint_happy: true, + end_with_newline: true, + wrap_line_length: '110', + indent_inner_html: true, + comma_first: false, + e4x: true, + indent_empty_lines: true + } +} + +// 首字母大小 +export function titleCase(str) { + return str.replace(/( |^)[a-z]/g, L => L.toUpperCase()) +} + +// 下划转驼峰 +export function camelCase(str) { + return str.replace(/_[a-z]/g, str1 => str1.substr(-1).toUpperCase()) +} + +export function isNumberStr(str) { + return /^[+-]?(0|([1-9]\d*))(\.\d+)?$/g.test(str) +} + diff --git a/custom-ui/src/utils/jsencrypt.js b/custom-ui/src/utils/jsencrypt.js new file mode 100644 index 0000000..78d9523 --- /dev/null +++ b/custom-ui/src/utils/jsencrypt.js @@ -0,0 +1,30 @@ +import JSEncrypt from 'jsencrypt/bin/jsencrypt.min' + +// 密钥对生成 http://web.chacuo.net/netrsakeypair + +const publicKey = 'MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAKoR8mX0rGKLqzcWmOzbfj64K8ZIgOdH\n' + + 'nzkXSOVOZbFu/TJhZ7rFAN+eaGkl3C4buccQd/EjEsj9ir7ijT7h96MCAwEAAQ==' + +const privateKey = 'MIIBVAIBADANBgkqhkiG9w0BAQEFAASCAT4wggE6AgEAAkEAqhHyZfSsYourNxaY\n' + + '7Nt+PrgrxkiA50efORdI5U5lsW79MmFnusUA355oaSXcLhu5xxB38SMSyP2KvuKN\n' + + 'PuH3owIDAQABAkAfoiLyL+Z4lf4Myxk6xUDgLaWGximj20CUf+5BKKnlrK+Ed8gA\n' + + 'kM0HqoTt2UZwA5E2MzS4EI2gjfQhz5X28uqxAiEA3wNFxfrCZlSZHb0gn2zDpWow\n' + + 'cSxQAgiCstxGUoOqlW8CIQDDOerGKH5OmCJ4Z21v+F25WaHYPxCFMvwxpcw99Ecv\n' + + 'DQIgIdhDTIqD2jfYjPTY8Jj3EDGPbH2HHuffvflECt3Ek60CIQCFRlCkHpi7hthh\n' + + 'YhovyloRYsM+IS9h/0BzlEAuO0ktMQIgSPT3aFAgJYwKpqRYKlLDVcflZFCKY7u3\n' + + 'UP8iWi1Qw0Y=' + +// 加密 +export function encrypt(txt) { + const encryptor = new JSEncrypt() + encryptor.setPublicKey(publicKey) // 设置公钥 + return encryptor.encrypt(txt) // 对数据进行加密 +} + +// 解密 +export function decrypt(txt) { + const encryptor = new JSEncrypt() + encryptor.setPrivateKey(privateKey) // 设置私钥 + return encryptor.decrypt(txt) // 对数据进行解密 +} + diff --git a/custom-ui/src/utils/permission.js b/custom-ui/src/utils/permission.js new file mode 100644 index 0000000..1730e33 --- /dev/null +++ b/custom-ui/src/utils/permission.js @@ -0,0 +1,51 @@ +import store from '@/store' + +/** + * 字符权限校验 + * @param {Array} value 校验值 + * @returns {Boolean} + */ +export function checkPermi(value) { + if (value && value instanceof Array && value.length > 0) { + const permissions = store.getters && store.getters.permissions + const permissionDatas = value + const all_permission = "*:*:*"; + + const hasPermission = permissions.some(permission => { + return all_permission === permission || permissionDatas.includes(permission) + }) + + if (!hasPermission) { + return false + } + return true + } else { + console.error(`need roles! Like checkPermi="['system:user:add','system:user:edit']"`) + return false + } +} + +/** + * 角色权限校验 + * @param {Array} value 校验值 + * @returns {Boolean} + */ +export function checkRole(value) { + if (value && value instanceof Array && value.length > 0) { + const roles = store.getters && store.getters.roles + const permissionRoles = value + const super_admin = "admin"; + + const hasRole = roles.some(role => { + return super_admin === role || permissionRoles.includes(role) + }) + + if (!hasRole) { + return false + } + return true + } else { + console.error(`need roles! Like checkRole="['admin','editor']"`) + return false + } +} \ No newline at end of file diff --git a/custom-ui/src/utils/request.js b/custom-ui/src/utils/request.js new file mode 100644 index 0000000..ad9923c --- /dev/null +++ b/custom-ui/src/utils/request.js @@ -0,0 +1,146 @@ +import axios from 'axios' +import { Notification, MessageBox, Message, Loading } from 'element-ui' +import store from '@/store' +import { getToken } from '@/utils/auth' +import errorCode from '@/utils/errorCode' +import { tansParams, blobValidate } from "@/utils/ruoyi"; +import cache from '@/plugins/cache' +import { saveAs } from 'file-saver' + +let downloadLoadingInstance; +// 是否显示重新登录 +export let isRelogin = { show: false }; + +axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8' +// 创建axios实例 +const service = axios.create({ + // axios中请求配置有baseURL选项,表示请求URL公共部分 + baseURL: process.env.VUE_APP_BASE_API, + // 超时 + timeout: 10000 +}) + +// request拦截器 +service.interceptors.request.use(config => { + // 是否需要设置 token + const isToken = (config.headers || {}).isToken === false + // 是否需要防止数据重复提交 + const isRepeatSubmit = (config.headers || {}).repeatSubmit === false + if (getToken() && !isToken) { + config.headers['Authorization'] = 'Bearer ' + getToken() // 让每个请求携带自定义token 请根据实际情况自行修改 + } + // get请求映射params参数 + if (config.method === 'get' && config.params) { + let url = config.url + '?' + tansParams(config.params); + url = url.slice(0, -1); + config.params = {}; + config.url = url; + } + if (!isRepeatSubmit && (config.method === 'post' || config.method === 'put')) { + const requestObj = { + url: config.url, + data: typeof config.data === 'object' ? JSON.stringify(config.data) : config.data, + time: new Date().getTime() + } + const sessionObj = cache.session.getJSON('sessionObj') + if (sessionObj === undefined || sessionObj === null || sessionObj === '') { + cache.session.setJSON('sessionObj', requestObj) + } else { + const s_url = sessionObj.url; // 请求地址 + const s_data = sessionObj.data; // 请求数据 + const s_time = sessionObj.time; // 请求时间 + const interval = 1000; // 间隔时间(ms),小于此时间视为重复提交 + if (s_data === requestObj.data && requestObj.time - s_time < interval && s_url === requestObj.url) { + const message = '数据正在处理,请勿重复提交'; + console.warn(`[${s_url}]: ` + message) + return Promise.reject(new Error(message)) + } else { + cache.session.setJSON('sessionObj', requestObj) + } + } + } + return config +}, error => { + console.log(error) + Promise.reject(error) +}) + +// 响应拦截器 +service.interceptors.response.use(res => { + // 未设置状态码则默认成功状态 + const code = res.data.code || 200; + // 获取错误信息 + const msg = errorCode[code] || res.data.msg || errorCode['default'] + // 二进制数据则直接返回 + if(res.request.responseType === 'blob' || res.request.responseType === 'arraybuffer'){ + return res.data + } + if (code === 401) { + if (!isRelogin.show) { + isRelogin.show = true; + MessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', { confirmButtonText: '重新登录', cancelButtonText: '取消', type: 'warning' }).then(() => { + isRelogin.show = false; + store.dispatch('LogOut').then(() => { + location.href = '/index'; + }) + }).catch(() => { + isRelogin.show = false; + }); + } + return Promise.reject('无效的会话,或者会话已过期,请重新登录。') + } else if (code === 500) { + Message({ message: msg, type: 'error' }) + return Promise.reject(new Error(msg)) + } else if (code === 601) { + Message({ message: msg, type: 'warning' }) + return Promise.reject('error') + } else if (code !== 200) { + Notification.error({ title: msg }) + return Promise.reject('error') + } else { + return res.data + } + }, + error => { + console.log('err' + error) + let { message } = error; + if (message == "Network Error") { + message = "后端接口连接异常"; + } else if (message.includes("timeout")) { + message = "系统接口请求超时"; + } else if (message.includes("Request failed with status code")) { + message = "系统接口" + message.substr(message.length - 3) + "异常"; + } + Message({ message: message, type: 'error', duration: 5 * 1000 }) + return Promise.reject(error) + } +) + +// 通用下载方法 +export function download(url, params, filename, config) { + downloadLoadingInstance = Loading.service({ text: "正在下载数据,请稍候", spinner: "el-icon-loading", background: "rgba(0, 0, 0, 0.7)", }) + return service.post(url, params, { + transformRequest: [(params) => { return tansParams(params) }], + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + responseType: 'blob', + ...config + }).then(async (data) => { + const isLogin = await blobValidate(data); + if (isLogin) { + const blob = new Blob([data]) + saveAs(blob, filename) + } else { + const resText = await data.text(); + const rspObj = JSON.parse(resText); + const errMsg = errorCode[rspObj.code] || rspObj.msg || errorCode['default'] + Message.error(errMsg); + } + downloadLoadingInstance.close(); + }).catch((r) => { + console.error(r) + Message.error('下载文件出现错误,请联系管理员!') + downloadLoadingInstance.close(); + }) +} + +export default service diff --git a/custom-ui/src/utils/ruoyi.js b/custom-ui/src/utils/ruoyi.js new file mode 100644 index 0000000..243c4c7 --- /dev/null +++ b/custom-ui/src/utils/ruoyi.js @@ -0,0 +1,239 @@ + + +/** + * 通用js方法封装处理 + * Copyright (c) 2019 ruoyi + */ + +// 日期格式化 +export function parseTime(time, pattern) { + if (arguments.length === 0 || !time) { + return null + } + const format = pattern || '{y}-{m}-{d} {h}:{i}:{s}' + let date + if (typeof time === 'object') { + date = time + } else { + if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) { + time = parseInt(time) + } else if (typeof time === 'string') { + time = time.replace(new RegExp(/-/gm), '/').replace('T', ' ').replace(new RegExp(/\.[\d]{3}/gm), ''); + } + if ((typeof time === 'number') && (time.toString().length === 10)) { + time = time * 1000 + } + date = new Date(time) + } + const formatObj = { + y: date.getFullYear(), + m: date.getMonth() + 1, + d: date.getDate(), + h: date.getHours(), + i: date.getMinutes(), + s: date.getSeconds(), + a: date.getDay() + } + const time_str = format.replace(/{(y|m|d|h|i|s|a)+}/g, (result, key) => { + let value = formatObj[key] + // Note: getDay() returns 0 on Sunday + if (key === 'a') { return ['日', '一', '二', '三', '四', '五', '六'][value] } + if (result.length > 0 && value < 10) { + value = '0' + value + } + return value || 0 + }) + return time_str +} + +// 表单重置 +export function resetForm(refName) { + if (this.$refs[refName]) { + this.$refs[refName].resetFields(); + } +} + +// 添加日期范围 +export function addDateRange(params, dateRange, propName) { + let search = params; + search.params = typeof (search.params) === 'object' && search.params !== null && !Array.isArray(search.params) ? search.params : {}; + dateRange = Array.isArray(dateRange) ? dateRange : []; + if (typeof (propName) === 'undefined') { + search.params['beginTime'] = dateRange[0]; + search.params['endTime'] = dateRange[1]; + } else { + search.params['begin' + propName] = dateRange[0]; + search.params['end' + propName] = dateRange[1]; + } + return search; +} + +// 回显数据字典 +export function selectDictLabel(datas, value) { + if (value === undefined) { + return ""; + } + var actions = []; + Object.keys(datas).some((key) => { + if (datas[key].value == ('' + value)) { + actions.push(datas[key].label); + return true; + } + }) + if (actions.length === 0) { + actions.push(value); + } + return actions.join(''); +} + +// 回显数据字典(字符串、数组) +export function selectDictLabels(datas, value, separator) { + if (value === undefined || value.length ===0) { + return ""; + } + if (Array.isArray(value)) { + value = value.join(","); + } + var actions = []; + var currentSeparator = undefined === separator ? "," : separator; + var temp = value.split(currentSeparator); + Object.keys(value.split(currentSeparator)).some((val) => { + var match = false; + Object.keys(datas).some((key) => { + if (datas[key].value == ('' + temp[val])) { + actions.push(datas[key].label + currentSeparator); + match = true; + } + }) + if (!match) { + actions.push(temp[val] + currentSeparator); + } + }) + return actions.join('').substring(0, actions.join('').length - 1); +} + +// 字符串格式化(%s ) +export function sprintf(str) { + var args = arguments, flag = true, i = 1; + str = str.replace(/%s/g, function () { + var arg = args[i++]; + if (typeof arg === 'undefined') { + flag = false; + return ''; + } + return arg; + }); + return flag ? str : ''; +} + +// 转换字符串,undefined,null等转化为"" +export function parseStrEmpty(str) { + if (!str || str == "undefined" || str == "null") { + return ""; + } + return str; +} + +// 数据合并 +export function mergeRecursive(source, target) { + for (var p in target) { + try { + if (target[p].constructor == Object) { + source[p] = mergeRecursive(source[p], target[p]); + } else { + source[p] = target[p]; + } + } catch (e) { + source[p] = target[p]; + } + } + return source; +}; + +/** + * 构造树型结构数据 + * @param {*} data 数据源 + * @param {*} id id字段 默认 'id' + * @param {*} parentId 父节点字段 默认 'parentId' + * @param {*} children 孩子节点字段 默认 'children' + */ +export function handleTree(data, id, parentId, children) { + let config = { + id: id || 'id', + parentId: parentId || 'parentId', + childrenList: children || 'children' + }; + + var childrenListMap = {}; + var nodeIds = {}; + var tree = []; + + for (let d of data) { + let parentId = d[config.parentId]; + if (childrenListMap[parentId] == null) { + childrenListMap[parentId] = []; + } + nodeIds[d[config.id]] = d; + childrenListMap[parentId].push(d); + } + + for (let d of data) { + let parentId = d[config.parentId]; + if (nodeIds[parentId] == null) { + tree.push(d); + } + } + + for (let t of tree) { + adaptToChildrenList(t); + } + + function adaptToChildrenList(o) { + if (childrenListMap[o[config.id]] !== null) { + o[config.childrenList] = childrenListMap[o[config.id]]; + } + if (o[config.childrenList]) { + for (let c of o[config.childrenList]) { + adaptToChildrenList(c); + } + } + } + return tree; +} + +/** +* 参数处理 +* @param {*} params 参数 +*/ +export function tansParams(params) { + let result = '' + for (const propName of Object.keys(params)) { + const value = params[propName]; + var part = encodeURIComponent(propName) + "="; + if (value !== null && value !== "" && typeof (value) !== "undefined") { + if (typeof value === 'object') { + for (const key of Object.keys(value)) { + if (value[key] !== null && value[key] !== "" && typeof (value[key]) !== 'undefined') { + let params = propName + '[' + key + ']'; + var subPart = encodeURIComponent(params) + "="; + result += subPart + encodeURIComponent(value[key]) + "&"; + } + } + } else { + result += part + encodeURIComponent(value) + "&"; + } + } + } + return result +} + +// 验证是否为blob格式 +export async function blobValidate(data) { + try { + const text = await data.text(); + JSON.parse(text); + return false; + } catch (error) { + return true; + } +} diff --git a/custom-ui/src/utils/scroll-to.js b/custom-ui/src/utils/scroll-to.js new file mode 100644 index 0000000..c5d8e04 --- /dev/null +++ b/custom-ui/src/utils/scroll-to.js @@ -0,0 +1,58 @@ +Math.easeInOutQuad = function(t, b, c, d) { + t /= d / 2 + if (t < 1) { + return c / 2 * t * t + b + } + t-- + return -c / 2 * (t * (t - 2) - 1) + b +} + +// requestAnimationFrame for Smart Animating http://goo.gl/sx5sts +var requestAnimFrame = (function() { + return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || function(callback) { window.setTimeout(callback, 1000 / 60) } +})() + +/** + * Because it's so fucking difficult to detect the scrolling element, just move them all + * @param {number} amount + */ +function move(amount) { + document.documentElement.scrollTop = amount + document.body.parentNode.scrollTop = amount + document.body.scrollTop = amount +} + +function position() { + return document.documentElement.scrollTop || document.body.parentNode.scrollTop || document.body.scrollTop +} + +/** + * @param {number} to + * @param {number} duration + * @param {Function} callback + */ +export function scrollTo(to, duration, callback) { + const start = position() + const change = to - start + const increment = 20 + let currentTime = 0 + duration = (typeof (duration) === 'undefined') ? 500 : duration + var animateScroll = function() { + // increment the time + currentTime += increment + // find the value with the quadratic in-out easing function + var val = Math.easeInOutQuad(currentTime, start, change, duration) + // move the document.body + move(val) + // do the animation unless its over + if (currentTime < duration) { + requestAnimFrame(animateScroll) + } else { + if (callback && typeof (callback) === 'function') { + // the animation is done so lets callback + callback() + } + } + } + animateScroll() +} diff --git a/custom-ui/src/utils/validate.js b/custom-ui/src/utils/validate.js new file mode 100644 index 0000000..adfa254 --- /dev/null +++ b/custom-ui/src/utils/validate.js @@ -0,0 +1,83 @@ +/** + * @param {string} path + * @returns {Boolean} + */ +export function isExternal(path) { + return /^(https?:|mailto:|tel:)/.test(path) +} + +/** + * @param {string} str + * @returns {Boolean} + */ +export function validUsername(str) { + const valid_map = ['admin', 'editor'] + return valid_map.indexOf(str.trim()) >= 0 +} + +/** + * @param {string} url + * @returns {Boolean} + */ +export function validURL(url) { + const reg = /^(https?|ftp):\/\/([a-zA-Z0-9.-]+(:[a-zA-Z0-9.&%$-]+)*@)*((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}|([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))(:[0-9]+)*(\/($|[a-zA-Z0-9.,?'\\+&%$#=~_-]+))*$/ + return reg.test(url) +} + +/** + * @param {string} str + * @returns {Boolean} + */ +export function validLowerCase(str) { + const reg = /^[a-z]+$/ + return reg.test(str) +} + +/** + * @param {string} str + * @returns {Boolean} + */ +export function validUpperCase(str) { + const reg = /^[A-Z]+$/ + return reg.test(str) +} + +/** + * @param {string} str + * @returns {Boolean} + */ +export function validAlphabets(str) { + const reg = /^[A-Za-z]+$/ + return reg.test(str) +} + +/** + * @param {string} email + * @returns {Boolean} + */ +export function validEmail(email) { + const reg = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/ + return reg.test(email) +} + +/** + * @param {string} str + * @returns {Boolean} + */ +export function isString(str) { + if (typeof str === 'string' || str instanceof String) { + return true + } + return false +} + +/** + * @param {Array} arg + * @returns {Boolean} + */ +export function isArray(arg) { + if (typeof Array.isArray === 'undefined') { + return Object.prototype.toString.call(arg) === '[object Array]' + } + return Array.isArray(arg) +} diff --git a/custom-ui/src/views/business/countGroup/index.vue b/custom-ui/src/views/business/countGroup/index.vue new file mode 100644 index 0000000..404ffc9 --- /dev/null +++ b/custom-ui/src/views/business/countGroup/index.vue @@ -0,0 +1,175 @@ + + + + + diff --git a/custom-ui/src/views/business/survey/index.vue b/custom-ui/src/views/business/survey/index.vue new file mode 100644 index 0000000..c5e7526 --- /dev/null +++ b/custom-ui/src/views/business/survey/index.vue @@ -0,0 +1,347 @@ + + + diff --git a/custom-ui/src/views/business/surveySubmit/index.vue b/custom-ui/src/views/business/surveySubmit/index.vue new file mode 100644 index 0000000..97e00e9 --- /dev/null +++ b/custom-ui/src/views/business/surveySubmit/index.vue @@ -0,0 +1,166 @@ + + + diff --git a/custom-ui/src/views/business/template/index.vue b/custom-ui/src/views/business/template/index.vue new file mode 100644 index 0000000..311496d --- /dev/null +++ b/custom-ui/src/views/business/template/index.vue @@ -0,0 +1,298 @@ + + + diff --git a/custom-ui/src/views/business/templateProp/index.vue b/custom-ui/src/views/business/templateProp/index.vue new file mode 100644 index 0000000..9455b0c --- /dev/null +++ b/custom-ui/src/views/business/templateProp/index.vue @@ -0,0 +1,363 @@ + + + diff --git a/custom-ui/src/views/business/templatePropValue/index.vue b/custom-ui/src/views/business/templatePropValue/index.vue new file mode 100644 index 0000000..372a633 --- /dev/null +++ b/custom-ui/src/views/business/templatePropValue/index.vue @@ -0,0 +1,307 @@ + + + diff --git a/custom-ui/src/views/components/icons/element-icons.js b/custom-ui/src/views/components/icons/element-icons.js new file mode 100644 index 0000000..9ea4d63 --- /dev/null +++ b/custom-ui/src/views/components/icons/element-icons.js @@ -0,0 +1,3 @@ +const elementIcons = ['platform-eleme', 'eleme', 'delete-solid', 'delete', 's-tools', 'setting', 'user-solid', 'user', 'phone', 'phone-outline', 'more', 'more-outline', 'star-on', 'star-off', 's-goods', 'goods', 'warning', 'warning-outline', 'question', 'info', 'remove', 'circle-plus', 'success', 'error', 'zoom-in', 'zoom-out', 'remove-outline', 'circle-plus-outline', 'circle-check', 'circle-close', 's-help', 'help', 'minus', 'plus', 'check', 'close', 'picture', 'picture-outline', 'picture-outline-round', 'upload', 'upload2', 'download', 'camera-solid', 'camera', 'video-camera-solid', 'video-camera', 'message-solid', 'bell', 's-cooperation', 's-order', 's-platform', 's-fold', 's-unfold', 's-operation', 's-promotion', 's-home', 's-release', 's-ticket', 's-management', 's-open', 's-shop', 's-marketing', 's-flag', 's-comment', 's-finance', 's-claim', 's-custom', 's-opportunity', 's-data', 's-check', 's-grid', 'menu', 'share', 'd-caret', 'caret-left', 'caret-right', 'caret-bottom', 'caret-top', 'bottom-left', 'bottom-right', 'back', 'right', 'bottom', 'top', 'top-left', 'top-right', 'arrow-left', 'arrow-right', 'arrow-down', 'arrow-up', 'd-arrow-left', 'd-arrow-right', 'video-pause', 'video-play', 'refresh', 'refresh-right', 'refresh-left', 'finished', 'sort', 'sort-up', 'sort-down', 'rank', 'loading', 'view', 'c-scale-to-original', 'date', 'edit', 'edit-outline', 'folder', 'folder-opened', 'folder-add', 'folder-remove', 'folder-delete', 'folder-checked', 'tickets', 'document-remove', 'document-delete', 'document-copy', 'document-checked', 'document', 'document-add', 'printer', 'paperclip', 'takeaway-box', 'search', 'monitor', 'attract', 'mobile', 'scissors', 'umbrella', 'headset', 'brush', 'mouse', 'coordinate', 'magic-stick', 'reading', 'data-line', 'data-board', 'pie-chart', 'data-analysis', 'collection-tag', 'film', 'suitcase', 'suitcase-1', 'receiving', 'collection', 'files', 'notebook-1', 'notebook-2', 'toilet-paper', 'office-building', 'school', 'table-lamp', 'house', 'no-smoking', 'smoking', 'shopping-cart-full', 'shopping-cart-1', 'shopping-cart-2', 'shopping-bag-1', 'shopping-bag-2', 'sold-out', 'sell', 'present', 'box', 'bank-card', 'money', 'coin', 'wallet', 'discount', 'price-tag', 'news', 'guide', 'male', 'female', 'thumb', 'cpu', 'link', 'connection', 'open', 'turn-off', 'set-up', 'chat-round', 'chat-line-round', 'chat-square', 'chat-dot-round', 'chat-dot-square', 'chat-line-square', 'message', 'postcard', 'position', 'turn-off-microphone', 'microphone', 'close-notification', 'bangzhu', 'time', 'odometer', 'crop', 'aim', 'switch-button', 'full-screen', 'copy-document', 'mic', 'stopwatch', 'medal-1', 'medal', 'trophy', 'trophy-1', 'first-aid-kit', 'discover', 'place', 'location', 'location-outline', 'location-information', 'add-location', 'delete-location', 'map-location', 'alarm-clock', 'timer', 'watch-1', 'watch', 'lock', 'unlock', 'key', 'service', 'mobile-phone', 'bicycle', 'truck', 'ship', 'basketball', 'football', 'soccer', 'baseball', 'wind-power', 'light-rain', 'lightning', 'heavy-rain', 'sunrise', 'sunrise-1', 'sunset', 'sunny', 'cloudy', 'partly-cloudy', 'cloudy-and-sunny', 'moon', 'moon-night', 'dish', 'dish-1', 'food', 'chicken', 'fork-spoon', 'knife-fork', 'burger', 'tableware', 'sugar', 'dessert', 'ice-cream', 'hot-water', 'water-cup', 'coffee-cup', 'cold-drink', 'goblet', 'goblet-full', 'goblet-square', 'goblet-square-full', 'refrigerator', 'grape', 'watermelon', 'cherry', 'apple', 'pear', 'orange', 'coffee', 'ice-tea', 'ice-drink', 'milk-tea', 'potato-strips', 'lollipop', 'ice-cream-square', 'ice-cream-round'] + +export default elementIcons diff --git a/custom-ui/src/views/components/icons/index.vue b/custom-ui/src/views/components/icons/index.vue new file mode 100644 index 0000000..d3c9a71 --- /dev/null +++ b/custom-ui/src/views/components/icons/index.vue @@ -0,0 +1,87 @@ + + + + + diff --git a/custom-ui/src/views/components/icons/svg-icons.js b/custom-ui/src/views/components/icons/svg-icons.js new file mode 100644 index 0000000..724cd8e --- /dev/null +++ b/custom-ui/src/views/components/icons/svg-icons.js @@ -0,0 +1,10 @@ +const req = require.context('../../../assets/icons/svg', false, /\.svg$/) +const requireAll = requireContext => requireContext.keys() + +const re = /\.\/(.*)\.svg/ + +const svgIcons = requireAll(req).map(i => { + return i.match(re)[1] +}) + +export default svgIcons diff --git a/custom-ui/src/views/dashboard/BarChart.vue b/custom-ui/src/views/dashboard/BarChart.vue new file mode 100644 index 0000000..cd33d2d --- /dev/null +++ b/custom-ui/src/views/dashboard/BarChart.vue @@ -0,0 +1,102 @@ + + + diff --git a/custom-ui/src/views/dashboard/LineChart.vue b/custom-ui/src/views/dashboard/LineChart.vue new file mode 100644 index 0000000..ddd1063 --- /dev/null +++ b/custom-ui/src/views/dashboard/LineChart.vue @@ -0,0 +1,135 @@ + + + diff --git a/custom-ui/src/views/dashboard/PanelGroup.vue b/custom-ui/src/views/dashboard/PanelGroup.vue new file mode 100644 index 0000000..1a1081f --- /dev/null +++ b/custom-ui/src/views/dashboard/PanelGroup.vue @@ -0,0 +1,181 @@ + + + + + diff --git a/custom-ui/src/views/dashboard/PieChart.vue b/custom-ui/src/views/dashboard/PieChart.vue new file mode 100644 index 0000000..c360057 --- /dev/null +++ b/custom-ui/src/views/dashboard/PieChart.vue @@ -0,0 +1,79 @@ + + + diff --git a/custom-ui/src/views/dashboard/RaddarChart.vue b/custom-ui/src/views/dashboard/RaddarChart.vue new file mode 100644 index 0000000..b1790ca --- /dev/null +++ b/custom-ui/src/views/dashboard/RaddarChart.vue @@ -0,0 +1,116 @@ + + + diff --git a/custom-ui/src/views/dashboard/mixins/resize.js b/custom-ui/src/views/dashboard/mixins/resize.js new file mode 100644 index 0000000..b1e76e9 --- /dev/null +++ b/custom-ui/src/views/dashboard/mixins/resize.js @@ -0,0 +1,56 @@ +import { debounce } from '@/utils' + +export default { + data() { + return { + $_sidebarElm: null, + $_resizeHandler: null + } + }, + mounted() { + this.initListener() + }, + activated() { + if (!this.$_resizeHandler) { + // avoid duplication init + this.initListener() + } + + // when keep-alive chart activated, auto resize + this.resize() + }, + beforeDestroy() { + this.destroyListener() + }, + deactivated() { + this.destroyListener() + }, + methods: { + // use $_ for mixins properties + // https://vuejs.org/v2/style-guide/index.html#Private-property-names-essential + $_sidebarResizeHandler(e) { + if (e.propertyName === 'width') { + this.$_resizeHandler() + } + }, + initListener() { + this.$_resizeHandler = debounce(() => { + this.resize() + }, 100) + window.addEventListener('resize', this.$_resizeHandler) + + this.$_sidebarElm = document.getElementsByClassName('sidebar-container')[0] + this.$_sidebarElm && this.$_sidebarElm.addEventListener('transitionend', this.$_sidebarResizeHandler) + }, + destroyListener() { + window.removeEventListener('resize', this.$_resizeHandler) + this.$_resizeHandler = null + + this.$_sidebarElm && this.$_sidebarElm.removeEventListener('transitionend', this.$_sidebarResizeHandler) + }, + resize() { + const { chart } = this + chart && chart.resize() + } + } +} diff --git a/custom-ui/src/views/error/401.vue b/custom-ui/src/views/error/401.vue new file mode 100644 index 0000000..448b6ec --- /dev/null +++ b/custom-ui/src/views/error/401.vue @@ -0,0 +1,88 @@ + + + + + diff --git a/custom-ui/src/views/error/404.vue b/custom-ui/src/views/error/404.vue new file mode 100644 index 0000000..96f075c --- /dev/null +++ b/custom-ui/src/views/error/404.vue @@ -0,0 +1,233 @@ + + + + + diff --git a/custom-ui/src/views/index.vue b/custom-ui/src/views/index.vue new file mode 100644 index 0000000..1014327 --- /dev/null +++ b/custom-ui/src/views/index.vue @@ -0,0 +1,87 @@ + + + + + + diff --git a/custom-ui/src/views/index_v1.vue b/custom-ui/src/views/index_v1.vue new file mode 100644 index 0000000..d2d2ec6 --- /dev/null +++ b/custom-ui/src/views/index_v1.vue @@ -0,0 +1,98 @@ + + + + + diff --git a/custom-ui/src/views/login.vue b/custom-ui/src/views/login.vue new file mode 100644 index 0000000..ecfaaea --- /dev/null +++ b/custom-ui/src/views/login.vue @@ -0,0 +1,225 @@ + + + + + diff --git a/custom-ui/src/views/monitor/cache/index.vue b/custom-ui/src/views/monitor/cache/index.vue new file mode 100644 index 0000000..53f6eee --- /dev/null +++ b/custom-ui/src/views/monitor/cache/index.vue @@ -0,0 +1,146 @@ + + + diff --git a/custom-ui/src/views/monitor/cache/list.vue b/custom-ui/src/views/monitor/cache/list.vue new file mode 100644 index 0000000..a1e7955 --- /dev/null +++ b/custom-ui/src/views/monitor/cache/list.vue @@ -0,0 +1,241 @@ + + + diff --git a/custom-ui/src/views/monitor/druid/index.vue b/custom-ui/src/views/monitor/druid/index.vue new file mode 100644 index 0000000..c6ad585 --- /dev/null +++ b/custom-ui/src/views/monitor/druid/index.vue @@ -0,0 +1,15 @@ + + diff --git a/custom-ui/src/views/monitor/job/index.vue b/custom-ui/src/views/monitor/job/index.vue new file mode 100644 index 0000000..37c8fc1 --- /dev/null +++ b/custom-ui/src/views/monitor/job/index.vue @@ -0,0 +1,513 @@ + + + diff --git a/custom-ui/src/views/monitor/job/log.vue b/custom-ui/src/views/monitor/job/log.vue new file mode 100644 index 0000000..60bee1d --- /dev/null +++ b/custom-ui/src/views/monitor/job/log.vue @@ -0,0 +1,295 @@ + + + diff --git a/custom-ui/src/views/monitor/logininfor/index.vue b/custom-ui/src/views/monitor/logininfor/index.vue new file mode 100644 index 0000000..8a9b17a --- /dev/null +++ b/custom-ui/src/views/monitor/logininfor/index.vue @@ -0,0 +1,245 @@ + + + + diff --git a/custom-ui/src/views/monitor/online/index.vue b/custom-ui/src/views/monitor/online/index.vue new file mode 100644 index 0000000..ad613c9 --- /dev/null +++ b/custom-ui/src/views/monitor/online/index.vue @@ -0,0 +1,122 @@ + + + + diff --git a/custom-ui/src/views/monitor/operlog/index.vue b/custom-ui/src/views/monitor/operlog/index.vue new file mode 100644 index 0000000..c1b5377 --- /dev/null +++ b/custom-ui/src/views/monitor/operlog/index.vue @@ -0,0 +1,305 @@ + + + + diff --git a/custom-ui/src/views/monitor/server/index.vue b/custom-ui/src/views/monitor/server/index.vue new file mode 100644 index 0000000..b122edf --- /dev/null +++ b/custom-ui/src/views/monitor/server/index.vue @@ -0,0 +1,207 @@ + + + \ No newline at end of file diff --git a/custom-ui/src/views/redirect.vue b/custom-ui/src/views/redirect.vue new file mode 100644 index 0000000..db4c1d6 --- /dev/null +++ b/custom-ui/src/views/redirect.vue @@ -0,0 +1,12 @@ + diff --git a/custom-ui/src/views/register.vue b/custom-ui/src/views/register.vue new file mode 100644 index 0000000..6167069 --- /dev/null +++ b/custom-ui/src/views/register.vue @@ -0,0 +1,209 @@ + + + + + diff --git a/custom-ui/src/views/system/config/index.vue b/custom-ui/src/views/system/config/index.vue new file mode 100644 index 0000000..f580b98 --- /dev/null +++ b/custom-ui/src/views/system/config/index.vue @@ -0,0 +1,343 @@ + + + diff --git a/custom-ui/src/views/system/dept/index.vue b/custom-ui/src/views/system/dept/index.vue new file mode 100644 index 0000000..e502b4e --- /dev/null +++ b/custom-ui/src/views/system/dept/index.vue @@ -0,0 +1,340 @@ + + + diff --git a/custom-ui/src/views/system/dict/data.vue b/custom-ui/src/views/system/dict/data.vue new file mode 100644 index 0000000..324bb64 --- /dev/null +++ b/custom-ui/src/views/system/dict/data.vue @@ -0,0 +1,402 @@ + + + \ No newline at end of file diff --git a/custom-ui/src/views/system/dict/index.vue b/custom-ui/src/views/system/dict/index.vue new file mode 100644 index 0000000..6ca5457 --- /dev/null +++ b/custom-ui/src/views/system/dict/index.vue @@ -0,0 +1,347 @@ + + + \ No newline at end of file diff --git a/custom-ui/src/views/system/menu/index.vue b/custom-ui/src/views/system/menu/index.vue new file mode 100644 index 0000000..57b56e5 --- /dev/null +++ b/custom-ui/src/views/system/menu/index.vue @@ -0,0 +1,453 @@ + + + diff --git a/custom-ui/src/views/system/notice/index.vue b/custom-ui/src/views/system/notice/index.vue new file mode 100644 index 0000000..7982b54 --- /dev/null +++ b/custom-ui/src/views/system/notice/index.vue @@ -0,0 +1,312 @@ + + + diff --git a/custom-ui/src/views/system/post/index.vue b/custom-ui/src/views/system/post/index.vue new file mode 100644 index 0000000..444bf63 --- /dev/null +++ b/custom-ui/src/views/system/post/index.vue @@ -0,0 +1,309 @@ + + + diff --git a/custom-ui/src/views/system/role/authUser.vue b/custom-ui/src/views/system/role/authUser.vue new file mode 100644 index 0000000..147aa33 --- /dev/null +++ b/custom-ui/src/views/system/role/authUser.vue @@ -0,0 +1,199 @@ + + + \ No newline at end of file diff --git a/custom-ui/src/views/system/role/index.vue b/custom-ui/src/views/system/role/index.vue new file mode 100644 index 0000000..fb3b5ef --- /dev/null +++ b/custom-ui/src/views/system/role/index.vue @@ -0,0 +1,605 @@ + + + \ No newline at end of file diff --git a/custom-ui/src/views/system/role/selectUser.vue b/custom-ui/src/views/system/role/selectUser.vue new file mode 100644 index 0000000..b2b072f --- /dev/null +++ b/custom-ui/src/views/system/role/selectUser.vue @@ -0,0 +1,138 @@ + + + diff --git a/custom-ui/src/views/system/user/authRole.vue b/custom-ui/src/views/system/user/authRole.vue new file mode 100644 index 0000000..ab5e72f --- /dev/null +++ b/custom-ui/src/views/system/user/authRole.vue @@ -0,0 +1,117 @@ + + + \ No newline at end of file diff --git a/custom-ui/src/views/system/user/index.vue b/custom-ui/src/views/system/user/index.vue new file mode 100644 index 0000000..ae87fe4 --- /dev/null +++ b/custom-ui/src/views/system/user/index.vue @@ -0,0 +1,670 @@ + + + \ No newline at end of file diff --git a/custom-ui/src/views/system/user/profile/index.vue b/custom-ui/src/views/system/user/profile/index.vue new file mode 100644 index 0000000..ad530f9 --- /dev/null +++ b/custom-ui/src/views/system/user/profile/index.vue @@ -0,0 +1,91 @@ + + + diff --git a/custom-ui/src/views/system/user/profile/resetPwd.vue b/custom-ui/src/views/system/user/profile/resetPwd.vue new file mode 100644 index 0000000..64e8f8c --- /dev/null +++ b/custom-ui/src/views/system/user/profile/resetPwd.vue @@ -0,0 +1,68 @@ + + + diff --git a/custom-ui/src/views/system/user/profile/userAvatar.vue b/custom-ui/src/views/system/user/profile/userAvatar.vue new file mode 100644 index 0000000..70d8487 --- /dev/null +++ b/custom-ui/src/views/system/user/profile/userAvatar.vue @@ -0,0 +1,187 @@ + + + + diff --git a/custom-ui/src/views/system/user/profile/userInfo.vue b/custom-ui/src/views/system/user/profile/userInfo.vue new file mode 100644 index 0000000..c09a20b --- /dev/null +++ b/custom-ui/src/views/system/user/profile/userInfo.vue @@ -0,0 +1,75 @@ + + + diff --git a/custom-ui/src/views/tool/build/CodeTypeDialog.vue b/custom-ui/src/views/tool/build/CodeTypeDialog.vue new file mode 100644 index 0000000..b5c2e2e --- /dev/null +++ b/custom-ui/src/views/tool/build/CodeTypeDialog.vue @@ -0,0 +1,106 @@ + + diff --git a/custom-ui/src/views/tool/build/DraggableItem.vue b/custom-ui/src/views/tool/build/DraggableItem.vue new file mode 100644 index 0000000..e881778 --- /dev/null +++ b/custom-ui/src/views/tool/build/DraggableItem.vue @@ -0,0 +1,100 @@ + diff --git a/custom-ui/src/views/tool/build/IconsDialog.vue b/custom-ui/src/views/tool/build/IconsDialog.vue new file mode 100644 index 0000000..958be50 --- /dev/null +++ b/custom-ui/src/views/tool/build/IconsDialog.vue @@ -0,0 +1,123 @@ + + + diff --git a/custom-ui/src/views/tool/build/RightPanel.vue b/custom-ui/src/views/tool/build/RightPanel.vue new file mode 100644 index 0000000..c2760eb --- /dev/null +++ b/custom-ui/src/views/tool/build/RightPanel.vue @@ -0,0 +1,946 @@ + + + + + diff --git a/custom-ui/src/views/tool/build/TreeNodeDialog.vue b/custom-ui/src/views/tool/build/TreeNodeDialog.vue new file mode 100644 index 0000000..fa7f0b2 --- /dev/null +++ b/custom-ui/src/views/tool/build/TreeNodeDialog.vue @@ -0,0 +1,149 @@ + + diff --git a/custom-ui/src/views/tool/build/index.vue b/custom-ui/src/views/tool/build/index.vue new file mode 100644 index 0000000..ff475df --- /dev/null +++ b/custom-ui/src/views/tool/build/index.vue @@ -0,0 +1,826 @@ + + + + + diff --git a/custom-ui/src/views/tool/gen/basicInfoForm.vue b/custom-ui/src/views/tool/gen/basicInfoForm.vue new file mode 100644 index 0000000..7029529 --- /dev/null +++ b/custom-ui/src/views/tool/gen/basicInfoForm.vue @@ -0,0 +1,60 @@ + + + diff --git a/custom-ui/src/views/tool/gen/editTable.vue b/custom-ui/src/views/tool/gen/editTable.vue new file mode 100644 index 0000000..951497a --- /dev/null +++ b/custom-ui/src/views/tool/gen/editTable.vue @@ -0,0 +1,234 @@ + + + diff --git a/custom-ui/src/views/tool/gen/genInfoForm.vue b/custom-ui/src/views/tool/gen/genInfoForm.vue new file mode 100644 index 0000000..3f8d67f --- /dev/null +++ b/custom-ui/src/views/tool/gen/genInfoForm.vue @@ -0,0 +1,299 @@ + + + diff --git a/custom-ui/src/views/tool/gen/importTable.vue b/custom-ui/src/views/tool/gen/importTable.vue new file mode 100644 index 0000000..3ea9532 --- /dev/null +++ b/custom-ui/src/views/tool/gen/importTable.vue @@ -0,0 +1,120 @@ + + + diff --git a/custom-ui/src/views/tool/gen/index.vue b/custom-ui/src/views/tool/gen/index.vue new file mode 100644 index 0000000..3f1f930 --- /dev/null +++ b/custom-ui/src/views/tool/gen/index.vue @@ -0,0 +1,337 @@ + + + diff --git a/custom-ui/src/views/tool/swagger/index.vue b/custom-ui/src/views/tool/swagger/index.vue new file mode 100644 index 0000000..b782968 --- /dev/null +++ b/custom-ui/src/views/tool/swagger/index.vue @@ -0,0 +1,15 @@ + + diff --git a/custom-ui/vue.config.js b/custom-ui/vue.config.js new file mode 100644 index 0000000..8bd226f --- /dev/null +++ b/custom-ui/vue.config.js @@ -0,0 +1,136 @@ +'use strict' +const path = require('path') + +function resolve(dir) { + return path.join(__dirname, dir) +} + +const CompressionPlugin = require('compression-webpack-plugin') + +const name = process.env.VUE_APP_TITLE || '后台管理系统' // 网页标题 + +const port = process.env.port || process.env.npm_config_port || 80 // 端口 + +// vue.config.js 配置说明 +//官方vue.config.js 参考文档 https://cli.vuejs.org/zh/config/#css-loaderoptions +// 这里只列一部分,具体配置参考文档 +module.exports = { + // 部署生产环境和开发环境下的URL。 + // 默认情况下,Vue CLI 会假设你的应用是被部署在一个域名的根路径上 + // 例如 https://www.ruoyi.vip/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.ruoyi.vip/admin/,则设置 baseUrl 为 /admin/。 + publicPath: process.env.NODE_ENV === "production" ? "/" : "/", + // 在npm run build 或 yarn build 时 ,生成文件的目录名称(要和baseUrl的生产环境路径一致)(默认dist) + outputDir: 'dist', + // 用于放置生成的静态资源 (js、css、img、fonts) 的;(项目打包之后,静态资源会放在这个文件夹下) + assetsDir: 'static', + // 是否开启eslint保存检测,有效值:ture | false | 'error' + lintOnSave: process.env.NODE_ENV === 'development', + // 如果你不需要生产环境的 source map,可以将其设置为 false 以加速生产环境构建。 + productionSourceMap: false, + // webpack-dev-server 相关配置 + devServer: { + host: '0.0.0.0', + port: port, + open: true, + proxy: { + // detail: https://cli.vuejs.org/config/#devserver-proxy + [process.env.VUE_APP_BASE_API]: { + target: `http://localhost:9000`, + changeOrigin: true, + pathRewrite: { + ['^' + process.env.VUE_APP_BASE_API]: '' + } + } + }, + disableHostCheck: true + }, + css: { + loaderOptions: { + sass: { + sassOptions: { outputStyle: "expanded" } + } + } + }, + configureWebpack: { + name: name, + resolve: { + alias: { + '@': resolve('src') + } + }, + plugins: [ + // http://doc.ruoyi.vip/ruoyi-vue/other/faq.html#使用gzip解压缩静态文件 + new CompressionPlugin({ + cache: false, // 不启用文件缓存 + 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() + + 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'), + { + from: path.resolve(__dirname, './public/robots.txt'), //防爬虫文件 + to: './' //到根目录下 + } + } + ) + } +} diff --git a/custom-ui/启动必看.txt b/custom-ui/启动必看.txt new file mode 100644 index 0000000..6a44e0f --- /dev/null +++ b/custom-ui/启动必看.txt @@ -0,0 +1,5 @@ +首次运行 +npm install --registry=https://registry.npmmirror.com + +# 本地开发 启动项目 +npm run dev \ No newline at end of file diff --git a/pom.xml b/pom.xml index 313c8bc..75ca6cb 100644 --- a/pom.xml +++ b/pom.xml @@ -2,293 +2,231 @@ - 4.0.0 - - me.zhengjie - wjcy - pom - 1.0 - - - wjcy-common - wjcy-logging - wjcy-system - wjcy-tools - wjcy-generator - - - EL-ADMIN 后台管理 - http://auauz.net - - - org.springframework.boot - spring-boot-starter-parent - 2.2.10.RELEASE - - + 4.0.0 + + com.ruoyi + ruoyi + 3.8.5 + + + 管理系统 + + 3.8.5 UTF-8 UTF-8 1.8 - 1.16 - 1.2.70 - 1.1.24 - 2.5.0 - 1.3.1.Final - 2.1.1 - 2.15.0 - 2.0.7 + 3.1.1 + 1.2.15 + 1.21 + 3.0.0 + 2.3.3 + 1.4.6 + 2.0.23 + 6.4.0 + 2.11.0 + 1.4 + 3.2.2 + 4.1.2 + 2.3 + 0.9.1 + + + + + + + + org.springframework.boot + spring-boot-dependencies + 2.5.14 + pom + import + + + + + com.alibaba + druid-spring-boot-starter + ${druid.version} + + + + + eu.bitwalker + UserAgentUtils + ${bitwalker.version} + + + + + com.github.pagehelper + pagehelper-spring-boot-starter + ${pagehelper.boot.version} + + + + + com.github.oshi + oshi-core + ${oshi.version} + + + + + io.springfox + springfox-boot-starter + ${swagger.version} + + + io.swagger + swagger-models + + + + + + + commons-io + commons-io + ${commons.io.version} + + + + + commons-fileupload + commons-fileupload + ${commons.fileupload.version} + + + + + org.apache.poi + poi-ooxml + ${poi.version} + + + + + org.apache.velocity + velocity-engine-core + ${velocity.version} + + + + + commons-collections + commons-collections + ${commons.collections.version} + + + + + com.alibaba.fastjson2 + fastjson2 + ${fastjson.version} + + + + + io.jsonwebtoken + jjwt + ${jwt.version} + + + + + pro.fessional + kaptcha + ${kaptcha.version} + + + + + com.ruoyi + ruoyi-quartz + ${ruoyi.version} + + + + + com.ruoyi + ruoyi-generator + ${ruoyi.version} + + + + + com.ruoyi + ruoyi-framework + ${ruoyi.version} + + + + + com.ruoyi + ruoyi-system + ${ruoyi.version} + + + + + com.ruoyi + ruoyi-business + ${ruoyi.version} + + + + + com.ruoyi + ruoyi-common + ${ruoyi.version} + + + + org.projectlombok + lombok + 1.18.24 + + + + + com.baomidou + mybatis-plus-boot-starter + 3.4.2 + + + + + + + + ruoyi-admin + ruoyi-framework + ruoyi-system + ruoyi-business + ruoyi-quartz + ruoyi-generator + ruoyi-common + + pom + - - - org.springframework.boot - spring-boot-starter-logging - - - * - * - - - - - - org.springframework.boot - spring-boot-starter-data-jpa - - - - - org.springframework.boot - spring-boot-starter-web - - - - - org.springframework.boot - spring-boot-starter-test - test - - - - - org.springframework.boot - spring-boot-starter-security - - - - - org.springframework.boot - spring-boot-starter-cache - - - - - org.springframework.boot - spring-boot-starter-data-redis - - - - - org.apache.commons - commons-pool2 - ${commons-pool2.version} - - - org.apache.commons - commons-lang3 - - - org.springframework.boot - spring-boot-configuration-processor - true - - - - org.bgee.log4jdbc-log4j2 - log4jdbc-log4j2-jdbc4.1 - ${log4jdbc.version} - - - - - com.github.xiaoymin - knife4j-spring-boot-starter - ${knife4j.version} - - - - - mysql - mysql-connector-java - runtime - - - - - com.alibaba - druid-spring-boot-starter - ${druid.version} - - - org.lionsoul - ip2region - 1.7.2 - - - - - org.projectlombok - lombok - true - - - - - - - com.alibaba - fastjson - ${fastjson.version} - - - - - org.mapstruct - mapstruct - ${mapstruct.version} - - - org.mapstruct - mapstruct-processor - ${mapstruct.version} - provided - - - javax.inject - javax.inject - 1 - - - - - com.github.whvcse - easy-captcha - 1.6.2 - - - - - nl.basjes.parse.useragent - yauaa - 5.23 - - - - - com.baomidou - mybatis-plus-boot-starter - 3.3.2 - - - com.h2database - h2 - runtime - - - - - org.springframework.boot - spring-boot-starter-log4j2 - - - - - org.apache.poi - poi - 4.0.1 - - - - - org.apache.poi - poi-ooxml - 4.0.1 - - - - net.sourceforge.jexcelapi - jxl - 2.6.10 - - - - org.redisson - redisson - 3.5.7 - - - - - org.apache.rocketmq - rocketmq-client - 4.4.0 - - - - - com.google.guava - guava - 24.1-jre - - - com.madgag.spongycastle - core - 1.58.0.0 - - - - org.springframework.boot - spring-boot-starter-thymeleaf - - - - org.springframework.cloud - spring-cloud-starter-openfeign - 2.2.5.RELEASE - - - com.netflix.feign - feign-jackson - 8.18.0 - - - - org.telegram - telegrambots - 5.5.0 - - - - src/main/java - - **/*.xml - - true - - - org.apache.maven.plugins - maven-surefire-plugin + maven-compiler-plugin + 3.1 - true + ${java.version} + ${java.version} + ${project.build.sourceEncoding} @@ -298,7 +236,7 @@ public aliyun nexus - http://maven.aliyun.com/nexus/content/groups/public/ + https://maven.aliyun.com/repository/public true @@ -309,7 +247,7 @@ public aliyun nexus - http://maven.aliyun.com/nexus/content/groups/public/ + https://maven.aliyun.com/repository/public true @@ -318,4 +256,5 @@ + \ No newline at end of file diff --git a/ruoyi-admin/pom.xml b/ruoyi-admin/pom.xml new file mode 100644 index 0000000..945307b --- /dev/null +++ b/ruoyi-admin/pom.xml @@ -0,0 +1,112 @@ + + + + ruoyi + com.ruoyi + 3.8.5 + + 4.0.0 + jar + ruoyi-admin + + + web服务入口 + + + + + + + org.springframework.boot + spring-boot-devtools + true + + + + + io.springfox + springfox-boot-starter + + + + + io.swagger + swagger-models + 1.6.2 + + + + + mysql + mysql-connector-java + + + + + com.ruoyi + ruoyi-framework + + + + + com.ruoyi + ruoyi-quartz + + + + + com.ruoyi + ruoyi-generator + + + + + com.github.xiaoymin + knife4j-spring-boot-starter + 3.0.3 + + + com.google.guava + guava + + + org.yaml + snakeyaml + + + + + + + + + org.springframework.boot + spring-boot-maven-plugin + 2.1.1.RELEASE + + true + + + + + repackage + + + + + + org.apache.maven.plugins + maven-war-plugin + 3.1.0 + + false + ${project.artifactId} + + + + ${project.artifactId} + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/java/com/ruoyi/RunApplication.java b/ruoyi-admin/src/main/java/com/ruoyi/RunApplication.java new file mode 100644 index 0000000..adf49b3 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/RunApplication.java @@ -0,0 +1,30 @@ +package com.ruoyi; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; + +/** + * 启动程序 + * + * @author #author# + */ +@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class }) +public class RunApplication +{ + public static void main(String[] args) + { + // System.setProperty("spring.devtools.restart.enabled", "false"); + SpringApplication.run(RunApplication.class, args); + System.out.println("(♥◠‿◠)ノ゙ 项目启动成功 ლ(´ڡ`ლ)゙ \n" + + " .-------. ____ __ \n" + + " | _ _ \\ \\ \\ / / \n" + + " | ( ' ) | \\ _. / ' \n" + + " |(_ o _) / _( )_ .' \n" + + " | (_,_).' __ ___(_ o _)' \n" + + " | |\\ \\ | || |(_,_)' \n" + + " | | \\ `' /| `-' / \n" + + " | | \\ / \\ / \n" + + " ''-' `'-' `-..-' "); + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/RunServletInitializer.java b/ruoyi-admin/src/main/java/com/ruoyi/RunServletInitializer.java new file mode 100644 index 0000000..083da28 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/RunServletInitializer.java @@ -0,0 +1,18 @@ +package com.ruoyi; + +import org.springframework.boot.builder.SpringApplicationBuilder; +import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; + +/** + * web容器中进行部署 + * + * @author #author# + */ +public class RunServletInitializer extends SpringBootServletInitializer +{ + @Override + protected SpringApplicationBuilder configure(SpringApplicationBuilder application) + { + return application.sources(RunApplication.class); + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CaptchaController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CaptchaController.java new file mode 100644 index 0000000..53bdfa9 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CaptchaController.java @@ -0,0 +1,94 @@ +package com.ruoyi.web.controller.common; + +import java.awt.image.BufferedImage; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Resource; +import javax.imageio.ImageIO; +import javax.servlet.http.HttpServletResponse; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.FastByteArrayOutputStream; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; +import com.google.code.kaptcha.Producer; +import com.ruoyi.common.config.RuoYiConfig; +import com.ruoyi.common.constant.CacheConstants; +import com.ruoyi.common.constant.Constants; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.redis.RedisCache; +import com.ruoyi.common.utils.sign.Base64; +import com.ruoyi.common.utils.uuid.IdUtils; +import com.ruoyi.system.service.ISysConfigService; + +/** + * 验证码操作处理 + * + * @author #author# + */ +@RestController +public class CaptchaController +{ + @Resource(name = "captchaProducer") + private Producer captchaProducer; + + @Resource(name = "captchaProducerMath") + private Producer captchaProducerMath; + + @Autowired + private RedisCache redisCache; + + @Autowired + private ISysConfigService configService; + /** + * 生成验证码 + */ + @GetMapping("/captchaImage") + public AjaxResult getCode(HttpServletResponse response) throws IOException + { + AjaxResult ajax = AjaxResult.success(); + boolean captchaEnabled = configService.selectCaptchaEnabled(); + ajax.put("captchaEnabled", captchaEnabled); + if (!captchaEnabled) + { + return ajax; + } + + // 保存验证码信息 + String uuid = IdUtils.simpleUUID(); + String verifyKey = CacheConstants.CAPTCHA_CODE_KEY + uuid; + + String capStr = null, code = null; + BufferedImage image = null; + + // 生成验证码 + String captchaType = RuoYiConfig.getCaptchaType(); + if ("math".equals(captchaType)) + { + String capText = captchaProducerMath.createText(); + capStr = capText.substring(0, capText.lastIndexOf("@")); + code = capText.substring(capText.lastIndexOf("@") + 1); + image = captchaProducerMath.createImage(capStr); + } + else if ("char".equals(captchaType)) + { + capStr = code = captchaProducer.createText(); + image = captchaProducer.createImage(capStr); + } + + redisCache.setCacheObject(verifyKey, code, Constants.CAPTCHA_EXPIRATION, TimeUnit.MINUTES); + // 转换流信息写出 + FastByteArrayOutputStream os = new FastByteArrayOutputStream(); + try + { + ImageIO.write(image, "jpg", os); + } + catch (IOException e) + { + return AjaxResult.error(e.getMessage()); + } + + ajax.put("uuid", uuid); + ajax.put("img", Base64.encode(os.toByteArray())); + return ajax; + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java new file mode 100644 index 0000000..053a988 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java @@ -0,0 +1,163 @@ +package com.ruoyi.web.controller.common; + +import java.util.ArrayList; +import java.util.List; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.multipart.MultipartFile; +import com.ruoyi.common.config.RuoYiConfig; +import com.ruoyi.common.constant.Constants; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.common.utils.file.FileUploadUtils; +import com.ruoyi.common.utils.file.FileUtils; +import com.ruoyi.framework.config.ServerConfig; + +/** + * 通用请求处理 + * + * @author #author# + */ +@RestController +@RequestMapping("/common") +public class CommonController +{ + private static final Logger log = LoggerFactory.getLogger(CommonController.class); + + @Autowired + private ServerConfig serverConfig; + + private static final String FILE_DELIMETER = ","; + + /** + * 通用下载请求 + * + * @param fileName 文件名称 + * @param delete 是否删除 + */ + @GetMapping("/download") + public void fileDownload(String fileName, Boolean delete, HttpServletResponse response, HttpServletRequest request) + { + try + { + if (!FileUtils.checkAllowDownload(fileName)) + { + throw new Exception(StringUtils.format("文件名称({})非法,不允许下载。 ", fileName)); + } + String realFileName = System.currentTimeMillis() + fileName.substring(fileName.indexOf("_") + 1); + String filePath = RuoYiConfig.getDownloadPath() + fileName; + + response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE); + FileUtils.setAttachmentResponseHeader(response, realFileName); + FileUtils.writeBytes(filePath, response.getOutputStream()); + if (delete) + { + FileUtils.deleteFile(filePath); + } + } + catch (Exception e) + { + log.error("下载文件失败", e); + } + } + + /** + * 通用上传请求(单个) + */ + @PostMapping("/upload") + public AjaxResult uploadFile(MultipartFile file) throws Exception + { + try + { + // 上传文件路径 + String filePath = RuoYiConfig.getUploadPath(); + // 上传并返回新文件名称 + String fileName = FileUploadUtils.upload(filePath, file); + String url = serverConfig.getUrl() + fileName; + AjaxResult ajax = AjaxResult.success(); + ajax.put("url", url); + ajax.put("fileName", fileName); + ajax.put("newFileName", FileUtils.getName(fileName)); + ajax.put("originalFilename", file.getOriginalFilename()); + return ajax; + } + catch (Exception e) + { + return AjaxResult.error(e.getMessage()); + } + } + + /** + * 通用上传请求(多个) + */ + @PostMapping("/uploads") + public AjaxResult uploadFiles(List files) throws Exception + { + try + { + // 上传文件路径 + String filePath = RuoYiConfig.getUploadPath(); + List urls = new ArrayList(); + List fileNames = new ArrayList(); + List newFileNames = new ArrayList(); + List originalFilenames = new ArrayList(); + for (MultipartFile file : files) + { + // 上传并返回新文件名称 + String fileName = FileUploadUtils.upload(filePath, file); + String url = serverConfig.getUrl() + fileName; + urls.add(url); + fileNames.add(fileName); + newFileNames.add(FileUtils.getName(fileName)); + originalFilenames.add(file.getOriginalFilename()); + } + AjaxResult ajax = AjaxResult.success(); + ajax.put("urls", StringUtils.join(urls, FILE_DELIMETER)); + ajax.put("fileNames", StringUtils.join(fileNames, FILE_DELIMETER)); + ajax.put("newFileNames", StringUtils.join(newFileNames, FILE_DELIMETER)); + ajax.put("originalFilenames", StringUtils.join(originalFilenames, FILE_DELIMETER)); + return ajax; + } + catch (Exception e) + { + return AjaxResult.error(e.getMessage()); + } + } + + /** + * 本地资源通用下载 + */ + @GetMapping("/download/resource") + public void resourceDownload(String resource, HttpServletRequest request, HttpServletResponse response) + throws Exception + { + try + { + if (!FileUtils.checkAllowDownload(resource)) + { + throw new Exception(StringUtils.format("资源文件({})非法,不允许下载。 ", resource)); + } + // 本地资源路径 + String localPath = RuoYiConfig.getProfile(); + // 数据库资源地址 + String downloadPath = localPath + StringUtils.substringAfter(resource, Constants.RESOURCE_PREFIX); + // 下载名称 + String downloadName = StringUtils.substringAfterLast(downloadPath, "/"); + response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE); + FileUtils.setAttachmentResponseHeader(response, downloadName); + FileUtils.writeBytes(downloadPath, response.getOutputStream()); + } + catch (Exception e) + { + log.error("下载文件失败", e); + } + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/CacheController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/CacheController.java new file mode 100644 index 0000000..d86c5bf --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/CacheController.java @@ -0,0 +1,120 @@ +package com.ruoyi.web.controller.monitor; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Properties; +import java.util.Set; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.redis.core.RedisCallback; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.constant.CacheConstants; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.system.domain.SysCache; + +/** + * 缓存监控 + * + * @author #author# + */ +@RestController +@RequestMapping("/monitor/cache") +public class CacheController +{ + @Autowired + private RedisTemplate redisTemplate; + + private final static List caches = new ArrayList(); + { + caches.add(new SysCache(CacheConstants.LOGIN_TOKEN_KEY, "用户信息")); + caches.add(new SysCache(CacheConstants.SYS_CONFIG_KEY, "配置信息")); + caches.add(new SysCache(CacheConstants.SYS_DICT_KEY, "数据字典")); + caches.add(new SysCache(CacheConstants.CAPTCHA_CODE_KEY, "验证码")); + caches.add(new SysCache(CacheConstants.REPEAT_SUBMIT_KEY, "防重提交")); + caches.add(new SysCache(CacheConstants.RATE_LIMIT_KEY, "限流处理")); + caches.add(new SysCache(CacheConstants.PWD_ERR_CNT_KEY, "密码错误次数")); + } + + @PreAuthorize("@ss.hasPermi('monitor:cache:list')") + @GetMapping() + public AjaxResult getInfo() throws Exception + { + Properties info = (Properties) redisTemplate.execute((RedisCallback) connection -> connection.info()); + Properties commandStats = (Properties) redisTemplate.execute((RedisCallback) connection -> connection.info("commandstats")); + Object dbSize = redisTemplate.execute((RedisCallback) connection -> connection.dbSize()); + + Map result = new HashMap<>(3); + result.put("info", info); + result.put("dbSize", dbSize); + + List> pieList = new ArrayList<>(); + commandStats.stringPropertyNames().forEach(key -> { + Map data = new HashMap<>(2); + String property = commandStats.getProperty(key); + data.put("name", StringUtils.removeStart(key, "cmdstat_")); + data.put("value", StringUtils.substringBetween(property, "calls=", ",usec")); + pieList.add(data); + }); + result.put("commandStats", pieList); + return AjaxResult.success(result); + } + + @PreAuthorize("@ss.hasPermi('monitor:cache:list')") + @GetMapping("/getNames") + public AjaxResult cache() + { + return AjaxResult.success(caches); + } + + @PreAuthorize("@ss.hasPermi('monitor:cache:list')") + @GetMapping("/getKeys/{cacheName}") + public AjaxResult getCacheKeys(@PathVariable String cacheName) + { + Set cacheKeys = redisTemplate.keys(cacheName + "*"); + return AjaxResult.success(cacheKeys); + } + + @PreAuthorize("@ss.hasPermi('monitor:cache:list')") + @GetMapping("/getValue/{cacheName}/{cacheKey}") + public AjaxResult getCacheValue(@PathVariable String cacheName, @PathVariable String cacheKey) + { + String cacheValue = redisTemplate.opsForValue().get(cacheKey); + SysCache sysCache = new SysCache(cacheName, cacheKey, cacheValue); + return AjaxResult.success(sysCache); + } + + @PreAuthorize("@ss.hasPermi('monitor:cache:list')") + @DeleteMapping("/clearCacheName/{cacheName}") + public AjaxResult clearCacheName(@PathVariable String cacheName) + { + Collection cacheKeys = redisTemplate.keys(cacheName + "*"); + redisTemplate.delete(cacheKeys); + return AjaxResult.success(); + } + + @PreAuthorize("@ss.hasPermi('monitor:cache:list')") + @DeleteMapping("/clearCacheKey/{cacheKey}") + public AjaxResult clearCacheKey(@PathVariable String cacheKey) + { + redisTemplate.delete(cacheKey); + return AjaxResult.success(); + } + + @PreAuthorize("@ss.hasPermi('monitor:cache:list')") + @DeleteMapping("/clearCacheAll") + public AjaxResult clearCacheAll() + { + Collection cacheKeys = redisTemplate.keys("*"); + redisTemplate.delete(cacheKeys); + return AjaxResult.success(); + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/ServerController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/ServerController.java new file mode 100644 index 0000000..8eea96f --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/ServerController.java @@ -0,0 +1,27 @@ +package com.ruoyi.web.controller.monitor; + +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.framework.web.domain.Server; + +/** + * 服务器监控 + * + * @author #author# + */ +@RestController +@RequestMapping("/monitor/server") +public class ServerController +{ + @PreAuthorize("@ss.hasPermi('monitor:server:list')") + @GetMapping() + public AjaxResult getInfo() throws Exception + { + Server server = new Server(); + server.copyTo(); + return AjaxResult.success(server); + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysLogininforController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysLogininforController.java new file mode 100644 index 0000000..6c135da --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysLogininforController.java @@ -0,0 +1,82 @@ +package com.ruoyi.web.controller.monitor; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.service.SysPasswordService; +import com.ruoyi.system.domain.SysLogininfor; +import com.ruoyi.system.service.ISysLogininforService; + +/** + * 系统访问记录 + * + * @author #author# + */ +@RestController +@RequestMapping("/monitor/logininfor") +public class SysLogininforController extends BaseController +{ + @Autowired + private ISysLogininforService logininforService; + + @Autowired + private SysPasswordService passwordService; + + @PreAuthorize("@ss.hasPermi('monitor:logininfor:list')") + @GetMapping("/list") + public TableDataInfo list(SysLogininfor logininfor) + { + startPage(); + List list = logininforService.selectLogininforList(logininfor); + return getDataTable(list); + } + + @Log(title = "登录日志", businessType = BusinessType.EXPORT) + @PreAuthorize("@ss.hasPermi('monitor:logininfor:export')") + @PostMapping("/export") + public void export(HttpServletResponse response, SysLogininfor logininfor) + { + List list = logininforService.selectLogininforList(logininfor); + ExcelUtil util = new ExcelUtil(SysLogininfor.class); + util.exportExcel(response, list, "登录日志"); + } + + @PreAuthorize("@ss.hasPermi('monitor:logininfor:remove')") + @Log(title = "登录日志", businessType = BusinessType.DELETE) + @DeleteMapping("/{infoIds}") + public AjaxResult remove(@PathVariable Long[] infoIds) + { + return toAjax(logininforService.deleteLogininforByIds(infoIds)); + } + + @PreAuthorize("@ss.hasPermi('monitor:logininfor:remove')") + @Log(title = "登录日志", businessType = BusinessType.CLEAN) + @DeleteMapping("/clean") + public AjaxResult clean() + { + logininforService.cleanLogininfor(); + return success(); + } + + @PreAuthorize("@ss.hasPermi('monitor:logininfor:unlock')") + @Log(title = "账户解锁", businessType = BusinessType.OTHER) + @GetMapping("/unlock/{userName}") + public AjaxResult unlock(@PathVariable("userName") String userName) + { + passwordService.clearLoginRecordCache(userName); + return success(); + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysOperlogController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysOperlogController.java new file mode 100644 index 0000000..62da6cf --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysOperlogController.java @@ -0,0 +1,69 @@ +package com.ruoyi.web.controller.monitor; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.system.domain.SysOperLog; +import com.ruoyi.system.service.ISysOperLogService; + +/** + * 操作日志记录 + * + * @author #author# + */ +@RestController +@RequestMapping("/monitor/operlog") +public class SysOperlogController extends BaseController +{ + @Autowired + private ISysOperLogService operLogService; + + @PreAuthorize("@ss.hasPermi('monitor:operlog:list')") + @GetMapping("/list") + public TableDataInfo list(SysOperLog operLog) + { + startPage(); + List list = operLogService.selectOperLogList(operLog); + return getDataTable(list); + } + + @Log(title = "操作日志", businessType = BusinessType.EXPORT) + @PreAuthorize("@ss.hasPermi('monitor:operlog:export')") + @PostMapping("/export") + public void export(HttpServletResponse response, SysOperLog operLog) + { + List list = operLogService.selectOperLogList(operLog); + ExcelUtil util = new ExcelUtil(SysOperLog.class); + util.exportExcel(response, list, "操作日志"); + } + + @Log(title = "操作日志", businessType = BusinessType.DELETE) + @PreAuthorize("@ss.hasPermi('monitor:operlog:remove')") + @DeleteMapping("/{operIds}") + public AjaxResult remove(@PathVariable Long[] operIds) + { + return toAjax(operLogService.deleteOperLogByIds(operIds)); + } + + @Log(title = "操作日志", businessType = BusinessType.CLEAN) + @PreAuthorize("@ss.hasPermi('monitor:operlog:remove')") + @DeleteMapping("/clean") + public AjaxResult clean() + { + operLogService.cleanOperLog(); + return success(); + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysUserOnlineController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysUserOnlineController.java new file mode 100644 index 0000000..7943c9f --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysUserOnlineController.java @@ -0,0 +1,92 @@ +package com.ruoyi.web.controller.monitor; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.constant.CacheConstants; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.domain.model.LoginUser; +import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.common.core.redis.RedisCache; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.system.domain.SysUserOnline; +import com.ruoyi.system.service.ISysUserOnlineService; + +/** + * 在线用户监控 + * + * @author #author# + */ +@RestController +@RequestMapping("/monitor/online") +public class SysUserOnlineController extends BaseController +{ + @Autowired + private ISysUserOnlineService userOnlineService; + + @Autowired + private RedisCache redisCache; + + @PreAuthorize("@ss.hasPermi('monitor:online:list')") + @GetMapping("/list") + public TableDataInfo list(String ipaddr, String userName) + { + Collection keys = redisCache.keys(CacheConstants.LOGIN_TOKEN_KEY + "*"); + List userOnlineList = new ArrayList(); + for (String key : keys) + { + LoginUser user = redisCache.getCacheObject(key); + if (StringUtils.isNotEmpty(ipaddr) && StringUtils.isNotEmpty(userName)) + { + if (StringUtils.equals(ipaddr, user.getIpaddr()) && StringUtils.equals(userName, user.getUsername())) + { + userOnlineList.add(userOnlineService.selectOnlineByInfo(ipaddr, userName, user)); + } + } + else if (StringUtils.isNotEmpty(ipaddr)) + { + if (StringUtils.equals(ipaddr, user.getIpaddr())) + { + userOnlineList.add(userOnlineService.selectOnlineByIpaddr(ipaddr, user)); + } + } + else if (StringUtils.isNotEmpty(userName) && StringUtils.isNotNull(user.getUser())) + { + if (StringUtils.equals(userName, user.getUsername())) + { + userOnlineList.add(userOnlineService.selectOnlineByUserName(userName, user)); + } + } + else + { + userOnlineList.add(userOnlineService.loginUserToUserOnline(user)); + } + } + Collections.reverse(userOnlineList); + userOnlineList.removeAll(Collections.singleton(null)); + return getDataTable(userOnlineList); + } + + /** + * 强退用户 + */ + @PreAuthorize("@ss.hasPermi('monitor:online:forceLogout')") + @Log(title = "在线用户", businessType = BusinessType.FORCE) + @DeleteMapping("/{tokenId}") + public AjaxResult forceLogout(@PathVariable String tokenId) + { + redisCache.deleteObject(CacheConstants.LOGIN_TOKEN_KEY + tokenId); + return success(); + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysConfigController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysConfigController.java new file mode 100644 index 0000000..a0b840e --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysConfigController.java @@ -0,0 +1,134 @@ +package com.ruoyi.web.controller.system; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.constant.UserConstants; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.system.domain.SysConfig; +import com.ruoyi.system.service.ISysConfigService; + +/** + * 参数配置 信息操作处理 + * + * @author #author# + */ +@RestController +@RequestMapping("/system/config") +public class SysConfigController extends BaseController +{ + @Autowired + private ISysConfigService configService; + + /** + * 获取参数配置列表 + */ + @PreAuthorize("@ss.hasPermi('system:config:list')") + @GetMapping("/list") + public TableDataInfo list(SysConfig config) + { + startPage(); + List list = configService.selectConfigList(config); + return getDataTable(list); + } + + @Log(title = "参数管理", businessType = BusinessType.EXPORT) + @PreAuthorize("@ss.hasPermi('system:config:export')") + @PostMapping("/export") + public void export(HttpServletResponse response, SysConfig config) + { + List list = configService.selectConfigList(config); + ExcelUtil util = new ExcelUtil(SysConfig.class); + util.exportExcel(response, list, "参数数据"); + } + + /** + * 根据参数编号获取详细信息 + */ + @PreAuthorize("@ss.hasPermi('system:config:query')") + @GetMapping(value = "/{configId}") + public AjaxResult getInfo(@PathVariable Long configId) + { + return success(configService.selectConfigById(configId)); + } + + /** + * 根据参数键名查询参数值 + */ + @GetMapping(value = "/configKey/{configKey}") + public AjaxResult getConfigKey(@PathVariable String configKey) + { + return success(configService.selectConfigByKey(configKey)); + } + + /** + * 新增参数配置 + */ + @PreAuthorize("@ss.hasPermi('system:config:add')") + @Log(title = "参数管理", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@Validated @RequestBody SysConfig config) + { + if (UserConstants.NOT_UNIQUE.equals(configService.checkConfigKeyUnique(config))) + { + return error("新增参数'" + config.getConfigName() + "'失败,参数键名已存在"); + } + config.setCreateBy(getUsername()); + return toAjax(configService.insertConfig(config)); + } + + /** + * 修改参数配置 + */ + @PreAuthorize("@ss.hasPermi('system:config:edit')") + @Log(title = "参数管理", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@Validated @RequestBody SysConfig config) + { + if (UserConstants.NOT_UNIQUE.equals(configService.checkConfigKeyUnique(config))) + { + return error("修改参数'" + config.getConfigName() + "'失败,参数键名已存在"); + } + config.setUpdateBy(getUsername()); + return toAjax(configService.updateConfig(config)); + } + + /** + * 删除参数配置 + */ + @PreAuthorize("@ss.hasPermi('system:config:remove')") + @Log(title = "参数管理", businessType = BusinessType.DELETE) + @DeleteMapping("/{configIds}") + public AjaxResult remove(@PathVariable Long[] configIds) + { + configService.deleteConfigByIds(configIds); + return success(); + } + + /** + * 刷新参数缓存 + */ + @PreAuthorize("@ss.hasPermi('system:config:remove')") + @Log(title = "参数管理", businessType = BusinessType.CLEAN) + @DeleteMapping("/refreshCache") + public AjaxResult refreshCache() + { + configService.resetConfigCache(); + return success(); + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDeptController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDeptController.java new file mode 100644 index 0000000..6d91ceb --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDeptController.java @@ -0,0 +1,132 @@ +package com.ruoyi.web.controller.system; + +import java.util.List; +import org.apache.commons.lang3.ArrayUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.constant.UserConstants; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.domain.entity.SysDept; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.system.service.ISysDeptService; + +/** + * 部门信息 + * + * @author #author# + */ +@RestController +@RequestMapping("/system/dept") +public class SysDeptController extends BaseController +{ + @Autowired + private ISysDeptService deptService; + + /** + * 获取部门列表 + */ + @PreAuthorize("@ss.hasPermi('system:dept:list')") + @GetMapping("/list") + public AjaxResult list(SysDept dept) + { + List depts = deptService.selectDeptList(dept); + return success(depts); + } + + /** + * 查询部门列表(排除节点) + */ + @PreAuthorize("@ss.hasPermi('system:dept:list')") + @GetMapping("/list/exclude/{deptId}") + public AjaxResult excludeChild(@PathVariable(value = "deptId", required = false) Long deptId) + { + List depts = deptService.selectDeptList(new SysDept()); + depts.removeIf(d -> d.getDeptId().intValue() == deptId || ArrayUtils.contains(StringUtils.split(d.getAncestors(), ","), deptId + "")); + return success(depts); + } + + /** + * 根据部门编号获取详细信息 + */ + @PreAuthorize("@ss.hasPermi('system:dept:query')") + @GetMapping(value = "/{deptId}") + public AjaxResult getInfo(@PathVariable Long deptId) + { + deptService.checkDeptDataScope(deptId); + return success(deptService.selectDeptById(deptId)); + } + + /** + * 新增部门 + */ + @PreAuthorize("@ss.hasPermi('system:dept:add')") + @Log(title = "部门管理", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@Validated @RequestBody SysDept dept) + { + if (UserConstants.NOT_UNIQUE.equals(deptService.checkDeptNameUnique(dept))) + { + return error("新增部门'" + dept.getDeptName() + "'失败,部门名称已存在"); + } + dept.setCreateBy(getUsername()); + return toAjax(deptService.insertDept(dept)); + } + + /** + * 修改部门 + */ + @PreAuthorize("@ss.hasPermi('system:dept:edit')") + @Log(title = "部门管理", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@Validated @RequestBody SysDept dept) + { + Long deptId = dept.getDeptId(); + deptService.checkDeptDataScope(deptId); + if (UserConstants.NOT_UNIQUE.equals(deptService.checkDeptNameUnique(dept))) + { + return error("修改部门'" + dept.getDeptName() + "'失败,部门名称已存在"); + } + else if (dept.getParentId().equals(deptId)) + { + return error("修改部门'" + dept.getDeptName() + "'失败,上级部门不能是自己"); + } + else if (StringUtils.equals(UserConstants.DEPT_DISABLE, dept.getStatus()) && deptService.selectNormalChildrenDeptById(deptId) > 0) + { + return error("该部门包含未停用的子部门!"); + } + dept.setUpdateBy(getUsername()); + return toAjax(deptService.updateDept(dept)); + } + + /** + * 删除部门 + */ + @PreAuthorize("@ss.hasPermi('system:dept:remove')") + @Log(title = "部门管理", businessType = BusinessType.DELETE) + @DeleteMapping("/{deptId}") + public AjaxResult remove(@PathVariable Long deptId) + { + if (deptService.hasChildByDeptId(deptId)) + { + return warn("存在下级部门,不允许删除"); + } + if (deptService.checkDeptExistUser(deptId)) + { + return warn("部门存在用户,不允许删除"); + } + deptService.checkDeptDataScope(deptId); + return toAjax(deptService.deleteDeptById(deptId)); + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictDataController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictDataController.java new file mode 100644 index 0000000..2973488 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictDataController.java @@ -0,0 +1,121 @@ +package com.ruoyi.web.controller.system; + +import java.util.ArrayList; +import java.util.List; +import javax.servlet.http.HttpServletResponse; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.domain.entity.SysDictData; +import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.system.service.ISysDictDataService; +import com.ruoyi.system.service.ISysDictTypeService; + +/** + * 数据字典信息 + * + * @author #author# + */ +@RestController +@RequestMapping("/system/dict/data") +public class SysDictDataController extends BaseController +{ + @Autowired + private ISysDictDataService dictDataService; + + @Autowired + private ISysDictTypeService dictTypeService; + + @PreAuthorize("@ss.hasPermi('system:dict:list')") + @GetMapping("/list") + public TableDataInfo list(SysDictData dictData) + { + startPage(); + List list = dictDataService.selectDictDataList(dictData); + return getDataTable(list); + } + + @Log(title = "字典数据", businessType = BusinessType.EXPORT) + @PreAuthorize("@ss.hasPermi('system:dict:export')") + @PostMapping("/export") + public void export(HttpServletResponse response, SysDictData dictData) + { + List list = dictDataService.selectDictDataList(dictData); + ExcelUtil util = new ExcelUtil(SysDictData.class); + util.exportExcel(response, list, "字典数据"); + } + + /** + * 查询字典数据详细 + */ + @PreAuthorize("@ss.hasPermi('system:dict:query')") + @GetMapping(value = "/{dictCode}") + public AjaxResult getInfo(@PathVariable Long dictCode) + { + return success(dictDataService.selectDictDataById(dictCode)); + } + + /** + * 根据字典类型查询字典数据信息 + */ + @GetMapping(value = "/type/{dictType}") + public AjaxResult dictType(@PathVariable String dictType) + { + List data = dictTypeService.selectDictDataByType(dictType); + if (StringUtils.isNull(data)) + { + data = new ArrayList(); + } + return success(data); + } + + /** + * 新增字典类型 + */ + @PreAuthorize("@ss.hasPermi('system:dict:add')") + @Log(title = "字典数据", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@Validated @RequestBody SysDictData dict) + { + dict.setCreateBy(getUsername()); + return toAjax(dictDataService.insertDictData(dict)); + } + + /** + * 修改保存字典类型 + */ + @PreAuthorize("@ss.hasPermi('system:dict:edit')") + @Log(title = "字典数据", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@Validated @RequestBody SysDictData dict) + { + dict.setUpdateBy(getUsername()); + return toAjax(dictDataService.updateDictData(dict)); + } + + /** + * 删除字典类型 + */ + @PreAuthorize("@ss.hasPermi('system:dict:remove')") + @Log(title = "字典类型", businessType = BusinessType.DELETE) + @DeleteMapping("/{dictCodes}") + public AjaxResult remove(@PathVariable Long[] dictCodes) + { + dictDataService.deleteDictDataByIds(dictCodes); + return success(); + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictTypeController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictTypeController.java new file mode 100644 index 0000000..4cf2ba2 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictTypeController.java @@ -0,0 +1,132 @@ +package com.ruoyi.web.controller.system; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.constant.UserConstants; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.domain.entity.SysDictType; +import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.system.service.ISysDictTypeService; + +/** + * 数据字典信息 + * + * @author #author# + */ +@RestController +@RequestMapping("/system/dict/type") +public class SysDictTypeController extends BaseController +{ + @Autowired + private ISysDictTypeService dictTypeService; + + @PreAuthorize("@ss.hasPermi('system:dict:list')") + @GetMapping("/list") + public TableDataInfo list(SysDictType dictType) + { + startPage(); + List list = dictTypeService.selectDictTypeList(dictType); + return getDataTable(list); + } + + @Log(title = "字典类型", businessType = BusinessType.EXPORT) + @PreAuthorize("@ss.hasPermi('system:dict:export')") + @PostMapping("/export") + public void export(HttpServletResponse response, SysDictType dictType) + { + List list = dictTypeService.selectDictTypeList(dictType); + ExcelUtil util = new ExcelUtil(SysDictType.class); + util.exportExcel(response, list, "字典类型"); + } + + /** + * 查询字典类型详细 + */ + @PreAuthorize("@ss.hasPermi('system:dict:query')") + @GetMapping(value = "/{dictId}") + public AjaxResult getInfo(@PathVariable Long dictId) + { + return success(dictTypeService.selectDictTypeById(dictId)); + } + + /** + * 新增字典类型 + */ + @PreAuthorize("@ss.hasPermi('system:dict:add')") + @Log(title = "字典类型", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@Validated @RequestBody SysDictType dict) + { + if (UserConstants.NOT_UNIQUE.equals(dictTypeService.checkDictTypeUnique(dict))) + { + return error("新增字典'" + dict.getDictName() + "'失败,字典类型已存在"); + } + dict.setCreateBy(getUsername()); + return toAjax(dictTypeService.insertDictType(dict)); + } + + /** + * 修改字典类型 + */ + @PreAuthorize("@ss.hasPermi('system:dict:edit')") + @Log(title = "字典类型", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@Validated @RequestBody SysDictType dict) + { + if (UserConstants.NOT_UNIQUE.equals(dictTypeService.checkDictTypeUnique(dict))) + { + return error("修改字典'" + dict.getDictName() + "'失败,字典类型已存在"); + } + dict.setUpdateBy(getUsername()); + return toAjax(dictTypeService.updateDictType(dict)); + } + + /** + * 删除字典类型 + */ + @PreAuthorize("@ss.hasPermi('system:dict:remove')") + @Log(title = "字典类型", businessType = BusinessType.DELETE) + @DeleteMapping("/{dictIds}") + public AjaxResult remove(@PathVariable Long[] dictIds) + { + dictTypeService.deleteDictTypeByIds(dictIds); + return success(); + } + + /** + * 刷新字典缓存 + */ + @PreAuthorize("@ss.hasPermi('system:dict:remove')") + @Log(title = "字典类型", businessType = BusinessType.CLEAN) + @DeleteMapping("/refreshCache") + public AjaxResult refreshCache() + { + dictTypeService.resetDictCache(); + return success(); + } + + /** + * 获取字典选择框列表 + */ + @GetMapping("/optionselect") + public AjaxResult optionselect() + { + List dictTypes = dictTypeService.selectDictTypeAll(); + return success(dictTypes); + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysIndexController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysIndexController.java new file mode 100644 index 0000000..eb2479c --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysIndexController.java @@ -0,0 +1,29 @@ +package com.ruoyi.web.controller.system; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.config.RuoYiConfig; +import com.ruoyi.common.utils.StringUtils; + +/** + * 首页 + * + * @author #author# + */ +@RestController +public class SysIndexController +{ + /** 系统基础配置 */ + @Autowired + private RuoYiConfig ruoyiConfig; + + /** + * 访问首页,提示语 + */ + @RequestMapping("/") + public String index() + { + return StringUtils.format("欢迎使用{}后台管理框架,当前版本:v{},请通过前端地址访问。", ruoyiConfig.getName(), ruoyiConfig.getVersion()); + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java new file mode 100644 index 0000000..88d7eb0 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java @@ -0,0 +1,86 @@ +package com.ruoyi.web.controller.system; + +import java.util.List; +import java.util.Set; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.constant.Constants; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.domain.entity.SysMenu; +import com.ruoyi.common.core.domain.entity.SysUser; +import com.ruoyi.common.core.domain.model.LoginBody; +import com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.framework.web.service.SysLoginService; +import com.ruoyi.framework.web.service.SysPermissionService; +import com.ruoyi.system.service.ISysMenuService; + +/** + * 登录验证 + * + * @author #author# + */ +@RestController +public class SysLoginController +{ + @Autowired + private SysLoginService loginService; + + @Autowired + private ISysMenuService menuService; + + @Autowired + private SysPermissionService permissionService; + + /** + * 登录方法 + * + * @param loginBody 登录信息 + * @return 结果 + */ + @PostMapping("/login") + public AjaxResult login(@RequestBody LoginBody loginBody) + { + AjaxResult ajax = AjaxResult.success(); + // 生成令牌 + String token = loginService.login(loginBody.getUsername(), loginBody.getPassword(), loginBody.getCode(), + loginBody.getUuid()); + ajax.put(Constants.TOKEN, token); + return ajax; + } + + /** + * 获取用户信息 + * + * @return 用户信息 + */ + @GetMapping("getInfo") + public AjaxResult getInfo() + { + SysUser user = SecurityUtils.getLoginUser().getUser(); + // 角色集合 + Set roles = permissionService.getRolePermission(user); + // 权限集合 + Set permissions = permissionService.getMenuPermission(user); + AjaxResult ajax = AjaxResult.success(); + ajax.put("user", user); + ajax.put("roles", roles); + ajax.put("permissions", permissions); + return ajax; + } + + /** + * 获取路由信息 + * + * @return 路由信息 + */ + @GetMapping("getRouters") + public AjaxResult getRouters() + { + Long userId = SecurityUtils.getUserId(); + List menus = menuService.selectMenuTreeByUserId(userId); + return AjaxResult.success(menuService.buildMenus(menus)); + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysMenuController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysMenuController.java new file mode 100644 index 0000000..fc6e9a9 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysMenuController.java @@ -0,0 +1,142 @@ +package com.ruoyi.web.controller.system; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.constant.UserConstants; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.domain.entity.SysMenu; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.system.service.ISysMenuService; + +/** + * 菜单信息 + * + * @author #author# + */ +@RestController +@RequestMapping("/system/menu") +public class SysMenuController extends BaseController +{ + @Autowired + private ISysMenuService menuService; + + /** + * 获取菜单列表 + */ + @PreAuthorize("@ss.hasPermi('system:menu:list')") + @GetMapping("/list") + public AjaxResult list(SysMenu menu) + { + List menus = menuService.selectMenuList(menu, getUserId()); + return success(menus); + } + + /** + * 根据菜单编号获取详细信息 + */ + @PreAuthorize("@ss.hasPermi('system:menu:query')") + @GetMapping(value = "/{menuId}") + public AjaxResult getInfo(@PathVariable Long menuId) + { + return success(menuService.selectMenuById(menuId)); + } + + /** + * 获取菜单下拉树列表 + */ + @GetMapping("/treeselect") + public AjaxResult treeselect(SysMenu menu) + { + List menus = menuService.selectMenuList(menu, getUserId()); + return success(menuService.buildMenuTreeSelect(menus)); + } + + /** + * 加载对应角色菜单列表树 + */ + @GetMapping(value = "/roleMenuTreeselect/{roleId}") + public AjaxResult roleMenuTreeselect(@PathVariable("roleId") Long roleId) + { + List menus = menuService.selectMenuList(getUserId()); + AjaxResult ajax = AjaxResult.success(); + ajax.put("checkedKeys", menuService.selectMenuListByRoleId(roleId)); + ajax.put("menus", menuService.buildMenuTreeSelect(menus)); + return ajax; + } + + /** + * 新增菜单 + */ + @PreAuthorize("@ss.hasPermi('system:menu:add')") + @Log(title = "菜单管理", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@Validated @RequestBody SysMenu menu) + { + if (UserConstants.NOT_UNIQUE.equals(menuService.checkMenuNameUnique(menu))) + { + return error("新增菜单'" + menu.getMenuName() + "'失败,菜单名称已存在"); + } + else if (UserConstants.YES_FRAME.equals(menu.getIsFrame()) && !StringUtils.ishttp(menu.getPath())) + { + return error("新增菜单'" + menu.getMenuName() + "'失败,地址必须以http(s)://开头"); + } + menu.setCreateBy(getUsername()); + return toAjax(menuService.insertMenu(menu)); + } + + /** + * 修改菜单 + */ + @PreAuthorize("@ss.hasPermi('system:menu:edit')") + @Log(title = "菜单管理", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@Validated @RequestBody SysMenu menu) + { + if (UserConstants.NOT_UNIQUE.equals(menuService.checkMenuNameUnique(menu))) + { + return error("修改菜单'" + menu.getMenuName() + "'失败,菜单名称已存在"); + } + else if (UserConstants.YES_FRAME.equals(menu.getIsFrame()) && !StringUtils.ishttp(menu.getPath())) + { + return error("修改菜单'" + menu.getMenuName() + "'失败,地址必须以http(s)://开头"); + } + else if (menu.getMenuId().equals(menu.getParentId())) + { + return error("修改菜单'" + menu.getMenuName() + "'失败,上级菜单不能选择自己"); + } + menu.setUpdateBy(getUsername()); + return toAjax(menuService.updateMenu(menu)); + } + + /** + * 删除菜单 + */ + @PreAuthorize("@ss.hasPermi('system:menu:remove')") + @Log(title = "菜单管理", businessType = BusinessType.DELETE) + @DeleteMapping("/{menuId}") + public AjaxResult remove(@PathVariable("menuId") Long menuId) + { + if (menuService.hasChildByMenuId(menuId)) + { + return warn("存在子菜单,不允许删除"); + } + if (menuService.checkMenuExistRole(menuId)) + { + return warn("菜单已分配,不允许删除"); + } + return toAjax(menuService.deleteMenuById(menuId)); + } +} \ No newline at end of file diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysNoticeController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysNoticeController.java new file mode 100644 index 0000000..b81dbaa --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysNoticeController.java @@ -0,0 +1,91 @@ +package com.ruoyi.web.controller.system; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.system.domain.SysNotice; +import com.ruoyi.system.service.ISysNoticeService; + +/** + * 公告 信息操作处理 + * + * @author #author# + */ +@RestController +@RequestMapping("/system/notice") +public class SysNoticeController extends BaseController +{ + @Autowired + private ISysNoticeService noticeService; + + /** + * 获取通知公告列表 + */ + @PreAuthorize("@ss.hasPermi('system:notice:list')") + @GetMapping("/list") + public TableDataInfo list(SysNotice notice) + { + startPage(); + List list = noticeService.selectNoticeList(notice); + return getDataTable(list); + } + + /** + * 根据通知公告编号获取详细信息 + */ + @PreAuthorize("@ss.hasPermi('system:notice:query')") + @GetMapping(value = "/{noticeId}") + public AjaxResult getInfo(@PathVariable Long noticeId) + { + return success(noticeService.selectNoticeById(noticeId)); + } + + /** + * 新增通知公告 + */ + @PreAuthorize("@ss.hasPermi('system:notice:add')") + @Log(title = "通知公告", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@Validated @RequestBody SysNotice notice) + { + notice.setCreateBy(getUsername()); + return toAjax(noticeService.insertNotice(notice)); + } + + /** + * 修改通知公告 + */ + @PreAuthorize("@ss.hasPermi('system:notice:edit')") + @Log(title = "通知公告", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@Validated @RequestBody SysNotice notice) + { + notice.setUpdateBy(getUsername()); + return toAjax(noticeService.updateNotice(notice)); + } + + /** + * 删除通知公告 + */ + @PreAuthorize("@ss.hasPermi('system:notice:remove')") + @Log(title = "通知公告", businessType = BusinessType.DELETE) + @DeleteMapping("/{noticeIds}") + public AjaxResult remove(@PathVariable Long[] noticeIds) + { + return toAjax(noticeService.deleteNoticeByIds(noticeIds)); + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysPostController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysPostController.java new file mode 100644 index 0000000..3b1fd60 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysPostController.java @@ -0,0 +1,130 @@ +package com.ruoyi.web.controller.system; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.constant.UserConstants; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.system.domain.SysPost; +import com.ruoyi.system.service.ISysPostService; + +/** + * 岗位信息操作处理 + * + * @author #author# + */ +@RestController +@RequestMapping("/system/post") +public class SysPostController extends BaseController +{ + @Autowired + private ISysPostService postService; + + /** + * 获取岗位列表 + */ + @PreAuthorize("@ss.hasPermi('system:post:list')") + @GetMapping("/list") + public TableDataInfo list(SysPost post) + { + startPage(); + List list = postService.selectPostList(post); + return getDataTable(list); + } + + @Log(title = "岗位管理", businessType = BusinessType.EXPORT) + @PreAuthorize("@ss.hasPermi('system:post:export')") + @PostMapping("/export") + public void export(HttpServletResponse response, SysPost post) + { + List list = postService.selectPostList(post); + ExcelUtil util = new ExcelUtil(SysPost.class); + util.exportExcel(response, list, "岗位数据"); + } + + /** + * 根据岗位编号获取详细信息 + */ + @PreAuthorize("@ss.hasPermi('system:post:query')") + @GetMapping(value = "/{postId}") + public AjaxResult getInfo(@PathVariable Long postId) + { + return success(postService.selectPostById(postId)); + } + + /** + * 新增岗位 + */ + @PreAuthorize("@ss.hasPermi('system:post:add')") + @Log(title = "岗位管理", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@Validated @RequestBody SysPost post) + { + if (UserConstants.NOT_UNIQUE.equals(postService.checkPostNameUnique(post))) + { + return error("新增岗位'" + post.getPostName() + "'失败,岗位名称已存在"); + } + else if (UserConstants.NOT_UNIQUE.equals(postService.checkPostCodeUnique(post))) + { + return error("新增岗位'" + post.getPostName() + "'失败,岗位编码已存在"); + } + post.setCreateBy(getUsername()); + return toAjax(postService.insertPost(post)); + } + + /** + * 修改岗位 + */ + @PreAuthorize("@ss.hasPermi('system:post:edit')") + @Log(title = "岗位管理", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@Validated @RequestBody SysPost post) + { + if (UserConstants.NOT_UNIQUE.equals(postService.checkPostNameUnique(post))) + { + return error("修改岗位'" + post.getPostName() + "'失败,岗位名称已存在"); + } + else if (UserConstants.NOT_UNIQUE.equals(postService.checkPostCodeUnique(post))) + { + return error("修改岗位'" + post.getPostName() + "'失败,岗位编码已存在"); + } + post.setUpdateBy(getUsername()); + return toAjax(postService.updatePost(post)); + } + + /** + * 删除岗位 + */ + @PreAuthorize("@ss.hasPermi('system:post:remove')") + @Log(title = "岗位管理", businessType = BusinessType.DELETE) + @DeleteMapping("/{postIds}") + public AjaxResult remove(@PathVariable Long[] postIds) + { + return toAjax(postService.deletePostByIds(postIds)); + } + + /** + * 获取岗位选择框列表 + */ + @GetMapping("/optionselect") + public AjaxResult optionselect() + { + List posts = postService.selectPostAll(); + return success(posts); + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysProfileController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysProfileController.java new file mode 100644 index 0000000..44914f5 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysProfileController.java @@ -0,0 +1,144 @@ +package com.ruoyi.web.controller.system; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.multipart.MultipartFile; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.config.RuoYiConfig; +import com.ruoyi.common.constant.UserConstants; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.domain.entity.SysUser; +import com.ruoyi.common.core.domain.model.LoginUser; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.common.utils.file.FileUploadUtils; +import com.ruoyi.common.utils.file.MimeTypeUtils; +import com.ruoyi.framework.web.service.TokenService; +import com.ruoyi.system.service.ISysUserService; + +/** + * 个人信息 业务处理 + * + * @author #author# + */ +@RestController +@RequestMapping("/system/user/profile") +public class SysProfileController extends BaseController +{ + @Autowired + private ISysUserService userService; + + @Autowired + private TokenService tokenService; + + /** + * 个人信息 + */ + @GetMapping + public AjaxResult profile() + { + LoginUser loginUser = getLoginUser(); + SysUser user = loginUser.getUser(); + AjaxResult ajax = AjaxResult.success(user); + ajax.put("roleGroup", userService.selectUserRoleGroup(loginUser.getUsername())); + ajax.put("postGroup", userService.selectUserPostGroup(loginUser.getUsername())); + return ajax; + } + + /** + * 修改用户 + */ + @Log(title = "个人信息", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult updateProfile(@RequestBody SysUser user) + { + LoginUser loginUser = getLoginUser(); + SysUser sysUser = loginUser.getUser(); + user.setUserName(sysUser.getUserName()); + if (StringUtils.isNotEmpty(user.getPhonenumber()) + && UserConstants.NOT_UNIQUE.equals(userService.checkPhoneUnique(user))) + { + return error("修改用户'" + user.getUserName() + "'失败,手机号码已存在"); + } + if (StringUtils.isNotEmpty(user.getEmail()) + && UserConstants.NOT_UNIQUE.equals(userService.checkEmailUnique(user))) + { + return error("修改用户'" + user.getUserName() + "'失败,邮箱账号已存在"); + } + user.setUserId(sysUser.getUserId()); + user.setPassword(null); + user.setAvatar(null); + user.setDeptId(null); + if (userService.updateUserProfile(user) > 0) + { + // 更新缓存用户信息 + sysUser.setNickName(user.getNickName()); + sysUser.setPhonenumber(user.getPhonenumber()); + sysUser.setEmail(user.getEmail()); + sysUser.setSex(user.getSex()); + tokenService.setLoginUser(loginUser); + return success(); + } + return error("修改个人信息异常,请联系管理员"); + } + + /** + * 重置密码 + */ + @Log(title = "个人信息", businessType = BusinessType.UPDATE) + @PutMapping("/updatePwd") + public AjaxResult updatePwd(String oldPassword, String newPassword) + { + LoginUser loginUser = getLoginUser(); + String userName = loginUser.getUsername(); + String password = loginUser.getPassword(); + if (!SecurityUtils.matchesPassword(oldPassword, password)) + { + return error("修改密码失败,旧密码错误"); + } + if (SecurityUtils.matchesPassword(newPassword, password)) + { + return error("新密码不能与旧密码相同"); + } + if (userService.resetUserPwd(userName, SecurityUtils.encryptPassword(newPassword)) > 0) + { + // 更新缓存用户密码 + loginUser.getUser().setPassword(SecurityUtils.encryptPassword(newPassword)); + tokenService.setLoginUser(loginUser); + return success(); + } + return error("修改密码异常,请联系管理员"); + } + + /** + * 头像上传 + */ + @Log(title = "用户头像", businessType = BusinessType.UPDATE) + @PostMapping("/avatar") + public AjaxResult avatar(@RequestParam("avatarfile") MultipartFile file) throws Exception + { + if (!file.isEmpty()) + { + LoginUser loginUser = getLoginUser(); + String avatar = FileUploadUtils.upload(RuoYiConfig.getAvatarPath(), file, MimeTypeUtils.IMAGE_EXTENSION); + if (userService.updateUserAvatar(loginUser.getUsername(), avatar)) + { + AjaxResult ajax = AjaxResult.success(); + ajax.put("imgUrl", avatar); + // 更新缓存用户头像 + loginUser.getUser().setAvatar(avatar); + tokenService.setLoginUser(loginUser); + return ajax; + } + } + return error("上传图片异常,请联系管理员"); + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRegisterController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRegisterController.java new file mode 100644 index 0000000..244ea2f --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRegisterController.java @@ -0,0 +1,38 @@ +package com.ruoyi.web.controller.system; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.domain.model.RegisterBody; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.framework.web.service.SysRegisterService; +import com.ruoyi.system.service.ISysConfigService; + +/** + * 注册验证 + * + * @author #author# + */ +@RestController +public class SysRegisterController extends BaseController +{ + @Autowired + private SysRegisterService registerService; + + @Autowired + private ISysConfigService configService; + + @PostMapping("/register") + public AjaxResult register(@RequestBody RegisterBody user) + { + if (!("true".equals(configService.selectConfigByKey("sys.account.registerUser")))) + { + return error("当前系统没有开启注册功能!"); + } + String msg = registerService.register(user); + return StringUtils.isEmpty(msg) ? success() : error(msg); + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRoleController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRoleController.java new file mode 100644 index 0000000..6f3d52f --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRoleController.java @@ -0,0 +1,263 @@ +package com.ruoyi.web.controller.system; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.constant.UserConstants; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.domain.entity.SysDept; +import com.ruoyi.common.core.domain.entity.SysRole; +import com.ruoyi.common.core.domain.entity.SysUser; +import com.ruoyi.common.core.domain.model.LoginUser; +import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.service.SysPermissionService; +import com.ruoyi.framework.web.service.TokenService; +import com.ruoyi.system.domain.SysUserRole; +import com.ruoyi.system.service.ISysDeptService; +import com.ruoyi.system.service.ISysRoleService; +import com.ruoyi.system.service.ISysUserService; + +/** + * 角色信息 + * + * @author #author# + */ +@RestController +@RequestMapping("/system/role") +public class SysRoleController extends BaseController +{ + @Autowired + private ISysRoleService roleService; + + @Autowired + private TokenService tokenService; + + @Autowired + private SysPermissionService permissionService; + + @Autowired + private ISysUserService userService; + + @Autowired + private ISysDeptService deptService; + + @PreAuthorize("@ss.hasPermi('system:role:list')") + @GetMapping("/list") + public TableDataInfo list(SysRole role) + { + startPage(); + List list = roleService.selectRoleList(role); + return getDataTable(list); + } + + @Log(title = "角色管理", businessType = BusinessType.EXPORT) + @PreAuthorize("@ss.hasPermi('system:role:export')") + @PostMapping("/export") + public void export(HttpServletResponse response, SysRole role) + { + List list = roleService.selectRoleList(role); + ExcelUtil util = new ExcelUtil(SysRole.class); + util.exportExcel(response, list, "角色数据"); + } + + /** + * 根据角色编号获取详细信息 + */ + @PreAuthorize("@ss.hasPermi('system:role:query')") + @GetMapping(value = "/{roleId}") + public AjaxResult getInfo(@PathVariable Long roleId) + { + roleService.checkRoleDataScope(roleId); + return success(roleService.selectRoleById(roleId)); + } + + /** + * 新增角色 + */ + @PreAuthorize("@ss.hasPermi('system:role:add')") + @Log(title = "角色管理", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@Validated @RequestBody SysRole role) + { + if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleNameUnique(role))) + { + return error("新增角色'" + role.getRoleName() + "'失败,角色名称已存在"); + } + else if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleKeyUnique(role))) + { + return error("新增角色'" + role.getRoleName() + "'失败,角色权限已存在"); + } + role.setCreateBy(getUsername()); + return toAjax(roleService.insertRole(role)); + + } + + /** + * 修改保存角色 + */ + @PreAuthorize("@ss.hasPermi('system:role:edit')") + @Log(title = "角色管理", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@Validated @RequestBody SysRole role) + { + roleService.checkRoleAllowed(role); + roleService.checkRoleDataScope(role.getRoleId()); + if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleNameUnique(role))) + { + return error("修改角色'" + role.getRoleName() + "'失败,角色名称已存在"); + } + else if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleKeyUnique(role))) + { + return error("修改角色'" + role.getRoleName() + "'失败,角色权限已存在"); + } + role.setUpdateBy(getUsername()); + + if (roleService.updateRole(role) > 0) + { + // 更新缓存用户权限 + LoginUser loginUser = getLoginUser(); + if (StringUtils.isNotNull(loginUser.getUser()) && !loginUser.getUser().isAdmin()) + { + loginUser.setPermissions(permissionService.getMenuPermission(loginUser.getUser())); + loginUser.setUser(userService.selectUserByUserName(loginUser.getUser().getUserName())); + tokenService.setLoginUser(loginUser); + } + return success(); + } + return error("修改角色'" + role.getRoleName() + "'失败,请联系管理员"); + } + + /** + * 修改保存数据权限 + */ + @PreAuthorize("@ss.hasPermi('system:role:edit')") + @Log(title = "角色管理", businessType = BusinessType.UPDATE) + @PutMapping("/dataScope") + public AjaxResult dataScope(@RequestBody SysRole role) + { + roleService.checkRoleAllowed(role); + roleService.checkRoleDataScope(role.getRoleId()); + return toAjax(roleService.authDataScope(role)); + } + + /** + * 状态修改 + */ + @PreAuthorize("@ss.hasPermi('system:role:edit')") + @Log(title = "角色管理", businessType = BusinessType.UPDATE) + @PutMapping("/changeStatus") + public AjaxResult changeStatus(@RequestBody SysRole role) + { + roleService.checkRoleAllowed(role); + roleService.checkRoleDataScope(role.getRoleId()); + role.setUpdateBy(getUsername()); + return toAjax(roleService.updateRoleStatus(role)); + } + + /** + * 删除角色 + */ + @PreAuthorize("@ss.hasPermi('system:role:remove')") + @Log(title = "角色管理", businessType = BusinessType.DELETE) + @DeleteMapping("/{roleIds}") + public AjaxResult remove(@PathVariable Long[] roleIds) + { + return toAjax(roleService.deleteRoleByIds(roleIds)); + } + + /** + * 获取角色选择框列表 + */ + @PreAuthorize("@ss.hasPermi('system:role:query')") + @GetMapping("/optionselect") + public AjaxResult optionselect() + { + return success(roleService.selectRoleAll()); + } + + /** + * 查询已分配用户角色列表 + */ + @PreAuthorize("@ss.hasPermi('system:role:list')") + @GetMapping("/authUser/allocatedList") + public TableDataInfo allocatedList(SysUser user) + { + startPage(); + List list = userService.selectAllocatedList(user); + return getDataTable(list); + } + + /** + * 查询未分配用户角色列表 + */ + @PreAuthorize("@ss.hasPermi('system:role:list')") + @GetMapping("/authUser/unallocatedList") + public TableDataInfo unallocatedList(SysUser user) + { + startPage(); + List list = userService.selectUnallocatedList(user); + return getDataTable(list); + } + + /** + * 取消授权用户 + */ + @PreAuthorize("@ss.hasPermi('system:role:edit')") + @Log(title = "角色管理", businessType = BusinessType.GRANT) + @PutMapping("/authUser/cancel") + public AjaxResult cancelAuthUser(@RequestBody SysUserRole userRole) + { + return toAjax(roleService.deleteAuthUser(userRole)); + } + + /** + * 批量取消授权用户 + */ + @PreAuthorize("@ss.hasPermi('system:role:edit')") + @Log(title = "角色管理", businessType = BusinessType.GRANT) + @PutMapping("/authUser/cancelAll") + public AjaxResult cancelAuthUserAll(Long roleId, Long[] userIds) + { + return toAjax(roleService.deleteAuthUsers(roleId, userIds)); + } + + /** + * 批量选择用户授权 + */ + @PreAuthorize("@ss.hasPermi('system:role:edit')") + @Log(title = "角色管理", businessType = BusinessType.GRANT) + @PutMapping("/authUser/selectAll") + public AjaxResult selectAuthUserAll(Long roleId, Long[] userIds) + { + roleService.checkRoleDataScope(roleId); + return toAjax(roleService.insertAuthUsers(roleId, userIds)); + } + + /** + * 获取对应角色部门树列表 + */ + @PreAuthorize("@ss.hasPermi('system:role:query')") + @GetMapping(value = "/deptTree/{roleId}") + public AjaxResult deptTree(@PathVariable("roleId") Long roleId) + { + AjaxResult ajax = AjaxResult.success(); + ajax.put("checkedKeys", deptService.selectDeptListByRoleId(roleId)); + ajax.put("depts", deptService.selectDeptTreeList(new SysDept())); + return ajax; + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java new file mode 100644 index 0000000..a71ee04 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java @@ -0,0 +1,256 @@ +package com.ruoyi.web.controller.system; + +import java.util.List; +import java.util.stream.Collectors; +import javax.servlet.http.HttpServletResponse; +import org.apache.commons.lang3.ArrayUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.multipart.MultipartFile; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.constant.UserConstants; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.domain.entity.SysDept; +import com.ruoyi.common.core.domain.entity.SysRole; +import com.ruoyi.common.core.domain.entity.SysUser; +import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.system.service.ISysDeptService; +import com.ruoyi.system.service.ISysPostService; +import com.ruoyi.system.service.ISysRoleService; +import com.ruoyi.system.service.ISysUserService; + +/** + * 用户信息 + * + * @author #author# + */ +@RestController +@RequestMapping("/system/user") +public class SysUserController extends BaseController +{ + @Autowired + private ISysUserService userService; + + @Autowired + private ISysRoleService roleService; + + @Autowired + private ISysDeptService deptService; + + @Autowired + private ISysPostService postService; + + /** + * 获取用户列表 + */ + @PreAuthorize("@ss.hasPermi('system:user:list')") + @GetMapping("/list") + public TableDataInfo list(SysUser user) + { + startPage(); + List list = userService.selectUserList(user); + return getDataTable(list); + } + + @Log(title = "用户管理", businessType = BusinessType.EXPORT) + @PreAuthorize("@ss.hasPermi('system:user:export')") + @PostMapping("/export") + public void export(HttpServletResponse response, SysUser user) + { + List list = userService.selectUserList(user); + ExcelUtil util = new ExcelUtil(SysUser.class); + util.exportExcel(response, list, "用户数据"); + } + + @Log(title = "用户管理", businessType = BusinessType.IMPORT) + @PreAuthorize("@ss.hasPermi('system:user:import')") + @PostMapping("/importData") + public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception + { + ExcelUtil util = new ExcelUtil(SysUser.class); + List userList = util.importExcel(file.getInputStream()); + String operName = getUsername(); + String message = userService.importUser(userList, updateSupport, operName); + return success(message); + } + + @PostMapping("/importTemplate") + public void importTemplate(HttpServletResponse response) + { + ExcelUtil util = new ExcelUtil(SysUser.class); + util.importTemplateExcel(response, "用户数据"); + } + + /** + * 根据用户编号获取详细信息 + */ + @PreAuthorize("@ss.hasPermi('system:user:query')") + @GetMapping(value = { "/", "/{userId}" }) + public AjaxResult getInfo(@PathVariable(value = "userId", required = false) Long userId) + { + userService.checkUserDataScope(userId); + AjaxResult ajax = AjaxResult.success(); + List roles = roleService.selectRoleAll(); + ajax.put("roles", SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList())); + ajax.put("posts", postService.selectPostAll()); + if (StringUtils.isNotNull(userId)) + { + SysUser sysUser = userService.selectUserById(userId); + ajax.put(AjaxResult.DATA_TAG, sysUser); + ajax.put("postIds", postService.selectPostListByUserId(userId)); + ajax.put("roleIds", sysUser.getRoles().stream().map(SysRole::getRoleId).collect(Collectors.toList())); + } + return ajax; + } + + /** + * 新增用户 + */ + @PreAuthorize("@ss.hasPermi('system:user:add')") + @Log(title = "用户管理", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@Validated @RequestBody SysUser user) + { + if (UserConstants.NOT_UNIQUE.equals(userService.checkUserNameUnique(user))) + { + return error("新增用户'" + user.getUserName() + "'失败,登录账号已存在"); + } + else if (StringUtils.isNotEmpty(user.getPhonenumber()) + && UserConstants.NOT_UNIQUE.equals(userService.checkPhoneUnique(user))) + { + return error("新增用户'" + user.getUserName() + "'失败,手机号码已存在"); + } + else if (StringUtils.isNotEmpty(user.getEmail()) + && UserConstants.NOT_UNIQUE.equals(userService.checkEmailUnique(user))) + { + return error("新增用户'" + user.getUserName() + "'失败,邮箱账号已存在"); + } + user.setCreateBy(getUsername()); + user.setPassword(SecurityUtils.encryptPassword(user.getPassword())); + return toAjax(userService.insertUser(user)); + } + + /** + * 修改用户 + */ + @PreAuthorize("@ss.hasPermi('system:user:edit')") + @Log(title = "用户管理", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@Validated @RequestBody SysUser user) + { + userService.checkUserAllowed(user); + userService.checkUserDataScope(user.getUserId()); + if (UserConstants.NOT_UNIQUE.equals(userService.checkUserNameUnique(user))) + { + return error("修改用户'" + user.getUserName() + "'失败,登录账号已存在"); + } + else if (StringUtils.isNotEmpty(user.getPhonenumber()) + && UserConstants.NOT_UNIQUE.equals(userService.checkPhoneUnique(user))) + { + return error("修改用户'" + user.getUserName() + "'失败,手机号码已存在"); + } + else if (StringUtils.isNotEmpty(user.getEmail()) + && UserConstants.NOT_UNIQUE.equals(userService.checkEmailUnique(user))) + { + return error("修改用户'" + user.getUserName() + "'失败,邮箱账号已存在"); + } + user.setUpdateBy(getUsername()); + return toAjax(userService.updateUser(user)); + } + + /** + * 删除用户 + */ + @PreAuthorize("@ss.hasPermi('system:user:remove')") + @Log(title = "用户管理", businessType = BusinessType.DELETE) + @DeleteMapping("/{userIds}") + public AjaxResult remove(@PathVariable Long[] userIds) + { + if (ArrayUtils.contains(userIds, getUserId())) + { + return error("当前用户不能删除"); + } + return toAjax(userService.deleteUserByIds(userIds)); + } + + /** + * 重置密码 + */ + @PreAuthorize("@ss.hasPermi('system:user:resetPwd')") + @Log(title = "用户管理", businessType = BusinessType.UPDATE) + @PutMapping("/resetPwd") + public AjaxResult resetPwd(@RequestBody SysUser user) + { + userService.checkUserAllowed(user); + userService.checkUserDataScope(user.getUserId()); + user.setPassword(SecurityUtils.encryptPassword(user.getPassword())); + user.setUpdateBy(getUsername()); + return toAjax(userService.resetPwd(user)); + } + + /** + * 状态修改 + */ + @PreAuthorize("@ss.hasPermi('system:user:edit')") + @Log(title = "用户管理", businessType = BusinessType.UPDATE) + @PutMapping("/changeStatus") + public AjaxResult changeStatus(@RequestBody SysUser user) + { + userService.checkUserAllowed(user); + userService.checkUserDataScope(user.getUserId()); + user.setUpdateBy(getUsername()); + return toAjax(userService.updateUserStatus(user)); + } + + /** + * 根据用户编号获取授权角色 + */ + @PreAuthorize("@ss.hasPermi('system:user:query')") + @GetMapping("/authRole/{userId}") + public AjaxResult authRole(@PathVariable("userId") Long userId) + { + AjaxResult ajax = AjaxResult.success(); + SysUser user = userService.selectUserById(userId); + List roles = roleService.selectRolesByUserId(userId); + ajax.put("user", user); + ajax.put("roles", SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList())); + return ajax; + } + + /** + * 用户授权角色 + */ + @PreAuthorize("@ss.hasPermi('system:user:edit')") + @Log(title = "用户管理", businessType = BusinessType.GRANT) + @PutMapping("/authRole") + public AjaxResult insertAuthRole(Long userId, Long[] roleIds) + { + userService.checkUserDataScope(userId); + userService.insertUserAuth(userId, roleIds); + return success(); + } + + /** + * 获取部门树列表 + */ + @PreAuthorize("@ss.hasPermi('system:user:list')") + @GetMapping("/deptTree") + public AjaxResult deptTree(SysDept dept) + { + return success(deptService.selectDeptTreeList(dept)); + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/TestController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/TestController.java new file mode 100644 index 0000000..2d0b4f5 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/TestController.java @@ -0,0 +1,183 @@ +package com.ruoyi.web.controller.tool; + +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.R; +import com.ruoyi.common.utils.StringUtils; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import io.swagger.annotations.ApiOperation; + +/** + * swagger 用户测试方法 + * + * @author #author# + */ +@Api("用户信息管理") +@RestController +@RequestMapping("/test/user") +public class TestController extends BaseController +{ + private final static Map users = new LinkedHashMap(); + { + users.put(1, new UserEntity(1, "admin", "admin123", "15888888888")); + users.put(2, new UserEntity(2, "ry", "admin123", "15666666666")); + } + + @ApiOperation("获取用户列表") + @GetMapping("/list") + public R> userList() + { + List userList = new ArrayList(users.values()); + return R.ok(userList); + } + + @ApiOperation("获取用户详细") + @ApiImplicitParam(name = "userId", value = "用户ID", required = true, dataType = "int", paramType = "path", dataTypeClass = Integer.class) + @GetMapping("/{userId}") + public R getUser(@PathVariable Integer userId) + { + if (!users.isEmpty() && users.containsKey(userId)) + { + return R.ok(users.get(userId)); + } + else + { + return R.fail("用户不存在"); + } + } + + @ApiOperation("新增用户") + @ApiImplicitParams({ + @ApiImplicitParam(name = "userId", value = "用户id", dataType = "Integer", dataTypeClass = Integer.class), + @ApiImplicitParam(name = "username", value = "用户名称", dataType = "String", dataTypeClass = String.class), + @ApiImplicitParam(name = "password", value = "用户密码", dataType = "String", dataTypeClass = String.class), + @ApiImplicitParam(name = "mobile", value = "用户手机", dataType = "String", dataTypeClass = String.class) + }) + @PostMapping("/save") + public R save(UserEntity user) + { + if (StringUtils.isNull(user) || StringUtils.isNull(user.getUserId())) + { + return R.fail("用户ID不能为空"); + } + users.put(user.getUserId(), user); + return R.ok(); + } + + @ApiOperation("更新用户") + @PutMapping("/update") + public R update(@RequestBody UserEntity user) + { + if (StringUtils.isNull(user) || StringUtils.isNull(user.getUserId())) + { + return R.fail("用户ID不能为空"); + } + if (users.isEmpty() || !users.containsKey(user.getUserId())) + { + return R.fail("用户不存在"); + } + users.remove(user.getUserId()); + users.put(user.getUserId(), user); + return R.ok(); + } + + @ApiOperation("删除用户信息") + @ApiImplicitParam(name = "userId", value = "用户ID", required = true, dataType = "int", paramType = "path", dataTypeClass = Integer.class) + @DeleteMapping("/{userId}") + public R delete(@PathVariable Integer userId) + { + if (!users.isEmpty() && users.containsKey(userId)) + { + users.remove(userId); + return R.ok(); + } + else + { + return R.fail("用户不存在"); + } + } +} + +@ApiModel(value = "UserEntity", description = "用户实体") +class UserEntity +{ + @ApiModelProperty("用户ID") + private Integer userId; + + @ApiModelProperty("用户名称") + private String username; + + @ApiModelProperty("用户密码") + private String password; + + @ApiModelProperty("用户手机") + private String mobile; + + public UserEntity() + { + + } + + public UserEntity(Integer userId, String username, String password, String mobile) + { + this.userId = userId; + this.username = username; + this.password = password; + this.mobile = mobile; + } + + public Integer getUserId() + { + return userId; + } + + public void setUserId(Integer userId) + { + this.userId = userId; + } + + public String getUsername() + { + return username; + } + + public void setUsername(String username) + { + this.username = username; + } + + public String getPassword() + { + return password; + } + + public void setPassword(String password) + { + this.password = password; + } + + public String getMobile() + { + return mobile; + } + + public void setMobile(String mobile) + { + this.mobile = mobile; + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/core/config/SwaggerConfig.java b/ruoyi-admin/src/main/java/com/ruoyi/web/core/config/SwaggerConfig.java new file mode 100644 index 0000000..7950a54 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/core/config/SwaggerConfig.java @@ -0,0 +1,125 @@ +package com.ruoyi.web.core.config; + +import java.util.ArrayList; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import com.ruoyi.common.config.RuoYiConfig; +import io.swagger.annotations.ApiOperation; +import io.swagger.models.auth.In; +import springfox.documentation.builders.ApiInfoBuilder; +import springfox.documentation.builders.PathSelectors; +import springfox.documentation.builders.RequestHandlerSelectors; +import springfox.documentation.service.ApiInfo; +import springfox.documentation.service.ApiKey; +import springfox.documentation.service.AuthorizationScope; +import springfox.documentation.service.Contact; +import springfox.documentation.service.SecurityReference; +import springfox.documentation.service.SecurityScheme; +import springfox.documentation.spi.DocumentationType; +import springfox.documentation.spi.service.contexts.SecurityContext; +import springfox.documentation.spring.web.plugins.Docket; + +/** + * Swagger2的接口配置 + * + * @author #author# + */ +@Configuration +public class SwaggerConfig +{ + /** 系统基础配置 */ + @Autowired + private RuoYiConfig ruoyiConfig; + + /** 是否开启swagger */ + @Value("${swagger.enabled}") + private boolean enabled; + + /** 设置请求的统一前缀 */ + @Value("${swagger.pathMapping}") + private String pathMapping; + + /** + * 创建API + */ + @Bean + public Docket createRestApi() + { + return new Docket(DocumentationType.OAS_30) + // 是否启用Swagger + .enable(enabled) + // 用来创建该API的基本信息,展示在文档的页面中(自定义展示的信息) + .apiInfo(apiInfo()) + // 设置哪些接口暴露给Swagger展示 + .select() + // 扫描所有有注解的api,用这种方式更灵活 + .apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class)) + // 扫描指定包中的swagger注解 + // .apis(RequestHandlerSelectors.basePackage("com.ruoyi.project.tool.swagger")) + // 扫描所有 .apis(RequestHandlerSelectors.any()) + .paths(PathSelectors.any()) + .build() + /* 设置安全模式,swagger可以设置访问token */ + .securitySchemes(securitySchemes()) + .securityContexts(securityContexts()) + .pathMapping(pathMapping); + } + + /** + * 安全模式,这里指定token通过Authorization头请求头传递 + */ + private List securitySchemes() + { + List apiKeyList = new ArrayList(); + apiKeyList.add(new ApiKey("Authorization", "Authorization", In.HEADER.toValue())); + return apiKeyList; + } + + /** + * 安全上下文 + */ + private List securityContexts() + { + List securityContexts = new ArrayList<>(); + securityContexts.add( + SecurityContext.builder() + .securityReferences(defaultAuth()) + .operationSelector(o -> o.requestMappingPattern().matches("/.*")) + .build()); + return securityContexts; + } + + /** + * 默认的安全上引用 + */ + private List defaultAuth() + { + AuthorizationScope authorizationScope = new AuthorizationScope("global", "accessEverything"); + AuthorizationScope[] authorizationScopes = new AuthorizationScope[1]; + authorizationScopes[0] = authorizationScope; + List securityReferences = new ArrayList<>(); + securityReferences.add(new SecurityReference("Authorization", authorizationScopes)); + return securityReferences; + } + + /** + * 添加摘要信息 + */ + private ApiInfo apiInfo() + { + // 用ApiInfoBuilder进行定制 + return new ApiInfoBuilder() + // 设置标题 + .title("标题:管理系统_接口文档") + // 描述 + .description("接口文档") + // 作者信息 + .contact(new Contact(ruoyiConfig.getName(), null, null)) + // 版本 + .version("版本号:" + ruoyiConfig.getVersion()) + .build(); + } +} diff --git a/ruoyi-admin/src/main/resources/META-INF/spring-devtools.properties b/ruoyi-admin/src/main/resources/META-INF/spring-devtools.properties new file mode 100644 index 0000000..2b23f85 --- /dev/null +++ b/ruoyi-admin/src/main/resources/META-INF/spring-devtools.properties @@ -0,0 +1 @@ +restart.include.json=/com.alibaba.fastjson.*.jar \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/application-druid.yml b/ruoyi-admin/src/main/resources/application-druid.yml new file mode 100644 index 0000000..7cb8fa0 --- /dev/null +++ b/ruoyi-admin/src/main/resources/application-druid.yml @@ -0,0 +1,57 @@ +# 数据源配置 +spring: + datasource: + type: com.alibaba.druid.pool.DruidDataSource + driverClassName: com.mysql.cj.jdbc.Driver + druid: + # 主库数据源 + master: + url: jdbc:mysql://192.168.124.67:3306/dba?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 + username: dba + password: 123456 + # 从库数据源 + slave: + # 从数据源开关/默认关闭 + enabled: false + url: + username: + password: + # 初始连接数 + initialSize: 5 + # 最小连接池数量 + minIdle: 10 + # 最大连接池数量 + maxActive: 20 + # 配置获取连接等待超时的时间 + maxWait: 60000 + # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 + timeBetweenEvictionRunsMillis: 60000 + # 配置一个连接在池中最小生存的时间,单位是毫秒 + minEvictableIdleTimeMillis: 300000 + # 配置一个连接在池中最大生存的时间,单位是毫秒 + maxEvictableIdleTimeMillis: 900000 + # 配置检测连接是否有效 + validationQuery: SELECT 1 FROM DUAL + testWhileIdle: true + testOnBorrow: false + testOnReturn: false + webStatFilter: + enabled: true + statViewServlet: + enabled: true + # 设置白名单,不填则允许所有访问 + allow: + url-pattern: /druid/* + # 控制台管理用户名和密码 + login-username: ruoyi + login-password: 123456 + filter: + stat: + enabled: true + # 慢SQL记录 + log-slow-sql: true + slow-sql-millis: 1000 + merge-sql: true + wall: + config: + multi-statement-allow: true \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/application.yml b/ruoyi-admin/src/main/resources/application.yml new file mode 100644 index 0000000..b841603 --- /dev/null +++ b/ruoyi-admin/src/main/resources/application.yml @@ -0,0 +1,139 @@ +# 项目相关配置 +ruoyi: + # 名称 + name: #author# + # 版本 + version: 3.8.5 + # 版权年份 + copyrightYear: 2023 + # 实例演示开关 + demoEnabled: true + # 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath) + profile: D:/poject/log/uploadPath + # 获取ip地址开关 + addressEnabled: false + # 验证码类型 math 数组计算 char 字符验证 + captchaType: math + +# 开发环境配置 +server: + # 服务器的HTTP端口,默认为8080 + port: 9000 + servlet: + # 应用的访问路径 + context-path: / + tomcat: + # tomcat的URI编码 + uri-encoding: UTF-8 + # 连接数满后的排队数,默认为100 + accept-count: 1000 + threads: + # tomcat最大线程数,默认为200 + max: 800 + # Tomcat启动初始化的线程数,默认值10 + min-spare: 100 + +# 日志配置 +logging: + level: + com.ruoyi: debug + org.springframework: warn + +# 用户配置 +user: + password: + # 密码最大错误次数 + maxRetryCount: 5 + # 密码锁定时间(默认10分钟) + lockTime: 10 + +# Spring配置 +spring: + # 资源信息 + messages: + # 国际化资源文件路径 + basename: i18n/messages + profiles: + active: druid + # 文件上传 + servlet: + multipart: + # 单个文件大小 + max-file-size: 10MB + # 设置总上传的文件大小 + max-request-size: 20MB + # 服务模块 + devtools: + restart: + # 热部署开关 + enabled: true + # redis 配置 + redis: + # 地址 + host: 192.168.124.67 + # 端口,默认为6379 + port: 6379 + # 数据库索引 + database: 0 + # 密码 + password: 123456 + # 连接超时时间 + timeout: 10s + lettuce: + pool: + # 连接池中的最小空闲连接 + min-idle: 0 + # 连接池中的最大空闲连接 + max-idle: 8 + # 连接池的最大数据库连接数 + max-active: 8 + # #连接池最大阻塞等待时间(使用负值表示没有限制) + max-wait: -1ms + +# token配置 +token: + # 令牌自定义标识 + header: Authorization + # 令牌密钥 + secret: abcdefghijklmnopqrstuvwxyz + # 令牌有效期(默认30分钟) + expireTime: 30 + + + +# MyBatis Plus配置 +mybatis-plus: + # 搜索指定包别名 + typeAliasesPackage: com.ruoyi.**.domain,com.ruoyi.**.vo.domain + # 配置mapper的扫描,找到所有的mapper.xml映射文件 + mapperLocations: classpath*:mapper/**/*Mapper.xml + # 加载全局的配置文件 + configLocation: classpath:mybatis/mybatis-config.xml + global-config: + db-config: + logic-delete-field: deleted # 全局逻辑删除的实体字段名(since 3.3.0,配置后可以忽略不配置步骤2) + logic-delete-value: UNIX_TIMESTAMP() # 逻辑已删除值(默认为 时间戳) + logic-not-delete-value: 0 # 逻辑未删除值(默认为 0) + + +# PageHelper分页插件 +pagehelper: + helperDialect: mysql + supportMethodsArguments: true + params: count=countSql + +# Swagger配置 +swagger: + # 是否开启swagger + enabled: true + # 请求前缀 + pathMapping: /dev-api + +# 防止XSS攻击 +xss: + # 过滤开关 + enabled: true + # 排除链接(多个用逗号分隔) + excludes: /system/notice + # 匹配链接 + urlPatterns: /system/*,/monitor/*,/tool/* diff --git a/ruoyi-admin/src/main/resources/banner.txt b/ruoyi-admin/src/main/resources/banner.txt new file mode 100644 index 0000000..0931cb8 --- /dev/null +++ b/ruoyi-admin/src/main/resources/banner.txt @@ -0,0 +1,24 @@ +Application Version: ${ruoyi.version} +Spring Boot Version: ${spring-boot.version} +//////////////////////////////////////////////////////////////////// +// _ooOoo_ // +// o8888888o // +// 88" . "88 // +// (| ^_^ |) // +// O\ = /O // +// ____/`---'\____ // +// .' \\| |// `. // +// / \\||| : |||// \ // +// / _||||| -:- |||||- \ // +// | | \\\ - /// | | // +// | \_| ''\---/'' | | // +// \ .-\__ `-` ___/-. / // +// ___`. .' /--.--\ `. . ___ // +// ."" '< `.___\_<|>_/___.' >'"". // +// | | : `- \`.;`\ _ /`;.`/ - ` : | | // +// \ \ `-. \_ __\ /__ _/ .-` / / // +// ========`-.____`-.___\_____/___.-`____.-'======== // +// `=---=' // +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ // +// 佛祖保佑 永不宕机 永无BUG // +//////////////////////////////////////////////////////////////////// \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/i18n/messages.properties b/ruoyi-admin/src/main/resources/i18n/messages.properties new file mode 100644 index 0000000..4098fc9 --- /dev/null +++ b/ruoyi-admin/src/main/resources/i18n/messages.properties @@ -0,0 +1,37 @@ +#错误消息 +not.null=* 必须填写 +user.jcaptcha.error=验证码错误 +user.jcaptcha.expire=验证码已失效 +user.not.exists=用户不存在/密码错误 +user.password.not.match=用户不存在/密码错误 +user.password.retry.limit.count=密码输入错误{0}次 +user.password.retry.limit.exceed=密码输入错误{0}次,帐户锁定{1}分钟 +user.password.delete=对不起,您的账号已被删除 +user.blocked=用户已封禁,请联系管理员 +role.blocked=角色已封禁,请联系管理员 +user.logout.success=退出成功 + +length.not.valid=长度必须在{min}到{max}个字符之间 + +user.username.not.valid=* 2到20个汉字、字母、数字或下划线组成,且必须以非数字开头 +user.password.not.valid=* 5-50个字符 + +user.email.not.valid=邮箱格式错误 +user.mobile.phone.number.not.valid=手机号格式错误 +user.login.success=登录成功 +user.register.success=注册成功 +user.notfound=请重新登录 +user.forcelogout=管理员强制退出,请重新登录 +user.unknown.error=未知错误,请重新登录 + +##文件上传消息 +upload.exceed.maxSize=上传的文件大小超出限制的文件大小!
允许的文件最大大小是:{0}MB! +upload.filename.exceed.length=上传的文件名最长{0}个字符 + +##权限 +no.permission=您没有数据的权限,请联系管理员添加权限 [{0}] +no.create.permission=您没有创建数据的权限,请联系管理员添加权限 [{0}] +no.update.permission=您没有修改数据的权限,请联系管理员添加权限 [{0}] +no.delete.permission=您没有删除数据的权限,请联系管理员添加权限 [{0}] +no.export.permission=您没有导出数据的权限,请联系管理员添加权限 [{0}] +no.view.permission=您没有查看数据的权限,请联系管理员添加权限 [{0}] diff --git a/ruoyi-admin/src/main/resources/logback.xml b/ruoyi-admin/src/main/resources/logback.xml new file mode 100644 index 0000000..bec4598 --- /dev/null +++ b/ruoyi-admin/src/main/resources/logback.xml @@ -0,0 +1,93 @@ + + + + + + + + + + + ${log.pattern} + + + + + + ${log.path}/sys-info.log + + + + ${log.path}/sys-info.%d{yyyy-MM-dd}.log + + 60 + + + ${log.pattern} + + + + INFO + + ACCEPT + + DENY + + + + + ${log.path}/sys-error.log + + + + ${log.path}/sys-error.%d{yyyy-MM-dd}.log + + 60 + + + ${log.pattern} + + + + ERROR + + ACCEPT + + DENY + + + + + + ${log.path}/sys-user.log + + + ${log.path}/sys-user.%d{yyyy-MM-dd}.log + + 60 + + + ${log.pattern} + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/mybatis/mybatis-config.xml b/ruoyi-admin/src/main/resources/mybatis/mybatis-config.xml new file mode 100644 index 0000000..ac47c03 --- /dev/null +++ b/ruoyi-admin/src/main/resources/mybatis/mybatis-config.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/ruoyi-business/pom.xml b/ruoyi-business/pom.xml new file mode 100644 index 0000000..db4d1fa --- /dev/null +++ b/ruoyi-business/pom.xml @@ -0,0 +1,28 @@ + + + + ruoyi + com.ruoyi + 3.8.5 + + 4.0.0 + + ruoyi-business + + + business业务模块 + + + + + + + com.ruoyi + ruoyi-common + + + + + \ No newline at end of file diff --git a/ruoyi-business/src/main/java/com/ruoyi/business/controller/BusinessSurveyController.java b/ruoyi-business/src/main/java/com/ruoyi/business/controller/BusinessSurveyController.java new file mode 100644 index 0000000..febed77 --- /dev/null +++ b/ruoyi-business/src/main/java/com/ruoyi/business/controller/BusinessSurveyController.java @@ -0,0 +1,138 @@ +package com.ruoyi.business.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +import com.alibaba.fastjson2.JSONArray; +import com.alibaba.fastjson2.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.ruoyi.business.domain.BusinessTemplate; +import com.ruoyi.business.domain.BusinessTemplateProp; +import com.ruoyi.business.domain.BusinessTemplatePropValue; +import com.ruoyi.business.service.IBusinessTemplatePropService; +import com.ruoyi.business.service.IBusinessTemplateService; +import com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.common.utils.StringUtils; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.business.domain.BusinessSurvey; +import com.ruoyi.business.service.IBusinessSurveyService; +import com.ruoyi.common.utils.poi.ExcelUtil; +import java.util.Arrays; +import java.util.Optional; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import com.ruoyi.common.core.page.TableDataInfo; + +/** + * 调查问卷管理Controller + * + * @author ruoyi + * @date 2024-04-01 + */ +@RestController +@RequestMapping("/business/survey") +public class BusinessSurveyController extends BaseController +{ + @Autowired + private IBusinessSurveyService businessSurveyService; + + + /** + * 获取问卷属性 + */ + @GetMapping("/listBySurveyId") + public AjaxResult listBySurveyId(String surveyId) { + return businessSurveyService.listBySurveyId(surveyId); + } + + + + /** + * 查询调查问卷管理列表 + */ + @PreAuthorize("@ss.hasPermi('business:survey:list')") + @GetMapping("/list") + public TableDataInfo list(BusinessSurvey businessSurvey) + { + startPage(); + List list = businessSurveyService.lambdaQuery() + .eq(StringUtils.isNotEmpty(businessSurvey.getTitle()),BusinessSurvey::getTitle,businessSurvey.getTitle()) + .eq(StringUtils.isNotBlank(businessSurvey.getOpen()),BusinessSurvey::getOpen,businessSurvey.getOpen()).list(); + return getDataTable(list); + } + + /** + * 导出调查问卷管理列表 + */ + @PreAuthorize("@ss.hasPermi('business:survey:export')") + @Log(title = "调查问卷管理", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, BusinessSurvey businessSurvey) + { + List list = businessSurveyService.list(); + ExcelUtil util = new ExcelUtil(BusinessSurvey.class); + util.exportExcel(response, list, "调查问卷管理数据"); + } + + /** + * 获取调查问卷管理详细信息 + */ + @PreAuthorize("@ss.hasPermi('business:survey:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(businessSurveyService.getById(id)); + } + @Autowired + private IBusinessTemplateService businessTemplateService; + /** + * 新增调查问卷管理 + */ + @PreAuthorize("@ss.hasPermi('business:survey:add')") + @Log(title = "调查问卷管理", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody BusinessSurvey businessSurvey) + { + BusinessTemplate one = businessTemplateService.lambdaQuery().eq(BusinessTemplate::getId, businessSurvey.getTempId()).one(); + businessSurvey.setTempName(one.getTitle()); + return toAjax(businessSurveyService.save(businessSurvey)); + } + + /** + * 修改调查问卷管理 + */ + @PreAuthorize("@ss.hasPermi('business:survey:edit')") + @Log(title = "调查问卷管理", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody BusinessSurvey businessSurvey) + { + BusinessTemplate one = businessTemplateService.lambdaQuery().eq(BusinessTemplate::getId, businessSurvey.getTempId()).one(); + businessSurvey.setTempName(one.getTitle()); + return toAjax(businessSurveyService.updateById(businessSurvey)); + } + + /** + * 删除调查问卷管理 + */ + @PreAuthorize("@ss.hasPermi('business:survey:remove')") + @Log(title = "调查问卷管理", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(businessSurveyService.removeByIds(Arrays.asList(ids))); + } +} diff --git a/ruoyi-business/src/main/java/com/ruoyi/business/controller/BusinessTemplateController.java b/ruoyi-business/src/main/java/com/ruoyi/business/controller/BusinessTemplateController.java new file mode 100644 index 0000000..7c3373b --- /dev/null +++ b/ruoyi-business/src/main/java/com/ruoyi/business/controller/BusinessTemplateController.java @@ -0,0 +1,138 @@ +package com.ruoyi.business.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.ruoyi.business.domain.BusinessSurvey; +import com.ruoyi.business.service.IBusinessSurveyService; +import com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.common.utils.StringUtils; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.business.domain.BusinessTemplate; +import com.ruoyi.business.service.IBusinessTemplateService; +import com.ruoyi.common.utils.poi.ExcelUtil; +import java.util.Arrays; +import com.ruoyi.common.core.page.TableDataInfo; + +/** + * 模版管理Controller + * + * @author ruoyi + * @date 2024-03-31 + */ +@RestController +@RequestMapping("/business/template") +public class BusinessTemplateController extends BaseController +{ + @Autowired + private IBusinessTemplateService businessTemplateService; + + /** + * 查询模版管理列表 + */ + @PreAuthorize("@ss.hasPermi('business:template:list')") + @GetMapping("/list") + public TableDataInfo list(BusinessTemplate businessTemplate) + { + startPage(); + LambdaQueryWrapper like = new LambdaQueryWrapper() + .eq(StringUtils.isNotBlank( businessTemplate.getOpen()),BusinessTemplate::getOpen, businessTemplate.getOpen()) + .like(StringUtils.isNotBlank(businessTemplate.getTitle()), BusinessTemplate::getTitle, businessTemplate.getTitle()); + if(businessTemplate.getCreateBy() != null){ + logger.debug("SecurityUtils.getUsername():{}",SecurityUtils.getUsername()); + like.eq(BusinessTemplate::getCreateBy, SecurityUtils.getUsername()); + } + List list = businessTemplateService.list(like); + return getDataTable(list); + } + + /** + * 查询模版管理列表 + */ + @PreAuthorize("@ss.hasPermi('business:template:list')") + @GetMapping("/listAll") + public AjaxResult listAll(BusinessTemplate businessTemplate) + { + List list = businessTemplateService.list( + new LambdaQueryWrapper().eq(BusinessTemplate::getCreateBy,SecurityUtils.getUsername()) + .eq(StringUtils.isNotBlank(businessTemplate.getId()),BusinessTemplate::getId,businessTemplate.getId()) + ); + return AjaxResult.success(list); + } + + /** + * 导出模版管理列表 + */ + @PreAuthorize("@ss.hasPermi('business:template:export')") + @Log(title = "模版管理", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, BusinessTemplate businessTemplate) + { + List list = businessTemplateService.list(); + ExcelUtil util = new ExcelUtil(BusinessTemplate.class); + util.exportExcel(response, list, "模版管理数据"); + } + + /** + * 获取模版管理详细信息 + */ + @PreAuthorize("@ss.hasPermi('business:template:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(businessTemplateService.getById(id)); + } + + + /** + * 新增模版管理 + */ + @PreAuthorize("@ss.hasPermi('business:template:add')") + @Log(title = "模版管理", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody BusinessTemplate businessTemplate) + { + return toAjax(businessTemplateService.save(businessTemplate)); + } + + @Autowired + private IBusinessSurveyService businessSurveyService; + /** + * 修改模版管理 + */ + @PreAuthorize("@ss.hasPermi('business:template:edit')") + @Log(title = "模版管理", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody BusinessTemplate businessTemplate) + { + BusinessSurvey businessSurvey = new BusinessSurvey(); + businessSurvey.setTempName(businessTemplate.getTitle()); + businessSurveyService.lambdaUpdate().eq(BusinessSurvey::getTempId, businessTemplate.getId()).update(businessSurvey); + return toAjax(businessTemplateService.updateById(businessTemplate)); + } + + /** + * 删除模版管理 + */ + @PreAuthorize("@ss.hasPermi('business:template:remove')") + @Log(title = "模版管理", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(businessTemplateService.removeByIds(Arrays.asList(ids))); + } +} diff --git a/ruoyi-business/src/main/java/com/ruoyi/business/controller/BusinessTemplatePropController.java b/ruoyi-business/src/main/java/com/ruoyi/business/controller/BusinessTemplatePropController.java new file mode 100644 index 0000000..47c35b6 --- /dev/null +++ b/ruoyi-business/src/main/java/com/ruoyi/business/controller/BusinessTemplatePropController.java @@ -0,0 +1,121 @@ +package com.ruoyi.business.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +import com.alibaba.fastjson2.JSON; +import com.alibaba.fastjson2.JSONArray; +import com.alibaba.fastjson2.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.ruoyi.business.domain.BusinessTemplatePropValue; +import com.ruoyi.business.service.IBusinessTemplatePropValueService; +import com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.common.utils.StringUtils; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.business.domain.BusinessTemplateProp; +import com.ruoyi.business.service.IBusinessTemplatePropService; +import com.ruoyi.common.utils.poi.ExcelUtil; + +import java.util.Arrays; +import java.util.Optional; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import com.ruoyi.common.core.page.TableDataInfo; + +/** + * 模版属性Controller + * + * @author ruoyi + * @date 2024-03-31 + */ +@RestController +@RequestMapping("/business/templateProp") +public class BusinessTemplatePropController extends BaseController { + @Autowired + private IBusinessTemplatePropService businessTemplatePropService; + + @Autowired + private IBusinessTemplatePropValueService businessTemplatePropValueService; + + + /** + * 查询模版属性列表 + */ + @PreAuthorize("@ss.hasPermi('business:templateProp:list')") + @GetMapping("/list") + public TableDataInfo list(BusinessTemplateProp businessTemplateProp) { + startPage(); + List list = businessTemplatePropService.list(new LambdaQueryWrapper() + .eq(StringUtils.isNotBlank(businessTemplateProp.getCompType()),BusinessTemplateProp::getCompType,businessTemplateProp.getCompType()) + .eq(StringUtils.isNotBlank(businessTemplateProp.getFieldName()),BusinessTemplateProp::getFieldName,businessTemplateProp.getFieldName()) + .eq(StringUtils.isNotBlank(businessTemplateProp.getId()),BusinessTemplateProp::getId,businessTemplateProp.getId()) + .eq(BusinessTemplateProp::getTempId,businessTemplateProp.getTempId()) + ); + return getDataTable(list); + } + + /** + * 导出模版属性列表 + */ + @PreAuthorize("@ss.hasPermi('business:templateProp:export')") + @Log(title = "模版属性" , businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, BusinessTemplateProp businessTemplateProp) { + List list = businessTemplatePropService.list(); + ExcelUtil util = new ExcelUtil(BusinessTemplateProp.class); + util.exportExcel(response, list, "模版属性数据"); + } + + /** + * 获取模版属性详细信息 + */ + @PreAuthorize("@ss.hasPermi('business:templateProp:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) { + return success(businessTemplatePropService.getById(id)); + } + + /** + * 新增模版属性 + */ + @PreAuthorize("@ss.hasPermi('business:templateProp:add')") + @Log(title = "模版属性" , businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody BusinessTemplateProp businessTemplateProp) { + return toAjax(businessTemplatePropService.save(businessTemplateProp)); + } + + /** + * 修改模版属性 + */ + @PreAuthorize("@ss.hasPermi('business:templateProp:edit')") + @Log(title = "模版属性" , businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody BusinessTemplateProp businessTemplateProp) { + return toAjax(businessTemplatePropService.updateById(businessTemplateProp)); + } + + /** + * 删除模版属性 + */ + @PreAuthorize("@ss.hasPermi('business:templateProp:remove')") + @Log(title = "模版属性" , businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) { + return toAjax(businessTemplatePropService.removeByIds(Arrays.asList(ids))); + } +} diff --git a/ruoyi-business/src/main/java/com/ruoyi/business/controller/BusinessTemplatePropValueController.java b/ruoyi-business/src/main/java/com/ruoyi/business/controller/BusinessTemplatePropValueController.java new file mode 100644 index 0000000..73205c8 --- /dev/null +++ b/ruoyi-business/src/main/java/com/ruoyi/business/controller/BusinessTemplatePropValueController.java @@ -0,0 +1,128 @@ +package com.ruoyi.business.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.business.domain.BusinessTemplatePropValue; +import com.ruoyi.business.service.IBusinessTemplatePropValueService; +import com.ruoyi.common.utils.poi.ExcelUtil; +import java.util.Arrays; +import java.util.Map; + +import com.ruoyi.common.core.page.TableDataInfo; + +/** + * 模版属性值Controller + * + * @author ruoyi + * @date 2024-03-31 + */ +@RestController +@RequestMapping("/business/templatePropValue") +public class BusinessTemplatePropValueController extends BaseController +{ + @Autowired + private IBusinessTemplatePropValueService businessTemplatePropValueService; + + /** + * 查询模版属性值列表 + */ + @PreAuthorize("@ss.hasPermi('business:templatePropValue:list')") + @GetMapping("/list") + public TableDataInfo list(BusinessTemplatePropValue businessTemplatePropValue) + { + startPage(); + List list = businessTemplatePropValueService.list(); + return getDataTable(list); + } + + /** + * 统计问卷 + */ + @GetMapping("/countGroup") + public AjaxResult countGroup(String surveyId) + { + Object o = businessTemplatePropValueService.countGroup(surveyId); + return AjaxResult.success(o); + } + + /** + * 导出模版属性值列表 + */ + @PreAuthorize("@ss.hasPermi('business:templatePropValue:export')") + @Log(title = "模版属性值", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, BusinessTemplatePropValue businessTemplatePropValue) + { + List list = businessTemplatePropValueService.list(); + ExcelUtil util = new ExcelUtil(BusinessTemplatePropValue.class); + util.exportExcel(response, list, "模版属性值数据"); + } + + /** + * 获取模版属性值详细信息 + */ + @PreAuthorize("@ss.hasPermi('business:templatePropValue:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(businessTemplatePropValueService.getById(id)); + } + + /** + * 新增模版属性值 + */ + @PreAuthorize("@ss.hasPermi('business:templatePropValue:add')") + @Log(title = "模版属性值", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody BusinessTemplatePropValue businessTemplatePropValue) + { + return toAjax(businessTemplatePropValueService.save(businessTemplatePropValue)); + } + + + /** + * 新增模版属性值 + */ + @Log(title = "模版属性值", businessType = BusinessType.INSERT) + @PostMapping("/addList") + public AjaxResult addList(@RequestBody Map data) + { + return toAjax(businessTemplatePropValueService.addList(data)); + } + + /** + * 修改模版属性值 + */ + @PreAuthorize("@ss.hasPermi('business:templatePropValue:edit')") + @Log(title = "模版属性值", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody BusinessTemplatePropValue businessTemplatePropValue) + { + return toAjax(businessTemplatePropValueService.updateById(businessTemplatePropValue)); + } + + /** + * 删除模版属性值 + */ + @PreAuthorize("@ss.hasPermi('business:templatePropValue:remove')") + @Log(title = "模版属性值", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(businessTemplatePropValueService.removeByIds(Arrays.asList(ids))); + } +} diff --git a/ruoyi-business/src/main/java/com/ruoyi/business/domain/BusinessSurvey.java b/ruoyi-business/src/main/java/com/ruoyi/business/domain/BusinessSurvey.java new file mode 100644 index 0000000..2d11671 --- /dev/null +++ b/ruoyi-business/src/main/java/com/ruoyi/business/domain/BusinessSurvey.java @@ -0,0 +1,64 @@ +package com.ruoyi.business.domain; + +import lombok.Data; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +import java.util.ArrayList; + +/** + * 调查问卷管理对象 business_survey + * + * @author ruoyi + * @date 2024-04-01 + */ +@Data +public class BusinessSurvey extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + + + /** 问卷名称 */ + @Excel(name = "问卷名称") + private String title; + + + /** 问卷描述 */ + @Excel(name = "问卷描述") + private String context; + + + /** 模板id */ + @Excel(name = "模板id") + private String tempId; + + + /** 模板名称 */ + @Excel(name = "模板名称") + private String tempName; + + + /** 是否开放 */ + @Excel(name = "是否开放") + private String open; + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("title", getTitle()) + .append("context", getContext()) + .append("tempId", getTempId()) + .append("open", getOpen()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("deleted", getDeleted()) + .append("remark", getRemark()) + .toString(); + } +} diff --git a/ruoyi-business/src/main/java/com/ruoyi/business/domain/BusinessTemplate.java b/ruoyi-business/src/main/java/com/ruoyi/business/domain/BusinessTemplate.java new file mode 100644 index 0000000..004332e --- /dev/null +++ b/ruoyi-business/src/main/java/com/ruoyi/business/domain/BusinessTemplate.java @@ -0,0 +1,73 @@ +package com.ruoyi.business.domain; + +import lombok.Data; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * 模版管理对象 business_template + * + * @author ruoyi + * @date 2024-03-31 + */ +@Data +public class BusinessTemplate extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 标题 */ + @Excel(name = "标题") + private String title; + + + /** 内容 */ + @Excel(name = "内容") + private String context; + + + /** 是否开放 */ + @Excel(name = "是否开放") + private String open; + + + public void setTitle(String title) + { + this.title = title; + } + + public String getTitle() + { + return title; + } + public void setContext(String context) + { + this.context = context; + } + + public String getContext() + { + return context; + } + public void setOpen(String open) + { + this.open = open; + } + + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("title", getTitle()) + .append("context", getContext()) + .append("open", getOpen()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("remark", getRemark()) + .toString(); + } +} diff --git a/ruoyi-business/src/main/java/com/ruoyi/business/domain/BusinessTemplateProp.java b/ruoyi-business/src/main/java/com/ruoyi/business/domain/BusinessTemplateProp.java new file mode 100644 index 0000000..b1f8e3a --- /dev/null +++ b/ruoyi-business/src/main/java/com/ruoyi/business/domain/BusinessTemplateProp.java @@ -0,0 +1,182 @@ +package com.ruoyi.business.domain; + +import com.alibaba.fastjson2.JSON; +import com.baomidou.mybatisplus.annotation.TableField; +import lombok.Data; +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 模版属性对象 business_template_prop + * + * @author ruoyi + * @date 2024-03-31 + */ +@Data +public class BusinessTemplateProp extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + + /** 标题 */ + @Excel(name = "标题") + private String title; + + + /** 组件类型(0单选框 1多选框) */ + @Excel(name = "组件类型", readConverterExp = "0=单选框,1=多选框") + private String compType; + + + /** 字段名 */ + @Excel(name = "字段名") + private String fieldName; + + + /** 占位提示 */ + @Excel(name = "占位提示") + private String placPrompt; + + + /** 默认值 */ + @Excel(name = "默认值") + private String defaultValue; + + + /** 可选值 */ + @Excel(name = "可选值") + private String optionalValue; + + /** 可选值数组 */ + @Excel(name = "可选值数组") + @TableField(exist = false) + private List> optionalValues = new ArrayList>(); + + /** 是否开放 */ + @Excel(name = "是否开放") + private String open; + + + /** 模版id */ + @Excel(name = "模版id") + private Long tempId; + + /** 排序 */ + @Excel(name = "排序") + private Integer sort; + + public void setTitle(String title) + { + this.title = title; + } + + public String getTitle() + { + return title; + } + public void setCompType(String compType) + { + this.compType = compType; + } + + public String getCompType() + { + return compType; + } + public void setFieldName(String fieldName) + { + this.fieldName = fieldName; + } + + public String getFieldName() + { + return fieldName; + } + public void setPlacPrompt(String placPrompt) + { + this.placPrompt = placPrompt; + } + + public String getPlacPrompt() + { + return placPrompt; + } + public void setDefaultValue(String defaultValue) + { + this.defaultValue = defaultValue; + } + + public String getDefaultValue() + { + return defaultValue; + } + public void setOptionalValue(String optionalValue) + { + if(StringUtils.isNotBlank(optionalValue)){ + String[] split = optionalValue.split("\\|"); + + for (String s : split) { + Map dataMap = new HashMap<>(); + String[] value = s.split(","); + dataMap.put("key",value[0]); + dataMap.put("value",value[1]); + this.optionalValues.add(dataMap); + } + + } + this.optionalValue = optionalValue; + } + + public String getOptionalValue() + { + return optionalValue; + } + public void setOpen(String open) + { + this.open = open; + } + + public String getOpen() + { + return open; + } + public void setTempId(Long tempId) + { + this.tempId = tempId; + } + + public Long getTempId() + { + return tempId; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("title", getTitle()) + .append("compType", getCompType()) + .append("fieldName", getFieldName()) + .append("placPrompt", getPlacPrompt()) + .append("defaultValue", getDefaultValue()) + .append("optionalValue", getOptionalValue()) + .append("open", getOpen()) + .append("tempId", getTempId()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("deleted", getDeleted()) + .append("remark", getRemark()) + .toString(); + } + +} diff --git a/ruoyi-business/src/main/java/com/ruoyi/business/domain/BusinessTemplatePropValue.java b/ruoyi-business/src/main/java/com/ruoyi/business/domain/BusinessTemplatePropValue.java new file mode 100644 index 0000000..6c08563 --- /dev/null +++ b/ruoyi-business/src/main/java/com/ruoyi/business/domain/BusinessTemplatePropValue.java @@ -0,0 +1,111 @@ +package com.ruoyi.business.domain; + +import lombok.Data; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * 模版属性值对象 business_template_prop_value + * + * @author ruoyi + * @date 2024-03-31 + */ +@Data +public class BusinessTemplatePropValue extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + + + /** 字段id */ + @Excel(name = "字段id") + private String propId; + + + /** 字段名称 */ + @Excel(name = "字段名称") + private String propName; + + + /** 字段类型 */ + @Excel(name = "字段类型") + private String propType; + + /** 值键 */ + @Excel(name = "值键") + private String valueKey; + + + /** 值描述 */ + @Excel(name = "值描述") + private String valueText; + + + /** 原值对象 */ + @Excel(name = "原值对象") + private String valueSources; + + + /** 试卷id */ + @Excel(name = "试卷id") + private String surveyId; + + + + + + public void setPropId(String propId) + { + this.propId = propId; + } + + public String getPropId() + { + return propId; + } + public void setPropName(String propName) + { + this.propName = propName; + } + + public String getPropName() + { + return propName; + } + public void setValueKey(String valueKey) + { + this.valueKey = valueKey; + } + + public String getValueKey() + { + return valueKey; + } + public void setValueText(String valueText) + { + this.valueText = valueText; + } + + public String getValueText() + { + return valueText; + } + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("propId", getPropId()) + .append("propName", getPropName()) + .append("valueKey", getValueKey()) + .append("valueText", getValueText()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("deleted", getDeleted()) + .append("remark", getRemark()) + .toString(); + } +} diff --git a/ruoyi-business/src/main/java/com/ruoyi/business/mapper/BusinessSurveyMapper.java b/ruoyi-business/src/main/java/com/ruoyi/business/mapper/BusinessSurveyMapper.java new file mode 100644 index 0000000..84296ce --- /dev/null +++ b/ruoyi-business/src/main/java/com/ruoyi/business/mapper/BusinessSurveyMapper.java @@ -0,0 +1,16 @@ +package com.ruoyi.business.mapper; + +import java.util.List; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.ruoyi.business.domain.BusinessSurvey; + +/** + * 调查问卷管理Mapper接口 + * + * @author ruoyi + * @date 2024-04-01 + */ +public interface BusinessSurveyMapper extends BaseMapper +{ + +} diff --git a/ruoyi-business/src/main/java/com/ruoyi/business/mapper/BusinessTemplateMapper.java b/ruoyi-business/src/main/java/com/ruoyi/business/mapper/BusinessTemplateMapper.java new file mode 100644 index 0000000..c6c907f --- /dev/null +++ b/ruoyi-business/src/main/java/com/ruoyi/business/mapper/BusinessTemplateMapper.java @@ -0,0 +1,16 @@ +package com.ruoyi.business.mapper; + +import java.util.List; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.ruoyi.business.domain.BusinessTemplate; + +/** + * 模版管理Mapper接口 + * + * @author ruoyi + * @date 2024-03-31 + */ +public interface BusinessTemplateMapper extends BaseMapper +{ + +} diff --git a/ruoyi-business/src/main/java/com/ruoyi/business/mapper/BusinessTemplatePropMapper.java b/ruoyi-business/src/main/java/com/ruoyi/business/mapper/BusinessTemplatePropMapper.java new file mode 100644 index 0000000..bc58dab --- /dev/null +++ b/ruoyi-business/src/main/java/com/ruoyi/business/mapper/BusinessTemplatePropMapper.java @@ -0,0 +1,16 @@ +package com.ruoyi.business.mapper; + +import java.util.List; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.ruoyi.business.domain.BusinessTemplateProp; + +/** + * 模版属性Mapper接口 + * + * @author ruoyi + * @date 2024-03-31 + */ +public interface BusinessTemplatePropMapper extends BaseMapper +{ + +} diff --git a/ruoyi-business/src/main/java/com/ruoyi/business/mapper/BusinessTemplatePropValueMapper.java b/ruoyi-business/src/main/java/com/ruoyi/business/mapper/BusinessTemplatePropValueMapper.java new file mode 100644 index 0000000..7bf8d14 --- /dev/null +++ b/ruoyi-business/src/main/java/com/ruoyi/business/mapper/BusinessTemplatePropValueMapper.java @@ -0,0 +1,23 @@ +package com.ruoyi.business.mapper; + +import java.util.List; +import java.util.Map; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.ruoyi.business.domain.BusinessTemplatePropValue; +import org.apache.ibatis.annotations.Param; + +/** + * 模版属性值Mapper接口 + * + * @author ruoyi + * @date 2024-03-31 + */ +public interface BusinessTemplatePropValueMapper extends BaseMapper +{ + /** + * 获取统计数据 + * @param surveyId + */ + List> countGroup(@Param("surveyId") String surveyId, @Param("propId") String propId); +} diff --git a/ruoyi-business/src/main/java/com/ruoyi/business/service/IBusinessSurveyService.java b/ruoyi-business/src/main/java/com/ruoyi/business/service/IBusinessSurveyService.java new file mode 100644 index 0000000..44df001 --- /dev/null +++ b/ruoyi-business/src/main/java/com/ruoyi/business/service/IBusinessSurveyService.java @@ -0,0 +1,22 @@ +package com.ruoyi.business.service; + +import java.util.List; +import com.ruoyi.business.domain.BusinessSurvey; +import com.baomidou.mybatisplus.extension.service.IService; +import com.ruoyi.common.core.domain.AjaxResult; + +/** + * 调查问卷管理Service接口 + * + * @author ruoyi + * @date 2024-04-01 + */ +public interface IBusinessSurveyService extends IService +{ + + /** + * 根据试卷获取题目 + * @param surveyId + */ + AjaxResult listBySurveyId(String surveyId); +} diff --git a/ruoyi-business/src/main/java/com/ruoyi/business/service/IBusinessTemplatePropService.java b/ruoyi-business/src/main/java/com/ruoyi/business/service/IBusinessTemplatePropService.java new file mode 100644 index 0000000..ca64766 --- /dev/null +++ b/ruoyi-business/src/main/java/com/ruoyi/business/service/IBusinessTemplatePropService.java @@ -0,0 +1,15 @@ +package com.ruoyi.business.service; + +import java.util.List; +import com.ruoyi.business.domain.BusinessTemplateProp; +import com.baomidou.mybatisplus.extension.service.IService; +/** + * 模版属性Service接口 + * + * @author ruoyi + * @date 2024-03-31 + */ +public interface IBusinessTemplatePropService extends IService +{ + +} diff --git a/ruoyi-business/src/main/java/com/ruoyi/business/service/IBusinessTemplatePropValueService.java b/ruoyi-business/src/main/java/com/ruoyi/business/service/IBusinessTemplatePropValueService.java new file mode 100644 index 0000000..702b92a --- /dev/null +++ b/ruoyi-business/src/main/java/com/ruoyi/business/service/IBusinessTemplatePropValueService.java @@ -0,0 +1,28 @@ +package com.ruoyi.business.service; + +import java.util.List; +import java.util.Map; + +import com.ruoyi.business.domain.BusinessTemplatePropValue; +import com.baomidou.mybatisplus.extension.service.IService; +/** + * 模版属性值Service接口 + * + * @author ruoyi + * @date 2024-03-31 + */ +public interface IBusinessTemplatePropValueService extends IService +{ + + /** + *获取统计数据 + * @param tempId + */ + Object countGroup(String tempId); + /** + * 批量写入值 + * @param data + * @return + */ + boolean addList(Map data); +} diff --git a/ruoyi-business/src/main/java/com/ruoyi/business/service/IBusinessTemplateService.java b/ruoyi-business/src/main/java/com/ruoyi/business/service/IBusinessTemplateService.java new file mode 100644 index 0000000..5efca6d --- /dev/null +++ b/ruoyi-business/src/main/java/com/ruoyi/business/service/IBusinessTemplateService.java @@ -0,0 +1,15 @@ +package com.ruoyi.business.service; + +import java.util.List; +import com.ruoyi.business.domain.BusinessTemplate; +import com.baomidou.mybatisplus.extension.service.IService; +/** + * 模版管理Service接口 + * + * @author ruoyi + * @date 2024-03-31 + */ +public interface IBusinessTemplateService extends IService +{ + +} diff --git a/ruoyi-business/src/main/java/com/ruoyi/business/service/impl/BusinessSurveyServiceImpl.java b/ruoyi-business/src/main/java/com/ruoyi/business/service/impl/BusinessSurveyServiceImpl.java new file mode 100644 index 0000000..9bfbd9d --- /dev/null +++ b/ruoyi-business/src/main/java/com/ruoyi/business/service/impl/BusinessSurveyServiceImpl.java @@ -0,0 +1,102 @@ +package com.ruoyi.business.service.impl; + +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import com.alibaba.fastjson2.JSONArray; +import com.alibaba.fastjson2.JSONObject; +import com.ruoyi.business.domain.BusinessTemplateProp; +import com.ruoyi.business.domain.BusinessTemplatePropValue; +import com.ruoyi.business.mapper.BusinessTemplatePropMapper; +import com.ruoyi.business.mapper.BusinessTemplatePropValueMapper; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.common.utils.SecurityUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.business.mapper.BusinessSurveyMapper; +import com.ruoyi.business.domain.BusinessSurvey; +import com.ruoyi.business.service.IBusinessSurveyService; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + +/** + * 调查问卷管理Service业务层处理 + * + * @author ruoyi + * @date 2024-04-01 + */ +@Service +public class BusinessSurveyServiceImpl extends ServiceImpl implements IBusinessSurveyService +{ + @Autowired + private BusinessTemplatePropMapper businessTemplatePropMapper; +@Autowired + private BusinessTemplatePropValueMapper businessTemplatePropValueMapper; + + /** + * 根据试卷获取题目 + * @param surveyId + * @return + */ + @Override + public AjaxResult listBySurveyId(String surveyId) { + BusinessSurvey businessSurvey = baseMapper.selectOne(new LambdaQueryWrapper().eq(BusinessSurvey::getId, surveyId)); + + List list = businessTemplatePropMapper.selectList(new LambdaQueryWrapper() + .eq(BusinessTemplateProp::getTempId, businessSurvey.getTempId()) + .orderByDesc(BusinessTemplateProp::getSort)); + + JSONObject jsonObject = new JSONObject(); + list.forEach(e -> { + BusinessTemplatePropValue one = businessTemplatePropValueMapper.selectOne(new LambdaQueryWrapper() + .eq(BusinessTemplatePropValue::getPropId, e.getId()) + .eq(BusinessTemplatePropValue::getSurveyId, surveyId) + .eq(BusinessTemplatePropValue::getCreateBy, SecurityUtils.getUsername())); + if (e.getCompType().equals("0")) { + jsonObject.put(e.getId(), Optional.ofNullable(one).orElse(new BusinessTemplatePropValue()).getValueSources()); + } + if (e.getCompType().equals("1")) { + String valueSources = Optional.ofNullable(one).orElse(new BusinessTemplatePropValue()).getValueSources(); + if(null != valueSources){ + List collect = Stream.of(valueSources.substring(1, valueSources.length() - 1).split(", ")).collect(Collectors.toList()); + jsonObject.put(e.getId(),collect); + }else{ + jsonObject.put(e.getId(),new ArrayList<>()); + } + } + if (e.getCompType().equals("2")) { + jsonObject.put(e.getId(), Optional.ofNullable(one).orElse(new BusinessTemplatePropValue()).getValueSources()); + } + if (e.getCompType().equals("3")) { + jsonObject.put(e.getId(), Optional.ofNullable(one).orElse(new BusinessTemplatePropValue()).getValueSources()); + } + if (e.getCompType().equals("4")) { + jsonObject.put(e.getId(), Optional.ofNullable(one).orElse(new BusinessTemplatePropValue()).getValueSources()); + } + if (e.getCompType().equals("5")) { + jsonObject.put(e.getId(), Optional.ofNullable(one).orElse(new BusinessTemplatePropValue()).getValueSources()); + } + if (e.getCompType().equals("6")) { + jsonObject.put(e.getId(), Optional.ofNullable(one).orElse(new BusinessTemplatePropValue()).getValueSources()); + } + if (e.getCompType().equals("7")) { + jsonObject.put(e.getId(), Optional.ofNullable(one).orElse(new BusinessTemplatePropValue()).getValueSources()); + } + if (e.getCompType().equals("8")) { + jsonObject.put(e.getId(), Optional.ofNullable(one).orElse(new BusinessTemplatePropValue()).getValueSources()); + } + if (e.getCompType().equals("9")) { + jsonObject.put(e.getId(), Optional.ofNullable(one).orElse(new BusinessTemplatePropValue()).getValueSources() == null ? new JSONArray() : Optional.ofNullable(one).orElse(new BusinessTemplatePropValue()).getValueSources()); + } + }); + AjaxResult success = AjaxResult.success(list); + success.put("form" , jsonObject); + return success; + + } +} diff --git a/ruoyi-business/src/main/java/com/ruoyi/business/service/impl/BusinessTemplatePropServiceImpl.java b/ruoyi-business/src/main/java/com/ruoyi/business/service/impl/BusinessTemplatePropServiceImpl.java new file mode 100644 index 0000000..abb5a99 --- /dev/null +++ b/ruoyi-business/src/main/java/com/ruoyi/business/service/impl/BusinessTemplatePropServiceImpl.java @@ -0,0 +1,27 @@ +package com.ruoyi.business.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.business.mapper.BusinessTemplatePropMapper; +import com.ruoyi.business.domain.BusinessTemplateProp; +import com.ruoyi.business.service.IBusinessTemplatePropService; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + +/** + * 模版属性Service业务层处理 + * + * @author ruoyi + * @date 2024-03-31 + */ +@Service +public class BusinessTemplatePropServiceImpl extends ServiceImpl implements IBusinessTemplatePropService +{ + @Autowired + private BusinessTemplatePropMapper businessTemplatePropMapper; + + +} diff --git a/ruoyi-business/src/main/java/com/ruoyi/business/service/impl/BusinessTemplatePropValueServiceImpl.java b/ruoyi-business/src/main/java/com/ruoyi/business/service/impl/BusinessTemplatePropValueServiceImpl.java new file mode 100644 index 0000000..a673410 --- /dev/null +++ b/ruoyi-business/src/main/java/com/ruoyi/business/service/impl/BusinessTemplatePropValueServiceImpl.java @@ -0,0 +1,149 @@ +package com.ruoyi.business.service.impl; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.atomic.AtomicReference; + +import com.alibaba.fastjson2.JSONArray; +import com.alibaba.fastjson2.JSONObject; +import com.ruoyi.business.domain.BusinessSurvey; +import com.ruoyi.business.domain.BusinessTemplate; +import com.ruoyi.business.domain.BusinessTemplateProp; +import com.ruoyi.business.mapper.BusinessSurveyMapper; +import com.ruoyi.business.mapper.BusinessTemplatePropMapper; +import com.ruoyi.business.service.IBusinessSurveyService; +import com.ruoyi.business.service.IBusinessTemplatePropService; +import com.ruoyi.business.service.IBusinessTemplateService; +import com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.common.utils.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.business.mapper.BusinessTemplatePropValueMapper; +import com.ruoyi.business.domain.BusinessTemplatePropValue; +import com.ruoyi.business.service.IBusinessTemplatePropValueService; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + +/** + * 模版属性值Service业务层处理 + * + * @author ruoyi + * @date 2024-03-31 + */ +@Service +public class BusinessTemplatePropValueServiceImpl extends ServiceImpl implements IBusinessTemplatePropValueService { + @Autowired + private BusinessTemplatePropValueMapper businessTemplatePropValueMapper; + + @Autowired + private IBusinessTemplateService businessTemplateService; + + @Autowired + private IBusinessTemplatePropService businessTemplatePropService; + + @Autowired + private IBusinessSurveyService businessSurveyService; + + + /** + * 获取统计数据 + * + * @param surveyId + * @return + */ + @Override + public Object countGroup(String surveyId) { + BusinessSurvey businessSurvey = businessSurveyService.lambdaQuery().eq(BusinessSurvey::getId, surveyId).one(); + + BusinessTemplate businessTemplate = businessTemplateService.lambdaQuery().eq(BusinessTemplate::getId, businessSurvey.getTempId()).one(); + + List businessTemplateProps = businessTemplatePropService.lambdaQuery() + .eq(BusinessTemplateProp::getTempId, businessTemplate.getId()).in(BusinessTemplateProp::getCompType, new String[]{"0" , "1" , "6"}).list(); + + JSONObject map = new JSONObject(); + List> list = new ArrayList<>(); + businessTemplateProps.forEach(e -> { + List> countList = businessTemplatePropValueMapper.countGroup(surveyId, e.getId()); + map.put(e.getTitle(), countList); + }); + + return map; + } + + /** + * 批量写入值 + * + * @param data + * @return + */ + @Override + public boolean addList(Map data) { + + // 试卷id + String surveyId = data.get("surveyId").toString(); + data.remove("surveyId"); + List datas = new ArrayList<>(); + data.forEach((k, v) -> { + BusinessTemplatePropValue businessTemplatePropValue = new BusinessTemplatePropValue(); + BusinessTemplateProp businessTemplateProp = businessTemplatePropService.getById(k); + List businessTemplatePropValues = businessTemplatePropValueMapper.selectList(new LambdaQueryWrapper() + .eq(BusinessTemplatePropValue::getPropId, k).eq(BusinessTemplatePropValue::getCreateBy, SecurityUtils.getUsername())); + + businessTemplatePropValues.forEach(e -> { + if (e.getPropId().equals(k)) { + businessTemplatePropValue.setId(e.getId()); + } + }); + businessTemplatePropValue.setPropName(businessTemplateProp.getFieldName()); + businessTemplatePropValue.setPropType(businessTemplateProp.getCompType()); + businessTemplatePropValue.setPropId(k); + businessTemplatePropValue.setValueKey(v.toString()); + if (businessTemplateProp.getCompType().equals("0")) { + String optionalValue = businessTemplateProp.getOptionalValue(); + String[] split = optionalValue.split("\\|"); + for (String v1 : split) { + String[] v2 = v1.split(","); + if (v2[0].equals(v)) { + businessTemplatePropValue.setValueText(v2[1]); + } + } + businessTemplatePropValue.setValueSources(v.toString()); + } else if (businessTemplateProp.getCompType().equals("1")) { + String optionalValue = businessTemplateProp.getOptionalValue(); + String[] split = optionalValue.split("\\|"); + StringBuilder sb = new StringBuilder(); + + for (String v1 : split) { + String[] v2 = v1.split(","); + if (((ArrayList) v).contains(v2[0])) { + sb.append(v2[1]).append(","); + } + } + businessTemplatePropValue.setValueText(sb.substring(0, sb.length() - 1)); + businessTemplatePropValue.setValueSources(v.toString()); + } else if (businessTemplateProp.getCompType().equals("6")) { + String optionalValue = businessTemplateProp.getOptionalValue(); + String[] split = optionalValue.split("\\|"); + StringBuilder sb = new StringBuilder(); + + for (String v1 : split) { + String[] v2 = v1.split(","); + if (v.equals(v2[0])) { + sb.append(v2[1]).append(","); + } + } + businessTemplatePropValue.setValueText(sb.substring(0, sb.length() - 1)); + businessTemplatePropValue.setValueSources(v.toString()); + } else { + businessTemplatePropValue.setValueText(v.toString()); + businessTemplatePropValue.setValueSources(v.toString()); + } + businessTemplatePropValue.setSurveyId(surveyId); + datas.add(businessTemplatePropValue); + }); + + return saveOrUpdateBatch(datas); + } +} diff --git a/ruoyi-business/src/main/java/com/ruoyi/business/service/impl/BusinessTemplateServiceImpl.java b/ruoyi-business/src/main/java/com/ruoyi/business/service/impl/BusinessTemplateServiceImpl.java new file mode 100644 index 0000000..41294b4 --- /dev/null +++ b/ruoyi-business/src/main/java/com/ruoyi/business/service/impl/BusinessTemplateServiceImpl.java @@ -0,0 +1,27 @@ +package com.ruoyi.business.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.business.mapper.BusinessTemplateMapper; +import com.ruoyi.business.domain.BusinessTemplate; +import com.ruoyi.business.service.IBusinessTemplateService; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + +/** + * 模版管理Service业务层处理 + * + * @author ruoyi + * @date 2024-03-31 + */ +@Service +public class BusinessTemplateServiceImpl extends ServiceImpl implements IBusinessTemplateService +{ + @Autowired + private BusinessTemplateMapper businessTemplateMapper; + + +} diff --git a/ruoyi-business/src/main/resources/mapper/business/BusinessSurveyMapper.xml b/ruoyi-business/src/main/resources/mapper/business/BusinessSurveyMapper.xml new file mode 100644 index 0000000..5acaf12 --- /dev/null +++ b/ruoyi-business/src/main/resources/mapper/business/BusinessSurveyMapper.xml @@ -0,0 +1,95 @@ + + + + + + + + + + + + + + + + + + + + select id, title, context, temp_id, open, create_by, create_time, update_by, update_time, deleted, remark from business_survey + + + + + + + + insert into business_survey + + title, + context, + temp_id, + open, + create_by, + create_time, + update_by, + update_time, + deleted, + remark, + + + #{title}, + #{context}, + #{tempId}, + #{open}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + #{deleted}, + #{remark}, + + + + + update business_survey + + title = #{title}, + context = #{context}, + temp_id = #{tempId}, + open = #{open}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + deleted = #{deleted}, + remark = #{remark}, + + where id = #{id} + + + + delete from business_survey where id = #{id} + + + + delete from business_survey where id in + + #{id} + + + \ No newline at end of file diff --git a/ruoyi-business/src/main/resources/mapper/business/BusinessTemplateMapper.xml b/ruoyi-business/src/main/resources/mapper/business/BusinessTemplateMapper.xml new file mode 100644 index 0000000..9322834 --- /dev/null +++ b/ruoyi-business/src/main/resources/mapper/business/BusinessTemplateMapper.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + select id, title, context, open, create_by, create_time, update_by, update_time, deleted, remark from business_template + + + + + + + + insert into business_template + + title, + context, + open, + create_by, + create_time, + update_by, + update_time, + deleted, + remark, + + + #{title}, + #{context}, + #{open}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + #{deleted}, + #{remark}, + + + + + update business_template + + title = #{title}, + context = #{context}, + open = #{open}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + deleted = #{deleted}, + remark = #{remark}, + + where id = #{id} + + + + delete from business_template where id = #{id} + + + + delete from business_template where id in + + #{id} + + + \ No newline at end of file diff --git a/ruoyi-business/src/main/resources/mapper/business/BusinessTemplatePropMapper.xml b/ruoyi-business/src/main/resources/mapper/business/BusinessTemplatePropMapper.xml new file mode 100644 index 0000000..29ae31b --- /dev/null +++ b/ruoyi-business/src/main/resources/mapper/business/BusinessTemplatePropMapper.xml @@ -0,0 +1,115 @@ + + + + + + + + + + + + + + + + + + + + + + + + select id, title, comp_type, field_name, plac_prompt, default_value, optional_value, open, temp_id, create_by, create_time, update_by, update_time, deleted, remark from business_template_prop + + + + + + + + insert into business_template_prop + + title, + comp_type, + field_name, + plac_prompt, + default_value, + optional_value, + open, + temp_id, + create_by, + create_time, + update_by, + update_time, + deleted, + remark, + + + #{title}, + #{compType}, + #{fieldName}, + #{placPrompt}, + #{defaultValue}, + #{optionalValue}, + #{open}, + #{tempId}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + #{deleted}, + #{remark}, + + + + + update business_template_prop + + title = #{title}, + comp_type = #{compType}, + field_name = #{fieldName}, + plac_prompt = #{placPrompt}, + default_value = #{defaultValue}, + optional_value = #{optionalValue}, + open = #{open}, + temp_id = #{tempId}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + deleted = #{deleted}, + remark = #{remark}, + + where id = #{id} + + + + delete from business_template_prop where id = #{id} + + + + delete from business_template_prop where id in + + #{id} + + + \ No newline at end of file diff --git a/ruoyi-business/src/main/resources/mapper/business/BusinessTemplatePropValueMapper.xml b/ruoyi-business/src/main/resources/mapper/business/BusinessTemplatePropValueMapper.xml new file mode 100644 index 0000000..1c39d13 --- /dev/null +++ b/ruoyi-business/src/main/resources/mapper/business/BusinessTemplatePropValueMapper.xml @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + + + select id, prop_id, prop_name, value_key, value_text, temp_id, create_by, create_time, update_by, update_time, deleted, remark from business_template_prop_value + + + + + + + + + + + insert into business_template_prop_value + + prop_id, + prop_name, + value_key, + value_text, + temp_id, + create_by, + create_time, + update_by, + update_time, + deleted, + remark, + + + #{propId}, + #{propName}, + #{valueKey}, + #{valueText}, + #{tempId}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + #{deleted}, + #{remark}, + + + + + update business_template_prop_value + + prop_id = #{propId}, + prop_name = #{propName}, + value_key = #{valueKey}, + value_text = #{valueText}, + temp_id = #{tempId}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + deleted = #{deleted}, + remark = #{remark}, + + where id = #{id} + + + + delete from business_template_prop_value where id = #{id} + + + + delete from business_template_prop_value where id in + + #{id} + + + \ No newline at end of file diff --git a/ruoyi-common/pom.xml b/ruoyi-common/pom.xml new file mode 100644 index 0000000..6eadd0b --- /dev/null +++ b/ruoyi-common/pom.xml @@ -0,0 +1,148 @@ + + + + ruoyi + com.ruoyi + 3.8.5 + + 4.0.0 + + ruoyi-common + + + common通用工具 + + + + + + + org.springframework + spring-context-support + + + + + org.springframework + spring-web + + + + + org.springframework.boot + spring-boot-starter-security + + + + + com.github.pagehelper + pagehelper-spring-boot-starter + + + + + org.springframework.boot + spring-boot-starter-validation + + + + + org.apache.commons + commons-lang3 + + + + + com.fasterxml.jackson.core + jackson-databind + + + + + com.baomidou + dynamic-datasource-spring-boot-starter + 3.5.2 + + + + + com.alibaba.fastjson2 + fastjson2 + + + + + commons-io + commons-io + + + + + commons-fileupload + commons-fileupload + + + + + org.apache.poi + poi-ooxml + + + + + org.yaml + snakeyaml + + + + + io.jsonwebtoken + jjwt + + + + + javax.xml.bind + jaxb-api + + + + + org.springframework.boot + spring-boot-starter-data-redis + + + + + org.apache.commons + commons-pool2 + + + + + eu.bitwalker + UserAgentUtils + + + + + javax.servlet + javax.servlet-api + + + + + com.baomidou + mybatis-plus-boot-starter + 3.4.2 + + + org.projectlombok + lombok + 1.18.10 + + + + \ No newline at end of file diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/annotation/Anonymous.java b/ruoyi-common/src/main/java/com/ruoyi/common/annotation/Anonymous.java new file mode 100644 index 0000000..b58f81b --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/annotation/Anonymous.java @@ -0,0 +1,19 @@ +package com.ruoyi.common.annotation; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * 匿名访问不鉴权注解 + * + * @author #author# + */ +@Target({ ElementType.METHOD, ElementType.TYPE }) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface Anonymous +{ +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/annotation/DataScope.java b/ruoyi-common/src/main/java/com/ruoyi/common/annotation/DataScope.java new file mode 100644 index 0000000..c05a69f --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/annotation/DataScope.java @@ -0,0 +1,33 @@ +package com.ruoyi.common.annotation; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * 数据权限过滤注解 + * + * @author #author# + */ +@Target(ElementType.METHOD) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface DataScope +{ + /** + * 部门表的别名 + */ + public String deptAlias() default ""; + + /** + * 用户表的别名 + */ + public String userAlias() default ""; + + /** + * 权限字符(用于多个角色匹配符合要求的权限)默认根据权限注解@ss获取,多个权限用逗号分隔开来 + */ + public String permission() default ""; +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/annotation/DataSource.java b/ruoyi-common/src/main/java/com/ruoyi/common/annotation/DataSource.java new file mode 100644 index 0000000..c1096dc --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/annotation/DataSource.java @@ -0,0 +1,28 @@ +package com.ruoyi.common.annotation; + +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; +import com.ruoyi.common.enums.DataSourceType; + +/** + * 自定义多数据源切换注解 + * + * 优先级:先方法,后类,如果方法覆盖了类上的数据源类型,以方法的为准,否则以类上的为准 + * + * @author #author# + */ +@Target({ ElementType.METHOD, ElementType.TYPE }) +@Retention(RetentionPolicy.RUNTIME) +@Documented +@Inherited +public @interface DataSource +{ + /** + * 切换数据源名称 + */ + public DataSourceType value() default DataSourceType.MASTER; +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/annotation/Excel.java b/ruoyi-common/src/main/java/com/ruoyi/common/annotation/Excel.java new file mode 100644 index 0000000..be51417 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/annotation/Excel.java @@ -0,0 +1,187 @@ +package com.ruoyi.common.annotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; +import java.math.BigDecimal; +import org.apache.poi.ss.usermodel.HorizontalAlignment; +import org.apache.poi.ss.usermodel.IndexedColors; +import com.ruoyi.common.utils.poi.ExcelHandlerAdapter; + +/** + * 自定义导出Excel数据注解 + * + * @author #author# + */ +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.FIELD) +public @interface Excel +{ + /** + * 导出时在excel中排序 + */ + public int sort() default Integer.MAX_VALUE; + + /** + * 导出到Excel中的名字. + */ + public String name() default ""; + + /** + * 日期格式, 如: yyyy-MM-dd + */ + public String dateFormat() default ""; + + /** + * 如果是字典类型,请设置字典的type值 (如: sys_user_sex) + */ + public String dictType() default ""; + + /** + * 读取内容转表达式 (如: 0=男,1=女,2=未知) + */ + public String readConverterExp() default ""; + + /** + * 分隔符,读取字符串组内容 + */ + public String separator() default ","; + + /** + * BigDecimal 精度 默认:-1(默认不开启BigDecimal格式化) + */ + public int scale() default -1; + + /** + * BigDecimal 舍入规则 默认:BigDecimal.ROUND_HALF_EVEN + */ + public int roundingMode() default BigDecimal.ROUND_HALF_EVEN; + + /** + * 导出时在excel中每个列的高度 单位为字符 + */ + public double height() default 14; + + /** + * 导出时在excel中每个列的宽 单位为字符 + */ + public double width() default 16; + + /** + * 文字后缀,如% 90 变成90% + */ + public String suffix() default ""; + + /** + * 当值为空时,字段的默认值 + */ + public String defaultValue() default ""; + + /** + * 提示信息 + */ + public String prompt() default ""; + + /** + * 设置只能选择不能输入的列内容. + */ + public String[] combo() default {}; + + /** + * 是否需要纵向合并单元格,应对需求:含有list集合单元格) + */ + public boolean needMerge() default false; + + /** + * 是否导出数据,应对需求:有时我们需要导出一份模板,这是标题需要但内容需要用户手工填写. + */ + public boolean isExport() default true; + + /** + * 另一个类中的属性名称,支持多级获取,以小数点隔开 + */ + public String targetAttr() default ""; + + /** + * 是否自动统计数据,在最后追加一行统计数据总和 + */ + public boolean isStatistics() default false; + + /** + * 导出类型(0数字 1字符串 2图片) + */ + public ColumnType cellType() default ColumnType.STRING; + + /** + * 导出列头背景色 + */ + public IndexedColors headerBackgroundColor() default IndexedColors.GREY_50_PERCENT; + + /** + * 导出列头字体颜色 + */ + public IndexedColors headerColor() default IndexedColors.WHITE; + + /** + * 导出单元格背景色 + */ + public IndexedColors backgroundColor() default IndexedColors.WHITE; + + /** + * 导出单元格字体颜色 + */ + public IndexedColors color() default IndexedColors.BLACK; + + /** + * 导出字段对齐方式 + */ + public HorizontalAlignment align() default HorizontalAlignment.CENTER; + + /** + * 自定义数据处理器 + */ + public Class handler() default ExcelHandlerAdapter.class; + + /** + * 自定义数据处理器参数 + */ + public String[] args() default {}; + + /** + * 字段类型(0:导出导入;1:仅导出;2:仅导入) + */ + Type type() default Type.ALL; + + public enum Type + { + ALL(0), EXPORT(1), IMPORT(2); + private final int value; + + Type(int value) + { + this.value = value; + } + + public int value() + { + return this.value; + } + } + + public enum ColumnType + { + NUMERIC(0), STRING(1), IMAGE(2); + private final int value; + + ColumnType(int value) + { + this.value = value; + } + + public int value() + { + return this.value; + } + } +} \ No newline at end of file diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/annotation/Excels.java b/ruoyi-common/src/main/java/com/ruoyi/common/annotation/Excels.java new file mode 100644 index 0000000..512d59a --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/annotation/Excels.java @@ -0,0 +1,18 @@ +package com.ruoyi.common.annotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Excel注解集 + * + * @author #author# + */ +@Target(ElementType.FIELD) +@Retention(RetentionPolicy.RUNTIME) +public @interface Excels +{ + public Excel[] value(); +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/annotation/Log.java b/ruoyi-common/src/main/java/com/ruoyi/common/annotation/Log.java new file mode 100644 index 0000000..e7a126e --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/annotation/Log.java @@ -0,0 +1,46 @@ +package com.ruoyi.common.annotation; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.common.enums.OperatorType; + +/** + * 自定义操作日志记录注解 + * + * @author #author# + * + */ +@Target({ ElementType.PARAMETER, ElementType.METHOD }) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface Log +{ + /** + * 模块 + */ + public String title() default ""; + + /** + * 功能 + */ + public BusinessType businessType() default BusinessType.OTHER; + + /** + * 操作人类别 + */ + public OperatorType operatorType() default OperatorType.MANAGE; + + /** + * 是否保存请求的参数 + */ + public boolean isSaveRequestData() default true; + + /** + * 是否保存响应的参数 + */ + public boolean isSaveResponseData() default true; +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/annotation/RateLimiter.java b/ruoyi-common/src/main/java/com/ruoyi/common/annotation/RateLimiter.java new file mode 100644 index 0000000..ec2c4e5 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/annotation/RateLimiter.java @@ -0,0 +1,40 @@ +package com.ruoyi.common.annotation; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; +import com.ruoyi.common.constant.CacheConstants; +import com.ruoyi.common.enums.LimitType; + +/** + * 限流注解 + * + * @author #author# + */ +@Target(ElementType.METHOD) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface RateLimiter +{ + /** + * 限流key + */ + public String key() default CacheConstants.RATE_LIMIT_KEY; + + /** + * 限流时间,单位秒 + */ + public int time() default 60; + + /** + * 限流次数 + */ + public int count() default 100; + + /** + * 限流类型 + */ + public LimitType limitType() default LimitType.DEFAULT; +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/annotation/RepeatSubmit.java b/ruoyi-common/src/main/java/com/ruoyi/common/annotation/RepeatSubmit.java new file mode 100644 index 0000000..c2babc5 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/annotation/RepeatSubmit.java @@ -0,0 +1,31 @@ +package com.ruoyi.common.annotation; + +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 #author# + * + */ +@Inherited +@Target(ElementType.METHOD) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface RepeatSubmit +{ + /** + * 间隔时间(ms),小于此时间视为重复提交 + */ + public int interval() default 5000; + + /** + * 提示消息 + */ + public String message() default "不允许重复提交,请稍候再试"; +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/config/RuoYiConfig.java b/ruoyi-common/src/main/java/com/ruoyi/common/config/RuoYiConfig.java new file mode 100644 index 0000000..c33156d --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/config/RuoYiConfig.java @@ -0,0 +1,135 @@ +package com.ruoyi.common.config; + +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.stereotype.Component; + +/** + * 读取项目相关配置 + * + * @author #author# + */ +@Component +@ConfigurationProperties(prefix = "ruoyi") +public class RuoYiConfig +{ + /** 项目名称 */ + private String name; + + /** 版本 */ + private String version; + + /** 版权年份 */ + private String copyrightYear; + + /** 实例演示开关 */ + private boolean demoEnabled; + + /** 上传路径 */ + private static String profile; + + /** 获取地址开关 */ + private static boolean addressEnabled; + + /** 验证码类型 */ + private static String captchaType; + + public String getName() + { + return name; + } + + public void setName(String name) + { + this.name = name; + } + + public String getVersion() + { + return version; + } + + public void setVersion(String version) + { + this.version = version; + } + + public String getCopyrightYear() + { + return copyrightYear; + } + + public void setCopyrightYear(String copyrightYear) + { + this.copyrightYear = copyrightYear; + } + + public boolean isDemoEnabled() + { + return demoEnabled; + } + + public void setDemoEnabled(boolean demoEnabled) + { + this.demoEnabled = demoEnabled; + } + + public static String getProfile() + { + return profile; + } + + public void setProfile(String profile) + { + RuoYiConfig.profile = profile; + } + + public static boolean isAddressEnabled() + { + return addressEnabled; + } + + public void setAddressEnabled(boolean addressEnabled) + { + RuoYiConfig.addressEnabled = addressEnabled; + } + + public static String getCaptchaType() { + return captchaType; + } + + public void setCaptchaType(String captchaType) { + RuoYiConfig.captchaType = captchaType; + } + + /** + * 获取导入上传路径 + */ + public static String getImportPath() + { + return getProfile() + "/import"; + } + + /** + * 获取头像上传路径 + */ + public static String getAvatarPath() + { + return getProfile() + "/avatar"; + } + + /** + * 获取下载路径 + */ + public static String getDownloadPath() + { + return getProfile() + "/download/"; + } + + /** + * 获取上传路径 + */ + public static String getUploadPath() + { + return getProfile() + "/upload"; + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/constant/CacheConstants.java b/ruoyi-common/src/main/java/com/ruoyi/common/constant/CacheConstants.java new file mode 100644 index 0000000..990670d --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/constant/CacheConstants.java @@ -0,0 +1,44 @@ +package com.ruoyi.common.constant; + +/** + * 缓存的key 常量 + * + * @author #author# + */ +public class CacheConstants +{ + /** + * 登录用户 redis key + */ + public static final String LOGIN_TOKEN_KEY = "login_tokens:"; + + /** + * 验证码 redis key + */ + public static final String CAPTCHA_CODE_KEY = "captcha_codes:"; + + /** + * 参数管理 cache key + */ + public static final String SYS_CONFIG_KEY = "sys_config:"; + + /** + * 字典管理 cache key + */ + public static final String SYS_DICT_KEY = "sys_dict:"; + + /** + * 防重提交 redis key + */ + public static final String REPEAT_SUBMIT_KEY = "repeat_submit:"; + + /** + * 限流 redis key + */ + public static final String RATE_LIMIT_KEY = "rate_limit:"; + + /** + * 登录账户密码错误次数 redis key + */ + public static final String PWD_ERR_CNT_KEY = "pwd_err_cnt:"; +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/constant/Constants.java b/ruoyi-common/src/main/java/com/ruoyi/common/constant/Constants.java new file mode 100644 index 0000000..1dfeef8 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/constant/Constants.java @@ -0,0 +1,142 @@ +package com.ruoyi.common.constant; + +import io.jsonwebtoken.Claims; + +/** + * 通用常量信息 + * + * @author #author# + */ +public class Constants +{ + /** + * UTF-8 字符集 + */ + public static final String UTF8 = "UTF-8"; + + /** + * GBK 字符集 + */ + public static final String GBK = "GBK"; + + /** + * www主域 + */ + public static final String WWW = "www."; + + /** + * http请求 + */ + public static final String HTTP = "http://"; + + /** + * https请求 + */ + public static final String HTTPS = "https://"; + + /** + * 通用成功标识 + */ + public static final String SUCCESS = "0"; + + /** + * 通用失败标识 + */ + public static final String FAIL = "1"; + + /** + * 登录成功 + */ + public static final String LOGIN_SUCCESS = "Success"; + + /** + * 注销 + */ + public static final String LOGOUT = "Logout"; + + /** + * 注册 + */ + public static final String REGISTER = "Register"; + + /** + * 登录失败 + */ + public static final String LOGIN_FAIL = "Error"; + + /** + * 验证码有效期(分钟) + */ + public static final Integer CAPTCHA_EXPIRATION = 2; + + /** + * 令牌 + */ + public static final String TOKEN = "token"; + + /** + * 令牌前缀 + */ + public static final String TOKEN_PREFIX = "Bearer "; + + /** + * 令牌前缀 + */ + public static final String LOGIN_USER_KEY = "login_user_key"; + + /** + * 用户ID + */ + public static final String JWT_USERID = "userid"; + + /** + * 用户名称 + */ + public static final String JWT_USERNAME = Claims.SUBJECT; + + /** + * 用户头像 + */ + public static final String JWT_AVATAR = "avatar"; + + /** + * 创建时间 + */ + public static final String JWT_CREATED = "created"; + + /** + * 用户权限 + */ + public static final String JWT_AUTHORITIES = "authorities"; + + /** + * 资源映射路径 前缀 + */ + public static final String RESOURCE_PREFIX = "/profile"; + + /** + * RMI 远程方法调用 + */ + public static final String LOOKUP_RMI = "rmi:"; + + /** + * LDAP 远程方法调用 + */ + public static final String LOOKUP_LDAP = "ldap:"; + + /** + * LDAPS 远程方法调用 + */ + public static final String LOOKUP_LDAPS = "ldaps:"; + + /** + * 定时任务白名单配置(仅允许访问的包名,如其他需要可以自行添加) + */ + public static final String[] JOB_WHITELIST_STR = { "com.ruoyi" }; + + /** + * 定时任务违规的字符 + */ + public static final String[] JOB_ERROR_STR = { "java.net.URL", "javax.naming.InitialContext", "org.yaml.snakeyaml", + "org.springframework", "org.apache", "com.ruoyi.common.utils.file", "com.ruoyi.common.config" }; +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/constant/GenConstants.java b/ruoyi-common/src/main/java/com/ruoyi/common/constant/GenConstants.java new file mode 100644 index 0000000..fac4a44 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/constant/GenConstants.java @@ -0,0 +1,117 @@ +package com.ruoyi.common.constant; + +/** + * 代码生成通用常量 + * + * @author #author# + */ +public class GenConstants +{ + /** 单表(增删改查) */ + public static final String TPL_CRUD = "crud"; + + /** 树表(增删改查) */ + public static final String TPL_TREE = "tree"; + + /** 主子表(增删改查) */ + public static final String TPL_SUB = "sub"; + + /** 树编码字段 */ + public static final String TREE_CODE = "treeCode"; + + /** 树父编码字段 */ + public static final String TREE_PARENT_CODE = "treeParentCode"; + + /** 树名称字段 */ + public static final String TREE_NAME = "treeName"; + + /** 上级菜单ID字段 */ + public static final String PARENT_MENU_ID = "parentMenuId"; + + /** 上级菜单名称字段 */ + public static final String PARENT_MENU_NAME = "parentMenuName"; + + /** 数据库字符串类型 */ + public static final String[] COLUMNTYPE_STR = { "char", "varchar", "nvarchar", "varchar2" }; + + /** 数据库文本类型 */ + public static final String[] COLUMNTYPE_TEXT = { "tinytext", "text", "mediumtext", "longtext" }; + + /** 数据库时间类型 */ + public static final String[] COLUMNTYPE_TIME = { "datetime", "time", "date", "timestamp" }; + + /** 数据库数字类型 */ + public static final String[] COLUMNTYPE_NUMBER = { "tinyint", "smallint", "mediumint", "int", "number", "integer", + "bit", "bigint", "float", "double", "decimal" }; + + /** 页面不需要编辑字段 */ + public static final String[] COLUMNNAME_NOT_EDIT = { "id", "create_by", "create_time", "del_flag" }; + + /** 页面不需要显示的列表字段 */ + public static final String[] COLUMNNAME_NOT_LIST = { "id", "create_by", "create_time", "del_flag", "update_by", + "update_time" }; + + /** 页面不需要查询字段 */ + public static final String[] COLUMNNAME_NOT_QUERY = { "id", "create_by", "create_time", "del_flag", "update_by", + "update_time", "remark" }; + + /** Entity基类字段 */ + public static final String[] BASE_ENTITY = { "createBy", "createTime", "updateBy", "updateTime", "remark" }; + + /** Tree基类字段 */ + public static final String[] TREE_ENTITY = { "parentName", "parentId", "orderNum", "ancestors", "children" }; + + /** 文本框 */ + public static final String HTML_INPUT = "input"; + + /** 文本域 */ + public static final String HTML_TEXTAREA = "textarea"; + + /** 下拉框 */ + public static final String HTML_SELECT = "select"; + + /** 单选框 */ + public static final String HTML_RADIO = "radio"; + + /** 复选框 */ + public static final String HTML_CHECKBOX = "checkbox"; + + /** 日期控件 */ + public static final String HTML_DATETIME = "datetime"; + + /** 图片上传控件 */ + public static final String HTML_IMAGE_UPLOAD = "imageUpload"; + + /** 文件上传控件 */ + public static final String HTML_FILE_UPLOAD = "fileUpload"; + + /** 富文本控件 */ + public static final String HTML_EDITOR = "editor"; + + /** 字符串类型 */ + public static final String TYPE_STRING = "String"; + + /** 整型 */ + public static final String TYPE_INTEGER = "Integer"; + + /** 长整型 */ + public static final String TYPE_LONG = "Long"; + + /** 浮点型 */ + public static final String TYPE_DOUBLE = "Double"; + + /** 高精度计算类型 */ + public static final String TYPE_BIGDECIMAL = "BigDecimal"; + + /** 时间类型 */ + public static final String TYPE_DATE = "Date"; + + /** 模糊查询 */ + public static final String QUERY_LIKE = "LIKE"; + + /** 相等查询 */ + public static final String QUERY_EQ = "EQ"; + + /** 需要 */ + public static final String REQUIRE = "1"; +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/constant/HttpStatus.java b/ruoyi-common/src/main/java/com/ruoyi/common/constant/HttpStatus.java new file mode 100644 index 0000000..77d016c --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/constant/HttpStatus.java @@ -0,0 +1,94 @@ +package com.ruoyi.common.constant; + +/** + * 返回状态码 + * + * @author #author# + */ +public class HttpStatus +{ + /** + * 操作成功 + */ + public static final int SUCCESS = 200; + + /** + * 对象创建成功 + */ + public static final int CREATED = 201; + + /** + * 请求已经被接受 + */ + public static final int ACCEPTED = 202; + + /** + * 操作已经执行成功,但是没有返回数据 + */ + public static final int NO_CONTENT = 204; + + /** + * 资源已被移除 + */ + public static final int MOVED_PERM = 301; + + /** + * 重定向 + */ + public static final int SEE_OTHER = 303; + + /** + * 资源没有被修改 + */ + public static final int NOT_MODIFIED = 304; + + /** + * 参数列表错误(缺少,格式不匹配) + */ + public static final int BAD_REQUEST = 400; + + /** + * 未授权 + */ + public static final int UNAUTHORIZED = 401; + + /** + * 访问受限,授权过期 + */ + public static final int FORBIDDEN = 403; + + /** + * 资源,服务未找到 + */ + public static final int NOT_FOUND = 404; + + /** + * 不允许的http方法 + */ + public static final int BAD_METHOD = 405; + + /** + * 资源冲突,或者资源被锁 + */ + public static final int CONFLICT = 409; + + /** + * 不支持的数据,媒体类型 + */ + public static final int UNSUPPORTED_TYPE = 415; + + /** + * 系统内部错误 + */ + public static final int ERROR = 500; + + /** + * 接口未实现 + */ + public static final int NOT_IMPLEMENTED = 501; + + /** + * 系统警告消息 + */ + public static final int WARN = 601; +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/constant/ScheduleConstants.java b/ruoyi-common/src/main/java/com/ruoyi/common/constant/ScheduleConstants.java new file mode 100644 index 0000000..bc608c4 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/constant/ScheduleConstants.java @@ -0,0 +1,50 @@ +package com.ruoyi.common.constant; + +/** + * 任务调度通用常量 + * + * @author #author# + */ +public class ScheduleConstants +{ + public static final String TASK_CLASS_NAME = "TASK_CLASS_NAME"; + + /** 执行目标key */ + public static final String TASK_PROPERTIES = "TASK_PROPERTIES"; + + /** 默认 */ + public static final String MISFIRE_DEFAULT = "0"; + + /** 立即触发执行 */ + public static final String MISFIRE_IGNORE_MISFIRES = "1"; + + /** 触发一次执行 */ + public static final String MISFIRE_FIRE_AND_PROCEED = "2"; + + /** 不触发立即执行 */ + public static final String MISFIRE_DO_NOTHING = "3"; + + public enum Status + { + /** + * 正常 + */ + NORMAL("0"), + /** + * 暂停 + */ + PAUSE("1"); + + private String value; + + private Status(String value) + { + this.value = value; + } + + public String getValue() + { + return value; + } + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/constant/UserConstants.java b/ruoyi-common/src/main/java/com/ruoyi/common/constant/UserConstants.java new file mode 100644 index 0000000..0f9f99b --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/constant/UserConstants.java @@ -0,0 +1,78 @@ +package com.ruoyi.common.constant; + +/** + * 用户常量信息 + * + * @author #author# + */ +public class UserConstants +{ + /** + * 平台内系统用户的唯一标志 + */ + public static final String SYS_USER = "SYS_USER"; + + /** 正常状态 */ + public static final String NORMAL = "0"; + + /** 异常状态 */ + public static final String EXCEPTION = "1"; + + /** 用户封禁状态 */ + public static final String USER_DISABLE = "1"; + + /** 角色封禁状态 */ + public static final String ROLE_DISABLE = "1"; + + /** 部门正常状态 */ + public static final String DEPT_NORMAL = "0"; + + /** 部门停用状态 */ + public static final String DEPT_DISABLE = "1"; + + /** 字典正常状态 */ + public static final String DICT_NORMAL = "0"; + + /** 是否为系统默认(是) */ + public static final String YES = "Y"; + + /** 是否菜单外链(是) */ + public static final String YES_FRAME = "0"; + + /** 是否菜单外链(否) */ + public static final String NO_FRAME = "1"; + + /** 菜单类型(目录) */ + public static final String TYPE_DIR = "M"; + + /** 菜单类型(菜单) */ + public static final String TYPE_MENU = "C"; + + /** 菜单类型(按钮) */ + public static final String TYPE_BUTTON = "F"; + + /** Layout组件标识 */ + public final static String LAYOUT = "Layout"; + + /** ParentView组件标识 */ + public final static String PARENT_VIEW = "ParentView"; + + /** InnerLink组件标识 */ + public final static String INNER_LINK = "InnerLink"; + + /** 校验返回结果码 */ + public final static String UNIQUE = "0"; + public final static String NOT_UNIQUE = "1"; + + /** + * 用户名长度限制 + */ + public static final int USERNAME_MIN_LENGTH = 2; + public static final int USERNAME_MAX_LENGTH = 20; + + /** + * 密码长度限制 + */ + public static final int PASSWORD_MIN_LENGTH = 5; + public static final int PASSWORD_MAX_LENGTH = 20; +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/controller/BaseController.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/controller/BaseController.java new file mode 100644 index 0000000..6854a2b --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/controller/BaseController.java @@ -0,0 +1,202 @@ +package com.ruoyi.common.core.controller; + +import java.beans.PropertyEditorSupport; +import java.util.Date; +import java.util.List; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.web.bind.WebDataBinder; +import org.springframework.web.bind.annotation.InitBinder; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.ruoyi.common.constant.HttpStatus; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.domain.model.LoginUser; +import com.ruoyi.common.core.page.PageDomain; +import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.common.core.page.TableSupport; +import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.common.utils.PageUtils; +import com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.common.utils.sql.SqlUtil; + +/** + * web层通用数据处理 + * + * @author #author# + */ +public class BaseController +{ + protected final Logger logger = LoggerFactory.getLogger(this.getClass()); + + /** + * 将前台传递过来的日期格式的字符串,自动转化为Date类型 + */ + @InitBinder + public void initBinder(WebDataBinder binder) + { + // Date 类型转换 + binder.registerCustomEditor(Date.class, new PropertyEditorSupport() + { + @Override + public void setAsText(String text) + { + setValue(DateUtils.parseDate(text)); + } + }); + } + + /** + * 设置请求分页数据 + */ + protected void startPage() + { + PageUtils.startPage(); + } + + /** + * 设置请求排序数据 + */ + protected void startOrderBy() + { + PageDomain pageDomain = TableSupport.buildPageRequest(); + if (StringUtils.isNotEmpty(pageDomain.getOrderBy())) + { + String orderBy = SqlUtil.escapeOrderBySql(pageDomain.getOrderBy()); + PageHelper.orderBy(orderBy); + } + } + + /** + * 清理分页的线程变量 + */ + protected void clearPage() + { + PageUtils.clearPage(); + } + + /** + * 响应请求分页数据 + */ + @SuppressWarnings({ "rawtypes", "unchecked" }) + protected TableDataInfo getDataTable(List list) + { + TableDataInfo rspData = new TableDataInfo(); + rspData.setCode(HttpStatus.SUCCESS); + rspData.setMsg("查询成功"); + rspData.setRows(list); + rspData.setTotal(new PageInfo(list).getTotal()); + return rspData; + } + + /** + * 返回成功 + */ + public AjaxResult success() + { + return AjaxResult.success(); + } + + /** + * 返回失败消息 + */ + public AjaxResult error() + { + return AjaxResult.error(); + } + + /** + * 返回成功消息 + */ + public AjaxResult success(String message) + { + return AjaxResult.success(message); + } + + /** + * 返回成功消息 + */ + public AjaxResult success(Object data) + { + return AjaxResult.success(data); + } + + /** + * 返回失败消息 + */ + public AjaxResult error(String message) + { + return AjaxResult.error(message); + } + + /** + * 返回警告消息 + */ + public AjaxResult warn(String message) + { + return AjaxResult.warn(message); + } + + /** + * 响应返回结果 + * + * @param rows 影响行数 + * @return 操作结果 + */ + protected AjaxResult toAjax(int rows) + { + return rows > 0 ? AjaxResult.success() : AjaxResult.error(); + } + + /** + * 响应返回结果 + * + * @param result 结果 + * @return 操作结果 + */ + protected AjaxResult toAjax(boolean result) + { + return result ? success() : error(); + } + + /** + * 页面跳转 + */ + public String redirect(String url) + { + return StringUtils.format("redirect:{}", url); + } + + /** + * 获取用户缓存信息 + */ + public LoginUser getLoginUser() + { + return SecurityUtils.getLoginUser(); + } + + /** + * 获取登录用户id + */ + public Long getUserId() + { + return getLoginUser().getUserId(); + } + + /** + * 获取登录部门id + */ + public Long getDeptId() + { + return getLoginUser().getDeptId(); + } + + /** + * 获取登录用户名 + */ + public String getUsername() + { + return getLoginUser().getUsername(); + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/AjaxResult.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/AjaxResult.java new file mode 100644 index 0000000..9823008 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/AjaxResult.java @@ -0,0 +1,185 @@ +package com.ruoyi.common.core.domain; + +import java.util.HashMap; +import com.ruoyi.common.constant.HttpStatus; +import com.ruoyi.common.utils.StringUtils; + +/** + * 操作消息提醒 + * + * @author #author# + */ +public class AjaxResult extends HashMap +{ + private static final long serialVersionUID = 1L; + + /** 状态码 */ + public static final String CODE_TAG = "code"; + + /** 返回内容 */ + public static final String MSG_TAG = "msg"; + + /** 数据对象 */ + public static final String DATA_TAG = "data"; + + /** + * 初始化一个新创建的 AjaxResult 对象,使其表示一个空消息。 + */ + public AjaxResult() + { + } + + /** + * 初始化一个新创建的 AjaxResult 对象 + * + * @param code 状态码 + * @param msg 返回内容 + */ + public AjaxResult(int code, String msg) + { + super.put(CODE_TAG, code); + super.put(MSG_TAG, msg); + } + + /** + * 初始化一个新创建的 AjaxResult 对象 + * + * @param code 状态码 + * @param msg 返回内容 + * @param data 数据对象 + */ + public AjaxResult(int code, String msg, Object data) + { + super.put(CODE_TAG, code); + super.put(MSG_TAG, msg); + if (StringUtils.isNotNull(data)) + { + super.put(DATA_TAG, data); + } + } + + /** + * 返回成功消息 + * + * @return 成功消息 + */ + public static AjaxResult success() + { + return AjaxResult.success("操作成功"); + } + + /** + * 返回成功数据 + * + * @return 成功消息 + */ + public static AjaxResult success(Object data) + { + return AjaxResult.success("操作成功", data); + } + + /** + * 返回成功消息 + * + * @param msg 返回内容 + * @return 成功消息 + */ + public static AjaxResult success(String msg) + { + return AjaxResult.success(msg, null); + } + + /** + * 返回成功消息 + * + * @param msg 返回内容 + * @param data 数据对象 + * @return 成功消息 + */ + public static AjaxResult success(String msg, Object data) + { + return new AjaxResult(HttpStatus.SUCCESS, msg, data); + } + + /** + * 返回警告消息 + * + * @param msg 返回内容 + * @return 警告消息 + */ + public static AjaxResult warn(String msg) + { + return AjaxResult.warn(msg, null); + } + + /** + * 返回警告消息 + * + * @param msg 返回内容 + * @param data 数据对象 + * @return 警告消息 + */ + public static AjaxResult warn(String msg, Object data) + { + return new AjaxResult(HttpStatus.WARN, msg, data); + } + + /** + * 返回错误消息 + * + * @return 错误消息 + */ + public static AjaxResult error() + { + return AjaxResult.error("操作失败"); + } + + /** + * 返回错误消息 + * + * @param msg 返回内容 + * @return 错误消息 + */ + public static AjaxResult error(String msg) + { + return AjaxResult.error(msg, null); + } + + /** + * 返回错误消息 + * + * @param msg 返回内容 + * @param data 数据对象 + * @return 错误消息 + */ + public static AjaxResult error(String msg, Object data) + { + return new AjaxResult(HttpStatus.ERROR, msg, data); + } + + /** + * 返回错误消息 + * + * @param code 状态码 + * @param msg 返回内容 + * @return 错误消息 + */ + public static AjaxResult error(int code, String msg) + { + return new AjaxResult(code, msg, null); + } + + /** + * 方便链式调用 + * + * @param key 键 + * @param value 值 + * @return 数据对象 + */ + @Override + public AjaxResult put(String key, Object value) + { + super.put(key, value); + return this; + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/BaseEntity.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/BaseEntity.java new file mode 100644 index 0000000..181fd64 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/BaseEntity.java @@ -0,0 +1,152 @@ +package com.ruoyi.common.core.domain; + +import java.io.Serializable; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.ruoyi.common.annotation.Excel; + +/** + * Entity基类 + * + * @author #author# + */ +public class BaseEntity implements Serializable +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private String id; + + /** 搜索值 */ + @JsonIgnore + @TableField(exist = false) + private String searchValue; + + /** 创建者 */ + @TableField(fill = FieldFill.INSERT) + private String createBy; + + /** 创建时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @TableField(fill = FieldFill.INSERT) + private Date createTime; + + /** 更新者 */ + @TableField(fill = FieldFill.INSERT_UPDATE) + private String updateBy; + + /** 更新时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @TableField(fill = FieldFill.INSERT_UPDATE) + private Date updateTime; + + /** 是否删除 */ + @Excel(name = "是否删除") + @TableField(fill = FieldFill.INSERT) + private Long deleted; + + /** 备注 */ + private String remark; + + /** 请求参数 */ + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @TableField(exist = false) + private Map params; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getSearchValue() + { + return searchValue; + } + + public void setSearchValue(String searchValue) + { + this.searchValue = searchValue; + } + + public String getCreateBy() + { + return createBy; + } + + public void setCreateBy(String createBy) + { + this.createBy = createBy; + } + + public Date getCreateTime() + { + return createTime; + } + + public void setCreateTime(Date createTime) + { + this.createTime = createTime; + } + + public String getUpdateBy() + { + return updateBy; + } + + public void setUpdateBy(String updateBy) + { + this.updateBy = updateBy; + } + + public Date getUpdateTime() + { + return updateTime; + } + + public void setUpdateTime(Date updateTime) + { + this.updateTime = updateTime; + } + + public String getRemark() + { + return remark; + } + + public void setRemark(String remark) + { + this.remark = remark; + } + + public Long getDeleted() { + return deleted; + } + + public void setDeleted(Long deleted) { + this.deleted = deleted; + } + + public Map getParams() + { + if (params == null) + { + params = new HashMap<>(); + } + return params; + } + + public void setParams(Map params) + { + this.params = params; + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/R.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/R.java new file mode 100644 index 0000000..4bd24a1 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/R.java @@ -0,0 +1,115 @@ +package com.ruoyi.common.core.domain; + +import java.io.Serializable; +import com.ruoyi.common.constant.HttpStatus; + +/** + * 响应信息主体 + * + * @author #author# + */ +public class R implements Serializable +{ + private static final long serialVersionUID = 1L; + + /** 成功 */ + public static final int SUCCESS = HttpStatus.SUCCESS; + + /** 失败 */ + public static final int FAIL = HttpStatus.ERROR; + + private int code; + + private String msg; + + private T data; + + public static R ok() + { + return restResult(null, SUCCESS, "操作成功"); + } + + public static R ok(T data) + { + return restResult(data, SUCCESS, "操作成功"); + } + + public static R ok(T data, String msg) + { + return restResult(data, SUCCESS, msg); + } + + public static R fail() + { + return restResult(null, FAIL, "操作失败"); + } + + public static R fail(String msg) + { + return restResult(null, FAIL, msg); + } + + public static R fail(T data) + { + return restResult(data, FAIL, "操作失败"); + } + + public static R fail(T data, String msg) + { + return restResult(data, FAIL, msg); + } + + public static R fail(int code, String msg) + { + return restResult(null, code, msg); + } + + private static R restResult(T data, int code, String msg) + { + R apiResult = new R<>(); + apiResult.setCode(code); + apiResult.setData(data); + apiResult.setMsg(msg); + return apiResult; + } + + public int getCode() + { + return code; + } + + public void setCode(int code) + { + this.code = code; + } + + public String getMsg() + { + return msg; + } + + public void setMsg(String msg) + { + this.msg = msg; + } + + public T getData() + { + return data; + } + + public void setData(T data) + { + this.data = data; + } + + public static Boolean isError(R ret) + { + return !isSuccess(ret); + } + + public static Boolean isSuccess(R ret) + { + return R.SUCCESS == ret.getCode(); + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/TreeEntity.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/TreeEntity.java new file mode 100644 index 0000000..be2ee71 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/TreeEntity.java @@ -0,0 +1,79 @@ +package com.ruoyi.common.core.domain; + +import java.util.ArrayList; +import java.util.List; + +/** + * Tree基类 + * + * @author #author# + */ +public class TreeEntity extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 父菜单名称 */ + private String parentName; + + /** 父菜单ID */ + private Long parentId; + + /** 显示顺序 */ + private Integer orderNum; + + /** 祖级列表 */ + private String ancestors; + + /** 子部门 */ + private List children = new ArrayList<>(); + + public String getParentName() + { + return parentName; + } + + public void setParentName(String parentName) + { + this.parentName = parentName; + } + + public Long getParentId() + { + return parentId; + } + + public void setParentId(Long parentId) + { + this.parentId = parentId; + } + + public Integer getOrderNum() + { + return orderNum; + } + + public void setOrderNum(Integer orderNum) + { + this.orderNum = orderNum; + } + + public String getAncestors() + { + return ancestors; + } + + public void setAncestors(String ancestors) + { + this.ancestors = ancestors; + } + + public List getChildren() + { + return children; + } + + public void setChildren(List children) + { + this.children = children; + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/TreeSelect.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/TreeSelect.java new file mode 100644 index 0000000..c7a8f6c --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/TreeSelect.java @@ -0,0 +1,77 @@ +package com.ruoyi.common.core.domain; + +import java.io.Serializable; +import java.util.List; +import java.util.stream.Collectors; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.ruoyi.common.core.domain.entity.SysDept; +import com.ruoyi.common.core.domain.entity.SysMenu; + +/** + * Treeselect树结构实体类 + * + * @author #author# + */ +public class TreeSelect implements Serializable +{ + private static final long serialVersionUID = 1L; + + /** 节点ID */ + private Long id; + + /** 节点名称 */ + private String label; + + /** 子节点 */ + @JsonInclude(JsonInclude.Include.NON_EMPTY) + private List children; + + public TreeSelect() + { + + } + + public TreeSelect(SysDept dept) + { + this.id = dept.getDeptId(); + this.label = dept.getDeptName(); + this.children = dept.getChildren().stream().map(TreeSelect::new).collect(Collectors.toList()); + } + + public TreeSelect(SysMenu menu) + { + this.id = menu.getMenuId(); + this.label = menu.getMenuName(); + this.children = menu.getChildren().stream().map(TreeSelect::new).collect(Collectors.toList()); + } + + public Long getId() + { + return id; + } + + public void setId(Long id) + { + this.id = id; + } + + public String getLabel() + { + return label; + } + + public void setLabel(String label) + { + this.label = label; + } + + public List getChildren() + { + return children; + } + + public void setChildren(List children) + { + this.children = children; + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDept.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDept.java new file mode 100644 index 0000000..015daa3 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDept.java @@ -0,0 +1,203 @@ +package com.ruoyi.common.core.domain.entity; + +import java.util.ArrayList; +import java.util.List; +import javax.validation.constraints.Email; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * 部门表 sys_dept + * + * @author #author# + */ +public class SysDept extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 部门ID */ + private Long deptId; + + /** 父部门ID */ + private Long parentId; + + /** 祖级列表 */ + private String ancestors; + + /** 部门名称 */ + private String deptName; + + /** 显示顺序 */ + private Integer orderNum; + + /** 负责人 */ + private String leader; + + /** 联系电话 */ + private String phone; + + /** 邮箱 */ + private String email; + + /** 部门状态:0正常,1停用 */ + private String status; + + /** 删除标志(0代表存在 2代表删除) */ + private String delFlag; + + /** 父部门名称 */ + private String parentName; + + /** 子部门 */ + private List children = new ArrayList(); + + public Long getDeptId() + { + return deptId; + } + + public void setDeptId(Long deptId) + { + this.deptId = deptId; + } + + public Long getParentId() + { + return parentId; + } + + public void setParentId(Long parentId) + { + this.parentId = parentId; + } + + public String getAncestors() + { + return ancestors; + } + + public void setAncestors(String ancestors) + { + this.ancestors = ancestors; + } + + @NotBlank(message = "部门名称不能为空") + @Size(min = 0, max = 30, message = "部门名称长度不能超过30个字符") + public String getDeptName() + { + return deptName; + } + + public void setDeptName(String deptName) + { + this.deptName = deptName; + } + + @NotNull(message = "显示顺序不能为空") + public Integer getOrderNum() + { + return orderNum; + } + + public void setOrderNum(Integer orderNum) + { + this.orderNum = orderNum; + } + + public String getLeader() + { + return leader; + } + + public void setLeader(String leader) + { + this.leader = leader; + } + + @Size(min = 0, max = 11, message = "联系电话长度不能超过11个字符") + public String getPhone() + { + return phone; + } + + public void setPhone(String phone) + { + this.phone = phone; + } + + @Email(message = "邮箱格式不正确") + @Size(min = 0, max = 50, message = "邮箱长度不能超过50个字符") + public String getEmail() + { + return email; + } + + public void setEmail(String email) + { + this.email = email; + } + + public String getStatus() + { + return status; + } + + public void setStatus(String status) + { + this.status = status; + } + + public String getDelFlag() + { + return delFlag; + } + + public void setDelFlag(String delFlag) + { + this.delFlag = delFlag; + } + + public String getParentName() + { + return parentName; + } + + public void setParentName(String parentName) + { + this.parentName = parentName; + } + + public List getChildren() + { + return children; + } + + public void setChildren(List children) + { + this.children = children; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("deptId", getDeptId()) + .append("parentId", getParentId()) + .append("ancestors", getAncestors()) + .append("deptName", getDeptName()) + .append("orderNum", getOrderNum()) + .append("leader", getLeader()) + .append("phone", getPhone()) + .append("email", getEmail()) + .append("status", getStatus()) + .append("delFlag", getDelFlag()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .toString(); + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDictData.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDictData.java new file mode 100644 index 0000000..db584c5 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDictData.java @@ -0,0 +1,176 @@ +package com.ruoyi.common.core.domain.entity; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.Size; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.annotation.Excel.ColumnType; +import com.ruoyi.common.constant.UserConstants; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * 字典数据表 sys_dict_data + * + * @author #author# + */ +public class SysDictData extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 字典编码 */ + @Excel(name = "字典编码", cellType = ColumnType.NUMERIC) + private Long dictCode; + + /** 字典排序 */ + @Excel(name = "字典排序", cellType = ColumnType.NUMERIC) + private Long dictSort; + + /** 字典标签 */ + @Excel(name = "字典标签") + private String dictLabel; + + /** 字典键值 */ + @Excel(name = "字典键值") + private String dictValue; + + /** 字典类型 */ + @Excel(name = "字典类型") + private String dictType; + + /** 样式属性(其他样式扩展) */ + private String cssClass; + + /** 表格字典样式 */ + private String listClass; + + /** 是否默认(Y是 N否) */ + @Excel(name = "是否默认", readConverterExp = "Y=是,N=否") + private String isDefault; + + /** 状态(0正常 1停用) */ + @Excel(name = "状态", readConverterExp = "0=正常,1=停用") + private String status; + + public Long getDictCode() + { + return dictCode; + } + + public void setDictCode(Long dictCode) + { + this.dictCode = dictCode; + } + + public Long getDictSort() + { + return dictSort; + } + + public void setDictSort(Long dictSort) + { + this.dictSort = dictSort; + } + + @NotBlank(message = "字典标签不能为空") + @Size(min = 0, max = 100, message = "字典标签长度不能超过100个字符") + public String getDictLabel() + { + return dictLabel; + } + + public void setDictLabel(String dictLabel) + { + this.dictLabel = dictLabel; + } + + @NotBlank(message = "字典键值不能为空") + @Size(min = 0, max = 100, message = "字典键值长度不能超过100个字符") + public String getDictValue() + { + return dictValue; + } + + public void setDictValue(String dictValue) + { + this.dictValue = dictValue; + } + + @NotBlank(message = "字典类型不能为空") + @Size(min = 0, max = 100, message = "字典类型长度不能超过100个字符") + public String getDictType() + { + return dictType; + } + + public void setDictType(String dictType) + { + this.dictType = dictType; + } + + @Size(min = 0, max = 100, message = "样式属性长度不能超过100个字符") + public String getCssClass() + { + return cssClass; + } + + public void setCssClass(String cssClass) + { + this.cssClass = cssClass; + } + + public String getListClass() + { + return listClass; + } + + public void setListClass(String listClass) + { + this.listClass = listClass; + } + + public boolean getDefault() + { + return UserConstants.YES.equals(this.isDefault); + } + + public String getIsDefault() + { + return isDefault; + } + + public void setIsDefault(String isDefault) + { + this.isDefault = isDefault; + } + + public String getStatus() + { + return status; + } + + public void setStatus(String status) + { + this.status = status; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("dictCode", getDictCode()) + .append("dictSort", getDictSort()) + .append("dictLabel", getDictLabel()) + .append("dictValue", getDictValue()) + .append("dictType", getDictType()) + .append("cssClass", getCssClass()) + .append("listClass", getListClass()) + .append("isDefault", getIsDefault()) + .append("status", getStatus()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("remark", getRemark()) + .toString(); + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDictType.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDictType.java new file mode 100644 index 0000000..e1c3686 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDictType.java @@ -0,0 +1,96 @@ +package com.ruoyi.common.core.domain.entity; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.Pattern; +import javax.validation.constraints.Size; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.annotation.Excel.ColumnType; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * 字典类型表 sys_dict_type + * + * @author #author# + */ +public class SysDictType extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 字典主键 */ + @Excel(name = "字典主键", cellType = ColumnType.NUMERIC) + private Long dictId; + + /** 字典名称 */ + @Excel(name = "字典名称") + private String dictName; + + /** 字典类型 */ + @Excel(name = "字典类型") + private String dictType; + + /** 状态(0正常 1停用) */ + @Excel(name = "状态", readConverterExp = "0=正常,1=停用") + private String status; + + public Long getDictId() + { + return dictId; + } + + public void setDictId(Long dictId) + { + this.dictId = dictId; + } + + @NotBlank(message = "字典名称不能为空") + @Size(min = 0, max = 100, message = "字典类型名称长度不能超过100个字符") + public String getDictName() + { + return dictName; + } + + public void setDictName(String dictName) + { + this.dictName = dictName; + } + + @NotBlank(message = "字典类型不能为空") + @Size(min = 0, max = 100, message = "字典类型类型长度不能超过100个字符") + @Pattern(regexp = "^[a-z][a-z0-9_]*$", message = "字典类型必须以字母开头,且只能为(小写字母,数字,下滑线)") + public String getDictType() + { + return dictType; + } + + public void setDictType(String dictType) + { + this.dictType = dictType; + } + + public String getStatus() + { + return status; + } + + public void setStatus(String status) + { + this.status = status; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("dictId", getDictId()) + .append("dictName", getDictName()) + .append("dictType", getDictType()) + .append("status", getStatus()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("remark", getRemark()) + .toString(); + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysMenu.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysMenu.java new file mode 100644 index 0000000..fae0ee6 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysMenu.java @@ -0,0 +1,259 @@ +package com.ruoyi.common.core.domain.entity; + +import java.util.ArrayList; +import java.util.List; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * 菜单权限表 sys_menu + * + * @author #author# + */ +public class SysMenu extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 菜单ID */ + private Long menuId; + + /** 菜单名称 */ + private String menuName; + + /** 父菜单名称 */ + private String parentName; + + /** 父菜单ID */ + private Long parentId; + + /** 显示顺序 */ + private Integer orderNum; + + /** 路由地址 */ + private String path; + + /** 组件路径 */ + private String component; + + /** 路由参数 */ + private String query; + + /** 是否为外链(0是 1否) */ + private String isFrame; + + /** 是否缓存(0缓存 1不缓存) */ + private String isCache; + + /** 类型(M目录 C菜单 F按钮) */ + private String menuType; + + /** 显示状态(0显示 1隐藏) */ + private String visible; + + /** 菜单状态(0正常 1停用) */ + private String status; + + /** 权限字符串 */ + private String perms; + + /** 菜单图标 */ + private String icon; + + /** 子菜单 */ + private List children = new ArrayList(); + + public Long getMenuId() + { + return menuId; + } + + public void setMenuId(Long menuId) + { + this.menuId = menuId; + } + + @NotBlank(message = "菜单名称不能为空") + @Size(min = 0, max = 50, message = "菜单名称长度不能超过50个字符") + public String getMenuName() + { + return menuName; + } + + public void setMenuName(String menuName) + { + this.menuName = menuName; + } + + public String getParentName() + { + return parentName; + } + + public void setParentName(String parentName) + { + this.parentName = parentName; + } + + public Long getParentId() + { + return parentId; + } + + public void setParentId(Long parentId) + { + this.parentId = parentId; + } + + @NotNull(message = "显示顺序不能为空") + public Integer getOrderNum() + { + return orderNum; + } + + public void setOrderNum(Integer orderNum) + { + this.orderNum = orderNum; + } + + @Size(min = 0, max = 200, message = "路由地址不能超过200个字符") + public String getPath() + { + return path; + } + + public void setPath(String path) + { + this.path = path; + } + + @Size(min = 0, max = 200, message = "组件路径不能超过255个字符") + public String getComponent() + { + return component; + } + + public void setComponent(String component) + { + this.component = component; + } + + public String getQuery() + { + return query; + } + + public void setQuery(String query) + { + this.query = query; + } + + public String getIsFrame() + { + return isFrame; + } + + public void setIsFrame(String isFrame) + { + this.isFrame = isFrame; + } + + public String getIsCache() + { + return isCache; + } + + public void setIsCache(String isCache) + { + this.isCache = isCache; + } + + @NotBlank(message = "菜单类型不能为空") + public String getMenuType() + { + return menuType; + } + + public void setMenuType(String menuType) + { + this.menuType = menuType; + } + + public String getVisible() + { + return visible; + } + + public void setVisible(String visible) + { + this.visible = visible; + } + + public String getStatus() + { + return status; + } + + public void setStatus(String status) + { + this.status = status; + } + + @Size(min = 0, max = 100, message = "权限标识长度不能超过100个字符") + public String getPerms() + { + return perms; + } + + public void setPerms(String perms) + { + this.perms = perms; + } + + public String getIcon() + { + return icon; + } + + public void setIcon(String icon) + { + this.icon = icon; + } + + public List getChildren() + { + return children; + } + + public void setChildren(List children) + { + this.children = children; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("menuId", getMenuId()) + .append("menuName", getMenuName()) + .append("parentId", getParentId()) + .append("orderNum", getOrderNum()) + .append("path", getPath()) + .append("component", getComponent()) + .append("isFrame", getIsFrame()) + .append("IsCache", getIsCache()) + .append("menuType", getMenuType()) + .append("visible", getVisible()) + .append("status ", getStatus()) + .append("perms", getPerms()) + .append("icon", getIcon()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("remark", getRemark()) + .toString(); + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysRole.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysRole.java new file mode 100644 index 0000000..5cac2a1 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysRole.java @@ -0,0 +1,241 @@ +package com.ruoyi.common.core.domain.entity; + +import java.util.Set; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.annotation.Excel.ColumnType; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * 角色表 sys_role + * + * @author #author# + */ +public class SysRole extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 角色ID */ + @Excel(name = "角色序号", cellType = ColumnType.NUMERIC) + private Long roleId; + + /** 角色名称 */ + @Excel(name = "角色名称") + private String roleName; + + /** 角色权限 */ + @Excel(name = "角色权限") + private String roleKey; + + /** 角色排序 */ + @Excel(name = "角色排序") + private Integer roleSort; + + /** 数据范围(1:所有数据权限;2:自定义数据权限;3:本部门数据权限;4:本部门及以下数据权限;5:仅本人数据权限) */ + @Excel(name = "数据范围", readConverterExp = "1=所有数据权限,2=自定义数据权限,3=本部门数据权限,4=本部门及以下数据权限,5=仅本人数据权限") + private String dataScope; + + /** 菜单树选择项是否关联显示( 0:父子不互相关联显示 1:父子互相关联显示) */ + private boolean menuCheckStrictly; + + /** 部门树选择项是否关联显示(0:父子不互相关联显示 1:父子互相关联显示 ) */ + private boolean deptCheckStrictly; + + /** 角色状态(0正常 1停用) */ + @Excel(name = "角色状态", readConverterExp = "0=正常,1=停用") + private String status; + + /** 删除标志(0代表存在 2代表删除) */ + private String delFlag; + + /** 用户是否存在此角色标识 默认不存在 */ + private boolean flag = false; + + /** 菜单组 */ + private Long[] menuIds; + + /** 部门组(数据权限) */ + private Long[] deptIds; + + /** 角色菜单权限 */ + private Set permissions; + + public SysRole() + { + + } + + public SysRole(Long roleId) + { + this.roleId = roleId; + } + + public Long getRoleId() + { + return roleId; + } + + public void setRoleId(Long roleId) + { + this.roleId = roleId; + } + + public boolean isAdmin() + { + return isAdmin(this.roleId); + } + + public static boolean isAdmin(Long roleId) + { + return roleId != null && 1L == roleId; + } + + @NotBlank(message = "角色名称不能为空") + @Size(min = 0, max = 30, message = "角色名称长度不能超过30个字符") + public String getRoleName() + { + return roleName; + } + + public void setRoleName(String roleName) + { + this.roleName = roleName; + } + + @NotBlank(message = "权限字符不能为空") + @Size(min = 0, max = 100, message = "权限字符长度不能超过100个字符") + public String getRoleKey() + { + return roleKey; + } + + public void setRoleKey(String roleKey) + { + this.roleKey = roleKey; + } + + @NotNull(message = "显示顺序不能为空") + public Integer getRoleSort() + { + return roleSort; + } + + public void setRoleSort(Integer roleSort) + { + this.roleSort = roleSort; + } + + public String getDataScope() + { + return dataScope; + } + + public void setDataScope(String dataScope) + { + this.dataScope = dataScope; + } + + public boolean isMenuCheckStrictly() + { + return menuCheckStrictly; + } + + public void setMenuCheckStrictly(boolean menuCheckStrictly) + { + this.menuCheckStrictly = menuCheckStrictly; + } + + public boolean isDeptCheckStrictly() + { + return deptCheckStrictly; + } + + public void setDeptCheckStrictly(boolean deptCheckStrictly) + { + this.deptCheckStrictly = deptCheckStrictly; + } + + public String getStatus() + { + return status; + } + + public void setStatus(String status) + { + this.status = status; + } + + public String getDelFlag() + { + return delFlag; + } + + public void setDelFlag(String delFlag) + { + this.delFlag = delFlag; + } + + public boolean isFlag() + { + return flag; + } + + public void setFlag(boolean flag) + { + this.flag = flag; + } + + public Long[] getMenuIds() + { + return menuIds; + } + + public void setMenuIds(Long[] menuIds) + { + this.menuIds = menuIds; + } + + public Long[] getDeptIds() + { + return deptIds; + } + + public void setDeptIds(Long[] deptIds) + { + this.deptIds = deptIds; + } + + public Set getPermissions() + { + return permissions; + } + + public void setPermissions(Set permissions) + { + this.permissions = permissions; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("roleId", getRoleId()) + .append("roleName", getRoleName()) + .append("roleKey", getRoleKey()) + .append("roleSort", getRoleSort()) + .append("dataScope", getDataScope()) + .append("menuCheckStrictly", isMenuCheckStrictly()) + .append("deptCheckStrictly", isDeptCheckStrictly()) + .append("status", getStatus()) + .append("delFlag", getDelFlag()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("remark", getRemark()) + .toString(); + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java new file mode 100644 index 0000000..7d868e8 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java @@ -0,0 +1,324 @@ +package com.ruoyi.common.core.domain.entity; + +import java.util.Date; +import java.util.List; +import javax.validation.constraints.*; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.annotation.Excel.ColumnType; +import com.ruoyi.common.annotation.Excel.Type; +import com.ruoyi.common.annotation.Excels; +import com.ruoyi.common.core.domain.BaseEntity; +import com.ruoyi.common.xss.Xss; + +/** + * 用户对象 sys_user + * + * @author #author# + */ +public class SysUser extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 用户ID */ + @Excel(name = "用户序号", cellType = ColumnType.NUMERIC, prompt = "用户编号") + private Long userId; + + /** 部门ID */ + @Excel(name = "部门编号", type = Type.IMPORT) + private Long deptId; + + /** 用户账号 */ + @Excel(name = "登录名称") + private String userName; + + /** 用户昵称 */ + @Excel(name = "用户名称") + private String nickName; + + /** 用户邮箱 */ + @Excel(name = "用户邮箱") + private String email; + + /** 手机号码 */ + @Excel(name = "手机号码") + private String phonenumber; + + /** 用户性别 */ + @Excel(name = "用户性别", readConverterExp = "0=男,1=女,2=未知") + private String sex; + + /** 用户头像 */ + private String avatar; + + /** 密码 */ + private String password; + + /** 帐号状态(0正常 1停用) */ + @Excel(name = "帐号状态", readConverterExp = "0=正常,1=停用") + private String status; + + /** 删除标志(0代表存在 2代表删除) */ + private String delFlag; + + /** 最后登录IP */ + @Excel(name = "最后登录IP", type = Type.EXPORT) + private String loginIp; + + /** 最后登录时间 */ + @Excel(name = "最后登录时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", type = Type.EXPORT) + private Date loginDate; + + /** 部门对象 */ + @Excels({ + @Excel(name = "部门名称", targetAttr = "deptName", type = Type.EXPORT), + @Excel(name = "部门负责人", targetAttr = "leader", type = Type.EXPORT) + }) + private SysDept dept; + + /** 角色对象 */ + private List roles; + + /** 角色组 */ + private Long[] roleIds; + + /** 岗位组 */ + private Long[] postIds; + + /** 角色ID */ + private Long roleId; + + public SysUser() + { + + } + + public SysUser(Long userId) + { + this.userId = userId; + } + + public Long getUserId() + { + return userId; + } + + public void setUserId(Long userId) + { + this.userId = userId; + } + + public boolean isAdmin() + { + return isAdmin(this.userId); + } + + public static boolean isAdmin(Long userId) + { + return userId != null && 1L == userId; + } + + public Long getDeptId() + { + return deptId; + } + + public void setDeptId(Long deptId) + { + this.deptId = deptId; + } + + @Xss(message = "用户昵称不能包含脚本字符") + @Size(min = 0, max = 30, message = "用户昵称长度不能超过30个字符") + public String getNickName() + { + return nickName; + } + + public void setNickName(String nickName) + { + this.nickName = nickName; + } + + @Xss(message = "用户账号不能包含脚本字符") + @NotBlank(message = "用户账号不能为空") + @Size(min = 0, max = 30, message = "用户账号长度不能超过30个字符") + public String getUserName() + { + return userName; + } + + public void setUserName(String userName) + { + this.userName = userName; + } + + @Email(message = "邮箱格式不正确") + @Size(min = 0, max = 50, message = "邮箱长度不能超过50个字符") + public String getEmail() + { + return email; + } + + public void setEmail(String email) + { + this.email = email; + } + + @Size(min = 0, max = 11, message = "手机号码长度不能超过11个字符") + public String getPhonenumber() + { + return phonenumber; + } + + public void setPhonenumber(String phonenumber) + { + this.phonenumber = phonenumber; + } + + public String getSex() + { + return sex; + } + + public void setSex(String sex) + { + this.sex = sex; + } + + public String getAvatar() + { + return avatar; + } + + public void setAvatar(String avatar) + { + this.avatar = avatar; + } + + public String getPassword() + { + return password; + } + + public void setPassword(String password) + { + this.password = password; + } + + public String getStatus() + { + return status; + } + + public void setStatus(String status) + { + this.status = status; + } + + public String getDelFlag() + { + return delFlag; + } + + public void setDelFlag(String delFlag) + { + this.delFlag = delFlag; + } + + public String getLoginIp() + { + return loginIp; + } + + public void setLoginIp(String loginIp) + { + this.loginIp = loginIp; + } + + public Date getLoginDate() + { + return loginDate; + } + + public void setLoginDate(Date loginDate) + { + this.loginDate = loginDate; + } + + public SysDept getDept() + { + return dept; + } + + public void setDept(SysDept dept) + { + this.dept = dept; + } + + public List getRoles() + { + return roles; + } + + public void setRoles(List roles) + { + this.roles = roles; + } + + public Long[] getRoleIds() + { + return roleIds; + } + + public void setRoleIds(Long[] roleIds) + { + this.roleIds = roleIds; + } + + public Long[] getPostIds() + { + return postIds; + } + + public void setPostIds(Long[] postIds) + { + this.postIds = postIds; + } + + public Long getRoleId() + { + return roleId; + } + + public void setRoleId(Long roleId) + { + this.roleId = roleId; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("userId", getUserId()) + .append("deptId", getDeptId()) + .append("userName", getUserName()) + .append("nickName", getNickName()) + .append("email", getEmail()) + .append("phonenumber", getPhonenumber()) + .append("sex", getSex()) + .append("avatar", getAvatar()) + .append("password", getPassword()) + .append("status", getStatus()) + .append("delFlag", getDelFlag()) + .append("loginIp", getLoginIp()) + .append("loginDate", getLoginDate()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("remark", getRemark()) + .append("dept", getDept()) + .toString(); + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/model/LoginBody.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/model/LoginBody.java new file mode 100644 index 0000000..a8651bb --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/model/LoginBody.java @@ -0,0 +1,69 @@ +package com.ruoyi.common.core.domain.model; + +/** + * 用户登录对象 + * + * @author #author# + */ +public class LoginBody +{ + /** + * 用户名 + */ + private String username; + + /** + * 用户密码 + */ + private String password; + + /** + * 验证码 + */ + private String code; + + /** + * 唯一标识 + */ + private String uuid; + + public String getUsername() + { + return username; + } + + public void setUsername(String username) + { + this.username = username; + } + + public String getPassword() + { + return password; + } + + public void setPassword(String password) + { + this.password = password; + } + + public String getCode() + { + return code; + } + + public void setCode(String code) + { + this.code = code; + } + + public String getUuid() + { + return uuid; + } + + public void setUuid(String uuid) + { + this.uuid = uuid; + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/model/LoginUser.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/model/LoginUser.java new file mode 100644 index 0000000..26feb5f --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/model/LoginUser.java @@ -0,0 +1,266 @@ +package com.ruoyi.common.core.domain.model; + +import java.util.Collection; +import java.util.Set; +import org.springframework.security.core.GrantedAuthority; +import org.springframework.security.core.userdetails.UserDetails; +import com.alibaba.fastjson2.annotation.JSONField; +import com.ruoyi.common.core.domain.entity.SysUser; + +/** + * 登录用户身份权限 + * + * @author #author# + */ +public class LoginUser implements UserDetails +{ + private static final long serialVersionUID = 1L; + + /** + * 用户ID + */ + private Long userId; + + /** + * 部门ID + */ + private Long deptId; + + /** + * 用户唯一标识 + */ + private String token; + + /** + * 登录时间 + */ + private Long loginTime; + + /** + * 过期时间 + */ + private Long expireTime; + + /** + * 登录IP地址 + */ + private String ipaddr; + + /** + * 登录地点 + */ + private String loginLocation; + + /** + * 浏览器类型 + */ + private String browser; + + /** + * 操作系统 + */ + private String os; + + /** + * 权限列表 + */ + private Set permissions; + + /** + * 用户信息 + */ + private SysUser user; + + public Long getUserId() + { + return userId; + } + + public void setUserId(Long userId) + { + this.userId = userId; + } + + public Long getDeptId() + { + return deptId; + } + + public void setDeptId(Long deptId) + { + this.deptId = deptId; + } + + public String getToken() + { + return token; + } + + public void setToken(String token) + { + this.token = token; + } + + public LoginUser() + { + } + + public LoginUser(SysUser user, Set permissions) + { + this.user = user; + this.permissions = permissions; + } + + public LoginUser(Long userId, Long deptId, SysUser user, Set permissions) + { + this.userId = userId; + this.deptId = deptId; + this.user = user; + this.permissions = permissions; + } + + @JSONField(serialize = false) + @Override + public String getPassword() + { + return user.getPassword(); + } + + @Override + public String getUsername() + { + return user.getUserName(); + } + + /** + * 账户是否未过期,过期无法验证 + */ + @JSONField(serialize = false) + @Override + public boolean isAccountNonExpired() + { + return true; + } + + /** + * 指定用户是否解锁,锁定的用户无法进行身份验证 + * + * @return + */ + @JSONField(serialize = false) + @Override + public boolean isAccountNonLocked() + { + return true; + } + + /** + * 指示是否已过期的用户的凭据(密码),过期的凭据防止认证 + * + * @return + */ + @JSONField(serialize = false) + @Override + public boolean isCredentialsNonExpired() + { + return true; + } + + /** + * 是否可用 ,禁用的用户不能身份验证 + * + * @return + */ + @JSONField(serialize = false) + @Override + public boolean isEnabled() + { + return true; + } + + public Long getLoginTime() + { + return loginTime; + } + + public void setLoginTime(Long loginTime) + { + this.loginTime = loginTime; + } + + public String getIpaddr() + { + return ipaddr; + } + + public void setIpaddr(String ipaddr) + { + this.ipaddr = ipaddr; + } + + public String getLoginLocation() + { + return loginLocation; + } + + public void setLoginLocation(String loginLocation) + { + this.loginLocation = loginLocation; + } + + public String getBrowser() + { + return browser; + } + + public void setBrowser(String browser) + { + this.browser = browser; + } + + public String getOs() + { + return os; + } + + public void setOs(String os) + { + this.os = os; + } + + public Long getExpireTime() + { + return expireTime; + } + + public void setExpireTime(Long expireTime) + { + this.expireTime = expireTime; + } + + public Set getPermissions() + { + return permissions; + } + + public void setPermissions(Set permissions) + { + this.permissions = permissions; + } + + public SysUser getUser() + { + return user; + } + + public void setUser(SysUser user) + { + this.user = user; + } + + @Override + public Collection getAuthorities() + { + return null; + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/model/RegisterBody.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/model/RegisterBody.java new file mode 100644 index 0000000..9ef3065 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/model/RegisterBody.java @@ -0,0 +1,11 @@ +package com.ruoyi.common.core.domain.model; + +/** + * 用户注册对象 + * + * @author #author# + */ +public class RegisterBody extends LoginBody +{ + +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/page/PageDomain.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/page/PageDomain.java new file mode 100644 index 0000000..ad02385 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/page/PageDomain.java @@ -0,0 +1,101 @@ +package com.ruoyi.common.core.page; + +import com.ruoyi.common.utils.StringUtils; + +/** + * 分页数据 + * + * @author #author# + */ +public class PageDomain +{ + /** 当前记录起始索引 */ + private Integer pageNum; + + /** 每页显示记录数 */ + private Integer pageSize; + + /** 排序列 */ + private String orderByColumn; + + /** 排序的方向desc或者asc */ + private String isAsc = "asc"; + + /** 分页参数合理化 */ + private Boolean reasonable = true; + + public String getOrderBy() + { + if (StringUtils.isEmpty(orderByColumn)) + { + return ""; + } + return StringUtils.toUnderScoreCase(orderByColumn) + " " + isAsc; + } + + public Integer getPageNum() + { + return pageNum; + } + + public void setPageNum(Integer pageNum) + { + this.pageNum = pageNum; + } + + public Integer getPageSize() + { + return pageSize; + } + + public void setPageSize(Integer pageSize) + { + this.pageSize = pageSize; + } + + public String getOrderByColumn() + { + return orderByColumn; + } + + public void setOrderByColumn(String orderByColumn) + { + this.orderByColumn = orderByColumn; + } + + public String getIsAsc() + { + return isAsc; + } + + public void setIsAsc(String isAsc) + { + if (StringUtils.isNotEmpty(isAsc)) + { + // 兼容前端排序类型 + if ("ascending".equals(isAsc)) + { + isAsc = "asc"; + } + else if ("descending".equals(isAsc)) + { + isAsc = "desc"; + } + this.isAsc = isAsc; + } + } + + public Boolean getReasonable() + { + if (StringUtils.isNull(reasonable)) + { + return Boolean.TRUE; + } + return reasonable; + } + + public void setReasonable(Boolean reasonable) + { + this.reasonable = reasonable; + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/page/TableDataInfo.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/page/TableDataInfo.java new file mode 100644 index 0000000..b2a3541 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/page/TableDataInfo.java @@ -0,0 +1,85 @@ +package com.ruoyi.common.core.page; + +import java.io.Serializable; +import java.util.List; + +/** + * 表格分页数据对象 + * + * @author #author# + */ +public class TableDataInfo implements Serializable +{ + private static final long serialVersionUID = 1L; + + /** 总记录数 */ + private long total; + + /** 列表数据 */ + private List rows; + + /** 消息状态码 */ + private int code; + + /** 消息内容 */ + private String msg; + + /** + * 表格数据对象 + */ + public TableDataInfo() + { + } + + /** + * 分页 + * + * @param list 列表数据 + * @param total 总记录数 + */ + public TableDataInfo(List list, int total) + { + this.rows = list; + this.total = total; + } + + public long getTotal() + { + return total; + } + + public void setTotal(long total) + { + this.total = total; + } + + public List getRows() + { + return rows; + } + + public void setRows(List rows) + { + this.rows = rows; + } + + public int getCode() + { + return code; + } + + public void setCode(int code) + { + this.code = code; + } + + public String getMsg() + { + return msg; + } + + public void setMsg(String msg) + { + this.msg = msg; + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/page/TableSupport.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/page/TableSupport.java new file mode 100644 index 0000000..af9b257 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/page/TableSupport.java @@ -0,0 +1,56 @@ +package com.ruoyi.common.core.page; + +import com.ruoyi.common.core.text.Convert; +import com.ruoyi.common.utils.ServletUtils; + +/** + * 表格数据处理 + * + * @author #author# + */ +public class TableSupport +{ + /** + * 当前记录起始索引 + */ + public static final String PAGE_NUM = "pageNum"; + + /** + * 每页显示记录数 + */ + public static final String PAGE_SIZE = "pageSize"; + + /** + * 排序列 + */ + public static final String ORDER_BY_COLUMN = "orderByColumn"; + + /** + * 排序的方向 "desc" 或者 "asc". + */ + public static final String IS_ASC = "isAsc"; + + /** + * 分页参数合理化 + */ + public static final String REASONABLE = "reasonable"; + + /** + * 封装分页对象 + */ + public static PageDomain getPageDomain() + { + PageDomain pageDomain = new PageDomain(); + pageDomain.setPageNum(Convert.toInt(ServletUtils.getParameter(PAGE_NUM), 1)); + pageDomain.setPageSize(Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10)); + pageDomain.setOrderByColumn(ServletUtils.getParameter(ORDER_BY_COLUMN)); + pageDomain.setIsAsc(ServletUtils.getParameter(IS_ASC)); + pageDomain.setReasonable(ServletUtils.getParameterToBool(REASONABLE)); + return pageDomain; + } + + public static PageDomain buildPageRequest() + { + return getPageDomain(); + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/redis/RedisCache.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/redis/RedisCache.java new file mode 100644 index 0000000..fd6062f --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/redis/RedisCache.java @@ -0,0 +1,268 @@ +package com.ruoyi.common.core.redis; + +import java.util.Collection; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.TimeUnit; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.redis.core.BoundSetOperations; +import org.springframework.data.redis.core.HashOperations; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.data.redis.core.ValueOperations; +import org.springframework.stereotype.Component; + +/** + * spring redis 工具类 + * + * @author #author# + **/ +@SuppressWarnings(value = { "unchecked", "rawtypes" }) +@Component +public class RedisCache +{ + @Autowired + public RedisTemplate redisTemplate; + + /** + * 缓存基本的对象,Integer、String、实体类等 + * + * @param key 缓存的键值 + * @param value 缓存的值 + */ + public void setCacheObject(final String key, final T value) + { + redisTemplate.opsForValue().set(key, value); + } + + /** + * 缓存基本的对象,Integer、String、实体类等 + * + * @param key 缓存的键值 + * @param value 缓存的值 + * @param timeout 时间 + * @param timeUnit 时间颗粒度 + */ + public void setCacheObject(final String key, final T value, final Integer timeout, final TimeUnit timeUnit) + { + redisTemplate.opsForValue().set(key, value, timeout, timeUnit); + } + + /** + * 设置有效时间 + * + * @param key Redis键 + * @param timeout 超时时间 + * @return true=设置成功;false=设置失败 + */ + public boolean expire(final String key, final long timeout) + { + return expire(key, timeout, TimeUnit.SECONDS); + } + + /** + * 设置有效时间 + * + * @param key Redis键 + * @param timeout 超时时间 + * @param unit 时间单位 + * @return true=设置成功;false=设置失败 + */ + public boolean expire(final String key, final long timeout, final TimeUnit unit) + { + return redisTemplate.expire(key, timeout, unit); + } + + /** + * 获取有效时间 + * + * @param key Redis键 + * @return 有效时间 + */ + public long getExpire(final String key) + { + return redisTemplate.getExpire(key); + } + + /** + * 判断 key是否存在 + * + * @param key 键 + * @return true 存在 false不存在 + */ + public Boolean hasKey(String key) + { + return redisTemplate.hasKey(key); + } + + /** + * 获得缓存的基本对象。 + * + * @param key 缓存键值 + * @return 缓存键值对应的数据 + */ + public T getCacheObject(final String key) + { + ValueOperations operation = redisTemplate.opsForValue(); + return operation.get(key); + } + + /** + * 删除单个对象 + * + * @param key + */ + public boolean deleteObject(final String key) + { + return redisTemplate.delete(key); + } + + /** + * 删除集合对象 + * + * @param collection 多个对象 + * @return + */ + public boolean deleteObject(final Collection collection) + { + return redisTemplate.delete(collection) > 0; + } + + /** + * 缓存List数据 + * + * @param key 缓存的键值 + * @param dataList 待缓存的List数据 + * @return 缓存的对象 + */ + public long setCacheList(final String key, final List dataList) + { + Long count = redisTemplate.opsForList().rightPushAll(key, dataList); + return count == null ? 0 : count; + } + + /** + * 获得缓存的list对象 + * + * @param key 缓存的键值 + * @return 缓存键值对应的数据 + */ + public List getCacheList(final String key) + { + return redisTemplate.opsForList().range(key, 0, -1); + } + + /** + * 缓存Set + * + * @param key 缓存键值 + * @param dataSet 缓存的数据 + * @return 缓存数据的对象 + */ + public BoundSetOperations setCacheSet(final String key, final Set dataSet) + { + BoundSetOperations setOperation = redisTemplate.boundSetOps(key); + Iterator it = dataSet.iterator(); + while (it.hasNext()) + { + setOperation.add(it.next()); + } + return setOperation; + } + + /** + * 获得缓存的set + * + * @param key + * @return + */ + public Set getCacheSet(final String key) + { + return redisTemplate.opsForSet().members(key); + } + + /** + * 缓存Map + * + * @param key + * @param dataMap + */ + public void setCacheMap(final String key, final Map dataMap) + { + if (dataMap != null) { + redisTemplate.opsForHash().putAll(key, dataMap); + } + } + + /** + * 获得缓存的Map + * + * @param key + * @return + */ + public Map getCacheMap(final String key) + { + return redisTemplate.opsForHash().entries(key); + } + + /** + * 往Hash中存入数据 + * + * @param key Redis键 + * @param hKey Hash键 + * @param value 值 + */ + public void setCacheMapValue(final String key, final String hKey, final T value) + { + redisTemplate.opsForHash().put(key, hKey, value); + } + + /** + * 获取Hash中的数据 + * + * @param key Redis键 + * @param hKey Hash键 + * @return Hash中的对象 + */ + public T getCacheMapValue(final String key, final String hKey) + { + HashOperations opsForHash = redisTemplate.opsForHash(); + return opsForHash.get(key, hKey); + } + + /** + * 获取多个Hash中的数据 + * + * @param key Redis键 + * @param hKeys Hash键集合 + * @return Hash对象集合 + */ + public List getMultiCacheMapValue(final String key, final Collection hKeys) + { + return redisTemplate.opsForHash().multiGet(key, hKeys); + } + + /** + * 删除Hash中的某条数据 + * + * @param key Redis键 + * @param hKey Hash键 + * @return 是否成功 + */ + public boolean deleteCacheMapValue(final String key, final String hKey) + { + return redisTemplate.opsForHash().delete(key, hKey) > 0; + } + + /** + * 获得缓存的基本对象列表 + * + * @param pattern 字符串前缀 + * @return 对象列表 + */ + public Collection keys(final String pattern) + { + return redisTemplate.keys(pattern); + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/text/CharsetKit.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/text/CharsetKit.java new file mode 100644 index 0000000..8220fe7 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/text/CharsetKit.java @@ -0,0 +1,86 @@ +package com.ruoyi.common.core.text; + +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import com.ruoyi.common.utils.StringUtils; + +/** + * 字符集工具类 + * + * @author #author# + */ +public class CharsetKit +{ + /** ISO-8859-1 */ + public static final String ISO_8859_1 = "ISO-8859-1"; + /** UTF-8 */ + public static final String UTF_8 = "UTF-8"; + /** GBK */ + public static final String GBK = "GBK"; + + /** ISO-8859-1 */ + public static final Charset CHARSET_ISO_8859_1 = Charset.forName(ISO_8859_1); + /** UTF-8 */ + public static final Charset CHARSET_UTF_8 = Charset.forName(UTF_8); + /** GBK */ + public static final Charset CHARSET_GBK = Charset.forName(GBK); + + /** + * 转换为Charset对象 + * + * @param charset 字符集,为空则返回默认字符集 + * @return Charset + */ + public static Charset charset(String charset) + { + return StringUtils.isEmpty(charset) ? Charset.defaultCharset() : Charset.forName(charset); + } + + /** + * 转换字符串的字符集编码 + * + * @param source 字符串 + * @param srcCharset 源字符集,默认ISO-8859-1 + * @param destCharset 目标字符集,默认UTF-8 + * @return 转换后的字符集 + */ + public static String convert(String source, String srcCharset, String destCharset) + { + return convert(source, Charset.forName(srcCharset), Charset.forName(destCharset)); + } + + /** + * 转换字符串的字符集编码 + * + * @param source 字符串 + * @param srcCharset 源字符集,默认ISO-8859-1 + * @param destCharset 目标字符集,默认UTF-8 + * @return 转换后的字符集 + */ + public static String convert(String source, Charset srcCharset, Charset destCharset) + { + if (null == srcCharset) + { + srcCharset = StandardCharsets.ISO_8859_1; + } + + if (null == destCharset) + { + destCharset = StandardCharsets.UTF_8; + } + + if (StringUtils.isEmpty(source) || srcCharset.equals(destCharset)) + { + return source; + } + return new String(source.getBytes(srcCharset), destCharset); + } + + /** + * @return 系统字符集编码 + */ + public static String systemCharset() + { + return Charset.defaultCharset().name(); + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/text/Convert.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/text/Convert.java new file mode 100644 index 0000000..453e659 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/text/Convert.java @@ -0,0 +1,1000 @@ +package com.ruoyi.common.core.text; + +import java.math.BigDecimal; +import java.math.BigInteger; +import java.nio.ByteBuffer; +import java.nio.charset.Charset; +import java.text.NumberFormat; +import java.util.Set; +import com.ruoyi.common.utils.StringUtils; +import org.apache.commons.lang3.ArrayUtils; + +/** + * 类型转换器 + * + * @author #author# + */ +public class Convert +{ + /** + * 转换为字符串
+ * 如果给定的值为null,或者转换失败,返回默认值
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @param defaultValue 转换错误时的默认值 + * @return 结果 + */ + public static String toStr(Object value, String defaultValue) + { + if (null == value) + { + return defaultValue; + } + if (value instanceof String) + { + return (String) value; + } + return value.toString(); + } + + /** + * 转换为字符串
+ * 如果给定的值为null,或者转换失败,返回默认值null
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @return 结果 + */ + public static String toStr(Object value) + { + return toStr(value, null); + } + + /** + * 转换为字符
+ * 如果给定的值为null,或者转换失败,返回默认值
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @param defaultValue 转换错误时的默认值 + * @return 结果 + */ + public static Character toChar(Object value, Character defaultValue) + { + if (null == value) + { + return defaultValue; + } + if (value instanceof Character) + { + return (Character) value; + } + + final String valueStr = toStr(value, null); + return StringUtils.isEmpty(valueStr) ? defaultValue : valueStr.charAt(0); + } + + /** + * 转换为字符
+ * 如果给定的值为null,或者转换失败,返回默认值null
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @return 结果 + */ + public static Character toChar(Object value) + { + return toChar(value, null); + } + + /** + * 转换为byte
+ * 如果给定的值为null,或者转换失败,返回默认值
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @param defaultValue 转换错误时的默认值 + * @return 结果 + */ + public static Byte toByte(Object value, Byte defaultValue) + { + if (value == null) + { + return defaultValue; + } + if (value instanceof Byte) + { + return (Byte) value; + } + if (value instanceof Number) + { + return ((Number) value).byteValue(); + } + final String valueStr = toStr(value, null); + if (StringUtils.isEmpty(valueStr)) + { + return defaultValue; + } + try + { + return Byte.parseByte(valueStr); + } + catch (Exception e) + { + return defaultValue; + } + } + + /** + * 转换为byte
+ * 如果给定的值为null,或者转换失败,返回默认值null
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @return 结果 + */ + public static Byte toByte(Object value) + { + return toByte(value, null); + } + + /** + * 转换为Short
+ * 如果给定的值为null,或者转换失败,返回默认值
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @param defaultValue 转换错误时的默认值 + * @return 结果 + */ + public static Short toShort(Object value, Short defaultValue) + { + if (value == null) + { + return defaultValue; + } + if (value instanceof Short) + { + return (Short) value; + } + if (value instanceof Number) + { + return ((Number) value).shortValue(); + } + final String valueStr = toStr(value, null); + if (StringUtils.isEmpty(valueStr)) + { + return defaultValue; + } + try + { + return Short.parseShort(valueStr.trim()); + } + catch (Exception e) + { + return defaultValue; + } + } + + /** + * 转换为Short
+ * 如果给定的值为null,或者转换失败,返回默认值null
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @return 结果 + */ + public static Short toShort(Object value) + { + return toShort(value, null); + } + + /** + * 转换为Number
+ * 如果给定的值为空,或者转换失败,返回默认值
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @param defaultValue 转换错误时的默认值 + * @return 结果 + */ + public static Number toNumber(Object value, Number defaultValue) + { + if (value == null) + { + return defaultValue; + } + if (value instanceof Number) + { + return (Number) value; + } + final String valueStr = toStr(value, null); + if (StringUtils.isEmpty(valueStr)) + { + return defaultValue; + } + try + { + return NumberFormat.getInstance().parse(valueStr); + } + catch (Exception e) + { + return defaultValue; + } + } + + /** + * 转换为Number
+ * 如果给定的值为空,或者转换失败,返回默认值null
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @return 结果 + */ + public static Number toNumber(Object value) + { + return toNumber(value, null); + } + + /** + * 转换为int
+ * 如果给定的值为空,或者转换失败,返回默认值
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @param defaultValue 转换错误时的默认值 + * @return 结果 + */ + public static Integer toInt(Object value, Integer defaultValue) + { + if (value == null) + { + return defaultValue; + } + if (value instanceof Integer) + { + return (Integer) value; + } + if (value instanceof Number) + { + return ((Number) value).intValue(); + } + final String valueStr = toStr(value, null); + if (StringUtils.isEmpty(valueStr)) + { + return defaultValue; + } + try + { + return Integer.parseInt(valueStr.trim()); + } + catch (Exception e) + { + return defaultValue; + } + } + + /** + * 转换为int
+ * 如果给定的值为null,或者转换失败,返回默认值null
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @return 结果 + */ + public static Integer toInt(Object value) + { + return toInt(value, null); + } + + /** + * 转换为Integer数组
+ * + * @param str 被转换的值 + * @return 结果 + */ + public static Integer[] toIntArray(String str) + { + return toIntArray(",", str); + } + + /** + * 转换为Long数组
+ * + * @param str 被转换的值 + * @return 结果 + */ + public static Long[] toLongArray(String str) + { + return toLongArray(",", str); + } + + /** + * 转换为Integer数组
+ * + * @param split 分隔符 + * @param split 被转换的值 + * @return 结果 + */ + public static Integer[] toIntArray(String split, String str) + { + if (StringUtils.isEmpty(str)) + { + return new Integer[] {}; + } + String[] arr = str.split(split); + final Integer[] ints = new Integer[arr.length]; + for (int i = 0; i < arr.length; i++) + { + final Integer v = toInt(arr[i], 0); + ints[i] = v; + } + return ints; + } + + /** + * 转换为Long数组
+ * + * @param split 分隔符 + * @param str 被转换的值 + * @return 结果 + */ + public static Long[] toLongArray(String split, String str) + { + if (StringUtils.isEmpty(str)) + { + return new Long[] {}; + } + String[] arr = str.split(split); + final Long[] longs = new Long[arr.length]; + for (int i = 0; i < arr.length; i++) + { + final Long v = toLong(arr[i], null); + longs[i] = v; + } + return longs; + } + + /** + * 转换为String数组
+ * + * @param str 被转换的值 + * @return 结果 + */ + public static String[] toStrArray(String str) + { + return toStrArray(",", str); + } + + /** + * 转换为String数组
+ * + * @param split 分隔符 + * @param split 被转换的值 + * @return 结果 + */ + public static String[] toStrArray(String split, String str) + { + return str.split(split); + } + + /** + * 转换为long
+ * 如果给定的值为空,或者转换失败,返回默认值
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @param defaultValue 转换错误时的默认值 + * @return 结果 + */ + public static Long toLong(Object value, Long defaultValue) + { + if (value == null) + { + return defaultValue; + } + if (value instanceof Long) + { + return (Long) value; + } + if (value instanceof Number) + { + return ((Number) value).longValue(); + } + final String valueStr = toStr(value, null); + if (StringUtils.isEmpty(valueStr)) + { + return defaultValue; + } + try + { + // 支持科学计数法 + return new BigDecimal(valueStr.trim()).longValue(); + } + catch (Exception e) + { + return defaultValue; + } + } + + /** + * 转换为long
+ * 如果给定的值为null,或者转换失败,返回默认值null
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @return 结果 + */ + public static Long toLong(Object value) + { + return toLong(value, null); + } + + /** + * 转换为double
+ * 如果给定的值为空,或者转换失败,返回默认值
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @param defaultValue 转换错误时的默认值 + * @return 结果 + */ + public static Double toDouble(Object value, Double defaultValue) + { + if (value == null) + { + return defaultValue; + } + if (value instanceof Double) + { + return (Double) value; + } + if (value instanceof Number) + { + return ((Number) value).doubleValue(); + } + final String valueStr = toStr(value, null); + if (StringUtils.isEmpty(valueStr)) + { + return defaultValue; + } + try + { + // 支持科学计数法 + return new BigDecimal(valueStr.trim()).doubleValue(); + } + catch (Exception e) + { + return defaultValue; + } + } + + /** + * 转换为double
+ * 如果给定的值为空,或者转换失败,返回默认值null
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @return 结果 + */ + public static Double toDouble(Object value) + { + return toDouble(value, null); + } + + /** + * 转换为Float
+ * 如果给定的值为空,或者转换失败,返回默认值
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @param defaultValue 转换错误时的默认值 + * @return 结果 + */ + public static Float toFloat(Object value, Float defaultValue) + { + if (value == null) + { + return defaultValue; + } + if (value instanceof Float) + { + return (Float) value; + } + if (value instanceof Number) + { + return ((Number) value).floatValue(); + } + final String valueStr = toStr(value, null); + if (StringUtils.isEmpty(valueStr)) + { + return defaultValue; + } + try + { + return Float.parseFloat(valueStr.trim()); + } + catch (Exception e) + { + return defaultValue; + } + } + + /** + * 转换为Float
+ * 如果给定的值为空,或者转换失败,返回默认值null
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @return 结果 + */ + public static Float toFloat(Object value) + { + return toFloat(value, null); + } + + /** + * 转换为boolean
+ * String支持的值为:true、false、yes、ok、no,1,0 如果给定的值为空,或者转换失败,返回默认值
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @param defaultValue 转换错误时的默认值 + * @return 结果 + */ + public static Boolean toBool(Object value, Boolean defaultValue) + { + if (value == null) + { + return defaultValue; + } + if (value instanceof Boolean) + { + return (Boolean) value; + } + String valueStr = toStr(value, null); + if (StringUtils.isEmpty(valueStr)) + { + return defaultValue; + } + valueStr = valueStr.trim().toLowerCase(); + switch (valueStr) + { + case "true": + case "yes": + case "ok": + case "1": + return true; + case "false": + case "no": + case "0": + return false; + default: + return defaultValue; + } + } + + /** + * 转换为boolean
+ * 如果给定的值为空,或者转换失败,返回默认值null
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @return 结果 + */ + public static Boolean toBool(Object value) + { + return toBool(value, null); + } + + /** + * 转换为Enum对象
+ * 如果给定的值为空,或者转换失败,返回默认值
+ * + * @param clazz Enum的Class + * @param value 值 + * @param defaultValue 默认值 + * @return Enum + */ + public static > E toEnum(Class clazz, Object value, E defaultValue) + { + if (value == null) + { + return defaultValue; + } + if (clazz.isAssignableFrom(value.getClass())) + { + @SuppressWarnings("unchecked") + E myE = (E) value; + return myE; + } + final String valueStr = toStr(value, null); + if (StringUtils.isEmpty(valueStr)) + { + return defaultValue; + } + try + { + return Enum.valueOf(clazz, valueStr); + } + catch (Exception e) + { + return defaultValue; + } + } + + /** + * 转换为Enum对象
+ * 如果给定的值为空,或者转换失败,返回默认值null
+ * + * @param clazz Enum的Class + * @param value 值 + * @return Enum + */ + public static > E toEnum(Class clazz, Object value) + { + return toEnum(clazz, value, null); + } + + /** + * 转换为BigInteger
+ * 如果给定的值为空,或者转换失败,返回默认值
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @param defaultValue 转换错误时的默认值 + * @return 结果 + */ + public static BigInteger toBigInteger(Object value, BigInteger defaultValue) + { + if (value == null) + { + return defaultValue; + } + if (value instanceof BigInteger) + { + return (BigInteger) value; + } + if (value instanceof Long) + { + return BigInteger.valueOf((Long) value); + } + final String valueStr = toStr(value, null); + if (StringUtils.isEmpty(valueStr)) + { + return defaultValue; + } + try + { + return new BigInteger(valueStr); + } + catch (Exception e) + { + return defaultValue; + } + } + + /** + * 转换为BigInteger
+ * 如果给定的值为空,或者转换失败,返回默认值null
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @return 结果 + */ + public static BigInteger toBigInteger(Object value) + { + return toBigInteger(value, null); + } + + /** + * 转换为BigDecimal
+ * 如果给定的值为空,或者转换失败,返回默认值
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @param defaultValue 转换错误时的默认值 + * @return 结果 + */ + public static BigDecimal toBigDecimal(Object value, BigDecimal defaultValue) + { + if (value == null) + { + return defaultValue; + } + if (value instanceof BigDecimal) + { + return (BigDecimal) value; + } + if (value instanceof Long) + { + return new BigDecimal((Long) value); + } + if (value instanceof Double) + { + return BigDecimal.valueOf((Double) value); + } + if (value instanceof Integer) + { + return new BigDecimal((Integer) value); + } + final String valueStr = toStr(value, null); + if (StringUtils.isEmpty(valueStr)) + { + return defaultValue; + } + try + { + return new BigDecimal(valueStr); + } + catch (Exception e) + { + return defaultValue; + } + } + + /** + * 转换为BigDecimal
+ * 如果给定的值为空,或者转换失败,返回默认值
+ * 转换失败不会报错 + * + * @param value 被转换的值 + * @return 结果 + */ + public static BigDecimal toBigDecimal(Object value) + { + return toBigDecimal(value, null); + } + + /** + * 将对象转为字符串
+ * 1、Byte数组和ByteBuffer会被转换为对应字符串的数组 2、对象数组会调用Arrays.toString方法 + * + * @param obj 对象 + * @return 字符串 + */ + public static String utf8Str(Object obj) + { + return str(obj, CharsetKit.CHARSET_UTF_8); + } + + /** + * 将对象转为字符串
+ * 1、Byte数组和ByteBuffer会被转换为对应字符串的数组 2、对象数组会调用Arrays.toString方法 + * + * @param obj 对象 + * @param charsetName 字符集 + * @return 字符串 + */ + public static String str(Object obj, String charsetName) + { + return str(obj, Charset.forName(charsetName)); + } + + /** + * 将对象转为字符串
+ * 1、Byte数组和ByteBuffer会被转换为对应字符串的数组 2、对象数组会调用Arrays.toString方法 + * + * @param obj 对象 + * @param charset 字符集 + * @return 字符串 + */ + public static String str(Object obj, Charset charset) + { + if (null == obj) + { + return null; + } + + if (obj instanceof String) + { + return (String) obj; + } + else if (obj instanceof byte[]) + { + return str((byte[]) obj, charset); + } + else if (obj instanceof Byte[]) + { + byte[] bytes = ArrayUtils.toPrimitive((Byte[]) obj); + return str(bytes, charset); + } + else if (obj instanceof ByteBuffer) + { + return str((ByteBuffer) obj, charset); + } + return obj.toString(); + } + + /** + * 将byte数组转为字符串 + * + * @param bytes byte数组 + * @param charset 字符集 + * @return 字符串 + */ + public static String str(byte[] bytes, String charset) + { + return str(bytes, StringUtils.isEmpty(charset) ? Charset.defaultCharset() : Charset.forName(charset)); + } + + /** + * 解码字节码 + * + * @param data 字符串 + * @param charset 字符集,如果此字段为空,则解码的结果取决于平台 + * @return 解码后的字符串 + */ + public static String str(byte[] data, Charset charset) + { + if (data == null) + { + return null; + } + + if (null == charset) + { + return new String(data); + } + return new String(data, charset); + } + + /** + * 将编码的byteBuffer数据转换为字符串 + * + * @param data 数据 + * @param charset 字符集,如果为空使用当前系统字符集 + * @return 字符串 + */ + public static String str(ByteBuffer data, String charset) + { + if (data == null) + { + return null; + } + + return str(data, Charset.forName(charset)); + } + + /** + * 将编码的byteBuffer数据转换为字符串 + * + * @param data 数据 + * @param charset 字符集,如果为空使用当前系统字符集 + * @return 字符串 + */ + public static String str(ByteBuffer data, Charset charset) + { + if (null == charset) + { + charset = Charset.defaultCharset(); + } + return charset.decode(data).toString(); + } + + // ----------------------------------------------------------------------- 全角半角转换 + /** + * 半角转全角 + * + * @param input String. + * @return 全角字符串. + */ + public static String toSBC(String input) + { + return toSBC(input, null); + } + + /** + * 半角转全角 + * + * @param input String + * @param notConvertSet 不替换的字符集合 + * @return 全角字符串. + */ + public static String toSBC(String input, Set notConvertSet) + { + char[] c = input.toCharArray(); + for (int i = 0; i < c.length; i++) + { + if (null != notConvertSet && notConvertSet.contains(c[i])) + { + // 跳过不替换的字符 + continue; + } + + if (c[i] == ' ') + { + c[i] = '\u3000'; + } + else if (c[i] < '\177') + { + c[i] = (char) (c[i] + 65248); + + } + } + return new String(c); + } + + /** + * 全角转半角 + * + * @param input String. + * @return 半角字符串 + */ + public static String toDBC(String input) + { + return toDBC(input, null); + } + + /** + * 替换全角为半角 + * + * @param text 文本 + * @param notConvertSet 不替换的字符集合 + * @return 替换后的字符 + */ + public static String toDBC(String text, Set notConvertSet) + { + char[] c = text.toCharArray(); + for (int i = 0; i < c.length; i++) + { + if (null != notConvertSet && notConvertSet.contains(c[i])) + { + // 跳过不替换的字符 + continue; + } + + if (c[i] == '\u3000') + { + c[i] = ' '; + } + else if (c[i] > '\uFF00' && c[i] < '\uFF5F') + { + c[i] = (char) (c[i] - 65248); + } + } + String returnString = new String(c); + + return returnString; + } + + /** + * 数字金额大写转换 先写个完整的然后将如零拾替换成零 + * + * @param n 数字 + * @return 中文大写数字 + */ + public static String digitUppercase(double n) + { + String[] fraction = { "角", "分" }; + String[] digit = { "零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖" }; + String[][] unit = { { "元", "万", "亿" }, { "", "拾", "佰", "仟" } }; + + String head = n < 0 ? "负" : ""; + n = Math.abs(n); + + String s = ""; + for (int i = 0; i < fraction.length; i++) + { + s += (digit[(int) (Math.floor(n * 10 * Math.pow(10, i)) % 10)] + fraction[i]).replaceAll("(零.)+", ""); + } + if (s.length() < 1) + { + s = "整"; + } + int integerPart = (int) Math.floor(n); + + for (int i = 0; i < unit[0].length && integerPart > 0; i++) + { + String p = ""; + for (int j = 0; j < unit[1].length && n > 0; j++) + { + p = digit[integerPart % 10] + unit[1][j] + p; + integerPart = integerPart / 10; + } + s = p.replaceAll("(零.)*零$", "").replaceAll("^$", "零") + unit[0][i] + s; + } + return head + s.replaceAll("(零.)*零元", "元").replaceFirst("(零.)+", "").replaceAll("(零.)+", "零").replaceAll("^整$", "零元整"); + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/text/StrFormatter.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/text/StrFormatter.java new file mode 100644 index 0000000..f0e83be --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/text/StrFormatter.java @@ -0,0 +1,92 @@ +package com.ruoyi.common.core.text; + +import com.ruoyi.common.utils.StringUtils; + +/** + * 字符串格式化 + * + * @author #author# + */ +public class StrFormatter +{ + public static final String EMPTY_JSON = "{}"; + public static final char C_BACKSLASH = '\\'; + public static final char C_DELIM_START = '{'; + public static final char C_DELIM_END = '}'; + + /** + * 格式化字符串
+ * 此方法只是简单将占位符 {} 按照顺序替换为参数
+ * 如果想输出 {} 使用 \\转义 { 即可,如果想输出 {} 之前的 \ 使用双转义符 \\\\ 即可
+ * 例:
+ * 通常使用:format("this is {} for {}", "a", "b") -> this is a for b
+ * 转义{}: format("this is \\{} for {}", "a", "b") -> this is \{} for a
+ * 转义\: format("this is \\\\{} for {}", "a", "b") -> this is \a for b
+ * + * @param strPattern 字符串模板 + * @param argArray 参数列表 + * @return 结果 + */ + public static String format(final String strPattern, final Object... argArray) + { + if (StringUtils.isEmpty(strPattern) || StringUtils.isEmpty(argArray)) + { + return strPattern; + } + final int strPatternLength = strPattern.length(); + + // 初始化定义好的长度以获得更好的性能 + StringBuilder sbuf = new StringBuilder(strPatternLength + 50); + + int handledPosition = 0; + int delimIndex;// 占位符所在位置 + for (int argIndex = 0; argIndex < argArray.length; argIndex++) + { + delimIndex = strPattern.indexOf(EMPTY_JSON, handledPosition); + if (delimIndex == -1) + { + if (handledPosition == 0) + { + return strPattern; + } + else + { // 字符串模板剩余部分不再包含占位符,加入剩余部分后返回结果 + sbuf.append(strPattern, handledPosition, strPatternLength); + return sbuf.toString(); + } + } + else + { + if (delimIndex > 0 && strPattern.charAt(delimIndex - 1) == C_BACKSLASH) + { + if (delimIndex > 1 && strPattern.charAt(delimIndex - 2) == C_BACKSLASH) + { + // 转义符之前还有一个转义符,占位符依旧有效 + sbuf.append(strPattern, handledPosition, delimIndex - 1); + sbuf.append(Convert.utf8Str(argArray[argIndex])); + handledPosition = delimIndex + 2; + } + else + { + // 占位符被转义 + argIndex--; + sbuf.append(strPattern, handledPosition, delimIndex - 1); + sbuf.append(C_DELIM_START); + handledPosition = delimIndex + 1; + } + } + else + { + // 正常占位符 + sbuf.append(strPattern, handledPosition, delimIndex); + sbuf.append(Convert.utf8Str(argArray[argIndex])); + handledPosition = delimIndex + 2; + } + } + } + // 加入最后一个占位符后所有的字符 + sbuf.append(strPattern, handledPosition, strPattern.length()); + + return sbuf.toString(); + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/enums/BusinessStatus.java b/ruoyi-common/src/main/java/com/ruoyi/common/enums/BusinessStatus.java new file mode 100644 index 0000000..3cdeb10 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/enums/BusinessStatus.java @@ -0,0 +1,20 @@ +package com.ruoyi.common.enums; + +/** + * 操作状态 + * + * @author #author# + * + */ +public enum BusinessStatus +{ + /** + * 成功 + */ + SUCCESS, + + /** + * 失败 + */ + FAIL, +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/enums/BusinessType.java b/ruoyi-common/src/main/java/com/ruoyi/common/enums/BusinessType.java new file mode 100644 index 0000000..00a017d --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/enums/BusinessType.java @@ -0,0 +1,59 @@ +package com.ruoyi.common.enums; + +/** + * 业务操作类型 + * + * @author #author# + */ +public enum BusinessType +{ + /** + * 其它 + */ + OTHER, + + /** + * 新增 + */ + INSERT, + + /** + * 修改 + */ + UPDATE, + + /** + * 删除 + */ + DELETE, + + /** + * 授权 + */ + GRANT, + + /** + * 导出 + */ + EXPORT, + + /** + * 导入 + */ + IMPORT, + + /** + * 强退 + */ + FORCE, + + /** + * 生成代码 + */ + GENCODE, + + /** + * 清空数据 + */ + CLEAN, +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/enums/DataSourceType.java b/ruoyi-common/src/main/java/com/ruoyi/common/enums/DataSourceType.java new file mode 100644 index 0000000..afc2106 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/enums/DataSourceType.java @@ -0,0 +1,19 @@ +package com.ruoyi.common.enums; + +/** + * 数据源 + * + * @author #author# + */ +public enum DataSourceType +{ + /** + * 主库 + */ + MASTER, + + /** + * 从库 + */ + SLAVE +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/enums/HttpMethod.java b/ruoyi-common/src/main/java/com/ruoyi/common/enums/HttpMethod.java new file mode 100644 index 0000000..6daa2dd --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/enums/HttpMethod.java @@ -0,0 +1,36 @@ +package com.ruoyi.common.enums; + +import java.util.HashMap; +import java.util.Map; +import org.springframework.lang.Nullable; + +/** + * 请求方式 + * + * @author #author# + */ +public enum HttpMethod +{ + GET, HEAD, POST, PUT, PATCH, DELETE, OPTIONS, TRACE; + + private static final Map mappings = new HashMap<>(16); + + static + { + for (HttpMethod httpMethod : values()) + { + mappings.put(httpMethod.name(), httpMethod); + } + } + + @Nullable + public static HttpMethod resolve(@Nullable String method) + { + return (method != null ? mappings.get(method) : null); + } + + public boolean matches(String method) + { + return (this == resolve(method)); + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/enums/LimitType.java b/ruoyi-common/src/main/java/com/ruoyi/common/enums/LimitType.java new file mode 100644 index 0000000..cde04fd --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/enums/LimitType.java @@ -0,0 +1,20 @@ +package com.ruoyi.common.enums; + +/** + * 限流类型 + * + * @author #author# + */ + +public enum LimitType +{ + /** + * 默认策略全局限流 + */ + DEFAULT, + + /** + * 根据请求者IP进行限流 + */ + IP +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/enums/OperatorType.java b/ruoyi-common/src/main/java/com/ruoyi/common/enums/OperatorType.java new file mode 100644 index 0000000..588e03d --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/enums/OperatorType.java @@ -0,0 +1,24 @@ +package com.ruoyi.common.enums; + +/** + * 操作人类别 + * + * @author #author# + */ +public enum OperatorType +{ + /** + * 其它 + */ + OTHER, + + /** + * 后台用户 + */ + MANAGE, + + /** + * 手机端用户 + */ + MOBILE +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/enums/UserStatus.java b/ruoyi-common/src/main/java/com/ruoyi/common/enums/UserStatus.java new file mode 100644 index 0000000..ad15be2 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/enums/UserStatus.java @@ -0,0 +1,30 @@ +package com.ruoyi.common.enums; + +/** + * 用户状态 + * + * @author #author# + */ +public enum UserStatus +{ + OK("0", "正常"), DISABLE("1", "停用"), DELETED("2", "删除"); + + private final String code; + private final String info; + + UserStatus(String code, String info) + { + this.code = code; + this.info = info; + } + + public String getCode() + { + return code; + } + + public String getInfo() + { + return info; + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/exception/DemoModeException.java b/ruoyi-common/src/main/java/com/ruoyi/common/exception/DemoModeException.java new file mode 100644 index 0000000..25842fd --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/exception/DemoModeException.java @@ -0,0 +1,15 @@ +package com.ruoyi.common.exception; + +/** + * 演示模式异常 + * + * @author #author# + */ +public class DemoModeException extends RuntimeException +{ + private static final long serialVersionUID = 1L; + + public DemoModeException() + { + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/exception/GlobalException.java b/ruoyi-common/src/main/java/com/ruoyi/common/exception/GlobalException.java new file mode 100644 index 0000000..76f0982 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/exception/GlobalException.java @@ -0,0 +1,58 @@ +package com.ruoyi.common.exception; + +/** + * 全局异常 + * + * @author #author# + */ +public class GlobalException extends RuntimeException +{ + private static final long serialVersionUID = 1L; + + /** + * 错误提示 + */ + private String message; + + /** + * 错误明细,内部调试错误 + * + * 和 {@link CommonResult#getDetailMessage()} 一致的设计 + */ + private String detailMessage; + + /** + * 空构造方法,避免反序列化问题 + */ + public GlobalException() + { + } + + public GlobalException(String message) + { + this.message = message; + } + + public String getDetailMessage() + { + return detailMessage; + } + + public GlobalException setDetailMessage(String detailMessage) + { + this.detailMessage = detailMessage; + return this; + } + + @Override + public String getMessage() + { + return message; + } + + public GlobalException setMessage(String message) + { + this.message = message; + return this; + } +} \ No newline at end of file diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/exception/ServiceException.java b/ruoyi-common/src/main/java/com/ruoyi/common/exception/ServiceException.java new file mode 100644 index 0000000..4ac42e8 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/exception/ServiceException.java @@ -0,0 +1,74 @@ +package com.ruoyi.common.exception; + +/** + * 业务异常 + * + * @author #author# + */ +public final class ServiceException extends RuntimeException +{ + private static final long serialVersionUID = 1L; + + /** + * 错误码 + */ + private Integer code; + + /** + * 错误提示 + */ + private String message; + + /** + * 错误明细,内部调试错误 + * + * 和 {@link CommonResult#getDetailMessage()} 一致的设计 + */ + private String detailMessage; + + /** + * 空构造方法,避免反序列化问题 + */ + public ServiceException() + { + } + + public ServiceException(String message) + { + this.message = message; + } + + public ServiceException(String message, Integer code) + { + this.message = message; + this.code = code; + } + + public String getDetailMessage() + { + return detailMessage; + } + + @Override + public String getMessage() + { + return message; + } + + public Integer getCode() + { + return code; + } + + public ServiceException setMessage(String message) + { + this.message = message; + return this; + } + + public ServiceException setDetailMessage(String detailMessage) + { + this.detailMessage = detailMessage; + return this; + } +} \ No newline at end of file diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/exception/UtilException.java b/ruoyi-common/src/main/java/com/ruoyi/common/exception/UtilException.java new file mode 100644 index 0000000..5ca412d --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/exception/UtilException.java @@ -0,0 +1,26 @@ +package com.ruoyi.common.exception; + +/** + * 工具类异常 + * + * @author #author# + */ +public class UtilException extends RuntimeException +{ + private static final long serialVersionUID = 8247610319171014183L; + + public UtilException(Throwable e) + { + super(e.getMessage(), e); + } + + public UtilException(String message) + { + super(message); + } + + public UtilException(String message, Throwable throwable) + { + super(message, throwable); + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/exception/base/BaseException.java b/ruoyi-common/src/main/java/com/ruoyi/common/exception/base/BaseException.java new file mode 100644 index 0000000..3f8220a --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/exception/base/BaseException.java @@ -0,0 +1,97 @@ +package com.ruoyi.common.exception.base; + +import com.ruoyi.common.utils.MessageUtils; +import com.ruoyi.common.utils.StringUtils; + +/** + * 基础异常 + * + * @author #author# + */ +public class BaseException extends RuntimeException +{ + private static final long serialVersionUID = 1L; + + /** + * 所属模块 + */ + private String module; + + /** + * 错误码 + */ + private String code; + + /** + * 错误码对应的参数 + */ + private Object[] args; + + /** + * 错误消息 + */ + private String defaultMessage; + + public BaseException(String module, String code, Object[] args, String defaultMessage) + { + this.module = module; + this.code = code; + this.args = args; + this.defaultMessage = defaultMessage; + } + + public BaseException(String module, String code, Object[] args) + { + this(module, code, args, null); + } + + public BaseException(String module, String defaultMessage) + { + this(module, null, null, defaultMessage); + } + + public BaseException(String code, Object[] args) + { + this(null, code, args, null); + } + + public BaseException(String defaultMessage) + { + this(null, null, null, defaultMessage); + } + + @Override + public String getMessage() + { + String message = null; + if (!StringUtils.isEmpty(code)) + { + message = MessageUtils.message(code, args); + } + if (message == null) + { + message = defaultMessage; + } + return message; + } + + public String getModule() + { + return module; + } + + public String getCode() + { + return code; + } + + public Object[] getArgs() + { + return args; + } + + public String getDefaultMessage() + { + return defaultMessage; + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/exception/file/FileException.java b/ruoyi-common/src/main/java/com/ruoyi/common/exception/file/FileException.java new file mode 100644 index 0000000..c682535 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/exception/file/FileException.java @@ -0,0 +1,19 @@ +package com.ruoyi.common.exception.file; + +import com.ruoyi.common.exception.base.BaseException; + +/** + * 文件信息异常类 + * + * @author #author# + */ +public class FileException extends BaseException +{ + private static final long serialVersionUID = 1L; + + public FileException(String code, Object[] args) + { + super("file", code, args, null); + } + +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/exception/file/FileNameLengthLimitExceededException.java b/ruoyi-common/src/main/java/com/ruoyi/common/exception/file/FileNameLengthLimitExceededException.java new file mode 100644 index 0000000..b0dcf3a --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/exception/file/FileNameLengthLimitExceededException.java @@ -0,0 +1,16 @@ +package com.ruoyi.common.exception.file; + +/** + * 文件名称超长限制异常类 + * + * @author #author# + */ +public class FileNameLengthLimitExceededException extends FileException +{ + private static final long serialVersionUID = 1L; + + public FileNameLengthLimitExceededException(int defaultFileNameLength) + { + super("upload.filename.exceed.length", new Object[] { defaultFileNameLength }); + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/exception/file/FileSizeLimitExceededException.java b/ruoyi-common/src/main/java/com/ruoyi/common/exception/file/FileSizeLimitExceededException.java new file mode 100644 index 0000000..69f2e2e --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/exception/file/FileSizeLimitExceededException.java @@ -0,0 +1,16 @@ +package com.ruoyi.common.exception.file; + +/** + * 文件名大小限制异常类 + * + * @author #author# + */ +public class FileSizeLimitExceededException extends FileException +{ + private static final long serialVersionUID = 1L; + + public FileSizeLimitExceededException(long defaultMaxSize) + { + super("upload.exceed.maxSize", new Object[] { defaultMaxSize }); + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/exception/file/InvalidExtensionException.java b/ruoyi-common/src/main/java/com/ruoyi/common/exception/file/InvalidExtensionException.java new file mode 100644 index 0000000..7047bb6 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/exception/file/InvalidExtensionException.java @@ -0,0 +1,81 @@ +package com.ruoyi.common.exception.file; + +import java.util.Arrays; +import org.apache.commons.fileupload.FileUploadException; + +/** + * 文件上传 误异常类 + * + * @author #author# + */ +public class InvalidExtensionException extends FileUploadException +{ + private static final long serialVersionUID = 1L; + + private String[] allowedExtension; + private String extension; + private String filename; + + public InvalidExtensionException(String[] allowedExtension, String extension, String filename) + { + super("文件[" + filename + "]后缀[" + extension + "]不正确,请上传" + Arrays.toString(allowedExtension) + "格式"); + this.allowedExtension = allowedExtension; + this.extension = extension; + this.filename = filename; + } + + public String[] getAllowedExtension() + { + return allowedExtension; + } + + public String getExtension() + { + return extension; + } + + public String getFilename() + { + return filename; + } + + public static class InvalidImageExtensionException extends InvalidExtensionException + { + private static final long serialVersionUID = 1L; + + public InvalidImageExtensionException(String[] allowedExtension, String extension, String filename) + { + super(allowedExtension, extension, filename); + } + } + + public static class InvalidFlashExtensionException extends InvalidExtensionException + { + private static final long serialVersionUID = 1L; + + public InvalidFlashExtensionException(String[] allowedExtension, String extension, String filename) + { + super(allowedExtension, extension, filename); + } + } + + public static class InvalidMediaExtensionException extends InvalidExtensionException + { + private static final long serialVersionUID = 1L; + + public InvalidMediaExtensionException(String[] allowedExtension, String extension, String filename) + { + super(allowedExtension, extension, filename); + } + } + + public static class InvalidVideoExtensionException extends InvalidExtensionException + { + private static final long serialVersionUID = 1L; + + public InvalidVideoExtensionException(String[] allowedExtension, String extension, String filename) + { + super(allowedExtension, extension, filename); + } + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/exception/job/TaskException.java b/ruoyi-common/src/main/java/com/ruoyi/common/exception/job/TaskException.java new file mode 100644 index 0000000..defd070 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/exception/job/TaskException.java @@ -0,0 +1,34 @@ +package com.ruoyi.common.exception.job; + +/** + * 计划策略异常 + * + * @author #author# + */ +public class TaskException extends Exception +{ + private static final long serialVersionUID = 1L; + + private Code code; + + public TaskException(String msg, Code code) + { + this(msg, code, null); + } + + public TaskException(String msg, Code code, Exception nestedEx) + { + super(msg, nestedEx); + this.code = code; + } + + public Code getCode() + { + return code; + } + + public enum Code + { + TASK_EXISTS, NO_TASK_EXISTS, TASK_ALREADY_STARTED, UNKNOWN, CONFIG_ERROR, TASK_NODE_NOT_AVAILABLE + } +} \ No newline at end of file diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/exception/user/CaptchaException.java b/ruoyi-common/src/main/java/com/ruoyi/common/exception/user/CaptchaException.java new file mode 100644 index 0000000..a2cc1e5 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/exception/user/CaptchaException.java @@ -0,0 +1,16 @@ +package com.ruoyi.common.exception.user; + +/** + * 验证码错误异常类 + * + * @author #author# + */ +public class CaptchaException extends UserException +{ + private static final long serialVersionUID = 1L; + + public CaptchaException() + { + super("user.jcaptcha.error", null); + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/exception/user/CaptchaExpireException.java b/ruoyi-common/src/main/java/com/ruoyi/common/exception/user/CaptchaExpireException.java new file mode 100644 index 0000000..9c32525 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/exception/user/CaptchaExpireException.java @@ -0,0 +1,16 @@ +package com.ruoyi.common.exception.user; + +/** + * 验证码失效异常类 + * + * @author #author# + */ +public class CaptchaExpireException extends UserException +{ + private static final long serialVersionUID = 1L; + + public CaptchaExpireException() + { + super("user.jcaptcha.expire", null); + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/exception/user/UserException.java b/ruoyi-common/src/main/java/com/ruoyi/common/exception/user/UserException.java new file mode 100644 index 0000000..011d087 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/exception/user/UserException.java @@ -0,0 +1,18 @@ +package com.ruoyi.common.exception.user; + +import com.ruoyi.common.exception.base.BaseException; + +/** + * 用户信息异常类 + * + * @author #author# + */ +public class UserException extends BaseException +{ + private static final long serialVersionUID = 1L; + + public UserException(String code, Object[] args) + { + super("user", code, args, null); + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/exception/user/UserPasswordNotMatchException.java b/ruoyi-common/src/main/java/com/ruoyi/common/exception/user/UserPasswordNotMatchException.java new file mode 100644 index 0000000..061c019 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/exception/user/UserPasswordNotMatchException.java @@ -0,0 +1,16 @@ +package com.ruoyi.common.exception.user; + +/** + * 用户密码不正确或不符合规范异常类 + * + * @author #author# + */ +public class UserPasswordNotMatchException extends UserException +{ + private static final long serialVersionUID = 1L; + + public UserPasswordNotMatchException() + { + super("user.password.not.match", null); + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/exception/user/UserPasswordRetryLimitExceedException.java b/ruoyi-common/src/main/java/com/ruoyi/common/exception/user/UserPasswordRetryLimitExceedException.java new file mode 100644 index 0000000..8bd1d6f --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/exception/user/UserPasswordRetryLimitExceedException.java @@ -0,0 +1,16 @@ +package com.ruoyi.common.exception.user; + +/** + * 用户错误最大次数异常类 + * + * @author #author# + */ +public class UserPasswordRetryLimitExceedException extends UserException +{ + private static final long serialVersionUID = 1L; + + public UserPasswordRetryLimitExceedException(int retryLimitCount, int lockTime) + { + super("user.password.retry.limit.exceed", new Object[] { retryLimitCount, lockTime }); + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/filter/PropertyPreExcludeFilter.java b/ruoyi-common/src/main/java/com/ruoyi/common/filter/PropertyPreExcludeFilter.java new file mode 100644 index 0000000..b01e78a --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/filter/PropertyPreExcludeFilter.java @@ -0,0 +1,24 @@ +package com.ruoyi.common.filter; + +import com.alibaba.fastjson2.filter.SimplePropertyPreFilter; + +/** + * 排除JSON敏感属性 + * + * @author #author# + */ +public class PropertyPreExcludeFilter extends SimplePropertyPreFilter +{ + public PropertyPreExcludeFilter() + { + } + + public PropertyPreExcludeFilter addExcludes(String... filters) + { + for (int i = 0; i < filters.length; i++) + { + this.getExcludes().add(filters[i]); + } + return this; + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/filter/RepeatableFilter.java b/ruoyi-common/src/main/java/com/ruoyi/common/filter/RepeatableFilter.java new file mode 100644 index 0000000..e5bdab0 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/filter/RepeatableFilter.java @@ -0,0 +1,52 @@ +package com.ruoyi.common.filter; + +import java.io.IOException; +import javax.servlet.Filter; +import javax.servlet.FilterChain; +import javax.servlet.FilterConfig; +import javax.servlet.ServletException; +import javax.servlet.ServletRequest; +import javax.servlet.ServletResponse; +import javax.servlet.http.HttpServletRequest; +import org.springframework.http.MediaType; +import com.ruoyi.common.utils.StringUtils; + +/** + * Repeatable 过滤器 + * + * @author #author# + */ +public class RepeatableFilter implements Filter +{ + @Override + public void init(FilterConfig filterConfig) throws ServletException + { + + } + + @Override + public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) + throws IOException, ServletException + { + ServletRequest requestWrapper = null; + if (request instanceof HttpServletRequest + && StringUtils.startsWithIgnoreCase(request.getContentType(), MediaType.APPLICATION_JSON_VALUE)) + { + requestWrapper = new RepeatedlyRequestWrapper((HttpServletRequest) request, response); + } + if (null == requestWrapper) + { + chain.doFilter(request, response); + } + else + { + chain.doFilter(requestWrapper, response); + } + } + + @Override + public void destroy() + { + + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/filter/RepeatedlyRequestWrapper.java b/ruoyi-common/src/main/java/com/ruoyi/common/filter/RepeatedlyRequestWrapper.java new file mode 100644 index 0000000..9f7bdb2 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/filter/RepeatedlyRequestWrapper.java @@ -0,0 +1,76 @@ +package com.ruoyi.common.filter; + +import java.io.BufferedReader; +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.InputStreamReader; +import javax.servlet.ReadListener; +import javax.servlet.ServletInputStream; +import javax.servlet.ServletResponse; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletRequestWrapper; +import com.ruoyi.common.utils.http.HttpHelper; +import com.ruoyi.common.constant.Constants; + +/** + * 构建可重复读取inputStream的request + * + * @author #author# + */ +public class RepeatedlyRequestWrapper extends HttpServletRequestWrapper +{ + private final byte[] body; + + public RepeatedlyRequestWrapper(HttpServletRequest request, ServletResponse response) throws IOException + { + super(request); + request.setCharacterEncoding(Constants.UTF8); + response.setCharacterEncoding(Constants.UTF8); + + body = HttpHelper.getBodyString(request).getBytes(Constants.UTF8); + } + + @Override + public BufferedReader getReader() throws IOException + { + return new BufferedReader(new InputStreamReader(getInputStream())); + } + + @Override + public ServletInputStream getInputStream() throws IOException + { + final ByteArrayInputStream bais = new ByteArrayInputStream(body); + return new ServletInputStream() + { + @Override + public int read() throws IOException + { + return bais.read(); + } + + @Override + public int available() throws IOException + { + return body.length; + } + + @Override + public boolean isFinished() + { + return false; + } + + @Override + public boolean isReady() + { + return false; + } + + @Override + public void setReadListener(ReadListener readListener) + { + + } + }; + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/filter/XssFilter.java b/ruoyi-common/src/main/java/com/ruoyi/common/filter/XssFilter.java new file mode 100644 index 0000000..e3c587c --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/filter/XssFilter.java @@ -0,0 +1,75 @@ +package com.ruoyi.common.filter; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import javax.servlet.Filter; +import javax.servlet.FilterChain; +import javax.servlet.FilterConfig; +import javax.servlet.ServletException; +import javax.servlet.ServletRequest; +import javax.servlet.ServletResponse; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.common.enums.HttpMethod; + +/** + * 防止XSS攻击的过滤器 + * + * @author #author# + */ +public class XssFilter implements Filter +{ + /** + * 排除链接 + */ + public List excludes = new ArrayList<>(); + + @Override + public void init(FilterConfig filterConfig) throws ServletException + { + String tempExcludes = filterConfig.getInitParameter("excludes"); + if (StringUtils.isNotEmpty(tempExcludes)) + { + String[] url = tempExcludes.split(","); + for (int i = 0; url != null && i < url.length; i++) + { + excludes.add(url[i]); + } + } + } + + @Override + public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) + throws IOException, ServletException + { + HttpServletRequest req = (HttpServletRequest) request; + HttpServletResponse resp = (HttpServletResponse) response; + if (handleExcludeURL(req, resp)) + { + chain.doFilter(request, response); + return; + } + XssHttpServletRequestWrapper xssRequest = new XssHttpServletRequestWrapper((HttpServletRequest) request); + chain.doFilter(xssRequest, response); + } + + private boolean handleExcludeURL(HttpServletRequest request, HttpServletResponse response) + { + String url = request.getServletPath(); + String method = request.getMethod(); + // GET DELETE 不过滤 + if (method == null || HttpMethod.GET.matches(method) || HttpMethod.DELETE.matches(method)) + { + return true; + } + return StringUtils.matches(url, excludes); + } + + @Override + public void destroy() + { + + } +} \ No newline at end of file diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/filter/XssHttpServletRequestWrapper.java b/ruoyi-common/src/main/java/com/ruoyi/common/filter/XssHttpServletRequestWrapper.java new file mode 100644 index 0000000..ad183e7 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/filter/XssHttpServletRequestWrapper.java @@ -0,0 +1,111 @@ +package com.ruoyi.common.filter; + +import java.io.ByteArrayInputStream; +import java.io.IOException; +import javax.servlet.ReadListener; +import javax.servlet.ServletInputStream; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletRequestWrapper; +import org.apache.commons.io.IOUtils; +import org.springframework.http.HttpHeaders; +import org.springframework.http.MediaType; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.common.utils.html.EscapeUtil; + +/** + * XSS过滤处理 + * + * @author #author# + */ +public class XssHttpServletRequestWrapper extends HttpServletRequestWrapper +{ + /** + * @param request + */ + public XssHttpServletRequestWrapper(HttpServletRequest request) + { + super(request); + } + + @Override + public String[] getParameterValues(String name) + { + String[] values = super.getParameterValues(name); + if (values != null) + { + int length = values.length; + String[] escapesValues = new String[length]; + for (int i = 0; i < length; i++) + { + // 防xss攻击和过滤前后空格 + escapesValues[i] = EscapeUtil.clean(values[i]).trim(); + } + return escapesValues; + } + return super.getParameterValues(name); + } + + @Override + public ServletInputStream getInputStream() throws IOException + { + // 非json类型,直接返回 + if (!isJsonRequest()) + { + return super.getInputStream(); + } + + // 为空,直接返回 + String json = IOUtils.toString(super.getInputStream(), "utf-8"); + if (StringUtils.isEmpty(json)) + { + return super.getInputStream(); + } + + // xss过滤 + json = EscapeUtil.clean(json).trim(); + byte[] jsonBytes = json.getBytes("utf-8"); + final ByteArrayInputStream bis = new ByteArrayInputStream(jsonBytes); + return new ServletInputStream() + { + @Override + public boolean isFinished() + { + return true; + } + + @Override + public boolean isReady() + { + return true; + } + + @Override + public int available() throws IOException + { + return jsonBytes.length; + } + + @Override + public void setReadListener(ReadListener readListener) + { + } + + @Override + public int read() throws IOException + { + return bis.read(); + } + }; + } + + /** + * 是否是Json请求 + * + * @param request + */ + public boolean isJsonRequest() + { + String header = super.getHeader(HttpHeaders.CONTENT_TYPE); + return StringUtils.startsWithIgnoreCase(header, MediaType.APPLICATION_JSON_VALUE); + } +} \ No newline at end of file diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/handler/MyMetaObjectHandler.java b/ruoyi-common/src/main/java/com/ruoyi/common/handler/MyMetaObjectHandler.java new file mode 100644 index 0000000..1d0368c --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/handler/MyMetaObjectHandler.java @@ -0,0 +1,52 @@ +package com.ruoyi.common.handler; + +import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler; +import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.common.utils.StringUtils; + +import lombok.extern.slf4j.Slf4j; +import org.apache.ibatis.reflection.MetaObject; +import org.springframework.stereotype.Component; + +import java.util.Date; + +/** + * mybatisplus 填充器 + */ +@Slf4j +@Component +public class MyMetaObjectHandler implements MetaObjectHandler { + + @Override + public void insertFill(MetaObject metaObject) { + log.info("start insert fill ...."); + Object createBy = metaObject.getValue("createBy"); +// String uuid = UUID.randomUUID().toString(); +// this.strictInsertFill(metaObject, "id", String.class, uuid); // 起始版本 3.3.0(推荐使用) + if (StringUtils.isNull(createBy) || createBy.equals("")) { + this.strictInsertFill(metaObject, "createBy", String.class, SecurityUtils.getUsername()); // 起始版本 3.3.0(推荐使用) + } + this.strictInsertFill(metaObject, "createTime", Date.class, DateUtils.getNowDate()); // 起始版本 3.3.0(推荐使用) + this.strictInsertFill(metaObject, "deleted", Long.class, 0L); // 起始版本 3.3.0(推荐使用) + + // 或者 +// this.strictInsertFill(metaObject, "createTime", () -> LocalDateTime.now(), LocalDateTime.class); // 起始版本 3.3.3(推荐) + // 或者 +// this.fillStrategy(metaObject, "createTime", LocalDateTime.now()); // 也可以使用(3.3.0 该方法有bug) + } + + @Override + public void updateFill(MetaObject metaObject) { + log.info("start update fill ...."); + Object updateBy = metaObject.getValue("updateBy"); + if (StringUtils.isNull(updateBy) || updateBy.equals("")) { + this.strictInsertFill(metaObject, "updateBy", String.class, SecurityUtils.getUsername()); + } + this.strictUpdateFill(metaObject, "updateTime", Date.class, DateUtils.getNowDate()); // 起始版本 3.3.0(推荐) + // 或者 +// this.strictUpdateFill(metaObject, "updateTime", () -> LocalDateTime.now(), LocalDateTime.class); // 起始版本 3.3.3(推荐) + // 或者 +// this.fillStrategy(metaObject, "updateTime", LocalDateTime.now()); // 也可以使用(3.3.0 该方法有bug) + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/Arith.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/Arith.java new file mode 100644 index 0000000..2d8fe39 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/Arith.java @@ -0,0 +1,114 @@ +package com.ruoyi.common.utils; + +import java.math.BigDecimal; +import java.math.RoundingMode; + +/** + * 精确的浮点数运算 + * + * @author #author# + */ +public class Arith +{ + + /** 默认除法运算精度 */ + private static final int DEF_DIV_SCALE = 10; + + /** 这个类不能实例化 */ + private Arith() + { + } + + /** + * 提供精确的加法运算。 + * @param v1 被加数 + * @param v2 加数 + * @return 两个参数的和 + */ + public static double add(double v1, double v2) + { + BigDecimal b1 = new BigDecimal(Double.toString(v1)); + BigDecimal b2 = new BigDecimal(Double.toString(v2)); + return b1.add(b2).doubleValue(); + } + + /** + * 提供精确的减法运算。 + * @param v1 被减数 + * @param v2 减数 + * @return 两个参数的差 + */ + public static double sub(double v1, double v2) + { + BigDecimal b1 = new BigDecimal(Double.toString(v1)); + BigDecimal b2 = new BigDecimal(Double.toString(v2)); + return b1.subtract(b2).doubleValue(); + } + + /** + * 提供精确的乘法运算。 + * @param v1 被乘数 + * @param v2 乘数 + * @return 两个参数的积 + */ + public static double mul(double v1, double v2) + { + BigDecimal b1 = new BigDecimal(Double.toString(v1)); + BigDecimal b2 = new BigDecimal(Double.toString(v2)); + return b1.multiply(b2).doubleValue(); + } + + /** + * 提供(相对)精确的除法运算,当发生除不尽的情况时,精确到 + * 小数点以后10位,以后的数字四舍五入。 + * @param v1 被除数 + * @param v2 除数 + * @return 两个参数的商 + */ + public static double div(double v1, double v2) + { + return div(v1, v2, DEF_DIV_SCALE); + } + + /** + * 提供(相对)精确的除法运算。当发生除不尽的情况时,由scale参数指 + * 定精度,以后的数字四舍五入。 + * @param v1 被除数 + * @param v2 除数 + * @param scale 表示表示需要精确到小数点以后几位。 + * @return 两个参数的商 + */ + public static double div(double v1, double v2, int scale) + { + if (scale < 0) + { + throw new IllegalArgumentException( + "The scale must be a positive integer or zero"); + } + BigDecimal b1 = new BigDecimal(Double.toString(v1)); + BigDecimal b2 = new BigDecimal(Double.toString(v2)); + if (b1.compareTo(BigDecimal.ZERO) == 0) + { + return BigDecimal.ZERO.doubleValue(); + } + return b1.divide(b2, scale, RoundingMode.HALF_UP).doubleValue(); + } + + /** + * 提供精确的小数位四舍五入处理。 + * @param v 需要四舍五入的数字 + * @param scale 小数点后保留几位 + * @return 四舍五入后的结果 + */ + public static double round(double v, int scale) + { + if (scale < 0) + { + throw new IllegalArgumentException( + "The scale must be a positive integer or zero"); + } + BigDecimal b = new BigDecimal(Double.toString(v)); + BigDecimal one = BigDecimal.ONE; + return b.divide(one, scale, RoundingMode.HALF_UP).doubleValue(); + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/DateUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/DateUtils.java new file mode 100644 index 0000000..0b85e7d --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/DateUtils.java @@ -0,0 +1,187 @@ +package com.ruoyi.common.utils; + +import java.lang.management.ManagementFactory; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.LocalTime; +import java.time.ZoneId; +import java.time.ZonedDateTime; +import java.util.Date; +import org.apache.commons.lang3.time.DateFormatUtils; + +/** + * 时间工具类 + * + * @author #author# + */ +public class DateUtils extends org.apache.commons.lang3.time.DateUtils +{ + public static String YYYY = "yyyy"; + + public static String YYYY_MM = "yyyy-MM"; + + public static String YYYY_MM_DD = "yyyy-MM-dd"; + + public static String YYYYMMDDHHMMSS = "yyyyMMddHHmmss"; + + public static String YYYY_MM_DD_HH_MM_SS = "yyyy-MM-dd HH:mm:ss"; + + private static String[] parsePatterns = { + "yyyy-MM-dd", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm", "yyyy-MM", + "yyyy/MM/dd", "yyyy/MM/dd HH:mm:ss", "yyyy/MM/dd HH:mm", "yyyy/MM", + "yyyy.MM.dd", "yyyy.MM.dd HH:mm:ss", "yyyy.MM.dd HH:mm", "yyyy.MM"}; + + /** + * 获取当前Date型日期 + * + * @return Date() 当前日期 + */ + public static Date getNowDate() + { + return new Date(); + } + + /** + * 获取当前日期, 默认格式为yyyy-MM-dd + * + * @return String + */ + public static String getDate() + { + return dateTimeNow(YYYY_MM_DD); + } + + public static final String getTime() + { + return dateTimeNow(YYYY_MM_DD_HH_MM_SS); + } + + public static final String dateTimeNow() + { + return dateTimeNow(YYYYMMDDHHMMSS); + } + + public static final String dateTimeNow(final String format) + { + return parseDateToStr(format, new Date()); + } + + public static final String dateTime(final Date date) + { + return parseDateToStr(YYYY_MM_DD, date); + } + + public static final String parseDateToStr(final String format, final Date date) + { + return new SimpleDateFormat(format).format(date); + } + + public static final Date dateTime(final String format, final String ts) + { + try + { + return new SimpleDateFormat(format).parse(ts); + } + catch (ParseException e) + { + throw new RuntimeException(e); + } + } + + /** + * 日期路径 即年/月/日 如2018/08/08 + */ + public static final String datePath() + { + Date now = new Date(); + return DateFormatUtils.format(now, "yyyy/MM/dd"); + } + + /** + * 日期路径 即年/月/日 如20180808 + */ + public static final String dateTime() + { + Date now = new Date(); + return DateFormatUtils.format(now, "yyyyMMdd"); + } + + /** + * 日期型字符串转化为日期 格式 + */ + public static Date parseDate(Object str) + { + if (str == null) + { + return null; + } + try + { + return parseDate(str.toString(), parsePatterns); + } + catch (ParseException e) + { + return null; + } + } + + /** + * 获取服务器启动时间 + */ + public static Date getServerStartDate() + { + long time = ManagementFactory.getRuntimeMXBean().getStartTime(); + return new Date(time); + } + + /** + * 计算相差天数 + */ + public static int differentDaysByMillisecond(Date date1, Date date2) + { + return Math.abs((int) ((date2.getTime() - date1.getTime()) / (1000 * 3600 * 24))); + } + + /** + * 计算两个时间差 + */ + public static String getDatePoor(Date endDate, Date nowDate) + { + long nd = 1000 * 24 * 60 * 60; + long nh = 1000 * 60 * 60; + long nm = 1000 * 60; + // long ns = 1000; + // 获得两个时间的毫秒时间差异 + long diff = endDate.getTime() - nowDate.getTime(); + // 计算差多少天 + long day = diff / nd; + // 计算差多少小时 + long hour = diff % nd / nh; + // 计算差多少分钟 + long min = diff % nd % nh / nm; + // 计算差多少秒//输出结果 + // long sec = diff % nd % nh % nm / ns; + return day + "天" + hour + "小时" + min + "分钟"; + } + + /** + * 增加 LocalDateTime ==> Date + */ + public static Date toDate(LocalDateTime temporalAccessor) + { + ZonedDateTime zdt = temporalAccessor.atZone(ZoneId.systemDefault()); + return Date.from(zdt.toInstant()); + } + + /** + * 增加 LocalDate ==> Date + */ + public static Date toDate(LocalDate temporalAccessor) + { + LocalDateTime localDateTime = LocalDateTime.of(temporalAccessor, LocalTime.of(0, 0, 0)); + ZonedDateTime zdt = localDateTime.atZone(ZoneId.systemDefault()); + return Date.from(zdt.toInstant()); + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/DictUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/DictUtils.java new file mode 100644 index 0000000..87e6d5d --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/DictUtils.java @@ -0,0 +1,186 @@ +package com.ruoyi.common.utils; + +import java.util.Collection; +import java.util.List; +import com.alibaba.fastjson2.JSONArray; +import com.ruoyi.common.constant.CacheConstants; +import com.ruoyi.common.core.domain.entity.SysDictData; +import com.ruoyi.common.core.redis.RedisCache; +import com.ruoyi.common.utils.spring.SpringUtils; + +/** + * 字典工具类 + * + * @author #author# + */ +public class DictUtils +{ + /** + * 分隔符 + */ + public static final String SEPARATOR = ","; + + /** + * 设置字典缓存 + * + * @param key 参数键 + * @param dictDatas 字典数据列表 + */ + public static void setDictCache(String key, List dictDatas) + { + SpringUtils.getBean(RedisCache.class).setCacheObject(getCacheKey(key), dictDatas); + } + + /** + * 获取字典缓存 + * + * @param key 参数键 + * @return dictDatas 字典数据列表 + */ + public static List getDictCache(String key) + { + JSONArray arrayCache = SpringUtils.getBean(RedisCache.class).getCacheObject(getCacheKey(key)); + if (StringUtils.isNotNull(arrayCache)) + { + return arrayCache.toList(SysDictData.class); + } + return null; + } + + /** + * 根据字典类型和字典值获取字典标签 + * + * @param dictType 字典类型 + * @param dictValue 字典值 + * @return 字典标签 + */ + public static String getDictLabel(String dictType, String dictValue) + { + return getDictLabel(dictType, dictValue, SEPARATOR); + } + + /** + * 根据字典类型和字典标签获取字典值 + * + * @param dictType 字典类型 + * @param dictLabel 字典标签 + * @return 字典值 + */ + public static String getDictValue(String dictType, String dictLabel) + { + return getDictValue(dictType, dictLabel, SEPARATOR); + } + + /** + * 根据字典类型和字典值获取字典标签 + * + * @param dictType 字典类型 + * @param dictValue 字典值 + * @param separator 分隔符 + * @return 字典标签 + */ + public static String getDictLabel(String dictType, String dictValue, String separator) + { + StringBuilder propertyString = new StringBuilder(); + List datas = getDictCache(dictType); + + if (StringUtils.isNotNull(datas)) + { + if (StringUtils.containsAny(separator, dictValue)) + { + for (SysDictData dict : datas) + { + for (String value : dictValue.split(separator)) + { + if (value.equals(dict.getDictValue())) + { + propertyString.append(dict.getDictLabel()).append(separator); + break; + } + } + } + } + else + { + for (SysDictData dict : datas) + { + if (dictValue.equals(dict.getDictValue())) + { + return dict.getDictLabel(); + } + } + } + } + return StringUtils.stripEnd(propertyString.toString(), separator); + } + + /** + * 根据字典类型和字典标签获取字典值 + * + * @param dictType 字典类型 + * @param dictLabel 字典标签 + * @param separator 分隔符 + * @return 字典值 + */ + public static String getDictValue(String dictType, String dictLabel, String separator) + { + StringBuilder propertyString = new StringBuilder(); + List datas = getDictCache(dictType); + + if (StringUtils.containsAny(separator, dictLabel) && StringUtils.isNotEmpty(datas)) + { + for (SysDictData dict : datas) + { + for (String label : dictLabel.split(separator)) + { + if (label.equals(dict.getDictLabel())) + { + propertyString.append(dict.getDictValue()).append(separator); + break; + } + } + } + } + else + { + for (SysDictData dict : datas) + { + if (dictLabel.equals(dict.getDictLabel())) + { + return dict.getDictValue(); + } + } + } + return StringUtils.stripEnd(propertyString.toString(), separator); + } + + /** + * 删除指定字典缓存 + * + * @param key 字典键 + */ + public static void removeDictCache(String key) + { + SpringUtils.getBean(RedisCache.class).deleteObject(getCacheKey(key)); + } + + /** + * 清空字典缓存 + */ + public static void clearDictCache() + { + Collection keys = SpringUtils.getBean(RedisCache.class).keys(CacheConstants.SYS_DICT_KEY + "*"); + SpringUtils.getBean(RedisCache.class).deleteObject(keys); + } + + /** + * 设置cache key + * + * @param configKey 参数键 + * @return 缓存键key + */ + public static String getCacheKey(String configKey) + { + return CacheConstants.SYS_DICT_KEY + configKey; + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/ExceptionUtil.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/ExceptionUtil.java new file mode 100644 index 0000000..d58c5b1 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/ExceptionUtil.java @@ -0,0 +1,39 @@ +package com.ruoyi.common.utils; + +import java.io.PrintWriter; +import java.io.StringWriter; +import org.apache.commons.lang3.exception.ExceptionUtils; + +/** + * 错误信息处理类。 + * + * @author #author# + */ +public class ExceptionUtil +{ + /** + * 获取exception的详细错误信息。 + */ + public static String getExceptionMessage(Throwable e) + { + StringWriter sw = new StringWriter(); + e.printStackTrace(new PrintWriter(sw, true)); + return sw.toString(); + } + + public static String getRootErrorMessage(Exception e) + { + Throwable root = ExceptionUtils.getRootCause(e); + root = (root == null ? e : root); + if (root == null) + { + return ""; + } + String msg = root.getMessage(); + if (msg == null) + { + return "null"; + } + return StringUtils.defaultString(msg); + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/LogUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/LogUtils.java new file mode 100644 index 0000000..8b55b37 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/LogUtils.java @@ -0,0 +1,18 @@ +package com.ruoyi.common.utils; + +/** + * 处理并记录日志文件 + * + * @author #author# + */ +public class LogUtils +{ + public static String getBlock(Object msg) + { + if (msg == null) + { + msg = ""; + } + return "[" + msg.toString() + "]"; + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/MessageUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/MessageUtils.java new file mode 100644 index 0000000..f286b05 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/MessageUtils.java @@ -0,0 +1,26 @@ +package com.ruoyi.common.utils; + +import org.springframework.context.MessageSource; +import org.springframework.context.i18n.LocaleContextHolder; +import com.ruoyi.common.utils.spring.SpringUtils; + +/** + * 获取i18n资源文件 + * + * @author #author# + */ +public class MessageUtils +{ + /** + * 根据消息键和参数 获取消息 委托给spring messageSource + * + * @param code 消息键 + * @param args 参数 + * @return 获取国际化翻译值 + */ + public static String message(String code, Object... args) + { + MessageSource messageSource = SpringUtils.getBean(MessageSource.class); + return messageSource.getMessage(code, args, LocaleContextHolder.getLocale()); + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/PageUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/PageUtils.java new file mode 100644 index 0000000..30f5010 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/PageUtils.java @@ -0,0 +1,35 @@ +package com.ruoyi.common.utils; + +import com.github.pagehelper.PageHelper; +import com.ruoyi.common.core.page.PageDomain; +import com.ruoyi.common.core.page.TableSupport; +import com.ruoyi.common.utils.sql.SqlUtil; + +/** + * 分页工具类 + * + * @author #author# + */ +public class PageUtils extends PageHelper +{ + /** + * 设置请求分页数据 + */ + public static void startPage() + { + PageDomain pageDomain = TableSupport.buildPageRequest(); + Integer pageNum = pageDomain.getPageNum(); + Integer pageSize = pageDomain.getPageSize(); + String orderBy = SqlUtil.escapeOrderBySql(pageDomain.getOrderBy()); + Boolean reasonable = pageDomain.getReasonable(); + PageHelper.startPage(pageNum, pageSize, orderBy).setReasonable(reasonable); + } + + /** + * 清理分页的线程变量 + */ + public static void clearPage() + { + PageHelper.clearPage(); + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/SecurityUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/SecurityUtils.java new file mode 100644 index 0000000..d60c7ad --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/SecurityUtils.java @@ -0,0 +1,120 @@ +package com.ruoyi.common.utils; + +import org.springframework.security.core.Authentication; +import org.springframework.security.core.context.SecurityContextHolder; +import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; +import com.ruoyi.common.constant.HttpStatus; +import com.ruoyi.common.core.domain.model.LoginUser; +import com.ruoyi.common.exception.ServiceException; + +/** + * 安全服务工具类 + * + * @author #author# + */ +public class SecurityUtils +{ + /** + * 用户ID + **/ + public static Long getUserId() + { + try + { + return getLoginUser().getUserId(); + } + catch (Exception e) + { + throw new ServiceException("获取用户ID异常", HttpStatus.UNAUTHORIZED); + } + } + + /** + * 获取部门ID + **/ + public static Long getDeptId() + { + try + { + return getLoginUser().getDeptId(); + } + catch (Exception e) + { + throw new ServiceException("获取部门ID异常", HttpStatus.UNAUTHORIZED); + } + } + + /** + * 获取用户账户 + **/ + public static String getUsername() + { + try + { + return getLoginUser().getUsername(); + } + catch (Exception e) + { + throw new ServiceException("获取用户账户异常", HttpStatus.UNAUTHORIZED); + } + } + + /** + * 获取用户 + **/ + public static LoginUser getLoginUser() + { + try + { + return (LoginUser) getAuthentication().getPrincipal(); + } + catch (Exception e) + { + throw new ServiceException("获取用户信息异常", HttpStatus.UNAUTHORIZED); + } + } + + /** + * 获取Authentication + */ + public static Authentication getAuthentication() + { + return SecurityContextHolder.getContext().getAuthentication(); + } + + /** + * 生成BCryptPasswordEncoder密码 + * + * @param password 密码 + * @return 加密字符串 + */ + public static String encryptPassword(String password) + { + BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder(); + return passwordEncoder.encode(password); + } + + /** + * 判断密码是否相同 + * + * @param rawPassword 真实密码 + * @param encodedPassword 加密后字符 + * @return 结果 + */ + public static boolean matchesPassword(String rawPassword, String encodedPassword) + { + BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder(); + return passwordEncoder.matches(rawPassword, encodedPassword); + } + + /** + * 是否为管理员 + * + * @param userId 用户ID + * @return 结果 + */ + public static boolean isAdmin(Long userId) + { + return userId != null && 1L == userId; + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/ServletUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/ServletUtils.java new file mode 100644 index 0000000..12da09c --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/ServletUtils.java @@ -0,0 +1,218 @@ +package com.ruoyi.common.utils; + +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLDecoder; +import java.net.URLEncoder; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import javax.servlet.ServletRequest; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; +import org.springframework.web.context.request.RequestAttributes; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; +import com.ruoyi.common.constant.Constants; +import com.ruoyi.common.core.text.Convert; + +/** + * 客户端工具类 + * + * @author #author# + */ +public class ServletUtils +{ + /** + * 获取String参数 + */ + public static String getParameter(String name) + { + return getRequest().getParameter(name); + } + + /** + * 获取String参数 + */ + public static String getParameter(String name, String defaultValue) + { + return Convert.toStr(getRequest().getParameter(name), defaultValue); + } + + /** + * 获取Integer参数 + */ + public static Integer getParameterToInt(String name) + { + return Convert.toInt(getRequest().getParameter(name)); + } + + /** + * 获取Integer参数 + */ + public static Integer getParameterToInt(String name, Integer defaultValue) + { + return Convert.toInt(getRequest().getParameter(name), defaultValue); + } + + /** + * 获取Boolean参数 + */ + public static Boolean getParameterToBool(String name) + { + return Convert.toBool(getRequest().getParameter(name)); + } + + /** + * 获取Boolean参数 + */ + public static Boolean getParameterToBool(String name, Boolean defaultValue) + { + return Convert.toBool(getRequest().getParameter(name), defaultValue); + } + + /** + * 获得所有请求参数 + * + * @param request 请求对象{@link ServletRequest} + * @return Map + */ + public static Map getParams(ServletRequest request) + { + final Map map = request.getParameterMap(); + return Collections.unmodifiableMap(map); + } + + /** + * 获得所有请求参数 + * + * @param request 请求对象{@link ServletRequest} + * @return Map + */ + public static Map getParamMap(ServletRequest request) + { + Map params = new HashMap<>(); + for (Map.Entry entry : getParams(request).entrySet()) + { + params.put(entry.getKey(), StringUtils.join(entry.getValue(), ",")); + } + return params; + } + + /** + * 获取request + */ + public static HttpServletRequest getRequest() + { + return getRequestAttributes().getRequest(); + } + + /** + * 获取response + */ + public static HttpServletResponse getResponse() + { + return getRequestAttributes().getResponse(); + } + + /** + * 获取session + */ + public static HttpSession getSession() + { + return getRequest().getSession(); + } + + public static ServletRequestAttributes getRequestAttributes() + { + RequestAttributes attributes = RequestContextHolder.getRequestAttributes(); + return (ServletRequestAttributes) attributes; + } + + /** + * 将字符串渲染到客户端 + * + * @param response 渲染对象 + * @param string 待渲染的字符串 + */ + public static void renderString(HttpServletResponse response, String string) + { + try + { + response.setStatus(200); + response.setContentType("application/json"); + response.setCharacterEncoding("utf-8"); + response.getWriter().print(string); + } + catch (IOException e) + { + e.printStackTrace(); + } + } + + /** + * 是否是Ajax异步请求 + * + * @param request + */ + public static boolean isAjaxRequest(HttpServletRequest request) + { + String accept = request.getHeader("accept"); + if (accept != null && accept.contains("application/json")) + { + return true; + } + + String xRequestedWith = request.getHeader("X-Requested-With"); + if (xRequestedWith != null && xRequestedWith.contains("XMLHttpRequest")) + { + return true; + } + + String uri = request.getRequestURI(); + if (StringUtils.inStringIgnoreCase(uri, ".json", ".xml")) + { + return true; + } + + String ajax = request.getParameter("__ajax"); + return StringUtils.inStringIgnoreCase(ajax, "json", "xml"); + } + + /** + * 内容编码 + * + * @param str 内容 + * @return 编码后的内容 + */ + public static String urlEncode(String str) + { + try + { + return URLEncoder.encode(str, Constants.UTF8); + } + catch (UnsupportedEncodingException e) + { + return StringUtils.EMPTY; + } + } + + /** + * 内容解码 + * + * @param str 内容 + * @return 解码后的内容 + */ + public static String urlDecode(String str) + { + try + { + return URLDecoder.decode(str, Constants.UTF8); + } + catch (UnsupportedEncodingException e) + { + return StringUtils.EMPTY; + } + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/StringUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/StringUtils.java new file mode 100644 index 0000000..dcc4974 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/StringUtils.java @@ -0,0 +1,614 @@ +package com.ruoyi.common.utils; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import org.springframework.util.AntPathMatcher; +import com.ruoyi.common.constant.Constants; +import com.ruoyi.common.core.text.StrFormatter; + +/** + * 字符串工具类 + * + * @author #author# + */ +public class StringUtils extends org.apache.commons.lang3.StringUtils +{ + /** 空字符串 */ + private static final String NULLSTR = ""; + + /** 下划线 */ + private static final char SEPARATOR = '_'; + + /** + * 获取参数不为空值 + * + * @param value defaultValue 要判断的value + * @return value 返回值 + */ + public static T nvl(T value, T defaultValue) + { + return value != null ? value : defaultValue; + } + + /** + * * 判断一个Collection是否为空, 包含List,Set,Queue + * + * @param coll 要判断的Collection + * @return true:为空 false:非空 + */ + public static boolean isEmpty(Collection coll) + { + return isNull(coll) || coll.isEmpty(); + } + + /** + * * 判断一个Collection是否非空,包含List,Set,Queue + * + * @param coll 要判断的Collection + * @return true:非空 false:空 + */ + public static boolean isNotEmpty(Collection coll) + { + return !isEmpty(coll); + } + + /** + * * 判断一个对象数组是否为空 + * + * @param objects 要判断的对象数组 + ** @return true:为空 false:非空 + */ + public static boolean isEmpty(Object[] objects) + { + return isNull(objects) || (objects.length == 0); + } + + /** + * * 判断一个对象数组是否非空 + * + * @param objects 要判断的对象数组 + * @return true:非空 false:空 + */ + public static boolean isNotEmpty(Object[] objects) + { + return !isEmpty(objects); + } + + /** + * * 判断一个Map是否为空 + * + * @param map 要判断的Map + * @return true:为空 false:非空 + */ + public static boolean isEmpty(Map map) + { + return isNull(map) || map.isEmpty(); + } + + /** + * * 判断一个Map是否为空 + * + * @param map 要判断的Map + * @return true:非空 false:空 + */ + public static boolean isNotEmpty(Map map) + { + return !isEmpty(map); + } + + /** + * * 判断一个字符串是否为空串 + * + * @param str String + * @return true:为空 false:非空 + */ + public static boolean isEmpty(String str) + { + return isNull(str) || NULLSTR.equals(str.trim()); + } + + /** + * * 判断一个字符串是否为非空串 + * + * @param str String + * @return true:非空串 false:空串 + */ + public static boolean isNotEmpty(String str) + { + return !isEmpty(str); + } + + /** + * * 判断一个对象是否为空 + * + * @param object Object + * @return true:为空 false:非空 + */ + public static boolean isNull(Object object) + { + return object == null; + } + + /** + * * 判断一个对象是否非空 + * + * @param object Object + * @return true:非空 false:空 + */ + public static boolean isNotNull(Object object) + { + return !isNull(object); + } + + /** + * * 判断一个对象是否是数组类型(Java基本型别的数组) + * + * @param object 对象 + * @return true:是数组 false:不是数组 + */ + public static boolean isArray(Object object) + { + return isNotNull(object) && object.getClass().isArray(); + } + + /** + * 去空格 + */ + public static String trim(String str) + { + return (str == null ? "" : str.trim()); + } + + /** + * 截取字符串 + * + * @param str 字符串 + * @param start 开始 + * @return 结果 + */ + public static String substring(final String str, int start) + { + if (str == null) + { + return NULLSTR; + } + + if (start < 0) + { + start = str.length() + start; + } + + if (start < 0) + { + start = 0; + } + if (start > str.length()) + { + return NULLSTR; + } + + return str.substring(start); + } + + /** + * 截取字符串 + * + * @param str 字符串 + * @param start 开始 + * @param end 结束 + * @return 结果 + */ + public static String substring(final String str, int start, int end) + { + if (str == null) + { + return NULLSTR; + } + + if (end < 0) + { + end = str.length() + end; + } + if (start < 0) + { + start = str.length() + start; + } + + if (end > str.length()) + { + end = str.length(); + } + + if (start > end) + { + return NULLSTR; + } + + if (start < 0) + { + start = 0; + } + if (end < 0) + { + end = 0; + } + + return str.substring(start, end); + } + + /** + * 格式化文本, {} 表示占位符
+ * 此方法只是简单将占位符 {} 按照顺序替换为参数
+ * 如果想输出 {} 使用 \\转义 { 即可,如果想输出 {} 之前的 \ 使用双转义符 \\\\ 即可
+ * 例:
+ * 通常使用:format("this is {} for {}", "a", "b") -> this is a for b
+ * 转义{}: format("this is \\{} for {}", "a", "b") -> this is \{} for a
+ * 转义\: format("this is \\\\{} for {}", "a", "b") -> this is \a for b
+ * + * @param template 文本模板,被替换的部分用 {} 表示 + * @param params 参数值 + * @return 格式化后的文本 + */ + public static String format(String template, Object... params) + { + if (isEmpty(params) || isEmpty(template)) + { + return template; + } + return StrFormatter.format(template, params); + } + + /** + * 是否为http(s)://开头 + * + * @param link 链接 + * @return 结果 + */ + public static boolean ishttp(String link) + { + return StringUtils.startsWithAny(link, Constants.HTTP, Constants.HTTPS); + } + + /** + * 字符串转set + * + * @param str 字符串 + * @param sep 分隔符 + * @return set集合 + */ + public static final Set str2Set(String str, String sep) + { + return new HashSet(str2List(str, sep, true, false)); + } + + /** + * 字符串转list + * + * @param str 字符串 + * @param sep 分隔符 + * @param filterBlank 过滤纯空白 + * @param trim 去掉首尾空白 + * @return list集合 + */ + public static final List str2List(String str, String sep, boolean filterBlank, boolean trim) + { + List list = new ArrayList(); + if (StringUtils.isEmpty(str)) + { + return list; + } + + // 过滤空白字符串 + if (filterBlank && StringUtils.isBlank(str)) + { + return list; + } + String[] split = str.split(sep); + for (String string : split) + { + if (filterBlank && StringUtils.isBlank(string)) + { + continue; + } + if (trim) + { + string = string.trim(); + } + list.add(string); + } + + return list; + } + + /** + * 判断给定的set列表中是否包含数组array 判断给定的数组array中是否包含给定的元素value + * + * @param set 给定的集合 + * @param array 给定的数组 + * @return boolean 结果 + */ + public static boolean containsAny(Collection collection, String... array) + { + if (isEmpty(collection) || isEmpty(array)) + { + return false; + } + else + { + for (String str : array) + { + if (collection.contains(str)) + { + return true; + } + } + return false; + } + } + + /** + * 查找指定字符串是否包含指定字符串列表中的任意一个字符串同时串忽略大小写 + * + * @param cs 指定字符串 + * @param searchCharSequences 需要检查的字符串数组 + * @return 是否包含任意一个字符串 + */ + public static boolean containsAnyIgnoreCase(CharSequence cs, CharSequence... searchCharSequences) + { + if (isEmpty(cs) || isEmpty(searchCharSequences)) + { + return false; + } + for (CharSequence testStr : searchCharSequences) + { + if (containsIgnoreCase(cs, testStr)) + { + return true; + } + } + return false; + } + + /** + * 驼峰转下划线命名 + */ + public static String toUnderScoreCase(String str) + { + if (str == null) + { + return null; + } + StringBuilder sb = new StringBuilder(); + // 前置字符是否大写 + boolean preCharIsUpperCase = true; + // 当前字符是否大写 + boolean curreCharIsUpperCase = true; + // 下一字符是否大写 + boolean nexteCharIsUpperCase = true; + for (int i = 0; i < str.length(); i++) + { + char c = str.charAt(i); + if (i > 0) + { + preCharIsUpperCase = Character.isUpperCase(str.charAt(i - 1)); + } + else + { + preCharIsUpperCase = false; + } + + curreCharIsUpperCase = Character.isUpperCase(c); + + if (i < (str.length() - 1)) + { + nexteCharIsUpperCase = Character.isUpperCase(str.charAt(i + 1)); + } + + if (preCharIsUpperCase && curreCharIsUpperCase && !nexteCharIsUpperCase) + { + sb.append(SEPARATOR); + } + else if ((i != 0 && !preCharIsUpperCase) && curreCharIsUpperCase) + { + sb.append(SEPARATOR); + } + sb.append(Character.toLowerCase(c)); + } + + return sb.toString(); + } + + /** + * 是否包含字符串 + * + * @param str 验证字符串 + * @param strs 字符串组 + * @return 包含返回true + */ + public static boolean inStringIgnoreCase(String str, String... strs) + { + if (str != null && strs != null) + { + for (String s : strs) + { + if (str.equalsIgnoreCase(trim(s))) + { + return true; + } + } + } + return false; + } + + /** + * 将下划线大写方式命名的字符串转换为驼峰式。如果转换前的下划线大写方式命名的字符串为空,则返回空字符串。 例如:HELLO_WORLD->HelloWorld + * + * @param name 转换前的下划线大写方式命名的字符串 + * @return 转换后的驼峰式命名的字符串 + */ + public static String convertToCamelCase(String name) + { + StringBuilder result = new StringBuilder(); + // 快速检查 + if (name == null || name.isEmpty()) + { + // 没必要转换 + return ""; + } + else if (!name.contains("_")) + { + // 不含下划线,仅将首字母大写 + return name.substring(0, 1).toUpperCase() + name.substring(1); + } + // 用下划线将原始字符串分割 + String[] camels = name.split("_"); + for (String camel : camels) + { + // 跳过原始字符串中开头、结尾的下换线或双重下划线 + if (camel.isEmpty()) + { + continue; + } + // 首字母大写 + result.append(camel.substring(0, 1).toUpperCase()); + result.append(camel.substring(1).toLowerCase()); + } + return result.toString(); + } + + /** + * 驼峰式命名法 + * 例如:user_name->userName + */ + public static String toCamelCase(String s) + { + if (s == null) + { + return null; + } + if (s.indexOf(SEPARATOR) == -1) + { + return s; + } + s = s.toLowerCase(); + StringBuilder sb = new StringBuilder(s.length()); + boolean upperCase = false; + for (int i = 0; i < s.length(); i++) + { + char c = s.charAt(i); + + if (c == SEPARATOR) + { + upperCase = true; + } + else if (upperCase) + { + sb.append(Character.toUpperCase(c)); + upperCase = false; + } + else + { + sb.append(c); + } + } + return sb.toString(); + } + + /** + * 查找指定字符串是否匹配指定字符串列表中的任意一个字符串 + * + * @param str 指定字符串 + * @param strs 需要检查的字符串数组 + * @return 是否匹配 + */ + public static boolean matches(String str, List strs) + { + if (isEmpty(str) || isEmpty(strs)) + { + return false; + } + for (String pattern : strs) + { + if (isMatch(pattern, str)) + { + return true; + } + } + return false; + } + + /** + * 判断url是否与规则配置: + * ? 表示单个字符; + * * 表示一层路径内的任意字符串,不可跨层级; + * ** 表示任意层路径; + * + * @param pattern 匹配规则 + * @param url 需要匹配的url + * @return + */ + public static boolean isMatch(String pattern, String url) + { + AntPathMatcher matcher = new AntPathMatcher(); + return matcher.match(pattern, url); + } + + @SuppressWarnings("unchecked") + public static T cast(Object obj) + { + return (T) obj; + } + + /** + * 数字左边补齐0,使之达到指定长度。注意,如果数字转换为字符串后,长度大于size,则只保留 最后size个字符。 + * + * @param num 数字对象 + * @param size 字符串指定长度 + * @return 返回数字的字符串格式,该字符串为指定长度。 + */ + public static final String padl(final Number num, final int size) + { + return padl(num.toString(), size, '0'); + } + + /** + * 字符串左补齐。如果原始字符串s长度大于size,则只保留最后size个字符。 + * + * @param s 原始字符串 + * @param size 字符串指定长度 + * @param c 用于补齐的字符 + * @return 返回指定长度的字符串,由原字符串左补齐或截取得到。 + */ + public static final String padl(final String s, final int size, final char c) + { + final StringBuilder sb = new StringBuilder(size); + if (s != null) + { + final int len = s.length(); + if (s.length() <= size) + { + for (int i = size - len; i > 0; i--) + { + sb.append(c); + } + sb.append(s); + } + else + { + return s.substring(len - size, len); + } + } + else + { + for (int i = size; i > 0; i--) + { + sb.append(c); + } + } + return sb.toString(); + } +} \ No newline at end of file diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/Threads.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/Threads.java new file mode 100644 index 0000000..f420d9e --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/Threads.java @@ -0,0 +1,99 @@ +package com.ruoyi.common.utils; + +import java.util.concurrent.CancellationException; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Future; +import java.util.concurrent.TimeUnit; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * 线程相关工具类. + * + * @author #author# + */ +public class Threads +{ + private static final Logger logger = LoggerFactory.getLogger(Threads.class); + + /** + * sleep等待,单位为毫秒 + */ + public static void sleep(long milliseconds) + { + try + { + Thread.sleep(milliseconds); + } + catch (InterruptedException e) + { + return; + } + } + + /** + * 停止线程池 + * 先使用shutdown, 停止接收新任务并尝试完成所有已存在任务. + * 如果超时, 则调用shutdownNow, 取消在workQueue中Pending的任务,并中断所有阻塞函数. + * 如果仍然超時,則強制退出. + * 另对在shutdown时线程本身被调用中断做了处理. + */ + public static void shutdownAndAwaitTermination(ExecutorService pool) + { + if (pool != null && !pool.isShutdown()) + { + pool.shutdown(); + try + { + if (!pool.awaitTermination(120, TimeUnit.SECONDS)) + { + pool.shutdownNow(); + if (!pool.awaitTermination(120, TimeUnit.SECONDS)) + { + logger.info("Pool did not terminate"); + } + } + } + catch (InterruptedException ie) + { + pool.shutdownNow(); + Thread.currentThread().interrupt(); + } + } + } + + /** + * 打印线程异常信息 + */ + public static void printException(Runnable r, Throwable t) + { + if (t == null && r instanceof Future) + { + try + { + Future future = (Future) r; + if (future.isDone()) + { + future.get(); + } + } + catch (CancellationException ce) + { + t = ce; + } + catch (ExecutionException ee) + { + t = ee.getCause(); + } + catch (InterruptedException ie) + { + Thread.currentThread().interrupt(); + } + } + if (t != null) + { + logger.error(t.getMessage(), t); + } + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/bean/BeanUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/bean/BeanUtils.java new file mode 100644 index 0000000..f807f9e --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/bean/BeanUtils.java @@ -0,0 +1,110 @@ +package com.ruoyi.common.utils.bean; + +import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * Bean 工具类 + * + * @author #author# + */ +public class BeanUtils extends org.springframework.beans.BeanUtils +{ + /** Bean方法名中属性名开始的下标 */ + private static final int BEAN_METHOD_PROP_INDEX = 3; + + /** * 匹配getter方法的正则表达式 */ + private static final Pattern GET_PATTERN = Pattern.compile("get(\\p{javaUpperCase}\\w*)"); + + /** * 匹配setter方法的正则表达式 */ + private static final Pattern SET_PATTERN = Pattern.compile("set(\\p{javaUpperCase}\\w*)"); + + /** + * Bean属性复制工具方法。 + * + * @param dest 目标对象 + * @param src 源对象 + */ + public static void copyBeanProp(Object dest, Object src) + { + try + { + copyProperties(src, dest); + } + catch (Exception e) + { + e.printStackTrace(); + } + } + + /** + * 获取对象的setter方法。 + * + * @param obj 对象 + * @return 对象的setter方法列表 + */ + public static List getSetterMethods(Object obj) + { + // setter方法列表 + List setterMethods = new ArrayList(); + + // 获取所有方法 + Method[] methods = obj.getClass().getMethods(); + + // 查找setter方法 + + for (Method method : methods) + { + Matcher m = SET_PATTERN.matcher(method.getName()); + if (m.matches() && (method.getParameterTypes().length == 1)) + { + setterMethods.add(method); + } + } + // 返回setter方法列表 + return setterMethods; + } + + /** + * 获取对象的getter方法。 + * + * @param obj 对象 + * @return 对象的getter方法列表 + */ + + public static List getGetterMethods(Object obj) + { + // getter方法列表 + List getterMethods = new ArrayList(); + // 获取所有方法 + Method[] methods = obj.getClass().getMethods(); + // 查找getter方法 + for (Method method : methods) + { + Matcher m = GET_PATTERN.matcher(method.getName()); + if (m.matches() && (method.getParameterTypes().length == 0)) + { + getterMethods.add(method); + } + } + // 返回getter方法列表 + return getterMethods; + } + + /** + * 检查Bean方法名中的属性名是否相等。
+ * 如getName()和setName()属性名一样,getName()和setAge()属性名不一样。 + * + * @param m1 方法名1 + * @param m2 方法名2 + * @return 属性名一样返回true,否则返回false + */ + + public static boolean isMethodPropEquals(String m1, String m2) + { + return m1.substring(BEAN_METHOD_PROP_INDEX).equals(m2.substring(BEAN_METHOD_PROP_INDEX)); + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/bean/BeanValidators.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/bean/BeanValidators.java new file mode 100644 index 0000000..1d6521f --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/bean/BeanValidators.java @@ -0,0 +1,24 @@ +package com.ruoyi.common.utils.bean; + +import java.util.Set; +import javax.validation.ConstraintViolation; +import javax.validation.ConstraintViolationException; +import javax.validation.Validator; + +/** + * bean对象属性验证 + * + * @author #author# + */ +public class BeanValidators +{ + public static void validateWithException(Validator validator, Object object, Class... groups) + throws ConstraintViolationException + { + Set> constraintViolations = validator.validate(object, groups); + if (!constraintViolations.isEmpty()) + { + throw new ConstraintViolationException(constraintViolations); + } + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileTypeUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileTypeUtils.java new file mode 100644 index 0000000..6ded4de --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileTypeUtils.java @@ -0,0 +1,76 @@ +package com.ruoyi.common.utils.file; + +import java.io.File; +import org.apache.commons.lang3.StringUtils; + +/** + * 文件类型工具类 + * + * @author #author# + */ +public class FileTypeUtils +{ + /** + * 获取文件类型 + *

+ * 例如: ruoyi.txt, 返回: txt + * + * @param file 文件名 + * @return 后缀(不含".") + */ + public static String getFileType(File file) + { + if (null == file) + { + return StringUtils.EMPTY; + } + return getFileType(file.getName()); + } + + /** + * 获取文件类型 + *

+ * 例如: ruoyi.txt, 返回: txt + * + * @param fileName 文件名 + * @return 后缀(不含".") + */ + public static String getFileType(String fileName) + { + int separatorIndex = fileName.lastIndexOf("."); + if (separatorIndex < 0) + { + return ""; + } + return fileName.substring(separatorIndex + 1).toLowerCase(); + } + + /** + * 获取文件类型 + * + * @param photoByte 文件字节码 + * @return 后缀(不含".") + */ + public static String getFileExtendName(byte[] photoByte) + { + String strFileExtendName = "JPG"; + if ((photoByte[0] == 71) && (photoByte[1] == 73) && (photoByte[2] == 70) && (photoByte[3] == 56) + && ((photoByte[4] == 55) || (photoByte[4] == 57)) && (photoByte[5] == 97)) + { + strFileExtendName = "GIF"; + } + else if ((photoByte[6] == 74) && (photoByte[7] == 70) && (photoByte[8] == 73) && (photoByte[9] == 70)) + { + strFileExtendName = "JPG"; + } + else if ((photoByte[0] == 66) && (photoByte[1] == 77)) + { + strFileExtendName = "BMP"; + } + else if ((photoByte[1] == 80) && (photoByte[2] == 78) && (photoByte[3] == 71)) + { + strFileExtendName = "PNG"; + } + return strFileExtendName; + } +} \ No newline at end of file diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUploadUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUploadUtils.java new file mode 100644 index 0000000..831bb83 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUploadUtils.java @@ -0,0 +1,232 @@ +package com.ruoyi.common.utils.file; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Paths; +import java.util.Objects; +import org.apache.commons.io.FilenameUtils; +import org.springframework.web.multipart.MultipartFile; +import com.ruoyi.common.config.RuoYiConfig; +import com.ruoyi.common.constant.Constants; +import com.ruoyi.common.exception.file.FileNameLengthLimitExceededException; +import com.ruoyi.common.exception.file.FileSizeLimitExceededException; +import com.ruoyi.common.exception.file.InvalidExtensionException; +import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.common.utils.uuid.Seq; + +/** + * 文件上传工具类 + * + * @author #author# + */ +public class FileUploadUtils +{ + /** + * 默认大小 50M + */ + public static final long DEFAULT_MAX_SIZE = 50 * 1024 * 1024; + + /** + * 默认的文件名最大长度 100 + */ + public static final int DEFAULT_FILE_NAME_LENGTH = 100; + + /** + * 默认上传的地址 + */ + private static String defaultBaseDir = RuoYiConfig.getProfile(); + + public static void setDefaultBaseDir(String defaultBaseDir) + { + FileUploadUtils.defaultBaseDir = defaultBaseDir; + } + + public static String getDefaultBaseDir() + { + return defaultBaseDir; + } + + /** + * 以默认配置进行文件上传 + * + * @param file 上传的文件 + * @return 文件名称 + * @throws Exception + */ + public static final String upload(MultipartFile file) throws IOException + { + try + { + return upload(getDefaultBaseDir(), file, MimeTypeUtils.DEFAULT_ALLOWED_EXTENSION); + } + catch (Exception e) + { + throw new IOException(e.getMessage(), e); + } + } + + /** + * 根据文件路径上传 + * + * @param baseDir 相对应用的基目录 + * @param file 上传的文件 + * @return 文件名称 + * @throws IOException + */ + public static final String upload(String baseDir, MultipartFile file) throws IOException + { + try + { + return upload(baseDir, file, MimeTypeUtils.DEFAULT_ALLOWED_EXTENSION); + } + catch (Exception e) + { + throw new IOException(e.getMessage(), e); + } + } + + /** + * 文件上传 + * + * @param baseDir 相对应用的基目录 + * @param file 上传的文件 + * @param allowedExtension 上传文件类型 + * @return 返回上传成功的文件名 + * @throws FileSizeLimitExceededException 如果超出最大大小 + * @throws FileNameLengthLimitExceededException 文件名太长 + * @throws IOException 比如读写文件出错时 + * @throws InvalidExtensionException 文件校验异常 + */ + public static final String upload(String baseDir, MultipartFile file, String[] allowedExtension) + throws FileSizeLimitExceededException, IOException, FileNameLengthLimitExceededException, + InvalidExtensionException + { + int fileNamelength = Objects.requireNonNull(file.getOriginalFilename()).length(); + if (fileNamelength > FileUploadUtils.DEFAULT_FILE_NAME_LENGTH) + { + throw new FileNameLengthLimitExceededException(FileUploadUtils.DEFAULT_FILE_NAME_LENGTH); + } + + assertAllowed(file, allowedExtension); + + String fileName = extractFilename(file); + + String absPath = getAbsoluteFile(baseDir, fileName).getAbsolutePath(); + file.transferTo(Paths.get(absPath)); + return getPathFileName(baseDir, fileName); + } + + /** + * 编码文件名 + */ + public static final String extractFilename(MultipartFile file) + { + return StringUtils.format("{}/{}_{}.{}", DateUtils.datePath(), + FilenameUtils.getBaseName(file.getOriginalFilename()), Seq.getId(Seq.uploadSeqType), getExtension(file)); + } + + public static final File getAbsoluteFile(String uploadDir, String fileName) throws IOException + { + File desc = new File(uploadDir + File.separator + fileName); + + if (!desc.exists()) + { + if (!desc.getParentFile().exists()) + { + desc.getParentFile().mkdirs(); + } + } + return desc; + } + + public static final String getPathFileName(String uploadDir, String fileName) throws IOException + { + int dirLastIndex = RuoYiConfig.getProfile().length() + 1; + String currentDir = StringUtils.substring(uploadDir, dirLastIndex); + return Constants.RESOURCE_PREFIX + "/" + currentDir + "/" + fileName; + } + + /** + * 文件大小校验 + * + * @param file 上传的文件 + * @return + * @throws FileSizeLimitExceededException 如果超出最大大小 + * @throws InvalidExtensionException + */ + public static final void assertAllowed(MultipartFile file, String[] allowedExtension) + throws FileSizeLimitExceededException, InvalidExtensionException + { + long size = file.getSize(); + if (size > DEFAULT_MAX_SIZE) + { + throw new FileSizeLimitExceededException(DEFAULT_MAX_SIZE / 1024 / 1024); + } + + String fileName = file.getOriginalFilename(); + String extension = getExtension(file); + if (allowedExtension != null && !isAllowedExtension(extension, allowedExtension)) + { + if (allowedExtension == MimeTypeUtils.IMAGE_EXTENSION) + { + throw new InvalidExtensionException.InvalidImageExtensionException(allowedExtension, extension, + fileName); + } + else if (allowedExtension == MimeTypeUtils.FLASH_EXTENSION) + { + throw new InvalidExtensionException.InvalidFlashExtensionException(allowedExtension, extension, + fileName); + } + else if (allowedExtension == MimeTypeUtils.MEDIA_EXTENSION) + { + throw new InvalidExtensionException.InvalidMediaExtensionException(allowedExtension, extension, + fileName); + } + else if (allowedExtension == MimeTypeUtils.VIDEO_EXTENSION) + { + throw new InvalidExtensionException.InvalidVideoExtensionException(allowedExtension, extension, + fileName); + } + else + { + throw new InvalidExtensionException(allowedExtension, extension, fileName); + } + } + } + + /** + * 判断MIME类型是否是允许的MIME类型 + * + * @param extension + * @param allowedExtension + * @return + */ + public static final boolean isAllowedExtension(String extension, String[] allowedExtension) + { + for (String str : allowedExtension) + { + if (str.equalsIgnoreCase(extension)) + { + return true; + } + } + return false; + } + + /** + * 获取文件名的后缀 + * + * @param file 表单文件 + * @return 后缀名 + */ + public static final String getExtension(MultipartFile file) + { + String extension = FilenameUtils.getExtension(file.getOriginalFilename()); + if (StringUtils.isEmpty(extension)) + { + extension = MimeTypeUtils.getExtension(Objects.requireNonNull(file.getContentType())); + } + return extension; + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUtils.java new file mode 100644 index 0000000..a8a5736 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUtils.java @@ -0,0 +1,291 @@ +package com.ruoyi.common.utils.file; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.OutputStream; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import org.apache.commons.io.IOUtils; +import org.apache.commons.lang3.ArrayUtils; +import com.ruoyi.common.config.RuoYiConfig; +import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.common.utils.uuid.IdUtils; +import org.apache.commons.io.FilenameUtils; + +/** + * 文件处理工具类 + * + * @author #author# + */ +public class FileUtils +{ + public static String FILENAME_PATTERN = "[a-zA-Z0-9_\\-\\|\\.\\u4e00-\\u9fa5]+"; + + /** + * 输出指定文件的byte数组 + * + * @param filePath 文件路径 + * @param os 输出流 + * @return + */ + public static void writeBytes(String filePath, OutputStream os) throws IOException + { + FileInputStream fis = null; + try + { + File file = new File(filePath); + if (!file.exists()) + { + throw new FileNotFoundException(filePath); + } + fis = new FileInputStream(file); + byte[] b = new byte[1024]; + int length; + while ((length = fis.read(b)) > 0) + { + os.write(b, 0, length); + } + } + catch (IOException e) + { + throw e; + } + finally + { + IOUtils.close(os); + IOUtils.close(fis); + } + } + + /** + * 写数据到文件中 + * + * @param data 数据 + * @return 目标文件 + * @throws IOException IO异常 + */ + public static String writeImportBytes(byte[] data) throws IOException + { + return writeBytes(data, RuoYiConfig.getImportPath()); + } + + /** + * 写数据到文件中 + * + * @param data 数据 + * @param uploadDir 目标文件 + * @return 目标文件 + * @throws IOException IO异常 + */ + public static String writeBytes(byte[] data, String uploadDir) throws IOException + { + FileOutputStream fos = null; + String pathName = ""; + try + { + String extension = getFileExtendName(data); + pathName = DateUtils.datePath() + "/" + IdUtils.fastUUID() + "." + extension; + File file = FileUploadUtils.getAbsoluteFile(uploadDir, pathName); + fos = new FileOutputStream(file); + fos.write(data); + } + finally + { + IOUtils.close(fos); + } + return FileUploadUtils.getPathFileName(uploadDir, pathName); + } + + /** + * 删除文件 + * + * @param filePath 文件 + * @return + */ + public static boolean deleteFile(String filePath) + { + boolean flag = false; + File file = new File(filePath); + // 路径为文件且不为空则进行删除 + if (file.isFile() && file.exists()) + { + flag = file.delete(); + } + return flag; + } + + /** + * 文件名称验证 + * + * @param filename 文件名称 + * @return true 正常 false 非法 + */ + public static boolean isValidFilename(String filename) + { + return filename.matches(FILENAME_PATTERN); + } + + /** + * 检查文件是否可下载 + * + * @param resource 需要下载的文件 + * @return true 正常 false 非法 + */ + public static boolean checkAllowDownload(String resource) + { + // 禁止目录上跳级别 + if (StringUtils.contains(resource, "..")) + { + return false; + } + + // 检查允许下载的文件规则 + if (ArrayUtils.contains(MimeTypeUtils.DEFAULT_ALLOWED_EXTENSION, FileTypeUtils.getFileType(resource))) + { + return true; + } + + // 不在允许下载的文件规则 + return false; + } + + /** + * 下载文件名重新编码 + * + * @param request 请求对象 + * @param fileName 文件名 + * @return 编码后的文件名 + */ + public static String setFileDownloadHeader(HttpServletRequest request, String fileName) throws UnsupportedEncodingException + { + final String agent = request.getHeader("USER-AGENT"); + String filename = fileName; + if (agent.contains("MSIE")) + { + // IE浏览器 + filename = URLEncoder.encode(filename, "utf-8"); + filename = filename.replace("+", " "); + } + else if (agent.contains("Firefox")) + { + // 火狐浏览器 + filename = new String(fileName.getBytes(), "ISO8859-1"); + } + else if (agent.contains("Chrome")) + { + // google浏览器 + filename = URLEncoder.encode(filename, "utf-8"); + } + else + { + // 其它浏览器 + filename = URLEncoder.encode(filename, "utf-8"); + } + return filename; + } + + /** + * 下载文件名重新编码 + * + * @param response 响应对象 + * @param realFileName 真实文件名 + */ + public static void setAttachmentResponseHeader(HttpServletResponse response, String realFileName) throws UnsupportedEncodingException + { + String percentEncodedFileName = percentEncode(realFileName); + + StringBuilder contentDispositionValue = new StringBuilder(); + contentDispositionValue.append("attachment; filename=") + .append(percentEncodedFileName) + .append(";") + .append("filename*=") + .append("utf-8''") + .append(percentEncodedFileName); + + response.addHeader("Access-Control-Expose-Headers", "Content-Disposition,download-filename"); + response.setHeader("Content-disposition", contentDispositionValue.toString()); + response.setHeader("download-filename", percentEncodedFileName); + } + + /** + * 百分号编码工具方法 + * + * @param s 需要百分号编码的字符串 + * @return 百分号编码后的字符串 + */ + public static String percentEncode(String s) throws UnsupportedEncodingException + { + String encode = URLEncoder.encode(s, StandardCharsets.UTF_8.toString()); + return encode.replaceAll("\\+", "%20"); + } + + /** + * 获取图像后缀 + * + * @param photoByte 图像数据 + * @return 后缀名 + */ + public static String getFileExtendName(byte[] photoByte) + { + String strFileExtendName = "jpg"; + if ((photoByte[0] == 71) && (photoByte[1] == 73) && (photoByte[2] == 70) && (photoByte[3] == 56) + && ((photoByte[4] == 55) || (photoByte[4] == 57)) && (photoByte[5] == 97)) + { + strFileExtendName = "gif"; + } + else if ((photoByte[6] == 74) && (photoByte[7] == 70) && (photoByte[8] == 73) && (photoByte[9] == 70)) + { + strFileExtendName = "jpg"; + } + else if ((photoByte[0] == 66) && (photoByte[1] == 77)) + { + strFileExtendName = "bmp"; + } + else if ((photoByte[1] == 80) && (photoByte[2] == 78) && (photoByte[3] == 71)) + { + strFileExtendName = "png"; + } + return strFileExtendName; + } + + /** + * 获取文件名称 /profile/upload/2022/04/16/ruoyi.png -- ruoyi.png + * + * @param fileName 路径名称 + * @return 没有文件路径的名称 + */ + public static String getName(String fileName) + { + if (fileName == null) + { + return null; + } + int lastUnixPos = fileName.lastIndexOf('/'); + int lastWindowsPos = fileName.lastIndexOf('\\'); + int index = Math.max(lastUnixPos, lastWindowsPos); + return fileName.substring(index + 1); + } + + /** + * 获取不带后缀文件名称 /profile/upload/2022/04/16/ruoyi.png -- ruoyi + * + * @param fileName 路径名称 + * @return 没有文件路径和后缀的名称 + */ + public static String getNameNotSuffix(String fileName) + { + if (fileName == null) + { + return null; + } + String baseName = FilenameUtils.getBaseName(fileName); + return baseName; + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/ImageUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/ImageUtils.java new file mode 100644 index 0000000..d957c14 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/ImageUtils.java @@ -0,0 +1,98 @@ +package com.ruoyi.common.utils.file; + +import java.io.ByteArrayInputStream; +import java.io.FileInputStream; +import java.io.InputStream; +import java.net.URL; +import java.net.URLConnection; +import java.util.Arrays; +import org.apache.poi.util.IOUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import com.ruoyi.common.config.RuoYiConfig; +import com.ruoyi.common.constant.Constants; +import com.ruoyi.common.utils.StringUtils; + +/** + * 图片处理工具类 + * + * @author #author# + */ +public class ImageUtils +{ + private static final Logger log = LoggerFactory.getLogger(ImageUtils.class); + + public static byte[] getImage(String imagePath) + { + InputStream is = getFile(imagePath); + try + { + return IOUtils.toByteArray(is); + } + catch (Exception e) + { + log.error("图片加载异常 {}", e); + return null; + } + finally + { + IOUtils.closeQuietly(is); + } + } + + public static InputStream getFile(String imagePath) + { + try + { + byte[] result = readFile(imagePath); + result = Arrays.copyOf(result, result.length); + return new ByteArrayInputStream(result); + } + catch (Exception e) + { + log.error("获取图片异常 {}", e); + } + return null; + } + + /** + * 读取文件为字节数据 + * + * @param url 地址 + * @return 字节数据 + */ + public static byte[] readFile(String url) + { + InputStream in = null; + try + { + if (url.startsWith("http")) + { + // 网络地址 + URL urlObj = new URL(url); + URLConnection urlConnection = urlObj.openConnection(); + urlConnection.setConnectTimeout(30 * 1000); + urlConnection.setReadTimeout(60 * 1000); + urlConnection.setDoInput(true); + in = urlConnection.getInputStream(); + } + else + { + // 本机地址 + String localPath = RuoYiConfig.getProfile(); + String downloadPath = localPath + StringUtils.substringAfter(url, Constants.RESOURCE_PREFIX); + in = new FileInputStream(downloadPath); + } + return IOUtils.toByteArray(in); + } + catch (Exception e) + { + log.error("获取文件路径异常 {}", e); + return null; + } + finally + { + IOUtils.closeQuietly(in); + } + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/MimeTypeUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/MimeTypeUtils.java new file mode 100644 index 0000000..2babfc2 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/MimeTypeUtils.java @@ -0,0 +1,59 @@ +package com.ruoyi.common.utils.file; + +/** + * 媒体类型工具类 + * + * @author #author# + */ +public class MimeTypeUtils +{ + public static final String IMAGE_PNG = "image/png"; + + public static final String IMAGE_JPG = "image/jpg"; + + public static final String IMAGE_JPEG = "image/jpeg"; + + public static final String IMAGE_BMP = "image/bmp"; + + public static final String IMAGE_GIF = "image/gif"; + + public static final String[] IMAGE_EXTENSION = { "bmp", "gif", "jpg", "jpeg", "png" }; + + public static final String[] FLASH_EXTENSION = { "swf", "flv" }; + + public static final String[] MEDIA_EXTENSION = { "swf", "flv", "mp3", "wav", "wma", "wmv", "mid", "avi", "mpg", + "asf", "rm", "rmvb" }; + + public static final String[] VIDEO_EXTENSION = { "mp4", "avi", "rmvb" }; + + public static final String[] DEFAULT_ALLOWED_EXTENSION = { + // 图片 + "bmp", "gif", "jpg", "jpeg", "png", + // word excel powerpoint + "doc", "docx", "xls", "xlsx", "ppt", "pptx", "html", "htm", "txt", + // 压缩文件 + "rar", "zip", "gz", "bz2", + // 视频格式 + "mp4", "avi", "rmvb", + // pdf + "pdf" }; + + public static String getExtension(String prefix) + { + switch (prefix) + { + case IMAGE_PNG: + return "png"; + case IMAGE_JPG: + return "jpg"; + case IMAGE_JPEG: + return "jpeg"; + case IMAGE_BMP: + return "bmp"; + case IMAGE_GIF: + return "gif"; + default: + return ""; + } + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/html/EscapeUtil.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/html/EscapeUtil.java new file mode 100644 index 0000000..24ac58e --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/html/EscapeUtil.java @@ -0,0 +1,167 @@ +package com.ruoyi.common.utils.html; + +import com.ruoyi.common.utils.StringUtils; + +/** + * 转义和反转义工具类 + * + * @author #author# + */ +public class EscapeUtil +{ + public static final String RE_HTML_MARK = "(<[^<]*?>)|(<[\\s]*?/[^<]*?>)|(<[^<]*?/[\\s]*?>)"; + + private static final char[][] TEXT = new char[64][]; + + static + { + for (int i = 0; i < 64; i++) + { + TEXT[i] = new char[] { (char) i }; + } + + // special HTML characters + TEXT['\''] = "'".toCharArray(); // 单引号 + TEXT['"'] = """.toCharArray(); // 双引号 + TEXT['&'] = "&".toCharArray(); // &符 + TEXT['<'] = "<".toCharArray(); // 小于号 + TEXT['>'] = ">".toCharArray(); // 大于号 + } + + /** + * 转义文本中的HTML字符为安全的字符 + * + * @param text 被转义的文本 + * @return 转义后的文本 + */ + public static String escape(String text) + { + return encode(text); + } + + /** + * 还原被转义的HTML特殊字符 + * + * @param content 包含转义符的HTML内容 + * @return 转换后的字符串 + */ + public static String unescape(String content) + { + return decode(content); + } + + /** + * 清除所有HTML标签,但是不删除标签内的内容 + * + * @param content 文本 + * @return 清除标签后的文本 + */ + public static String clean(String content) + { + return new HTMLFilter().filter(content); + } + + /** + * Escape编码 + * + * @param text 被编码的文本 + * @return 编码后的字符 + */ + private static String encode(String text) + { + if (StringUtils.isEmpty(text)) + { + return StringUtils.EMPTY; + } + + final StringBuilder tmp = new StringBuilder(text.length() * 6); + char c; + for (int i = 0; i < text.length(); i++) + { + c = text.charAt(i); + if (c < 256) + { + tmp.append("%"); + if (c < 16) + { + tmp.append("0"); + } + tmp.append(Integer.toString(c, 16)); + } + else + { + tmp.append("%u"); + if (c <= 0xfff) + { + // issue#I49JU8@Gitee + tmp.append("0"); + } + tmp.append(Integer.toString(c, 16)); + } + } + return tmp.toString(); + } + + /** + * Escape解码 + * + * @param content 被转义的内容 + * @return 解码后的字符串 + */ + public static String decode(String content) + { + if (StringUtils.isEmpty(content)) + { + return content; + } + + StringBuilder tmp = new StringBuilder(content.length()); + int lastPos = 0, pos = 0; + char ch; + while (lastPos < content.length()) + { + pos = content.indexOf("%", lastPos); + if (pos == lastPos) + { + if (content.charAt(pos + 1) == 'u') + { + ch = (char) Integer.parseInt(content.substring(pos + 2, pos + 6), 16); + tmp.append(ch); + lastPos = pos + 6; + } + else + { + ch = (char) Integer.parseInt(content.substring(pos + 1, pos + 3), 16); + tmp.append(ch); + lastPos = pos + 3; + } + } + else + { + if (pos == -1) + { + tmp.append(content.substring(lastPos)); + lastPos = content.length(); + } + else + { + tmp.append(content.substring(lastPos, pos)); + lastPos = pos; + } + } + } + return tmp.toString(); + } + + public static void main(String[] args) + { + String html = ""; + String escape = EscapeUtil.escape(html); + // String html = "ipt>alert(\"XSS\")ipt>"; + // String html = "<123"; + // String html = "123>"; + System.out.println("clean: " + EscapeUtil.clean(html)); + System.out.println("escape: " + escape); + System.out.println("unescape: " + EscapeUtil.unescape(escape)); + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/html/HTMLFilter.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/html/HTMLFilter.java new file mode 100644 index 0000000..eebfcd3 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/html/HTMLFilter.java @@ -0,0 +1,570 @@ +package com.ruoyi.common.utils.html; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentMap; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * HTML过滤器,用于去除XSS漏洞隐患。 + * + * @author #author# + */ +public final class HTMLFilter +{ + /** + * regex flag union representing /si modifiers in php + **/ + private static final int REGEX_FLAGS_SI = Pattern.CASE_INSENSITIVE | Pattern.DOTALL; + private static final Pattern P_COMMENTS = Pattern.compile("", Pattern.DOTALL); + private static final Pattern P_COMMENT = Pattern.compile("^!--(.*)--$", REGEX_FLAGS_SI); + private static final Pattern P_TAGS = Pattern.compile("<(.*?)>", Pattern.DOTALL); + private static final Pattern P_END_TAG = Pattern.compile("^/([a-z0-9]+)", REGEX_FLAGS_SI); + private static final Pattern P_START_TAG = Pattern.compile("^([a-z0-9]+)(.*?)(/?)$", REGEX_FLAGS_SI); + private static final Pattern P_QUOTED_ATTRIBUTES = Pattern.compile("([a-z0-9]+)=([\"'])(.*?)\\2", REGEX_FLAGS_SI); + private static final Pattern P_UNQUOTED_ATTRIBUTES = Pattern.compile("([a-z0-9]+)(=)([^\"\\s']+)", REGEX_FLAGS_SI); + private static final Pattern P_PROTOCOL = Pattern.compile("^([^:]+):", REGEX_FLAGS_SI); + private static final Pattern P_ENTITY = Pattern.compile("&#(\\d+);?"); + private static final Pattern P_ENTITY_UNICODE = Pattern.compile("&#x([0-9a-f]+);?"); + private static final Pattern P_ENCODE = Pattern.compile("%([0-9a-f]{2});?"); + private static final Pattern P_VALID_ENTITIES = Pattern.compile("&([^&;]*)(?=(;|&|$))"); + private static final Pattern P_VALID_QUOTES = Pattern.compile("(>|^)([^<]+?)(<|$)", Pattern.DOTALL); + private static final Pattern P_END_ARROW = Pattern.compile("^>"); + private static final Pattern P_BODY_TO_END = Pattern.compile("<([^>]*?)(?=<|$)"); + private static final Pattern P_XML_CONTENT = Pattern.compile("(^|>)([^<]*?)(?=>)"); + private static final Pattern P_STRAY_LEFT_ARROW = Pattern.compile("<([^>]*?)(?=<|$)"); + private static final Pattern P_STRAY_RIGHT_ARROW = Pattern.compile("(^|>)([^<]*?)(?=>)"); + private static final Pattern P_AMP = Pattern.compile("&"); + private static final Pattern P_QUOTE = Pattern.compile("\""); + private static final Pattern P_LEFT_ARROW = Pattern.compile("<"); + private static final Pattern P_RIGHT_ARROW = Pattern.compile(">"); + private static final Pattern P_BOTH_ARROWS = Pattern.compile("<>"); + + // @xxx could grow large... maybe use sesat's ReferenceMap + private static final ConcurrentMap P_REMOVE_PAIR_BLANKS = new ConcurrentHashMap<>(); + private static final ConcurrentMap P_REMOVE_SELF_BLANKS = new ConcurrentHashMap<>(); + + /** + * set of allowed html elements, along with allowed attributes for each element + **/ + private final Map> vAllowed; + /** + * counts of open tags for each (allowable) html element + **/ + private final Map vTagCounts = new HashMap<>(); + + /** + * html elements which must always be self-closing (e.g. "") + **/ + private final String[] vSelfClosingTags; + /** + * html elements which must always have separate opening and closing tags (e.g. "") + **/ + private final String[] vNeedClosingTags; + /** + * set of disallowed html elements + **/ + private final String[] vDisallowed; + /** + * attributes which should be checked for valid protocols + **/ + private final String[] vProtocolAtts; + /** + * allowed protocols + **/ + private final String[] vAllowedProtocols; + /** + * tags which should be removed if they contain no content (e.g. "" or "") + **/ + private final String[] vRemoveBlanks; + /** + * entities allowed within html markup + **/ + private final String[] vAllowedEntities; + /** + * flag determining whether comments are allowed in input String. + */ + private final boolean stripComment; + private final boolean encodeQuotes; + /** + * flag determining whether to try to make tags when presented with "unbalanced" angle brackets (e.g. "" + * becomes " text "). If set to false, unbalanced angle brackets will be html escaped. + */ + private final boolean alwaysMakeTags; + + /** + * Default constructor. + */ + public HTMLFilter() + { + vAllowed = new HashMap<>(); + + final ArrayList a_atts = new ArrayList<>(); + a_atts.add("href"); + a_atts.add("target"); + vAllowed.put("a", a_atts); + + final ArrayList img_atts = new ArrayList<>(); + img_atts.add("src"); + img_atts.add("width"); + img_atts.add("height"); + img_atts.add("alt"); + vAllowed.put("img", img_atts); + + final ArrayList no_atts = new ArrayList<>(); + vAllowed.put("b", no_atts); + vAllowed.put("strong", no_atts); + vAllowed.put("i", no_atts); + vAllowed.put("em", no_atts); + + vSelfClosingTags = new String[] { "img" }; + vNeedClosingTags = new String[] { "a", "b", "strong", "i", "em" }; + vDisallowed = new String[] {}; + vAllowedProtocols = new String[] { "http", "mailto", "https" }; // no ftp. + vProtocolAtts = new String[] { "src", "href" }; + vRemoveBlanks = new String[] { "a", "b", "strong", "i", "em" }; + vAllowedEntities = new String[] { "amp", "gt", "lt", "quot" }; + stripComment = true; + encodeQuotes = true; + alwaysMakeTags = false; + } + + /** + * Map-parameter configurable constructor. + * + * @param conf map containing configuration. keys match field names. + */ + @SuppressWarnings("unchecked") + public HTMLFilter(final Map conf) + { + + assert conf.containsKey("vAllowed") : "configuration requires vAllowed"; + assert conf.containsKey("vSelfClosingTags") : "configuration requires vSelfClosingTags"; + assert conf.containsKey("vNeedClosingTags") : "configuration requires vNeedClosingTags"; + assert conf.containsKey("vDisallowed") : "configuration requires vDisallowed"; + assert conf.containsKey("vAllowedProtocols") : "configuration requires vAllowedProtocols"; + assert conf.containsKey("vProtocolAtts") : "configuration requires vProtocolAtts"; + assert conf.containsKey("vRemoveBlanks") : "configuration requires vRemoveBlanks"; + assert conf.containsKey("vAllowedEntities") : "configuration requires vAllowedEntities"; + + vAllowed = Collections.unmodifiableMap((HashMap>) conf.get("vAllowed")); + vSelfClosingTags = (String[]) conf.get("vSelfClosingTags"); + vNeedClosingTags = (String[]) conf.get("vNeedClosingTags"); + vDisallowed = (String[]) conf.get("vDisallowed"); + vAllowedProtocols = (String[]) conf.get("vAllowedProtocols"); + vProtocolAtts = (String[]) conf.get("vProtocolAtts"); + vRemoveBlanks = (String[]) conf.get("vRemoveBlanks"); + vAllowedEntities = (String[]) conf.get("vAllowedEntities"); + stripComment = conf.containsKey("stripComment") ? (Boolean) conf.get("stripComment") : true; + encodeQuotes = conf.containsKey("encodeQuotes") ? (Boolean) conf.get("encodeQuotes") : true; + alwaysMakeTags = conf.containsKey("alwaysMakeTags") ? (Boolean) conf.get("alwaysMakeTags") : true; + } + + private void reset() + { + vTagCounts.clear(); + } + + // --------------------------------------------------------------- + // my versions of some PHP library functions + public static String chr(final int decimal) + { + return String.valueOf((char) decimal); + } + + public static String htmlSpecialChars(final String s) + { + String result = s; + result = regexReplace(P_AMP, "&", result); + result = regexReplace(P_QUOTE, """, result); + result = regexReplace(P_LEFT_ARROW, "<", result); + result = regexReplace(P_RIGHT_ARROW, ">", result); + return result; + } + + // --------------------------------------------------------------- + + /** + * given a user submitted input String, filter out any invalid or restricted html. + * + * @param input text (i.e. submitted by a user) than may contain html + * @return "clean" version of input, with only valid, whitelisted html elements allowed + */ + public String filter(final String input) + { + reset(); + String s = input; + + s = escapeComments(s); + + s = balanceHTML(s); + + s = checkTags(s); + + s = processRemoveBlanks(s); + + // s = validateEntities(s); + + return s; + } + + public boolean isAlwaysMakeTags() + { + return alwaysMakeTags; + } + + public boolean isStripComments() + { + return stripComment; + } + + private String escapeComments(final String s) + { + final Matcher m = P_COMMENTS.matcher(s); + final StringBuffer buf = new StringBuffer(); + if (m.find()) + { + final String match = m.group(1); // (.*?) + m.appendReplacement(buf, Matcher.quoteReplacement("")); + } + m.appendTail(buf); + + return buf.toString(); + } + + private String balanceHTML(String s) + { + if (alwaysMakeTags) + { + // + // try and form html + // + s = regexReplace(P_END_ARROW, "", s); + // 不追加结束标签 + s = regexReplace(P_BODY_TO_END, "<$1>", s); + s = regexReplace(P_XML_CONTENT, "$1<$2", s); + + } + else + { + // + // escape stray brackets + // + s = regexReplace(P_STRAY_LEFT_ARROW, "<$1", s); + s = regexReplace(P_STRAY_RIGHT_ARROW, "$1$2><", s); + + // + // the last regexp causes '<>' entities to appear + // (we need to do a lookahead assertion so that the last bracket can + // be used in the next pass of the regexp) + // + s = regexReplace(P_BOTH_ARROWS, "", s); + } + + return s; + } + + private String checkTags(String s) + { + Matcher m = P_TAGS.matcher(s); + + final StringBuffer buf = new StringBuffer(); + while (m.find()) + { + String replaceStr = m.group(1); + replaceStr = processTag(replaceStr); + m.appendReplacement(buf, Matcher.quoteReplacement(replaceStr)); + } + m.appendTail(buf); + + // these get tallied in processTag + // (remember to reset before subsequent calls to filter method) + final StringBuilder sBuilder = new StringBuilder(buf.toString()); + for (String key : vTagCounts.keySet()) + { + for (int ii = 0; ii < vTagCounts.get(key); ii++) + { + sBuilder.append(""); + } + } + s = sBuilder.toString(); + + return s; + } + + private String processRemoveBlanks(final String s) + { + String result = s; + for (String tag : vRemoveBlanks) + { + if (!P_REMOVE_PAIR_BLANKS.containsKey(tag)) + { + P_REMOVE_PAIR_BLANKS.putIfAbsent(tag, Pattern.compile("<" + tag + "(\\s[^>]*)?>")); + } + result = regexReplace(P_REMOVE_PAIR_BLANKS.get(tag), "", result); + if (!P_REMOVE_SELF_BLANKS.containsKey(tag)) + { + P_REMOVE_SELF_BLANKS.putIfAbsent(tag, Pattern.compile("<" + tag + "(\\s[^>]*)?/>")); + } + result = regexReplace(P_REMOVE_SELF_BLANKS.get(tag), "", result); + } + + return result; + } + + private static String regexReplace(final Pattern regex_pattern, final String replacement, final String s) + { + Matcher m = regex_pattern.matcher(s); + return m.replaceAll(replacement); + } + + private String processTag(final String s) + { + // ending tags + Matcher m = P_END_TAG.matcher(s); + if (m.find()) + { + final String name = m.group(1).toLowerCase(); + if (allowed(name)) + { + if (!inArray(name, vSelfClosingTags)) + { + if (vTagCounts.containsKey(name)) + { + vTagCounts.put(name, vTagCounts.get(name) - 1); + return ""; + } + } + } + } + + // starting tags + m = P_START_TAG.matcher(s); + if (m.find()) + { + final String name = m.group(1).toLowerCase(); + final String body = m.group(2); + String ending = m.group(3); + + // debug( "in a starting tag, name='" + name + "'; body='" + body + "'; ending='" + ending + "'" ); + if (allowed(name)) + { + final StringBuilder params = new StringBuilder(); + + final Matcher m2 = P_QUOTED_ATTRIBUTES.matcher(body); + final Matcher m3 = P_UNQUOTED_ATTRIBUTES.matcher(body); + final List paramNames = new ArrayList<>(); + final List paramValues = new ArrayList<>(); + while (m2.find()) + { + paramNames.add(m2.group(1)); // ([a-z0-9]+) + paramValues.add(m2.group(3)); // (.*?) + } + while (m3.find()) + { + paramNames.add(m3.group(1)); // ([a-z0-9]+) + paramValues.add(m3.group(3)); // ([^\"\\s']+) + } + + String paramName, paramValue; + for (int ii = 0; ii < paramNames.size(); ii++) + { + paramName = paramNames.get(ii).toLowerCase(); + paramValue = paramValues.get(ii); + + // debug( "paramName='" + paramName + "'" ); + // debug( "paramValue='" + paramValue + "'" ); + // debug( "allowed? " + vAllowed.get( name ).contains( paramName ) ); + + if (allowedAttribute(name, paramName)) + { + if (inArray(paramName, vProtocolAtts)) + { + paramValue = processParamProtocol(paramValue); + } + params.append(' ').append(paramName).append("=\\\"").append(paramValue).append("\\\""); + } + } + + if (inArray(name, vSelfClosingTags)) + { + ending = " /"; + } + + if (inArray(name, vNeedClosingTags)) + { + ending = ""; + } + + if (ending == null || ending.length() < 1) + { + if (vTagCounts.containsKey(name)) + { + vTagCounts.put(name, vTagCounts.get(name) + 1); + } + else + { + vTagCounts.put(name, 1); + } + } + else + { + ending = " /"; + } + return "<" + name + params + ending + ">"; + } + else + { + return ""; + } + } + + // comments + m = P_COMMENT.matcher(s); + if (!stripComment && m.find()) + { + return "<" + m.group() + ">"; + } + + return ""; + } + + private String processParamProtocol(String s) + { + s = decodeEntities(s); + final Matcher m = P_PROTOCOL.matcher(s); + if (m.find()) + { + final String protocol = m.group(1); + if (!inArray(protocol, vAllowedProtocols)) + { + // bad protocol, turn into local anchor link instead + s = "#" + s.substring(protocol.length() + 1); + if (s.startsWith("#//")) + { + s = "#" + s.substring(3); + } + } + } + + return s; + } + + private String decodeEntities(String s) + { + StringBuffer buf = new StringBuffer(); + + Matcher m = P_ENTITY.matcher(s); + while (m.find()) + { + final String match = m.group(1); + final int decimal = Integer.decode(match).intValue(); + m.appendReplacement(buf, Matcher.quoteReplacement(chr(decimal))); + } + m.appendTail(buf); + s = buf.toString(); + + buf = new StringBuffer(); + m = P_ENTITY_UNICODE.matcher(s); + while (m.find()) + { + final String match = m.group(1); + final int decimal = Integer.valueOf(match, 16).intValue(); + m.appendReplacement(buf, Matcher.quoteReplacement(chr(decimal))); + } + m.appendTail(buf); + s = buf.toString(); + + buf = new StringBuffer(); + m = P_ENCODE.matcher(s); + while (m.find()) + { + final String match = m.group(1); + final int decimal = Integer.valueOf(match, 16).intValue(); + m.appendReplacement(buf, Matcher.quoteReplacement(chr(decimal))); + } + m.appendTail(buf); + s = buf.toString(); + + s = validateEntities(s); + return s; + } + + private String validateEntities(final String s) + { + StringBuffer buf = new StringBuffer(); + + // validate entities throughout the string + Matcher m = P_VALID_ENTITIES.matcher(s); + while (m.find()) + { + final String one = m.group(1); // ([^&;]*) + final String two = m.group(2); // (?=(;|&|$)) + m.appendReplacement(buf, Matcher.quoteReplacement(checkEntity(one, two))); + } + m.appendTail(buf); + + return encodeQuotes(buf.toString()); + } + + private String encodeQuotes(final String s) + { + if (encodeQuotes) + { + StringBuffer buf = new StringBuffer(); + Matcher m = P_VALID_QUOTES.matcher(s); + while (m.find()) + { + final String one = m.group(1); // (>|^) + final String two = m.group(2); // ([^<]+?) + final String three = m.group(3); // (<|$) + // 不替换双引号为",防止json格式无效 regexReplace(P_QUOTE, """, two) + m.appendReplacement(buf, Matcher.quoteReplacement(one + two + three)); + } + m.appendTail(buf); + return buf.toString(); + } + else + { + return s; + } + } + + private String checkEntity(final String preamble, final String term) + { + + return ";".equals(term) && isValidEntity(preamble) ? '&' + preamble : "&" + preamble; + } + + private boolean isValidEntity(final String entity) + { + return inArray(entity, vAllowedEntities); + } + + private static boolean inArray(final String s, final String[] array) + { + for (String item : array) + { + if (item != null && item.equals(s)) + { + return true; + } + } + return false; + } + + private boolean allowed(final String name) + { + return (vAllowed.isEmpty() || vAllowed.containsKey(name)) && !inArray(name, vDisallowed); + } + + private boolean allowedAttribute(final String name, final String paramName) + { + return allowed(name) && (vAllowed.isEmpty() || vAllowed.get(name).contains(paramName)); + } +} \ No newline at end of file diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/http/HttpHelper.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/http/HttpHelper.java new file mode 100644 index 0000000..3fe178c --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/http/HttpHelper.java @@ -0,0 +1,55 @@ +package com.ruoyi.common.utils.http; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.nio.charset.StandardCharsets; +import javax.servlet.ServletRequest; +import org.apache.commons.lang3.exception.ExceptionUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * 通用http工具封装 + * + * @author #author# + */ +public class HttpHelper +{ + private static final Logger LOGGER = LoggerFactory.getLogger(HttpHelper.class); + + public static String getBodyString(ServletRequest request) + { + StringBuilder sb = new StringBuilder(); + BufferedReader reader = null; + try (InputStream inputStream = request.getInputStream()) + { + reader = new BufferedReader(new InputStreamReader(inputStream, StandardCharsets.UTF_8)); + String line = ""; + while ((line = reader.readLine()) != null) + { + sb.append(line); + } + } + catch (IOException e) + { + LOGGER.warn("getBodyString出现问题!"); + } + finally + { + if (reader != null) + { + try + { + reader.close(); + } + catch (IOException e) + { + LOGGER.error(ExceptionUtils.getMessage(e)); + } + } + } + return sb.toString(); + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/http/HttpUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/http/HttpUtils.java new file mode 100644 index 0000000..c1d5c11 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/http/HttpUtils.java @@ -0,0 +1,274 @@ +package com.ruoyi.common.utils.http; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.PrintWriter; +import java.net.ConnectException; +import java.net.SocketTimeoutException; +import java.net.URL; +import java.net.URLConnection; +import java.nio.charset.StandardCharsets; +import java.security.cert.X509Certificate; +import javax.net.ssl.HostnameVerifier; +import javax.net.ssl.HttpsURLConnection; +import javax.net.ssl.SSLContext; +import javax.net.ssl.SSLSession; +import javax.net.ssl.TrustManager; +import javax.net.ssl.X509TrustManager; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import com.ruoyi.common.constant.Constants; +import com.ruoyi.common.utils.StringUtils; + +/** + * 通用http发送方法 + * + * @author #author# + */ +public class HttpUtils +{ + private static final Logger log = LoggerFactory.getLogger(HttpUtils.class); + + /** + * 向指定 URL 发送GET方法的请求 + * + * @param url 发送请求的 URL + * @return 所代表远程资源的响应结果 + */ + public static String sendGet(String url) + { + return sendGet(url, StringUtils.EMPTY); + } + + /** + * 向指定 URL 发送GET方法的请求 + * + * @param url 发送请求的 URL + * @param param 请求参数,请求参数应该是 name1=value1&name2=value2 的形式。 + * @return 所代表远程资源的响应结果 + */ + public static String sendGet(String url, String param) + { + return sendGet(url, param, Constants.UTF8); + } + + /** + * 向指定 URL 发送GET方法的请求 + * + * @param url 发送请求的 URL + * @param param 请求参数,请求参数应该是 name1=value1&name2=value2 的形式。 + * @param contentType 编码类型 + * @return 所代表远程资源的响应结果 + */ + public static String sendGet(String url, String param, String contentType) + { + StringBuilder result = new StringBuilder(); + BufferedReader in = null; + try + { + String urlNameString = StringUtils.isNotBlank(param) ? url + "?" + param : url; + log.info("sendGet - {}", urlNameString); + URL realUrl = new URL(urlNameString); + URLConnection connection = realUrl.openConnection(); + connection.setRequestProperty("accept", "*/*"); + connection.setRequestProperty("connection", "Keep-Alive"); + connection.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)"); + connection.connect(); + in = new BufferedReader(new InputStreamReader(connection.getInputStream(), contentType)); + String line; + while ((line = in.readLine()) != null) + { + result.append(line); + } + log.info("recv - {}", result); + } + catch (ConnectException e) + { + log.error("调用HttpUtils.sendGet ConnectException, url=" + url + ",param=" + param, e); + } + catch (SocketTimeoutException e) + { + log.error("调用HttpUtils.sendGet SocketTimeoutException, url=" + url + ",param=" + param, e); + } + catch (IOException e) + { + log.error("调用HttpUtils.sendGet IOException, url=" + url + ",param=" + param, e); + } + catch (Exception e) + { + log.error("调用HttpsUtil.sendGet Exception, url=" + url + ",param=" + param, e); + } + finally + { + try + { + if (in != null) + { + in.close(); + } + } + catch (Exception ex) + { + log.error("调用in.close Exception, url=" + url + ",param=" + param, ex); + } + } + return result.toString(); + } + + /** + * 向指定 URL 发送POST方法的请求 + * + * @param url 发送请求的 URL + * @param param 请求参数,请求参数应该是 name1=value1&name2=value2 的形式。 + * @return 所代表远程资源的响应结果 + */ + public static String sendPost(String url, String param) + { + PrintWriter out = null; + BufferedReader in = null; + StringBuilder result = new StringBuilder(); + try + { + log.info("sendPost - {}", url); + URL realUrl = new URL(url); + URLConnection conn = realUrl.openConnection(); + conn.setRequestProperty("accept", "*/*"); + conn.setRequestProperty("connection", "Keep-Alive"); + conn.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)"); + conn.setRequestProperty("Accept-Charset", "utf-8"); + conn.setRequestProperty("contentType", "utf-8"); + conn.setDoOutput(true); + conn.setDoInput(true); + out = new PrintWriter(conn.getOutputStream()); + out.print(param); + out.flush(); + in = new BufferedReader(new InputStreamReader(conn.getInputStream(), StandardCharsets.UTF_8)); + String line; + while ((line = in.readLine()) != null) + { + result.append(line); + } + log.info("recv - {}", result); + } + catch (ConnectException e) + { + log.error("调用HttpUtils.sendPost ConnectException, url=" + url + ",param=" + param, e); + } + catch (SocketTimeoutException e) + { + log.error("调用HttpUtils.sendPost SocketTimeoutException, url=" + url + ",param=" + param, e); + } + catch (IOException e) + { + log.error("调用HttpUtils.sendPost IOException, url=" + url + ",param=" + param, e); + } + catch (Exception e) + { + log.error("调用HttpsUtil.sendPost Exception, url=" + url + ",param=" + param, e); + } + finally + { + try + { + if (out != null) + { + out.close(); + } + if (in != null) + { + in.close(); + } + } + catch (IOException ex) + { + log.error("调用in.close Exception, url=" + url + ",param=" + param, ex); + } + } + return result.toString(); + } + + public static String sendSSLPost(String url, String param) + { + StringBuilder result = new StringBuilder(); + String urlNameString = url + "?" + param; + try + { + log.info("sendSSLPost - {}", urlNameString); + SSLContext sc = SSLContext.getInstance("SSL"); + sc.init(null, new TrustManager[] { new TrustAnyTrustManager() }, new java.security.SecureRandom()); + URL console = new URL(urlNameString); + HttpsURLConnection conn = (HttpsURLConnection) console.openConnection(); + conn.setRequestProperty("accept", "*/*"); + conn.setRequestProperty("connection", "Keep-Alive"); + conn.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)"); + conn.setRequestProperty("Accept-Charset", "utf-8"); + conn.setRequestProperty("contentType", "utf-8"); + conn.setDoOutput(true); + conn.setDoInput(true); + + conn.setSSLSocketFactory(sc.getSocketFactory()); + conn.setHostnameVerifier(new TrustAnyHostnameVerifier()); + conn.connect(); + InputStream is = conn.getInputStream(); + BufferedReader br = new BufferedReader(new InputStreamReader(is)); + String ret = ""; + while ((ret = br.readLine()) != null) + { + if (ret != null && !"".equals(ret.trim())) + { + result.append(new String(ret.getBytes(StandardCharsets.ISO_8859_1), StandardCharsets.UTF_8)); + } + } + log.info("recv - {}", result); + conn.disconnect(); + br.close(); + } + catch (ConnectException e) + { + log.error("调用HttpUtils.sendSSLPost ConnectException, url=" + url + ",param=" + param, e); + } + catch (SocketTimeoutException e) + { + log.error("调用HttpUtils.sendSSLPost SocketTimeoutException, url=" + url + ",param=" + param, e); + } + catch (IOException e) + { + log.error("调用HttpUtils.sendSSLPost IOException, url=" + url + ",param=" + param, e); + } + catch (Exception e) + { + log.error("调用HttpsUtil.sendSSLPost Exception, url=" + url + ",param=" + param, e); + } + return result.toString(); + } + + private static class TrustAnyTrustManager implements X509TrustManager + { + @Override + public void checkClientTrusted(X509Certificate[] chain, String authType) + { + } + + @Override + public void checkServerTrusted(X509Certificate[] chain, String authType) + { + } + + @Override + public X509Certificate[] getAcceptedIssuers() + { + return new X509Certificate[] {}; + } + } + + private static class TrustAnyHostnameVerifier implements HostnameVerifier + { + @Override + public boolean verify(String hostname, SSLSession session) + { + return true; + } + } +} \ No newline at end of file diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/ip/AddressUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/ip/AddressUtils.java new file mode 100644 index 0000000..f00b5c5 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/ip/AddressUtils.java @@ -0,0 +1,56 @@ +package com.ruoyi.common.utils.ip; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import com.alibaba.fastjson2.JSON; +import com.alibaba.fastjson2.JSONObject; +import com.ruoyi.common.config.RuoYiConfig; +import com.ruoyi.common.constant.Constants; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.common.utils.http.HttpUtils; + +/** + * 获取地址类 + * + * @author #author# + */ +public class AddressUtils +{ + private static final Logger log = LoggerFactory.getLogger(AddressUtils.class); + + // IP地址查询 + public static final String IP_URL = "http://whois.pconline.com.cn/ipJson.jsp"; + + // 未知地址 + public static final String UNKNOWN = "XX XX"; + + public static String getRealAddressByIP(String ip) + { + // 内网不查询 + if (IpUtils.internalIp(ip)) + { + return "内网IP"; + } + if (RuoYiConfig.isAddressEnabled()) + { + try + { + String rspStr = HttpUtils.sendGet(IP_URL, "ip=" + ip + "&json=true", Constants.GBK); + if (StringUtils.isEmpty(rspStr)) + { + log.error("获取地理位置异常 {}", ip); + return UNKNOWN; + } + JSONObject obj = JSON.parseObject(rspStr); + String region = obj.getString("pro"); + String city = obj.getString("city"); + return String.format("%s %s", region, city); + } + catch (Exception e) + { + log.error("获取地理位置异常 {}", ip); + } + } + return UNKNOWN; + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/ip/IpUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/ip/IpUtils.java new file mode 100644 index 0000000..c4dd8fe --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/ip/IpUtils.java @@ -0,0 +1,264 @@ +package com.ruoyi.common.utils.ip; + +import java.net.InetAddress; +import java.net.UnknownHostException; +import javax.servlet.http.HttpServletRequest; +import com.ruoyi.common.utils.StringUtils; + +/** + * 获取IP方法 + * + * @author #author# + */ +public class IpUtils +{ + /** + * 获取客户端IP + * + * @param request 请求对象 + * @return IP地址 + */ + public static String getIpAddr(HttpServletRequest request) + { + if (request == null) + { + return "unknown"; + } + String ip = request.getHeader("x-forwarded-for"); + if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) + { + ip = request.getHeader("Proxy-Client-IP"); + } + if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) + { + ip = request.getHeader("X-Forwarded-For"); + } + if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) + { + ip = request.getHeader("WL-Proxy-Client-IP"); + } + if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) + { + ip = request.getHeader("X-Real-IP"); + } + + if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) + { + ip = request.getRemoteAddr(); + } + + return "0:0:0:0:0:0:0:1".equals(ip) ? "127.0.0.1" : getMultistageReverseProxyIp(ip); + } + + /** + * 检查是否为内部IP地址 + * + * @param ip IP地址 + * @return 结果 + */ + public static boolean internalIp(String ip) + { + byte[] addr = textToNumericFormatV4(ip); + return internalIp(addr) || "127.0.0.1".equals(ip); + } + + /** + * 检查是否为内部IP地址 + * + * @param addr byte地址 + * @return 结果 + */ + private static boolean internalIp(byte[] addr) + { + if (StringUtils.isNull(addr) || addr.length < 2) + { + return true; + } + final byte b0 = addr[0]; + final byte b1 = addr[1]; + // 10.x.x.x/8 + final byte SECTION_1 = 0x0A; + // 172.16.x.x/12 + final byte SECTION_2 = (byte) 0xAC; + final byte SECTION_3 = (byte) 0x10; + final byte SECTION_4 = (byte) 0x1F; + // 192.168.x.x/16 + final byte SECTION_5 = (byte) 0xC0; + final byte SECTION_6 = (byte) 0xA8; + switch (b0) + { + case SECTION_1: + return true; + case SECTION_2: + if (b1 >= SECTION_3 && b1 <= SECTION_4) + { + return true; + } + case SECTION_5: + switch (b1) + { + case SECTION_6: + return true; + } + default: + return false; + } + } + + /** + * 将IPv4地址转换成字节 + * + * @param text IPv4地址 + * @return byte 字节 + */ + public static byte[] textToNumericFormatV4(String text) + { + if (text.length() == 0) + { + return null; + } + + byte[] bytes = new byte[4]; + String[] elements = text.split("\\.", -1); + try + { + long l; + int i; + switch (elements.length) + { + case 1: + l = Long.parseLong(elements[0]); + if ((l < 0L) || (l > 4294967295L)) + { + return null; + } + bytes[0] = (byte) (int) (l >> 24 & 0xFF); + bytes[1] = (byte) (int) ((l & 0xFFFFFF) >> 16 & 0xFF); + bytes[2] = (byte) (int) ((l & 0xFFFF) >> 8 & 0xFF); + bytes[3] = (byte) (int) (l & 0xFF); + break; + case 2: + l = Integer.parseInt(elements[0]); + if ((l < 0L) || (l > 255L)) + { + return null; + } + bytes[0] = (byte) (int) (l & 0xFF); + l = Integer.parseInt(elements[1]); + if ((l < 0L) || (l > 16777215L)) + { + return null; + } + bytes[1] = (byte) (int) (l >> 16 & 0xFF); + bytes[2] = (byte) (int) ((l & 0xFFFF) >> 8 & 0xFF); + bytes[3] = (byte) (int) (l & 0xFF); + break; + case 3: + for (i = 0; i < 2; ++i) + { + l = Integer.parseInt(elements[i]); + if ((l < 0L) || (l > 255L)) + { + return null; + } + bytes[i] = (byte) (int) (l & 0xFF); + } + l = Integer.parseInt(elements[2]); + if ((l < 0L) || (l > 65535L)) + { + return null; + } + bytes[2] = (byte) (int) (l >> 8 & 0xFF); + bytes[3] = (byte) (int) (l & 0xFF); + break; + case 4: + for (i = 0; i < 4; ++i) + { + l = Integer.parseInt(elements[i]); + if ((l < 0L) || (l > 255L)) + { + return null; + } + bytes[i] = (byte) (int) (l & 0xFF); + } + break; + default: + return null; + } + } + catch (NumberFormatException e) + { + return null; + } + return bytes; + } + + /** + * 获取IP地址 + * + * @return 本地IP地址 + */ + public static String getHostIp() + { + try + { + return InetAddress.getLocalHost().getHostAddress(); + } + catch (UnknownHostException e) + { + } + return "127.0.0.1"; + } + + /** + * 获取主机名 + * + * @return 本地主机名 + */ + public static String getHostName() + { + try + { + return InetAddress.getLocalHost().getHostName(); + } + catch (UnknownHostException e) + { + } + return "未知"; + } + + /** + * 从多级反向代理中获得第一个非unknown IP地址 + * + * @param ip 获得的IP地址 + * @return 第一个非unknown IP地址 + */ + public static String getMultistageReverseProxyIp(String ip) + { + // 多级反向代理检测 + if (ip != null && ip.indexOf(",") > 0) + { + final String[] ips = ip.trim().split(","); + for (String subIp : ips) + { + if (false == isUnknown(subIp)) + { + ip = subIp; + break; + } + } + } + return ip; + } + + /** + * 检测给定字符串是否为未知,多用于检测HTTP请求相关 + * + * @param checkString 被检测的字符串 + * @return 是否未知 + */ + public static boolean isUnknown(String checkString) + { + return StringUtils.isBlank(checkString) || "unknown".equalsIgnoreCase(checkString); + } +} \ No newline at end of file diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelHandlerAdapter.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelHandlerAdapter.java new file mode 100644 index 0000000..a402370 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelHandlerAdapter.java @@ -0,0 +1,19 @@ +package com.ruoyi.common.utils.poi; + +/** + * Excel数据格式处理适配器 + * + * @author #author# + */ +public interface ExcelHandlerAdapter +{ + /** + * 格式化 + * + * @param value 单元格数据值 + * @param args excel注解args参数组 + * + * @return 处理后的值 + */ + Object format(Object value, String[] args); +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java new file mode 100644 index 0000000..69c5758 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java @@ -0,0 +1,1734 @@ +package com.ruoyi.common.utils.poi; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.lang.reflect.Field; +import java.lang.reflect.Method; +import java.lang.reflect.ParameterizedType; +import java.math.BigDecimal; +import java.text.DecimalFormat; +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Comparator; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.UUID; +import java.util.stream.Collectors; +import javax.servlet.http.HttpServletResponse; +import org.apache.commons.lang3.ArrayUtils; +import org.apache.commons.lang3.RegExUtils; +import org.apache.commons.lang3.reflect.FieldUtils; +import org.apache.poi.hssf.usermodel.HSSFClientAnchor; +import org.apache.poi.hssf.usermodel.HSSFPicture; +import org.apache.poi.hssf.usermodel.HSSFPictureData; +import org.apache.poi.hssf.usermodel.HSSFShape; +import org.apache.poi.hssf.usermodel.HSSFSheet; +import org.apache.poi.hssf.usermodel.HSSFWorkbook; +import org.apache.poi.ooxml.POIXMLDocumentPart; +import org.apache.poi.ss.usermodel.BorderStyle; +import org.apache.poi.ss.usermodel.Cell; +import org.apache.poi.ss.usermodel.CellStyle; +import org.apache.poi.ss.usermodel.CellType; +import org.apache.poi.ss.usermodel.ClientAnchor; +import org.apache.poi.ss.usermodel.DataValidation; +import org.apache.poi.ss.usermodel.DataValidationConstraint; +import org.apache.poi.ss.usermodel.DataValidationHelper; +import org.apache.poi.ss.usermodel.DateUtil; +import org.apache.poi.ss.usermodel.Drawing; +import org.apache.poi.ss.usermodel.FillPatternType; +import org.apache.poi.ss.usermodel.Font; +import org.apache.poi.ss.usermodel.HorizontalAlignment; +import org.apache.poi.ss.usermodel.IndexedColors; +import org.apache.poi.ss.usermodel.Name; +import org.apache.poi.ss.usermodel.PictureData; +import org.apache.poi.ss.usermodel.Row; +import org.apache.poi.ss.usermodel.Sheet; +import org.apache.poi.ss.usermodel.VerticalAlignment; +import org.apache.poi.ss.usermodel.Workbook; +import org.apache.poi.ss.usermodel.WorkbookFactory; +import org.apache.poi.ss.util.CellRangeAddress; +import org.apache.poi.ss.util.CellRangeAddressList; +import org.apache.poi.util.IOUtils; +import org.apache.poi.xssf.streaming.SXSSFWorkbook; +import org.apache.poi.xssf.usermodel.XSSFClientAnchor; +import org.apache.poi.xssf.usermodel.XSSFDataValidation; +import org.apache.poi.xssf.usermodel.XSSFDrawing; +import org.apache.poi.xssf.usermodel.XSSFPicture; +import org.apache.poi.xssf.usermodel.XSSFShape; +import org.apache.poi.xssf.usermodel.XSSFSheet; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; +import org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTMarker; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.annotation.Excel.ColumnType; +import com.ruoyi.common.annotation.Excel.Type; +import com.ruoyi.common.annotation.Excels; +import com.ruoyi.common.config.RuoYiConfig; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.text.Convert; +import com.ruoyi.common.exception.UtilException; +import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.common.utils.DictUtils; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.common.utils.file.FileTypeUtils; +import com.ruoyi.common.utils.file.FileUtils; +import com.ruoyi.common.utils.file.ImageUtils; +import com.ruoyi.common.utils.reflect.ReflectUtils; + +/** + * Excel相关处理 + * + * @author #author# + */ +public class ExcelUtil +{ + private static final Logger log = LoggerFactory.getLogger(ExcelUtil.class); + + public static final String FORMULA_REGEX_STR = "=|-|\\+|@"; + + public static final String[] FORMULA_STR = { "=", "-", "+", "@" }; + + /** + * Excel sheet最大行数,默认65536 + */ + public static final int sheetSize = 65536; + + /** + * 工作表名称 + */ + private String sheetName; + + /** + * 导出类型(EXPORT:导出数据;IMPORT:导入模板) + */ + private Type type; + + /** + * 工作薄对象 + */ + private Workbook wb; + + /** + * 工作表对象 + */ + private Sheet sheet; + + /** + * 样式列表 + */ + private Map styles; + + /** + * 导入导出数据列表 + */ + private List list; + + /** + * 注解列表 + */ + private List fields; + + /** + * 当前行号 + */ + private int rownum; + + /** + * 标题 + */ + private String title; + + /** + * 最大高度 + */ + private short maxHeight; + + /** + * 合并后最后行数 + */ + private int subMergedLastRowNum = 0; + + /** + * 合并后开始行数 + */ + private int subMergedFirstRowNum = 1; + + /** + * 对象的子列表方法 + */ + private Method subMethod; + + /** + * 对象的子列表属性 + */ + private List subFields; + + /** + * 统计列表 + */ + private Map statistics = new HashMap(); + + /** + * 数字格式 + */ + private static final DecimalFormat DOUBLE_FORMAT = new DecimalFormat("######0.00"); + + /** + * 实体对象 + */ + public Class clazz; + + /** + * 需要排除列属性 + */ + public String[] excludeFields; + + public ExcelUtil(Class clazz) + { + this.clazz = clazz; + } + + /** + * 隐藏Excel中列属性 + * + * @param fields 列属性名 示例[单个"name"/多个"id","name"] + * @throws Exception + */ + public void hideColumn(String... fields) + { + this.excludeFields = fields; + } + + public void init(List list, String sheetName, String title, Type type) + { + if (list == null) + { + list = new ArrayList(); + } + this.list = list; + this.sheetName = sheetName; + this.type = type; + this.title = title; + createExcelField(); + createWorkbook(); + createTitle(); + createSubHead(); + } + + /** + * 创建excel第一行标题 + */ + public void createTitle() + { + if (StringUtils.isNotEmpty(title)) + { + subMergedFirstRowNum++; + subMergedLastRowNum++; + int titleLastCol = this.fields.size() - 1; + if (isSubList()) + { + titleLastCol = titleLastCol + subFields.size() - 1; + } + Row titleRow = sheet.createRow(rownum == 0 ? rownum++ : 0); + titleRow.setHeightInPoints(30); + Cell titleCell = titleRow.createCell(0); + titleCell.setCellStyle(styles.get("title")); + titleCell.setCellValue(title); + sheet.addMergedRegion(new CellRangeAddress(titleRow.getRowNum(), titleRow.getRowNum(), titleRow.getRowNum(), titleLastCol)); + } + } + + /** + * 创建对象的子列表名称 + */ + public void createSubHead() + { + if (isSubList()) + { + subMergedFirstRowNum++; + subMergedLastRowNum++; + Row subRow = sheet.createRow(rownum); + int excelNum = 0; + for (Object[] objects : fields) + { + Excel attr = (Excel) objects[1]; + Cell headCell1 = subRow.createCell(excelNum); + headCell1.setCellValue(attr.name()); + headCell1.setCellStyle(styles.get(StringUtils.format("header_{}_{}", attr.headerColor(), attr.headerBackgroundColor()))); + excelNum++; + } + int headFirstRow = excelNum - 1; + int headLastRow = headFirstRow + subFields.size() - 1; + if (headLastRow > headFirstRow) + { + sheet.addMergedRegion(new CellRangeAddress(rownum, rownum, headFirstRow, headLastRow)); + } + rownum++; + } + } + + /** + * 对excel表单默认第一个索引名转换成list + * + * @param is 输入流 + * @return 转换后集合 + */ + public List importExcel(InputStream is) throws Exception + { + return importExcel(is, 0); + } + + /** + * 对excel表单默认第一个索引名转换成list + * + * @param is 输入流 + * @param titleNum 标题占用行数 + * @return 转换后集合 + */ + public List importExcel(InputStream is, int titleNum) throws Exception + { + return importExcel(StringUtils.EMPTY, is, titleNum); + } + + /** + * 对excel表单指定表格索引名转换成list + * + * @param sheetName 表格索引名 + * @param titleNum 标题占用行数 + * @param is 输入流 + * @return 转换后集合 + */ + public List importExcel(String sheetName, InputStream is, int titleNum) throws Exception + { + this.type = Type.IMPORT; + this.wb = WorkbookFactory.create(is); + List list = new ArrayList(); + // 如果指定sheet名,则取指定sheet中的内容 否则默认指向第1个sheet + Sheet sheet = StringUtils.isNotEmpty(sheetName) ? wb.getSheet(sheetName) : wb.getSheetAt(0); + if (sheet == null) + { + throw new IOException("文件sheet不存在"); + } + boolean isXSSFWorkbook = !(wb instanceof HSSFWorkbook); + Map pictures; + if (isXSSFWorkbook) + { + pictures = getSheetPictures07((XSSFSheet) sheet, (XSSFWorkbook) wb); + } + else + { + pictures = getSheetPictures03((HSSFSheet) sheet, (HSSFWorkbook) wb); + } + // 获取最后一个非空行的行下标,比如总行数为n,则返回的为n-1 + int rows = sheet.getLastRowNum(); + + if (rows > 0) + { + // 定义一个map用于存放excel列的序号和field. + Map cellMap = new HashMap(); + // 获取表头 + Row heard = sheet.getRow(titleNum); + for (int i = 0; i < heard.getPhysicalNumberOfCells(); i++) + { + Cell cell = heard.getCell(i); + if (StringUtils.isNotNull(cell)) + { + String value = this.getCellValue(heard, i).toString(); + cellMap.put(value, i); + } + else + { + cellMap.put(null, i); + } + } + // 有数据时才处理 得到类的所有field. + List fields = this.getFields(); + Map fieldsMap = new HashMap(); + for (Object[] objects : fields) + { + Excel attr = (Excel) objects[1]; + Integer column = cellMap.get(attr.name()); + if (column != null) + { + fieldsMap.put(column, objects); + } + } + for (int i = titleNum + 1; i <= rows; i++) + { + // 从第2行开始取数据,默认第一行是表头. + Row row = sheet.getRow(i); + // 判断当前行是否是空行 + if (isRowEmpty(row)) + { + continue; + } + T entity = null; + for (Map.Entry entry : fieldsMap.entrySet()) + { + Object val = this.getCellValue(row, entry.getKey()); + + // 如果不存在实例则新建. + entity = (entity == null ? clazz.newInstance() : entity); + // 从map中得到对应列的field. + Field field = (Field) entry.getValue()[0]; + Excel attr = (Excel) entry.getValue()[1]; + // 取得类型,并根据对象类型设置值. + Class fieldType = field.getType(); + if (String.class == fieldType) + { + String s = Convert.toStr(val); + if (StringUtils.endsWith(s, ".0")) + { + val = StringUtils.substringBefore(s, ".0"); + } + else + { + String dateFormat = field.getAnnotation(Excel.class).dateFormat(); + if (StringUtils.isNotEmpty(dateFormat)) + { + val = parseDateToStr(dateFormat, val); + } + else + { + val = Convert.toStr(val); + } + } + } + else if ((Integer.TYPE == fieldType || Integer.class == fieldType) && StringUtils.isNumeric(Convert.toStr(val))) + { + val = Convert.toInt(val); + } + else if ((Long.TYPE == fieldType || Long.class == fieldType) && StringUtils.isNumeric(Convert.toStr(val))) + { + val = Convert.toLong(val); + } + else if (Double.TYPE == fieldType || Double.class == fieldType) + { + val = Convert.toDouble(val); + } + else if (Float.TYPE == fieldType || Float.class == fieldType) + { + val = Convert.toFloat(val); + } + else if (BigDecimal.class == fieldType) + { + val = Convert.toBigDecimal(val); + } + else if (Date.class == fieldType) + { + if (val instanceof String) + { + val = DateUtils.parseDate(val); + } + else if (val instanceof Double) + { + val = DateUtil.getJavaDate((Double) val); + } + } + else if (Boolean.TYPE == fieldType || Boolean.class == fieldType) + { + val = Convert.toBool(val, false); + } + if (StringUtils.isNotNull(fieldType)) + { + String propertyName = field.getName(); + if (StringUtils.isNotEmpty(attr.targetAttr())) + { + propertyName = field.getName() + "." + attr.targetAttr(); + } + else if (StringUtils.isNotEmpty(attr.readConverterExp())) + { + val = reverseByExp(Convert.toStr(val), attr.readConverterExp(), attr.separator()); + } + else if (StringUtils.isNotEmpty(attr.dictType())) + { + val = reverseDictByExp(Convert.toStr(val), attr.dictType(), attr.separator()); + } + else if (!attr.handler().equals(ExcelHandlerAdapter.class)) + { + val = dataFormatHandlerAdapter(val, attr); + } + else if (ColumnType.IMAGE == attr.cellType() && StringUtils.isNotEmpty(pictures)) + { + PictureData image = pictures.get(row.getRowNum() + "_" + entry.getKey()); + if (image == null) + { + val = ""; + } + else + { + byte[] data = image.getData(); + val = FileUtils.writeImportBytes(data); + } + } + ReflectUtils.invokeSetter(entity, propertyName, val); + } + } + list.add(entity); + } + } + return list; + } + + /** + * 对list数据源将其里面的数据导入到excel表单 + * + * @param list 导出数据集合 + * @param sheetName 工作表的名称 + * @return 结果 + */ + public AjaxResult exportExcel(List list, String sheetName) + { + return exportExcel(list, sheetName, StringUtils.EMPTY); + } + + /** + * 对list数据源将其里面的数据导入到excel表单 + * + * @param list 导出数据集合 + * @param sheetName 工作表的名称 + * @param title 标题 + * @return 结果 + */ + public AjaxResult exportExcel(List list, String sheetName, String title) + { + this.init(list, sheetName, title, Type.EXPORT); + return exportExcel(); + } + + /** + * 对list数据源将其里面的数据导入到excel表单 + * + * @param response 返回数据 + * @param list 导出数据集合 + * @param sheetName 工作表的名称 + * @return 结果 + */ + public void exportExcel(HttpServletResponse response, List list, String sheetName) + { + exportExcel(response, list, sheetName, StringUtils.EMPTY); + } + + /** + * 对list数据源将其里面的数据导入到excel表单 + * + * @param response 返回数据 + * @param list 导出数据集合 + * @param sheetName 工作表的名称 + * @param title 标题 + * @return 结果 + */ + public void exportExcel(HttpServletResponse response, List list, String sheetName, String title) + { + response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); + response.setCharacterEncoding("utf-8"); + this.init(list, sheetName, title, Type.EXPORT); + exportExcel(response); + } + + /** + * 对list数据源将其里面的数据导入到excel表单 + * + * @param sheetName 工作表的名称 + * @return 结果 + */ + public AjaxResult importTemplateExcel(String sheetName) + { + return importTemplateExcel(sheetName, StringUtils.EMPTY); + } + + /** + * 对list数据源将其里面的数据导入到excel表单 + * + * @param sheetName 工作表的名称 + * @param title 标题 + * @return 结果 + */ + public AjaxResult importTemplateExcel(String sheetName, String title) + { + this.init(null, sheetName, title, Type.IMPORT); + return exportExcel(); + } + + /** + * 对list数据源将其里面的数据导入到excel表单 + * + * @param sheetName 工作表的名称 + * @return 结果 + */ + public void importTemplateExcel(HttpServletResponse response, String sheetName) + { + importTemplateExcel(response, sheetName, StringUtils.EMPTY); + } + + /** + * 对list数据源将其里面的数据导入到excel表单 + * + * @param sheetName 工作表的名称 + * @param title 标题 + * @return 结果 + */ + public void importTemplateExcel(HttpServletResponse response, String sheetName, String title) + { + response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); + response.setCharacterEncoding("utf-8"); + this.init(null, sheetName, title, Type.IMPORT); + exportExcel(response); + } + + /** + * 对list数据源将其里面的数据导入到excel表单 + * + * @return 结果 + */ + public void exportExcel(HttpServletResponse response) + { + try + { + writeSheet(); + wb.write(response.getOutputStream()); + } + catch (Exception e) + { + log.error("导出Excel异常{}", e.getMessage()); + } + finally + { + IOUtils.closeQuietly(wb); + } + } + + /** + * 对list数据源将其里面的数据导入到excel表单 + * + * @return 结果 + */ + public AjaxResult exportExcel() + { + OutputStream out = null; + try + { + writeSheet(); + String filename = encodingFilename(sheetName); + out = new FileOutputStream(getAbsoluteFile(filename)); + wb.write(out); + return AjaxResult.success(filename); + } + catch (Exception e) + { + log.error("导出Excel异常{}", e.getMessage()); + throw new UtilException("导出Excel失败,请联系网站管理员!"); + } + finally + { + IOUtils.closeQuietly(wb); + IOUtils.closeQuietly(out); + } + } + + /** + * 创建写入数据到Sheet + */ + public void writeSheet() + { + // 取出一共有多少个sheet. + int sheetNo = Math.max(1, (int) Math.ceil(list.size() * 1.0 / sheetSize)); + for (int index = 0; index < sheetNo; index++) + { + createSheet(sheetNo, index); + + // 产生一行 + Row row = sheet.createRow(rownum); + int column = 0; + // 写入各个字段的列头名称 + for (Object[] os : fields) + { + Field field = (Field) os[0]; + Excel excel = (Excel) os[1]; + if (Collection.class.isAssignableFrom(field.getType())) + { + for (Field subField : subFields) + { + Excel subExcel = subField.getAnnotation(Excel.class); + this.createHeadCell(subExcel, row, column++); + } + } + else + { + this.createHeadCell(excel, row, column++); + } + } + if (Type.EXPORT.equals(type)) + { + fillExcelData(index, row); + addStatisticsRow(); + } + } + } + + /** + * 填充excel数据 + * + * @param index 序号 + * @param row 单元格行 + */ + @SuppressWarnings("unchecked") + public void fillExcelData(int index, Row row) + { + int startNo = index * sheetSize; + int endNo = Math.min(startNo + sheetSize, list.size()); + int rowNo = (1 + rownum) - startNo; + for (int i = startNo; i < endNo; i++) + { + rowNo = isSubList() ? (i > 1 ? rowNo + 1 : rowNo + i) : i + 1 + rownum - startNo; + row = sheet.createRow(rowNo); + // 得到导出对象. + T vo = (T) list.get(i); + Collection subList = null; + if (isSubList()) + { + if (isSubListValue(vo)) + { + subList = getListCellValue(vo); + subMergedLastRowNum = subMergedLastRowNum + subList.size(); + } + else + { + subMergedFirstRowNum++; + subMergedLastRowNum++; + } + } + int column = 0; + for (Object[] os : fields) + { + Field field = (Field) os[0]; + Excel excel = (Excel) os[1]; + if (Collection.class.isAssignableFrom(field.getType()) && StringUtils.isNotNull(subList)) + { + boolean subFirst = false; + for (Object obj : subList) + { + if (subFirst) + { + rowNo++; + row = sheet.createRow(rowNo); + } + List subFields = FieldUtils.getFieldsListWithAnnotation(obj.getClass(), Excel.class); + int subIndex = 0; + for (Field subField : subFields) + { + if (subField.isAnnotationPresent(Excel.class)) + { + subField.setAccessible(true); + Excel attr = subField.getAnnotation(Excel.class); + this.addCell(attr, row, (T) obj, subField, column + subIndex); + } + subIndex++; + } + subFirst = true; + } + this.subMergedFirstRowNum = this.subMergedFirstRowNum + subList.size(); + } + else + { + this.addCell(excel, row, vo, field, column++); + } + } + } + } + + /** + * 创建表格样式 + * + * @param wb 工作薄对象 + * @return 样式列表 + */ + private Map createStyles(Workbook wb) + { + // 写入各条记录,每条记录对应excel表中的一行 + Map styles = new HashMap(); + CellStyle style = wb.createCellStyle(); + style.setAlignment(HorizontalAlignment.CENTER); + style.setVerticalAlignment(VerticalAlignment.CENTER); + Font titleFont = wb.createFont(); + titleFont.setFontName("Arial"); + titleFont.setFontHeightInPoints((short) 16); + titleFont.setBold(true); + style.setFont(titleFont); + styles.put("title", style); + + style = wb.createCellStyle(); + style.setAlignment(HorizontalAlignment.CENTER); + style.setVerticalAlignment(VerticalAlignment.CENTER); + style.setBorderRight(BorderStyle.THIN); + style.setRightBorderColor(IndexedColors.GREY_50_PERCENT.getIndex()); + style.setBorderLeft(BorderStyle.THIN); + style.setLeftBorderColor(IndexedColors.GREY_50_PERCENT.getIndex()); + style.setBorderTop(BorderStyle.THIN); + style.setTopBorderColor(IndexedColors.GREY_50_PERCENT.getIndex()); + style.setBorderBottom(BorderStyle.THIN); + style.setBottomBorderColor(IndexedColors.GREY_50_PERCENT.getIndex()); + Font dataFont = wb.createFont(); + dataFont.setFontName("Arial"); + dataFont.setFontHeightInPoints((short) 10); + style.setFont(dataFont); + styles.put("data", style); + + style = wb.createCellStyle(); + style.setAlignment(HorizontalAlignment.CENTER); + style.setVerticalAlignment(VerticalAlignment.CENTER); + Font totalFont = wb.createFont(); + totalFont.setFontName("Arial"); + totalFont.setFontHeightInPoints((short) 10); + style.setFont(totalFont); + styles.put("total", style); + + styles.putAll(annotationHeaderStyles(wb, styles)); + + styles.putAll(annotationDataStyles(wb)); + + return styles; + } + + /** + * 根据Excel注解创建表格头样式 + * + * @param wb 工作薄对象 + * @return 自定义样式列表 + */ + private Map annotationHeaderStyles(Workbook wb, Map styles) + { + Map headerStyles = new HashMap(); + for (Object[] os : fields) + { + Excel excel = (Excel) os[1]; + String key = StringUtils.format("header_{}_{}", excel.headerColor(), excel.headerBackgroundColor()); + if (!headerStyles.containsKey(key)) + { + CellStyle style = wb.createCellStyle(); + style.cloneStyleFrom(styles.get("data")); + style.setAlignment(HorizontalAlignment.CENTER); + style.setVerticalAlignment(VerticalAlignment.CENTER); + style.setFillForegroundColor(excel.headerBackgroundColor().index); + style.setFillPattern(FillPatternType.SOLID_FOREGROUND); + Font headerFont = wb.createFont(); + headerFont.setFontName("Arial"); + headerFont.setFontHeightInPoints((short) 10); + headerFont.setBold(true); + headerFont.setColor(excel.headerColor().index); + style.setFont(headerFont); + headerStyles.put(key, style); + } + } + return headerStyles; + } + + /** + * 根据Excel注解创建表格列样式 + * + * @param wb 工作薄对象 + * @return 自定义样式列表 + */ + private Map annotationDataStyles(Workbook wb) + { + Map styles = new HashMap(); + for (Object[] os : fields) + { + Excel excel = (Excel) os[1]; + String key = StringUtils.format("data_{}_{}_{}", excel.align(), excel.color(), excel.backgroundColor()); + if (!styles.containsKey(key)) + { + CellStyle style = wb.createCellStyle(); + style.setAlignment(excel.align()); + style.setVerticalAlignment(VerticalAlignment.CENTER); + style.setBorderRight(BorderStyle.THIN); + style.setRightBorderColor(IndexedColors.GREY_50_PERCENT.getIndex()); + style.setBorderLeft(BorderStyle.THIN); + style.setLeftBorderColor(IndexedColors.GREY_50_PERCENT.getIndex()); + style.setBorderTop(BorderStyle.THIN); + style.setTopBorderColor(IndexedColors.GREY_50_PERCENT.getIndex()); + style.setBorderBottom(BorderStyle.THIN); + style.setBottomBorderColor(IndexedColors.GREY_50_PERCENT.getIndex()); + style.setFillPattern(FillPatternType.SOLID_FOREGROUND); + style.setFillForegroundColor(excel.backgroundColor().getIndex()); + Font dataFont = wb.createFont(); + dataFont.setFontName("Arial"); + dataFont.setFontHeightInPoints((short) 10); + dataFont.setColor(excel.color().index); + style.setFont(dataFont); + styles.put(key, style); + } + } + return styles; + } + + /** + * 创建单元格 + */ + public Cell createHeadCell(Excel attr, Row row, int column) + { + // 创建列 + Cell cell = row.createCell(column); + // 写入列信息 + cell.setCellValue(attr.name()); + setDataValidation(attr, row, column); + cell.setCellStyle(styles.get(StringUtils.format("header_{}_{}", attr.headerColor(), attr.headerBackgroundColor()))); + if (isSubList()) + { + // 填充默认样式,防止合并单元格样式失效 + sheet.setDefaultColumnStyle(column, styles.get(StringUtils.format("data_{}_{}_{}", attr.align(), attr.color(), attr.backgroundColor()))); + if (attr.needMerge()) + { + sheet.addMergedRegion(new CellRangeAddress(rownum - 1, rownum, column, column)); + } + } + return cell; + } + + /** + * 设置单元格信息 + * + * @param value 单元格值 + * @param attr 注解相关 + * @param cell 单元格信息 + */ + public void setCellVo(Object value, Excel attr, Cell cell) + { + if (ColumnType.STRING == attr.cellType()) + { + String cellValue = Convert.toStr(value); + // 对于任何以表达式触发字符 =-+@开头的单元格,直接使用tab字符作为前缀,防止CSV注入。 + if (StringUtils.startsWithAny(cellValue, FORMULA_STR)) + { + cellValue = RegExUtils.replaceFirst(cellValue, FORMULA_REGEX_STR, "\t$0"); + } + if (value instanceof Collection && StringUtils.equals("[]", cellValue)) + { + cellValue = StringUtils.EMPTY; + } + cell.setCellValue(StringUtils.isNull(cellValue) ? attr.defaultValue() : cellValue + attr.suffix()); + } + else if (ColumnType.NUMERIC == attr.cellType()) + { + if (StringUtils.isNotNull(value)) + { + cell.setCellValue(StringUtils.contains(Convert.toStr(value), ".") ? Convert.toDouble(value) : Convert.toInt(value)); + } + } + else if (ColumnType.IMAGE == attr.cellType()) + { + ClientAnchor anchor = new XSSFClientAnchor(0, 0, 0, 0, (short) cell.getColumnIndex(), cell.getRow().getRowNum(), (short) (cell.getColumnIndex() + 1), cell.getRow().getRowNum() + 1); + String imagePath = Convert.toStr(value); + if (StringUtils.isNotEmpty(imagePath)) + { + byte[] data = ImageUtils.getImage(imagePath); + getDrawingPatriarch(cell.getSheet()).createPicture(anchor, + cell.getSheet().getWorkbook().addPicture(data, getImageType(data))); + } + } + } + + /** + * 获取画布 + */ + public static Drawing getDrawingPatriarch(Sheet sheet) + { + if (sheet.getDrawingPatriarch() == null) + { + sheet.createDrawingPatriarch(); + } + return sheet.getDrawingPatriarch(); + } + + /** + * 获取图片类型,设置图片插入类型 + */ + public int getImageType(byte[] value) + { + String type = FileTypeUtils.getFileExtendName(value); + if ("JPG".equalsIgnoreCase(type)) + { + return Workbook.PICTURE_TYPE_JPEG; + } + else if ("PNG".equalsIgnoreCase(type)) + { + return Workbook.PICTURE_TYPE_PNG; + } + return Workbook.PICTURE_TYPE_JPEG; + } + + /** + * 创建表格样式 + */ + public void setDataValidation(Excel attr, Row row, int column) + { + if (attr.name().indexOf("注:") >= 0) + { + sheet.setColumnWidth(column, 6000); + } + else + { + // 设置列宽 + sheet.setColumnWidth(column, (int) ((attr.width() + 0.72) * 256)); + } + if (StringUtils.isNotEmpty(attr.prompt()) || attr.combo().length > 0) + { + if (attr.combo().length > 15 || StringUtils.join(attr.combo()).length() > 255) + { + // 如果下拉数大于15或字符串长度大于255,则使用一个新sheet存储,避免生成的模板下拉值获取不到 + setXSSFValidationWithHidden(sheet, attr.combo(), attr.prompt(), 1, 100, column, column); + } + else + { + // 提示信息或只能选择不能输入的列内容. + setPromptOrValidation(sheet, attr.combo(), attr.prompt(), 1, 100, column, column); + } + } + } + + /** + * 添加单元格 + */ + public Cell addCell(Excel attr, Row row, T vo, Field field, int column) + { + Cell cell = null; + try + { + // 设置行高 + row.setHeight(maxHeight); + // 根据Excel中设置情况决定是否导出,有些情况需要保持为空,希望用户填写这一列. + if (attr.isExport()) + { + // 创建cell + cell = row.createCell(column); + if (isSubListValue(vo) && getListCellValue(vo).size() > 1 && attr.needMerge()) + { + CellRangeAddress cellAddress = new CellRangeAddress(subMergedFirstRowNum, subMergedLastRowNum, column, column); + sheet.addMergedRegion(cellAddress); + } + cell.setCellStyle(styles.get(StringUtils.format("data_{}_{}_{}", attr.align(), attr.color(), attr.backgroundColor()))); + + // 用于读取对象中的属性 + Object value = getTargetValue(vo, field, attr); + String dateFormat = attr.dateFormat(); + String readConverterExp = attr.readConverterExp(); + String separator = attr.separator(); + String dictType = attr.dictType(); + if (StringUtils.isNotEmpty(dateFormat) && StringUtils.isNotNull(value)) + { + cell.setCellValue(parseDateToStr(dateFormat, value)); + } + else if (StringUtils.isNotEmpty(readConverterExp) && StringUtils.isNotNull(value)) + { + cell.setCellValue(convertByExp(Convert.toStr(value), readConverterExp, separator)); + } + else if (StringUtils.isNotEmpty(dictType) && StringUtils.isNotNull(value)) + { + cell.setCellValue(convertDictByExp(Convert.toStr(value), dictType, separator)); + } + else if (value instanceof BigDecimal && -1 != attr.scale()) + { + cell.setCellValue((((BigDecimal) value).setScale(attr.scale(), attr.roundingMode())).doubleValue()); + } + else if (!attr.handler().equals(ExcelHandlerAdapter.class)) + { + cell.setCellValue(dataFormatHandlerAdapter(value, attr)); + } + else + { + // 设置列类型 + setCellVo(value, attr, cell); + } + addStatisticsData(column, Convert.toStr(value), attr); + } + } + catch (Exception e) + { + log.error("导出Excel失败{}", e); + } + return cell; + } + + /** + * 设置 POI XSSFSheet 单元格提示或选择框 + * + * @param sheet 表单 + * @param textlist 下拉框显示的内容 + * @param promptContent 提示内容 + * @param firstRow 开始行 + * @param endRow 结束行 + * @param firstCol 开始列 + * @param endCol 结束列 + */ + public void setPromptOrValidation(Sheet sheet, String[] textlist, String promptContent, int firstRow, int endRow, + int firstCol, int endCol) + { + DataValidationHelper helper = sheet.getDataValidationHelper(); + DataValidationConstraint constraint = textlist.length > 0 ? helper.createExplicitListConstraint(textlist) : helper.createCustomConstraint("DD1"); + CellRangeAddressList regions = new CellRangeAddressList(firstRow, endRow, firstCol, endCol); + DataValidation dataValidation = helper.createValidation(constraint, regions); + if (StringUtils.isNotEmpty(promptContent)) + { + // 如果设置了提示信息则鼠标放上去提示 + dataValidation.createPromptBox("", promptContent); + dataValidation.setShowPromptBox(true); + } + // 处理Excel兼容性问题 + if (dataValidation instanceof XSSFDataValidation) + { + dataValidation.setSuppressDropDownArrow(true); + dataValidation.setShowErrorBox(true); + } + else + { + dataValidation.setSuppressDropDownArrow(false); + } + sheet.addValidationData(dataValidation); + } + + /** + * 设置某些列的值只能输入预制的数据,显示下拉框(兼容超出一定数量的下拉框). + * + * @param sheet 要设置的sheet. + * @param textlist 下拉框显示的内容 + * @param promptContent 提示内容 + * @param firstRow 开始行 + * @param endRow 结束行 + * @param firstCol 开始列 + * @param endCol 结束列 + */ + public void setXSSFValidationWithHidden(Sheet sheet, String[] textlist, String promptContent, int firstRow, int endRow, int firstCol, int endCol) + { + String hideSheetName = "combo_" + firstCol + "_" + endCol; + Sheet hideSheet = wb.createSheet(hideSheetName); // 用于存储 下拉菜单数据 + for (int i = 0; i < textlist.length; i++) + { + hideSheet.createRow(i).createCell(0).setCellValue(textlist[i]); + } + // 创建名称,可被其他单元格引用 + Name name = wb.createName(); + name.setNameName(hideSheetName + "_data"); + name.setRefersToFormula(hideSheetName + "!$A$1:$A$" + textlist.length); + DataValidationHelper helper = sheet.getDataValidationHelper(); + // 加载下拉列表内容 + DataValidationConstraint constraint = helper.createFormulaListConstraint(hideSheetName + "_data"); + // 设置数据有效性加载在哪个单元格上,四个参数分别是:起始行、终止行、起始列、终止列 + CellRangeAddressList regions = new CellRangeAddressList(firstRow, endRow, firstCol, endCol); + // 数据有效性对象 + DataValidation dataValidation = helper.createValidation(constraint, regions); + if (StringUtils.isNotEmpty(promptContent)) + { + // 如果设置了提示信息则鼠标放上去提示 + dataValidation.createPromptBox("", promptContent); + dataValidation.setShowPromptBox(true); + } + // 处理Excel兼容性问题 + if (dataValidation instanceof XSSFDataValidation) + { + dataValidation.setSuppressDropDownArrow(true); + dataValidation.setShowErrorBox(true); + } + else + { + dataValidation.setSuppressDropDownArrow(false); + } + + sheet.addValidationData(dataValidation); + // 设置hiddenSheet隐藏 + wb.setSheetHidden(wb.getSheetIndex(hideSheet), true); + } + + /** + * 解析导出值 0=男,1=女,2=未知 + * + * @param propertyValue 参数值 + * @param converterExp 翻译注解 + * @param separator 分隔符 + * @return 解析后值 + */ + public static String convertByExp(String propertyValue, String converterExp, String separator) + { + StringBuilder propertyString = new StringBuilder(); + String[] convertSource = converterExp.split(","); + for (String item : convertSource) + { + String[] itemArray = item.split("="); + if (StringUtils.containsAny(propertyValue, separator)) + { + for (String value : propertyValue.split(separator)) + { + if (itemArray[0].equals(value)) + { + propertyString.append(itemArray[1] + separator); + break; + } + } + } + else + { + if (itemArray[0].equals(propertyValue)) + { + return itemArray[1]; + } + } + } + return StringUtils.stripEnd(propertyString.toString(), separator); + } + + /** + * 反向解析值 男=0,女=1,未知=2 + * + * @param propertyValue 参数值 + * @param converterExp 翻译注解 + * @param separator 分隔符 + * @return 解析后值 + */ + public static String reverseByExp(String propertyValue, String converterExp, String separator) + { + StringBuilder propertyString = new StringBuilder(); + String[] convertSource = converterExp.split(","); + for (String item : convertSource) + { + String[] itemArray = item.split("="); + if (StringUtils.containsAny(propertyValue, separator)) + { + for (String value : propertyValue.split(separator)) + { + if (itemArray[1].equals(value)) + { + propertyString.append(itemArray[0] + separator); + break; + } + } + } + else + { + if (itemArray[1].equals(propertyValue)) + { + return itemArray[0]; + } + } + } + return StringUtils.stripEnd(propertyString.toString(), separator); + } + + /** + * 解析字典值 + * + * @param dictValue 字典值 + * @param dictType 字典类型 + * @param separator 分隔符 + * @return 字典标签 + */ + public static String convertDictByExp(String dictValue, String dictType, String separator) + { + return DictUtils.getDictLabel(dictType, dictValue, separator); + } + + /** + * 反向解析值字典值 + * + * @param dictLabel 字典标签 + * @param dictType 字典类型 + * @param separator 分隔符 + * @return 字典值 + */ + public static String reverseDictByExp(String dictLabel, String dictType, String separator) + { + return DictUtils.getDictValue(dictType, dictLabel, separator); + } + + /** + * 数据处理器 + * + * @param value 数据值 + * @param excel 数据注解 + * @return + */ + public String dataFormatHandlerAdapter(Object value, Excel excel) + { + try + { + Object instance = excel.handler().newInstance(); + Method formatMethod = excel.handler().getMethod("format", new Class[] { Object.class, String[].class }); + value = formatMethod.invoke(instance, value, excel.args()); + } + catch (Exception e) + { + log.error("不能格式化数据 " + excel.handler(), e.getMessage()); + } + return Convert.toStr(value); + } + + /** + * 合计统计信息 + */ + private void addStatisticsData(Integer index, String text, Excel entity) + { + if (entity != null && entity.isStatistics()) + { + Double temp = 0D; + if (!statistics.containsKey(index)) + { + statistics.put(index, temp); + } + try + { + temp = Double.valueOf(text); + } + catch (NumberFormatException e) + { + } + statistics.put(index, statistics.get(index) + temp); + } + } + + /** + * 创建统计行 + */ + public void addStatisticsRow() + { + if (statistics.size() > 0) + { + Row row = sheet.createRow(sheet.getLastRowNum() + 1); + Set keys = statistics.keySet(); + Cell cell = row.createCell(0); + cell.setCellStyle(styles.get("total")); + cell.setCellValue("合计"); + + for (Integer key : keys) + { + cell = row.createCell(key); + cell.setCellStyle(styles.get("total")); + cell.setCellValue(DOUBLE_FORMAT.format(statistics.get(key))); + } + statistics.clear(); + } + } + + /** + * 编码文件名 + */ + public String encodingFilename(String filename) + { + filename = UUID.randomUUID().toString() + "_" + filename + ".xlsx"; + return filename; + } + + /** + * 获取下载路径 + * + * @param filename 文件名称 + */ + public String getAbsoluteFile(String filename) + { + String downloadPath = RuoYiConfig.getDownloadPath() + filename; + File desc = new File(downloadPath); + if (!desc.getParentFile().exists()) + { + desc.getParentFile().mkdirs(); + } + return downloadPath; + } + + /** + * 获取bean中的属性值 + * + * @param vo 实体对象 + * @param field 字段 + * @param excel 注解 + * @return 最终的属性值 + * @throws Exception + */ + private Object getTargetValue(T vo, Field field, Excel excel) throws Exception + { + Object o = field.get(vo); + if (StringUtils.isNotEmpty(excel.targetAttr())) + { + String target = excel.targetAttr(); + if (target.contains(".")) + { + String[] targets = target.split("[.]"); + for (String name : targets) + { + o = getValue(o, name); + } + } + else + { + o = getValue(o, target); + } + } + return o; + } + + /** + * 以类的属性的get方法方法形式获取值 + * + * @param o + * @param name + * @return value + * @throws Exception + */ + private Object getValue(Object o, String name) throws Exception + { + if (StringUtils.isNotNull(o) && StringUtils.isNotEmpty(name)) + { + Class clazz = o.getClass(); + Field field = clazz.getDeclaredField(name); + field.setAccessible(true); + o = field.get(o); + } + return o; + } + + /** + * 得到所有定义字段 + */ + private void createExcelField() + { + this.fields = getFields(); + this.fields = this.fields.stream().sorted(Comparator.comparing(objects -> ((Excel) objects[1]).sort())).collect(Collectors.toList()); + this.maxHeight = getRowHeight(); + } + + /** + * 获取字段注解信息 + */ + public List getFields() + { + List fields = new ArrayList(); + List tempFields = new ArrayList<>(); + tempFields.addAll(Arrays.asList(clazz.getSuperclass().getDeclaredFields())); + tempFields.addAll(Arrays.asList(clazz.getDeclaredFields())); + for (Field field : tempFields) + { + if (!ArrayUtils.contains(this.excludeFields, field.getName())) + { + // 单注解 + if (field.isAnnotationPresent(Excel.class)) + { + Excel attr = field.getAnnotation(Excel.class); + if (attr != null && (attr.type() == Type.ALL || attr.type() == type)) + { + field.setAccessible(true); + fields.add(new Object[] { field, attr }); + } + if (Collection.class.isAssignableFrom(field.getType())) + { + subMethod = getSubMethod(field.getName(), clazz); + ParameterizedType pt = (ParameterizedType) field.getGenericType(); + Class subClass = (Class) pt.getActualTypeArguments()[0]; + this.subFields = FieldUtils.getFieldsListWithAnnotation(subClass, Excel.class); + } + } + + // 多注解 + if (field.isAnnotationPresent(Excels.class)) + { + Excels attrs = field.getAnnotation(Excels.class); + Excel[] excels = attrs.value(); + for (Excel attr : excels) + { + if (attr != null && (attr.type() == Type.ALL || attr.type() == type)) + { + field.setAccessible(true); + fields.add(new Object[] { field, attr }); + } + } + } + } + } + return fields; + } + + /** + * 根据注解获取最大行高 + */ + public short getRowHeight() + { + double maxHeight = 0; + for (Object[] os : this.fields) + { + Excel excel = (Excel) os[1]; + maxHeight = Math.max(maxHeight, excel.height()); + } + return (short) (maxHeight * 20); + } + + /** + * 创建一个工作簿 + */ + public void createWorkbook() + { + this.wb = new SXSSFWorkbook(500); + this.sheet = wb.createSheet(); + wb.setSheetName(0, sheetName); + this.styles = createStyles(wb); + } + + /** + * 创建工作表 + * + * @param sheetNo sheet数量 + * @param index 序号 + */ + public void createSheet(int sheetNo, int index) + { + // 设置工作表的名称. + if (sheetNo > 1 && index > 0) + { + this.sheet = wb.createSheet(); + this.createTitle(); + wb.setSheetName(index, sheetName + index); + } + } + + /** + * 获取单元格值 + * + * @param row 获取的行 + * @param column 获取单元格列号 + * @return 单元格值 + */ + public Object getCellValue(Row row, int column) + { + if (row == null) + { + return row; + } + Object val = ""; + try + { + Cell cell = row.getCell(column); + if (StringUtils.isNotNull(cell)) + { + if (cell.getCellType() == CellType.NUMERIC || cell.getCellType() == CellType.FORMULA) + { + val = cell.getNumericCellValue(); + if (DateUtil.isCellDateFormatted(cell)) + { + val = DateUtil.getJavaDate((Double) val); // POI Excel 日期格式转换 + } + else + { + if ((Double) val % 1 != 0) + { + val = new BigDecimal(val.toString()); + } + else + { + val = new DecimalFormat("0").format(val); + } + } + } + else if (cell.getCellType() == CellType.STRING) + { + val = cell.getStringCellValue(); + } + else if (cell.getCellType() == CellType.BOOLEAN) + { + val = cell.getBooleanCellValue(); + } + else if (cell.getCellType() == CellType.ERROR) + { + val = cell.getErrorCellValue(); + } + + } + } + catch (Exception e) + { + return val; + } + return val; + } + + /** + * 判断是否是空行 + * + * @param row 判断的行 + * @return + */ + private boolean isRowEmpty(Row row) + { + if (row == null) + { + return true; + } + for (int i = row.getFirstCellNum(); i < row.getLastCellNum(); i++) + { + Cell cell = row.getCell(i); + if (cell != null && cell.getCellType() != CellType.BLANK) + { + return false; + } + } + return true; + } + + /** + * 获取Excel2003图片 + * + * @param sheet 当前sheet对象 + * @param workbook 工作簿对象 + * @return Map key:图片单元格索引(1_1)String,value:图片流PictureData + */ + public static Map getSheetPictures03(HSSFSheet sheet, HSSFWorkbook workbook) + { + Map sheetIndexPicMap = new HashMap(); + List pictures = workbook.getAllPictures(); + if (!pictures.isEmpty()) + { + for (HSSFShape shape : sheet.getDrawingPatriarch().getChildren()) + { + HSSFClientAnchor anchor = (HSSFClientAnchor) shape.getAnchor(); + if (shape instanceof HSSFPicture) + { + HSSFPicture pic = (HSSFPicture) shape; + int pictureIndex = pic.getPictureIndex() - 1; + HSSFPictureData picData = pictures.get(pictureIndex); + String picIndex = String.valueOf(anchor.getRow1()) + "_" + String.valueOf(anchor.getCol1()); + sheetIndexPicMap.put(picIndex, picData); + } + } + return sheetIndexPicMap; + } + else + { + return sheetIndexPicMap; + } + } + + /** + * 获取Excel2007图片 + * + * @param sheet 当前sheet对象 + * @param workbook 工作簿对象 + * @return Map key:图片单元格索引(1_1)String,value:图片流PictureData + */ + public static Map getSheetPictures07(XSSFSheet sheet, XSSFWorkbook workbook) + { + Map sheetIndexPicMap = new HashMap(); + for (POIXMLDocumentPart dr : sheet.getRelations()) + { + if (dr instanceof XSSFDrawing) + { + XSSFDrawing drawing = (XSSFDrawing) dr; + List shapes = drawing.getShapes(); + for (XSSFShape shape : shapes) + { + if (shape instanceof XSSFPicture) + { + XSSFPicture pic = (XSSFPicture) shape; + XSSFClientAnchor anchor = pic.getPreferredSize(); + CTMarker ctMarker = anchor.getFrom(); + String picIndex = ctMarker.getRow() + "_" + ctMarker.getCol(); + sheetIndexPicMap.put(picIndex, pic.getPictureData()); + } + } + } + } + return sheetIndexPicMap; + } + + /** + * 格式化不同类型的日期对象 + * + * @param dateFormat 日期格式 + * @param val 被格式化的日期对象 + * @return 格式化后的日期字符 + */ + public String parseDateToStr(String dateFormat, Object val) + { + if (val == null) + { + return ""; + } + String str; + if (val instanceof Date) + { + str = DateUtils.parseDateToStr(dateFormat, (Date) val); + } + else if (val instanceof LocalDateTime) + { + str = DateUtils.parseDateToStr(dateFormat, DateUtils.toDate((LocalDateTime) val)); + } + else if (val instanceof LocalDate) + { + str = DateUtils.parseDateToStr(dateFormat, DateUtils.toDate((LocalDate) val)); + } + else + { + str = val.toString(); + } + return str; + } + + /** + * 是否有对象的子列表 + */ + public boolean isSubList() + { + return StringUtils.isNotNull(subFields) && subFields.size() > 0; + } + + /** + * 是否有对象的子列表,集合不为空 + */ + public boolean isSubListValue(T vo) + { + return StringUtils.isNotNull(subFields) && subFields.size() > 0 && StringUtils.isNotNull(getListCellValue(vo)) && getListCellValue(vo).size() > 0; + } + + /** + * 获取集合的值 + */ + public Collection getListCellValue(Object obj) + { + Object value; + try + { + value = subMethod.invoke(obj, new Object[] {}); + } + catch (Exception e) + { + return new ArrayList(); + } + return (Collection) value; + } + + /** + * 获取对象的子列表方法 + * + * @param name 名称 + * @param pojoClass 类对象 + * @return 子列表方法 + */ + public Method getSubMethod(String name, Class pojoClass) + { + StringBuffer getMethodName = new StringBuffer("get"); + getMethodName.append(name.substring(0, 1).toUpperCase()); + getMethodName.append(name.substring(1)); + Method method = null; + try + { + method = pojoClass.getMethod(getMethodName.toString(), new Class[] {}); + } + catch (Exception e) + { + log.error("获取对象异常{}", e.getMessage()); + } + return method; + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/reflect/ReflectUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/reflect/ReflectUtils.java new file mode 100644 index 0000000..5134e13 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/reflect/ReflectUtils.java @@ -0,0 +1,410 @@ +package com.ruoyi.common.utils.reflect; + +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.lang.reflect.Modifier; +import java.lang.reflect.ParameterizedType; +import java.lang.reflect.Type; +import java.util.Date; +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.Validate; +import org.apache.poi.ss.usermodel.DateUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import com.ruoyi.common.core.text.Convert; +import com.ruoyi.common.utils.DateUtils; + +/** + * 反射工具类. 提供调用getter/setter方法, 访问私有变量, 调用私有方法, 获取泛型类型Class, 被AOP过的真实类等工具函数. + * + * @author #author# + */ +@SuppressWarnings("rawtypes") +public class ReflectUtils +{ + private static final String SETTER_PREFIX = "set"; + + private static final String GETTER_PREFIX = "get"; + + private static final String CGLIB_CLASS_SEPARATOR = "$$"; + + private static Logger logger = LoggerFactory.getLogger(ReflectUtils.class); + + /** + * 调用Getter方法. + * 支持多级,如:对象名.对象名.方法 + */ + @SuppressWarnings("unchecked") + public static E invokeGetter(Object obj, String propertyName) + { + Object object = obj; + for (String name : StringUtils.split(propertyName, ".")) + { + String getterMethodName = GETTER_PREFIX + StringUtils.capitalize(name); + object = invokeMethod(object, getterMethodName, new Class[] {}, new Object[] {}); + } + return (E) object; + } + + /** + * 调用Setter方法, 仅匹配方法名。 + * 支持多级,如:对象名.对象名.方法 + */ + public static void invokeSetter(Object obj, String propertyName, E value) + { + Object object = obj; + String[] names = StringUtils.split(propertyName, "."); + for (int i = 0; i < names.length; i++) + { + if (i < names.length - 1) + { + String getterMethodName = GETTER_PREFIX + StringUtils.capitalize(names[i]); + object = invokeMethod(object, getterMethodName, new Class[] {}, new Object[] {}); + } + else + { + String setterMethodName = SETTER_PREFIX + StringUtils.capitalize(names[i]); + invokeMethodByName(object, setterMethodName, new Object[] { value }); + } + } + } + + /** + * 直接读取对象属性值, 无视private/protected修饰符, 不经过getter函数. + */ + @SuppressWarnings("unchecked") + public static E getFieldValue(final Object obj, final String fieldName) + { + Field field = getAccessibleField(obj, fieldName); + if (field == null) + { + logger.debug("在 [" + obj.getClass() + "] 中,没有找到 [" + fieldName + "] 字段 "); + return null; + } + E result = null; + try + { + result = (E) field.get(obj); + } + catch (IllegalAccessException e) + { + logger.error("不可能抛出的异常{}", e.getMessage()); + } + return result; + } + + /** + * 直接设置对象属性值, 无视private/protected修饰符, 不经过setter函数. + */ + public static void setFieldValue(final Object obj, final String fieldName, final E value) + { + Field field = getAccessibleField(obj, fieldName); + if (field == null) + { + // throw new IllegalArgumentException("在 [" + obj.getClass() + "] 中,没有找到 [" + fieldName + "] 字段 "); + logger.debug("在 [" + obj.getClass() + "] 中,没有找到 [" + fieldName + "] 字段 "); + return; + } + try + { + field.set(obj, value); + } + catch (IllegalAccessException e) + { + logger.error("不可能抛出的异常: {}", e.getMessage()); + } + } + + /** + * 直接调用对象方法, 无视private/protected修饰符. + * 用于一次性调用的情况,否则应使用getAccessibleMethod()函数获得Method后反复调用. + * 同时匹配方法名+参数类型, + */ + @SuppressWarnings("unchecked") + public static E invokeMethod(final Object obj, final String methodName, final Class[] parameterTypes, + final Object[] args) + { + if (obj == null || methodName == null) + { + return null; + } + Method method = getAccessibleMethod(obj, methodName, parameterTypes); + if (method == null) + { + logger.debug("在 [" + obj.getClass() + "] 中,没有找到 [" + methodName + "] 方法 "); + return null; + } + try + { + return (E) method.invoke(obj, args); + } + catch (Exception e) + { + String msg = "method: " + method + ", obj: " + obj + ", args: " + args + ""; + throw convertReflectionExceptionToUnchecked(msg, e); + } + } + + /** + * 直接调用对象方法, 无视private/protected修饰符, + * 用于一次性调用的情况,否则应使用getAccessibleMethodByName()函数获得Method后反复调用. + * 只匹配函数名,如果有多个同名函数调用第一个。 + */ + @SuppressWarnings("unchecked") + public static E invokeMethodByName(final Object obj, final String methodName, final Object[] args) + { + Method method = getAccessibleMethodByName(obj, methodName, args.length); + if (method == null) + { + // 如果为空不报错,直接返回空。 + logger.debug("在 [" + obj.getClass() + "] 中,没有找到 [" + methodName + "] 方法 "); + return null; + } + try + { + // 类型转换(将参数数据类型转换为目标方法参数类型) + Class[] cs = method.getParameterTypes(); + for (int i = 0; i < cs.length; i++) + { + if (args[i] != null && !args[i].getClass().equals(cs[i])) + { + if (cs[i] == String.class) + { + args[i] = Convert.toStr(args[i]); + if (StringUtils.endsWith((String) args[i], ".0")) + { + args[i] = StringUtils.substringBefore((String) args[i], ".0"); + } + } + else if (cs[i] == Integer.class) + { + args[i] = Convert.toInt(args[i]); + } + else if (cs[i] == Long.class) + { + args[i] = Convert.toLong(args[i]); + } + else if (cs[i] == Double.class) + { + args[i] = Convert.toDouble(args[i]); + } + else if (cs[i] == Float.class) + { + args[i] = Convert.toFloat(args[i]); + } + else if (cs[i] == Date.class) + { + if (args[i] instanceof String) + { + args[i] = DateUtils.parseDate(args[i]); + } + else + { + args[i] = DateUtil.getJavaDate((Double) args[i]); + } + } + else if (cs[i] == boolean.class || cs[i] == Boolean.class) + { + args[i] = Convert.toBool(args[i]); + } + } + } + return (E) method.invoke(obj, args); + } + catch (Exception e) + { + String msg = "method: " + method + ", obj: " + obj + ", args: " + args + ""; + throw convertReflectionExceptionToUnchecked(msg, e); + } + } + + /** + * 循环向上转型, 获取对象的DeclaredField, 并强制设置为可访问. + * 如向上转型到Object仍无法找到, 返回null. + */ + public static Field getAccessibleField(final Object obj, final String fieldName) + { + // 为空不报错。直接返回 null + if (obj == null) + { + return null; + } + Validate.notBlank(fieldName, "fieldName can't be blank"); + for (Class superClass = obj.getClass(); superClass != Object.class; superClass = superClass.getSuperclass()) + { + try + { + Field field = superClass.getDeclaredField(fieldName); + makeAccessible(field); + return field; + } + catch (NoSuchFieldException e) + { + continue; + } + } + return null; + } + + /** + * 循环向上转型, 获取对象的DeclaredMethod,并强制设置为可访问. + * 如向上转型到Object仍无法找到, 返回null. + * 匹配函数名+参数类型。 + * 用于方法需要被多次调用的情况. 先使用本函数先取得Method,然后调用Method.invoke(Object obj, Object... args) + */ + public static Method getAccessibleMethod(final Object obj, final String methodName, + final Class... parameterTypes) + { + // 为空不报错。直接返回 null + if (obj == null) + { + return null; + } + Validate.notBlank(methodName, "methodName can't be blank"); + for (Class searchType = obj.getClass(); searchType != Object.class; searchType = searchType.getSuperclass()) + { + try + { + Method method = searchType.getDeclaredMethod(methodName, parameterTypes); + makeAccessible(method); + return method; + } + catch (NoSuchMethodException e) + { + continue; + } + } + return null; + } + + /** + * 循环向上转型, 获取对象的DeclaredMethod,并强制设置为可访问. + * 如向上转型到Object仍无法找到, 返回null. + * 只匹配函数名。 + * 用于方法需要被多次调用的情况. 先使用本函数先取得Method,然后调用Method.invoke(Object obj, Object... args) + */ + public static Method getAccessibleMethodByName(final Object obj, final String methodName, int argsNum) + { + // 为空不报错。直接返回 null + if (obj == null) + { + return null; + } + Validate.notBlank(methodName, "methodName can't be blank"); + for (Class searchType = obj.getClass(); searchType != Object.class; searchType = searchType.getSuperclass()) + { + Method[] methods = searchType.getDeclaredMethods(); + for (Method method : methods) + { + if (method.getName().equals(methodName) && method.getParameterTypes().length == argsNum) + { + makeAccessible(method); + return method; + } + } + } + return null; + } + + /** + * 改变private/protected的方法为public,尽量不调用实际改动的语句,避免JDK的SecurityManager抱怨。 + */ + public static void makeAccessible(Method method) + { + if ((!Modifier.isPublic(method.getModifiers()) || !Modifier.isPublic(method.getDeclaringClass().getModifiers())) + && !method.isAccessible()) + { + method.setAccessible(true); + } + } + + /** + * 改变private/protected的成员变量为public,尽量不调用实际改动的语句,避免JDK的SecurityManager抱怨。 + */ + public static void makeAccessible(Field field) + { + if ((!Modifier.isPublic(field.getModifiers()) || !Modifier.isPublic(field.getDeclaringClass().getModifiers()) + || Modifier.isFinal(field.getModifiers())) && !field.isAccessible()) + { + field.setAccessible(true); + } + } + + /** + * 通过反射, 获得Class定义中声明的泛型参数的类型, 注意泛型必须定义在父类处 + * 如无法找到, 返回Object.class. + */ + @SuppressWarnings("unchecked") + public static Class getClassGenricType(final Class clazz) + { + return getClassGenricType(clazz, 0); + } + + /** + * 通过反射, 获得Class定义中声明的父类的泛型参数的类型. + * 如无法找到, 返回Object.class. + */ + public static Class getClassGenricType(final Class clazz, final int index) + { + Type genType = clazz.getGenericSuperclass(); + + if (!(genType instanceof ParameterizedType)) + { + logger.debug(clazz.getSimpleName() + "'s superclass not ParameterizedType"); + return Object.class; + } + + Type[] params = ((ParameterizedType) genType).getActualTypeArguments(); + + if (index >= params.length || index < 0) + { + logger.debug("Index: " + index + ", Size of " + clazz.getSimpleName() + "'s Parameterized Type: " + + params.length); + return Object.class; + } + if (!(params[index] instanceof Class)) + { + logger.debug(clazz.getSimpleName() + " not set the actual class on superclass generic parameter"); + return Object.class; + } + + return (Class) params[index]; + } + + public static Class getUserClass(Object instance) + { + if (instance == null) + { + throw new RuntimeException("Instance must not be null"); + } + Class clazz = instance.getClass(); + if (clazz != null && clazz.getName().contains(CGLIB_CLASS_SEPARATOR)) + { + Class superClass = clazz.getSuperclass(); + if (superClass != null && !Object.class.equals(superClass)) + { + return superClass; + } + } + return clazz; + + } + + /** + * 将反射时的checked exception转换为unchecked exception. + */ + public static RuntimeException convertReflectionExceptionToUnchecked(String msg, Exception e) + { + if (e instanceof IllegalAccessException || e instanceof IllegalArgumentException + || e instanceof NoSuchMethodException) + { + return new IllegalArgumentException(msg, e); + } + else if (e instanceof InvocationTargetException) + { + return new RuntimeException(msg, ((InvocationTargetException) e).getTargetException()); + } + return new RuntimeException(msg, e); + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/sign/Base64.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/sign/Base64.java new file mode 100644 index 0000000..06e069d --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/sign/Base64.java @@ -0,0 +1,291 @@ +package com.ruoyi.common.utils.sign; + +/** + * Base64工具类 + * + * @author #author# + */ +public final class Base64 +{ + static private final int BASELENGTH = 128; + static private final int LOOKUPLENGTH = 64; + static private final int TWENTYFOURBITGROUP = 24; + static private final int EIGHTBIT = 8; + static private final int SIXTEENBIT = 16; + static private final int FOURBYTE = 4; + static private final int SIGN = -128; + static private final char PAD = '='; + static final private byte[] base64Alphabet = new byte[BASELENGTH]; + static final private char[] lookUpBase64Alphabet = new char[LOOKUPLENGTH]; + + static + { + for (int i = 0; i < BASELENGTH; ++i) + { + base64Alphabet[i] = -1; + } + for (int i = 'Z'; i >= 'A'; i--) + { + base64Alphabet[i] = (byte) (i - 'A'); + } + for (int i = 'z'; i >= 'a'; i--) + { + base64Alphabet[i] = (byte) (i - 'a' + 26); + } + + for (int i = '9'; i >= '0'; i--) + { + base64Alphabet[i] = (byte) (i - '0' + 52); + } + + base64Alphabet['+'] = 62; + base64Alphabet['/'] = 63; + + for (int i = 0; i <= 25; i++) + { + lookUpBase64Alphabet[i] = (char) ('A' + i); + } + + for (int i = 26, j = 0; i <= 51; i++, j++) + { + lookUpBase64Alphabet[i] = (char) ('a' + j); + } + + for (int i = 52, j = 0; i <= 61; i++, j++) + { + lookUpBase64Alphabet[i] = (char) ('0' + j); + } + lookUpBase64Alphabet[62] = (char) '+'; + lookUpBase64Alphabet[63] = (char) '/'; + } + + private static boolean isWhiteSpace(char octect) + { + return (octect == 0x20 || octect == 0xd || octect == 0xa || octect == 0x9); + } + + private static boolean isPad(char octect) + { + return (octect == PAD); + } + + private static boolean isData(char octect) + { + return (octect < BASELENGTH && base64Alphabet[octect] != -1); + } + + /** + * Encodes hex octects into Base64 + * + * @param binaryData Array containing binaryData + * @return Encoded Base64 array + */ + public static String encode(byte[] binaryData) + { + if (binaryData == null) + { + return null; + } + + int lengthDataBits = binaryData.length * EIGHTBIT; + if (lengthDataBits == 0) + { + return ""; + } + + int fewerThan24bits = lengthDataBits % TWENTYFOURBITGROUP; + int numberTriplets = lengthDataBits / TWENTYFOURBITGROUP; + int numberQuartet = fewerThan24bits != 0 ? numberTriplets + 1 : numberTriplets; + char encodedData[] = null; + + encodedData = new char[numberQuartet * 4]; + + byte k = 0, l = 0, b1 = 0, b2 = 0, b3 = 0; + + int encodedIndex = 0; + int dataIndex = 0; + + for (int i = 0; i < numberTriplets; i++) + { + b1 = binaryData[dataIndex++]; + b2 = binaryData[dataIndex++]; + b3 = binaryData[dataIndex++]; + + l = (byte) (b2 & 0x0f); + k = (byte) (b1 & 0x03); + + byte val1 = ((b1 & SIGN) == 0) ? (byte) (b1 >> 2) : (byte) ((b1) >> 2 ^ 0xc0); + byte val2 = ((b2 & SIGN) == 0) ? (byte) (b2 >> 4) : (byte) ((b2) >> 4 ^ 0xf0); + byte val3 = ((b3 & SIGN) == 0) ? (byte) (b3 >> 6) : (byte) ((b3) >> 6 ^ 0xfc); + + encodedData[encodedIndex++] = lookUpBase64Alphabet[val1]; + encodedData[encodedIndex++] = lookUpBase64Alphabet[val2 | (k << 4)]; + encodedData[encodedIndex++] = lookUpBase64Alphabet[(l << 2) | val3]; + encodedData[encodedIndex++] = lookUpBase64Alphabet[b3 & 0x3f]; + } + + // form integral number of 6-bit groups + if (fewerThan24bits == EIGHTBIT) + { + b1 = binaryData[dataIndex]; + k = (byte) (b1 & 0x03); + byte val1 = ((b1 & SIGN) == 0) ? (byte) (b1 >> 2) : (byte) ((b1) >> 2 ^ 0xc0); + encodedData[encodedIndex++] = lookUpBase64Alphabet[val1]; + encodedData[encodedIndex++] = lookUpBase64Alphabet[k << 4]; + encodedData[encodedIndex++] = PAD; + encodedData[encodedIndex++] = PAD; + } + else if (fewerThan24bits == SIXTEENBIT) + { + b1 = binaryData[dataIndex]; + b2 = binaryData[dataIndex + 1]; + l = (byte) (b2 & 0x0f); + k = (byte) (b1 & 0x03); + + byte val1 = ((b1 & SIGN) == 0) ? (byte) (b1 >> 2) : (byte) ((b1) >> 2 ^ 0xc0); + byte val2 = ((b2 & SIGN) == 0) ? (byte) (b2 >> 4) : (byte) ((b2) >> 4 ^ 0xf0); + + encodedData[encodedIndex++] = lookUpBase64Alphabet[val1]; + encodedData[encodedIndex++] = lookUpBase64Alphabet[val2 | (k << 4)]; + encodedData[encodedIndex++] = lookUpBase64Alphabet[l << 2]; + encodedData[encodedIndex++] = PAD; + } + return new String(encodedData); + } + + /** + * Decodes Base64 data into octects + * + * @param encoded string containing Base64 data + * @return Array containind decoded data. + */ + public static byte[] decode(String encoded) + { + if (encoded == null) + { + return null; + } + + char[] base64Data = encoded.toCharArray(); + // remove white spaces + int len = removeWhiteSpace(base64Data); + + if (len % FOURBYTE != 0) + { + return null;// should be divisible by four + } + + int numberQuadruple = (len / FOURBYTE); + + if (numberQuadruple == 0) + { + return new byte[0]; + } + + byte decodedData[] = null; + byte b1 = 0, b2 = 0, b3 = 0, b4 = 0; + char d1 = 0, d2 = 0, d3 = 0, d4 = 0; + + int i = 0; + int encodedIndex = 0; + int dataIndex = 0; + decodedData = new byte[(numberQuadruple) * 3]; + + for (; i < numberQuadruple - 1; i++) + { + + if (!isData((d1 = base64Data[dataIndex++])) || !isData((d2 = base64Data[dataIndex++])) + || !isData((d3 = base64Data[dataIndex++])) || !isData((d4 = base64Data[dataIndex++]))) + { + return null; + } // if found "no data" just return null + + b1 = base64Alphabet[d1]; + b2 = base64Alphabet[d2]; + b3 = base64Alphabet[d3]; + b4 = base64Alphabet[d4]; + + decodedData[encodedIndex++] = (byte) (b1 << 2 | b2 >> 4); + decodedData[encodedIndex++] = (byte) (((b2 & 0xf) << 4) | ((b3 >> 2) & 0xf)); + decodedData[encodedIndex++] = (byte) (b3 << 6 | b4); + } + + if (!isData((d1 = base64Data[dataIndex++])) || !isData((d2 = base64Data[dataIndex++]))) + { + return null;// if found "no data" just return null + } + + b1 = base64Alphabet[d1]; + b2 = base64Alphabet[d2]; + + d3 = base64Data[dataIndex++]; + d4 = base64Data[dataIndex++]; + if (!isData((d3)) || !isData((d4))) + {// Check if they are PAD characters + if (isPad(d3) && isPad(d4)) + { + if ((b2 & 0xf) != 0)// last 4 bits should be zero + { + return null; + } + byte[] tmp = new byte[i * 3 + 1]; + System.arraycopy(decodedData, 0, tmp, 0, i * 3); + tmp[encodedIndex] = (byte) (b1 << 2 | b2 >> 4); + return tmp; + } + else if (!isPad(d3) && isPad(d4)) + { + b3 = base64Alphabet[d3]; + if ((b3 & 0x3) != 0)// last 2 bits should be zero + { + return null; + } + byte[] tmp = new byte[i * 3 + 2]; + System.arraycopy(decodedData, 0, tmp, 0, i * 3); + tmp[encodedIndex++] = (byte) (b1 << 2 | b2 >> 4); + tmp[encodedIndex] = (byte) (((b2 & 0xf) << 4) | ((b3 >> 2) & 0xf)); + return tmp; + } + else + { + return null; + } + } + else + { // No PAD e.g 3cQl + b3 = base64Alphabet[d3]; + b4 = base64Alphabet[d4]; + decodedData[encodedIndex++] = (byte) (b1 << 2 | b2 >> 4); + decodedData[encodedIndex++] = (byte) (((b2 & 0xf) << 4) | ((b3 >> 2) & 0xf)); + decodedData[encodedIndex++] = (byte) (b3 << 6 | b4); + + } + return decodedData; + } + + /** + * remove WhiteSpace from MIME containing encoded Base64 data. + * + * @param data the byte array of base64 data (with WS) + * @return the new length + */ + private static int removeWhiteSpace(char[] data) + { + if (data == null) + { + return 0; + } + + // count characters that's not whitespace + int newSize = 0; + int len = data.length; + for (int i = 0; i < len; i++) + { + if (!isWhiteSpace(data[i])) + { + data[newSize++] = data[i]; + } + } + return newSize; + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/sign/Md5Utils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/sign/Md5Utils.java new file mode 100644 index 0000000..6df6afa --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/sign/Md5Utils.java @@ -0,0 +1,67 @@ +package com.ruoyi.common.utils.sign; + +import java.nio.charset.StandardCharsets; +import java.security.MessageDigest; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Md5加密方法 + * + * @author #author# + */ +public class Md5Utils +{ + private static final Logger log = LoggerFactory.getLogger(Md5Utils.class); + + private static byte[] md5(String s) + { + MessageDigest algorithm; + try + { + algorithm = MessageDigest.getInstance("MD5"); + algorithm.reset(); + algorithm.update(s.getBytes("UTF-8")); + byte[] messageDigest = algorithm.digest(); + return messageDigest; + } + catch (Exception e) + { + log.error("MD5 Error...", e); + } + return null; + } + + private static final String toHex(byte hash[]) + { + if (hash == null) + { + return null; + } + StringBuffer buf = new StringBuffer(hash.length * 2); + int i; + + for (i = 0; i < hash.length; i++) + { + if ((hash[i] & 0xff) < 0x10) + { + buf.append("0"); + } + buf.append(Long.toString(hash[i] & 0xff, 16)); + } + return buf.toString(); + } + + public static String hash(String s) + { + try + { + return new String(toHex(md5(s)).getBytes(StandardCharsets.UTF_8), StandardCharsets.UTF_8); + } + catch (Exception e) + { + log.error("not supported charset...{}", e); + return s; + } + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/spring/SpringUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/spring/SpringUtils.java new file mode 100644 index 0000000..20ece8d --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/spring/SpringUtils.java @@ -0,0 +1,158 @@ +package com.ruoyi.common.utils.spring; + +import org.springframework.aop.framework.AopContext; +import org.springframework.beans.BeansException; +import org.springframework.beans.factory.NoSuchBeanDefinitionException; +import org.springframework.beans.factory.config.BeanFactoryPostProcessor; +import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; +import org.springframework.context.ApplicationContext; +import org.springframework.context.ApplicationContextAware; +import org.springframework.stereotype.Component; +import com.ruoyi.common.utils.StringUtils; + +/** + * spring工具类 方便在非spring管理环境中获取bean + * + * @author #author# + */ +@Component +public final class SpringUtils implements BeanFactoryPostProcessor, ApplicationContextAware +{ + /** Spring应用上下文环境 */ + private static ConfigurableListableBeanFactory beanFactory; + + private static ApplicationContext applicationContext; + + @Override + public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException + { + SpringUtils.beanFactory = beanFactory; + } + + @Override + public void setApplicationContext(ApplicationContext applicationContext) throws BeansException + { + SpringUtils.applicationContext = applicationContext; + } + + /** + * 获取对象 + * + * @param name + * @return Object 一个以所给名字注册的bean的实例 + * @throws org.springframework.beans.BeansException + * + */ + @SuppressWarnings("unchecked") + public static T getBean(String name) throws BeansException + { + return (T) beanFactory.getBean(name); + } + + /** + * 获取类型为requiredType的对象 + * + * @param clz + * @return + * @throws org.springframework.beans.BeansException + * + */ + public static T getBean(Class clz) throws BeansException + { + T result = (T) beanFactory.getBean(clz); + return result; + } + + /** + * 如果BeanFactory包含一个与所给名称匹配的bean定义,则返回true + * + * @param name + * @return boolean + */ + public static boolean containsBean(String name) + { + return beanFactory.containsBean(name); + } + + /** + * 判断以给定名字注册的bean定义是一个singleton还是一个prototype。 如果与给定名字相应的bean定义没有被找到,将会抛出一个异常(NoSuchBeanDefinitionException) + * + * @param name + * @return boolean + * @throws org.springframework.beans.factory.NoSuchBeanDefinitionException + * + */ + public static boolean isSingleton(String name) throws NoSuchBeanDefinitionException + { + return beanFactory.isSingleton(name); + } + + /** + * @param name + * @return Class 注册对象的类型 + * @throws org.springframework.beans.factory.NoSuchBeanDefinitionException + * + */ + public static Class getType(String name) throws NoSuchBeanDefinitionException + { + return beanFactory.getType(name); + } + + /** + * 如果给定的bean名字在bean定义中有别名,则返回这些别名 + * + * @param name + * @return + * @throws org.springframework.beans.factory.NoSuchBeanDefinitionException + * + */ + public static String[] getAliases(String name) throws NoSuchBeanDefinitionException + { + return beanFactory.getAliases(name); + } + + /** + * 获取aop代理对象 + * + * @param invoker + * @return + */ + @SuppressWarnings("unchecked") + public static T getAopProxy(T invoker) + { + return (T) AopContext.currentProxy(); + } + + /** + * 获取当前的环境配置,无配置返回null + * + * @return 当前的环境配置 + */ + public static String[] getActiveProfiles() + { + return applicationContext.getEnvironment().getActiveProfiles(); + } + + /** + * 获取当前的环境配置,当有多个环境配置时,只获取第一个 + * + * @return 当前的环境配置 + */ + public static String getActiveProfile() + { + final String[] activeProfiles = getActiveProfiles(); + return StringUtils.isNotEmpty(activeProfiles) ? activeProfiles[0] : null; + } + + /** + * 获取配置文件中的值 + * + * @param key 配置文件的key + * @return 当前的配置文件的值 + * + */ + public static String getRequiredProperty(String key) + { + return applicationContext.getEnvironment().getRequiredProperty(key); + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/sql/SqlUtil.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/sql/SqlUtil.java new file mode 100644 index 0000000..b0dc0e8 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/sql/SqlUtil.java @@ -0,0 +1,61 @@ +package com.ruoyi.common.utils.sql; + +import com.ruoyi.common.exception.UtilException; +import com.ruoyi.common.utils.StringUtils; + +/** + * sql操作工具类 + * + * @author #author# + */ +public class SqlUtil +{ + /** + * 定义常用的 sql关键字 + */ + public static String SQL_REGEX = "and |extractvalue|updatexml|exec |insert |select |delete |update |drop |count |chr |mid |master |truncate |char |declare |or |+|user()"; + + /** + * 仅支持字母、数字、下划线、空格、逗号、小数点(支持多个字段排序) + */ + public static String SQL_PATTERN = "[a-zA-Z0-9_\\ \\,\\.]+"; + + /** + * 检查字符,防止注入绕过 + */ + public static String escapeOrderBySql(String value) + { + if (StringUtils.isNotEmpty(value) && !isValidOrderBySql(value)) + { + throw new UtilException("参数不符合规范,不能进行查询"); + } + return value; + } + + /** + * 验证 order by 语法是否符合规范 + */ + public static boolean isValidOrderBySql(String value) + { + return value.matches(SQL_PATTERN); + } + + /** + * SQL关键字检查 + */ + public static void filterKeyword(String value) + { + if (StringUtils.isEmpty(value)) + { + return; + } + String[] sqlKeywords = StringUtils.split(SQL_REGEX, "\\|"); + for (String sqlKeyword : sqlKeywords) + { + if (StringUtils.indexOfIgnoreCase(value, sqlKeyword) > -1) + { + throw new UtilException("参数存在SQL注入风险"); + } + } + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/uuid/IdUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/uuid/IdUtils.java new file mode 100644 index 0000000..9f42275 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/uuid/IdUtils.java @@ -0,0 +1,49 @@ +package com.ruoyi.common.utils.uuid; + +/** + * ID生成器工具类 + * + * @author #author# + */ +public class IdUtils +{ + /** + * 获取随机UUID + * + * @return 随机UUID + */ + public static String randomUUID() + { + return UUID.randomUUID().toString(); + } + + /** + * 简化的UUID,去掉了横线 + * + * @return 简化的UUID,去掉了横线 + */ + public static String simpleUUID() + { + return UUID.randomUUID().toString(true); + } + + /** + * 获取随机UUID,使用性能更好的ThreadLocalRandom生成UUID + * + * @return 随机UUID + */ + public static String fastUUID() + { + return UUID.fastUUID().toString(); + } + + /** + * 简化的UUID,去掉了横线,使用性能更好的ThreadLocalRandom生成UUID + * + * @return 简化的UUID,去掉了横线 + */ + public static String fastSimpleUUID() + { + return UUID.fastUUID().toString(true); + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/uuid/Seq.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/uuid/Seq.java new file mode 100644 index 0000000..b8c5170 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/uuid/Seq.java @@ -0,0 +1,86 @@ +package com.ruoyi.common.utils.uuid; + +import java.util.concurrent.atomic.AtomicInteger; +import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.common.utils.StringUtils; + +/** + * @author #author# 序列生成类 + */ +public class Seq +{ + // 通用序列类型 + public static final String commSeqType = "COMMON"; + + // 上传序列类型 + public static final String uploadSeqType = "UPLOAD"; + + // 通用接口序列数 + private static AtomicInteger commSeq = new AtomicInteger(1); + + // 上传接口序列数 + private static AtomicInteger uploadSeq = new AtomicInteger(1); + + // 机器标识 + private static String machineCode = "A"; + + /** + * 获取通用序列号 + * + * @return 序列值 + */ + public static String getId() + { + return getId(commSeqType); + } + + /** + * 默认16位序列号 yyMMddHHmmss + 一位机器标识 + 3长度循环递增字符串 + * + * @return 序列值 + */ + public static String getId(String type) + { + AtomicInteger atomicInt = commSeq; + if (uploadSeqType.equals(type)) + { + atomicInt = uploadSeq; + } + return getId(atomicInt, 3); + } + + /** + * 通用接口序列号 yyMMddHHmmss + 一位机器标识 + length长度循环递增字符串 + * + * @param atomicInt 序列数 + * @param length 数值长度 + * @return 序列值 + */ + public static String getId(AtomicInteger atomicInt, int length) + { + String result = DateUtils.dateTimeNow(); + result += machineCode; + result += getSeq(atomicInt, length); + return result; + } + + /** + * 序列循环递增字符串[1, 10 的 (length)幂次方), 用0左补齐length位数 + * + * @return 序列值 + */ + private synchronized static String getSeq(AtomicInteger atomicInt, int length) + { + // 先取值再+1 + int value = atomicInt.getAndIncrement(); + + // 如果更新后值>=10 的 (length)幂次方则重置为1 + int maxSeq = (int) Math.pow(10, length); + if (atomicInt.get() >= maxSeq) + { + atomicInt.set(1); + } + // 转字符串,用0左补齐 + return StringUtils.padl(value, length); + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/uuid/UUID.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/uuid/UUID.java new file mode 100644 index 0000000..c9cebec --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/uuid/UUID.java @@ -0,0 +1,484 @@ +package com.ruoyi.common.utils.uuid; + +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.security.SecureRandom; +import java.util.Random; +import java.util.concurrent.ThreadLocalRandom; +import com.ruoyi.common.exception.UtilException; + +/** + * 提供通用唯一识别码(universally unique identifier)(UUID)实现 + * + * @author #author# + */ +public final class UUID implements java.io.Serializable, Comparable +{ + private static final long serialVersionUID = -1185015143654744140L; + + /** + * SecureRandom 的单例 + * + */ + private static class Holder + { + static final SecureRandom numberGenerator = getSecureRandom(); + } + + /** 此UUID的最高64有效位 */ + private final long mostSigBits; + + /** 此UUID的最低64有效位 */ + private final long leastSigBits; + + /** + * 私有构造 + * + * @param data 数据 + */ + private UUID(byte[] data) + { + long msb = 0; + long lsb = 0; + assert data.length == 16 : "data must be 16 bytes in length"; + for (int i = 0; i < 8; i++) + { + msb = (msb << 8) | (data[i] & 0xff); + } + for (int i = 8; i < 16; i++) + { + lsb = (lsb << 8) | (data[i] & 0xff); + } + this.mostSigBits = msb; + this.leastSigBits = lsb; + } + + /** + * 使用指定的数据构造新的 UUID。 + * + * @param mostSigBits 用于 {@code UUID} 的最高有效 64 位 + * @param leastSigBits 用于 {@code UUID} 的最低有效 64 位 + */ + public UUID(long mostSigBits, long leastSigBits) + { + this.mostSigBits = mostSigBits; + this.leastSigBits = leastSigBits; + } + + /** + * 获取类型 4(伪随机生成的)UUID 的静态工厂。 使用加密的本地线程伪随机数生成器生成该 UUID。 + * + * @return 随机生成的 {@code UUID} + */ + public static UUID fastUUID() + { + return randomUUID(false); + } + + /** + * 获取类型 4(伪随机生成的)UUID 的静态工厂。 使用加密的强伪随机数生成器生成该 UUID。 + * + * @return 随机生成的 {@code UUID} + */ + public static UUID randomUUID() + { + return randomUUID(true); + } + + /** + * 获取类型 4(伪随机生成的)UUID 的静态工厂。 使用加密的强伪随机数生成器生成该 UUID。 + * + * @param isSecure 是否使用{@link SecureRandom}如果是可以获得更安全的随机码,否则可以得到更好的性能 + * @return 随机生成的 {@code UUID} + */ + public static UUID randomUUID(boolean isSecure) + { + final Random ng = isSecure ? Holder.numberGenerator : getRandom(); + + byte[] randomBytes = new byte[16]; + ng.nextBytes(randomBytes); + randomBytes[6] &= 0x0f; /* clear version */ + randomBytes[6] |= 0x40; /* set to version 4 */ + randomBytes[8] &= 0x3f; /* clear variant */ + randomBytes[8] |= 0x80; /* set to IETF variant */ + return new UUID(randomBytes); + } + + /** + * 根据指定的字节数组获取类型 3(基于名称的)UUID 的静态工厂。 + * + * @param name 用于构造 UUID 的字节数组。 + * + * @return 根据指定数组生成的 {@code UUID} + */ + public static UUID nameUUIDFromBytes(byte[] name) + { + MessageDigest md; + try + { + md = MessageDigest.getInstance("MD5"); + } + catch (NoSuchAlgorithmException nsae) + { + throw new InternalError("MD5 not supported"); + } + byte[] md5Bytes = md.digest(name); + md5Bytes[6] &= 0x0f; /* clear version */ + md5Bytes[6] |= 0x30; /* set to version 3 */ + md5Bytes[8] &= 0x3f; /* clear variant */ + md5Bytes[8] |= 0x80; /* set to IETF variant */ + return new UUID(md5Bytes); + } + + /** + * 根据 {@link #toString()} 方法中描述的字符串标准表示形式创建{@code UUID}。 + * + * @param name 指定 {@code UUID} 字符串 + * @return 具有指定值的 {@code UUID} + * @throws IllegalArgumentException 如果 name 与 {@link #toString} 中描述的字符串表示形式不符抛出此异常 + * + */ + public static UUID fromString(String name) + { + String[] components = name.split("-"); + if (components.length != 5) + { + throw new IllegalArgumentException("Invalid UUID string: " + name); + } + for (int i = 0; i < 5; i++) + { + components[i] = "0x" + components[i]; + } + + long mostSigBits = Long.decode(components[0]).longValue(); + mostSigBits <<= 16; + mostSigBits |= Long.decode(components[1]).longValue(); + mostSigBits <<= 16; + mostSigBits |= Long.decode(components[2]).longValue(); + + long leastSigBits = Long.decode(components[3]).longValue(); + leastSigBits <<= 48; + leastSigBits |= Long.decode(components[4]).longValue(); + + return new UUID(mostSigBits, leastSigBits); + } + + /** + * 返回此 UUID 的 128 位值中的最低有效 64 位。 + * + * @return 此 UUID 的 128 位值中的最低有效 64 位。 + */ + public long getLeastSignificantBits() + { + return leastSigBits; + } + + /** + * 返回此 UUID 的 128 位值中的最高有效 64 位。 + * + * @return 此 UUID 的 128 位值中最高有效 64 位。 + */ + public long getMostSignificantBits() + { + return mostSigBits; + } + + /** + * 与此 {@code UUID} 相关联的版本号. 版本号描述此 {@code UUID} 是如何生成的。 + *

+ * 版本号具有以下含意: + *

    + *
  • 1 基于时间的 UUID + *
  • 2 DCE 安全 UUID + *
  • 3 基于名称的 UUID + *
  • 4 随机生成的 UUID + *
+ * + * @return 此 {@code UUID} 的版本号 + */ + public int version() + { + // Version is bits masked by 0x000000000000F000 in MS long + return (int) ((mostSigBits >> 12) & 0x0f); + } + + /** + * 与此 {@code UUID} 相关联的变体号。变体号描述 {@code UUID} 的布局。 + *

+ * 变体号具有以下含意: + *

    + *
  • 0 为 NCS 向后兼容保留 + *
  • 2 IETF RFC 4122(Leach-Salz), 用于此类 + *
  • 6 保留,微软向后兼容 + *
  • 7 保留供以后定义使用 + *
+ * + * @return 此 {@code UUID} 相关联的变体号 + */ + public int variant() + { + // This field is composed of a varying number of bits. + // 0 - - Reserved for NCS backward compatibility + // 1 0 - The IETF aka Leach-Salz variant (used by this class) + // 1 1 0 Reserved, Microsoft backward compatibility + // 1 1 1 Reserved for future definition. + return (int) ((leastSigBits >>> (64 - (leastSigBits >>> 62))) & (leastSigBits >> 63)); + } + + /** + * 与此 UUID 相关联的时间戳值。 + * + *

+ * 60 位的时间戳值根据此 {@code UUID} 的 time_low、time_mid 和 time_hi 字段构造。
+ * 所得到的时间戳以 100 毫微秒为单位,从 UTC(通用协调时间) 1582 年 10 月 15 日零时开始。 + * + *

+ * 时间戳值仅在在基于时间的 UUID(其 version 类型为 1)中才有意义。
+ * 如果此 {@code UUID} 不是基于时间的 UUID,则此方法抛出 UnsupportedOperationException。 + * + * @throws UnsupportedOperationException 如果此 {@code UUID} 不是 version 为 1 的 UUID。 + */ + public long timestamp() throws UnsupportedOperationException + { + checkTimeBase(); + return (mostSigBits & 0x0FFFL) << 48// + | ((mostSigBits >> 16) & 0x0FFFFL) << 32// + | mostSigBits >>> 32; + } + + /** + * 与此 UUID 相关联的时钟序列值。 + * + *

+ * 14 位的时钟序列值根据此 UUID 的 clock_seq 字段构造。clock_seq 字段用于保证在基于时间的 UUID 中的时间唯一性。 + *

+ * {@code clockSequence} 值仅在基于时间的 UUID(其 version 类型为 1)中才有意义。 如果此 UUID 不是基于时间的 UUID,则此方法抛出 + * UnsupportedOperationException。 + * + * @return 此 {@code UUID} 的时钟序列 + * + * @throws UnsupportedOperationException 如果此 UUID 的 version 不为 1 + */ + public int clockSequence() throws UnsupportedOperationException + { + checkTimeBase(); + return (int) ((leastSigBits & 0x3FFF000000000000L) >>> 48); + } + + /** + * 与此 UUID 相关的节点值。 + * + *

+ * 48 位的节点值根据此 UUID 的 node 字段构造。此字段旨在用于保存机器的 IEEE 802 地址,该地址用于生成此 UUID 以保证空间唯一性。 + *

+ * 节点值仅在基于时间的 UUID(其 version 类型为 1)中才有意义。
+ * 如果此 UUID 不是基于时间的 UUID,则此方法抛出 UnsupportedOperationException。 + * + * @return 此 {@code UUID} 的节点值 + * + * @throws UnsupportedOperationException 如果此 UUID 的 version 不为 1 + */ + public long node() throws UnsupportedOperationException + { + checkTimeBase(); + return leastSigBits & 0x0000FFFFFFFFFFFFL; + } + + /** + * 返回此{@code UUID} 的字符串表现形式。 + * + *

+ * UUID 的字符串表示形式由此 BNF 描述: + * + *

+     * {@code
+     * UUID                   = ----
+     * time_low               = 4*
+     * time_mid               = 2*
+     * time_high_and_version  = 2*
+     * variant_and_sequence   = 2*
+     * node                   = 6*
+     * hexOctet               = 
+     * hexDigit               = [0-9a-fA-F]
+     * }
+     * 
+ * + * + * + * @return 此{@code UUID} 的字符串表现形式 + * @see #toString(boolean) + */ + @Override + public String toString() + { + return toString(false); + } + + /** + * 返回此{@code UUID} 的字符串表现形式。 + * + *

+ * UUID 的字符串表示形式由此 BNF 描述: + * + *

+     * {@code
+     * UUID                   = ----
+     * time_low               = 4*
+     * time_mid               = 2*
+     * time_high_and_version  = 2*
+     * variant_and_sequence   = 2*
+     * node                   = 6*
+     * hexOctet               = 
+     * hexDigit               = [0-9a-fA-F]
+     * }
+     * 
+ * + * + * + * @param isSimple 是否简单模式,简单模式为不带'-'的UUID字符串 + * @return 此{@code UUID} 的字符串表现形式 + */ + public String toString(boolean isSimple) + { + final StringBuilder builder = new StringBuilder(isSimple ? 32 : 36); + // time_low + builder.append(digits(mostSigBits >> 32, 8)); + if (!isSimple) + { + builder.append('-'); + } + // time_mid + builder.append(digits(mostSigBits >> 16, 4)); + if (!isSimple) + { + builder.append('-'); + } + // time_high_and_version + builder.append(digits(mostSigBits, 4)); + if (!isSimple) + { + builder.append('-'); + } + // variant_and_sequence + builder.append(digits(leastSigBits >> 48, 4)); + if (!isSimple) + { + builder.append('-'); + } + // node + builder.append(digits(leastSigBits, 12)); + + return builder.toString(); + } + + /** + * 返回此 UUID 的哈希码。 + * + * @return UUID 的哈希码值。 + */ + @Override + public int hashCode() + { + long hilo = mostSigBits ^ leastSigBits; + return ((int) (hilo >> 32)) ^ (int) hilo; + } + + /** + * 将此对象与指定对象比较。 + *

+ * 当且仅当参数不为 {@code null}、而是一个 UUID 对象、具有与此 UUID 相同的 varriant、包含相同的值(每一位均相同)时,结果才为 {@code true}。 + * + * @param obj 要与之比较的对象 + * + * @return 如果对象相同,则返回 {@code true};否则返回 {@code false} + */ + @Override + public boolean equals(Object obj) + { + if ((null == obj) || (obj.getClass() != UUID.class)) + { + return false; + } + UUID id = (UUID) obj; + return (mostSigBits == id.mostSigBits && leastSigBits == id.leastSigBits); + } + + // Comparison Operations + + /** + * 将此 UUID 与指定的 UUID 比较。 + * + *

+ * 如果两个 UUID 不同,且第一个 UUID 的最高有效字段大于第二个 UUID 的对应字段,则第一个 UUID 大于第二个 UUID。 + * + * @param val 与此 UUID 比较的 UUID + * + * @return 在此 UUID 小于、等于或大于 val 时,分别返回 -1、0 或 1。 + * + */ + @Override + public int compareTo(UUID val) + { + // The ordering is intentionally set up so that the UUIDs + // can simply be numerically compared as two numbers + return (this.mostSigBits < val.mostSigBits ? -1 : // + (this.mostSigBits > val.mostSigBits ? 1 : // + (this.leastSigBits < val.leastSigBits ? -1 : // + (this.leastSigBits > val.leastSigBits ? 1 : // + 0)))); + } + + // ------------------------------------------------------------------------------------------------------------------- + // Private method start + /** + * 返回指定数字对应的hex值 + * + * @param val 值 + * @param digits 位 + * @return 值 + */ + private static String digits(long val, int digits) + { + long hi = 1L << (digits * 4); + return Long.toHexString(hi | (val & (hi - 1))).substring(1); + } + + /** + * 检查是否为time-based版本UUID + */ + private void checkTimeBase() + { + if (version() != 1) + { + throw new UnsupportedOperationException("Not a time-based UUID"); + } + } + + /** + * 获取{@link SecureRandom},类提供加密的强随机数生成器 (RNG) + * + * @return {@link SecureRandom} + */ + public static SecureRandom getSecureRandom() + { + try + { + return SecureRandom.getInstance("SHA1PRNG"); + } + catch (NoSuchAlgorithmException e) + { + throw new UtilException(e); + } + } + + /** + * 获取随机数生成器对象
+ * ThreadLocalRandom是JDK 7之后提供并发产生随机数,能够解决多个线程发生的竞争争夺。 + * + * @return {@link ThreadLocalRandom} + */ + public static ThreadLocalRandom getRandom() + { + return ThreadLocalRandom.current(); + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/xss/Xss.java b/ruoyi-common/src/main/java/com/ruoyi/common/xss/Xss.java new file mode 100644 index 0000000..5b814b8 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/xss/Xss.java @@ -0,0 +1,27 @@ +package com.ruoyi.common.xss; + +import javax.validation.Constraint; +import javax.validation.Payload; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * 自定义xss校验注解 + * + * @author #author# + */ +@Retention(RetentionPolicy.RUNTIME) +@Target(value = { ElementType.METHOD, ElementType.FIELD, ElementType.CONSTRUCTOR, ElementType.PARAMETER }) +@Constraint(validatedBy = { XssValidator.class }) +public @interface Xss +{ + String message() + + default "不允许任何脚本运行"; + + Class[] groups() default {}; + + Class[] payload() default {}; +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/xss/XssValidator.java b/ruoyi-common/src/main/java/com/ruoyi/common/xss/XssValidator.java new file mode 100644 index 0000000..f93413e --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/xss/XssValidator.java @@ -0,0 +1,34 @@ +package com.ruoyi.common.xss; + +import com.ruoyi.common.utils.StringUtils; +import javax.validation.ConstraintValidator; +import javax.validation.ConstraintValidatorContext; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * 自定义xss校验注解实现 + * + * @author #author# + */ +public class XssValidator implements ConstraintValidator +{ + private static final String HTML_PATTERN = "<(\\S*?)[^>]*>.*?|<.*? />"; + + @Override + public boolean isValid(String value, ConstraintValidatorContext constraintValidatorContext) + { + if (StringUtils.isBlank(value)) + { + return true; + } + return !containsHtml(value); + } + + public static boolean containsHtml(String value) + { + Pattern pattern = Pattern.compile(HTML_PATTERN); + Matcher matcher = pattern.matcher(value); + return matcher.matches(); + } +} \ No newline at end of file diff --git a/ruoyi-framework/pom.xml b/ruoyi-framework/pom.xml new file mode 100644 index 0000000..b290918 --- /dev/null +++ b/ruoyi-framework/pom.xml @@ -0,0 +1,70 @@ + + + + ruoyi + com.ruoyi + 3.8.5 + + 4.0.0 + + ruoyi-framework + + + framework框架核心 + + + + + + + org.springframework.boot + spring-boot-starter-web + + + + + org.springframework.boot + spring-boot-starter-aop + + + + + com.alibaba + druid-spring-boot-starter + + + + + pro.fessional + kaptcha + + + javax.servlet-api + javax.servlet + + + + + + + com.github.oshi + oshi-core + + + + + com.ruoyi + ruoyi-system + + + + + com.ruoyi + ruoyi-business + + + + + \ No newline at end of file diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/DataScopeAspect.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/DataScopeAspect.java new file mode 100644 index 0000000..eb1f783 --- /dev/null +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/DataScopeAspect.java @@ -0,0 +1,167 @@ +package com.ruoyi.framework.aspectj; + +import java.util.ArrayList; +import java.util.List; +import org.aspectj.lang.JoinPoint; +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Before; +import org.springframework.stereotype.Component; +import com.ruoyi.common.annotation.DataScope; +import com.ruoyi.common.core.domain.BaseEntity; +import com.ruoyi.common.core.domain.entity.SysRole; +import com.ruoyi.common.core.domain.entity.SysUser; +import com.ruoyi.common.core.domain.model.LoginUser; +import com.ruoyi.common.core.text.Convert; +import com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.framework.security.context.PermissionContextHolder; + +/** + * 数据过滤处理 + * + * @author #author# + */ +@Aspect +@Component +public class DataScopeAspect +{ + /** + * 全部数据权限 + */ + public static final String DATA_SCOPE_ALL = "1"; + + /** + * 自定数据权限 + */ + public static final String DATA_SCOPE_CUSTOM = "2"; + + /** + * 部门数据权限 + */ + public static final String DATA_SCOPE_DEPT = "3"; + + /** + * 部门及以下数据权限 + */ + public static final String DATA_SCOPE_DEPT_AND_CHILD = "4"; + + /** + * 仅本人数据权限 + */ + public static final String DATA_SCOPE_SELF = "5"; + + /** + * 数据权限过滤关键字 + */ + public static final String DATA_SCOPE = "dataScope"; + + @Before("@annotation(controllerDataScope)") + public void doBefore(JoinPoint point, DataScope controllerDataScope) throws Throwable + { + clearDataScope(point); + handleDataScope(point, controllerDataScope); + } + + protected void handleDataScope(final JoinPoint joinPoint, DataScope controllerDataScope) + { + // 获取当前的用户 + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (StringUtils.isNotNull(loginUser)) + { + SysUser currentUser = loginUser.getUser(); + // 如果是超级管理员,则不过滤数据 + if (StringUtils.isNotNull(currentUser) && !currentUser.isAdmin()) + { + String permission = StringUtils.defaultIfEmpty(controllerDataScope.permission(), PermissionContextHolder.getContext()); + dataScopeFilter(joinPoint, currentUser, controllerDataScope.deptAlias(), + controllerDataScope.userAlias(), permission); + } + } + } + + /** + * 数据范围过滤 + * + * @param joinPoint 切点 + * @param user 用户 + * @param deptAlias 部门别名 + * @param userAlias 用户别名 + * @param permission 权限字符 + */ + public static void dataScopeFilter(JoinPoint joinPoint, SysUser user, String deptAlias, String userAlias, String permission) + { + StringBuilder sqlString = new StringBuilder(); + List conditions = new ArrayList(); + + for (SysRole role : user.getRoles()) + { + String dataScope = role.getDataScope(); + if (!DATA_SCOPE_CUSTOM.equals(dataScope) && conditions.contains(dataScope)) + { + continue; + } + if (StringUtils.isNotEmpty(permission) && StringUtils.isNotEmpty(role.getPermissions()) + && !StringUtils.containsAny(role.getPermissions(), Convert.toStrArray(permission))) + { + continue; + } + if (DATA_SCOPE_ALL.equals(dataScope)) + { + sqlString = new StringBuilder(); + break; + } + else if (DATA_SCOPE_CUSTOM.equals(dataScope)) + { + sqlString.append(StringUtils.format( + " OR {}.dept_id IN ( SELECT dept_id FROM sys_role_dept WHERE role_id = {} ) ", deptAlias, + role.getRoleId())); + } + else if (DATA_SCOPE_DEPT.equals(dataScope)) + { + sqlString.append(StringUtils.format(" OR {}.dept_id = {} ", deptAlias, user.getDeptId())); + } + else if (DATA_SCOPE_DEPT_AND_CHILD.equals(dataScope)) + { + sqlString.append(StringUtils.format( + " OR {}.dept_id IN ( SELECT dept_id FROM sys_dept WHERE dept_id = {} or find_in_set( {} , ancestors ) )", + deptAlias, user.getDeptId(), user.getDeptId())); + } + else if (DATA_SCOPE_SELF.equals(dataScope)) + { + if (StringUtils.isNotBlank(userAlias)) + { + sqlString.append(StringUtils.format(" OR {}.user_id = {} ", userAlias, user.getUserId())); + } + else + { + // 数据权限为仅本人且没有userAlias别名不查询任何数据 + sqlString.append(StringUtils.format(" OR {}.dept_id = 0 ", deptAlias)); + } + } + conditions.add(dataScope); + } + + if (StringUtils.isNotBlank(sqlString.toString())) + { + Object params = joinPoint.getArgs()[0]; + if (StringUtils.isNotNull(params) && params instanceof BaseEntity) + { + BaseEntity baseEntity = (BaseEntity) params; + baseEntity.getParams().put(DATA_SCOPE, " AND (" + sqlString.substring(4) + ")"); + } + } + } + + /** + * 拼接权限sql前先清空params.dataScope参数防止注入 + */ + private void clearDataScope(final JoinPoint joinPoint) + { + Object params = joinPoint.getArgs()[0]; + if (StringUtils.isNotNull(params) && params instanceof BaseEntity) + { + BaseEntity baseEntity = (BaseEntity) params; + baseEntity.getParams().put(DATA_SCOPE, ""); + } + } +} diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/DataSourceAspect.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/DataSourceAspect.java new file mode 100644 index 0000000..6287327 --- /dev/null +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/DataSourceAspect.java @@ -0,0 +1,72 @@ +package com.ruoyi.framework.aspectj; + +import java.util.Objects; +import org.aspectj.lang.ProceedingJoinPoint; +import org.aspectj.lang.annotation.Around; +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Pointcut; +import org.aspectj.lang.reflect.MethodSignature; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.core.annotation.AnnotationUtils; +import org.springframework.core.annotation.Order; +import org.springframework.stereotype.Component; +import com.ruoyi.common.annotation.DataSource; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.framework.datasource.DynamicDataSourceContextHolder; + +/** + * 多数据源处理 + * + * @author #author# + */ +@Aspect +@Order(1) +@Component +public class DataSourceAspect +{ + protected Logger logger = LoggerFactory.getLogger(getClass()); + + @Pointcut("@annotation(com.ruoyi.common.annotation.DataSource)" + + "|| @within(com.ruoyi.common.annotation.DataSource)") + public void dsPointCut() + { + + } + + @Around("dsPointCut()") + public Object around(ProceedingJoinPoint point) throws Throwable + { + DataSource dataSource = getDataSource(point); + + if (StringUtils.isNotNull(dataSource)) + { + DynamicDataSourceContextHolder.setDataSourceType(dataSource.value().name()); + } + + try + { + return point.proceed(); + } + finally + { + // 销毁数据源 在执行方法之后 + DynamicDataSourceContextHolder.clearDataSourceType(); + } + } + + /** + * 获取需要切换的数据源 + */ + public DataSource getDataSource(ProceedingJoinPoint point) + { + MethodSignature signature = (MethodSignature) point.getSignature(); + DataSource dataSource = AnnotationUtils.findAnnotation(signature.getMethod(), DataSource.class); + if (Objects.nonNull(dataSource)) + { + return dataSource; + } + + return AnnotationUtils.findAnnotation(signature.getDeclaringType(), DataSource.class); + } +} diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/LogAspect.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/LogAspect.java new file mode 100644 index 0000000..db4c6d6 --- /dev/null +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/LogAspect.java @@ -0,0 +1,227 @@ +package com.ruoyi.framework.aspectj; + +import java.util.Collection; +import java.util.Map; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import org.aspectj.lang.JoinPoint; +import org.aspectj.lang.annotation.AfterReturning; +import org.aspectj.lang.annotation.AfterThrowing; +import org.aspectj.lang.annotation.Aspect; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Component; +import org.springframework.validation.BindingResult; +import org.springframework.web.multipart.MultipartFile; +import com.alibaba.fastjson2.JSON; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.domain.model.LoginUser; +import com.ruoyi.common.enums.BusinessStatus; +import com.ruoyi.common.enums.HttpMethod; +import com.ruoyi.common.filter.PropertyPreExcludeFilter; +import com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.common.utils.ip.IpUtils; +import com.ruoyi.framework.manager.AsyncManager; +import com.ruoyi.framework.manager.factory.AsyncFactory; +import com.ruoyi.system.domain.SysOperLog; + +/** + * 操作日志记录处理 + * + * @author #author# + */ +@Aspect +@Component +public class LogAspect +{ + private static final Logger log = LoggerFactory.getLogger(LogAspect.class); + + /** 排除敏感属性字段 */ + public static final String[] EXCLUDE_PROPERTIES = { "password", "oldPassword", "newPassword", "confirmPassword" }; + + /** + * 处理完请求后执行 + * + * @param joinPoint 切点 + */ + @AfterReturning(pointcut = "@annotation(controllerLog)", returning = "jsonResult") + public void doAfterReturning(JoinPoint joinPoint, Log controllerLog, Object jsonResult) + { + handleLog(joinPoint, controllerLog, null, jsonResult); + } + + /** + * 拦截异常操作 + * + * @param joinPoint 切点 + * @param e 异常 + */ + @AfterThrowing(value = "@annotation(controllerLog)", throwing = "e") + public void doAfterThrowing(JoinPoint joinPoint, Log controllerLog, Exception e) + { + handleLog(joinPoint, controllerLog, e, null); + } + + protected void handleLog(final JoinPoint joinPoint, Log controllerLog, final Exception e, Object jsonResult) + { + try + { + // 获取当前的用户 + LoginUser loginUser = SecurityUtils.getLoginUser(); + + // *========数据库日志=========*// + SysOperLog operLog = new SysOperLog(); + operLog.setStatus(BusinessStatus.SUCCESS.ordinal()); + // 请求的地址 + String ip = IpUtils.getIpAddr(ServletUtils.getRequest()); + operLog.setOperIp(ip); + operLog.setOperUrl(StringUtils.substring(ServletUtils.getRequest().getRequestURI(), 0, 255)); + if (loginUser != null) + { + operLog.setOperName(loginUser.getUsername()); + } + + if (e != null) + { + operLog.setStatus(BusinessStatus.FAIL.ordinal()); + operLog.setErrorMsg(StringUtils.substring(e.getMessage(), 0, 2000)); + } + // 设置方法名称 + String className = joinPoint.getTarget().getClass().getName(); + String methodName = joinPoint.getSignature().getName(); + operLog.setMethod(className + "." + methodName + "()"); + // 设置请求方式 + operLog.setRequestMethod(ServletUtils.getRequest().getMethod()); + // 处理设置注解上的参数 + getControllerMethodDescription(joinPoint, controllerLog, operLog, jsonResult); + // 保存数据库 + AsyncManager.me().execute(AsyncFactory.recordOper(operLog)); + } + catch (Exception exp) + { + // 记录本地异常日志 + log.error("异常信息:{}", exp.getMessage()); + exp.printStackTrace(); + } + } + + /** + * 获取注解中对方法的描述信息 用于Controller层注解 + * + * @param log 日志 + * @param operLog 操作日志 + * @throws Exception + */ + public void getControllerMethodDescription(JoinPoint joinPoint, Log log, SysOperLog operLog, Object jsonResult) throws Exception + { + // 设置action动作 + operLog.setBusinessType(log.businessType().ordinal()); + // 设置标题 + operLog.setTitle(log.title()); + // 设置操作人类别 + operLog.setOperatorType(log.operatorType().ordinal()); + // 是否需要保存request,参数和值 + if (log.isSaveRequestData()) + { + // 获取参数的信息,传入到数据库中。 + setRequestValue(joinPoint, operLog); + } + // 是否需要保存response,参数和值 + if (log.isSaveResponseData() && StringUtils.isNotNull(jsonResult)) + { + operLog.setJsonResult(StringUtils.substring(JSON.toJSONString(jsonResult), 0, 2000)); + } + } + + /** + * 获取请求的参数,放到log中 + * + * @param operLog 操作日志 + * @throws Exception 异常 + */ + private void setRequestValue(JoinPoint joinPoint, SysOperLog operLog) throws Exception + { + String requestMethod = operLog.getRequestMethod(); + if (HttpMethod.PUT.name().equals(requestMethod) || HttpMethod.POST.name().equals(requestMethod)) + { + String params = argsArrayToString(joinPoint.getArgs()); + operLog.setOperParam(StringUtils.substring(params, 0, 2000)); + } + else + { + Map paramsMap = ServletUtils.getParamMap(ServletUtils.getRequest()); + operLog.setOperParam(StringUtils.substring(JSON.toJSONString(paramsMap, excludePropertyPreFilter()), 0, 2000)); + } + } + + /** + * 参数拼装 + */ + private String argsArrayToString(Object[] paramsArray) + { + String params = ""; + if (paramsArray != null && paramsArray.length > 0) + { + for (Object o : paramsArray) + { + if (StringUtils.isNotNull(o) && !isFilterObject(o)) + { + try + { + String jsonObj = JSON.toJSONString(o, excludePropertyPreFilter()); + params += jsonObj.toString() + " "; + } + catch (Exception e) + { + } + } + } + } + return params.trim(); + } + + /** + * 忽略敏感属性 + */ + public PropertyPreExcludeFilter excludePropertyPreFilter() + { + return new PropertyPreExcludeFilter().addExcludes(EXCLUDE_PROPERTIES); + } + + /** + * 判断是否需要过滤的对象。 + * + * @param o 对象信息。 + * @return 如果是需要过滤的对象,则返回true;否则返回false。 + */ + @SuppressWarnings("rawtypes") + public boolean isFilterObject(final Object o) + { + Class clazz = o.getClass(); + if (clazz.isArray()) + { + return clazz.getComponentType().isAssignableFrom(MultipartFile.class); + } + else if (Collection.class.isAssignableFrom(clazz)) + { + Collection collection = (Collection) o; + for (Object value : collection) + { + return value instanceof MultipartFile; + } + } + else if (Map.class.isAssignableFrom(clazz)) + { + Map map = (Map) o; + for (Object value : map.entrySet()) + { + Map.Entry entry = (Map.Entry) value; + return entry.getValue() instanceof MultipartFile; + } + } + return o instanceof MultipartFile || o instanceof HttpServletRequest || o instanceof HttpServletResponse + || o instanceof BindingResult; + } +} diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/RateLimiterAspect.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/RateLimiterAspect.java new file mode 100644 index 0000000..c7c3faa --- /dev/null +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/RateLimiterAspect.java @@ -0,0 +1,90 @@ +package com.ruoyi.framework.aspectj; + +import java.lang.reflect.Method; +import java.util.Collections; +import java.util.List; +import org.aspectj.lang.JoinPoint; +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Before; +import org.aspectj.lang.reflect.MethodSignature; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.data.redis.core.script.RedisScript; +import org.springframework.stereotype.Component; +import com.ruoyi.common.annotation.RateLimiter; +import com.ruoyi.common.enums.LimitType; +import com.ruoyi.common.exception.ServiceException; +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.common.utils.ip.IpUtils; + +/** + * 限流处理 + * + * @author #author# + */ +@Aspect +@Component +public class RateLimiterAspect +{ + private static final Logger log = LoggerFactory.getLogger(RateLimiterAspect.class); + + private RedisTemplate redisTemplate; + + private RedisScript limitScript; + + @Autowired + public void setRedisTemplate1(RedisTemplate redisTemplate) + { + this.redisTemplate = redisTemplate; + } + + @Autowired + public void setLimitScript(RedisScript limitScript) + { + this.limitScript = limitScript; + } + + @Before("@annotation(rateLimiter)") + public void doBefore(JoinPoint point, RateLimiter rateLimiter) throws Throwable + { + int time = rateLimiter.time(); + int count = rateLimiter.count(); + + String combineKey = getCombineKey(rateLimiter, point); + List keys = Collections.singletonList(combineKey); + try + { + Long number = redisTemplate.execute(limitScript, keys, count, time); + if (StringUtils.isNull(number) || number.intValue() > count) + { + throw new ServiceException("访问过于频繁,请稍候再试"); + } + log.info("限制请求'{}',当前请求'{}',缓存key'{}'", count, number.intValue(), combineKey); + } + catch (ServiceException e) + { + throw e; + } + catch (Exception e) + { + throw new RuntimeException("服务器限流异常,请稍候再试"); + } + } + + public String getCombineKey(RateLimiter rateLimiter, JoinPoint point) + { + StringBuffer stringBuffer = new StringBuffer(rateLimiter.key()); + if (rateLimiter.limitType() == LimitType.IP) + { + stringBuffer.append(IpUtils.getIpAddr(ServletUtils.getRequest())).append("-"); + } + MethodSignature signature = (MethodSignature) point.getSignature(); + Method method = signature.getMethod(); + Class targetClass = method.getDeclaringClass(); + stringBuffer.append(targetClass.getName()).append("-").append(method.getName()); + return stringBuffer.toString(); + } +} diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/ApplicationConfig.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/ApplicationConfig.java new file mode 100644 index 0000000..ea5b954 --- /dev/null +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/ApplicationConfig.java @@ -0,0 +1,30 @@ +package com.ruoyi.framework.config; + +import java.util.TimeZone; +import org.mybatis.spring.annotation.MapperScan; +import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.EnableAspectJAutoProxy; + +/** + * 程序注解配置 + * + * @author #author# + */ +@Configuration +// 表示通过aop框架暴露该代理对象,AopContext能够访问 +@EnableAspectJAutoProxy(exposeProxy = true) +// 指定要扫描的Mapper类的包的路径 +@MapperScan("com.ruoyi.**.mapper") +public class ApplicationConfig +{ + /** + * 时区配置 + */ + @Bean + public Jackson2ObjectMapperBuilderCustomizer jacksonObjectMapperCustomization() + { + return jacksonObjectMapperBuilder -> jacksonObjectMapperBuilder.timeZone(TimeZone.getDefault()); + } +} diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/CaptchaConfig.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/CaptchaConfig.java new file mode 100644 index 0000000..30e7909 --- /dev/null +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/CaptchaConfig.java @@ -0,0 +1,83 @@ +package com.ruoyi.framework.config; + +import java.util.Properties; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import com.google.code.kaptcha.impl.DefaultKaptcha; +import com.google.code.kaptcha.util.Config; +import static com.google.code.kaptcha.Constants.*; + +/** + * 验证码配置 + * + * @author #author# + */ +@Configuration +public class CaptchaConfig +{ + @Bean(name = "captchaProducer") + public DefaultKaptcha getKaptchaBean() + { + DefaultKaptcha defaultKaptcha = new DefaultKaptcha(); + Properties properties = new Properties(); + // 是否有边框 默认为true 我们可以自己设置yes,no + properties.setProperty(KAPTCHA_BORDER, "yes"); + // 验证码文本字符颜色 默认为Color.BLACK + properties.setProperty(KAPTCHA_TEXTPRODUCER_FONT_COLOR, "black"); + // 验证码图片宽度 默认为200 + properties.setProperty(KAPTCHA_IMAGE_WIDTH, "160"); + // 验证码图片高度 默认为50 + properties.setProperty(KAPTCHA_IMAGE_HEIGHT, "60"); + // 验证码文本字符大小 默认为40 + properties.setProperty(KAPTCHA_TEXTPRODUCER_FONT_SIZE, "38"); + // KAPTCHA_SESSION_KEY + properties.setProperty(KAPTCHA_SESSION_CONFIG_KEY, "kaptchaCode"); + // 验证码文本字符长度 默认为5 + properties.setProperty(KAPTCHA_TEXTPRODUCER_CHAR_LENGTH, "4"); + // 验证码文本字体样式 默认为new Font("Arial", 1, fontSize), new Font("Courier", 1, fontSize) + properties.setProperty(KAPTCHA_TEXTPRODUCER_FONT_NAMES, "Arial,Courier"); + // 图片样式 水纹com.google.code.kaptcha.impl.WaterRipple 鱼眼com.google.code.kaptcha.impl.FishEyeGimpy 阴影com.google.code.kaptcha.impl.ShadowGimpy + properties.setProperty(KAPTCHA_OBSCURIFICATOR_IMPL, "com.google.code.kaptcha.impl.ShadowGimpy"); + Config config = new Config(properties); + defaultKaptcha.setConfig(config); + return defaultKaptcha; + } + + @Bean(name = "captchaProducerMath") + public DefaultKaptcha getKaptchaBeanMath() + { + DefaultKaptcha defaultKaptcha = new DefaultKaptcha(); + Properties properties = new Properties(); + // 是否有边框 默认为true 我们可以自己设置yes,no + properties.setProperty(KAPTCHA_BORDER, "yes"); + // 边框颜色 默认为Color.BLACK + properties.setProperty(KAPTCHA_BORDER_COLOR, "105,179,90"); + // 验证码文本字符颜色 默认为Color.BLACK + properties.setProperty(KAPTCHA_TEXTPRODUCER_FONT_COLOR, "blue"); + // 验证码图片宽度 默认为200 + properties.setProperty(KAPTCHA_IMAGE_WIDTH, "160"); + // 验证码图片高度 默认为50 + properties.setProperty(KAPTCHA_IMAGE_HEIGHT, "60"); + // 验证码文本字符大小 默认为40 + properties.setProperty(KAPTCHA_TEXTPRODUCER_FONT_SIZE, "35"); + // KAPTCHA_SESSION_KEY + properties.setProperty(KAPTCHA_SESSION_CONFIG_KEY, "kaptchaCodeMath"); + // 验证码文本生成器 + properties.setProperty(KAPTCHA_TEXTPRODUCER_IMPL, "com.ruoyi.framework.config.KaptchaTextCreator"); + // 验证码文本字符间距 默认为2 + properties.setProperty(KAPTCHA_TEXTPRODUCER_CHAR_SPACE, "3"); + // 验证码文本字符长度 默认为5 + properties.setProperty(KAPTCHA_TEXTPRODUCER_CHAR_LENGTH, "6"); + // 验证码文本字体样式 默认为new Font("Arial", 1, fontSize), new Font("Courier", 1, fontSize) + properties.setProperty(KAPTCHA_TEXTPRODUCER_FONT_NAMES, "Arial,Courier"); + // 验证码噪点颜色 默认为Color.BLACK + properties.setProperty(KAPTCHA_NOISE_COLOR, "white"); + // 干扰实现类 + properties.setProperty(KAPTCHA_NOISE_IMPL, "com.google.code.kaptcha.impl.NoNoise"); + // 图片样式 水纹com.google.code.kaptcha.impl.WaterRipple 鱼眼com.google.code.kaptcha.impl.FishEyeGimpy 阴影com.google.code.kaptcha.impl.ShadowGimpy + properties.setProperty(KAPTCHA_OBSCURIFICATOR_IMPL, "com.google.code.kaptcha.impl.ShadowGimpy"); + Config config = new Config(properties); + defaultKaptcha.setConfig(config); + return defaultKaptcha; + } +} diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/DruidConfig.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/DruidConfig.java new file mode 100644 index 0000000..d7c8c01 --- /dev/null +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/DruidConfig.java @@ -0,0 +1,126 @@ +package com.ruoyi.framework.config; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import javax.servlet.Filter; +import javax.servlet.FilterChain; +import javax.servlet.ServletException; +import javax.servlet.ServletRequest; +import javax.servlet.ServletResponse; +import javax.sql.DataSource; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.boot.web.servlet.FilterRegistrationBean; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Primary; +import com.alibaba.druid.pool.DruidDataSource; +import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceBuilder; +import com.alibaba.druid.spring.boot.autoconfigure.properties.DruidStatProperties; +import com.alibaba.druid.util.Utils; +import com.ruoyi.common.enums.DataSourceType; +import com.ruoyi.common.utils.spring.SpringUtils; +import com.ruoyi.framework.config.properties.DruidProperties; +import com.ruoyi.framework.datasource.DynamicDataSource; + +/** + * druid 配置多数据源 + * + * @author #author# + */ +@Configuration +public class DruidConfig +{ + @Bean + @ConfigurationProperties("spring.datasource.druid.master") + public DataSource masterDataSource(DruidProperties druidProperties) + { + DruidDataSource dataSource = DruidDataSourceBuilder.create().build(); + return druidProperties.dataSource(dataSource); + } + + @Bean + @ConfigurationProperties("spring.datasource.druid.slave") + @ConditionalOnProperty(prefix = "spring.datasource.druid.slave", name = "enabled", havingValue = "true") + public DataSource slaveDataSource(DruidProperties druidProperties) + { + DruidDataSource dataSource = DruidDataSourceBuilder.create().build(); + return druidProperties.dataSource(dataSource); + } + + @Bean(name = "dynamicDataSource") + @Primary + public DynamicDataSource dataSource(DataSource masterDataSource) + { + Map targetDataSources = new HashMap<>(); + targetDataSources.put(DataSourceType.MASTER.name(), masterDataSource); + setDataSource(targetDataSources, DataSourceType.SLAVE.name(), "slaveDataSource"); + return new DynamicDataSource(masterDataSource, targetDataSources); + } + + /** + * 设置数据源 + * + * @param targetDataSources 备选数据源集合 + * @param sourceName 数据源名称 + * @param beanName bean名称 + */ + public void setDataSource(Map targetDataSources, String sourceName, String beanName) + { + try + { + DataSource dataSource = SpringUtils.getBean(beanName); + targetDataSources.put(sourceName, dataSource); + } + catch (Exception e) + { + } + } + + /** + * 去除监控页面底部的广告 + */ + @SuppressWarnings({ "rawtypes", "unchecked" }) + @Bean + @ConditionalOnProperty(name = "spring.datasource.druid.statViewServlet.enabled", havingValue = "true") + public FilterRegistrationBean removeDruidFilterRegistrationBean(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(javax.servlet.FilterConfig filterConfig) throws ServletException + { + } + @Override + public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) + throws IOException, ServletException + { + chain.doFilter(request, response); + // 重置缓冲区,响应头不会被重置 + response.resetBuffer(); + // 获取common.js + String text = Utils.readFromResource(filePath); + // 正则替换banner, 除去底部的广告信息 + text = text.replaceAll("
", ""); + text = text.replaceAll("powered.*?shrek.wang", ""); + response.getWriter().write(text); + } + @Override + public void destroy() + { + } + }; + FilterRegistrationBean registrationBean = new FilterRegistrationBean(); + registrationBean.setFilter(filter); + registrationBean.addUrlPatterns(commonJsPattern); + return registrationBean; + } +} diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/FastJson2JsonRedisSerializer.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/FastJson2JsonRedisSerializer.java new file mode 100644 index 0000000..dd28464 --- /dev/null +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/FastJson2JsonRedisSerializer.java @@ -0,0 +1,48 @@ +package com.ruoyi.framework.config; + +import java.nio.charset.Charset; +import org.springframework.data.redis.serializer.RedisSerializer; +import org.springframework.data.redis.serializer.SerializationException; +import com.alibaba.fastjson2.JSON; +import com.alibaba.fastjson2.JSONReader; +import com.alibaba.fastjson2.JSONWriter; + +/** + * Redis使用FastJson序列化 + * + * @author #author# + */ +public class FastJson2JsonRedisSerializer implements RedisSerializer +{ + public static final Charset DEFAULT_CHARSET = Charset.forName("UTF-8"); + + private Class clazz; + + public FastJson2JsonRedisSerializer(Class clazz) + { + super(); + this.clazz = clazz; + } + + @Override + public byte[] serialize(T t) throws SerializationException + { + if (t == null) + { + return new byte[0]; + } + return JSON.toJSONString(t, JSONWriter.Feature.WriteClassName).getBytes(DEFAULT_CHARSET); + } + + @Override + public T deserialize(byte[] bytes) throws SerializationException + { + if (bytes == null || bytes.length <= 0) + { + return null; + } + String str = new String(bytes, DEFAULT_CHARSET); + + return JSON.parseObject(str, clazz, JSONReader.Feature.SupportAutoType); + } +} diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/FilterConfig.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/FilterConfig.java new file mode 100644 index 0000000..0029766 --- /dev/null +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/FilterConfig.java @@ -0,0 +1,58 @@ +package com.ruoyi.framework.config; + +import java.util.HashMap; +import java.util.Map; +import javax.servlet.DispatcherType; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.boot.web.servlet.FilterRegistrationBean; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import com.ruoyi.common.filter.RepeatableFilter; +import com.ruoyi.common.filter.XssFilter; +import com.ruoyi.common.utils.StringUtils; + +/** + * Filter配置 + * + * @author #author# + */ +@Configuration +public class FilterConfig +{ + @Value("${xss.excludes}") + private String excludes; + + @Value("${xss.urlPatterns}") + private String urlPatterns; + + @SuppressWarnings({ "rawtypes", "unchecked" }) + @Bean + @ConditionalOnProperty(value = "xss.enabled", havingValue = "true") + public FilterRegistrationBean xssFilterRegistration() + { + FilterRegistrationBean registration = new FilterRegistrationBean(); + registration.setDispatcherTypes(DispatcherType.REQUEST); + registration.setFilter(new XssFilter()); + registration.addUrlPatterns(StringUtils.split(urlPatterns, ",")); + registration.setName("xssFilter"); + registration.setOrder(FilterRegistrationBean.HIGHEST_PRECEDENCE); + Map initParameters = new HashMap(); + initParameters.put("excludes", excludes); + registration.setInitParameters(initParameters); + return registration; + } + + @SuppressWarnings({ "rawtypes", "unchecked" }) + @Bean + public FilterRegistrationBean someFilterRegistration() + { + FilterRegistrationBean registration = new FilterRegistrationBean(); + registration.setFilter(new RepeatableFilter()); + registration.addUrlPatterns("/*"); + registration.setName("repeatableFilter"); + registration.setOrder(FilterRegistrationBean.LOWEST_PRECEDENCE); + return registration; + } + +} diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/KaptchaTextCreator.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/KaptchaTextCreator.java new file mode 100644 index 0000000..39059c1 --- /dev/null +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/KaptchaTextCreator.java @@ -0,0 +1,68 @@ +package com.ruoyi.framework.config; + +import java.util.Random; +import com.google.code.kaptcha.text.impl.DefaultTextCreator; + +/** + * 验证码文本生成器 + * + * @author #author# + */ +public class KaptchaTextCreator extends DefaultTextCreator +{ + private static final String[] CNUMBERS = "0,1,2,3,4,5,6,7,8,9,10".split(","); + + @Override + public String getText() + { + Integer result = 0; + Random random = new Random(); + int x = random.nextInt(10); + int y = random.nextInt(10); + StringBuilder suChinese = new StringBuilder(); + int randomoperands = random.nextInt(3); + if (randomoperands == 0) + { + result = x * y; + suChinese.append(CNUMBERS[x]); + suChinese.append("*"); + suChinese.append(CNUMBERS[y]); + } + else if (randomoperands == 1) + { + if ((x != 0) && y % x == 0) + { + result = y / x; + suChinese.append(CNUMBERS[y]); + suChinese.append("/"); + suChinese.append(CNUMBERS[x]); + } + else + { + result = x + y; + suChinese.append(CNUMBERS[x]); + suChinese.append("+"); + suChinese.append(CNUMBERS[y]); + } + } + else + { + if (x >= y) + { + result = x - y; + suChinese.append(CNUMBERS[x]); + suChinese.append("-"); + suChinese.append(CNUMBERS[y]); + } + else + { + result = y - x; + suChinese.append(CNUMBERS[y]); + suChinese.append("-"); + suChinese.append(CNUMBERS[x]); + } + } + suChinese.append("=?@" + result); + return suChinese.toString(); + } +} \ No newline at end of file diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/MybatisPlusConfig.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/MybatisPlusConfig.java new file mode 100644 index 0000000..11123ee --- /dev/null +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/MybatisPlusConfig.java @@ -0,0 +1,62 @@ +package com.ruoyi.framework.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; + +/** + * Mybatis Plus 配置 + * + * @author 明媒婚恋服务有限公司 + */ +@EnableTransactionManagement(proxyTargetClass = true) +@Configuration +public class MybatisPlusConfig +{ + @Bean + public MybatisPlusInterceptor mybatisPlusInterceptor() + { + MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor(); + // 分页插件 + interceptor.addInnerInterceptor(paginationInnerInterceptor()); + // 乐观锁插件 + interceptor.addInnerInterceptor(optimisticLockerInnerInterceptor()); + // 阻断插件 +// interceptor.addInnerInterceptor(blockAttackInnerInterceptor()); + return interceptor; + } + + /** + * 分页插件,自动识别数据库类型 https://baomidou.com/guide/interceptor-pagination.html + */ + public PaginationInnerInterceptor paginationInnerInterceptor() + { + PaginationInnerInterceptor paginationInnerInterceptor = new PaginationInnerInterceptor(); + // 设置数据库类型为mysql + paginationInnerInterceptor.setDbType(DbType.MYSQL); + // 设置最大单页限制数量,默认 500 条,-1 不受限制 + paginationInnerInterceptor.setMaxLimit(-1L); + return paginationInnerInterceptor; + } + + /** + * 乐观锁插件 https://baomidou.com/guide/interceptor-optimistic-locker.html + */ + public OptimisticLockerInnerInterceptor optimisticLockerInnerInterceptor() + { + return new OptimisticLockerInnerInterceptor(); + } + + /** + * 如果是对全表的删除或更新操作,就会终止该操作 https://baomidou.com/guide/interceptor-block-attack.html + */ + public BlockAttackInnerInterceptor blockAttackInnerInterceptor() + { + return new BlockAttackInnerInterceptor(); + } +} diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/RedisConfig.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/RedisConfig.java new file mode 100644 index 0000000..673d2a4 --- /dev/null +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/RedisConfig.java @@ -0,0 +1,69 @@ +package com.ruoyi.framework.config; + +import org.springframework.cache.annotation.CachingConfigurerSupport; +import org.springframework.cache.annotation.EnableCaching; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.data.redis.connection.RedisConnectionFactory; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.data.redis.core.script.DefaultRedisScript; +import org.springframework.data.redis.serializer.StringRedisSerializer; + +/** + * redis配置 + * + * @author #author# + */ +@Configuration +@EnableCaching +public class RedisConfig extends CachingConfigurerSupport +{ + @Bean + @SuppressWarnings(value = { "unchecked", "rawtypes" }) + public RedisTemplate redisTemplate(RedisConnectionFactory connectionFactory) + { + RedisTemplate template = new RedisTemplate<>(); + template.setConnectionFactory(connectionFactory); + + FastJson2JsonRedisSerializer serializer = new FastJson2JsonRedisSerializer(Object.class); + + // 使用StringRedisSerializer来序列化和反序列化redis的key值 + template.setKeySerializer(new StringRedisSerializer()); + template.setValueSerializer(serializer); + + // Hash的key也采用StringRedisSerializer的序列化方式 + template.setHashKeySerializer(new StringRedisSerializer()); + template.setHashValueSerializer(serializer); + + template.afterPropertiesSet(); + return template; + } + + @Bean + public DefaultRedisScript limitScript() + { + DefaultRedisScript redisScript = new DefaultRedisScript<>(); + redisScript.setScriptText(limitScriptText()); + redisScript.setResultType(Long.class); + return redisScript; + } + + /** + * 限流脚本 + */ + private String limitScriptText() + { + return "local key = KEYS[1]\n" + + "local count = tonumber(ARGV[1])\n" + + "local time = tonumber(ARGV[2])\n" + + "local current = redis.call('get', key);\n" + + "if current and tonumber(current) > count then\n" + + " return tonumber(current);\n" + + "end\n" + + "current = redis.call('incr', key)\n" + + "if tonumber(current) == 1 then\n" + + " redis.call('expire', key, time)\n" + + "end\n" + + "return tonumber(current);"; + } +} diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/ResourcesConfig.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/ResourcesConfig.java new file mode 100644 index 0000000..ff274da --- /dev/null +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/ResourcesConfig.java @@ -0,0 +1,73 @@ +package com.ruoyi.framework.config; + +import java.util.concurrent.TimeUnit; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.http.CacheControl; +import org.springframework.web.cors.CorsConfiguration; +import org.springframework.web.cors.UrlBasedCorsConfigurationSource; +import org.springframework.web.filter.CorsFilter; +import org.springframework.web.servlet.config.annotation.InterceptorRegistry; +import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; +import com.ruoyi.common.config.RuoYiConfig; +import com.ruoyi.common.constant.Constants; +import com.ruoyi.framework.interceptor.RepeatSubmitInterceptor; + +/** + * 通用配置 + * + * @author #author# + */ +@Configuration +public class ResourcesConfig implements WebMvcConfigurer +{ + @Autowired + private RepeatSubmitInterceptor repeatSubmitInterceptor; + + @Override + public void addResourceHandlers(ResourceHandlerRegistry registry) + { + /** 本地文件上传路径 */ + registry.addResourceHandler(Constants.RESOURCE_PREFIX + "/**") + .addResourceLocations("file:" + RuoYiConfig.getProfile() + "/"); + + /** swagger配置 */ + registry.addResourceHandler("/swagger-ui/**") + .addResourceLocations("classpath:/META-INF/resources/webjars/springfox-swagger-ui/") + .setCacheControl(CacheControl.maxAge(5, TimeUnit.HOURS).cachePublic());; + } + + /** + * 自定义拦截规则 + */ + @Override + public void addInterceptors(InterceptorRegistry registry) + { + registry.addInterceptor(repeatSubmitInterceptor).addPathPatterns("/**"); + } + + /** + * 跨域配置 + */ + @Bean + public CorsFilter corsFilter() + { + CorsConfiguration config = new CorsConfiguration(); + config.setAllowCredentials(true); + // 设置访问源地址 + config.addAllowedOriginPattern("*"); + // 设置访问源请求头 + config.addAllowedHeader("*"); + // 设置访问源请求方法 + config.addAllowedMethod("*"); + // 有效期 1800秒 + config.setMaxAge(1800L); + // 添加映射路径,拦截一切请求 + UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); + source.registerCorsConfiguration("/**", config); + // 返回新的CorsFilter + return new CorsFilter(source); + } +} \ No newline at end of file diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java new file mode 100644 index 0000000..9130b74 --- /dev/null +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java @@ -0,0 +1,148 @@ +package com.ruoyi.framework.config; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Bean; +import org.springframework.http.HttpMethod; +import org.springframework.security.authentication.AuthenticationManager; +import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; +import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity; +import org.springframework.security.config.annotation.web.builders.HttpSecurity; +import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; +import org.springframework.security.config.annotation.web.configurers.ExpressionUrlAuthorizationConfigurer; +import org.springframework.security.config.http.SessionCreationPolicy; +import org.springframework.security.core.userdetails.UserDetailsService; +import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; +import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter; +import org.springframework.security.web.authentication.logout.LogoutFilter; +import org.springframework.web.filter.CorsFilter; +import com.ruoyi.framework.config.properties.PermitAllUrlProperties; +import com.ruoyi.framework.security.filter.JwtAuthenticationTokenFilter; +import com.ruoyi.framework.security.handle.AuthenticationEntryPointImpl; +import com.ruoyi.framework.security.handle.LogoutSuccessHandlerImpl; + +/** + * spring security配置 + * + * @author #author# + */ +@EnableGlobalMethodSecurity(prePostEnabled = true, securedEnabled = true) +public class SecurityConfig extends WebSecurityConfigurerAdapter +{ + /** + * 自定义用户认证逻辑 + */ + @Autowired + private UserDetailsService userDetailsService; + + /** + * 认证失败处理类 + */ + @Autowired + private AuthenticationEntryPointImpl unauthorizedHandler; + + /** + * 退出处理类 + */ + @Autowired + private LogoutSuccessHandlerImpl logoutSuccessHandler; + + /** + * token认证过滤器 + */ + @Autowired + private JwtAuthenticationTokenFilter authenticationTokenFilter; + + /** + * 跨域过滤器 + */ + @Autowired + private CorsFilter corsFilter; + + /** + * 允许匿名访问的地址 + */ + @Autowired + private PermitAllUrlProperties permitAllUrl; + + /** + * 解决 无法直接注入 AuthenticationManager + * + * @return + * @throws Exception + */ + @Bean + @Override + public AuthenticationManager authenticationManagerBean() throws Exception + { + return super.authenticationManagerBean(); + } + + /** + * anyRequest | 匹配所有请求路径 + * access | SpringEl表达式结果为true时可以访问 + * anonymous | 匿名可以访问 + * denyAll | 用户不能访问 + * fullyAuthenticated | 用户完全认证可以访问(非remember-me下自动登录) + * hasAnyAuthority | 如果有参数,参数表示权限,则其中任何一个权限可以访问 + * hasAnyRole | 如果有参数,参数表示角色,则其中任何一个角色可以访问 + * hasAuthority | 如果有参数,参数表示权限,则其权限可以访问 + * hasIpAddress | 如果有参数,参数表示IP地址,如果用户IP和参数匹配,则可以访问 + * hasRole | 如果有参数,参数表示角色,则其角色可以访问 + * permitAll | 用户可以任意访问 + * rememberMe | 允许通过remember-me登录的用户访问 + * authenticated | 用户登录后可访问 + */ + @Override + protected void configure(HttpSecurity httpSecurity) throws Exception + { + // 注解标记允许匿名访问的url + ExpressionUrlAuthorizationConfigurer.ExpressionInterceptUrlRegistry registry = httpSecurity.authorizeRequests(); + permitAllUrl.getUrls().forEach(url -> registry.antMatchers(url).permitAll()); + + httpSecurity + // CSRF禁用,因为不使用session + .csrf().disable() + // 禁用HTTP响应标头 + .headers().cacheControl().disable().and() + // 认证失败处理类 + .exceptionHandling().authenticationEntryPoint(unauthorizedHandler).and() + // 基于token,所以不需要session + .sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS).and() + // 过滤请求 + .authorizeRequests() + // 对于登录login 注册register 验证码captchaImage 允许匿名访问 + .antMatchers("/login", "/register", "/captchaImage","/system/config/configKey/sys.account.registerUser").permitAll() + // 静态资源,可匿名访问 + .antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll() + .antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll() + // 除上面外的所有请求全部需要鉴权认证 + .anyRequest().authenticated() + .and() + .headers().frameOptions().disable(); + // 添加Logout filter + httpSecurity.logout().logoutUrl("/logout").logoutSuccessHandler(logoutSuccessHandler); + // 添加JWT filter + httpSecurity.addFilterBefore(authenticationTokenFilter, UsernamePasswordAuthenticationFilter.class); + // 添加CORS filter + httpSecurity.addFilterBefore(corsFilter, JwtAuthenticationTokenFilter.class); + httpSecurity.addFilterBefore(corsFilter, LogoutFilter.class); + } + + /** + * 强散列哈希加密实现 + */ + @Bean + public BCryptPasswordEncoder bCryptPasswordEncoder() + { + return new BCryptPasswordEncoder(); + } + + /** + * 身份认证接口 + */ + @Override + protected void configure(AuthenticationManagerBuilder auth) throws Exception + { + auth.userDetailsService(userDetailsService).passwordEncoder(bCryptPasswordEncoder()); + } +} diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/ServerConfig.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/ServerConfig.java new file mode 100644 index 0000000..fedf97d --- /dev/null +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/ServerConfig.java @@ -0,0 +1,32 @@ +package com.ruoyi.framework.config; + +import javax.servlet.http.HttpServletRequest; +import org.springframework.stereotype.Component; +import com.ruoyi.common.utils.ServletUtils; + +/** + * 服务相关配置 + * + * @author #author# + */ +@Component +public class ServerConfig +{ + /** + * 获取完整的请求路径,包括:域名,端口,上下文访问路径 + * + * @return 服务地址 + */ + public String getUrl() + { + HttpServletRequest request = ServletUtils.getRequest(); + return getDomain(request); + } + + public static String getDomain(HttpServletRequest request) + { + StringBuffer url = request.getRequestURL(); + String contextPath = request.getServletContext().getContextPath(); + return url.delete(url.length() - request.getRequestURI().length(), url.length()).append(contextPath).toString(); + } +} diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/ThreadPoolConfig.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/ThreadPoolConfig.java new file mode 100644 index 0000000..7e46fa5 --- /dev/null +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/ThreadPoolConfig.java @@ -0,0 +1,63 @@ +package com.ruoyi.framework.config; + +import com.ruoyi.common.utils.Threads; +import org.apache.commons.lang3.concurrent.BasicThreadFactory; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.ScheduledThreadPoolExecutor; +import java.util.concurrent.ThreadPoolExecutor; + +/** + * 线程池配置 + * + * @author #author# + **/ +@Configuration +public class ThreadPoolConfig +{ + // 核心线程池大小 + private int corePoolSize = 50; + + // 最大可创建的线程数 + private int maxPoolSize = 200; + + // 队列最大长度 + private int queueCapacity = 1000; + + // 线程池维护线程所允许的空闲时间 + private int keepAliveSeconds = 300; + + @Bean(name = "threadPoolTaskExecutor") + public ThreadPoolTaskExecutor threadPoolTaskExecutor() + { + ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); + executor.setMaxPoolSize(maxPoolSize); + executor.setCorePoolSize(corePoolSize); + executor.setQueueCapacity(queueCapacity); + executor.setKeepAliveSeconds(keepAliveSeconds); + // 线程池对拒绝任务(无线程可用)的处理策略 + executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy()); + return executor; + } + + /** + * 执行周期性或定时任务 + */ + @Bean(name = "scheduledExecutorService") + protected ScheduledExecutorService scheduledExecutorService() + { + return new ScheduledThreadPoolExecutor(corePoolSize, + new BasicThreadFactory.Builder().namingPattern("schedule-pool-%d").daemon(true).build(), + new ThreadPoolExecutor.CallerRunsPolicy()) + { + @Override + protected void afterExecute(Runnable r, Throwable t) + { + super.afterExecute(r, t); + Threads.printException(r, t); + } + }; + } +} diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/properties/DruidProperties.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/properties/DruidProperties.java new file mode 100644 index 0000000..c007684 --- /dev/null +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/properties/DruidProperties.java @@ -0,0 +1,77 @@ +package com.ruoyi.framework.config.properties; + +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Configuration; +import com.alibaba.druid.pool.DruidDataSource; + +/** + * druid 配置属性 + * + * @author #author# + */ +@Configuration +public class DruidProperties +{ + @Value("${spring.datasource.druid.initialSize}") + private int initialSize; + + @Value("${spring.datasource.druid.minIdle}") + private int minIdle; + + @Value("${spring.datasource.druid.maxActive}") + private int maxActive; + + @Value("${spring.datasource.druid.maxWait}") + private int maxWait; + + @Value("${spring.datasource.druid.timeBetweenEvictionRunsMillis}") + private int timeBetweenEvictionRunsMillis; + + @Value("${spring.datasource.druid.minEvictableIdleTimeMillis}") + private int minEvictableIdleTimeMillis; + + @Value("${spring.datasource.druid.maxEvictableIdleTimeMillis}") + private int maxEvictableIdleTimeMillis; + + @Value("${spring.datasource.druid.validationQuery}") + private String validationQuery; + + @Value("${spring.datasource.druid.testWhileIdle}") + private boolean testWhileIdle; + + @Value("${spring.datasource.druid.testOnBorrow}") + private boolean testOnBorrow; + + @Value("${spring.datasource.druid.testOnReturn}") + private boolean testOnReturn; + + public DruidDataSource dataSource(DruidDataSource datasource) + { + /** 配置初始化大小、最小、最大 */ + datasource.setInitialSize(initialSize); + datasource.setMaxActive(maxActive); + datasource.setMinIdle(minIdle); + + /** 配置获取连接等待超时的时间 */ + datasource.setMaxWait(maxWait); + + /** 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 */ + datasource.setTimeBetweenEvictionRunsMillis(timeBetweenEvictionRunsMillis); + + /** 配置一个连接在池中最小、最大生存的时间,单位是毫秒 */ + datasource.setMinEvictableIdleTimeMillis(minEvictableIdleTimeMillis); + datasource.setMaxEvictableIdleTimeMillis(maxEvictableIdleTimeMillis); + + /** + * 用来检测连接是否有效的sql,要求是一个查询语句,常用select 'x'。如果validationQuery为null,testOnBorrow、testOnReturn、testWhileIdle都不会起作用。 + */ + datasource.setValidationQuery(validationQuery); + /** 建议配置为true,不影响性能,并且保证安全性。申请连接的时候检测,如果空闲时间大于timeBetweenEvictionRunsMillis,执行validationQuery检测连接是否有效。 */ + datasource.setTestWhileIdle(testWhileIdle); + /** 申请连接时执行validationQuery检测连接是否有效,做了这个配置会降低性能。 */ + datasource.setTestOnBorrow(testOnBorrow); + /** 归还连接时执行validationQuery检测连接是否有效,做了这个配置会降低性能。 */ + datasource.setTestOnReturn(testOnReturn); + return datasource; + } +} diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/properties/PermitAllUrlProperties.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/properties/PermitAllUrlProperties.java new file mode 100644 index 0000000..36acaed --- /dev/null +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/properties/PermitAllUrlProperties.java @@ -0,0 +1,72 @@ +package com.ruoyi.framework.config.properties; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.regex.Pattern; +import org.apache.commons.lang3.RegExUtils; +import org.springframework.beans.BeansException; +import org.springframework.beans.factory.InitializingBean; +import org.springframework.context.ApplicationContext; +import org.springframework.context.ApplicationContextAware; +import org.springframework.context.annotation.Configuration; +import org.springframework.core.annotation.AnnotationUtils; +import org.springframework.web.method.HandlerMethod; +import org.springframework.web.servlet.mvc.method.RequestMappingInfo; +import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping; +import com.ruoyi.common.annotation.Anonymous; + +/** + * 设置Anonymous注解允许匿名访问的url + * + * @author #author# + */ +@Configuration +public class PermitAllUrlProperties implements InitializingBean, ApplicationContextAware +{ + private static final Pattern PATTERN = Pattern.compile("\\{(.*?)\\}"); + + private ApplicationContext applicationContext; + + private List urls = new ArrayList<>(); + + public String ASTERISK = "*"; + + @Override + public void afterPropertiesSet() + { + RequestMappingHandlerMapping mapping = applicationContext.getBean(RequestMappingHandlerMapping.class); + Map map = mapping.getHandlerMethods(); + + map.keySet().forEach(info -> { + HandlerMethod handlerMethod = map.get(info); + + // 获取方法上边的注解 替代path variable 为 * + Anonymous method = AnnotationUtils.findAnnotation(handlerMethod.getMethod(), Anonymous.class); + Optional.ofNullable(method).ifPresent(anonymous -> info.getPatternsCondition().getPatterns() + .forEach(url -> urls.add(RegExUtils.replaceAll(url, PATTERN, ASTERISK)))); + + // 获取类上边的注解, 替代path variable 为 * + Anonymous controller = AnnotationUtils.findAnnotation(handlerMethod.getBeanType(), Anonymous.class); + Optional.ofNullable(controller).ifPresent(anonymous -> info.getPatternsCondition().getPatterns() + .forEach(url -> urls.add(RegExUtils.replaceAll(url, PATTERN, ASTERISK)))); + }); + } + + @Override + public void setApplicationContext(ApplicationContext context) throws BeansException + { + this.applicationContext = context; + } + + public List getUrls() + { + return urls; + } + + public void setUrls(List urls) + { + this.urls = urls; + } +} diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/datasource/DynamicDataSource.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/datasource/DynamicDataSource.java new file mode 100644 index 0000000..443f727 --- /dev/null +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/datasource/DynamicDataSource.java @@ -0,0 +1,26 @@ +package com.ruoyi.framework.datasource; + +import java.util.Map; +import javax.sql.DataSource; +import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource; + +/** + * 动态数据源 + * + * @author #author# + */ +public class DynamicDataSource extends AbstractRoutingDataSource +{ + public DynamicDataSource(DataSource defaultTargetDataSource, Map targetDataSources) + { + super.setDefaultTargetDataSource(defaultTargetDataSource); + super.setTargetDataSources(targetDataSources); + super.afterPropertiesSet(); + } + + @Override + protected Object determineCurrentLookupKey() + { + return DynamicDataSourceContextHolder.getDataSourceType(); + } +} \ No newline at end of file diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/datasource/DynamicDataSourceContextHolder.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/datasource/DynamicDataSourceContextHolder.java new file mode 100644 index 0000000..ce4ab53 --- /dev/null +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/datasource/DynamicDataSourceContextHolder.java @@ -0,0 +1,45 @@ +package com.ruoyi.framework.datasource; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * 数据源切换处理 + * + * @author #author# + */ +public class DynamicDataSourceContextHolder +{ + public static final Logger log = LoggerFactory.getLogger(DynamicDataSourceContextHolder.class); + + /** + * 使用ThreadLocal维护变量,ThreadLocal为每个使用该变量的线程提供独立的变量副本, + * 所以每一个线程都可以独立地改变自己的副本,而不会影响其它线程所对应的副本。 + */ + private static final ThreadLocal CONTEXT_HOLDER = new ThreadLocal<>(); + + /** + * 设置数据源的变量 + */ + public static void setDataSourceType(String dsType) + { + log.info("切换到{}数据源", dsType); + CONTEXT_HOLDER.set(dsType); + } + + /** + * 获得数据源的变量 + */ + public static String getDataSourceType() + { + return CONTEXT_HOLDER.get(); + } + + /** + * 清空数据源变量 + */ + public static void clearDataSourceType() + { + CONTEXT_HOLDER.remove(); + } +} diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/interceptor/RepeatSubmitInterceptor.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/interceptor/RepeatSubmitInterceptor.java new file mode 100644 index 0000000..316110a --- /dev/null +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/interceptor/RepeatSubmitInterceptor.java @@ -0,0 +1,55 @@ +package com.ruoyi.framework.interceptor; + +import java.lang.reflect.Method; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import org.springframework.stereotype.Component; +import org.springframework.web.method.HandlerMethod; +import org.springframework.web.servlet.HandlerInterceptor; +import com.alibaba.fastjson2.JSON; +import com.ruoyi.common.annotation.RepeatSubmit; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.utils.ServletUtils; + +/** + * 防止重复提交拦截器 + * + * @author #author# + */ +@Component +public abstract class RepeatSubmitInterceptor implements HandlerInterceptor +{ + @Override + public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception + { + if (handler instanceof HandlerMethod) + { + HandlerMethod handlerMethod = (HandlerMethod) handler; + Method method = handlerMethod.getMethod(); + RepeatSubmit annotation = method.getAnnotation(RepeatSubmit.class); + if (annotation != null) + { + if (this.isRepeatSubmit(request, annotation)) + { + AjaxResult ajaxResult = AjaxResult.error(annotation.message()); + ServletUtils.renderString(response, JSON.toJSONString(ajaxResult)); + return false; + } + } + return true; + } + else + { + return true; + } + } + + /** + * 验证是否重复提交由子类实现具体的防重复提交的规则 + * + * @param request + * @return + * @throws Exception + */ + public abstract boolean isRepeatSubmit(HttpServletRequest request, RepeatSubmit annotation); +} diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/interceptor/impl/SameUrlDataInterceptor.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/interceptor/impl/SameUrlDataInterceptor.java new file mode 100644 index 0000000..b735978 --- /dev/null +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/interceptor/impl/SameUrlDataInterceptor.java @@ -0,0 +1,110 @@ +package com.ruoyi.framework.interceptor.impl; + +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.servlet.http.HttpServletRequest; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Component; +import com.alibaba.fastjson2.JSON; +import com.ruoyi.common.annotation.RepeatSubmit; +import com.ruoyi.common.constant.CacheConstants; +import com.ruoyi.common.core.redis.RedisCache; +import com.ruoyi.common.filter.RepeatedlyRequestWrapper; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.common.utils.http.HttpHelper; +import com.ruoyi.framework.interceptor.RepeatSubmitInterceptor; + +/** + * 判断请求url和数据是否和上一次相同, + * 如果和上次相同,则是重复提交表单。 有效时间为10秒内。 + * + * @author #author# + */ +@Component +public class SameUrlDataInterceptor extends RepeatSubmitInterceptor +{ + public final String REPEAT_PARAMS = "repeatParams"; + + public final String REPEAT_TIME = "repeatTime"; + + // 令牌自定义标识 + @Value("${token.header}") + private String header; + + @Autowired + private RedisCache redisCache; + + @SuppressWarnings("unchecked") + @Override + public boolean isRepeatSubmit(HttpServletRequest request, RepeatSubmit annotation) + { + String nowParams = ""; + if (request instanceof RepeatedlyRequestWrapper) + { + RepeatedlyRequestWrapper repeatedlyRequest = (RepeatedlyRequestWrapper) request; + nowParams = HttpHelper.getBodyString(repeatedlyRequest); + } + + // body参数为空,获取Parameter的数据 + if (StringUtils.isEmpty(nowParams)) + { + nowParams = JSON.toJSONString(request.getParameterMap()); + } + Map nowDataMap = new HashMap(); + nowDataMap.put(REPEAT_PARAMS, nowParams); + nowDataMap.put(REPEAT_TIME, System.currentTimeMillis()); + + // 请求地址(作为存放cache的key值) + String url = request.getRequestURI(); + + // 唯一值(没有消息头则使用请求地址) + String submitKey = StringUtils.trimToEmpty(request.getHeader(header)); + + // 唯一标识(指定key + url + 消息头) + String cacheRepeatKey = CacheConstants.REPEAT_SUBMIT_KEY + url + submitKey; + + Object sessionObj = redisCache.getCacheObject(cacheRepeatKey); + if (sessionObj != null) + { + Map sessionMap = (Map) sessionObj; + if (sessionMap.containsKey(url)) + { + Map preDataMap = (Map) sessionMap.get(url); + if (compareParams(nowDataMap, preDataMap) && compareTime(nowDataMap, preDataMap, annotation.interval())) + { + return true; + } + } + } + Map cacheMap = new HashMap(); + cacheMap.put(url, nowDataMap); + redisCache.setCacheObject(cacheRepeatKey, cacheMap, annotation.interval(), TimeUnit.MILLISECONDS); + return false; + } + + /** + * 判断参数是否相同 + */ + private boolean compareParams(Map nowMap, Map preMap) + { + String nowParams = (String) nowMap.get(REPEAT_PARAMS); + String preParams = (String) preMap.get(REPEAT_PARAMS); + return nowParams.equals(preParams); + } + + /** + * 判断两次间隔时间 + */ + private boolean compareTime(Map nowMap, Map preMap, int interval) + { + long time1 = (Long) nowMap.get(REPEAT_TIME); + long time2 = (Long) preMap.get(REPEAT_TIME); + if ((time1 - time2) < interval) + { + return true; + } + return false; + } +} diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/manager/AsyncManager.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/manager/AsyncManager.java new file mode 100644 index 0000000..cebe371 --- /dev/null +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/manager/AsyncManager.java @@ -0,0 +1,55 @@ +package com.ruoyi.framework.manager; + +import java.util.TimerTask; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import com.ruoyi.common.utils.Threads; +import com.ruoyi.common.utils.spring.SpringUtils; + +/** + * 异步任务管理器 + * + * @author #author# + */ +public class AsyncManager +{ + /** + * 操作延迟10毫秒 + */ + private final int OPERATE_DELAY_TIME = 10; + + /** + * 异步操作任务调度线程池 + */ + private ScheduledExecutorService executor = SpringUtils.getBean("scheduledExecutorService"); + + /** + * 单例模式 + */ + private AsyncManager(){} + + private static AsyncManager me = new AsyncManager(); + + public static AsyncManager me() + { + return me; + } + + /** + * 执行任务 + * + * @param task 任务 + */ + public void execute(TimerTask task) + { + executor.schedule(task, OPERATE_DELAY_TIME, TimeUnit.MILLISECONDS); + } + + /** + * 停止任务线程池 + */ + public void shutdown() + { + Threads.shutdownAndAwaitTermination(executor); + } +} diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/manager/ShutdownManager.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/manager/ShutdownManager.java new file mode 100644 index 0000000..97555a1 --- /dev/null +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/manager/ShutdownManager.java @@ -0,0 +1,39 @@ +package com.ruoyi.framework.manager; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Component; +import javax.annotation.PreDestroy; + +/** + * 确保应用退出时能关闭后台线程 + * + * @author #author# + */ +@Component +public class ShutdownManager +{ + private static final Logger logger = LoggerFactory.getLogger("sys-user"); + + @PreDestroy + public void destroy() + { + shutdownAsyncManager(); + } + + /** + * 停止异步执行任务 + */ + private void shutdownAsyncManager() + { + try + { + logger.info("====关闭后台任务任务线程池===="); + AsyncManager.me().shutdown(); + } + catch (Exception e) + { + logger.error(e.getMessage(), e); + } + } +} diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/manager/factory/AsyncFactory.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/manager/factory/AsyncFactory.java new file mode 100644 index 0000000..ecf3a60 --- /dev/null +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/manager/factory/AsyncFactory.java @@ -0,0 +1,102 @@ +package com.ruoyi.framework.manager.factory; + +import java.util.TimerTask; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import com.ruoyi.common.constant.Constants; +import com.ruoyi.common.utils.LogUtils; +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.common.utils.ip.AddressUtils; +import com.ruoyi.common.utils.ip.IpUtils; +import com.ruoyi.common.utils.spring.SpringUtils; +import com.ruoyi.system.domain.SysLogininfor; +import com.ruoyi.system.domain.SysOperLog; +import com.ruoyi.system.service.ISysLogininforService; +import com.ruoyi.system.service.ISysOperLogService; +import eu.bitwalker.useragentutils.UserAgent; + +/** + * 异步工厂(产生任务用) + * + * @author #author# + */ +public class AsyncFactory +{ + private static final Logger sys_user_logger = LoggerFactory.getLogger("sys-user"); + + /** + * 记录登录信息 + * + * @param username 用户名 + * @param status 状态 + * @param message 消息 + * @param args 列表 + * @return 任务task + */ + public static TimerTask recordLogininfor(final String username, final String status, final String message, + final Object... args) + { + final UserAgent userAgent = UserAgent.parseUserAgentString(ServletUtils.getRequest().getHeader("User-Agent")); + final String ip = IpUtils.getIpAddr(ServletUtils.getRequest()); + return new TimerTask() + { + @Override + public void run() + { + String address = AddressUtils.getRealAddressByIP(ip); + StringBuilder s = new StringBuilder(); + s.append(LogUtils.getBlock(ip)); + s.append(address); + s.append(LogUtils.getBlock(username)); + s.append(LogUtils.getBlock(status)); + s.append(LogUtils.getBlock(message)); + // 打印信息到日志 + sys_user_logger.info(s.toString(), args); + // 获取客户端操作系统 + String os = userAgent.getOperatingSystem().getName(); + // 获取客户端浏览器 + String browser = userAgent.getBrowser().getName(); + // 封装对象 + SysLogininfor logininfor = new SysLogininfor(); + logininfor.setUserName(username); + logininfor.setIpaddr(ip); + logininfor.setLoginLocation(address); + logininfor.setBrowser(browser); + logininfor.setOs(os); + logininfor.setMsg(message); + // 日志状态 + if (StringUtils.equalsAny(status, Constants.LOGIN_SUCCESS, Constants.LOGOUT, Constants.REGISTER)) + { + logininfor.setStatus(Constants.SUCCESS); + } + else if (Constants.LOGIN_FAIL.equals(status)) + { + logininfor.setStatus(Constants.FAIL); + } + // 插入数据 + SpringUtils.getBean(ISysLogininforService.class).insertLogininfor(logininfor); + } + }; + } + + /** + * 操作日志记录 + * + * @param operLog 操作日志信息 + * @return 任务task + */ + public static TimerTask recordOper(final SysOperLog operLog) + { + return new TimerTask() + { + @Override + public void run() + { + // 远程查询操作地点 + operLog.setOperLocation(AddressUtils.getRealAddressByIP(operLog.getOperIp())); + SpringUtils.getBean(ISysOperLogService.class).insertOperlog(operLog); + } + }; + } +} diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/security/context/AuthenticationContextHolder.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/security/context/AuthenticationContextHolder.java new file mode 100644 index 0000000..cbf9b79 --- /dev/null +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/security/context/AuthenticationContextHolder.java @@ -0,0 +1,28 @@ +package com.ruoyi.framework.security.context; + +import org.springframework.security.core.Authentication; + +/** + * 身份验证信息 + * + * @author #author# + */ +public class AuthenticationContextHolder +{ + private static final ThreadLocal contextHolder = new ThreadLocal<>(); + + public static Authentication getContext() + { + return contextHolder.get(); + } + + public static void setContext(Authentication context) + { + contextHolder.set(context); + } + + public static void clearContext() + { + contextHolder.remove(); + } +} diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/security/context/PermissionContextHolder.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/security/context/PermissionContextHolder.java new file mode 100644 index 0000000..fa1fd94 --- /dev/null +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/security/context/PermissionContextHolder.java @@ -0,0 +1,27 @@ +package com.ruoyi.framework.security.context; + +import org.springframework.web.context.request.RequestAttributes; +import org.springframework.web.context.request.RequestContextHolder; +import com.ruoyi.common.core.text.Convert; + +/** + * 权限信息 + * + * @author #author# + */ +public class PermissionContextHolder +{ + private static final String PERMISSION_CONTEXT_ATTRIBUTES = "PERMISSION_CONTEXT"; + + public static void setContext(String permission) + { + RequestContextHolder.currentRequestAttributes().setAttribute(PERMISSION_CONTEXT_ATTRIBUTES, permission, + RequestAttributes.SCOPE_REQUEST); + } + + public static String getContext() + { + return Convert.toStr(RequestContextHolder.currentRequestAttributes().getAttribute(PERMISSION_CONTEXT_ATTRIBUTES, + RequestAttributes.SCOPE_REQUEST)); + } +} diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/security/filter/JwtAuthenticationTokenFilter.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/security/filter/JwtAuthenticationTokenFilter.java new file mode 100644 index 0000000..b2add6f --- /dev/null +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/security/filter/JwtAuthenticationTokenFilter.java @@ -0,0 +1,44 @@ +package com.ruoyi.framework.security.filter; + +import java.io.IOException; +import javax.servlet.FilterChain; +import javax.servlet.ServletException; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; +import org.springframework.security.core.context.SecurityContextHolder; +import org.springframework.security.web.authentication.WebAuthenticationDetailsSource; +import org.springframework.stereotype.Component; +import org.springframework.web.filter.OncePerRequestFilter; +import com.ruoyi.common.core.domain.model.LoginUser; +import com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.framework.web.service.TokenService; + +/** + * token过滤器 验证token有效性 + * + * @author #author# + */ +@Component +public class JwtAuthenticationTokenFilter extends OncePerRequestFilter +{ + @Autowired + private TokenService tokenService; + + @Override + protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain chain) + throws ServletException, IOException + { + LoginUser loginUser = tokenService.getLoginUser(request); + if (StringUtils.isNotNull(loginUser) && StringUtils.isNull(SecurityUtils.getAuthentication())) + { + tokenService.verifyToken(loginUser); + UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(loginUser, null, loginUser.getAuthorities()); + authenticationToken.setDetails(new WebAuthenticationDetailsSource().buildDetails(request)); + SecurityContextHolder.getContext().setAuthentication(authenticationToken); + } + chain.doFilter(request, response); + } +} diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/security/handle/AuthenticationEntryPointImpl.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/security/handle/AuthenticationEntryPointImpl.java new file mode 100644 index 0000000..3d732c1 --- /dev/null +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/security/handle/AuthenticationEntryPointImpl.java @@ -0,0 +1,34 @@ +package com.ruoyi.framework.security.handle; + +import java.io.IOException; +import java.io.Serializable; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import org.springframework.security.core.AuthenticationException; +import org.springframework.security.web.AuthenticationEntryPoint; +import org.springframework.stereotype.Component; +import com.alibaba.fastjson2.JSON; +import com.ruoyi.common.constant.HttpStatus; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.common.utils.StringUtils; + +/** + * 认证失败处理类 返回未授权 + * + * @author #author# + */ +@Component +public class AuthenticationEntryPointImpl implements AuthenticationEntryPoint, Serializable +{ + private static final long serialVersionUID = -8970718410437077606L; + + @Override + public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException e) + throws IOException + { + int code = HttpStatus.UNAUTHORIZED; + String msg = StringUtils.format("请求访问:{},认证失败,无法访问系统资源", request.getRequestURI()); + ServletUtils.renderString(response, JSON.toJSONString(AjaxResult.error(code, msg))); + } +} diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/security/handle/LogoutSuccessHandlerImpl.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/security/handle/LogoutSuccessHandlerImpl.java new file mode 100644 index 0000000..322a09d --- /dev/null +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/security/handle/LogoutSuccessHandlerImpl.java @@ -0,0 +1,52 @@ +package com.ruoyi.framework.security.handle; + +import java.io.IOException; +import javax.servlet.ServletException; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Configuration; +import org.springframework.security.core.Authentication; +import org.springframework.security.web.authentication.logout.LogoutSuccessHandler; +import com.alibaba.fastjson2.JSON; +import com.ruoyi.common.constant.Constants; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.domain.model.LoginUser; +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.framework.manager.AsyncManager; +import com.ruoyi.framework.manager.factory.AsyncFactory; +import com.ruoyi.framework.web.service.TokenService; + +/** + * 自定义退出处理类 返回成功 + * + * @author #author# + */ +@Configuration +public class LogoutSuccessHandlerImpl implements LogoutSuccessHandler +{ + @Autowired + private TokenService tokenService; + + /** + * 退出处理 + * + * @return + */ + @Override + public void onLogoutSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) + throws IOException, ServletException + { + LoginUser loginUser = tokenService.getLoginUser(request); + if (StringUtils.isNotNull(loginUser)) + { + String userName = loginUser.getUsername(); + // 删除用户缓存记录 + tokenService.delLoginUser(loginUser.getToken()); + // 记录用户退出日志 + AsyncManager.me().execute(AsyncFactory.recordLogininfor(userName, Constants.LOGOUT, "退出成功")); + } + ServletUtils.renderString(response, JSON.toJSONString(AjaxResult.success("退出成功"))); + } +} diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/Server.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/Server.java new file mode 100644 index 0000000..99165fb --- /dev/null +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/Server.java @@ -0,0 +1,240 @@ +package com.ruoyi.framework.web.domain; + +import java.net.UnknownHostException; +import java.util.LinkedList; +import java.util.List; +import java.util.Properties; +import com.ruoyi.common.utils.Arith; +import com.ruoyi.common.utils.ip.IpUtils; +import com.ruoyi.framework.web.domain.server.Cpu; +import com.ruoyi.framework.web.domain.server.Jvm; +import com.ruoyi.framework.web.domain.server.Mem; +import com.ruoyi.framework.web.domain.server.Sys; +import com.ruoyi.framework.web.domain.server.SysFile; +import oshi.SystemInfo; +import oshi.hardware.CentralProcessor; +import oshi.hardware.CentralProcessor.TickType; +import oshi.hardware.GlobalMemory; +import oshi.hardware.HardwareAbstractionLayer; +import oshi.software.os.FileSystem; +import oshi.software.os.OSFileStore; +import oshi.software.os.OperatingSystem; +import oshi.util.Util; + +/** + * 服务器相关信息 + * + * @author #author# + */ +public class Server +{ + private static final int OSHI_WAIT_SECOND = 1000; + + /** + * CPU相关信息 + */ + private Cpu cpu = new Cpu(); + + /** + * 內存相关信息 + */ + private Mem mem = new Mem(); + + /** + * JVM相关信息 + */ + private Jvm jvm = new Jvm(); + + /** + * 服务器相关信息 + */ + private Sys sys = new Sys(); + + /** + * 磁盘相关信息 + */ + private List sysFiles = new LinkedList(); + + public Cpu getCpu() + { + return cpu; + } + + public void setCpu(Cpu cpu) + { + this.cpu = cpu; + } + + public Mem getMem() + { + return mem; + } + + public void setMem(Mem mem) + { + this.mem = mem; + } + + public Jvm getJvm() + { + return jvm; + } + + public void setJvm(Jvm jvm) + { + this.jvm = jvm; + } + + public Sys getSys() + { + return sys; + } + + public void setSys(Sys sys) + { + this.sys = sys; + } + + public List getSysFiles() + { + return sysFiles; + } + + public void setSysFiles(List sysFiles) + { + this.sysFiles = sysFiles; + } + + public void copyTo() throws Exception + { + SystemInfo si = new SystemInfo(); + HardwareAbstractionLayer hal = si.getHardware(); + + setCpuInfo(hal.getProcessor()); + + setMemInfo(hal.getMemory()); + + setSysInfo(); + + setJvmInfo(); + + setSysFiles(si.getOperatingSystem()); + } + + /** + * 设置CPU信息 + */ + private void setCpuInfo(CentralProcessor processor) + { + // CPU信息 + long[] prevTicks = processor.getSystemCpuLoadTicks(); + Util.sleep(OSHI_WAIT_SECOND); + long[] ticks = processor.getSystemCpuLoadTicks(); + long nice = ticks[TickType.NICE.getIndex()] - prevTicks[TickType.NICE.getIndex()]; + long irq = ticks[TickType.IRQ.getIndex()] - prevTicks[TickType.IRQ.getIndex()]; + long softirq = ticks[TickType.SOFTIRQ.getIndex()] - prevTicks[TickType.SOFTIRQ.getIndex()]; + long steal = ticks[TickType.STEAL.getIndex()] - prevTicks[TickType.STEAL.getIndex()]; + long cSys = ticks[TickType.SYSTEM.getIndex()] - prevTicks[TickType.SYSTEM.getIndex()]; + long user = ticks[TickType.USER.getIndex()] - prevTicks[TickType.USER.getIndex()]; + long iowait = ticks[TickType.IOWAIT.getIndex()] - prevTicks[TickType.IOWAIT.getIndex()]; + long idle = ticks[TickType.IDLE.getIndex()] - prevTicks[TickType.IDLE.getIndex()]; + long totalCpu = user + nice + cSys + idle + iowait + irq + softirq + steal; + cpu.setCpuNum(processor.getLogicalProcessorCount()); + cpu.setTotal(totalCpu); + cpu.setSys(cSys); + cpu.setUsed(user); + cpu.setWait(iowait); + cpu.setFree(idle); + } + + /** + * 设置内存信息 + */ + private void setMemInfo(GlobalMemory memory) + { + mem.setTotal(memory.getTotal()); + mem.setUsed(memory.getTotal() - memory.getAvailable()); + mem.setFree(memory.getAvailable()); + } + + /** + * 设置服务器信息 + */ + private void setSysInfo() + { + Properties props = System.getProperties(); + sys.setComputerName(IpUtils.getHostName()); + sys.setComputerIp(IpUtils.getHostIp()); + sys.setOsName(props.getProperty("os.name")); + sys.setOsArch(props.getProperty("os.arch")); + sys.setUserDir(props.getProperty("user.dir")); + } + + /** + * 设置Java虚拟机 + */ + private void setJvmInfo() throws UnknownHostException + { + Properties props = System.getProperties(); + jvm.setTotal(Runtime.getRuntime().totalMemory()); + jvm.setMax(Runtime.getRuntime().maxMemory()); + jvm.setFree(Runtime.getRuntime().freeMemory()); + jvm.setVersion(props.getProperty("java.version")); + jvm.setHome(props.getProperty("java.home")); + } + + /** + * 设置磁盘信息 + */ + private void setSysFiles(OperatingSystem os) + { + FileSystem fileSystem = os.getFileSystem(); + List fsArray = fileSystem.getFileStores(); + for (OSFileStore fs : fsArray) + { + long free = fs.getUsableSpace(); + long total = fs.getTotalSpace(); + long used = total - free; + SysFile sysFile = new SysFile(); + sysFile.setDirName(fs.getMount()); + sysFile.setSysTypeName(fs.getType()); + sysFile.setTypeName(fs.getName()); + sysFile.setTotal(convertFileSize(total)); + sysFile.setFree(convertFileSize(free)); + sysFile.setUsed(convertFileSize(used)); + sysFile.setUsage(Arith.mul(Arith.div(used, total, 4), 100)); + sysFiles.add(sysFile); + } + } + + /** + * 字节转换 + * + * @param size 字节大小 + * @return 转换后值 + */ + public String convertFileSize(long size) + { + long kb = 1024; + long mb = kb * 1024; + long gb = mb * 1024; + if (size >= gb) + { + return String.format("%.1f GB", (float) size / gb); + } + else if (size >= mb) + { + float f = (float) size / mb; + return String.format(f > 100 ? "%.0f MB" : "%.1f MB", f); + } + else if (size >= kb) + { + float f = (float) size / kb; + return String.format(f > 100 ? "%.0f KB" : "%.1f KB", f); + } + else + { + return String.format("%d B", size); + } + } +} diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/server/Cpu.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/server/Cpu.java new file mode 100644 index 0000000..9a775a3 --- /dev/null +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/server/Cpu.java @@ -0,0 +1,101 @@ +package com.ruoyi.framework.web.domain.server; + +import com.ruoyi.common.utils.Arith; + +/** + * CPU相关信息 + * + * @author #author# + */ +public class Cpu +{ + /** + * 核心数 + */ + private int cpuNum; + + /** + * CPU总的使用率 + */ + private double total; + + /** + * CPU系统使用率 + */ + private double sys; + + /** + * CPU用户使用率 + */ + private double used; + + /** + * CPU当前等待率 + */ + private double wait; + + /** + * CPU当前空闲率 + */ + private double free; + + public int getCpuNum() + { + return cpuNum; + } + + public void setCpuNum(int cpuNum) + { + this.cpuNum = cpuNum; + } + + public double getTotal() + { + return Arith.round(Arith.mul(total, 100), 2); + } + + public void setTotal(double total) + { + this.total = total; + } + + public double getSys() + { + return Arith.round(Arith.mul(sys / total, 100), 2); + } + + public void setSys(double sys) + { + this.sys = sys; + } + + public double getUsed() + { + return Arith.round(Arith.mul(used / total, 100), 2); + } + + public void setUsed(double used) + { + this.used = used; + } + + public double getWait() + { + return Arith.round(Arith.mul(wait / total, 100), 2); + } + + public void setWait(double wait) + { + this.wait = wait; + } + + public double getFree() + { + return Arith.round(Arith.mul(free / total, 100), 2); + } + + public void setFree(double free) + { + this.free = free; + } +} diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/server/Jvm.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/server/Jvm.java new file mode 100644 index 0000000..87910e5 --- /dev/null +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/server/Jvm.java @@ -0,0 +1,130 @@ +package com.ruoyi.framework.web.domain.server; + +import java.lang.management.ManagementFactory; +import com.ruoyi.common.utils.Arith; +import com.ruoyi.common.utils.DateUtils; + +/** + * JVM相关信息 + * + * @author #author# + */ +public class Jvm +{ + /** + * 当前JVM占用的内存总数(M) + */ + private double total; + + /** + * JVM最大可用内存总数(M) + */ + private double max; + + /** + * JVM空闲内存(M) + */ + private double free; + + /** + * JDK版本 + */ + private String version; + + /** + * JDK路径 + */ + private String home; + + public double getTotal() + { + return Arith.div(total, (1024 * 1024), 2); + } + + public void setTotal(double total) + { + this.total = total; + } + + public double getMax() + { + return Arith.div(max, (1024 * 1024), 2); + } + + public void setMax(double max) + { + this.max = max; + } + + public double getFree() + { + return Arith.div(free, (1024 * 1024), 2); + } + + public void setFree(double free) + { + this.free = free; + } + + public double getUsed() + { + return Arith.div(total - free, (1024 * 1024), 2); + } + + public double getUsage() + { + return Arith.mul(Arith.div(total - free, total, 4), 100); + } + + /** + * 获取JDK名称 + */ + public String getName() + { + return ManagementFactory.getRuntimeMXBean().getVmName(); + } + + public String getVersion() + { + return version; + } + + public void setVersion(String version) + { + this.version = version; + } + + public String getHome() + { + return home; + } + + public void setHome(String home) + { + this.home = home; + } + + /** + * JDK启动时间 + */ + public String getStartTime() + { + return DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, DateUtils.getServerStartDate()); + } + + /** + * JDK运行时间 + */ + public String getRunTime() + { + return DateUtils.getDatePoor(DateUtils.getNowDate(), DateUtils.getServerStartDate()); + } + + /** + * 运行参数 + */ + public String getInputArgs() + { + return ManagementFactory.getRuntimeMXBean().getInputArguments().toString(); + } +} diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/server/Mem.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/server/Mem.java new file mode 100644 index 0000000..f58afda --- /dev/null +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/server/Mem.java @@ -0,0 +1,61 @@ +package com.ruoyi.framework.web.domain.server; + +import com.ruoyi.common.utils.Arith; + +/** + * 內存相关信息 + * + * @author #author# + */ +public class Mem +{ + /** + * 内存总量 + */ + private double total; + + /** + * 已用内存 + */ + private double used; + + /** + * 剩余内存 + */ + private double free; + + public double getTotal() + { + return Arith.div(total, (1024 * 1024 * 1024), 2); + } + + public void setTotal(long total) + { + this.total = total; + } + + public double getUsed() + { + return Arith.div(used, (1024 * 1024 * 1024), 2); + } + + public void setUsed(long used) + { + this.used = used; + } + + public double getFree() + { + return Arith.div(free, (1024 * 1024 * 1024), 2); + } + + public void setFree(long free) + { + this.free = free; + } + + public double getUsage() + { + return Arith.mul(Arith.div(used, total, 4), 100); + } +} diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/server/Sys.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/server/Sys.java new file mode 100644 index 0000000..d401a1c --- /dev/null +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/server/Sys.java @@ -0,0 +1,84 @@ +package com.ruoyi.framework.web.domain.server; + +/** + * 系统相关信息 + * + * @author #author# + */ +public class Sys +{ + /** + * 服务器名称 + */ + private String computerName; + + /** + * 服务器Ip + */ + private String computerIp; + + /** + * 项目路径 + */ + private String userDir; + + /** + * 操作系统 + */ + private String osName; + + /** + * 系统架构 + */ + private String osArch; + + public String getComputerName() + { + return computerName; + } + + public void setComputerName(String computerName) + { + this.computerName = computerName; + } + + public String getComputerIp() + { + return computerIp; + } + + public void setComputerIp(String computerIp) + { + this.computerIp = computerIp; + } + + public String getUserDir() + { + return userDir; + } + + public void setUserDir(String userDir) + { + this.userDir = userDir; + } + + public String getOsName() + { + return osName; + } + + public void setOsName(String osName) + { + this.osName = osName; + } + + public String getOsArch() + { + return osArch; + } + + public void setOsArch(String osArch) + { + this.osArch = osArch; + } +} diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/server/SysFile.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/server/SysFile.java new file mode 100644 index 0000000..686d4ab --- /dev/null +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/server/SysFile.java @@ -0,0 +1,114 @@ +package com.ruoyi.framework.web.domain.server; + +/** + * 系统文件相关信息 + * + * @author #author# + */ +public class SysFile +{ + /** + * 盘符路径 + */ + private String dirName; + + /** + * 盘符类型 + */ + private String sysTypeName; + + /** + * 文件类型 + */ + private String typeName; + + /** + * 总大小 + */ + private String total; + + /** + * 剩余大小 + */ + private String free; + + /** + * 已经使用量 + */ + private String used; + + /** + * 资源的使用率 + */ + private double usage; + + public String getDirName() + { + return dirName; + } + + public void setDirName(String dirName) + { + this.dirName = dirName; + } + + public String getSysTypeName() + { + return sysTypeName; + } + + public void setSysTypeName(String sysTypeName) + { + this.sysTypeName = sysTypeName; + } + + public String getTypeName() + { + return typeName; + } + + public void setTypeName(String typeName) + { + this.typeName = typeName; + } + + public String getTotal() + { + return total; + } + + public void setTotal(String total) + { + this.total = total; + } + + public String getFree() + { + return free; + } + + public void setFree(String free) + { + this.free = free; + } + + public String getUsed() + { + return used; + } + + public void setUsed(String used) + { + this.used = used; + } + + public double getUsage() + { + return usage; + } + + public void setUsage(double usage) + { + this.usage = usage; + } +} diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/exception/GlobalExceptionHandler.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/exception/GlobalExceptionHandler.java new file mode 100644 index 0000000..bf9731a --- /dev/null +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/exception/GlobalExceptionHandler.java @@ -0,0 +1,114 @@ +package com.ruoyi.framework.web.exception; + +import javax.servlet.http.HttpServletRequest; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.security.access.AccessDeniedException; +import org.springframework.validation.BindException; +import org.springframework.web.HttpRequestMethodNotSupportedException; +import org.springframework.web.bind.MethodArgumentNotValidException; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.RestControllerAdvice; +import com.ruoyi.common.constant.HttpStatus; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.exception.DemoModeException; +import com.ruoyi.common.exception.ServiceException; +import com.ruoyi.common.utils.StringUtils; + +/** + * 全局异常处理器 + * + * @author #author# + */ +@RestControllerAdvice +public class GlobalExceptionHandler +{ + private static final Logger log = LoggerFactory.getLogger(GlobalExceptionHandler.class); + + /** + * 权限校验异常 + */ + @ExceptionHandler(AccessDeniedException.class) + public AjaxResult handleAccessDeniedException(AccessDeniedException e, HttpServletRequest request) + { + String requestURI = request.getRequestURI(); + log.error("请求地址'{}',权限校验失败'{}'", requestURI, e.getMessage()); + return AjaxResult.error(HttpStatus.FORBIDDEN, "没有权限,请联系管理员授权"); + } + + /** + * 请求方式不支持 + */ + @ExceptionHandler(HttpRequestMethodNotSupportedException.class) + public AjaxResult handleHttpRequestMethodNotSupported(HttpRequestMethodNotSupportedException e, + HttpServletRequest request) + { + String requestURI = request.getRequestURI(); + log.error("请求地址'{}',不支持'{}'请求", requestURI, e.getMethod()); + return AjaxResult.error(e.getMessage()); + } + + /** + * 业务异常 + */ + @ExceptionHandler(ServiceException.class) + public AjaxResult handleServiceException(ServiceException e, HttpServletRequest request) + { + log.error(e.getMessage(), e); + Integer code = e.getCode(); + return StringUtils.isNotNull(code) ? AjaxResult.error(code, e.getMessage()) : AjaxResult.error(e.getMessage()); + } + + /** + * 拦截未知的运行时异常 + */ + @ExceptionHandler(RuntimeException.class) + public AjaxResult handleRuntimeException(RuntimeException e, HttpServletRequest request) + { + String requestURI = request.getRequestURI(); + log.error("请求地址'{}',发生未知异常.", requestURI, e); + return AjaxResult.error(e.getMessage()); + } + + /** + * 系统异常 + */ + @ExceptionHandler(Exception.class) + public AjaxResult handleException(Exception e, HttpServletRequest request) + { + String requestURI = request.getRequestURI(); + log.error("请求地址'{}',发生系统异常.", requestURI, e); + return AjaxResult.error(e.getMessage()); + } + + /** + * 自定义验证异常 + */ + @ExceptionHandler(BindException.class) + public AjaxResult handleBindException(BindException e) + { + log.error(e.getMessage(), e); + String message = e.getAllErrors().get(0).getDefaultMessage(); + return AjaxResult.error(message); + } + + /** + * 自定义验证异常 + */ + @ExceptionHandler(MethodArgumentNotValidException.class) + public Object handleMethodArgumentNotValidException(MethodArgumentNotValidException e) + { + log.error(e.getMessage(), e); + String message = e.getBindingResult().getFieldError().getDefaultMessage(); + return AjaxResult.error(message); + } + + /** + * 演示模式异常 + */ + @ExceptionHandler(DemoModeException.class) + public AjaxResult handleDemoModeException(DemoModeException e) + { + return AjaxResult.error("演示模式,不允许操作"); + } +} diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/PermissionService.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/PermissionService.java new file mode 100644 index 0000000..433139b --- /dev/null +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/PermissionService.java @@ -0,0 +1,168 @@ +package com.ruoyi.framework.web.service; + +import java.util.Set; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; +import com.ruoyi.common.core.domain.entity.SysRole; +import com.ruoyi.common.core.domain.model.LoginUser; +import com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.framework.security.context.PermissionContextHolder; + +/** + * RuoYi首创 自定义权限实现,ss取自SpringSecurity首字母 + * + * @author #author# + */ +@Service("ss") +public class PermissionService +{ + /** 所有权限标识 */ + private static final String ALL_PERMISSION = "*:*:*"; + + /** 管理员角色权限标识 */ + private static final String SUPER_ADMIN = "admin"; + + private static final String ROLE_DELIMETER = ","; + + private static final String PERMISSION_DELIMETER = ","; + + /** + * 验证用户是否具备某权限 + * + * @param permission 权限字符串 + * @return 用户是否具备某权限 + */ + public boolean hasPermi(String permission) + { + if (StringUtils.isEmpty(permission)) + { + return false; + } + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (StringUtils.isNull(loginUser) || CollectionUtils.isEmpty(loginUser.getPermissions())) + { + return false; + } + PermissionContextHolder.setContext(permission); + return hasPermissions(loginUser.getPermissions(), permission); + } + + /** + * 验证用户是否不具备某权限,与 hasPermi逻辑相反 + * + * @param permission 权限字符串 + * @return 用户是否不具备某权限 + */ + public boolean lacksPermi(String permission) + { + return hasPermi(permission) != true; + } + + /** + * 验证用户是否具有以下任意一个权限 + * + * @param permissions 以 PERMISSION_NAMES_DELIMETER 为分隔符的权限列表 + * @return 用户是否具有以下任意一个权限 + */ + public boolean hasAnyPermi(String permissions) + { + if (StringUtils.isEmpty(permissions)) + { + return false; + } + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (StringUtils.isNull(loginUser) || CollectionUtils.isEmpty(loginUser.getPermissions())) + { + return false; + } + PermissionContextHolder.setContext(permissions); + Set authorities = loginUser.getPermissions(); + for (String permission : permissions.split(PERMISSION_DELIMETER)) + { + if (permission != null && hasPermissions(authorities, permission)) + { + return true; + } + } + return false; + } + + /** + * 判断用户是否拥有某个角色 + * + * @param role 角色字符串 + * @return 用户是否具备某角色 + */ + public boolean hasRole(String role) + { + if (StringUtils.isEmpty(role)) + { + return false; + } + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (StringUtils.isNull(loginUser) || CollectionUtils.isEmpty(loginUser.getUser().getRoles())) + { + return false; + } + for (SysRole sysRole : loginUser.getUser().getRoles()) + { + String roleKey = sysRole.getRoleKey(); + if (SUPER_ADMIN.equals(roleKey) || roleKey.equals(StringUtils.trim(role))) + { + return true; + } + } + return false; + } + + /** + * 验证用户是否不具备某角色,与 isRole逻辑相反。 + * + * @param role 角色名称 + * @return 用户是否不具备某角色 + */ + public boolean lacksRole(String role) + { + return hasRole(role) != true; + } + + /** + * 验证用户是否具有以下任意一个角色 + * + * @param roles 以 ROLE_NAMES_DELIMETER 为分隔符的角色列表 + * @return 用户是否具有以下任意一个角色 + */ + public boolean hasAnyRoles(String roles) + { + if (StringUtils.isEmpty(roles)) + { + return false; + } + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (StringUtils.isNull(loginUser) || CollectionUtils.isEmpty(loginUser.getUser().getRoles())) + { + return false; + } + for (String role : roles.split(ROLE_DELIMETER)) + { + if (hasRole(role)) + { + return true; + } + } + return false; + } + + /** + * 判断是否包含权限 + * + * @param permissions 权限列表 + * @param permission 权限字符串 + * @return 用户是否具备某权限 + */ + private boolean hasPermissions(Set permissions, String permission) + { + return permissions.contains(ALL_PERMISSION) || permissions.contains(StringUtils.trim(permission)); + } +} diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java new file mode 100644 index 0000000..fe137cc --- /dev/null +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java @@ -0,0 +1,141 @@ +package com.ruoyi.framework.web.service; + +import javax.annotation.Resource; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.authentication.AuthenticationManager; +import org.springframework.security.authentication.BadCredentialsException; +import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; +import org.springframework.security.core.Authentication; +import org.springframework.stereotype.Component; +import com.ruoyi.common.constant.CacheConstants; +import com.ruoyi.common.constant.Constants; +import com.ruoyi.common.core.domain.entity.SysUser; +import com.ruoyi.common.core.domain.model.LoginUser; +import com.ruoyi.common.core.redis.RedisCache; +import com.ruoyi.common.exception.ServiceException; +import com.ruoyi.common.exception.user.CaptchaException; +import com.ruoyi.common.exception.user.CaptchaExpireException; +import com.ruoyi.common.exception.user.UserPasswordNotMatchException; +import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.common.utils.MessageUtils; +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.common.utils.ip.IpUtils; +import com.ruoyi.framework.manager.AsyncManager; +import com.ruoyi.framework.manager.factory.AsyncFactory; +import com.ruoyi.framework.security.context.AuthenticationContextHolder; +import com.ruoyi.system.service.ISysConfigService; +import com.ruoyi.system.service.ISysUserService; + +/** + * 登录校验方法 + * + * @author #author# + */ +@Component +public class SysLoginService +{ + @Autowired + private TokenService tokenService; + + @Resource + private AuthenticationManager authenticationManager; + + @Autowired + private RedisCache redisCache; + + @Autowired + private ISysUserService userService; + + @Autowired + private ISysConfigService configService; + + /** + * 登录验证 + * + * @param username 用户名 + * @param password 密码 + * @param code 验证码 + * @param uuid 唯一标识 + * @return 结果 + */ + public String login(String username, String password, String code, String uuid) + { + boolean captchaEnabled = configService.selectCaptchaEnabled(); + // 验证码开关 + if (captchaEnabled) + { + validateCaptcha(username, code, uuid); + } + // 用户验证 + Authentication authentication = null; + try + { + UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(username, password); + AuthenticationContextHolder.setContext(authenticationToken); + // 该方法会去调用UserDetailsServiceImpl.loadUserByUsername + authentication = authenticationManager.authenticate(authenticationToken); + } + catch (Exception e) + { + if (e instanceof BadCredentialsException) + { + AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.password.not.match"))); + throw new UserPasswordNotMatchException(); + } + else + { + AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, e.getMessage())); + throw new ServiceException(e.getMessage()); + } + } + finally + { + AuthenticationContextHolder.clearContext(); + } + AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_SUCCESS, MessageUtils.message("user.login.success"))); + LoginUser loginUser = (LoginUser) authentication.getPrincipal(); + recordLoginInfo(loginUser.getUserId()); + // 生成token + return tokenService.createToken(loginUser); + } + + /** + * 校验验证码 + * + * @param username 用户名 + * @param code 验证码 + * @param uuid 唯一标识 + * @return 结果 + */ + public void validateCaptcha(String username, String code, String uuid) + { + String verifyKey = CacheConstants.CAPTCHA_CODE_KEY + StringUtils.nvl(uuid, ""); + String captcha = redisCache.getCacheObject(verifyKey); + redisCache.deleteObject(verifyKey); + if (captcha == null) + { + AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.expire"))); + throw new CaptchaExpireException(); + } + if (!code.equalsIgnoreCase(captcha)) + { + AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.error"))); + throw new CaptchaException(); + } + } + + /** + * 记录登录信息 + * + * @param userId 用户ID + */ + public void recordLoginInfo(Long userId) + { + SysUser sysUser = new SysUser(); + sysUser.setUserId(userId); + sysUser.setLoginIp(IpUtils.getIpAddr(ServletUtils.getRequest())); + sysUser.setLoginDate(DateUtils.getNowDate()); + userService.updateUserProfile(sysUser); + } +} diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysPasswordService.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysPasswordService.java new file mode 100644 index 0000000..5c3cf5c --- /dev/null +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysPasswordService.java @@ -0,0 +1,94 @@ +package com.ruoyi.framework.web.service; + +import java.util.concurrent.TimeUnit; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.security.core.Authentication; +import org.springframework.stereotype.Component; +import com.ruoyi.common.constant.CacheConstants; +import com.ruoyi.common.constant.Constants; +import com.ruoyi.common.core.domain.entity.SysUser; +import com.ruoyi.common.core.redis.RedisCache; +import com.ruoyi.common.exception.user.UserPasswordNotMatchException; +import com.ruoyi.common.exception.user.UserPasswordRetryLimitExceedException; +import com.ruoyi.common.utils.MessageUtils; +import com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.framework.manager.AsyncManager; +import com.ruoyi.framework.manager.factory.AsyncFactory; +import com.ruoyi.framework.security.context.AuthenticationContextHolder; + +/** + * 登录密码方法 + * + * @author #author# + */ +@Component +public class SysPasswordService +{ + @Autowired + private RedisCache redisCache; + + @Value(value = "${user.password.maxRetryCount}") + private int maxRetryCount; + + @Value(value = "${user.password.lockTime}") + private int lockTime; + + /** + * 登录账户密码错误次数缓存键名 + * + * @param username 用户名 + * @return 缓存键key + */ + private String getCacheKey(String username) + { + return CacheConstants.PWD_ERR_CNT_KEY + username; + } + + public void validate(SysUser user) + { + Authentication usernamePasswordAuthenticationToken = AuthenticationContextHolder.getContext(); + String username = usernamePasswordAuthenticationToken.getName(); + String password = usernamePasswordAuthenticationToken.getCredentials().toString(); + + Integer retryCount = redisCache.getCacheObject(getCacheKey(username)); + + if (retryCount == null) + { + retryCount = 0; + } + + if (retryCount >= Integer.valueOf(maxRetryCount).intValue()) + { + AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, + MessageUtils.message("user.password.retry.limit.exceed", maxRetryCount, lockTime))); + throw new UserPasswordRetryLimitExceedException(maxRetryCount, lockTime); + } + + if (!matches(user, password)) + { + retryCount = retryCount + 1; + AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, + MessageUtils.message("user.password.retry.limit.count", retryCount))); + redisCache.setCacheObject(getCacheKey(username), retryCount, lockTime, TimeUnit.MINUTES); + throw new UserPasswordNotMatchException(); + } + else + { + clearLoginRecordCache(username); + } + } + + public boolean matches(SysUser user, String rawPassword) + { + return SecurityUtils.matchesPassword(rawPassword, user.getPassword()); + } + + public void clearLoginRecordCache(String loginName) + { + if (redisCache.hasKey(getCacheKey(loginName))) + { + redisCache.deleteObject(getCacheKey(loginName)); + } + } +} diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysPermissionService.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysPermissionService.java new file mode 100644 index 0000000..06086e5 --- /dev/null +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysPermissionService.java @@ -0,0 +1,82 @@ +package com.ruoyi.framework.web.service; + +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; +import com.ruoyi.common.core.domain.entity.SysRole; +import com.ruoyi.common.core.domain.entity.SysUser; +import com.ruoyi.system.service.ISysMenuService; +import com.ruoyi.system.service.ISysRoleService; + +/** + * 用户权限处理 + * + * @author #author# + */ +@Component +public class SysPermissionService +{ + @Autowired + private ISysRoleService roleService; + + @Autowired + private ISysMenuService menuService; + + /** + * 获取角色数据权限 + * + * @param user 用户信息 + * @return 角色权限信息 + */ + public Set getRolePermission(SysUser user) + { + Set roles = new HashSet(); + // 管理员拥有所有权限 + if (user.isAdmin()) + { + roles.add("admin"); + } + else + { + roles.addAll(roleService.selectRolePermissionByUserId(user.getUserId())); + } + return roles; + } + + /** + * 获取菜单数据权限 + * + * @param user 用户信息 + * @return 菜单权限信息 + */ + public Set getMenuPermission(SysUser user) + { + Set perms = new HashSet(); + // 管理员拥有所有权限 + if (user.isAdmin()) + { + perms.add("*:*:*"); + } + else + { + List roles = user.getRoles(); + if (!roles.isEmpty() && roles.size() > 1) + { + // 多角色设置permissions属性,以便数据权限匹配权限 + for (SysRole role : roles) + { + Set rolePerms = menuService.selectMenuPermsByRoleId(role.getRoleId()); + role.setPermissions(rolePerms); + perms.addAll(rolePerms); + } + } + else + { + perms.addAll(menuService.selectMenuPermsByUserId(user.getUserId())); + } + } + return perms; + } +} diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysRegisterService.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysRegisterService.java new file mode 100644 index 0000000..988c68b --- /dev/null +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysRegisterService.java @@ -0,0 +1,115 @@ +package com.ruoyi.framework.web.service; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; +import com.ruoyi.common.constant.CacheConstants; +import com.ruoyi.common.constant.Constants; +import com.ruoyi.common.constant.UserConstants; +import com.ruoyi.common.core.domain.entity.SysUser; +import com.ruoyi.common.core.domain.model.RegisterBody; +import com.ruoyi.common.core.redis.RedisCache; +import com.ruoyi.common.exception.user.CaptchaException; +import com.ruoyi.common.exception.user.CaptchaExpireException; +import com.ruoyi.common.utils.MessageUtils; +import com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.framework.manager.AsyncManager; +import com.ruoyi.framework.manager.factory.AsyncFactory; +import com.ruoyi.system.service.ISysConfigService; +import com.ruoyi.system.service.ISysUserService; + +/** + * 注册校验方法 + * + * @author #author# + */ +@Component +public class SysRegisterService +{ + @Autowired + private ISysUserService userService; + + @Autowired + private ISysConfigService configService; + + @Autowired + private RedisCache redisCache; + + /** + * 注册 + */ + public String register(RegisterBody registerBody) + { + String msg = "", username = registerBody.getUsername(), password = registerBody.getPassword(); + SysUser sysUser = new SysUser(); + sysUser.setUserName(username); + + // 验证码开关 + boolean captchaEnabled = configService.selectCaptchaEnabled(); + if (captchaEnabled) + { + validateCaptcha(username, registerBody.getCode(), registerBody.getUuid()); + } + + if (StringUtils.isEmpty(username)) + { + msg = "用户名不能为空"; + } + else if (StringUtils.isEmpty(password)) + { + msg = "用户密码不能为空"; + } + else if (username.length() < UserConstants.USERNAME_MIN_LENGTH + || username.length() > UserConstants.USERNAME_MAX_LENGTH) + { + msg = "账户长度必须在2到20个字符之间"; + } + else if (password.length() < UserConstants.PASSWORD_MIN_LENGTH + || password.length() > UserConstants.PASSWORD_MAX_LENGTH) + { + msg = "密码长度必须在5到20个字符之间"; + } + else if (UserConstants.NOT_UNIQUE.equals(userService.checkUserNameUnique(sysUser))) + { + msg = "保存用户'" + username + "'失败,注册账号已存在"; + } + else + { + sysUser.setNickName(username); + sysUser.setPassword(SecurityUtils.encryptPassword(password)); + boolean regFlag = userService.registerUser(sysUser); + if (!regFlag) + { + msg = "注册失败,请联系系统管理人员"; + } + else + { + AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.REGISTER, MessageUtils.message("user.register.success"))); + } + } + return msg; + } + + /** + * 校验验证码 + * + * @param username 用户名 + * @param code 验证码 + * @param uuid 唯一标识 + * @return 结果 + */ + public void validateCaptcha(String username, String code, String uuid) + { + String verifyKey = CacheConstants.CAPTCHA_CODE_KEY + StringUtils.nvl(uuid, ""); + String captcha = redisCache.getCacheObject(verifyKey); + redisCache.deleteObject(verifyKey); + if (captcha == null) + { + throw new CaptchaExpireException(); + } + if (!code.equalsIgnoreCase(captcha)) + { + throw new CaptchaException(); + } + } +} diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/TokenService.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/TokenService.java new file mode 100644 index 0000000..234747d --- /dev/null +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/TokenService.java @@ -0,0 +1,226 @@ +package com.ruoyi.framework.web.service; + +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.servlet.http.HttpServletRequest; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Component; +import com.ruoyi.common.constant.CacheConstants; +import com.ruoyi.common.constant.Constants; +import com.ruoyi.common.core.domain.model.LoginUser; +import com.ruoyi.common.core.redis.RedisCache; +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.common.utils.ip.AddressUtils; +import com.ruoyi.common.utils.ip.IpUtils; +import com.ruoyi.common.utils.uuid.IdUtils; +import eu.bitwalker.useragentutils.UserAgent; +import io.jsonwebtoken.Claims; +import io.jsonwebtoken.Jwts; +import io.jsonwebtoken.SignatureAlgorithm; + +/** + * token验证处理 + * + * @author #author# + */ +@Component +public class TokenService +{ + // 令牌自定义标识 + @Value("${token.header}") + private String header; + + // 令牌秘钥 + @Value("${token.secret}") + private String secret; + + // 令牌有效期(默认30分钟) + @Value("${token.expireTime}") + private int expireTime; + + protected static final long MILLIS_SECOND = 1000; + + protected static final long MILLIS_MINUTE = 60 * MILLIS_SECOND; + + private static final Long MILLIS_MINUTE_TEN = 20 * 60 * 1000L; + + @Autowired + private RedisCache redisCache; + + /** + * 获取用户身份信息 + * + * @return 用户信息 + */ + public LoginUser getLoginUser(HttpServletRequest request) + { + // 获取请求携带的令牌 + String token = getToken(request); + if (StringUtils.isNotEmpty(token)) + { + try + { + Claims claims = parseToken(token); + // 解析对应的权限以及用户信息 + String uuid = (String) claims.get(Constants.LOGIN_USER_KEY); + String userKey = getTokenKey(uuid); + LoginUser user = redisCache.getCacheObject(userKey); + return user; + } + catch (Exception e) + { + } + } + return null; + } + + /** + * 设置用户身份信息 + */ + public void setLoginUser(LoginUser loginUser) + { + if (StringUtils.isNotNull(loginUser) && StringUtils.isNotEmpty(loginUser.getToken())) + { + refreshToken(loginUser); + } + } + + /** + * 删除用户身份信息 + */ + public void delLoginUser(String token) + { + if (StringUtils.isNotEmpty(token)) + { + String userKey = getTokenKey(token); + redisCache.deleteObject(userKey); + } + } + + /** + * 创建令牌 + * + * @param loginUser 用户信息 + * @return 令牌 + */ + public String createToken(LoginUser loginUser) + { + String token = IdUtils.fastUUID(); + loginUser.setToken(token); + setUserAgent(loginUser); + refreshToken(loginUser); + + Map claims = new HashMap<>(); + claims.put(Constants.LOGIN_USER_KEY, token); + return createToken(claims); + } + + /** + * 验证令牌有效期,相差不足20分钟,自动刷新缓存 + * + * @param loginUser + * @return 令牌 + */ + public void verifyToken(LoginUser loginUser) + { + long expireTime = loginUser.getExpireTime(); + long currentTime = System.currentTimeMillis(); + if (expireTime - currentTime <= MILLIS_MINUTE_TEN) + { + refreshToken(loginUser); + } + } + + /** + * 刷新令牌有效期 + * + * @param loginUser 登录信息 + */ + public void refreshToken(LoginUser loginUser) + { + loginUser.setLoginTime(System.currentTimeMillis()); + loginUser.setExpireTime(loginUser.getLoginTime() + expireTime * MILLIS_MINUTE); + // 根据uuid将loginUser缓存 + String userKey = getTokenKey(loginUser.getToken()); + redisCache.setCacheObject(userKey, loginUser, expireTime, TimeUnit.MINUTES); + } + + /** + * 设置用户代理信息 + * + * @param loginUser 登录信息 + */ + public void setUserAgent(LoginUser loginUser) + { + UserAgent userAgent = UserAgent.parseUserAgentString(ServletUtils.getRequest().getHeader("User-Agent")); + String ip = IpUtils.getIpAddr(ServletUtils.getRequest()); + loginUser.setIpaddr(ip); + loginUser.setLoginLocation(AddressUtils.getRealAddressByIP(ip)); + loginUser.setBrowser(userAgent.getBrowser().getName()); + loginUser.setOs(userAgent.getOperatingSystem().getName()); + } + + /** + * 从数据声明生成令牌 + * + * @param claims 数据声明 + * @return 令牌 + */ + private String createToken(Map claims) + { + String token = Jwts.builder() + .setClaims(claims) + .signWith(SignatureAlgorithm.HS512, secret).compact(); + return token; + } + + /** + * 从令牌中获取数据声明 + * + * @param token 令牌 + * @return 数据声明 + */ + private Claims parseToken(String token) + { + return Jwts.parser() + .setSigningKey(secret) + .parseClaimsJws(token) + .getBody(); + } + + /** + * 从令牌中获取用户名 + * + * @param token 令牌 + * @return 用户名 + */ + public String getUsernameFromToken(String token) + { + Claims claims = parseToken(token); + return claims.getSubject(); + } + + /** + * 获取请求token + * + * @param request + * @return token + */ + private String getToken(HttpServletRequest request) + { + String token = request.getHeader(header); + if (StringUtils.isNotEmpty(token) && token.startsWith(Constants.TOKEN_PREFIX)) + { + token = token.replace(Constants.TOKEN_PREFIX, ""); + } + return token; + } + + private String getTokenKey(String uuid) + { + return CacheConstants.LOGIN_TOKEN_KEY + uuid; + } +} diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/UserDetailsServiceImpl.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/UserDetailsServiceImpl.java new file mode 100644 index 0000000..39c7e34 --- /dev/null +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/UserDetailsServiceImpl.java @@ -0,0 +1,65 @@ +package com.ruoyi.framework.web.service; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.core.userdetails.UserDetails; +import org.springframework.security.core.userdetails.UserDetailsService; +import org.springframework.security.core.userdetails.UsernameNotFoundException; +import org.springframework.stereotype.Service; +import com.ruoyi.common.core.domain.entity.SysUser; +import com.ruoyi.common.core.domain.model.LoginUser; +import com.ruoyi.common.enums.UserStatus; +import com.ruoyi.common.exception.ServiceException; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.system.service.ISysUserService; + +/** + * 用户验证处理 + * + * @author #author# + */ +@Service +public class UserDetailsServiceImpl implements UserDetailsService +{ + private static final Logger log = LoggerFactory.getLogger(UserDetailsServiceImpl.class); + + @Autowired + private ISysUserService userService; + + @Autowired + private SysPasswordService passwordService; + + @Autowired + private SysPermissionService permissionService; + + @Override + public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException + { + SysUser user = userService.selectUserByUserName(username); + if (StringUtils.isNull(user)) + { + log.info("登录用户:{} 不存在.", username); + throw new ServiceException("登录用户:" + username + " 不存在"); + } + else if (UserStatus.DELETED.getCode().equals(user.getDelFlag())) + { + log.info("登录用户:{} 已被删除.", username); + throw new ServiceException("对不起,您的账号:" + username + " 已被删除"); + } + else if (UserStatus.DISABLE.getCode().equals(user.getStatus())) + { + log.info("登录用户:{} 已被停用.", username); + throw new ServiceException("对不起,您的账号:" + username + " 已停用"); + } + + passwordService.validate(user); + + return createLoginUser(user); + } + + public UserDetails createLoginUser(SysUser user) + { + return new LoginUser(user.getUserId(), user.getDeptId(), user, permissionService.getMenuPermission(user)); + } +} diff --git a/ruoyi-generator/pom.xml b/ruoyi-generator/pom.xml new file mode 100644 index 0000000..10bda90 --- /dev/null +++ b/ruoyi-generator/pom.xml @@ -0,0 +1,40 @@ + + + + ruoyi + com.ruoyi + 3.8.5 + + 4.0.0 + + ruoyi-generator + + + generator代码生成 + + + + + + + org.apache.velocity + velocity-engine-core + + + + + commons-collections + commons-collections + + + + + com.ruoyi + ruoyi-common + + + + + \ No newline at end of file diff --git a/ruoyi-generator/src/main/java/com/ruoyi/generator/config/GenConfig.java b/ruoyi-generator/src/main/java/com/ruoyi/generator/config/GenConfig.java new file mode 100644 index 0000000..c08f00e --- /dev/null +++ b/ruoyi-generator/src/main/java/com/ruoyi/generator/config/GenConfig.java @@ -0,0 +1,73 @@ +package com.ruoyi.generator.config; + +import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.context.annotation.PropertySource; +import org.springframework.stereotype.Component; + +/** + * 读取代码生成相关配置 + * + * @author zhihuiwuliu + */ +@Component +@ConfigurationProperties(prefix = "gen") +@PropertySource(value = { "classpath:generator.yml" }) +public class GenConfig +{ + /** 作者 */ + public static String author; + + /** 生成包路径 */ + public static String packageName; + + /** 自动去除表前缀,默认是false */ + public static boolean autoRemovePre; + + /** 表前缀(类名不会包含表前缀) */ + public static String tablePrefix; + + public static String getAuthor() + { + return author; + } + + @Value("${author}") + public void setAuthor(String author) + { + GenConfig.author = author; + } + + public static String getPackageName() + { + return packageName; + } + + @Value("${packageName}") + public void setPackageName(String packageName) + { + GenConfig.packageName = packageName; + } + + public static boolean getAutoRemovePre() + { + return autoRemovePre; + } + + @Value("${autoRemovePre}") + public void setAutoRemovePre(boolean autoRemovePre) + { + GenConfig.autoRemovePre = autoRemovePre; + } + + public static String getTablePrefix() + { + return tablePrefix; + } + + @Value("${tablePrefix}") + public void setTablePrefix(String tablePrefix) + { + GenConfig.tablePrefix = tablePrefix; + } +} diff --git a/ruoyi-generator/src/main/java/com/ruoyi/generator/controller/GenController.java b/ruoyi-generator/src/main/java/com/ruoyi/generator/controller/GenController.java new file mode 100644 index 0000000..8ce7a3f --- /dev/null +++ b/ruoyi-generator/src/main/java/com/ruoyi/generator/controller/GenController.java @@ -0,0 +1,214 @@ +package com.ruoyi.generator.controller; + +import java.io.IOException; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.servlet.http.HttpServletResponse; +import org.apache.commons.io.IOUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.common.core.text.Convert; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.generator.domain.GenTable; +import com.ruoyi.generator.domain.GenTableColumn; +import com.ruoyi.generator.service.IGenTableColumnService; +import com.ruoyi.generator.service.IGenTableService; + +/** + * 代码生成 操作处理 + * + * @author zhihuiwuliu + */ +@RestController +@RequestMapping("/tool/gen") +public class GenController extends BaseController +{ + @Autowired + private IGenTableService genTableService; + + @Autowired + private IGenTableColumnService genTableColumnService; + + /** + * 查询代码生成列表 + */ + @PreAuthorize("@ss.hasPermi('tool:gen:list')") + @GetMapping("/list") + public TableDataInfo genList(GenTable genTable) + { + startPage(); + List list = genTableService.selectGenTableList(genTable); + return getDataTable(list); + } + + /** + * 修改代码生成业务 + */ + @PreAuthorize("@ss.hasPermi('tool:gen:query')") + @GetMapping(value = "/{tableId}") + public AjaxResult getInfo(@PathVariable Long tableId) + { + GenTable table = genTableService.selectGenTableById(tableId); + List tables = genTableService.selectGenTableAll(); + List list = genTableColumnService.selectGenTableColumnListByTableId(tableId); + Map map = new HashMap(); + map.put("info", table); + map.put("rows", list); + map.put("tables", tables); + return success(map); + } + + /** + * 查询数据库列表 + */ + @PreAuthorize("@ss.hasPermi('tool:gen:list')") + @GetMapping("/db/list") + public TableDataInfo dataList(GenTable genTable) + { + startPage(); + List list = genTableService.selectDbTableList(genTable); + return getDataTable(list); + } + + /** + * 查询数据表字段列表 + */ + @PreAuthorize("@ss.hasPermi('tool:gen:list')") + @GetMapping(value = "/column/{tableId}") + public TableDataInfo columnList(Long tableId) + { + TableDataInfo dataInfo = new TableDataInfo(); + List list = genTableColumnService.selectGenTableColumnListByTableId(tableId); + dataInfo.setRows(list); + dataInfo.setTotal(list.size()); + return dataInfo; + } + + /** + * 导入表结构(保存) + */ + @PreAuthorize("@ss.hasPermi('tool:gen:import')") + @Log(title = "代码生成", businessType = BusinessType.IMPORT) + @PostMapping("/importTable") + public AjaxResult importTableSave(String tables) + { + String[] tableNames = Convert.toStrArray(tables); + // 查询表信息 + List tableList = genTableService.selectDbTableListByNames(tableNames); + genTableService.importGenTable(tableList); + return success(); + } + + /** + * 修改保存代码生成业务 + */ + @PreAuthorize("@ss.hasPermi('tool:gen:edit')") + @Log(title = "代码生成", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult editSave(@Validated @RequestBody GenTable genTable) + { + genTableService.validateEdit(genTable); + genTableService.updateGenTable(genTable); + return success(); + } + + /** + * 删除代码生成 + */ + @PreAuthorize("@ss.hasPermi('tool:gen:remove')") + @Log(title = "代码生成", businessType = BusinessType.DELETE) + @DeleteMapping("/{tableIds}") + public AjaxResult remove(@PathVariable Long[] tableIds) + { + genTableService.deleteGenTableByIds(tableIds); + return success(); + } + + /** + * 预览代码 + */ + @PreAuthorize("@ss.hasPermi('tool:gen:preview')") + @GetMapping("/preview/{tableId}") + public AjaxResult preview(@PathVariable("tableId") Long tableId) throws IOException + { + Map dataMap = genTableService.previewCode(tableId); + return success(dataMap); + } + + /** + * 生成代码(下载方式) + */ + @PreAuthorize("@ss.hasPermi('tool:gen:code')") + @Log(title = "代码生成", businessType = BusinessType.GENCODE) + @GetMapping("/download/{tableName}") + public void download(HttpServletResponse response, @PathVariable("tableName") String tableName) throws IOException + { + byte[] data = genTableService.downloadCode(tableName); + genCode(response, data); + } + + /** + * 生成代码(自定义路径) + */ + @PreAuthorize("@ss.hasPermi('tool:gen:code')") + @Log(title = "代码生成", businessType = BusinessType.GENCODE) + @GetMapping("/genCode/{tableName}") + public AjaxResult genCode(@PathVariable("tableName") String tableName) + { + genTableService.generatorCode(tableName); + return success(); + } + + /** + * 同步数据库 + */ + @PreAuthorize("@ss.hasPermi('tool:gen:edit')") + @Log(title = "代码生成", businessType = BusinessType.UPDATE) + @GetMapping("/synchDb/{tableName}") + public AjaxResult synchDb(@PathVariable("tableName") String tableName) + { + genTableService.synchDb(tableName); + return success(); + } + + /** + * 批量生成代码 + */ + @PreAuthorize("@ss.hasPermi('tool:gen:code')") + @Log(title = "代码生成", businessType = BusinessType.GENCODE) + @GetMapping("/batchGenCode") + public void batchGenCode(HttpServletResponse response, String tables) throws IOException + { + String[] tableNames = Convert.toStrArray(tables); + byte[] data = genTableService.downloadCode(tableNames); + genCode(response, data); + } + + /** + * 生成zip文件 + */ + private void genCode(HttpServletResponse response, byte[] data) throws IOException + { + response.reset(); + response.addHeader("Access-Control-Allow-Origin", "*"); + response.addHeader("Access-Control-Expose-Headers", "Content-Disposition"); + response.setHeader("Content-Disposition", "attachment; filename=\"ruoyi.zip\""); + response.addHeader("Content-Length", "" + data.length); + response.setContentType("application/octet-stream; charset=UTF-8"); + IOUtils.write(data, response.getOutputStream()); + } +} \ No newline at end of file diff --git a/ruoyi-generator/src/main/java/com/ruoyi/generator/domain/GenTable.java b/ruoyi-generator/src/main/java/com/ruoyi/generator/domain/GenTable.java new file mode 100644 index 0000000..702c580 --- /dev/null +++ b/ruoyi-generator/src/main/java/com/ruoyi/generator/domain/GenTable.java @@ -0,0 +1,372 @@ +package com.ruoyi.generator.domain; + +import java.util.List; +import javax.validation.Valid; +import javax.validation.constraints.NotBlank; +import org.apache.commons.lang3.ArrayUtils; +import com.ruoyi.common.constant.GenConstants; +import com.ruoyi.common.core.domain.BaseEntity; +import com.ruoyi.common.utils.StringUtils; + +/** + * 业务表 gen_table + * + * @author zhihuiwuliu + */ +public class GenTable extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 编号 */ + private Long tableId; + + /** 表名称 */ + @NotBlank(message = "表名称不能为空") + private String tableName; + + /** 表描述 */ + @NotBlank(message = "表描述不能为空") + private String tableComment; + + /** 关联父表的表名 */ + private String subTableName; + + /** 本表关联父表的外键名 */ + private String subTableFkName; + + /** 实体类名称(首字母大写) */ + @NotBlank(message = "实体类名称不能为空") + private String className; + + /** 使用的模板(crud单表操作 tree树表操作 sub主子表操作) */ + private String tplCategory; + + /** 生成包路径 */ + @NotBlank(message = "生成包路径不能为空") + private String packageName; + + /** 生成模块名 */ + @NotBlank(message = "生成模块名不能为空") + private String moduleName; + + /** 生成业务名 */ + @NotBlank(message = "生成业务名不能为空") + private String businessName; + + /** 生成功能名 */ + @NotBlank(message = "生成功能名不能为空") + private String functionName; + + /** 生成作者 */ + @NotBlank(message = "作者不能为空") + private String functionAuthor; + + /** 生成代码方式(0zip压缩包 1自定义路径) */ + private String genType; + + /** 生成路径(不填默认项目路径) */ + private String genPath; + + /** 主键信息 */ + private GenTableColumn pkColumn; + + /** 子表信息 */ + private GenTable subTable; + + /** 表列信息 */ + @Valid + private List columns; + + /** 其它生成选项 */ + private String options; + + /** 树编码字段 */ + private String treeCode; + + /** 树父编码字段 */ + private String treeParentCode; + + /** 树名称字段 */ + private String treeName; + + /** 上级菜单ID字段 */ + private String parentMenuId; + + /** 上级菜单名称字段 */ + private String parentMenuName; + + public Long getTableId() + { + return tableId; + } + + public void setTableId(Long tableId) + { + this.tableId = tableId; + } + + public String getTableName() + { + return tableName; + } + + public void setTableName(String tableName) + { + this.tableName = tableName; + } + + public String getTableComment() + { + return tableComment; + } + + public void setTableComment(String tableComment) + { + this.tableComment = tableComment; + } + + public String getSubTableName() + { + return subTableName; + } + + public void setSubTableName(String subTableName) + { + this.subTableName = subTableName; + } + + public String getSubTableFkName() + { + return subTableFkName; + } + + public void setSubTableFkName(String subTableFkName) + { + this.subTableFkName = subTableFkName; + } + + public String getClassName() + { + return className; + } + + public void setClassName(String className) + { + this.className = className; + } + + public String getTplCategory() + { + return tplCategory; + } + + public void setTplCategory(String tplCategory) + { + this.tplCategory = tplCategory; + } + + public String getPackageName() + { + return packageName; + } + + public void setPackageName(String packageName) + { + this.packageName = packageName; + } + + public String getModuleName() + { + return moduleName; + } + + public void setModuleName(String moduleName) + { + this.moduleName = moduleName; + } + + public String getBusinessName() + { + return businessName; + } + + public void setBusinessName(String businessName) + { + this.businessName = businessName; + } + + public String getFunctionName() + { + return functionName; + } + + public void setFunctionName(String functionName) + { + this.functionName = functionName; + } + + public String getFunctionAuthor() + { + return functionAuthor; + } + + public void setFunctionAuthor(String functionAuthor) + { + this.functionAuthor = functionAuthor; + } + + public String getGenType() + { + return genType; + } + + public void setGenType(String genType) + { + this.genType = genType; + } + + public String getGenPath() + { + return genPath; + } + + public void setGenPath(String genPath) + { + this.genPath = genPath; + } + + public GenTableColumn getPkColumn() + { + return pkColumn; + } + + public void setPkColumn(GenTableColumn pkColumn) + { + this.pkColumn = pkColumn; + } + + public GenTable getSubTable() + { + return subTable; + } + + public void setSubTable(GenTable subTable) + { + this.subTable = subTable; + } + + public List getColumns() + { + return columns; + } + + public void setColumns(List columns) + { + this.columns = columns; + } + + public String getOptions() + { + return options; + } + + public void setOptions(String options) + { + this.options = options; + } + + public String getTreeCode() + { + return treeCode; + } + + public void setTreeCode(String treeCode) + { + this.treeCode = treeCode; + } + + public String getTreeParentCode() + { + return treeParentCode; + } + + public void setTreeParentCode(String treeParentCode) + { + this.treeParentCode = treeParentCode; + } + + public String getTreeName() + { + return treeName; + } + + public void setTreeName(String treeName) + { + this.treeName = treeName; + } + + public String getParentMenuId() + { + return parentMenuId; + } + + public void setParentMenuId(String parentMenuId) + { + this.parentMenuId = parentMenuId; + } + + public String getParentMenuName() + { + return parentMenuName; + } + + public void setParentMenuName(String parentMenuName) + { + this.parentMenuName = parentMenuName; + } + + public boolean isSub() + { + return isSub(this.tplCategory); + } + + public static boolean isSub(String tplCategory) + { + return tplCategory != null && StringUtils.equals(GenConstants.TPL_SUB, tplCategory); + } + + public boolean isTree() + { + return isTree(this.tplCategory); + } + + public static boolean isTree(String tplCategory) + { + return tplCategory != null && StringUtils.equals(GenConstants.TPL_TREE, tplCategory); + } + + public boolean isCrud() + { + return isCrud(this.tplCategory); + } + + public static boolean isCrud(String tplCategory) + { + return tplCategory != null && StringUtils.equals(GenConstants.TPL_CRUD, tplCategory); + } + + public boolean isSuperColumn(String javaField) + { + return isSuperColumn(this.tplCategory, javaField); + } + + public static boolean isSuperColumn(String tplCategory, String javaField) + { + if (isTree(tplCategory)) + { + return StringUtils.equalsAnyIgnoreCase(javaField, + ArrayUtils.addAll(GenConstants.TREE_ENTITY, GenConstants.BASE_ENTITY)); + } + return StringUtils.equalsAnyIgnoreCase(javaField, GenConstants.BASE_ENTITY); + } +} \ No newline at end of file diff --git a/ruoyi-generator/src/main/java/com/ruoyi/generator/domain/GenTableColumn.java b/ruoyi-generator/src/main/java/com/ruoyi/generator/domain/GenTableColumn.java new file mode 100644 index 0000000..d59f271 --- /dev/null +++ b/ruoyi-generator/src/main/java/com/ruoyi/generator/domain/GenTableColumn.java @@ -0,0 +1,373 @@ +package com.ruoyi.generator.domain; + +import javax.validation.constraints.NotBlank; +import com.ruoyi.common.core.domain.BaseEntity; +import com.ruoyi.common.utils.StringUtils; + +/** + * 代码生成业务字段表 gen_table_column + * + * @author zhihuiwuliu + */ +public class GenTableColumn extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 编号 */ + private Long columnId; + + /** 归属表编号 */ + private Long tableId; + + /** 列名称 */ + private String columnName; + + /** 列描述 */ + private String columnComment; + + /** 列类型 */ + private String columnType; + + /** JAVA类型 */ + private String javaType; + + /** JAVA字段名 */ + @NotBlank(message = "Java属性不能为空") + private String javaField; + + /** 是否主键(1是) */ + private String isPk; + + /** 是否自增(1是) */ + private String isIncrement; + + /** 是否必填(1是) */ + private String isRequired; + + /** 是否为插入字段(1是) */ + private String isInsert; + + /** 是否编辑字段(1是) */ + private String isEdit; + + /** 是否列表字段(1是) */ + private String isList; + + /** 是否查询字段(1是) */ + private String isQuery; + + /** 查询方式(EQ等于、NE不等于、GT大于、LT小于、LIKE模糊、BETWEEN范围) */ + private String queryType; + + /** 显示类型(input文本框、textarea文本域、select下拉框、checkbox复选框、radio单选框、datetime日期控件、image图片上传控件、upload文件上传控件、editor富文本控件) */ + private String htmlType; + + /** 字典类型 */ + private String dictType; + + /** 排序 */ + private Integer sort; + + public void setColumnId(Long columnId) + { + this.columnId = columnId; + } + + public Long getColumnId() + { + return columnId; + } + + public void setTableId(Long tableId) + { + this.tableId = tableId; + } + + public Long getTableId() + { + return tableId; + } + + public void setColumnName(String columnName) + { + this.columnName = columnName; + } + + public String getColumnName() + { + return columnName; + } + + public void setColumnComment(String columnComment) + { + this.columnComment = columnComment; + } + + public String getColumnComment() + { + return columnComment; + } + + public void setColumnType(String columnType) + { + this.columnType = columnType; + } + + public String getColumnType() + { + return columnType; + } + + public void setJavaType(String javaType) + { + this.javaType = javaType; + } + + public String getJavaType() + { + return javaType; + } + + public void setJavaField(String javaField) + { + this.javaField = javaField; + } + + public String getJavaField() + { + return javaField; + } + + public String getCapJavaField() + { + return StringUtils.capitalize(javaField); + } + + public void setIsPk(String isPk) + { + this.isPk = isPk; + } + + public String getIsPk() + { + return isPk; + } + + public boolean isPk() + { + return isPk(this.isPk); + } + + public boolean isPk(String isPk) + { + return isPk != null && StringUtils.equals("1", isPk); + } + + public String getIsIncrement() + { + return isIncrement; + } + + public void setIsIncrement(String isIncrement) + { + this.isIncrement = isIncrement; + } + + public boolean isIncrement() + { + return isIncrement(this.isIncrement); + } + + public boolean isIncrement(String isIncrement) + { + return isIncrement != null && StringUtils.equals("1", isIncrement); + } + + public void setIsRequired(String isRequired) + { + this.isRequired = isRequired; + } + + public String getIsRequired() + { + return isRequired; + } + + public boolean isRequired() + { + return isRequired(this.isRequired); + } + + public boolean isRequired(String isRequired) + { + return isRequired != null && StringUtils.equals("1", isRequired); + } + + public void setIsInsert(String isInsert) + { + this.isInsert = isInsert; + } + + public String getIsInsert() + { + return isInsert; + } + + public boolean isInsert() + { + return isInsert(this.isInsert); + } + + public boolean isInsert(String isInsert) + { + return isInsert != null && StringUtils.equals("1", isInsert); + } + + public void setIsEdit(String isEdit) + { + this.isEdit = isEdit; + } + + public String getIsEdit() + { + return isEdit; + } + + public boolean isEdit() + { + return isInsert(this.isEdit); + } + + public boolean isEdit(String isEdit) + { + return isEdit != null && StringUtils.equals("1", isEdit); + } + + public void setIsList(String isList) + { + this.isList = isList; + } + + public String getIsList() + { + return isList; + } + + public boolean isList() + { + return isList(this.isList); + } + + public boolean isList(String isList) + { + return isList != null && StringUtils.equals("1", isList); + } + + public void setIsQuery(String isQuery) + { + this.isQuery = isQuery; + } + + public String getIsQuery() + { + return isQuery; + } + + public boolean isQuery() + { + return isQuery(this.isQuery); + } + + public boolean isQuery(String isQuery) + { + return isQuery != null && StringUtils.equals("1", isQuery); + } + + public void setQueryType(String queryType) + { + this.queryType = queryType; + } + + public String getQueryType() + { + return queryType; + } + + public String getHtmlType() + { + return htmlType; + } + + public void setHtmlType(String htmlType) + { + this.htmlType = htmlType; + } + + public void setDictType(String dictType) + { + this.dictType = dictType; + } + + public String getDictType() + { + return dictType; + } + + public void setSort(Integer sort) + { + this.sort = sort; + } + + public Integer getSort() + { + return sort; + } + + public boolean isSuperColumn() + { + return isSuperColumn(this.javaField); + } + + public static boolean isSuperColumn(String javaField) + { + return StringUtils.equalsAnyIgnoreCase(javaField, + // BaseEntity + "createBy", "createTime", "updateBy", "updateTime", "remark", + // TreeEntity + "parentName", "parentId", "orderNum", "ancestors"); + } + + public boolean isUsableColumn() + { + return isUsableColumn(javaField); + } + + public static boolean isUsableColumn(String javaField) + { + // isSuperColumn()中的名单用于避免生成多余Domain属性,若某些属性在生成页面时需要用到不能忽略,则放在此处白名单 + return StringUtils.equalsAnyIgnoreCase(javaField, "parentId", "orderNum", "remark"); + } + + public String readConverterExp() + { + String remarks = StringUtils.substringBetween(this.columnComment, "(", ")"); + StringBuffer sb = new StringBuffer(); + if (StringUtils.isNotEmpty(remarks)) + { + for (String value : remarks.split(" ")) + { + if (StringUtils.isNotEmpty(value)) + { + Object startStr = value.subSequence(0, 1); + String endStr = value.substring(1); + sb.append("").append(startStr).append("=").append(endStr).append(","); + } + } + return sb.deleteCharAt(sb.length() - 1).toString(); + } + else + { + return this.columnComment; + } + } +} diff --git a/ruoyi-generator/src/main/java/com/ruoyi/generator/mapper/GenTableColumnMapper.java b/ruoyi-generator/src/main/java/com/ruoyi/generator/mapper/GenTableColumnMapper.java new file mode 100644 index 0000000..f9d506a --- /dev/null +++ b/ruoyi-generator/src/main/java/com/ruoyi/generator/mapper/GenTableColumnMapper.java @@ -0,0 +1,60 @@ +package com.ruoyi.generator.mapper; + +import java.util.List; +import com.ruoyi.generator.domain.GenTableColumn; + +/** + * 业务字段 数据层 + * + * @author zhihuiwuliu + */ +public interface GenTableColumnMapper +{ + /** + * 根据表名称查询列信息 + * + * @param tableName 表名称 + * @return 列信息 + */ + public List selectDbTableColumnsByName(String tableName); + + /** + * 查询业务字段列表 + * + * @param tableId 业务字段编号 + * @return 业务字段集合 + */ + public List selectGenTableColumnListByTableId(Long tableId); + + /** + * 新增业务字段 + * + * @param genTableColumn 业务字段信息 + * @return 结果 + */ + public int insertGenTableColumn(GenTableColumn genTableColumn); + + /** + * 修改业务字段 + * + * @param genTableColumn 业务字段信息 + * @return 结果 + */ + public int updateGenTableColumn(GenTableColumn genTableColumn); + + /** + * 删除业务字段 + * + * @param genTableColumns 列数据 + * @return 结果 + */ + public int deleteGenTableColumns(List genTableColumns); + + /** + * 批量删除业务字段 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteGenTableColumnByIds(Long[] ids); +} diff --git a/ruoyi-generator/src/main/java/com/ruoyi/generator/mapper/GenTableMapper.java b/ruoyi-generator/src/main/java/com/ruoyi/generator/mapper/GenTableMapper.java new file mode 100644 index 0000000..c0197d3 --- /dev/null +++ b/ruoyi-generator/src/main/java/com/ruoyi/generator/mapper/GenTableMapper.java @@ -0,0 +1,83 @@ +package com.ruoyi.generator.mapper; + +import java.util.List; +import com.ruoyi.generator.domain.GenTable; + +/** + * 业务 数据层 + * + * @author zhihuiwuliu + */ +public interface GenTableMapper +{ + /** + * 查询业务列表 + * + * @param genTable 业务信息 + * @return 业务集合 + */ + public List selectGenTableList(GenTable genTable); + + /** + * 查询据库列表 + * + * @param genTable 业务信息 + * @return 数据库表集合 + */ + public List selectDbTableList(GenTable genTable); + + /** + * 查询据库列表 + * + * @param tableNames 表名称组 + * @return 数据库表集合 + */ + public List selectDbTableListByNames(String[] tableNames); + + /** + * 查询所有表信息 + * + * @return 表信息集合 + */ + public List selectGenTableAll(); + + /** + * 查询表ID业务信息 + * + * @param id 业务ID + * @return 业务信息 + */ + public GenTable selectGenTableById(Long id); + + /** + * 查询表名称业务信息 + * + * @param tableName 表名称 + * @return 业务信息 + */ + public GenTable selectGenTableByName(String tableName); + + /** + * 新增业务 + * + * @param genTable 业务信息 + * @return 结果 + */ + public int insertGenTable(GenTable genTable); + + /** + * 修改业务 + * + * @param genTable 业务信息 + * @return 结果 + */ + public int updateGenTable(GenTable genTable); + + /** + * 批量删除业务 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteGenTableByIds(Long[] ids); +} diff --git a/ruoyi-generator/src/main/java/com/ruoyi/generator/service/GenTableColumnServiceImpl.java b/ruoyi-generator/src/main/java/com/ruoyi/generator/service/GenTableColumnServiceImpl.java new file mode 100644 index 0000000..633d71f --- /dev/null +++ b/ruoyi-generator/src/main/java/com/ruoyi/generator/service/GenTableColumnServiceImpl.java @@ -0,0 +1,68 @@ +package com.ruoyi.generator.service; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.common.core.text.Convert; +import com.ruoyi.generator.domain.GenTableColumn; +import com.ruoyi.generator.mapper.GenTableColumnMapper; + +/** + * 业务字段 服务层实现 + * + * @author zhihuiwuliu + */ +@Service +public class GenTableColumnServiceImpl implements IGenTableColumnService +{ + @Autowired + private GenTableColumnMapper genTableColumnMapper; + + /** + * 查询业务字段列表 + * + * @param tableId 业务字段编号 + * @return 业务字段集合 + */ + @Override + public List selectGenTableColumnListByTableId(Long tableId) + { + return genTableColumnMapper.selectGenTableColumnListByTableId(tableId); + } + + /** + * 新增业务字段 + * + * @param genTableColumn 业务字段信息 + * @return 结果 + */ + @Override + public int insertGenTableColumn(GenTableColumn genTableColumn) + { + return genTableColumnMapper.insertGenTableColumn(genTableColumn); + } + + /** + * 修改业务字段 + * + * @param genTableColumn 业务字段信息 + * @return 结果 + */ + @Override + public int updateGenTableColumn(GenTableColumn genTableColumn) + { + return genTableColumnMapper.updateGenTableColumn(genTableColumn); + } + + /** + * 删除业务字段对象 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + @Override + public int deleteGenTableColumnByIds(String ids) + { + return genTableColumnMapper.deleteGenTableColumnByIds(Convert.toLongArray(ids)); + } +} diff --git a/ruoyi-generator/src/main/java/com/ruoyi/generator/service/GenTableServiceImpl.java b/ruoyi-generator/src/main/java/com/ruoyi/generator/service/GenTableServiceImpl.java new file mode 100644 index 0000000..b6958ee --- /dev/null +++ b/ruoyi-generator/src/main/java/com/ruoyi/generator/service/GenTableServiceImpl.java @@ -0,0 +1,521 @@ +package com.ruoyi.generator.service; + +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.IOException; +import java.io.StringWriter; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.zip.ZipEntry; +import java.util.zip.ZipOutputStream; +import org.apache.commons.io.FileUtils; +import org.apache.commons.io.IOUtils; +import org.apache.velocity.Template; +import org.apache.velocity.VelocityContext; +import org.apache.velocity.app.Velocity; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import com.alibaba.fastjson2.JSON; +import com.alibaba.fastjson2.JSONObject; +import com.ruoyi.common.constant.Constants; +import com.ruoyi.common.constant.GenConstants; +import com.ruoyi.common.core.text.CharsetKit; +import com.ruoyi.common.exception.ServiceException; +import com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.generator.domain.GenTable; +import com.ruoyi.generator.domain.GenTableColumn; +import com.ruoyi.generator.mapper.GenTableColumnMapper; +import com.ruoyi.generator.mapper.GenTableMapper; +import com.ruoyi.generator.util.GenUtils; +import com.ruoyi.generator.util.VelocityInitializer; +import com.ruoyi.generator.util.VelocityUtils; + +/** + * 业务 服务层实现 + * + * @author zhihuiwuliu + */ +@Service +public class GenTableServiceImpl implements IGenTableService +{ + private static final Logger log = LoggerFactory.getLogger(GenTableServiceImpl.class); + + @Autowired + private GenTableMapper genTableMapper; + + @Autowired + private GenTableColumnMapper genTableColumnMapper; + + /** + * 查询业务信息 + * + * @param id 业务ID + * @return 业务信息 + */ + @Override + public GenTable selectGenTableById(Long id) + { + GenTable genTable = genTableMapper.selectGenTableById(id); + setTableFromOptions(genTable); + return genTable; + } + + /** + * 查询业务列表 + * + * @param genTable 业务信息 + * @return 业务集合 + */ + @Override + public List selectGenTableList(GenTable genTable) + { + return genTableMapper.selectGenTableList(genTable); + } + + /** + * 查询据库列表 + * + * @param genTable 业务信息 + * @return 数据库表集合 + */ + @Override + public List selectDbTableList(GenTable genTable) + { + return genTableMapper.selectDbTableList(genTable); + } + + /** + * 查询据库列表 + * + * @param tableNames 表名称组 + * @return 数据库表集合 + */ + @Override + public List selectDbTableListByNames(String[] tableNames) + { + return genTableMapper.selectDbTableListByNames(tableNames); + } + + /** + * 查询所有表信息 + * + * @return 表信息集合 + */ + @Override + public List selectGenTableAll() + { + return genTableMapper.selectGenTableAll(); + } + + /** + * 修改业务 + * + * @param genTable 业务信息 + * @return 结果 + */ + @Override + @Transactional + public void updateGenTable(GenTable genTable) + { + String options = JSON.toJSONString(genTable.getParams()); + genTable.setOptions(options); + int row = genTableMapper.updateGenTable(genTable); + if (row > 0) + { + for (GenTableColumn cenTableColumn : genTable.getColumns()) + { + genTableColumnMapper.updateGenTableColumn(cenTableColumn); + } + } + } + + /** + * 删除业务对象 + * + * @param tableIds 需要删除的数据ID + * @return 结果 + */ + @Override + @Transactional + public void deleteGenTableByIds(Long[] tableIds) + { + genTableMapper.deleteGenTableByIds(tableIds); + genTableColumnMapper.deleteGenTableColumnByIds(tableIds); + } + + /** + * 导入表结构 + * + * @param tableList 导入表列表 + */ + @Override + @Transactional + public void importGenTable(List tableList) + { + String operName = SecurityUtils.getUsername(); + try + { + for (GenTable table : tableList) + { + String tableName = table.getTableName(); + GenUtils.initTable(table, operName); + int row = genTableMapper.insertGenTable(table); + if (row > 0) + { + // 保存列信息 + List genTableColumns = genTableColumnMapper.selectDbTableColumnsByName(tableName); + for (GenTableColumn column : genTableColumns) + { + GenUtils.initColumnField(column, table); + genTableColumnMapper.insertGenTableColumn(column); + } + } + } + } + catch (Exception e) + { + throw new ServiceException("导入失败:" + e.getMessage()); + } + } + + /** + * 预览代码 + * + * @param tableId 表编号 + * @return 预览数据列表 + */ + @Override + public Map previewCode(Long tableId) + { + Map dataMap = new LinkedHashMap<>(); + // 查询表信息 + GenTable table = genTableMapper.selectGenTableById(tableId); + // 设置主子表信息 + setSubTable(table); + // 设置主键列信息 + setPkColumn(table); + VelocityInitializer.initVelocity(); + + VelocityContext context = VelocityUtils.prepareContext(table); + + // 获取模板列表 + List templates = VelocityUtils.getTemplateList(table.getTplCategory()); + for (String template : templates) + { + // 渲染模板 + StringWriter sw = new StringWriter(); + Template tpl = Velocity.getTemplate(template, Constants.UTF8); + tpl.merge(context, sw); + dataMap.put(template, sw.toString()); + } + return dataMap; + } + + /** + * 生成代码(下载方式) + * + * @param tableName 表名称 + * @return 数据 + */ + @Override + public byte[] downloadCode(String tableName) + { + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + ZipOutputStream zip = new ZipOutputStream(outputStream); + generatorCode(tableName, zip); + IOUtils.closeQuietly(zip); + return outputStream.toByteArray(); + } + + /** + * 生成代码(自定义路径) + * + * @param tableName 表名称 + */ + @Override + public void generatorCode(String tableName) + { + // 查询表信息 + GenTable table = genTableMapper.selectGenTableByName(tableName); + // 设置主子表信息 + setSubTable(table); + // 设置主键列信息 + setPkColumn(table); + + VelocityInitializer.initVelocity(); + + VelocityContext context = VelocityUtils.prepareContext(table); + + // 获取模板列表 + List templates = VelocityUtils.getTemplateList(table.getTplCategory()); + for (String template : templates) + { + if (!StringUtils.containsAny(template, "sql.vm", "api.js.vm", "index.vue.vm", "index-tree.vue.vm")) + { + // 渲染模板 + StringWriter sw = new StringWriter(); + Template tpl = Velocity.getTemplate(template, Constants.UTF8); + tpl.merge(context, sw); + try + { + String path = getGenPath(table, template); + FileUtils.writeStringToFile(new File(path), sw.toString(), CharsetKit.UTF_8); + } + catch (IOException e) + { + throw new ServiceException("渲染模板失败,表名:" + table.getTableName()); + } + } + } + } + + /** + * 同步数据库 + * + * @param tableName 表名称 + */ + @Override + @Transactional + public void synchDb(String tableName) + { + GenTable table = genTableMapper.selectGenTableByName(tableName); + List tableColumns = table.getColumns(); + Map tableColumnMap = tableColumns.stream().collect(Collectors.toMap(GenTableColumn::getColumnName, Function.identity())); + + List dbTableColumns = genTableColumnMapper.selectDbTableColumnsByName(tableName); + if (StringUtils.isEmpty(dbTableColumns)) + { + throw new ServiceException("同步数据失败,原表结构不存在"); + } + List dbTableColumnNames = dbTableColumns.stream().map(GenTableColumn::getColumnName).collect(Collectors.toList()); + + dbTableColumns.forEach(column -> { + GenUtils.initColumnField(column, table); + if (tableColumnMap.containsKey(column.getColumnName())) + { + GenTableColumn prevColumn = tableColumnMap.get(column.getColumnName()); + column.setColumnId(prevColumn.getColumnId()); + if (column.isList()) + { + // 如果是列表,继续保留查询方式/字典类型选项 + column.setDictType(prevColumn.getDictType()); + column.setQueryType(prevColumn.getQueryType()); + } + if (StringUtils.isNotEmpty(prevColumn.getIsRequired()) && !column.isPk() + && (column.isInsert() || column.isEdit()) + && ((column.isUsableColumn()) || (!column.isSuperColumn()))) + { + // 如果是(新增/修改&非主键/非忽略及父属性),继续保留必填/显示类型选项 + column.setIsRequired(prevColumn.getIsRequired()); + column.setHtmlType(prevColumn.getHtmlType()); + } + genTableColumnMapper.updateGenTableColumn(column); + } + else + { + genTableColumnMapper.insertGenTableColumn(column); + } + }); + + List delColumns = tableColumns.stream().filter(column -> !dbTableColumnNames.contains(column.getColumnName())).collect(Collectors.toList()); + if (StringUtils.isNotEmpty(delColumns)) + { + genTableColumnMapper.deleteGenTableColumns(delColumns); + } + } + + /** + * 批量生成代码(下载方式) + * + * @param tableNames 表数组 + * @return 数据 + */ + @Override + public byte[] downloadCode(String[] tableNames) + { + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + ZipOutputStream zip = new ZipOutputStream(outputStream); + for (String tableName : tableNames) + { + generatorCode(tableName, zip); + } + IOUtils.closeQuietly(zip); + return outputStream.toByteArray(); + } + + /** + * 查询表信息并生成代码 + */ + private void generatorCode(String tableName, ZipOutputStream zip) + { + // 查询表信息 + GenTable table = genTableMapper.selectGenTableByName(tableName); + // 设置主子表信息 + setSubTable(table); + // 设置主键列信息 + setPkColumn(table); + + VelocityInitializer.initVelocity(); + + VelocityContext context = VelocityUtils.prepareContext(table); + + // 获取模板列表 + List templates = VelocityUtils.getTemplateList(table.getTplCategory()); + for (String template : templates) + { + // 渲染模板 + StringWriter sw = new StringWriter(); + Template tpl = Velocity.getTemplate(template, Constants.UTF8); + tpl.merge(context, sw); + try + { + // 添加到zip + zip.putNextEntry(new ZipEntry(VelocityUtils.getFileName(template, table))); + IOUtils.write(sw.toString(), zip, Constants.UTF8); + IOUtils.closeQuietly(sw); + zip.flush(); + zip.closeEntry(); + } + catch (IOException e) + { + log.error("渲染模板失败,表名:" + table.getTableName(), e); + } + } + } + + /** + * 修改保存参数校验 + * + * @param genTable 业务信息 + */ + @Override + public void validateEdit(GenTable genTable) + { + if (GenConstants.TPL_TREE.equals(genTable.getTplCategory())) + { + String options = JSON.toJSONString(genTable.getParams()); + JSONObject paramsObj = JSON.parseObject(options); + if (StringUtils.isEmpty(paramsObj.getString(GenConstants.TREE_CODE))) + { + throw new ServiceException("树编码字段不能为空"); + } + else if (StringUtils.isEmpty(paramsObj.getString(GenConstants.TREE_PARENT_CODE))) + { + throw new ServiceException("树父编码字段不能为空"); + } + else if (StringUtils.isEmpty(paramsObj.getString(GenConstants.TREE_NAME))) + { + throw new ServiceException("树名称字段不能为空"); + } + else if (GenConstants.TPL_SUB.equals(genTable.getTplCategory())) + { + if (StringUtils.isEmpty(genTable.getSubTableName())) + { + throw new ServiceException("关联子表的表名不能为空"); + } + else if (StringUtils.isEmpty(genTable.getSubTableFkName())) + { + throw new ServiceException("子表关联的外键名不能为空"); + } + } + } + } + + /** + * 设置主键列信息 + * + * @param table 业务表信息 + */ + public void setPkColumn(GenTable table) + { + for (GenTableColumn column : table.getColumns()) + { + if (column.isPk()) + { + table.setPkColumn(column); + break; + } + } + if (StringUtils.isNull(table.getPkColumn())) + { + table.setPkColumn(table.getColumns().get(0)); + } + if (GenConstants.TPL_SUB.equals(table.getTplCategory())) + { + for (GenTableColumn column : table.getSubTable().getColumns()) + { + if (column.isPk()) + { + table.getSubTable().setPkColumn(column); + break; + } + } + if (StringUtils.isNull(table.getSubTable().getPkColumn())) + { + table.getSubTable().setPkColumn(table.getSubTable().getColumns().get(0)); + } + } + } + + /** + * 设置主子表信息 + * + * @param table 业务表信息 + */ + public void setSubTable(GenTable table) + { + String subTableName = table.getSubTableName(); + if (StringUtils.isNotEmpty(subTableName)) + { + table.setSubTable(genTableMapper.selectGenTableByName(subTableName)); + } + } + + /** + * 设置代码生成其他选项值 + * + * @param genTable 设置后的生成对象 + */ + public void setTableFromOptions(GenTable genTable) + { + JSONObject paramsObj = JSON.parseObject(genTable.getOptions()); + if (StringUtils.isNotNull(paramsObj)) + { + String treeCode = paramsObj.getString(GenConstants.TREE_CODE); + String treeParentCode = paramsObj.getString(GenConstants.TREE_PARENT_CODE); + String treeName = paramsObj.getString(GenConstants.TREE_NAME); + String parentMenuId = paramsObj.getString(GenConstants.PARENT_MENU_ID); + String parentMenuName = paramsObj.getString(GenConstants.PARENT_MENU_NAME); + + genTable.setTreeCode(treeCode); + genTable.setTreeParentCode(treeParentCode); + genTable.setTreeName(treeName); + genTable.setParentMenuId(parentMenuId); + genTable.setParentMenuName(parentMenuName); + } + } + + /** + * 获取代码生成地址 + * + * @param table 业务表信息 + * @param template 模板文件路径 + * @return 生成地址 + */ + public static String getGenPath(GenTable table, String template) + { + String genPath = table.getGenPath(); + if (StringUtils.equals(genPath, "/")) + { + return System.getProperty("user.dir") + File.separator + "src" + File.separator + VelocityUtils.getFileName(template, table); + } + return genPath + File.separator + VelocityUtils.getFileName(template, table); + } +} \ No newline at end of file diff --git a/ruoyi-generator/src/main/java/com/ruoyi/generator/service/IGenTableColumnService.java b/ruoyi-generator/src/main/java/com/ruoyi/generator/service/IGenTableColumnService.java new file mode 100644 index 0000000..0f4ff3c --- /dev/null +++ b/ruoyi-generator/src/main/java/com/ruoyi/generator/service/IGenTableColumnService.java @@ -0,0 +1,44 @@ +package com.ruoyi.generator.service; + +import java.util.List; +import com.ruoyi.generator.domain.GenTableColumn; + +/** + * 业务字段 服务层 + * + * @author zhihuiwuliu + */ +public interface IGenTableColumnService +{ + /** + * 查询业务字段列表 + * + * @param tableId 业务字段编号 + * @return 业务字段集合 + */ + public List selectGenTableColumnListByTableId(Long tableId); + + /** + * 新增业务字段 + * + * @param genTableColumn 业务字段信息 + * @return 结果 + */ + public int insertGenTableColumn(GenTableColumn genTableColumn); + + /** + * 修改业务字段 + * + * @param genTableColumn 业务字段信息 + * @return 结果 + */ + public int updateGenTableColumn(GenTableColumn genTableColumn); + + /** + * 删除业务字段信息 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteGenTableColumnByIds(String ids); +} diff --git a/ruoyi-generator/src/main/java/com/ruoyi/generator/service/IGenTableService.java b/ruoyi-generator/src/main/java/com/ruoyi/generator/service/IGenTableService.java new file mode 100644 index 0000000..0e4d02d --- /dev/null +++ b/ruoyi-generator/src/main/java/com/ruoyi/generator/service/IGenTableService.java @@ -0,0 +1,121 @@ +package com.ruoyi.generator.service; + +import java.util.List; +import java.util.Map; +import com.ruoyi.generator.domain.GenTable; + +/** + * 业务 服务层 + * + * @author zhihuiwuliu + */ +public interface IGenTableService +{ + /** + * 查询业务列表 + * + * @param genTable 业务信息 + * @return 业务集合 + */ + public List selectGenTableList(GenTable genTable); + + /** + * 查询据库列表 + * + * @param genTable 业务信息 + * @return 数据库表集合 + */ + public List selectDbTableList(GenTable genTable); + + /** + * 查询据库列表 + * + * @param tableNames 表名称组 + * @return 数据库表集合 + */ + public List selectDbTableListByNames(String[] tableNames); + + /** + * 查询所有表信息 + * + * @return 表信息集合 + */ + public List selectGenTableAll(); + + /** + * 查询业务信息 + * + * @param id 业务ID + * @return 业务信息 + */ + public GenTable selectGenTableById(Long id); + + /** + * 修改业务 + * + * @param genTable 业务信息 + * @return 结果 + */ + public void updateGenTable(GenTable genTable); + + /** + * 删除业务信息 + * + * @param tableIds 需要删除的表数据ID + * @return 结果 + */ + public void deleteGenTableByIds(Long[] tableIds); + + /** + * 导入表结构 + * + * @param tableList 导入表列表 + */ + public void importGenTable(List tableList); + + /** + * 预览代码 + * + * @param tableId 表编号 + * @return 预览数据列表 + */ + public Map previewCode(Long tableId); + + /** + * 生成代码(下载方式) + * + * @param tableName 表名称 + * @return 数据 + */ + public byte[] downloadCode(String tableName); + + /** + * 生成代码(自定义路径) + * + * @param tableName 表名称 + * @return 数据 + */ + public void generatorCode(String tableName); + + /** + * 同步数据库 + * + * @param tableName 表名称 + */ + public void synchDb(String tableName); + + /** + * 批量生成代码(下载方式) + * + * @param tableNames 表数组 + * @return 数据 + */ + public byte[] downloadCode(String[] tableNames); + + /** + * 修改保存参数校验 + * + * @param genTable 业务信息 + */ + public void validateEdit(GenTable genTable); +} diff --git a/ruoyi-generator/src/main/java/com/ruoyi/generator/util/GenUtils.java b/ruoyi-generator/src/main/java/com/ruoyi/generator/util/GenUtils.java new file mode 100644 index 0000000..e5edcee --- /dev/null +++ b/ruoyi-generator/src/main/java/com/ruoyi/generator/util/GenUtils.java @@ -0,0 +1,257 @@ +package com.ruoyi.generator.util; + +import java.util.Arrays; +import org.apache.commons.lang3.RegExUtils; +import com.ruoyi.common.constant.GenConstants; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.generator.config.GenConfig; +import com.ruoyi.generator.domain.GenTable; +import com.ruoyi.generator.domain.GenTableColumn; + +/** + * 代码生成器 工具类 + * + * @author zhihuiwuliu + */ +public class GenUtils +{ + /** + * 初始化表信息 + */ + public static void initTable(GenTable genTable, String operName) + { + genTable.setClassName(convertClassName(genTable.getTableName())); + genTable.setPackageName(GenConfig.getPackageName()); + genTable.setModuleName(getModuleName(GenConfig.getPackageName())); + genTable.setBusinessName(getBusinessName(genTable.getTableName())); + genTable.setFunctionName(replaceText(genTable.getTableComment())); + genTable.setFunctionAuthor(GenConfig.getAuthor()); + genTable.setCreateBy(operName); + } + + /** + * 初始化列属性字段 + */ + public static void initColumnField(GenTableColumn column, GenTable table) + { + String dataType = getDbType(column.getColumnType()); + String columnName = column.getColumnName(); + column.setTableId(table.getTableId()); + column.setCreateBy(table.getCreateBy()); + // 设置java字段名 + column.setJavaField(StringUtils.toCamelCase(columnName)); + // 设置默认类型 + column.setJavaType(GenConstants.TYPE_STRING); + column.setQueryType(GenConstants.QUERY_EQ); + + if (arraysContains(GenConstants.COLUMNTYPE_STR, dataType) || arraysContains(GenConstants.COLUMNTYPE_TEXT, dataType)) + { + // 字符串长度超过500设置为文本域 + Integer columnLength = getColumnLength(column.getColumnType()); + String htmlType = columnLength >= 500 || arraysContains(GenConstants.COLUMNTYPE_TEXT, dataType) ? GenConstants.HTML_TEXTAREA : GenConstants.HTML_INPUT; + column.setHtmlType(htmlType); + } + else if (arraysContains(GenConstants.COLUMNTYPE_TIME, dataType)) + { + column.setJavaType(GenConstants.TYPE_DATE); + column.setHtmlType(GenConstants.HTML_DATETIME); + } + else if (arraysContains(GenConstants.COLUMNTYPE_NUMBER, dataType)) + { + column.setHtmlType(GenConstants.HTML_INPUT); + + // 如果是浮点型 统一用BigDecimal + String[] str = StringUtils.split(StringUtils.substringBetween(column.getColumnType(), "(", ")"), ","); + if (str != null && str.length == 2 && Integer.parseInt(str[1]) > 0) + { + column.setJavaType(GenConstants.TYPE_BIGDECIMAL); + } + // 如果是整形 + else if (str != null && str.length == 1 && Integer.parseInt(str[0]) <= 10) + { + column.setJavaType(GenConstants.TYPE_INTEGER); + } + // 长整形 + else + { + column.setJavaType(GenConstants.TYPE_LONG); + } + } + + // 插入字段(默认所有字段都需要插入) + column.setIsInsert(GenConstants.REQUIRE); + + // 编辑字段 + if (!arraysContains(GenConstants.COLUMNNAME_NOT_EDIT, columnName) && !column.isPk()) + { + column.setIsEdit(GenConstants.REQUIRE); + } + // 列表字段 + if (!arraysContains(GenConstants.COLUMNNAME_NOT_LIST, columnName) && !column.isPk()) + { + column.setIsList(GenConstants.REQUIRE); + } + // 查询字段 + if (!arraysContains(GenConstants.COLUMNNAME_NOT_QUERY, columnName) && !column.isPk()) + { + column.setIsQuery(GenConstants.REQUIRE); + } + + // 查询字段类型 + if (StringUtils.endsWithIgnoreCase(columnName, "name")) + { + column.setQueryType(GenConstants.QUERY_LIKE); + } + // 状态字段设置单选框 + if (StringUtils.endsWithIgnoreCase(columnName, "status")) + { + column.setHtmlType(GenConstants.HTML_RADIO); + } + // 类型&性别字段设置下拉框 + else if (StringUtils.endsWithIgnoreCase(columnName, "type") + || StringUtils.endsWithIgnoreCase(columnName, "sex")) + { + column.setHtmlType(GenConstants.HTML_SELECT); + } + // 图片字段设置图片上传控件 + else if (StringUtils.endsWithIgnoreCase(columnName, "image")) + { + column.setHtmlType(GenConstants.HTML_IMAGE_UPLOAD); + } + // 文件字段设置文件上传控件 + else if (StringUtils.endsWithIgnoreCase(columnName, "file")) + { + column.setHtmlType(GenConstants.HTML_FILE_UPLOAD); + } + // 内容字段设置富文本控件 + else if (StringUtils.endsWithIgnoreCase(columnName, "content")) + { + column.setHtmlType(GenConstants.HTML_EDITOR); + } + } + + /** + * 校验数组是否包含指定值 + * + * @param arr 数组 + * @param targetValue 值 + * @return 是否包含 + */ + public static boolean arraysContains(String[] arr, String targetValue) + { + return Arrays.asList(arr).contains(targetValue); + } + + /** + * 获取模块名 + * + * @param packageName 包名 + * @return 模块名 + */ + public static String getModuleName(String packageName) + { + int lastIndex = packageName.lastIndexOf("."); + int nameLength = packageName.length(); + return StringUtils.substring(packageName, lastIndex + 1, nameLength); + } + + /** + * 获取业务名 + * + * @param tableName 表名 + * @return 业务名 + */ + public static String getBusinessName(String tableName) + { + int lastIndex = tableName.lastIndexOf("_"); + int nameLength = tableName.length(); + return StringUtils.substring(tableName, lastIndex + 1, nameLength); + } + + /** + * 表名转换成Java类名 + * + * @param tableName 表名称 + * @return 类名 + */ + public static String convertClassName(String tableName) + { + boolean autoRemovePre = GenConfig.getAutoRemovePre(); + String tablePrefix = GenConfig.getTablePrefix(); + if (autoRemovePre && StringUtils.isNotEmpty(tablePrefix)) + { + String[] searchList = StringUtils.split(tablePrefix, ","); + tableName = replaceFirst(tableName, searchList); + } + return StringUtils.convertToCamelCase(tableName); + } + + /** + * 批量替换前缀 + * + * @param replacementm 替换值 + * @param searchList 替换列表 + * @return + */ + public static String replaceFirst(String replacementm, String[] searchList) + { + String text = replacementm; + for (String searchString : searchList) + { + if (replacementm.startsWith(searchString)) + { + text = replacementm.replaceFirst(searchString, ""); + break; + } + } + return text; + } + + /** + * 关键字替换 + * + * @param text 需要被替换的名字 + * @return 替换后的名字 + */ + public static String replaceText(String text) + { + return RegExUtils.replaceAll(text, "(?:表|智慧物流数据中心)", ""); + } + + /** + * 获取数据库类型字段 + * + * @param columnType 列类型 + * @return 截取后的列类型 + */ + public static String getDbType(String columnType) + { + if (StringUtils.indexOf(columnType, "(") > 0) + { + return StringUtils.substringBefore(columnType, "("); + } + else + { + return columnType; + } + } + + /** + * 获取字段长度 + * + * @param columnType 列类型 + * @return 截取后的列类型 + */ + public static Integer getColumnLength(String columnType) + { + if (StringUtils.indexOf(columnType, "(") > 0) + { + String length = StringUtils.substringBetween(columnType, "(", ")"); + return Integer.valueOf(length); + } + else + { + return 0; + } + } +} diff --git a/ruoyi-generator/src/main/java/com/ruoyi/generator/util/VelocityInitializer.java b/ruoyi-generator/src/main/java/com/ruoyi/generator/util/VelocityInitializer.java new file mode 100644 index 0000000..f9a7852 --- /dev/null +++ b/ruoyi-generator/src/main/java/com/ruoyi/generator/util/VelocityInitializer.java @@ -0,0 +1,34 @@ +package com.ruoyi.generator.util; + +import java.util.Properties; +import org.apache.velocity.app.Velocity; +import com.ruoyi.common.constant.Constants; + +/** + * VelocityEngine工厂 + * + * @author zhihuiwuliu + */ +public class VelocityInitializer +{ + /** + * 初始化vm方法 + */ + public static void initVelocity() + { + Properties p = new Properties(); + try + { + // 加载classpath目录下的vm文件 + p.setProperty("resource.loader.file.class", "org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader"); + // 定义字符集 + p.setProperty(Velocity.INPUT_ENCODING, Constants.UTF8); + // 初始化Velocity引擎,指定配置Properties + Velocity.init(p); + } + catch (Exception e) + { + throw new RuntimeException(e); + } + } +} diff --git a/ruoyi-generator/src/main/java/com/ruoyi/generator/util/VelocityUtils.java b/ruoyi-generator/src/main/java/com/ruoyi/generator/util/VelocityUtils.java new file mode 100644 index 0000000..9488e72 --- /dev/null +++ b/ruoyi-generator/src/main/java/com/ruoyi/generator/util/VelocityUtils.java @@ -0,0 +1,402 @@ +package com.ruoyi.generator.util; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import org.apache.velocity.VelocityContext; +import com.alibaba.fastjson2.JSON; +import com.alibaba.fastjson2.JSONObject; +import com.ruoyi.common.constant.GenConstants; +import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.generator.domain.GenTable; +import com.ruoyi.generator.domain.GenTableColumn; + +/** + * 模板处理工具类 + * + * @author zhihuiwuliu + */ +public class VelocityUtils +{ + /** 项目空间路径 */ + private static final String PROJECT_PATH = "main/java"; + + /** mybatis空间路径 */ + private static final String MYBATIS_PATH = "main/resources/mapper"; + + /** 默认上级菜单,系统工具 */ + private static final String DEFAULT_PARENT_MENU_ID = "3"; + + /** + * 设置模板变量信息 + * + * @return 模板列表 + */ + public static VelocityContext prepareContext(GenTable genTable) + { + String moduleName = genTable.getModuleName(); + String businessName = genTable.getBusinessName(); + String packageName = genTable.getPackageName(); + String tplCategory = genTable.getTplCategory(); + String functionName = genTable.getFunctionName(); + + VelocityContext velocityContext = new VelocityContext(); + velocityContext.put("tplCategory", genTable.getTplCategory()); + velocityContext.put("tableName", genTable.getTableName()); + velocityContext.put("functionName", StringUtils.isNotEmpty(functionName) ? functionName : "【请填写功能名称】"); + velocityContext.put("ClassName", genTable.getClassName()); + velocityContext.put("className", StringUtils.uncapitalize(genTable.getClassName())); + velocityContext.put("moduleName", genTable.getModuleName()); + velocityContext.put("BusinessName", StringUtils.capitalize(genTable.getBusinessName())); + velocityContext.put("businessName", genTable.getBusinessName()); + velocityContext.put("basePackage", getPackagePrefix(packageName)); + velocityContext.put("packageName", packageName); + velocityContext.put("author", genTable.getFunctionAuthor()); + velocityContext.put("datetime", DateUtils.getDate()); + velocityContext.put("pkColumn", genTable.getPkColumn()); + velocityContext.put("importList", getImportList(genTable)); + velocityContext.put("permissionPrefix", getPermissionPrefix(moduleName, businessName)); + velocityContext.put("columns", genTable.getColumns()); + velocityContext.put("table", genTable); + velocityContext.put("dicts", getDicts(genTable)); + setMenuVelocityContext(velocityContext, genTable); + if (GenConstants.TPL_TREE.equals(tplCategory)) + { + setTreeVelocityContext(velocityContext, genTable); + } + if (GenConstants.TPL_SUB.equals(tplCategory)) + { + setSubVelocityContext(velocityContext, genTable); + } + return velocityContext; + } + + public static void setMenuVelocityContext(VelocityContext context, GenTable genTable) + { + String options = genTable.getOptions(); + JSONObject paramsObj = JSON.parseObject(options); + String parentMenuId = getParentMenuId(paramsObj); + context.put("parentMenuId", parentMenuId); + } + + public static void setTreeVelocityContext(VelocityContext context, GenTable genTable) + { + String options = genTable.getOptions(); + JSONObject paramsObj = JSON.parseObject(options); + String treeCode = getTreecode(paramsObj); + String treeParentCode = getTreeParentCode(paramsObj); + String treeName = getTreeName(paramsObj); + + context.put("treeCode", treeCode); + context.put("treeParentCode", treeParentCode); + context.put("treeName", treeName); + context.put("expandColumn", getExpandColumn(genTable)); + if (paramsObj.containsKey(GenConstants.TREE_PARENT_CODE)) + { + context.put("tree_parent_code", paramsObj.getString(GenConstants.TREE_PARENT_CODE)); + } + if (paramsObj.containsKey(GenConstants.TREE_NAME)) + { + context.put("tree_name", paramsObj.getString(GenConstants.TREE_NAME)); + } + } + + public static void setSubVelocityContext(VelocityContext context, GenTable genTable) + { + GenTable subTable = genTable.getSubTable(); + String subTableName = genTable.getSubTableName(); + String subTableFkName = genTable.getSubTableFkName(); + String subClassName = genTable.getSubTable().getClassName(); + String subTableFkClassName = StringUtils.convertToCamelCase(subTableFkName); + + context.put("subTable", subTable); + context.put("subTableName", subTableName); + context.put("subTableFkName", subTableFkName); + context.put("subTableFkClassName", subTableFkClassName); + context.put("subTableFkclassName", StringUtils.uncapitalize(subTableFkClassName)); + context.put("subClassName", subClassName); + context.put("subclassName", StringUtils.uncapitalize(subClassName)); + context.put("subImportList", getImportList(genTable.getSubTable())); + } + + /** + * 获取模板信息 + * + * @return 模板列表 + */ + public static List getTemplateList(String tplCategory) + { + List templates = new ArrayList(); + templates.add("vm/java/domain.java.vm"); + templates.add("vm/java/mapper.java.vm"); + templates.add("vm/java/service.java.vm"); + templates.add("vm/java/serviceImpl.java.vm"); + templates.add("vm/java/controller.java.vm"); + templates.add("vm/xml/mapper.xml.vm"); + templates.add("vm/sql/sql.vm"); + templates.add("vm/js/api.js.vm"); + if (GenConstants.TPL_CRUD.equals(tplCategory)) + { + templates.add("vm/vue/index.vue.vm"); + } + else if (GenConstants.TPL_TREE.equals(tplCategory)) + { + templates.add("vm/vue/index-tree.vue.vm"); + } + else if (GenConstants.TPL_SUB.equals(tplCategory)) + { + templates.add("vm/vue/index.vue.vm"); + templates.add("vm/java/sub-domain.java.vm"); + } + return templates; + } + + /** + * 获取文件名 + */ + public static String getFileName(String template, GenTable genTable) + { + // 文件名称 + String fileName = ""; + // 包路径 + String packageName = genTable.getPackageName(); + // 模块名 + String moduleName = genTable.getModuleName(); + // 大写类名 + String className = genTable.getClassName(); + // 业务名称 + String businessName = genTable.getBusinessName(); + + String javaPath = PROJECT_PATH + "/" + StringUtils.replace(packageName, ".", "/"); + String mybatisPath = MYBATIS_PATH + "/" + moduleName; + String vuePath = "vue"; + + if (template.contains("domain.java.vm")) + { + fileName = StringUtils.format("{}/domain/{}.java", javaPath, className); + } + if (template.contains("sub-domain.java.vm") && StringUtils.equals(GenConstants.TPL_SUB, genTable.getTplCategory())) + { + fileName = StringUtils.format("{}/domain/{}.java", javaPath, genTable.getSubTable().getClassName()); + } + else if (template.contains("mapper.java.vm")) + { + fileName = StringUtils.format("{}/mapper/{}Mapper.java", javaPath, className); + } + else if (template.contains("service.java.vm")) + { + fileName = StringUtils.format("{}/service/I{}Service.java", javaPath, className); + } + else if (template.contains("serviceImpl.java.vm")) + { + fileName = StringUtils.format("{}/service/impl/{}ServiceImpl.java", javaPath, className); + } + else if (template.contains("controller.java.vm")) + { + fileName = StringUtils.format("{}/controller/{}Controller.java", javaPath, className); + } + else if (template.contains("mapper.xml.vm")) + { + fileName = StringUtils.format("{}/{}Mapper.xml", mybatisPath, className); + } + else if (template.contains("sql.vm")) + { + fileName = businessName + "Menu.sql"; + } + else if (template.contains("api.js.vm")) + { + fileName = StringUtils.format("{}/api/{}/{}.js", vuePath, moduleName, businessName); + } + else if (template.contains("index.vue.vm")) + { + fileName = StringUtils.format("{}/views/{}/{}/index.vue", vuePath, moduleName, businessName); + } + else if (template.contains("index-tree.vue.vm")) + { + fileName = StringUtils.format("{}/views/{}/{}/index.vue", vuePath, moduleName, businessName); + } + return fileName; + } + + /** + * 获取包前缀 + * + * @param packageName 包名称 + * @return 包前缀名称 + */ + public static String getPackagePrefix(String packageName) + { + int lastIndex = packageName.lastIndexOf("."); + return StringUtils.substring(packageName, 0, lastIndex); + } + + /** + * 根据列类型获取导入包 + * + * @param genTable 业务表对象 + * @return 返回需要导入的包列表 + */ + public static HashSet getImportList(GenTable genTable) + { + List columns = genTable.getColumns(); + GenTable subGenTable = genTable.getSubTable(); + HashSet importList = new HashSet(); + if (StringUtils.isNotNull(subGenTable)) + { + importList.add("java.util.List"); + } + for (GenTableColumn column : columns) + { + if (!column.isSuperColumn() && GenConstants.TYPE_DATE.equals(column.getJavaType())) + { + importList.add("java.util.Date"); + importList.add("com.fasterxml.jackson.annotation.JsonFormat"); + } + else if (!column.isSuperColumn() && GenConstants.TYPE_BIGDECIMAL.equals(column.getJavaType())) + { + importList.add("java.math.BigDecimal"); + } + } + return importList; + } + + /** + * 根据列类型获取字典组 + * + * @param genTable 业务表对象 + * @return 返回字典组 + */ + public static String getDicts(GenTable genTable) + { + List columns = genTable.getColumns(); + Set dicts = new HashSet(); + addDicts(dicts, columns); + if (StringUtils.isNotNull(genTable.getSubTable())) + { + List subColumns = genTable.getSubTable().getColumns(); + addDicts(dicts, subColumns); + } + return StringUtils.join(dicts, ", "); + } + + /** + * 添加字典列表 + * + * @param dicts 字典列表 + * @param columns 列集合 + */ + public static void addDicts(Set dicts, List columns) + { + for (GenTableColumn column : columns) + { + if (!column.isSuperColumn() && StringUtils.isNotEmpty(column.getDictType()) && StringUtils.equalsAny( + column.getHtmlType(), + new String[] { GenConstants.HTML_SELECT, GenConstants.HTML_RADIO, GenConstants.HTML_CHECKBOX })) + { + dicts.add("'" + column.getDictType() + "'"); + } + } + } + + /** + * 获取权限前缀 + * + * @param moduleName 模块名称 + * @param businessName 业务名称 + * @return 返回权限前缀 + */ + public static String getPermissionPrefix(String moduleName, String businessName) + { + return StringUtils.format("{}:{}", moduleName, businessName); + } + + /** + * 获取上级菜单ID字段 + * + * @param paramsObj 生成其他选项 + * @return 上级菜单ID字段 + */ + public static String getParentMenuId(JSONObject paramsObj) + { + if (StringUtils.isNotEmpty(paramsObj) && paramsObj.containsKey(GenConstants.PARENT_MENU_ID) + && StringUtils.isNotEmpty(paramsObj.getString(GenConstants.PARENT_MENU_ID))) + { + return paramsObj.getString(GenConstants.PARENT_MENU_ID); + } + return DEFAULT_PARENT_MENU_ID; + } + + /** + * 获取树编码 + * + * @param paramsObj 生成其他选项 + * @return 树编码 + */ + public static String getTreecode(JSONObject paramsObj) + { + if (paramsObj.containsKey(GenConstants.TREE_CODE)) + { + return StringUtils.toCamelCase(paramsObj.getString(GenConstants.TREE_CODE)); + } + return StringUtils.EMPTY; + } + + /** + * 获取树父编码 + * + * @param paramsObj 生成其他选项 + * @return 树父编码 + */ + public static String getTreeParentCode(JSONObject paramsObj) + { + if (paramsObj.containsKey(GenConstants.TREE_PARENT_CODE)) + { + return StringUtils.toCamelCase(paramsObj.getString(GenConstants.TREE_PARENT_CODE)); + } + return StringUtils.EMPTY; + } + + /** + * 获取树名称 + * + * @param paramsObj 生成其他选项 + * @return 树名称 + */ + public static String getTreeName(JSONObject paramsObj) + { + if (paramsObj.containsKey(GenConstants.TREE_NAME)) + { + return StringUtils.toCamelCase(paramsObj.getString(GenConstants.TREE_NAME)); + } + return StringUtils.EMPTY; + } + + /** + * 获取需要在哪一列上面显示展开按钮 + * + * @param genTable 业务表对象 + * @return 展开按钮列序号 + */ + public static int getExpandColumn(GenTable genTable) + { + String options = genTable.getOptions(); + JSONObject paramsObj = JSON.parseObject(options); + String treeName = paramsObj.getString(GenConstants.TREE_NAME); + int num = 0; + for (GenTableColumn column : genTable.getColumns()) + { + if (column.isList()) + { + num++; + String columnName = column.getColumnName(); + if (columnName.equals(treeName)) + { + break; + } + } + } + return num; + } +} diff --git a/ruoyi-generator/src/main/resources/generator.yml b/ruoyi-generator/src/main/resources/generator.yml new file mode 100644 index 0000000..69a13cf --- /dev/null +++ b/ruoyi-generator/src/main/resources/generator.yml @@ -0,0 +1,10 @@ +# 代码生成 +gen: + # 作者 + author: ruoyi + # 默认生成包路径 system 需改成自己的模块名称 如 system monitor tool + packageName: com.ruoyi.business + # 自动去除表前缀,默认是false + autoRemovePre: false + # 表前缀(生成类名不会包含表前缀,多个用逗号分隔) + tablePrefix: sys_ \ No newline at end of file diff --git a/ruoyi-generator/src/main/resources/mapper/generator/GenTableColumnMapper.xml b/ruoyi-generator/src/main/resources/mapper/generator/GenTableColumnMapper.xml new file mode 100644 index 0000000..11b2b96 --- /dev/null +++ b/ruoyi-generator/src/main/resources/mapper/generator/GenTableColumnMapper.xml @@ -0,0 +1,127 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select column_id, table_id, column_name, column_comment, column_type, java_type, java_field, is_pk, is_increment, is_required, is_insert, is_edit, is_list, is_query, query_type, html_type, dict_type, sort, create_by, create_time, update_by, update_time from gen_table_column + + + + + + + + insert into gen_table_column ( + table_id, + column_name, + column_comment, + column_type, + java_type, + java_field, + is_pk, + is_increment, + is_required, + is_insert, + is_edit, + is_list, + is_query, + query_type, + html_type, + dict_type, + sort, + create_by, + create_time + )values( + #{tableId}, + #{columnName}, + #{columnComment}, + #{columnType}, + #{javaType}, + #{javaField}, + #{isPk}, + #{isIncrement}, + #{isRequired}, + #{isInsert}, + #{isEdit}, + #{isList}, + #{isQuery}, + #{queryType}, + #{htmlType}, + #{dictType}, + #{sort}, + #{createBy}, + sysdate() + ) + + + + update gen_table_column + + column_comment = #{columnComment}, + java_type = #{javaType}, + java_field = #{javaField}, + is_insert = #{isInsert}, + is_edit = #{isEdit}, + is_list = #{isList}, + is_query = #{isQuery}, + is_required = #{isRequired}, + query_type = #{queryType}, + html_type = #{htmlType}, + dict_type = #{dictType}, + sort = #{sort}, + update_by = #{updateBy}, + update_time = sysdate() + + where column_id = #{columnId} + + + + delete from gen_table_column where table_id in + + #{tableId} + + + + + delete from gen_table_column where column_id in + + #{item.columnId} + + + + \ No newline at end of file diff --git a/ruoyi-generator/src/main/resources/mapper/generator/GenTableMapper.xml b/ruoyi-generator/src/main/resources/mapper/generator/GenTableMapper.xml new file mode 100644 index 0000000..b605e90 --- /dev/null +++ b/ruoyi-generator/src/main/resources/mapper/generator/GenTableMapper.xml @@ -0,0 +1,202 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select table_id, table_name, table_comment, sub_table_name, sub_table_fk_name, class_name, tpl_category, package_name, module_name, business_name, function_name, function_author, gen_type, gen_path, options, create_by, create_time, update_by, update_time, remark from gen_table + + + + + + + + + + + + + + + + + + insert into gen_table ( + table_name, + table_comment, + class_name, + tpl_category, + package_name, + module_name, + business_name, + function_name, + function_author, + gen_type, + gen_path, + remark, + create_by, + create_time + )values( + #{tableName}, + #{tableComment}, + #{className}, + #{tplCategory}, + #{packageName}, + #{moduleName}, + #{businessName}, + #{functionName}, + #{functionAuthor}, + #{genType}, + #{genPath}, + #{remark}, + #{createBy}, + sysdate() + ) + + + + update gen_table + + table_name = #{tableName}, + table_comment = #{tableComment}, + sub_table_name = #{subTableName}, + sub_table_fk_name = #{subTableFkName}, + class_name = #{className}, + function_author = #{functionAuthor}, + gen_type = #{genType}, + gen_path = #{genPath}, + tpl_category = #{tplCategory}, + package_name = #{packageName}, + module_name = #{moduleName}, + business_name = #{businessName}, + function_name = #{functionName}, + options = #{options}, + update_by = #{updateBy}, + remark = #{remark}, + update_time = sysdate() + + where table_id = #{tableId} + + + + delete from gen_table where table_id in + + #{tableId} + + + + \ No newline at end of file diff --git a/ruoyi-generator/src/main/resources/vm/java/controller.java.vm b/ruoyi-generator/src/main/resources/vm/java/controller.java.vm new file mode 100644 index 0000000..88e6c2d --- /dev/null +++ b/ruoyi-generator/src/main/resources/vm/java/controller.java.vm @@ -0,0 +1,116 @@ +package ${packageName}.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.enums.BusinessType; +import ${packageName}.domain.${ClassName}; +import ${packageName}.service.I${ClassName}Service; +import com.ruoyi.common.utils.poi.ExcelUtil; +import java.util.Arrays; +#if($table.crud || $table.sub) +import com.ruoyi.common.core.page.TableDataInfo; +#elseif($table.tree) +#end + +/** + * ${functionName}Controller + * + * @author ${author} + * @date ${datetime} + */ +@RestController +@RequestMapping("/${moduleName}/${businessName}") +public class ${ClassName}Controller extends BaseController +{ + @Autowired + private I${ClassName}Service ${className}Service; + + /** + * 查询${functionName}列表 + */ + @PreAuthorize("@ss.hasPermi('${permissionPrefix}:list')") + @GetMapping("/list") +#if($table.crud || $table.sub) + public TableDataInfo list(${ClassName} ${className}) + { + startPage(); + List<${ClassName}> list = ${className}Service.list(); + return getDataTable(list); + } +#elseif($table.tree) + public AjaxResult list(${ClassName} ${className}) + { + List<${ClassName}> list = ${className}Service.list(); + return success(list); + } +#end + + /** + * 导出${functionName}列表 + */ + @PreAuthorize("@ss.hasPermi('${permissionPrefix}:export')") + @Log(title = "${functionName}", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, ${ClassName} ${className}) + { + List<${ClassName}> list = ${className}Service.list(); + ExcelUtil<${ClassName}> util = new ExcelUtil<${ClassName}>(${ClassName}.class); + util.exportExcel(response, list, "${functionName}数据"); + } + + /** + * 获取${functionName}详细信息 + */ + @PreAuthorize("@ss.hasPermi('${permissionPrefix}:query')") + @GetMapping(value = "/{${pkColumn.javaField}}") + public AjaxResult getInfo(@PathVariable("${pkColumn.javaField}") ${pkColumn.javaType} ${pkColumn.javaField}) + { + return success(${className}Service.getById(${pkColumn.javaField})); + } + + /** + * 新增${functionName} + */ + @PreAuthorize("@ss.hasPermi('${permissionPrefix}:add')") + @Log(title = "${functionName}", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody ${ClassName} ${className}) + { + return toAjax(${className}Service.save(${className})); + } + + /** + * 修改${functionName} + */ + @PreAuthorize("@ss.hasPermi('${permissionPrefix}:edit')") + @Log(title = "${functionName}", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody ${ClassName} ${className}) + { + return toAjax(${className}Service.updateById(${className})); + } + + /** + * 删除${functionName} + */ + @PreAuthorize("@ss.hasPermi('${permissionPrefix}:remove')") + @Log(title = "${functionName}", businessType = BusinessType.DELETE) + @DeleteMapping("/{${pkColumn.javaField}s}") + public AjaxResult remove(@PathVariable ${pkColumn.javaType}[] ${pkColumn.javaField}s) + { + return toAjax(${className}Service.removeByIds(Arrays.asList(${pkColumn.javaField}s))); + } +} diff --git a/ruoyi-generator/src/main/resources/vm/java/domain.java.vm b/ruoyi-generator/src/main/resources/vm/java/domain.java.vm new file mode 100644 index 0000000..e7fb12e --- /dev/null +++ b/ruoyi-generator/src/main/resources/vm/java/domain.java.vm @@ -0,0 +1,109 @@ +package ${packageName}.domain; + +#foreach ($import in $importList) +import ${import}; +#end +import lombok.Data; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.annotation.Excel; +import java.util.ArrayList; +#if($table.crud || $table.sub) +import com.ruoyi.common.core.domain.BaseEntity; +#elseif($table.tree) +import com.ruoyi.common.core.domain.TreeEntity; +#end + +/** + * ${functionName}对象 ${tableName} + * + * @author ${author} + * @date ${datetime} + */ +#if($table.crud || $table.sub) +#set($Entity="BaseEntity") +#elseif($table.tree) +#set($Entity="TreeEntity") +#end +@Data +public class ${ClassName} extends ${Entity} +{ + private static final long serialVersionUID = 1L; + +#foreach ($column in $columns) + +#if(!$table.isSuperColumn($column.javaField)) + /** $column.columnComment */ +#if($column.list) +#set($parentheseIndex=$column.columnComment.indexOf("(")) +#if($parentheseIndex != -1) +#set($comment=$column.columnComment.substring(0, $parentheseIndex)) +#else +#set($comment=$column.columnComment) +#end +#if($parentheseIndex != -1) + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") +#elseif($column.javaType == 'Date') + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "${comment}", width = 30, dateFormat = "yyyy-MM-dd") +#else + @Excel(name = "${comment}") +#end +#end + private $column.javaType $column.javaField; + +#end +#end +#if($table.sub) + /** $table.subTable.functionName信息 */ + private List<${subClassName}> ${subclassName}List = new ArrayList<${subClassName}>(); + +#end +###foreach ($column in $columns) +###if(!$table.isSuperColumn($column.javaField)) +###if($column.javaField.length() > 2 && $column.javaField.substring(1,2).matches("[A-Z]")) +###set($AttrName=$column.javaField) +###else +###set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)}) +###end +## public void set${AttrName}($column.javaType $column.javaField) +## { +## this.$column.javaField = $column.javaField; +## } +## +## public $column.javaType get${AttrName}() +## { +## return $column.javaField; +## } +###end +###end + +###if($table.sub) +## public List<${subClassName}> get${subClassName}List() +## { +## return ${subclassName}List; +## } +## +## public void set${subClassName}List(List<${subClassName}> ${subclassName}List) +## { +## this.${subclassName}List = ${subclassName}List; +## } +## +###end +## @Override +## public String toString() { +## return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) +###foreach ($column in $columns) +###if($column.javaField.length() > 2 && $column.javaField.substring(1,2).matches("[A-Z]")) +###set($AttrName=$column.javaField) +###else +###set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)}) +###end +## .append("${column.javaField}", get${AttrName}()) +###end +###if($table.sub) +## .append("${subclassName}List", get${subClassName}List()) +###end +## .toString(); +## } +} diff --git a/ruoyi-generator/src/main/resources/vm/java/mapper.java.vm b/ruoyi-generator/src/main/resources/vm/java/mapper.java.vm new file mode 100644 index 0000000..adb7c90 --- /dev/null +++ b/ruoyi-generator/src/main/resources/vm/java/mapper.java.vm @@ -0,0 +1,19 @@ +package ${packageName}.mapper; + +import java.util.List; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import ${packageName}.domain.${ClassName}; +#if($table.sub) +import ${packageName}.domain.${subClassName}; +#end + +/** + * ${functionName}Mapper接口 + * + * @author ${author} + * @date ${datetime} + */ +public interface ${ClassName}Mapper extends BaseMapper<${ClassName}> +{ + +} diff --git a/ruoyi-generator/src/main/resources/vm/java/service.java.vm b/ruoyi-generator/src/main/resources/vm/java/service.java.vm new file mode 100644 index 0000000..b8af884 --- /dev/null +++ b/ruoyi-generator/src/main/resources/vm/java/service.java.vm @@ -0,0 +1,15 @@ +package ${packageName}.service; + +import java.util.List; +import ${packageName}.domain.${ClassName}; +import com.baomidou.mybatisplus.extension.service.IService; +/** + * ${functionName}Service接口 + * + * @author ${author} + * @date ${datetime} + */ +public interface I${ClassName}Service extends IService<${ClassName}> +{ + +} diff --git a/ruoyi-generator/src/main/resources/vm/java/serviceImpl.java.vm b/ruoyi-generator/src/main/resources/vm/java/serviceImpl.java.vm new file mode 100644 index 0000000..87051f3 --- /dev/null +++ b/ruoyi-generator/src/main/resources/vm/java/serviceImpl.java.vm @@ -0,0 +1,35 @@ +package ${packageName}.service.impl; + +import java.util.List; +#foreach ($column in $columns) +#if($column.javaField == 'createTime' || $column.javaField == 'updateTime') +import com.ruoyi.common.utils.DateUtils; +#break +#end +#end +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +#if($table.sub) +import java.util.ArrayList; +import com.ruoyi.common.utils.StringUtils; +import org.springframework.transaction.annotation.Transactional; +import ${packageName}.domain.${subClassName}; +#end +import ${packageName}.mapper.${ClassName}Mapper; +import ${packageName}.domain.${ClassName}; +import ${packageName}.service.I${ClassName}Service; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + +/** + * ${functionName}Service业务层处理 + * + * @author ${author} + * @date ${datetime} + */ +@Service +public class ${ClassName}ServiceImpl extends ServiceImpl<${ClassName}Mapper, ${ClassName}> implements I${ClassName}Service +{ + +} diff --git a/ruoyi-generator/src/main/resources/vm/java/sub-domain.java.vm b/ruoyi-generator/src/main/resources/vm/java/sub-domain.java.vm new file mode 100644 index 0000000..a3f53eb --- /dev/null +++ b/ruoyi-generator/src/main/resources/vm/java/sub-domain.java.vm @@ -0,0 +1,76 @@ +package ${packageName}.domain; + +#foreach ($import in $subImportList) +import ${import}; +#end +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * ${subTable.functionName}对象 ${subTableName} + * + * @author ${author} + * @date ${datetime} + */ +public class ${subClassName} extends BaseEntity +{ + private static final long serialVersionUID = 1L; + +#foreach ($column in $subTable.columns) +#if(!$table.isSuperColumn($column.javaField)) + /** $column.columnComment */ +#if($column.list) +#set($parentheseIndex=$column.columnComment.indexOf("(")) +#if($parentheseIndex != -1) +#set($comment=$column.columnComment.substring(0, $parentheseIndex)) +#else +#set($comment=$column.columnComment) +#end +#if($parentheseIndex != -1) + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") +#elseif($column.javaType == 'Date') + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "${comment}", width = 30, dateFormat = "yyyy-MM-dd") +#else + @Excel(name = "${comment}") +#end +#end + private $column.javaType $column.javaField; + +#end +#end +#foreach ($column in $subTable.columns) +#if(!$table.isSuperColumn($column.javaField)) +#if($column.javaField.length() > 2 && $column.javaField.substring(1,2).matches("[A-Z]")) +#set($AttrName=$column.javaField) +#else +#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)}) +#end + public void set${AttrName}($column.javaType $column.javaField) + { + this.$column.javaField = $column.javaField; + } + + public $column.javaType get${AttrName}() + { + return $column.javaField; + } +#end +#end + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) +#foreach ($column in $subTable.columns) +#if($column.javaField.length() > 2 && $column.javaField.substring(1,2).matches("[A-Z]")) +#set($AttrName=$column.javaField) +#else +#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)}) +#end + .append("${column.javaField}", get${AttrName}()) +#end + .toString(); + } +} diff --git a/ruoyi-generator/src/main/resources/vm/js/api.js.vm b/ruoyi-generator/src/main/resources/vm/js/api.js.vm new file mode 100644 index 0000000..9295524 --- /dev/null +++ b/ruoyi-generator/src/main/resources/vm/js/api.js.vm @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询${functionName}列表 +export function list${BusinessName}(query) { + return request({ + url: '/${moduleName}/${businessName}/list', + method: 'get', + params: query + }) +} + +// 查询${functionName}详细 +export function get${BusinessName}(${pkColumn.javaField}) { + return request({ + url: '/${moduleName}/${businessName}/' + ${pkColumn.javaField}, + method: 'get' + }) +} + +// 新增${functionName} +export function add${BusinessName}(data) { + return request({ + url: '/${moduleName}/${businessName}', + method: 'post', + data: data + }) +} + +// 修改${functionName} +export function update${BusinessName}(data) { + return request({ + url: '/${moduleName}/${businessName}', + method: 'put', + data: data + }) +} + +// 删除${functionName} +export function del${BusinessName}(${pkColumn.javaField}) { + return request({ + url: '/${moduleName}/${businessName}/' + ${pkColumn.javaField}, + method: 'delete' + }) +} diff --git a/ruoyi-generator/src/main/resources/vm/sql/sql.vm b/ruoyi-generator/src/main/resources/vm/sql/sql.vm new file mode 100644 index 0000000..0575583 --- /dev/null +++ b/ruoyi-generator/src/main/resources/vm/sql/sql.vm @@ -0,0 +1,22 @@ +-- 菜单 SQL +insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) +values('${functionName}', '${parentMenuId}', '1', '${businessName}', '${moduleName}/${businessName}/index', 1, 0, 'C', '0', '0', '${permissionPrefix}:list', '#', 'admin', sysdate(), '', null, '${functionName}菜单'); + +-- 按钮父菜单ID +SELECT @parentId := LAST_INSERT_ID(); + +-- 按钮 SQL +insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) +values('${functionName}查询', @parentId, '1', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:query', '#', 'admin', sysdate(), '', null, ''); + +insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) +values('${functionName}新增', @parentId, '2', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:add', '#', 'admin', sysdate(), '', null, ''); + +insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) +values('${functionName}修改', @parentId, '3', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:edit', '#', 'admin', sysdate(), '', null, ''); + +insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) +values('${functionName}删除', @parentId, '4', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:remove', '#', 'admin', sysdate(), '', null, ''); + +insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) +values('${functionName}导出', @parentId, '5', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:export', '#', 'admin', sysdate(), '', null, ''); \ No newline at end of file diff --git a/ruoyi-generator/src/main/resources/vm/vue/index-tree.vue.vm b/ruoyi-generator/src/main/resources/vm/vue/index-tree.vue.vm new file mode 100644 index 0000000..a4c64a0 --- /dev/null +++ b/ruoyi-generator/src/main/resources/vm/vue/index-tree.vue.vm @@ -0,0 +1,505 @@ + + + diff --git a/ruoyi-generator/src/main/resources/vm/vue/index.vue.vm b/ruoyi-generator/src/main/resources/vm/vue/index.vue.vm new file mode 100644 index 0000000..196233c --- /dev/null +++ b/ruoyi-generator/src/main/resources/vm/vue/index.vue.vm @@ -0,0 +1,607 @@ + + + diff --git a/ruoyi-generator/src/main/resources/vm/vue/v3/index-tree.vue.vm b/ruoyi-generator/src/main/resources/vm/vue/v3/index-tree.vue.vm new file mode 100644 index 0000000..7bbd2fc --- /dev/null +++ b/ruoyi-generator/src/main/resources/vm/vue/v3/index-tree.vue.vm @@ -0,0 +1,474 @@ + + + diff --git a/ruoyi-generator/src/main/resources/vm/vue/v3/index.vue.vm b/ruoyi-generator/src/main/resources/vm/vue/v3/index.vue.vm new file mode 100644 index 0000000..9cb4176 --- /dev/null +++ b/ruoyi-generator/src/main/resources/vm/vue/v3/index.vue.vm @@ -0,0 +1,595 @@ + + + diff --git a/ruoyi-generator/src/main/resources/vm/vue/v3/readme.txt b/ruoyi-generator/src/main/resources/vm/vue/v3/readme.txt new file mode 100644 index 0000000..99239bb --- /dev/null +++ b/ruoyi-generator/src/main/resources/vm/vue/v3/readme.txt @@ -0,0 +1 @@ +ʹõRuoYi-Vue3ǰˣôҪһ´Ŀ¼ģindex.vue.vmindex-tree.vue.vmļϼvueĿ¼ \ No newline at end of file diff --git a/ruoyi-generator/src/main/resources/vm/xml/mapper.xml.vm b/ruoyi-generator/src/main/resources/vm/xml/mapper.xml.vm new file mode 100644 index 0000000..0ceb3d8 --- /dev/null +++ b/ruoyi-generator/src/main/resources/vm/xml/mapper.xml.vm @@ -0,0 +1,135 @@ + + + + + +#foreach ($column in $columns) + +#end + +#if($table.sub) + + + + + + +#foreach ($column in $subTable.columns) + +#end + +#end + + + select#foreach($column in $columns) $column.columnName#if($foreach.count != $columns.size()),#end#end from ${tableName} + + + + + + + + insert into ${tableName} + +#foreach($column in $columns) +#if($column.columnName != $pkColumn.columnName || !$pkColumn.increment) + $column.columnName, +#end +#end + + +#foreach($column in $columns) +#if($column.columnName != $pkColumn.columnName || !$pkColumn.increment) + #{$column.javaField}, +#end +#end + + + + + update ${tableName} + +#foreach($column in $columns) +#if($column.columnName != $pkColumn.columnName) + $column.columnName = #{$column.javaField}, +#end +#end + + where ${pkColumn.columnName} = #{${pkColumn.javaField}} + + + + delete from ${tableName} where ${pkColumn.columnName} = #{${pkColumn.javaField}} + + + + delete from ${tableName} where ${pkColumn.columnName} in + + #{${pkColumn.javaField}} + + +#if($table.sub) + + + delete from ${subTableName} where ${subTableFkName} in + + #{${subTableFkclassName}} + + + + + delete from ${subTableName} where ${subTableFkName} = #{${subTableFkclassName}} + + + + insert into ${subTableName}(#foreach($column in $subTable.columns) $column.columnName#if($foreach.count != $subTable.columns.size()),#end#end) values + + (#foreach($column in $subTable.columns) #{item.$column.javaField}#if($foreach.count != $subTable.columns.size()),#end#end) + + +#end + \ No newline at end of file diff --git a/ruoyi-quartz/pom.xml b/ruoyi-quartz/pom.xml new file mode 100644 index 0000000..1922bcf --- /dev/null +++ b/ruoyi-quartz/pom.xml @@ -0,0 +1,40 @@ + + + + ruoyi + com.ruoyi + 3.8.5 + + 4.0.0 + + ruoyi-quartz + + + quartz定时任务 + + + + + + + org.quartz-scheduler + quartz + + + com.mchange + c3p0 + + + + + + + com.ruoyi + ruoyi-common + + + + + \ No newline at end of file diff --git a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/config/ScheduleConfig.java b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/config/ScheduleConfig.java new file mode 100644 index 0000000..621001a --- /dev/null +++ b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/config/ScheduleConfig.java @@ -0,0 +1,57 @@ +//package com.ruoyi.quartz.config; +// +//import org.springframework.context.annotation.Bean; +//import org.springframework.context.annotation.Configuration; +//import org.springframework.scheduling.quartz.SchedulerFactoryBean; +//import javax.sql.DataSource; +//import java.util.Properties; +// +///** +// * 定时任务配置(单机部署建议删除此类和qrtz数据库表,默认走内存会最高效) +// * +// * @author #author# +// */ +//@Configuration +//public class ScheduleConfig +//{ +// @Bean +// public SchedulerFactoryBean schedulerFactoryBean(DataSource dataSource) +// { +// SchedulerFactoryBean factory = new SchedulerFactoryBean(); +// factory.setDataSource(dataSource); +// +// // quartz参数 +// Properties prop = new Properties(); +// prop.put("org.quartz.scheduler.instanceName", "RuoyiScheduler"); +// prop.put("org.quartz.scheduler.instanceId", "AUTO"); +// // 线程池配置 +// prop.put("org.quartz.threadPool.class", "org.quartz.simpl.SimpleThreadPool"); +// prop.put("org.quartz.threadPool.threadCount", "20"); +// prop.put("org.quartz.threadPool.threadPriority", "5"); +// // JobStore配置 +// prop.put("org.quartz.jobStore.class", "org.springframework.scheduling.quartz.LocalDataSourceJobStore"); +// // 集群配置 +// prop.put("org.quartz.jobStore.isClustered", "true"); +// prop.put("org.quartz.jobStore.clusterCheckinInterval", "15000"); +// prop.put("org.quartz.jobStore.maxMisfiresToHandleAtATime", "1"); +// prop.put("org.quartz.jobStore.txIsolationLevelSerializable", "true"); +// +// // sqlserver 启用 +// // prop.put("org.quartz.jobStore.selectWithLockSQL", "SELECT * FROM {0}LOCKS UPDLOCK WHERE LOCK_NAME = ?"); +// prop.put("org.quartz.jobStore.misfireThreshold", "12000"); +// prop.put("org.quartz.jobStore.tablePrefix", "QRTZ_"); +// factory.setQuartzProperties(prop); +// +// factory.setSchedulerName("RuoyiScheduler"); +// // 延时启动 +// factory.setStartupDelay(1); +// factory.setApplicationContextSchedulerContextKey("applicationContextKey"); +// // 可选,QuartzScheduler +// // 启动时更新己存在的Job,这样就不用每次修改targetObject后删除qrtz_job_details表对应记录了 +// factory.setOverwriteExistingJobs(true); +// // 设置自动启动,默认为true +// factory.setAutoStartup(true); +// +// return factory; +// } +//} diff --git a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/controller/SysJobController.java b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/controller/SysJobController.java new file mode 100644 index 0000000..a1b212f --- /dev/null +++ b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/controller/SysJobController.java @@ -0,0 +1,185 @@ +package com.ruoyi.quartz.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; +import org.quartz.SchedulerException; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.constant.Constants; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.common.exception.job.TaskException; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.quartz.domain.SysJob; +import com.ruoyi.quartz.service.ISysJobService; +import com.ruoyi.quartz.util.CronUtils; +import com.ruoyi.quartz.util.ScheduleUtils; + +/** + * 调度任务信息操作处理 + * + * @author #author# + */ +@RestController +@RequestMapping("/monitor/job") +public class SysJobController extends BaseController +{ + @Autowired + private ISysJobService jobService; + + /** + * 查询定时任务列表 + */ + @PreAuthorize("@ss.hasPermi('monitor:job:list')") + @GetMapping("/list") + public TableDataInfo list(SysJob sysJob) + { + startPage(); + List list = jobService.selectJobList(sysJob); + return getDataTable(list); + } + + /** + * 导出定时任务列表 + */ + @PreAuthorize("@ss.hasPermi('monitor:job:export')") + @Log(title = "定时任务", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, SysJob sysJob) + { + List list = jobService.selectJobList(sysJob); + ExcelUtil util = new ExcelUtil(SysJob.class); + util.exportExcel(response, list, "定时任务"); + } + + /** + * 获取定时任务详细信息 + */ + @PreAuthorize("@ss.hasPermi('monitor:job:query')") + @GetMapping(value = "/{jobId}") + public AjaxResult getInfo(@PathVariable("jobId") Long jobId) + { + return success(jobService.selectJobById(jobId)); + } + + /** + * 新增定时任务 + */ + @PreAuthorize("@ss.hasPermi('monitor:job:add')") + @Log(title = "定时任务", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody SysJob job) throws SchedulerException, TaskException + { + if (!CronUtils.isValid(job.getCronExpression())) + { + return error("新增任务'" + job.getJobName() + "'失败,Cron表达式不正确"); + } + else if (StringUtils.containsIgnoreCase(job.getInvokeTarget(), Constants.LOOKUP_RMI)) + { + return error("新增任务'" + job.getJobName() + "'失败,目标字符串不允许'rmi'调用"); + } + else if (StringUtils.containsAnyIgnoreCase(job.getInvokeTarget(), new String[] { Constants.LOOKUP_LDAP, Constants.LOOKUP_LDAPS })) + { + return error("新增任务'" + job.getJobName() + "'失败,目标字符串不允许'ldap(s)'调用"); + } + else if (StringUtils.containsAnyIgnoreCase(job.getInvokeTarget(), new String[] { Constants.HTTP, Constants.HTTPS })) + { + return error("新增任务'" + job.getJobName() + "'失败,目标字符串不允许'http(s)'调用"); + } + else if (StringUtils.containsAnyIgnoreCase(job.getInvokeTarget(), Constants.JOB_ERROR_STR)) + { + return error("新增任务'" + job.getJobName() + "'失败,目标字符串存在违规"); + } + else if (!ScheduleUtils.whiteList(job.getInvokeTarget())) + { + return error("新增任务'" + job.getJobName() + "'失败,目标字符串不在白名单内"); + } + job.setCreateBy(getUsername()); + return toAjax(jobService.insertJob(job)); + } + + /** + * 修改定时任务 + */ + @PreAuthorize("@ss.hasPermi('monitor:job:edit')") + @Log(title = "定时任务", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody SysJob job) throws SchedulerException, TaskException + { + if (!CronUtils.isValid(job.getCronExpression())) + { + return error("修改任务'" + job.getJobName() + "'失败,Cron表达式不正确"); + } + else if (StringUtils.containsIgnoreCase(job.getInvokeTarget(), Constants.LOOKUP_RMI)) + { + return error("修改任务'" + job.getJobName() + "'失败,目标字符串不允许'rmi'调用"); + } + else if (StringUtils.containsAnyIgnoreCase(job.getInvokeTarget(), new String[] { Constants.LOOKUP_LDAP, Constants.LOOKUP_LDAPS })) + { + return error("修改任务'" + job.getJobName() + "'失败,目标字符串不允许'ldap(s)'调用"); + } + else if (StringUtils.containsAnyIgnoreCase(job.getInvokeTarget(), new String[] { Constants.HTTP, Constants.HTTPS })) + { + return error("修改任务'" + job.getJobName() + "'失败,目标字符串不允许'http(s)'调用"); + } + else if (StringUtils.containsAnyIgnoreCase(job.getInvokeTarget(), Constants.JOB_ERROR_STR)) + { + return error("修改任务'" + job.getJobName() + "'失败,目标字符串存在违规"); + } + else if (!ScheduleUtils.whiteList(job.getInvokeTarget())) + { + return error("修改任务'" + job.getJobName() + "'失败,目标字符串不在白名单内"); + } + job.setUpdateBy(getUsername()); + return toAjax(jobService.updateJob(job)); + } + + /** + * 定时任务状态修改 + */ + @PreAuthorize("@ss.hasPermi('monitor:job:changeStatus')") + @Log(title = "定时任务", businessType = BusinessType.UPDATE) + @PutMapping("/changeStatus") + public AjaxResult changeStatus(@RequestBody SysJob job) throws SchedulerException + { + SysJob newJob = jobService.selectJobById(job.getJobId()); + newJob.setStatus(job.getStatus()); + return toAjax(jobService.changeStatus(newJob)); + } + + /** + * 定时任务立即执行一次 + */ + @PreAuthorize("@ss.hasPermi('monitor:job:changeStatus')") + @Log(title = "定时任务", businessType = BusinessType.UPDATE) + @PutMapping("/run") + public AjaxResult run(@RequestBody SysJob job) throws SchedulerException + { + boolean result = jobService.run(job); + return result ? success() : error("任务不存在或已过期!"); + } + + /** + * 删除定时任务 + */ + @PreAuthorize("@ss.hasPermi('monitor:job:remove')") + @Log(title = "定时任务", businessType = BusinessType.DELETE) + @DeleteMapping("/{jobIds}") + public AjaxResult remove(@PathVariable Long[] jobIds) throws SchedulerException, TaskException + { + jobService.deleteJobByIds(jobIds); + return success(); + } +} diff --git a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/controller/SysJobLogController.java b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/controller/SysJobLogController.java new file mode 100644 index 0000000..9cfb7e4 --- /dev/null +++ b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/controller/SysJobLogController.java @@ -0,0 +1,92 @@ +package com.ruoyi.quartz.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.quartz.domain.SysJobLog; +import com.ruoyi.quartz.service.ISysJobLogService; + +/** + * 调度日志操作处理 + * + * @author #author# + */ +@RestController +@RequestMapping("/monitor/jobLog") +public class SysJobLogController extends BaseController +{ + @Autowired + private ISysJobLogService jobLogService; + + /** + * 查询定时任务调度日志列表 + */ + @PreAuthorize("@ss.hasPermi('monitor:job:list')") + @GetMapping("/list") + public TableDataInfo list(SysJobLog sysJobLog) + { + startPage(); + List list = jobLogService.selectJobLogList(sysJobLog); + return getDataTable(list); + } + + /** + * 导出定时任务调度日志列表 + */ + @PreAuthorize("@ss.hasPermi('monitor:job:export')") + @Log(title = "任务调度日志", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, SysJobLog sysJobLog) + { + List list = jobLogService.selectJobLogList(sysJobLog); + ExcelUtil util = new ExcelUtil(SysJobLog.class); + util.exportExcel(response, list, "调度日志"); + } + + /** + * 根据调度编号获取详细信息 + */ + @PreAuthorize("@ss.hasPermi('monitor:job:query')") + @GetMapping(value = "/{jobLogId}") + public AjaxResult getInfo(@PathVariable Long jobLogId) + { + return success(jobLogService.selectJobLogById(jobLogId)); + } + + + /** + * 删除定时任务调度日志 + */ + @PreAuthorize("@ss.hasPermi('monitor:job:remove')") + @Log(title = "定时任务调度日志", businessType = BusinessType.DELETE) + @DeleteMapping("/{jobLogIds}") + public AjaxResult remove(@PathVariable Long[] jobLogIds) + { + return toAjax(jobLogService.deleteJobLogByIds(jobLogIds)); + } + + /** + * 清空定时任务调度日志 + */ + @PreAuthorize("@ss.hasPermi('monitor:job:remove')") + @Log(title = "调度日志", businessType = BusinessType.CLEAN) + @DeleteMapping("/clean") + public AjaxResult clean() + { + jobLogService.cleanJobLog(); + return success(); + } +} diff --git a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/domain/SysJob.java b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/domain/SysJob.java new file mode 100644 index 0000000..e793925 --- /dev/null +++ b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/domain/SysJob.java @@ -0,0 +1,171 @@ +package com.ruoyi.quartz.domain; + +import java.util.Date; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.Size; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.annotation.Excel.ColumnType; +import com.ruoyi.common.constant.ScheduleConstants; +import com.ruoyi.common.core.domain.BaseEntity; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.quartz.util.CronUtils; + +/** + * 定时任务调度表 sys_job + * + * @author #author# + */ +public class SysJob extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 任务ID */ + @Excel(name = "任务序号", cellType = ColumnType.NUMERIC) + private Long jobId; + + /** 任务名称 */ + @Excel(name = "任务名称") + private String jobName; + + /** 任务组名 */ + @Excel(name = "任务组名") + private String jobGroup; + + /** 调用目标字符串 */ + @Excel(name = "调用目标字符串") + private String invokeTarget; + + /** cron执行表达式 */ + @Excel(name = "执行表达式 ") + private String cronExpression; + + /** cron计划策略 */ + @Excel(name = "计划策略 ", readConverterExp = "0=默认,1=立即触发执行,2=触发一次执行,3=不触发立即执行") + private String misfirePolicy = ScheduleConstants.MISFIRE_DEFAULT; + + /** 是否并发执行(0允许 1禁止) */ + @Excel(name = "并发执行", readConverterExp = "0=允许,1=禁止") + private String concurrent; + + /** 任务状态(0正常 1暂停) */ + @Excel(name = "任务状态", readConverterExp = "0=正常,1=暂停") + private String status; + + public Long getJobId() + { + return jobId; + } + + public void setJobId(Long jobId) + { + this.jobId = jobId; + } + + @NotBlank(message = "任务名称不能为空") + @Size(min = 0, max = 64, message = "任务名称不能超过64个字符") + public String getJobName() + { + return jobName; + } + + public void setJobName(String jobName) + { + this.jobName = jobName; + } + + public String getJobGroup() + { + return jobGroup; + } + + public void setJobGroup(String jobGroup) + { + this.jobGroup = jobGroup; + } + + @NotBlank(message = "调用目标字符串不能为空") + @Size(min = 0, max = 500, message = "调用目标字符串长度不能超过500个字符") + public String getInvokeTarget() + { + return invokeTarget; + } + + public void setInvokeTarget(String invokeTarget) + { + this.invokeTarget = invokeTarget; + } + + @NotBlank(message = "Cron执行表达式不能为空") + @Size(min = 0, max = 255, message = "Cron执行表达式不能超过255个字符") + public String getCronExpression() + { + return cronExpression; + } + + public void setCronExpression(String cronExpression) + { + this.cronExpression = cronExpression; + } + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + public Date getNextValidTime() + { + if (StringUtils.isNotEmpty(cronExpression)) + { + return CronUtils.getNextExecution(cronExpression); + } + return null; + } + + public String getMisfirePolicy() + { + return misfirePolicy; + } + + public void setMisfirePolicy(String misfirePolicy) + { + this.misfirePolicy = misfirePolicy; + } + + public String getConcurrent() + { + return concurrent; + } + + public void setConcurrent(String concurrent) + { + this.concurrent = concurrent; + } + + public String getStatus() + { + return status; + } + + public void setStatus(String status) + { + this.status = status; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("jobId", getJobId()) + .append("jobName", getJobName()) + .append("jobGroup", getJobGroup()) + .append("cronExpression", getCronExpression()) + .append("nextValidTime", getNextValidTime()) + .append("misfirePolicy", getMisfirePolicy()) + .append("concurrent", getConcurrent()) + .append("status", getStatus()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("remark", getRemark()) + .toString(); + } +} diff --git a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/domain/SysJobLog.java b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/domain/SysJobLog.java new file mode 100644 index 0000000..d7338d3 --- /dev/null +++ b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/domain/SysJobLog.java @@ -0,0 +1,155 @@ +package com.ruoyi.quartz.domain; + +import java.util.Date; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * 定时任务调度日志表 sys_job_log + * + * @author #author# + */ +public class SysJobLog extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** ID */ + @Excel(name = "日志序号") + private Long jobLogId; + + /** 任务名称 */ + @Excel(name = "任务名称") + private String jobName; + + /** 任务组名 */ + @Excel(name = "任务组名") + private String jobGroup; + + /** 调用目标字符串 */ + @Excel(name = "调用目标字符串") + private String invokeTarget; + + /** 日志信息 */ + @Excel(name = "日志信息") + private String jobMessage; + + /** 执行状态(0正常 1失败) */ + @Excel(name = "执行状态", readConverterExp = "0=正常,1=失败") + private String status; + + /** 异常信息 */ + @Excel(name = "异常信息") + private String exceptionInfo; + + /** 开始时间 */ + private Date startTime; + + /** 停止时间 */ + private Date stopTime; + + public Long getJobLogId() + { + return jobLogId; + } + + public void setJobLogId(Long jobLogId) + { + this.jobLogId = jobLogId; + } + + public String getJobName() + { + return jobName; + } + + public void setJobName(String jobName) + { + this.jobName = jobName; + } + + public String getJobGroup() + { + return jobGroup; + } + + public void setJobGroup(String jobGroup) + { + this.jobGroup = jobGroup; + } + + public String getInvokeTarget() + { + return invokeTarget; + } + + public void setInvokeTarget(String invokeTarget) + { + this.invokeTarget = invokeTarget; + } + + public String getJobMessage() + { + return jobMessage; + } + + public void setJobMessage(String jobMessage) + { + this.jobMessage = jobMessage; + } + + public String getStatus() + { + return status; + } + + public void setStatus(String status) + { + this.status = status; + } + + public String getExceptionInfo() + { + return exceptionInfo; + } + + public void setExceptionInfo(String exceptionInfo) + { + this.exceptionInfo = exceptionInfo; + } + + public Date getStartTime() + { + return startTime; + } + + public void setStartTime(Date startTime) + { + this.startTime = startTime; + } + + public Date getStopTime() + { + return stopTime; + } + + public void setStopTime(Date stopTime) + { + this.stopTime = stopTime; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("jobLogId", getJobLogId()) + .append("jobName", getJobName()) + .append("jobGroup", getJobGroup()) + .append("jobMessage", getJobMessage()) + .append("status", getStatus()) + .append("exceptionInfo", getExceptionInfo()) + .append("startTime", getStartTime()) + .append("stopTime", getStopTime()) + .toString(); + } +} diff --git a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/mapper/SysJobLogMapper.java b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/mapper/SysJobLogMapper.java new file mode 100644 index 0000000..91ebc05 --- /dev/null +++ b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/mapper/SysJobLogMapper.java @@ -0,0 +1,64 @@ +package com.ruoyi.quartz.mapper; + +import java.util.List; +import com.ruoyi.quartz.domain.SysJobLog; + +/** + * 调度任务日志信息 数据层 + * + * @author #author# + */ +public interface SysJobLogMapper +{ + /** + * 获取quartz调度器日志的计划任务 + * + * @param jobLog 调度日志信息 + * @return 调度任务日志集合 + */ + public List selectJobLogList(SysJobLog jobLog); + + /** + * 查询所有调度任务日志 + * + * @return 调度任务日志列表 + */ + public List selectJobLogAll(); + + /** + * 通过调度任务日志ID查询调度信息 + * + * @param jobLogId 调度任务日志ID + * @return 调度任务日志对象信息 + */ + public SysJobLog selectJobLogById(Long jobLogId); + + /** + * 新增任务日志 + * + * @param jobLog 调度日志信息 + * @return 结果 + */ + public int insertJobLog(SysJobLog jobLog); + + /** + * 批量删除调度日志信息 + * + * @param logIds 需要删除的数据ID + * @return 结果 + */ + public int deleteJobLogByIds(Long[] logIds); + + /** + * 删除任务日志 + * + * @param jobId 调度日志ID + * @return 结果 + */ + public int deleteJobLogById(Long jobId); + + /** + * 清空任务日志 + */ + public void cleanJobLog(); +} diff --git a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/mapper/SysJobMapper.java b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/mapper/SysJobMapper.java new file mode 100644 index 0000000..eac833b --- /dev/null +++ b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/mapper/SysJobMapper.java @@ -0,0 +1,67 @@ +package com.ruoyi.quartz.mapper; + +import java.util.List; +import com.ruoyi.quartz.domain.SysJob; + +/** + * 调度任务信息 数据层 + * + * @author #author# + */ +public interface SysJobMapper +{ + /** + * 查询调度任务日志集合 + * + * @param job 调度信息 + * @return 操作日志集合 + */ + public List selectJobList(SysJob job); + + /** + * 查询所有调度任务 + * + * @return 调度任务列表 + */ + public List selectJobAll(); + + /** + * 通过调度ID查询调度任务信息 + * + * @param jobId 调度ID + * @return 角色对象信息 + */ + public SysJob selectJobById(Long jobId); + + /** + * 通过调度ID删除调度任务信息 + * + * @param jobId 调度ID + * @return 结果 + */ + public int deleteJobById(Long jobId); + + /** + * 批量删除调度任务信息 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteJobByIds(Long[] ids); + + /** + * 修改调度任务信息 + * + * @param job 调度任务信息 + * @return 结果 + */ + public int updateJob(SysJob job); + + /** + * 新增调度任务信息 + * + * @param job 调度任务信息 + * @return 结果 + */ + public int insertJob(SysJob job); +} diff --git a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/ISysJobLogService.java b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/ISysJobLogService.java new file mode 100644 index 0000000..54a914c --- /dev/null +++ b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/ISysJobLogService.java @@ -0,0 +1,56 @@ +package com.ruoyi.quartz.service; + +import java.util.List; +import com.ruoyi.quartz.domain.SysJobLog; + +/** + * 定时任务调度日志信息信息 服务层 + * + * @author #author# + */ +public interface ISysJobLogService +{ + /** + * 获取quartz调度器日志的计划任务 + * + * @param jobLog 调度日志信息 + * @return 调度任务日志集合 + */ + public List selectJobLogList(SysJobLog jobLog); + + /** + * 通过调度任务日志ID查询调度信息 + * + * @param jobLogId 调度任务日志ID + * @return 调度任务日志对象信息 + */ + public SysJobLog selectJobLogById(Long jobLogId); + + /** + * 新增任务日志 + * + * @param jobLog 调度日志信息 + */ + public void addJobLog(SysJobLog jobLog); + + /** + * 批量删除调度日志信息 + * + * @param logIds 需要删除的日志ID + * @return 结果 + */ + public int deleteJobLogByIds(Long[] logIds); + + /** + * 删除任务日志 + * + * @param jobId 调度日志ID + * @return 结果 + */ + public int deleteJobLogById(Long jobId); + + /** + * 清空任务日志 + */ + public void cleanJobLog(); +} diff --git a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/ISysJobService.java b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/ISysJobService.java new file mode 100644 index 0000000..737ec98 --- /dev/null +++ b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/ISysJobService.java @@ -0,0 +1,102 @@ +package com.ruoyi.quartz.service; + +import java.util.List; +import org.quartz.SchedulerException; +import com.ruoyi.common.exception.job.TaskException; +import com.ruoyi.quartz.domain.SysJob; + +/** + * 定时任务调度信息信息 服务层 + * + * @author #author# + */ +public interface ISysJobService +{ + /** + * 获取quartz调度器的计划任务 + * + * @param job 调度信息 + * @return 调度任务集合 + */ + public List selectJobList(SysJob job); + + /** + * 通过调度任务ID查询调度信息 + * + * @param jobId 调度任务ID + * @return 调度任务对象信息 + */ + public SysJob selectJobById(Long jobId); + + /** + * 暂停任务 + * + * @param job 调度信息 + * @return 结果 + */ + public int pauseJob(SysJob job) throws SchedulerException; + + /** + * 恢复任务 + * + * @param job 调度信息 + * @return 结果 + */ + public int resumeJob(SysJob job) throws SchedulerException; + + /** + * 删除任务后,所对应的trigger也将被删除 + * + * @param job 调度信息 + * @return 结果 + */ + public int deleteJob(SysJob job) throws SchedulerException; + + /** + * 批量删除调度信息 + * + * @param jobIds 需要删除的任务ID + * @return 结果 + */ + public void deleteJobByIds(Long[] jobIds) throws SchedulerException; + + /** + * 任务调度状态修改 + * + * @param job 调度信息 + * @return 结果 + */ + public int changeStatus(SysJob job) throws SchedulerException; + + /** + * 立即运行任务 + * + * @param job 调度信息 + * @return 结果 + */ + public boolean run(SysJob job) throws SchedulerException; + + /** + * 新增任务 + * + * @param job 调度信息 + * @return 结果 + */ + public int insertJob(SysJob job) throws SchedulerException, TaskException; + + /** + * 更新任务 + * + * @param job 调度信息 + * @return 结果 + */ + public int updateJob(SysJob job) throws SchedulerException, TaskException; + + /** + * 校验cron表达式是否有效 + * + * @param cronExpression 表达式 + * @return 结果 + */ + public boolean checkCronExpressionIsValid(String cronExpression); +} diff --git a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/impl/SysJobLogServiceImpl.java b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/impl/SysJobLogServiceImpl.java new file mode 100644 index 0000000..3572f4d --- /dev/null +++ b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/impl/SysJobLogServiceImpl.java @@ -0,0 +1,87 @@ +package com.ruoyi.quartz.service.impl; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.quartz.domain.SysJobLog; +import com.ruoyi.quartz.mapper.SysJobLogMapper; +import com.ruoyi.quartz.service.ISysJobLogService; + +/** + * 定时任务调度日志信息 服务层 + * + * @author #author# + */ +@Service +public class SysJobLogServiceImpl implements ISysJobLogService +{ + @Autowired + private SysJobLogMapper jobLogMapper; + + /** + * 获取quartz调度器日志的计划任务 + * + * @param jobLog 调度日志信息 + * @return 调度任务日志集合 + */ + @Override + public List selectJobLogList(SysJobLog jobLog) + { + return jobLogMapper.selectJobLogList(jobLog); + } + + /** + * 通过调度任务日志ID查询调度信息 + * + * @param jobLogId 调度任务日志ID + * @return 调度任务日志对象信息 + */ + @Override + public SysJobLog selectJobLogById(Long jobLogId) + { + return jobLogMapper.selectJobLogById(jobLogId); + } + + /** + * 新增任务日志 + * + * @param jobLog 调度日志信息 + */ + @Override + public void addJobLog(SysJobLog jobLog) + { + jobLogMapper.insertJobLog(jobLog); + } + + /** + * 批量删除调度日志信息 + * + * @param logIds 需要删除的数据ID + * @return 结果 + */ + @Override + public int deleteJobLogByIds(Long[] logIds) + { + return jobLogMapper.deleteJobLogByIds(logIds); + } + + /** + * 删除任务日志 + * + * @param jobId 调度日志ID + */ + @Override + public int deleteJobLogById(Long jobId) + { + return jobLogMapper.deleteJobLogById(jobId); + } + + /** + * 清空任务日志 + */ + @Override + public void cleanJobLog() + { + jobLogMapper.cleanJobLog(); + } +} diff --git a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/impl/SysJobServiceImpl.java b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/impl/SysJobServiceImpl.java new file mode 100644 index 0000000..43571f1 --- /dev/null +++ b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/impl/SysJobServiceImpl.java @@ -0,0 +1,261 @@ +package com.ruoyi.quartz.service.impl; + +import java.util.List; +import javax.annotation.PostConstruct; +import org.quartz.JobDataMap; +import org.quartz.JobKey; +import org.quartz.Scheduler; +import org.quartz.SchedulerException; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import com.ruoyi.common.constant.ScheduleConstants; +import com.ruoyi.common.exception.job.TaskException; +import com.ruoyi.quartz.domain.SysJob; +import com.ruoyi.quartz.mapper.SysJobMapper; +import com.ruoyi.quartz.service.ISysJobService; +import com.ruoyi.quartz.util.CronUtils; +import com.ruoyi.quartz.util.ScheduleUtils; + +/** + * 定时任务调度信息 服务层 + * + * @author #author# + */ +@Service +public class SysJobServiceImpl implements ISysJobService +{ + @Autowired + private Scheduler scheduler; + + @Autowired + private SysJobMapper jobMapper; + + /** + * 项目启动时,初始化定时器 主要是防止手动修改数据库导致未同步到定时任务处理(注:不能手动修改数据库ID和任务组名,否则会导致脏数据) + */ + @PostConstruct + public void init() throws SchedulerException, TaskException + { + scheduler.clear(); + List jobList = jobMapper.selectJobAll(); + for (SysJob job : jobList) + { + ScheduleUtils.createScheduleJob(scheduler, job); + } + } + + /** + * 获取quartz调度器的计划任务列表 + * + * @param job 调度信息 + * @return + */ + @Override + public List selectJobList(SysJob job) + { + return jobMapper.selectJobList(job); + } + + /** + * 通过调度任务ID查询调度信息 + * + * @param jobId 调度任务ID + * @return 调度任务对象信息 + */ + @Override + public SysJob selectJobById(Long jobId) + { + return jobMapper.selectJobById(jobId); + } + + /** + * 暂停任务 + * + * @param job 调度信息 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public int pauseJob(SysJob job) throws SchedulerException + { + Long jobId = job.getJobId(); + String jobGroup = job.getJobGroup(); + job.setStatus(ScheduleConstants.Status.PAUSE.getValue()); + int rows = jobMapper.updateJob(job); + if (rows > 0) + { + scheduler.pauseJob(ScheduleUtils.getJobKey(jobId, jobGroup)); + } + return rows; + } + + /** + * 恢复任务 + * + * @param job 调度信息 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public int resumeJob(SysJob job) throws SchedulerException + { + Long jobId = job.getJobId(); + String jobGroup = job.getJobGroup(); + job.setStatus(ScheduleConstants.Status.NORMAL.getValue()); + int rows = jobMapper.updateJob(job); + if (rows > 0) + { + scheduler.resumeJob(ScheduleUtils.getJobKey(jobId, jobGroup)); + } + return rows; + } + + /** + * 删除任务后,所对应的trigger也将被删除 + * + * @param job 调度信息 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public int deleteJob(SysJob job) throws SchedulerException + { + Long jobId = job.getJobId(); + String jobGroup = job.getJobGroup(); + int rows = jobMapper.deleteJobById(jobId); + if (rows > 0) + { + scheduler.deleteJob(ScheduleUtils.getJobKey(jobId, jobGroup)); + } + return rows; + } + + /** + * 批量删除调度信息 + * + * @param jobIds 需要删除的任务ID + * @return 结果 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void deleteJobByIds(Long[] jobIds) throws SchedulerException + { + for (Long jobId : jobIds) + { + SysJob job = jobMapper.selectJobById(jobId); + deleteJob(job); + } + } + + /** + * 任务调度状态修改 + * + * @param job 调度信息 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public int changeStatus(SysJob job) throws SchedulerException + { + int rows = 0; + String status = job.getStatus(); + if (ScheduleConstants.Status.NORMAL.getValue().equals(status)) + { + rows = resumeJob(job); + } + else if (ScheduleConstants.Status.PAUSE.getValue().equals(status)) + { + rows = pauseJob(job); + } + return rows; + } + + /** + * 立即运行任务 + * + * @param job 调度信息 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public boolean run(SysJob job) throws SchedulerException + { + boolean result = false; + Long jobId = job.getJobId(); + String jobGroup = job.getJobGroup(); + SysJob properties = selectJobById(job.getJobId()); + // 参数 + JobDataMap dataMap = new JobDataMap(); + dataMap.put(ScheduleConstants.TASK_PROPERTIES, properties); + JobKey jobKey = ScheduleUtils.getJobKey(jobId, jobGroup); + if (scheduler.checkExists(jobKey)) + { + result = true; + scheduler.triggerJob(jobKey, dataMap); + } + return result; + } + + /** + * 新增任务 + * + * @param job 调度信息 调度信息 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public int insertJob(SysJob job) throws SchedulerException, TaskException + { + job.setStatus(ScheduleConstants.Status.PAUSE.getValue()); + int rows = jobMapper.insertJob(job); + if (rows > 0) + { + ScheduleUtils.createScheduleJob(scheduler, job); + } + return rows; + } + + /** + * 更新任务的时间表达式 + * + * @param job 调度信息 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public int updateJob(SysJob job) throws SchedulerException, TaskException + { + SysJob properties = selectJobById(job.getJobId()); + int rows = jobMapper.updateJob(job); + if (rows > 0) + { + updateSchedulerJob(job, properties.getJobGroup()); + } + return rows; + } + + /** + * 更新任务 + * + * @param job 任务对象 + * @param jobGroup 任务组名 + */ + public void updateSchedulerJob(SysJob job, String jobGroup) throws SchedulerException, TaskException + { + Long jobId = job.getJobId(); + // 判断是否存在 + JobKey jobKey = ScheduleUtils.getJobKey(jobId, jobGroup); + if (scheduler.checkExists(jobKey)) + { + // 防止创建时存在数据问题 先移除,然后在执行创建操作 + scheduler.deleteJob(jobKey); + } + ScheduleUtils.createScheduleJob(scheduler, job); + } + + /** + * 校验cron表达式是否有效 + * + * @param cronExpression 表达式 + * @return 结果 + */ + @Override + public boolean checkCronExpressionIsValid(String cronExpression) + { + return CronUtils.isValid(cronExpression); + } +} diff --git a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RyTask.java b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RyTask.java new file mode 100644 index 0000000..086eda4 --- /dev/null +++ b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RyTask.java @@ -0,0 +1,28 @@ +package com.ruoyi.quartz.task; + +import org.springframework.stereotype.Component; +import com.ruoyi.common.utils.StringUtils; + +/** + * 定时任务调度测试 + * + * @author #author# + */ +@Component("ryTask") +public class RyTask +{ + public void ryMultipleParams(String s, Boolean b, Long l, Double d, Integer i) + { + System.out.println(StringUtils.format("执行多参方法: 字符串类型{},布尔类型{},长整型{},浮点型{},整形{}", s, b, l, d, i)); + } + + public void ryParams(String params) + { + System.out.println("执行有参方法:" + params); + } + + public void ryNoParams() + { + System.out.println("执行无参方法"); + } +} diff --git a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/AbstractQuartzJob.java b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/AbstractQuartzJob.java new file mode 100644 index 0000000..f241c54 --- /dev/null +++ b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/AbstractQuartzJob.java @@ -0,0 +1,107 @@ +package com.ruoyi.quartz.util; + +import java.util.Date; +import org.quartz.Job; +import org.quartz.JobExecutionContext; +import org.quartz.JobExecutionException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import com.ruoyi.common.constant.Constants; +import com.ruoyi.common.constant.ScheduleConstants; +import com.ruoyi.common.utils.ExceptionUtil; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.common.utils.bean.BeanUtils; +import com.ruoyi.common.utils.spring.SpringUtils; +import com.ruoyi.quartz.domain.SysJob; +import com.ruoyi.quartz.domain.SysJobLog; +import com.ruoyi.quartz.service.ISysJobLogService; + +/** + * 抽象quartz调用 + * + * @author #author# + */ +public abstract class AbstractQuartzJob implements Job +{ + private static final Logger log = LoggerFactory.getLogger(AbstractQuartzJob.class); + + /** + * 线程本地变量 + */ + private static ThreadLocal threadLocal = new ThreadLocal<>(); + + @Override + public void execute(JobExecutionContext context) throws JobExecutionException + { + SysJob sysJob = new SysJob(); + BeanUtils.copyBeanProp(sysJob, context.getMergedJobDataMap().get(ScheduleConstants.TASK_PROPERTIES)); + try + { + before(context, sysJob); + if (sysJob != null) + { + doExecute(context, sysJob); + } + after(context, sysJob, null); + } + catch (Exception e) + { + log.error("任务执行异常 - :", e); + after(context, sysJob, e); + } + } + + /** + * 执行前 + * + * @param context 工作执行上下文对象 + * @param sysJob 系统计划任务 + */ + protected void before(JobExecutionContext context, SysJob sysJob) + { + threadLocal.set(new Date()); + } + + /** + * 执行后 + * + * @param context 工作执行上下文对象 + * @param sysJob 系统计划任务 + */ + protected void after(JobExecutionContext context, SysJob sysJob, Exception e) + { + Date startTime = threadLocal.get(); + threadLocal.remove(); + + final SysJobLog sysJobLog = new SysJobLog(); + sysJobLog.setJobName(sysJob.getJobName()); + sysJobLog.setJobGroup(sysJob.getJobGroup()); + sysJobLog.setInvokeTarget(sysJob.getInvokeTarget()); + sysJobLog.setStartTime(startTime); + sysJobLog.setStopTime(new Date()); + long runMs = sysJobLog.getStopTime().getTime() - sysJobLog.getStartTime().getTime(); + sysJobLog.setJobMessage(sysJobLog.getJobName() + " 总共耗时:" + runMs + "毫秒"); + if (e != null) + { + sysJobLog.setStatus(Constants.FAIL); + String errorMsg = StringUtils.substring(ExceptionUtil.getExceptionMessage(e), 0, 2000); + sysJobLog.setExceptionInfo(errorMsg); + } + else + { + sysJobLog.setStatus(Constants.SUCCESS); + } + + // 写入数据库当中 + SpringUtils.getBean(ISysJobLogService.class).addJobLog(sysJobLog); + } + + /** + * 执行方法,由子类重载 + * + * @param context 工作执行上下文对象 + * @param sysJob 系统计划任务 + * @throws Exception 执行过程中的异常 + */ + protected abstract void doExecute(JobExecutionContext context, SysJob sysJob) throws Exception; +} diff --git a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/CronUtils.java b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/CronUtils.java new file mode 100644 index 0000000..6eb0de8 --- /dev/null +++ b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/CronUtils.java @@ -0,0 +1,63 @@ +package com.ruoyi.quartz.util; + +import java.text.ParseException; +import java.util.Date; +import org.quartz.CronExpression; + +/** + * cron表达式工具类 + * + * @author #author# + * + */ +public class CronUtils +{ + /** + * 返回一个布尔值代表一个给定的Cron表达式的有效性 + * + * @param cronExpression Cron表达式 + * @return boolean 表达式是否有效 + */ + public static boolean isValid(String cronExpression) + { + return CronExpression.isValidExpression(cronExpression); + } + + /** + * 返回一个字符串值,表示该消息无效Cron表达式给出有效性 + * + * @param cronExpression Cron表达式 + * @return String 无效时返回表达式错误描述,如果有效返回null + */ + public static String getInvalidMessage(String cronExpression) + { + try + { + new CronExpression(cronExpression); + return null; + } + catch (ParseException pe) + { + return pe.getMessage(); + } + } + + /** + * 返回下一个执行时间根据给定的Cron表达式 + * + * @param cronExpression Cron表达式 + * @return Date 下次Cron表达式执行时间 + */ + public static Date getNextExecution(String cronExpression) + { + try + { + CronExpression cron = new CronExpression(cronExpression); + return cron.getNextValidTimeAfter(new Date(System.currentTimeMillis())); + } + catch (ParseException e) + { + throw new IllegalArgumentException(e.getMessage()); + } + } +} diff --git a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/JobInvokeUtil.java b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/JobInvokeUtil.java new file mode 100644 index 0000000..2d24e15 --- /dev/null +++ b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/JobInvokeUtil.java @@ -0,0 +1,182 @@ +package com.ruoyi.quartz.util; + +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.LinkedList; +import java.util.List; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.common.utils.spring.SpringUtils; +import com.ruoyi.quartz.domain.SysJob; + +/** + * 任务执行工具 + * + * @author #author# + */ +public class JobInvokeUtil +{ + /** + * 执行方法 + * + * @param sysJob 系统任务 + */ + public static void invokeMethod(SysJob sysJob) throws Exception + { + String invokeTarget = sysJob.getInvokeTarget(); + String beanName = getBeanName(invokeTarget); + String methodName = getMethodName(invokeTarget); + List methodParams = getMethodParams(invokeTarget); + + if (!isValidClassName(beanName)) + { + Object bean = SpringUtils.getBean(beanName); + invokeMethod(bean, methodName, methodParams); + } + else + { + Object bean = Class.forName(beanName).newInstance(); + invokeMethod(bean, methodName, methodParams); + } + } + + /** + * 调用任务方法 + * + * @param bean 目标对象 + * @param methodName 方法名称 + * @param methodParams 方法参数 + */ + private static void invokeMethod(Object bean, String methodName, List methodParams) + throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, + InvocationTargetException + { + if (StringUtils.isNotNull(methodParams) && methodParams.size() > 0) + { + Method method = bean.getClass().getMethod(methodName, getMethodParamsType(methodParams)); + method.invoke(bean, getMethodParamsValue(methodParams)); + } + else + { + Method method = bean.getClass().getMethod(methodName); + method.invoke(bean); + } + } + + /** + * 校验是否为为class包名 + * + * @param invokeTarget 名称 + * @return true是 false否 + */ + public static boolean isValidClassName(String invokeTarget) + { + return StringUtils.countMatches(invokeTarget, ".") > 1; + } + + /** + * 获取bean名称 + * + * @param invokeTarget 目标字符串 + * @return bean名称 + */ + public static String getBeanName(String invokeTarget) + { + String beanName = StringUtils.substringBefore(invokeTarget, "("); + return StringUtils.substringBeforeLast(beanName, "."); + } + + /** + * 获取bean方法 + * + * @param invokeTarget 目标字符串 + * @return method方法 + */ + public static String getMethodName(String invokeTarget) + { + String methodName = StringUtils.substringBefore(invokeTarget, "("); + return StringUtils.substringAfterLast(methodName, "."); + } + + /** + * 获取method方法参数相关列表 + * + * @param invokeTarget 目标字符串 + * @return method方法相关参数列表 + */ + public static List getMethodParams(String invokeTarget) + { + String methodStr = StringUtils.substringBetween(invokeTarget, "(", ")"); + if (StringUtils.isEmpty(methodStr)) + { + return null; + } + String[] methodParams = methodStr.split(",(?=([^\"']*[\"'][^\"']*[\"'])*[^\"']*$)"); + List classs = new LinkedList<>(); + for (int i = 0; i < methodParams.length; i++) + { + String str = StringUtils.trimToEmpty(methodParams[i]); + // String字符串类型,以'或"开头 + if (StringUtils.startsWithAny(str, "'", "\"")) + { + classs.add(new Object[] { StringUtils.substring(str, 1, str.length() - 1), String.class }); + } + // boolean布尔类型,等于true或者false + else if ("true".equalsIgnoreCase(str) || "false".equalsIgnoreCase(str)) + { + classs.add(new Object[] { Boolean.valueOf(str), Boolean.class }); + } + // long长整形,以L结尾 + else if (StringUtils.endsWith(str, "L")) + { + classs.add(new Object[] { Long.valueOf(StringUtils.substring(str, 0, str.length() - 1)), Long.class }); + } + // double浮点类型,以D结尾 + else if (StringUtils.endsWith(str, "D")) + { + classs.add(new Object[] { Double.valueOf(StringUtils.substring(str, 0, str.length() - 1)), Double.class }); + } + // 其他类型归类为整形 + else + { + classs.add(new Object[] { Integer.valueOf(str), Integer.class }); + } + } + return classs; + } + + /** + * 获取参数类型 + * + * @param methodParams 参数相关列表 + * @return 参数类型列表 + */ + public static Class[] getMethodParamsType(List methodParams) + { + Class[] classs = new Class[methodParams.size()]; + int index = 0; + for (Object[] os : methodParams) + { + classs[index] = (Class) os[1]; + index++; + } + return classs; + } + + /** + * 获取参数值 + * + * @param methodParams 参数相关列表 + * @return 参数值列表 + */ + public static Object[] getMethodParamsValue(List methodParams) + { + Object[] classs = new Object[methodParams.size()]; + int index = 0; + for (Object[] os : methodParams) + { + classs[index] = (Object) os[0]; + index++; + } + return classs; + } +} diff --git a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/QuartzDisallowConcurrentExecution.java b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/QuartzDisallowConcurrentExecution.java new file mode 100644 index 0000000..d275667 --- /dev/null +++ b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/QuartzDisallowConcurrentExecution.java @@ -0,0 +1,21 @@ +package com.ruoyi.quartz.util; + +import org.quartz.DisallowConcurrentExecution; +import org.quartz.JobExecutionContext; +import com.ruoyi.quartz.domain.SysJob; + +/** + * 定时任务处理(禁止并发执行) + * + * @author #author# + * + */ +@DisallowConcurrentExecution +public class QuartzDisallowConcurrentExecution extends AbstractQuartzJob +{ + @Override + protected void doExecute(JobExecutionContext context, SysJob sysJob) throws Exception + { + JobInvokeUtil.invokeMethod(sysJob); + } +} diff --git a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/QuartzJobExecution.java b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/QuartzJobExecution.java new file mode 100644 index 0000000..f0e09ab --- /dev/null +++ b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/QuartzJobExecution.java @@ -0,0 +1,19 @@ +package com.ruoyi.quartz.util; + +import org.quartz.JobExecutionContext; +import com.ruoyi.quartz.domain.SysJob; + +/** + * 定时任务处理(允许并发执行) + * + * @author #author# + * + */ +public class QuartzJobExecution extends AbstractQuartzJob +{ + @Override + protected void doExecute(JobExecutionContext context, SysJob sysJob) throws Exception + { + JobInvokeUtil.invokeMethod(sysJob); + } +} diff --git a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/ScheduleUtils.java b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/ScheduleUtils.java new file mode 100644 index 0000000..456f945 --- /dev/null +++ b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/ScheduleUtils.java @@ -0,0 +1,139 @@ +package com.ruoyi.quartz.util; + +import org.quartz.CronScheduleBuilder; +import org.quartz.CronTrigger; +import org.quartz.Job; +import org.quartz.JobBuilder; +import org.quartz.JobDetail; +import org.quartz.JobKey; +import org.quartz.Scheduler; +import org.quartz.SchedulerException; +import org.quartz.TriggerBuilder; +import org.quartz.TriggerKey; +import com.ruoyi.common.constant.Constants; +import com.ruoyi.common.constant.ScheduleConstants; +import com.ruoyi.common.exception.job.TaskException; +import com.ruoyi.common.exception.job.TaskException.Code; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.common.utils.spring.SpringUtils; +import com.ruoyi.quartz.domain.SysJob; + +/** + * 定时任务工具类 + * + * @author #author# + * + */ +public class ScheduleUtils +{ + /** + * 得到quartz任务类 + * + * @param sysJob 执行计划 + * @return 具体执行任务类 + */ + private static Class getQuartzJobClass(SysJob sysJob) + { + boolean isConcurrent = "0".equals(sysJob.getConcurrent()); + return isConcurrent ? QuartzJobExecution.class : QuartzDisallowConcurrentExecution.class; + } + + /** + * 构建任务触发对象 + */ + public static TriggerKey getTriggerKey(Long jobId, String jobGroup) + { + return TriggerKey.triggerKey(ScheduleConstants.TASK_CLASS_NAME + jobId, jobGroup); + } + + /** + * 构建任务键对象 + */ + public static JobKey getJobKey(Long jobId, String jobGroup) + { + return JobKey.jobKey(ScheduleConstants.TASK_CLASS_NAME + jobId, jobGroup); + } + + /** + * 创建定时任务 + */ + public static void createScheduleJob(Scheduler scheduler, SysJob job) throws SchedulerException, TaskException + { + Class jobClass = getQuartzJobClass(job); + // 构建job信息 + Long jobId = job.getJobId(); + String jobGroup = job.getJobGroup(); + JobDetail jobDetail = JobBuilder.newJob(jobClass).withIdentity(getJobKey(jobId, jobGroup)).build(); + + // 表达式调度构建器 + CronScheduleBuilder cronScheduleBuilder = CronScheduleBuilder.cronSchedule(job.getCronExpression()); + cronScheduleBuilder = handleCronScheduleMisfirePolicy(job, cronScheduleBuilder); + + // 按新的cronExpression表达式构建一个新的trigger + CronTrigger trigger = TriggerBuilder.newTrigger().withIdentity(getTriggerKey(jobId, jobGroup)) + .withSchedule(cronScheduleBuilder).build(); + + // 放入参数,运行时的方法可以获取 + jobDetail.getJobDataMap().put(ScheduleConstants.TASK_PROPERTIES, job); + + // 判断是否存在 + if (scheduler.checkExists(getJobKey(jobId, jobGroup))) + { + // 防止创建时存在数据问题 先移除,然后在执行创建操作 + scheduler.deleteJob(getJobKey(jobId, jobGroup)); + } + + // 判断任务是否过期 + if (StringUtils.isNotNull(CronUtils.getNextExecution(job.getCronExpression()))) + { + // 执行调度任务 + scheduler.scheduleJob(jobDetail, trigger); + } + + // 暂停任务 + if (job.getStatus().equals(ScheduleConstants.Status.PAUSE.getValue())) + { + scheduler.pauseJob(ScheduleUtils.getJobKey(jobId, jobGroup)); + } + } + + /** + * 设置定时任务策略 + */ + public static CronScheduleBuilder handleCronScheduleMisfirePolicy(SysJob job, CronScheduleBuilder cb) + throws TaskException + { + switch (job.getMisfirePolicy()) + { + case ScheduleConstants.MISFIRE_DEFAULT: + return cb; + case ScheduleConstants.MISFIRE_IGNORE_MISFIRES: + return cb.withMisfireHandlingInstructionIgnoreMisfires(); + case ScheduleConstants.MISFIRE_FIRE_AND_PROCEED: + return cb.withMisfireHandlingInstructionFireAndProceed(); + case ScheduleConstants.MISFIRE_DO_NOTHING: + return cb.withMisfireHandlingInstructionDoNothing(); + default: + throw new TaskException("The task misfire policy '" + job.getMisfirePolicy() + + "' cannot be used in cron schedule tasks", Code.CONFIG_ERROR); + } + } + + /** + * 检查包名是否为白名单配置 + * + * @param invokeTarget 目标字符串 + * @return 结果 + */ + public static boolean whiteList(String invokeTarget) + { + String packageName = StringUtils.substringBefore(invokeTarget, "("); + int count = StringUtils.countMatches(packageName, "."); + if (count > 1) + { + return StringUtils.containsAnyIgnoreCase(invokeTarget, Constants.JOB_WHITELIST_STR); + } + Object obj = SpringUtils.getBean(StringUtils.split(invokeTarget, ".")[0]); + return StringUtils.containsAnyIgnoreCase(obj.getClass().getPackage().getName(), Constants.JOB_WHITELIST_STR); + } +} diff --git a/ruoyi-quartz/src/main/resources/mapper/quartz/SysJobLogMapper.xml b/ruoyi-quartz/src/main/resources/mapper/quartz/SysJobLogMapper.xml new file mode 100644 index 0000000..e608e42 --- /dev/null +++ b/ruoyi-quartz/src/main/resources/mapper/quartz/SysJobLogMapper.xml @@ -0,0 +1,93 @@ + + + + + + + + + + + + + + + + + select job_log_id, job_name, job_group, invoke_target, job_message, status, exception_info, create_time + from sys_job_log + + + + + + + + + + delete from sys_job_log where job_log_id = #{jobLogId} + + + + delete from sys_job_log where job_log_id in + + #{jobLogId} + + + + + truncate table sys_job_log + + + + insert into sys_job_log( + job_log_id, + job_name, + job_group, + invoke_target, + job_message, + status, + exception_info, + create_time + )values( + #{jobLogId}, + #{jobName}, + #{jobGroup}, + #{invokeTarget}, + #{jobMessage}, + #{status}, + #{exceptionInfo}, + sysdate() + ) + + + \ No newline at end of file diff --git a/ruoyi-quartz/src/main/resources/mapper/quartz/SysJobMapper.xml b/ruoyi-quartz/src/main/resources/mapper/quartz/SysJobMapper.xml new file mode 100644 index 0000000..5605c44 --- /dev/null +++ b/ruoyi-quartz/src/main/resources/mapper/quartz/SysJobMapper.xml @@ -0,0 +1,111 @@ + + + + + + + + + + + + + + + + + + + + + + select job_id, job_name, job_group, invoke_target, cron_expression, misfire_policy, concurrent, status, create_by, create_time, remark + from sys_job + + + + + + + + + + delete from sys_job where job_id = #{jobId} + + + + delete from sys_job where job_id in + + #{jobId} + + + + + update sys_job + + job_name = #{jobName}, + job_group = #{jobGroup}, + invoke_target = #{invokeTarget}, + cron_expression = #{cronExpression}, + misfire_policy = #{misfirePolicy}, + concurrent = #{concurrent}, + status = #{status}, + remark = #{remark}, + update_by = #{updateBy}, + update_time = sysdate() + + where job_id = #{jobId} + + + + insert into sys_job( + job_id, + job_name, + job_group, + invoke_target, + cron_expression, + misfire_policy, + concurrent, + status, + remark, + create_by, + create_time + )values( + #{jobId}, + #{jobName}, + #{jobGroup}, + #{invokeTarget}, + #{cronExpression}, + #{misfirePolicy}, + #{concurrent}, + #{status}, + #{remark}, + #{createBy}, + sysdate() + ) + + + \ No newline at end of file diff --git a/ruoyi-system/pom.xml b/ruoyi-system/pom.xml new file mode 100644 index 0000000..aa268bd --- /dev/null +++ b/ruoyi-system/pom.xml @@ -0,0 +1,28 @@ + + + + ruoyi + com.ruoyi + 3.8.5 + + 4.0.0 + + ruoyi-system + + + system系统模块 + + + + + + + com.ruoyi + ruoyi-common + + + + + \ No newline at end of file diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysCache.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysCache.java new file mode 100644 index 0000000..b134b16 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysCache.java @@ -0,0 +1,81 @@ +package com.ruoyi.system.domain; + +import com.ruoyi.common.utils.StringUtils; + +/** + * 缓存信息 + * + * @author #author# + */ +public class SysCache +{ + /** 缓存名称 */ + private String cacheName = ""; + + /** 缓存键名 */ + private String cacheKey = ""; + + /** 缓存内容 */ + private String cacheValue = ""; + + /** 备注 */ + private String remark = ""; + + public SysCache() + { + + } + + public SysCache(String cacheName, String remark) + { + this.cacheName = cacheName; + this.remark = remark; + } + + public SysCache(String cacheName, String cacheKey, String cacheValue) + { + this.cacheName = StringUtils.replace(cacheName, ":", ""); + this.cacheKey = StringUtils.replace(cacheKey, cacheName, ""); + this.cacheValue = cacheValue; + } + + public String getCacheName() + { + return cacheName; + } + + public void setCacheName(String cacheName) + { + this.cacheName = cacheName; + } + + public String getCacheKey() + { + return cacheKey; + } + + public void setCacheKey(String cacheKey) + { + this.cacheKey = cacheKey; + } + + public String getCacheValue() + { + return cacheValue; + } + + public void setCacheValue(String cacheValue) + { + this.cacheValue = cacheValue; + } + + public String getRemark() + { + return remark; + } + + public void setRemark(String remark) + { + this.remark = remark; + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysConfig.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysConfig.java new file mode 100644 index 0000000..b76d439 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysConfig.java @@ -0,0 +1,111 @@ +package com.ruoyi.system.domain; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.Size; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.annotation.Excel.ColumnType; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * 参数配置表 sys_config + * + * @author #author# + */ +public class SysConfig extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 参数主键 */ + @Excel(name = "参数主键", cellType = ColumnType.NUMERIC) + private Long configId; + + /** 参数名称 */ + @Excel(name = "参数名称") + private String configName; + + /** 参数键名 */ + @Excel(name = "参数键名") + private String configKey; + + /** 参数键值 */ + @Excel(name = "参数键值") + private String configValue; + + /** 系统内置(Y是 N否) */ + @Excel(name = "系统内置", readConverterExp = "Y=是,N=否") + private String configType; + + public Long getConfigId() + { + return configId; + } + + public void setConfigId(Long configId) + { + this.configId = configId; + } + + @NotBlank(message = "参数名称不能为空") + @Size(min = 0, max = 100, message = "参数名称不能超过100个字符") + public String getConfigName() + { + return configName; + } + + public void setConfigName(String configName) + { + this.configName = configName; + } + + @NotBlank(message = "参数键名长度不能为空") + @Size(min = 0, max = 100, message = "参数键名长度不能超过100个字符") + public String getConfigKey() + { + return configKey; + } + + public void setConfigKey(String configKey) + { + this.configKey = configKey; + } + + @NotBlank(message = "参数键值不能为空") + @Size(min = 0, max = 500, message = "参数键值长度不能超过500个字符") + public String getConfigValue() + { + return configValue; + } + + public void setConfigValue(String configValue) + { + this.configValue = configValue; + } + + public String getConfigType() + { + return configType; + } + + public void setConfigType(String configType) + { + this.configType = configType; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("configId", getConfigId()) + .append("configName", getConfigName()) + .append("configKey", getConfigKey()) + .append("configValue", getConfigValue()) + .append("configType", getConfigType()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("remark", getRemark()) + .toString(); + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysLogininfor.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysLogininfor.java new file mode 100644 index 0000000..fec817e --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysLogininfor.java @@ -0,0 +1,144 @@ +package com.ruoyi.system.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.annotation.Excel.ColumnType; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * 系统访问记录表 sys_logininfor + * + * @author #author# + */ +public class SysLogininfor extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** ID */ + @Excel(name = "序号", cellType = ColumnType.NUMERIC) + private Long infoId; + + /** 用户账号 */ + @Excel(name = "用户账号") + private String userName; + + /** 登录状态 0成功 1失败 */ + @Excel(name = "登录状态", readConverterExp = "0=成功,1=失败") + private String status; + + /** 登录IP地址 */ + @Excel(name = "登录地址") + private String ipaddr; + + /** 登录地点 */ + @Excel(name = "登录地点") + private String loginLocation; + + /** 浏览器类型 */ + @Excel(name = "浏览器") + private String browser; + + /** 操作系统 */ + @Excel(name = "操作系统") + private String os; + + /** 提示消息 */ + @Excel(name = "提示消息") + private String msg; + + /** 访问时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "访问时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date loginTime; + + public Long getInfoId() + { + return infoId; + } + + public void setInfoId(Long infoId) + { + this.infoId = infoId; + } + + public String getUserName() + { + return userName; + } + + public void setUserName(String userName) + { + this.userName = userName; + } + + public String getStatus() + { + return status; + } + + public void setStatus(String status) + { + this.status = status; + } + + public String getIpaddr() + { + return ipaddr; + } + + public void setIpaddr(String ipaddr) + { + this.ipaddr = ipaddr; + } + + public String getLoginLocation() + { + return loginLocation; + } + + public void setLoginLocation(String loginLocation) + { + this.loginLocation = loginLocation; + } + + public String getBrowser() + { + return browser; + } + + public void setBrowser(String browser) + { + this.browser = browser; + } + + public String getOs() + { + return os; + } + + public void setOs(String os) + { + this.os = os; + } + + public String getMsg() + { + return msg; + } + + public void setMsg(String msg) + { + this.msg = msg; + } + + public Date getLoginTime() + { + return loginTime; + } + + public void setLoginTime(Date loginTime) + { + this.loginTime = loginTime; + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysNotice.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysNotice.java new file mode 100644 index 0000000..4ce6e7b --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysNotice.java @@ -0,0 +1,102 @@ +package com.ruoyi.system.domain; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.Size; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.core.domain.BaseEntity; +import com.ruoyi.common.xss.Xss; + +/** + * 通知公告表 sys_notice + * + * @author #author# + */ +public class SysNotice extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 公告ID */ + private Long noticeId; + + /** 公告标题 */ + private String noticeTitle; + + /** 公告类型(1通知 2公告) */ + private String noticeType; + + /** 公告内容 */ + private String noticeContent; + + /** 公告状态(0正常 1关闭) */ + private String status; + + public Long getNoticeId() + { + return noticeId; + } + + public void setNoticeId(Long noticeId) + { + this.noticeId = noticeId; + } + + public void setNoticeTitle(String noticeTitle) + { + this.noticeTitle = noticeTitle; + } + + @Xss(message = "公告标题不能包含脚本字符") + @NotBlank(message = "公告标题不能为空") + @Size(min = 0, max = 50, message = "公告标题不能超过50个字符") + public String getNoticeTitle() + { + return noticeTitle; + } + + public void setNoticeType(String noticeType) + { + this.noticeType = noticeType; + } + + public String getNoticeType() + { + return noticeType; + } + + public void setNoticeContent(String noticeContent) + { + this.noticeContent = noticeContent; + } + + public String getNoticeContent() + { + return noticeContent; + } + + public void setStatus(String status) + { + this.status = status; + } + + public String getStatus() + { + return status; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("noticeId", getNoticeId()) + .append("noticeTitle", getNoticeTitle()) + .append("noticeType", getNoticeType()) + .append("noticeContent", getNoticeContent()) + .append("status", getStatus()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("remark", getRemark()) + .toString(); + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysOperLog.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysOperLog.java new file mode 100644 index 0000000..410c28c --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysOperLog.java @@ -0,0 +1,255 @@ +package com.ruoyi.system.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.annotation.Excel.ColumnType; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * 操作日志记录表 oper_log + * + * @author #author# + */ +public class SysOperLog extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 日志主键 */ + @Excel(name = "操作序号", cellType = ColumnType.NUMERIC) + private Long operId; + + /** 操作模块 */ + @Excel(name = "操作模块") + private String title; + + /** 业务类型(0其它 1新增 2修改 3删除) */ + @Excel(name = "业务类型", readConverterExp = "0=其它,1=新增,2=修改,3=删除,4=授权,5=导出,6=导入,7=强退,8=生成代码,9=清空数据") + private Integer businessType; + + /** 业务类型数组 */ + private Integer[] businessTypes; + + /** 请求方法 */ + @Excel(name = "请求方法") + private String method; + + /** 请求方式 */ + @Excel(name = "请求方式") + private String requestMethod; + + /** 操作类别(0其它 1后台用户 2手机端用户) */ + @Excel(name = "操作类别", readConverterExp = "0=其它,1=后台用户,2=手机端用户") + private Integer operatorType; + + /** 操作人员 */ + @Excel(name = "操作人员") + private String operName; + + /** 部门名称 */ + @Excel(name = "部门名称") + private String deptName; + + /** 请求url */ + @Excel(name = "请求地址") + private String operUrl; + + /** 操作地址 */ + @Excel(name = "操作地址") + private String operIp; + + /** 操作地点 */ + @Excel(name = "操作地点") + private String operLocation; + + /** 请求参数 */ + @Excel(name = "请求参数") + private String operParam; + + /** 返回参数 */ + @Excel(name = "返回参数") + private String jsonResult; + + /** 操作状态(0正常 1异常) */ + @Excel(name = "状态", readConverterExp = "0=正常,1=异常") + private Integer status; + + /** 错误消息 */ + @Excel(name = "错误消息") + private String errorMsg; + + /** 操作时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "操作时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date operTime; + + public Long getOperId() + { + return operId; + } + + public void setOperId(Long operId) + { + this.operId = operId; + } + + public String getTitle() + { + return title; + } + + public void setTitle(String title) + { + this.title = title; + } + + public Integer getBusinessType() + { + return businessType; + } + + public void setBusinessType(Integer businessType) + { + this.businessType = businessType; + } + + public Integer[] getBusinessTypes() + { + return businessTypes; + } + + public void setBusinessTypes(Integer[] businessTypes) + { + this.businessTypes = businessTypes; + } + + public String getMethod() + { + return method; + } + + public void setMethod(String method) + { + this.method = method; + } + + public String getRequestMethod() + { + return requestMethod; + } + + public void setRequestMethod(String requestMethod) + { + this.requestMethod = requestMethod; + } + + public Integer getOperatorType() + { + return operatorType; + } + + public void setOperatorType(Integer operatorType) + { + this.operatorType = operatorType; + } + + public String getOperName() + { + return operName; + } + + public void setOperName(String operName) + { + this.operName = operName; + } + + public String getDeptName() + { + return deptName; + } + + public void setDeptName(String deptName) + { + this.deptName = deptName; + } + + public String getOperUrl() + { + return operUrl; + } + + public void setOperUrl(String operUrl) + { + this.operUrl = operUrl; + } + + public String getOperIp() + { + return operIp; + } + + public void setOperIp(String operIp) + { + this.operIp = operIp; + } + + public String getOperLocation() + { + return operLocation; + } + + public void setOperLocation(String operLocation) + { + this.operLocation = operLocation; + } + + public String getOperParam() + { + return operParam; + } + + public void setOperParam(String operParam) + { + this.operParam = operParam; + } + + public String getJsonResult() + { + return jsonResult; + } + + public void setJsonResult(String jsonResult) + { + this.jsonResult = jsonResult; + } + + public Integer getStatus() + { + return status; + } + + public void setStatus(Integer status) + { + this.status = status; + } + + public String getErrorMsg() + { + return errorMsg; + } + + public void setErrorMsg(String errorMsg) + { + this.errorMsg = errorMsg; + } + + public Date getOperTime() + { + return operTime; + } + + public void setOperTime(Date operTime) + { + this.operTime = operTime; + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysPost.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysPost.java new file mode 100644 index 0000000..696bb0c --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysPost.java @@ -0,0 +1,124 @@ +package com.ruoyi.system.domain; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.annotation.Excel.ColumnType; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * 岗位表 sys_post + * + * @author #author# + */ +public class SysPost extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 岗位序号 */ + @Excel(name = "岗位序号", cellType = ColumnType.NUMERIC) + private Long postId; + + /** 岗位编码 */ + @Excel(name = "岗位编码") + private String postCode; + + /** 岗位名称 */ + @Excel(name = "岗位名称") + private String postName; + + /** 岗位排序 */ + @Excel(name = "岗位排序") + private Integer postSort; + + /** 状态(0正常 1停用) */ + @Excel(name = "状态", readConverterExp = "0=正常,1=停用") + private String status; + + /** 用户是否存在此岗位标识 默认不存在 */ + private boolean flag = false; + + public Long getPostId() + { + return postId; + } + + public void setPostId(Long postId) + { + this.postId = postId; + } + + @NotBlank(message = "岗位编码不能为空") + @Size(min = 0, max = 64, message = "岗位编码长度不能超过64个字符") + public String getPostCode() + { + return postCode; + } + + public void setPostCode(String postCode) + { + this.postCode = postCode; + } + + @NotBlank(message = "岗位名称不能为空") + @Size(min = 0, max = 50, message = "岗位名称长度不能超过50个字符") + public String getPostName() + { + return postName; + } + + public void setPostName(String postName) + { + this.postName = postName; + } + + @NotNull(message = "显示顺序不能为空") + public Integer getPostSort() + { + return postSort; + } + + public void setPostSort(Integer postSort) + { + this.postSort = postSort; + } + + public String getStatus() + { + return status; + } + + public void setStatus(String status) + { + this.status = status; + } + + public boolean isFlag() + { + return flag; + } + + public void setFlag(boolean flag) + { + this.flag = flag; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("postId", getPostId()) + .append("postCode", getPostCode()) + .append("postName", getPostName()) + .append("postSort", getPostSort()) + .append("status", getStatus()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("remark", getRemark()) + .toString(); + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysRoleDept.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysRoleDept.java new file mode 100644 index 0000000..0b3e5c8 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysRoleDept.java @@ -0,0 +1,46 @@ +package com.ruoyi.system.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +/** + * 角色和部门关联 sys_role_dept + * + * @author #author# + */ +public class SysRoleDept +{ + /** 角色ID */ + private Long roleId; + + /** 部门ID */ + private Long deptId; + + public Long getRoleId() + { + return roleId; + } + + public void setRoleId(Long roleId) + { + this.roleId = roleId; + } + + public Long getDeptId() + { + return deptId; + } + + public void setDeptId(Long deptId) + { + this.deptId = deptId; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("roleId", getRoleId()) + .append("deptId", getDeptId()) + .toString(); + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysRoleMenu.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysRoleMenu.java new file mode 100644 index 0000000..61b779b --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysRoleMenu.java @@ -0,0 +1,46 @@ +package com.ruoyi.system.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +/** + * 角色和菜单关联 sys_role_menu + * + * @author #author# + */ +public class SysRoleMenu +{ + /** 角色ID */ + private Long roleId; + + /** 菜单ID */ + private Long menuId; + + public Long getRoleId() + { + return roleId; + } + + public void setRoleId(Long roleId) + { + this.roleId = roleId; + } + + public Long getMenuId() + { + return menuId; + } + + public void setMenuId(Long menuId) + { + this.menuId = menuId; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("roleId", getRoleId()) + .append("menuId", getMenuId()) + .toString(); + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysUserOnline.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysUserOnline.java new file mode 100644 index 0000000..7242112 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysUserOnline.java @@ -0,0 +1,113 @@ +package com.ruoyi.system.domain; + +/** + * 当前在线会话 + * + * @author #author# + */ +public class SysUserOnline +{ + /** 会话编号 */ + private String tokenId; + + /** 部门名称 */ + private String deptName; + + /** 用户名称 */ + private String userName; + + /** 登录IP地址 */ + private String ipaddr; + + /** 登录地址 */ + private String loginLocation; + + /** 浏览器类型 */ + private String browser; + + /** 操作系统 */ + private String os; + + /** 登录时间 */ + private Long loginTime; + + public String getTokenId() + { + return tokenId; + } + + public void setTokenId(String tokenId) + { + this.tokenId = tokenId; + } + + public String getDeptName() + { + return deptName; + } + + public void setDeptName(String deptName) + { + this.deptName = deptName; + } + + public String getUserName() + { + return userName; + } + + public void setUserName(String userName) + { + this.userName = userName; + } + + public String getIpaddr() + { + return ipaddr; + } + + public void setIpaddr(String ipaddr) + { + this.ipaddr = ipaddr; + } + + public String getLoginLocation() + { + return loginLocation; + } + + public void setLoginLocation(String loginLocation) + { + this.loginLocation = loginLocation; + } + + public String getBrowser() + { + return browser; + } + + public void setBrowser(String browser) + { + this.browser = browser; + } + + public String getOs() + { + return os; + } + + public void setOs(String os) + { + this.os = os; + } + + public Long getLoginTime() + { + return loginTime; + } + + public void setLoginTime(Long loginTime) + { + this.loginTime = loginTime; + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysUserPost.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysUserPost.java new file mode 100644 index 0000000..5a996f4 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysUserPost.java @@ -0,0 +1,46 @@ +package com.ruoyi.system.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +/** + * 用户和岗位关联 sys_user_post + * + * @author #author# + */ +public class SysUserPost +{ + /** 用户ID */ + private Long userId; + + /** 岗位ID */ + private Long postId; + + public Long getUserId() + { + return userId; + } + + public void setUserId(Long userId) + { + this.userId = userId; + } + + public Long getPostId() + { + return postId; + } + + public void setPostId(Long postId) + { + this.postId = postId; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("userId", getUserId()) + .append("postId", getPostId()) + .toString(); + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysUserRole.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysUserRole.java new file mode 100644 index 0000000..d1f28a7 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysUserRole.java @@ -0,0 +1,46 @@ +package com.ruoyi.system.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +/** + * 用户和角色关联 sys_user_role + * + * @author #author# + */ +public class SysUserRole +{ + /** 用户ID */ + private Long userId; + + /** 角色ID */ + private Long roleId; + + public Long getUserId() + { + return userId; + } + + public void setUserId(Long userId) + { + this.userId = userId; + } + + public Long getRoleId() + { + return roleId; + } + + public void setRoleId(Long roleId) + { + this.roleId = roleId; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("userId", getUserId()) + .append("roleId", getRoleId()) + .toString(); + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/MetaVo.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/MetaVo.java new file mode 100644 index 0000000..757b035 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/MetaVo.java @@ -0,0 +1,106 @@ +package com.ruoyi.system.domain.vo; + +import com.ruoyi.common.utils.StringUtils; + +/** + * 路由显示信息 + * + * @author #author# + */ +public class MetaVo +{ + /** + * 设置该路由在侧边栏和面包屑中展示的名字 + */ + private String title; + + /** + * 设置该路由的图标,对应路径src/assets/icons/svg + */ + private String icon; + + /** + * 设置为true,则不会被 缓存 + */ + private boolean noCache; + + /** + * 内链地址(http(s)://开头) + */ + private String link; + + public MetaVo() + { + } + + public MetaVo(String title, String icon) + { + this.title = title; + this.icon = icon; + } + + public MetaVo(String title, String icon, boolean noCache) + { + this.title = title; + this.icon = icon; + this.noCache = noCache; + } + + public MetaVo(String title, String icon, String link) + { + this.title = title; + this.icon = icon; + this.link = link; + } + + public MetaVo(String title, String icon, boolean noCache, String link) + { + this.title = title; + this.icon = icon; + this.noCache = noCache; + if (StringUtils.ishttp(link)) + { + this.link = link; + } + } + + public boolean isNoCache() + { + return noCache; + } + + public void setNoCache(boolean noCache) + { + this.noCache = noCache; + } + + public String getTitle() + { + return title; + } + + public void setTitle(String title) + { + this.title = title; + } + + public String getIcon() + { + return icon; + } + + public void setIcon(String icon) + { + this.icon = icon; + } + + public String getLink() + { + return link; + } + + public void setLink(String link) + { + this.link = link; + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/RouterVo.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/RouterVo.java new file mode 100644 index 0000000..5126472 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/RouterVo.java @@ -0,0 +1,148 @@ +package com.ruoyi.system.domain.vo; + +import com.fasterxml.jackson.annotation.JsonInclude; +import java.util.List; + +/** + * 路由配置信息 + * + * @author #author# + */ +@JsonInclude(JsonInclude.Include.NON_EMPTY) +public class RouterVo +{ + /** + * 路由名字 + */ + private String name; + + /** + * 路由地址 + */ + private String path; + + /** + * 是否隐藏路由,当设置 true 的时候该路由不会再侧边栏出现 + */ + private boolean hidden; + + /** + * 重定向地址,当设置 noRedirect 的时候该路由在面包屑导航中不可被点击 + */ + private String redirect; + + /** + * 组件地址 + */ + private String component; + + /** + * 路由参数:如 {"id": 1, "name": "ry"} + */ + private String query; + + /** + * 当你一个路由下面的 children 声明的路由大于1个时,自动会变成嵌套的模式--如组件页面 + */ + private Boolean alwaysShow; + + /** + * 其他元素 + */ + private MetaVo meta; + + /** + * 子路由 + */ + private List children; + + public String getName() + { + return name; + } + + public void setName(String name) + { + this.name = name; + } + + public String getPath() + { + return path; + } + + public void setPath(String path) + { + this.path = path; + } + + public boolean getHidden() + { + return hidden; + } + + public void setHidden(boolean hidden) + { + this.hidden = hidden; + } + + public String getRedirect() + { + return redirect; + } + + public void setRedirect(String redirect) + { + this.redirect = redirect; + } + + public String getComponent() + { + return component; + } + + public void setComponent(String component) + { + this.component = component; + } + + public String getQuery() + { + return query; + } + + public void setQuery(String query) + { + this.query = query; + } + + public Boolean getAlwaysShow() + { + return alwaysShow; + } + + public void setAlwaysShow(Boolean alwaysShow) + { + this.alwaysShow = alwaysShow; + } + + public MetaVo getMeta() + { + return meta; + } + + public void setMeta(MetaVo meta) + { + this.meta = meta; + } + + public List getChildren() + { + return children; + } + + public void setChildren(List children) + { + this.children = children; + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysConfigMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysConfigMapper.java new file mode 100644 index 0000000..1d6eabe --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysConfigMapper.java @@ -0,0 +1,76 @@ +package com.ruoyi.system.mapper; + +import java.util.List; +import com.ruoyi.system.domain.SysConfig; + +/** + * 参数配置 数据层 + * + * @author #author# + */ +public interface SysConfigMapper +{ + /** + * 查询参数配置信息 + * + * @param config 参数配置信息 + * @return 参数配置信息 + */ + public SysConfig selectConfig(SysConfig config); + + /** + * 通过ID查询配置 + * + * @param configId 参数ID + * @return 参数配置信息 + */ + public SysConfig selectConfigById(Long configId); + + /** + * 查询参数配置列表 + * + * @param config 参数配置信息 + * @return 参数配置集合 + */ + public List selectConfigList(SysConfig config); + + /** + * 根据键名查询参数配置信息 + * + * @param configKey 参数键名 + * @return 参数配置信息 + */ + public SysConfig checkConfigKeyUnique(String configKey); + + /** + * 新增参数配置 + * + * @param config 参数配置信息 + * @return 结果 + */ + public int insertConfig(SysConfig config); + + /** + * 修改参数配置 + * + * @param config 参数配置信息 + * @return 结果 + */ + public int updateConfig(SysConfig config); + + /** + * 删除参数配置 + * + * @param configId 参数ID + * @return 结果 + */ + public int deleteConfigById(Long configId); + + /** + * 批量删除参数信息 + * + * @param configIds 需要删除的参数ID + * @return 结果 + */ + public int deleteConfigByIds(Long[] configIds); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDeptMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDeptMapper.java new file mode 100644 index 0000000..355d7f2 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDeptMapper.java @@ -0,0 +1,118 @@ +package com.ruoyi.system.mapper; + +import java.util.List; +import org.apache.ibatis.annotations.Param; +import com.ruoyi.common.core.domain.entity.SysDept; + +/** + * 部门管理 数据层 + * + * @author #author# + */ +public interface SysDeptMapper +{ + /** + * 查询部门管理数据 + * + * @param dept 部门信息 + * @return 部门信息集合 + */ + public List selectDeptList(SysDept dept); + + /** + * 根据角色ID查询部门树信息 + * + * @param roleId 角色ID + * @param deptCheckStrictly 部门树选择项是否关联显示 + * @return 选中部门列表 + */ + public List selectDeptListByRoleId(@Param("roleId") Long roleId, @Param("deptCheckStrictly") boolean deptCheckStrictly); + + /** + * 根据部门ID查询信息 + * + * @param deptId 部门ID + * @return 部门信息 + */ + public SysDept selectDeptById(Long deptId); + + /** + * 根据ID查询所有子部门 + * + * @param deptId 部门ID + * @return 部门列表 + */ + public List selectChildrenDeptById(Long deptId); + + /** + * 根据ID查询所有子部门(正常状态) + * + * @param deptId 部门ID + * @return 子部门数 + */ + public int selectNormalChildrenDeptById(Long deptId); + + /** + * 是否存在子节点 + * + * @param deptId 部门ID + * @return 结果 + */ + public int hasChildByDeptId(Long deptId); + + /** + * 查询部门是否存在用户 + * + * @param deptId 部门ID + * @return 结果 + */ + public int checkDeptExistUser(Long deptId); + + /** + * 校验部门名称是否唯一 + * + * @param deptName 部门名称 + * @param parentId 父部门ID + * @return 结果 + */ + public SysDept checkDeptNameUnique(@Param("deptName") String deptName, @Param("parentId") Long parentId); + + /** + * 新增部门信息 + * + * @param dept 部门信息 + * @return 结果 + */ + public int insertDept(SysDept dept); + + /** + * 修改部门信息 + * + * @param dept 部门信息 + * @return 结果 + */ + public int updateDept(SysDept dept); + + /** + * 修改所在部门正常状态 + * + * @param deptIds 部门ID组 + */ + public void updateDeptStatusNormal(Long[] deptIds); + + /** + * 修改子元素关系 + * + * @param depts 子元素 + * @return 结果 + */ + public int updateDeptChildren(@Param("depts") List depts); + + /** + * 删除部门管理信息 + * + * @param deptId 部门ID + * @return 结果 + */ + public int deleteDeptById(Long deptId); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDictDataMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDictDataMapper.java new file mode 100644 index 0000000..26dc3c7 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDictDataMapper.java @@ -0,0 +1,95 @@ +package com.ruoyi.system.mapper; + +import java.util.List; +import org.apache.ibatis.annotations.Param; +import com.ruoyi.common.core.domain.entity.SysDictData; + +/** + * 字典表 数据层 + * + * @author #author# + */ +public interface SysDictDataMapper +{ + /** + * 根据条件分页查询字典数据 + * + * @param dictData 字典数据信息 + * @return 字典数据集合信息 + */ + public List selectDictDataList(SysDictData dictData); + + /** + * 根据字典类型查询字典数据 + * + * @param dictType 字典类型 + * @return 字典数据集合信息 + */ + public List selectDictDataByType(String dictType); + + /** + * 根据字典类型和字典键值查询字典数据信息 + * + * @param dictType 字典类型 + * @param dictValue 字典键值 + * @return 字典标签 + */ + public String selectDictLabel(@Param("dictType") String dictType, @Param("dictValue") String dictValue); + + /** + * 根据字典数据ID查询信息 + * + * @param dictCode 字典数据ID + * @return 字典数据 + */ + public SysDictData selectDictDataById(Long dictCode); + + /** + * 查询字典数据 + * + * @param dictType 字典类型 + * @return 字典数据 + */ + public int countDictDataByType(String dictType); + + /** + * 通过字典ID删除字典数据信息 + * + * @param dictCode 字典数据ID + * @return 结果 + */ + public int deleteDictDataById(Long dictCode); + + /** + * 批量删除字典数据信息 + * + * @param dictCodes 需要删除的字典数据ID + * @return 结果 + */ + public int deleteDictDataByIds(Long[] dictCodes); + + /** + * 新增字典数据信息 + * + * @param dictData 字典数据信息 + * @return 结果 + */ + public int insertDictData(SysDictData dictData); + + /** + * 修改字典数据信息 + * + * @param dictData 字典数据信息 + * @return 结果 + */ + public int updateDictData(SysDictData dictData); + + /** + * 同步修改字典类型 + * + * @param oldDictType 旧字典类型 + * @param newDictType 新旧字典类型 + * @return 结果 + */ + public int updateDictDataType(@Param("oldDictType") String oldDictType, @Param("newDictType") String newDictType); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDictTypeMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDictTypeMapper.java new file mode 100644 index 0000000..ee4469f --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDictTypeMapper.java @@ -0,0 +1,83 @@ +package com.ruoyi.system.mapper; + +import java.util.List; +import com.ruoyi.common.core.domain.entity.SysDictType; + +/** + * 字典表 数据层 + * + * @author #author# + */ +public interface SysDictTypeMapper +{ + /** + * 根据条件分页查询字典类型 + * + * @param dictType 字典类型信息 + * @return 字典类型集合信息 + */ + public List selectDictTypeList(SysDictType dictType); + + /** + * 根据所有字典类型 + * + * @return 字典类型集合信息 + */ + public List selectDictTypeAll(); + + /** + * 根据字典类型ID查询信息 + * + * @param dictId 字典类型ID + * @return 字典类型 + */ + public SysDictType selectDictTypeById(Long dictId); + + /** + * 根据字典类型查询信息 + * + * @param dictType 字典类型 + * @return 字典类型 + */ + public SysDictType selectDictTypeByType(String dictType); + + /** + * 通过字典ID删除字典信息 + * + * @param dictId 字典ID + * @return 结果 + */ + public int deleteDictTypeById(Long dictId); + + /** + * 批量删除字典类型信息 + * + * @param dictIds 需要删除的字典ID + * @return 结果 + */ + public int deleteDictTypeByIds(Long[] dictIds); + + /** + * 新增字典类型信息 + * + * @param dictType 字典类型信息 + * @return 结果 + */ + public int insertDictType(SysDictType dictType); + + /** + * 修改字典类型信息 + * + * @param dictType 字典类型信息 + * @return 结果 + */ + public int updateDictType(SysDictType dictType); + + /** + * 校验字典类型称是否唯一 + * + * @param dictType 字典类型 + * @return 结果 + */ + public SysDictType checkDictTypeUnique(String dictType); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysLogininforMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysLogininforMapper.java new file mode 100644 index 0000000..de507cd --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysLogininforMapper.java @@ -0,0 +1,42 @@ +package com.ruoyi.system.mapper; + +import java.util.List; +import com.ruoyi.system.domain.SysLogininfor; + +/** + * 系统访问日志情况信息 数据层 + * + * @author #author# + */ +public interface SysLogininforMapper +{ + /** + * 新增系统登录日志 + * + * @param logininfor 访问日志对象 + */ + public void insertLogininfor(SysLogininfor logininfor); + + /** + * 查询系统登录日志集合 + * + * @param logininfor 访问日志对象 + * @return 登录记录集合 + */ + public List selectLogininforList(SysLogininfor logininfor); + + /** + * 批量删除系统登录日志 + * + * @param infoIds 需要删除的登录日志ID + * @return 结果 + */ + public int deleteLogininforByIds(Long[] infoIds); + + /** + * 清空系统登录日志 + * + * @return 结果 + */ + public int cleanLogininfor(); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysMenuMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysMenuMapper.java new file mode 100644 index 0000000..ced9fa0 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysMenuMapper.java @@ -0,0 +1,125 @@ +package com.ruoyi.system.mapper; + +import java.util.List; +import org.apache.ibatis.annotations.Param; +import com.ruoyi.common.core.domain.entity.SysMenu; + +/** + * 菜单表 数据层 + * + * @author #author# + */ +public interface SysMenuMapper +{ + /** + * 查询系统菜单列表 + * + * @param menu 菜单信息 + * @return 菜单列表 + */ + public List selectMenuList(SysMenu menu); + + /** + * 根据用户所有权限 + * + * @return 权限列表 + */ + public List selectMenuPerms(); + + /** + * 根据用户查询系统菜单列表 + * + * @param menu 菜单信息 + * @return 菜单列表 + */ + public List selectMenuListByUserId(SysMenu menu); + + /** + * 根据角色ID查询权限 + * + * @param roleId 角色ID + * @return 权限列表 + */ + public List selectMenuPermsByRoleId(Long roleId); + + /** + * 根据用户ID查询权限 + * + * @param userId 用户ID + * @return 权限列表 + */ + public List selectMenuPermsByUserId(Long userId); + + /** + * 根据用户ID查询菜单 + * + * @return 菜单列表 + */ + public List selectMenuTreeAll(); + + /** + * 根据用户ID查询菜单 + * + * @param userId 用户ID + * @return 菜单列表 + */ + public List selectMenuTreeByUserId(Long userId); + + /** + * 根据角色ID查询菜单树信息 + * + * @param roleId 角色ID + * @param menuCheckStrictly 菜单树选择项是否关联显示 + * @return 选中菜单列表 + */ + public List selectMenuListByRoleId(@Param("roleId") Long roleId, @Param("menuCheckStrictly") boolean menuCheckStrictly); + + /** + * 根据菜单ID查询信息 + * + * @param menuId 菜单ID + * @return 菜单信息 + */ + public SysMenu selectMenuById(Long menuId); + + /** + * 是否存在菜单子节点 + * + * @param menuId 菜单ID + * @return 结果 + */ + public int hasChildByMenuId(Long menuId); + + /** + * 新增菜单信息 + * + * @param menu 菜单信息 + * @return 结果 + */ + public int insertMenu(SysMenu menu); + + /** + * 修改菜单信息 + * + * @param menu 菜单信息 + * @return 结果 + */ + public int updateMenu(SysMenu menu); + + /** + * 删除菜单管理信息 + * + * @param menuId 菜单ID + * @return 结果 + */ + public int deleteMenuById(Long menuId); + + /** + * 校验菜单名称是否唯一 + * + * @param menuName 菜单名称 + * @param parentId 父菜单ID + * @return 结果 + */ + public SysMenu checkMenuNameUnique(@Param("menuName") String menuName, @Param("parentId") Long parentId); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysNoticeMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysNoticeMapper.java new file mode 100644 index 0000000..df5ef57 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysNoticeMapper.java @@ -0,0 +1,60 @@ +package com.ruoyi.system.mapper; + +import java.util.List; +import com.ruoyi.system.domain.SysNotice; + +/** + * 通知公告表 数据层 + * + * @author #author# + */ +public interface SysNoticeMapper +{ + /** + * 查询公告信息 + * + * @param noticeId 公告ID + * @return 公告信息 + */ + public SysNotice selectNoticeById(Long noticeId); + + /** + * 查询公告列表 + * + * @param notice 公告信息 + * @return 公告集合 + */ + public List selectNoticeList(SysNotice notice); + + /** + * 新增公告 + * + * @param notice 公告信息 + * @return 结果 + */ + public int insertNotice(SysNotice notice); + + /** + * 修改公告 + * + * @param notice 公告信息 + * @return 结果 + */ + public int updateNotice(SysNotice notice); + + /** + * 批量删除公告 + * + * @param noticeId 公告ID + * @return 结果 + */ + public int deleteNoticeById(Long noticeId); + + /** + * 批量删除公告信息 + * + * @param noticeIds 需要删除的公告ID + * @return 结果 + */ + public int deleteNoticeByIds(Long[] noticeIds); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysOperLogMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysOperLogMapper.java new file mode 100644 index 0000000..40cce80 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysOperLogMapper.java @@ -0,0 +1,48 @@ +package com.ruoyi.system.mapper; + +import java.util.List; +import com.ruoyi.system.domain.SysOperLog; + +/** + * 操作日志 数据层 + * + * @author #author# + */ +public interface SysOperLogMapper +{ + /** + * 新增操作日志 + * + * @param operLog 操作日志对象 + */ + public void insertOperlog(SysOperLog operLog); + + /** + * 查询系统操作日志集合 + * + * @param operLog 操作日志对象 + * @return 操作日志集合 + */ + public List selectOperLogList(SysOperLog operLog); + + /** + * 批量删除系统操作日志 + * + * @param operIds 需要删除的操作日志ID + * @return 结果 + */ + public int deleteOperLogByIds(Long[] operIds); + + /** + * 查询操作日志详细 + * + * @param operId 操作ID + * @return 操作日志对象 + */ + public SysOperLog selectOperLogById(Long operId); + + /** + * 清空操作日志 + */ + public void cleanOperLog(); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysPostMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysPostMapper.java new file mode 100644 index 0000000..04912fb --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysPostMapper.java @@ -0,0 +1,99 @@ +package com.ruoyi.system.mapper; + +import java.util.List; +import com.ruoyi.system.domain.SysPost; + +/** + * 岗位信息 数据层 + * + * @author #author# + */ +public interface SysPostMapper +{ + /** + * 查询岗位数据集合 + * + * @param post 岗位信息 + * @return 岗位数据集合 + */ + public List selectPostList(SysPost post); + + /** + * 查询所有岗位 + * + * @return 岗位列表 + */ + public List selectPostAll(); + + /** + * 通过岗位ID查询岗位信息 + * + * @param postId 岗位ID + * @return 角色对象信息 + */ + public SysPost selectPostById(Long postId); + + /** + * 根据用户ID获取岗位选择框列表 + * + * @param userId 用户ID + * @return 选中岗位ID列表 + */ + public List selectPostListByUserId(Long userId); + + /** + * 查询用户所属岗位组 + * + * @param userName 用户名 + * @return 结果 + */ + public List selectPostsByUserName(String userName); + + /** + * 删除岗位信息 + * + * @param postId 岗位ID + * @return 结果 + */ + public int deletePostById(Long postId); + + /** + * 批量删除岗位信息 + * + * @param postIds 需要删除的岗位ID + * @return 结果 + */ + public int deletePostByIds(Long[] postIds); + + /** + * 修改岗位信息 + * + * @param post 岗位信息 + * @return 结果 + */ + public int updatePost(SysPost post); + + /** + * 新增岗位信息 + * + * @param post 岗位信息 + * @return 结果 + */ + public int insertPost(SysPost post); + + /** + * 校验岗位名称 + * + * @param postName 岗位名称 + * @return 结果 + */ + public SysPost checkPostNameUnique(String postName); + + /** + * 校验岗位编码 + * + * @param postCode 岗位编码 + * @return 结果 + */ + public SysPost checkPostCodeUnique(String postCode); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleDeptMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleDeptMapper.java new file mode 100644 index 0000000..13d5eb3 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleDeptMapper.java @@ -0,0 +1,44 @@ +package com.ruoyi.system.mapper; + +import java.util.List; +import com.ruoyi.system.domain.SysRoleDept; + +/** + * 角色与部门关联表 数据层 + * + * @author #author# + */ +public interface SysRoleDeptMapper +{ + /** + * 通过角色ID删除角色和部门关联 + * + * @param roleId 角色ID + * @return 结果 + */ + public int deleteRoleDeptByRoleId(Long roleId); + + /** + * 批量删除角色部门关联信息 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteRoleDept(Long[] ids); + + /** + * 查询部门使用数量 + * + * @param deptId 部门ID + * @return 结果 + */ + public int selectCountRoleDeptByDeptId(Long deptId); + + /** + * 批量新增角色部门信息 + * + * @param roleDeptList 角色部门列表 + * @return 结果 + */ + public int batchRoleDept(List roleDeptList); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleMapper.java new file mode 100644 index 0000000..64d0719 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleMapper.java @@ -0,0 +1,107 @@ +package com.ruoyi.system.mapper; + +import java.util.List; +import com.ruoyi.common.core.domain.entity.SysRole; + +/** + * 角色表 数据层 + * + * @author #author# + */ +public interface SysRoleMapper +{ + /** + * 根据条件分页查询角色数据 + * + * @param role 角色信息 + * @return 角色数据集合信息 + */ + public List selectRoleList(SysRole role); + + /** + * 根据用户ID查询角色 + * + * @param userId 用户ID + * @return 角色列表 + */ + public List selectRolePermissionByUserId(Long userId); + + /** + * 查询所有角色 + * + * @return 角色列表 + */ + public List selectRoleAll(); + + /** + * 根据用户ID获取角色选择框列表 + * + * @param userId 用户ID + * @return 选中角色ID列表 + */ + public List selectRoleListByUserId(Long userId); + + /** + * 通过角色ID查询角色 + * + * @param roleId 角色ID + * @return 角色对象信息 + */ + public SysRole selectRoleById(Long roleId); + + /** + * 根据用户ID查询角色 + * + * @param userName 用户名 + * @return 角色列表 + */ + public List selectRolesByUserName(String userName); + + /** + * 校验角色名称是否唯一 + * + * @param roleName 角色名称 + * @return 角色信息 + */ + public SysRole checkRoleNameUnique(String roleName); + + /** + * 校验角色权限是否唯一 + * + * @param roleKey 角色权限 + * @return 角色信息 + */ + public SysRole checkRoleKeyUnique(String roleKey); + + /** + * 修改角色信息 + * + * @param role 角色信息 + * @return 结果 + */ + public int updateRole(SysRole role); + + /** + * 新增角色信息 + * + * @param role 角色信息 + * @return 结果 + */ + public int insertRole(SysRole role); + + /** + * 通过角色ID删除角色 + * + * @param roleId 角色ID + * @return 结果 + */ + public int deleteRoleById(Long roleId); + + /** + * 批量删除角色信息 + * + * @param roleIds 需要删除的角色ID + * @return 结果 + */ + public int deleteRoleByIds(Long[] roleIds); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleMenuMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleMenuMapper.java new file mode 100644 index 0000000..6ccf87d --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleMenuMapper.java @@ -0,0 +1,44 @@ +package com.ruoyi.system.mapper; + +import java.util.List; +import com.ruoyi.system.domain.SysRoleMenu; + +/** + * 角色与菜单关联表 数据层 + * + * @author #author# + */ +public interface SysRoleMenuMapper +{ + /** + * 查询菜单使用数量 + * + * @param menuId 菜单ID + * @return 结果 + */ + public int checkMenuExistRole(Long menuId); + + /** + * 通过角色ID删除角色和菜单关联 + * + * @param roleId 角色ID + * @return 结果 + */ + public int deleteRoleMenuByRoleId(Long roleId); + + /** + * 批量删除角色菜单关联信息 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteRoleMenu(Long[] ids); + + /** + * 批量新增角色菜单信息 + * + * @param roleMenuList 角色菜单列表 + * @return 结果 + */ + public int batchRoleMenu(List roleMenuList); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java new file mode 100644 index 0000000..e1fd9ff --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java @@ -0,0 +1,127 @@ +package com.ruoyi.system.mapper; + +import java.util.List; +import org.apache.ibatis.annotations.Param; +import com.ruoyi.common.core.domain.entity.SysUser; + +/** + * 用户表 数据层 + * + * @author #author# + */ +public interface SysUserMapper +{ + /** + * 根据条件分页查询用户列表 + * + * @param sysUser 用户信息 + * @return 用户信息集合信息 + */ + public List selectUserList(SysUser sysUser); + + /** + * 根据条件分页查询已配用户角色列表 + * + * @param user 用户信息 + * @return 用户信息集合信息 + */ + public List selectAllocatedList(SysUser user); + + /** + * 根据条件分页查询未分配用户角色列表 + * + * @param user 用户信息 + * @return 用户信息集合信息 + */ + public List selectUnallocatedList(SysUser user); + + /** + * 通过用户名查询用户 + * + * @param userName 用户名 + * @return 用户对象信息 + */ + public SysUser selectUserByUserName(String userName); + + /** + * 通过用户ID查询用户 + * + * @param userId 用户ID + * @return 用户对象信息 + */ + public SysUser selectUserById(Long userId); + + /** + * 新增用户信息 + * + * @param user 用户信息 + * @return 结果 + */ + public int insertUser(SysUser user); + + /** + * 修改用户信息 + * + * @param user 用户信息 + * @return 结果 + */ + public int updateUser(SysUser user); + + /** + * 修改用户头像 + * + * @param userName 用户名 + * @param avatar 头像地址 + * @return 结果 + */ + public int updateUserAvatar(@Param("userName") String userName, @Param("avatar") String avatar); + + /** + * 重置用户密码 + * + * @param userName 用户名 + * @param password 密码 + * @return 结果 + */ + public int resetUserPwd(@Param("userName") String userName, @Param("password") String password); + + /** + * 通过用户ID删除用户 + * + * @param userId 用户ID + * @return 结果 + */ + public int deleteUserById(Long userId); + + /** + * 批量删除用户信息 + * + * @param userIds 需要删除的用户ID + * @return 结果 + */ + public int deleteUserByIds(Long[] userIds); + + /** + * 校验用户名称是否唯一 + * + * @param userName 用户名称 + * @return 结果 + */ + public SysUser checkUserNameUnique(String userName); + + /** + * 校验手机号码是否唯一 + * + * @param phonenumber 手机号码 + * @return 结果 + */ + public SysUser checkPhoneUnique(String phonenumber); + + /** + * 校验email是否唯一 + * + * @param email 用户邮箱 + * @return 结果 + */ + public SysUser checkEmailUnique(String email); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserPostMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserPostMapper.java new file mode 100644 index 0000000..650e8e6 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserPostMapper.java @@ -0,0 +1,44 @@ +package com.ruoyi.system.mapper; + +import java.util.List; +import com.ruoyi.system.domain.SysUserPost; + +/** + * 用户与岗位关联表 数据层 + * + * @author #author# + */ +public interface SysUserPostMapper +{ + /** + * 通过用户ID删除用户和岗位关联 + * + * @param userId 用户ID + * @return 结果 + */ + public int deleteUserPostByUserId(Long userId); + + /** + * 通过岗位ID查询岗位使用数量 + * + * @param postId 岗位ID + * @return 结果 + */ + public int countUserPostById(Long postId); + + /** + * 批量删除用户和岗位关联 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteUserPost(Long[] ids); + + /** + * 批量新增用户岗位信息 + * + * @param userPostList 用户角色列表 + * @return 结果 + */ + public int batchUserPost(List userPostList); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserRoleMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserRoleMapper.java new file mode 100644 index 0000000..d38b9ae --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserRoleMapper.java @@ -0,0 +1,62 @@ +package com.ruoyi.system.mapper; + +import java.util.List; +import org.apache.ibatis.annotations.Param; +import com.ruoyi.system.domain.SysUserRole; + +/** + * 用户与角色关联表 数据层 + * + * @author #author# + */ +public interface SysUserRoleMapper +{ + /** + * 通过用户ID删除用户和角色关联 + * + * @param userId 用户ID + * @return 结果 + */ + public int deleteUserRoleByUserId(Long userId); + + /** + * 批量删除用户和角色关联 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteUserRole(Long[] ids); + + /** + * 通过角色ID查询角色使用数量 + * + * @param roleId 角色ID + * @return 结果 + */ + public int countUserRoleByRoleId(Long roleId); + + /** + * 批量新增用户角色信息 + * + * @param userRoleList 用户角色列表 + * @return 结果 + */ + public int batchUserRole(List userRoleList); + + /** + * 删除用户和角色关联信息 + * + * @param userRole 用户和角色关联信息 + * @return 结果 + */ + public int deleteUserRoleInfo(SysUserRole userRole); + + /** + * 批量取消授权用户角色 + * + * @param roleId 角色ID + * @param userIds 需要删除的用户数据ID + * @return 结果 + */ + public int deleteUserRoleInfos(@Param("roleId") Long roleId, @Param("userIds") Long[] userIds); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysConfigService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysConfigService.java new file mode 100644 index 0000000..0ee9c07 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysConfigService.java @@ -0,0 +1,89 @@ +package com.ruoyi.system.service; + +import java.util.List; +import com.ruoyi.system.domain.SysConfig; + +/** + * 参数配置 服务层 + * + * @author #author# + */ +public interface ISysConfigService +{ + /** + * 查询参数配置信息 + * + * @param configId 参数配置ID + * @return 参数配置信息 + */ + public SysConfig selectConfigById(Long configId); + + /** + * 根据键名查询参数配置信息 + * + * @param configKey 参数键名 + * @return 参数键值 + */ + public String selectConfigByKey(String configKey); + + /** + * 获取验证码开关 + * + * @return true开启,false关闭 + */ + public boolean selectCaptchaEnabled(); + + /** + * 查询参数配置列表 + * + * @param config 参数配置信息 + * @return 参数配置集合 + */ + public List selectConfigList(SysConfig config); + + /** + * 新增参数配置 + * + * @param config 参数配置信息 + * @return 结果 + */ + public int insertConfig(SysConfig config); + + /** + * 修改参数配置 + * + * @param config 参数配置信息 + * @return 结果 + */ + public int updateConfig(SysConfig config); + + /** + * 批量删除参数信息 + * + * @param configIds 需要删除的参数ID + */ + public void deleteConfigByIds(Long[] configIds); + + /** + * 加载参数缓存数据 + */ + public void loadingConfigCache(); + + /** + * 清空参数缓存数据 + */ + public void clearConfigCache(); + + /** + * 重置参数缓存数据 + */ + public void resetConfigCache(); + + /** + * 校验参数键名是否唯一 + * + * @param config 参数信息 + * @return 结果 + */ + public String checkConfigKeyUnique(SysConfig config); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDeptService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDeptService.java new file mode 100644 index 0000000..42f7cbe --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDeptService.java @@ -0,0 +1,124 @@ +package com.ruoyi.system.service; + +import java.util.List; +import com.ruoyi.common.core.domain.TreeSelect; +import com.ruoyi.common.core.domain.entity.SysDept; + +/** + * 部门管理 服务层 + * + * @author #author# + */ +public interface ISysDeptService +{ + /** + * 查询部门管理数据 + * + * @param dept 部门信息 + * @return 部门信息集合 + */ + public List selectDeptList(SysDept dept); + + /** + * 查询部门树结构信息 + * + * @param dept 部门信息 + * @return 部门树信息集合 + */ + public List selectDeptTreeList(SysDept dept); + + /** + * 构建前端所需要树结构 + * + * @param depts 部门列表 + * @return 树结构列表 + */ + public List buildDeptTree(List depts); + + /** + * 构建前端所需要下拉树结构 + * + * @param depts 部门列表 + * @return 下拉树结构列表 + */ + public List buildDeptTreeSelect(List depts); + + /** + * 根据角色ID查询部门树信息 + * + * @param roleId 角色ID + * @return 选中部门列表 + */ + public List selectDeptListByRoleId(Long roleId); + + /** + * 根据部门ID查询信息 + * + * @param deptId 部门ID + * @return 部门信息 + */ + public SysDept selectDeptById(Long deptId); + + /** + * 根据ID查询所有子部门(正常状态) + * + * @param deptId 部门ID + * @return 子部门数 + */ + public int selectNormalChildrenDeptById(Long deptId); + + /** + * 是否存在部门子节点 + * + * @param deptId 部门ID + * @return 结果 + */ + public boolean hasChildByDeptId(Long deptId); + + /** + * 查询部门是否存在用户 + * + * @param deptId 部门ID + * @return 结果 true 存在 false 不存在 + */ + public boolean checkDeptExistUser(Long deptId); + + /** + * 校验部门名称是否唯一 + * + * @param dept 部门信息 + * @return 结果 + */ + public String checkDeptNameUnique(SysDept dept); + + /** + * 校验部门是否有数据权限 + * + * @param deptId 部门id + */ + public void checkDeptDataScope(Long deptId); + + /** + * 新增保存部门信息 + * + * @param dept 部门信息 + * @return 结果 + */ + public int insertDept(SysDept dept); + + /** + * 修改保存部门信息 + * + * @param dept 部门信息 + * @return 结果 + */ + public int updateDept(SysDept dept); + + /** + * 删除部门管理信息 + * + * @param deptId 部门ID + * @return 结果 + */ + public int deleteDeptById(Long deptId); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDictDataService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDictDataService.java new file mode 100644 index 0000000..edc85f9 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDictDataService.java @@ -0,0 +1,60 @@ +package com.ruoyi.system.service; + +import java.util.List; +import com.ruoyi.common.core.domain.entity.SysDictData; + +/** + * 字典 业务层 + * + * @author #author# + */ +public interface ISysDictDataService +{ + /** + * 根据条件分页查询字典数据 + * + * @param dictData 字典数据信息 + * @return 字典数据集合信息 + */ + public List selectDictDataList(SysDictData dictData); + + /** + * 根据字典类型和字典键值查询字典数据信息 + * + * @param dictType 字典类型 + * @param dictValue 字典键值 + * @return 字典标签 + */ + public String selectDictLabel(String dictType, String dictValue); + + /** + * 根据字典数据ID查询信息 + * + * @param dictCode 字典数据ID + * @return 字典数据 + */ + public SysDictData selectDictDataById(Long dictCode); + + /** + * 批量删除字典数据信息 + * + * @param dictCodes 需要删除的字典数据ID + */ + public void deleteDictDataByIds(Long[] dictCodes); + + /** + * 新增保存字典数据信息 + * + * @param dictData 字典数据信息 + * @return 结果 + */ + public int insertDictData(SysDictData dictData); + + /** + * 修改保存字典数据信息 + * + * @param dictData 字典数据信息 + * @return 结果 + */ + public int updateDictData(SysDictData dictData); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDictTypeService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDictTypeService.java new file mode 100644 index 0000000..92b97bf --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDictTypeService.java @@ -0,0 +1,98 @@ +package com.ruoyi.system.service; + +import java.util.List; +import com.ruoyi.common.core.domain.entity.SysDictData; +import com.ruoyi.common.core.domain.entity.SysDictType; + +/** + * 字典 业务层 + * + * @author #author# + */ +public interface ISysDictTypeService +{ + /** + * 根据条件分页查询字典类型 + * + * @param dictType 字典类型信息 + * @return 字典类型集合信息 + */ + public List selectDictTypeList(SysDictType dictType); + + /** + * 根据所有字典类型 + * + * @return 字典类型集合信息 + */ + public List selectDictTypeAll(); + + /** + * 根据字典类型查询字典数据 + * + * @param dictType 字典类型 + * @return 字典数据集合信息 + */ + public List selectDictDataByType(String dictType); + + /** + * 根据字典类型ID查询信息 + * + * @param dictId 字典类型ID + * @return 字典类型 + */ + public SysDictType selectDictTypeById(Long dictId); + + /** + * 根据字典类型查询信息 + * + * @param dictType 字典类型 + * @return 字典类型 + */ + public SysDictType selectDictTypeByType(String dictType); + + /** + * 批量删除字典信息 + * + * @param dictIds 需要删除的字典ID + */ + public void deleteDictTypeByIds(Long[] dictIds); + + /** + * 加载字典缓存数据 + */ + public void loadingDictCache(); + + /** + * 清空字典缓存数据 + */ + public void clearDictCache(); + + /** + * 重置字典缓存数据 + */ + public void resetDictCache(); + + /** + * 新增保存字典类型信息 + * + * @param dictType 字典类型信息 + * @return 结果 + */ + public int insertDictType(SysDictType dictType); + + /** + * 修改保存字典类型信息 + * + * @param dictType 字典类型信息 + * @return 结果 + */ + public int updateDictType(SysDictType dictType); + + /** + * 校验字典类型称是否唯一 + * + * @param dictType 字典类型 + * @return 结果 + */ + public String checkDictTypeUnique(SysDictType dictType); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysLogininforService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysLogininforService.java new file mode 100644 index 0000000..dd3786c --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysLogininforService.java @@ -0,0 +1,40 @@ +package com.ruoyi.system.service; + +import java.util.List; +import com.ruoyi.system.domain.SysLogininfor; + +/** + * 系统访问日志情况信息 服务层 + * + * @author #author# + */ +public interface ISysLogininforService +{ + /** + * 新增系统登录日志 + * + * @param logininfor 访问日志对象 + */ + public void insertLogininfor(SysLogininfor logininfor); + + /** + * 查询系统登录日志集合 + * + * @param logininfor 访问日志对象 + * @return 登录记录集合 + */ + public List selectLogininforList(SysLogininfor logininfor); + + /** + * 批量删除系统登录日志 + * + * @param infoIds 需要删除的登录日志ID + * @return 结果 + */ + public int deleteLogininforByIds(Long[] infoIds); + + /** + * 清空系统登录日志 + */ + public void cleanLogininfor(); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysMenuService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysMenuService.java new file mode 100644 index 0000000..1407df4 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysMenuService.java @@ -0,0 +1,144 @@ +package com.ruoyi.system.service; + +import java.util.List; +import java.util.Set; +import com.ruoyi.common.core.domain.TreeSelect; +import com.ruoyi.common.core.domain.entity.SysMenu; +import com.ruoyi.system.domain.vo.RouterVo; + +/** + * 菜单 业务层 + * + * @author #author# + */ +public interface ISysMenuService +{ + /** + * 根据用户查询系统菜单列表 + * + * @param userId 用户ID + * @return 菜单列表 + */ + public List selectMenuList(Long userId); + + /** + * 根据用户查询系统菜单列表 + * + * @param menu 菜单信息 + * @param userId 用户ID + * @return 菜单列表 + */ + public List selectMenuList(SysMenu menu, Long userId); + + /** + * 根据用户ID查询权限 + * + * @param userId 用户ID + * @return 权限列表 + */ + public Set selectMenuPermsByUserId(Long userId); + + /** + * 根据角色ID查询权限 + * + * @param roleId 角色ID + * @return 权限列表 + */ + public Set selectMenuPermsByRoleId(Long roleId); + + /** + * 根据用户ID查询菜单树信息 + * + * @param userId 用户ID + * @return 菜单列表 + */ + public List selectMenuTreeByUserId(Long userId); + + /** + * 根据角色ID查询菜单树信息 + * + * @param roleId 角色ID + * @return 选中菜单列表 + */ + public List selectMenuListByRoleId(Long roleId); + + /** + * 构建前端路由所需要的菜单 + * + * @param menus 菜单列表 + * @return 路由列表 + */ + public List buildMenus(List menus); + + /** + * 构建前端所需要树结构 + * + * @param menus 菜单列表 + * @return 树结构列表 + */ + public List buildMenuTree(List menus); + + /** + * 构建前端所需要下拉树结构 + * + * @param menus 菜单列表 + * @return 下拉树结构列表 + */ + public List buildMenuTreeSelect(List menus); + + /** + * 根据菜单ID查询信息 + * + * @param menuId 菜单ID + * @return 菜单信息 + */ + public SysMenu selectMenuById(Long menuId); + + /** + * 是否存在菜单子节点 + * + * @param menuId 菜单ID + * @return 结果 true 存在 false 不存在 + */ + public boolean hasChildByMenuId(Long menuId); + + /** + * 查询菜单是否存在角色 + * + * @param menuId 菜单ID + * @return 结果 true 存在 false 不存在 + */ + public boolean checkMenuExistRole(Long menuId); + + /** + * 新增保存菜单信息 + * + * @param menu 菜单信息 + * @return 结果 + */ + public int insertMenu(SysMenu menu); + + /** + * 修改保存菜单信息 + * + * @param menu 菜单信息 + * @return 结果 + */ + public int updateMenu(SysMenu menu); + + /** + * 删除菜单管理信息 + * + * @param menuId 菜单ID + * @return 结果 + */ + public int deleteMenuById(Long menuId); + + /** + * 校验菜单名称是否唯一 + * + * @param menu 菜单信息 + * @return 结果 + */ + public String checkMenuNameUnique(SysMenu menu); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysNoticeService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysNoticeService.java new file mode 100644 index 0000000..01c9b7a --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysNoticeService.java @@ -0,0 +1,60 @@ +package com.ruoyi.system.service; + +import java.util.List; +import com.ruoyi.system.domain.SysNotice; + +/** + * 公告 服务层 + * + * @author #author# + */ +public interface ISysNoticeService +{ + /** + * 查询公告信息 + * + * @param noticeId 公告ID + * @return 公告信息 + */ + public SysNotice selectNoticeById(Long noticeId); + + /** + * 查询公告列表 + * + * @param notice 公告信息 + * @return 公告集合 + */ + public List selectNoticeList(SysNotice notice); + + /** + * 新增公告 + * + * @param notice 公告信息 + * @return 结果 + */ + public int insertNotice(SysNotice notice); + + /** + * 修改公告 + * + * @param notice 公告信息 + * @return 结果 + */ + public int updateNotice(SysNotice notice); + + /** + * 删除公告信息 + * + * @param noticeId 公告ID + * @return 结果 + */ + public int deleteNoticeById(Long noticeId); + + /** + * 批量删除公告信息 + * + * @param noticeIds 需要删除的公告ID + * @return 结果 + */ + public int deleteNoticeByIds(Long[] noticeIds); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysOperLogService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysOperLogService.java new file mode 100644 index 0000000..f438184 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysOperLogService.java @@ -0,0 +1,48 @@ +package com.ruoyi.system.service; + +import java.util.List; +import com.ruoyi.system.domain.SysOperLog; + +/** + * 操作日志 服务层 + * + * @author #author# + */ +public interface ISysOperLogService +{ + /** + * 新增操作日志 + * + * @param operLog 操作日志对象 + */ + public void insertOperlog(SysOperLog operLog); + + /** + * 查询系统操作日志集合 + * + * @param operLog 操作日志对象 + * @return 操作日志集合 + */ + public List selectOperLogList(SysOperLog operLog); + + /** + * 批量删除系统操作日志 + * + * @param operIds 需要删除的操作日志ID + * @return 结果 + */ + public int deleteOperLogByIds(Long[] operIds); + + /** + * 查询操作日志详细 + * + * @param operId 操作ID + * @return 操作日志对象 + */ + public SysOperLog selectOperLogById(Long operId); + + /** + * 清空操作日志 + */ + public void cleanOperLog(); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysPostService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysPostService.java new file mode 100644 index 0000000..296a85c --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysPostService.java @@ -0,0 +1,99 @@ +package com.ruoyi.system.service; + +import java.util.List; +import com.ruoyi.system.domain.SysPost; + +/** + * 岗位信息 服务层 + * + * @author #author# + */ +public interface ISysPostService +{ + /** + * 查询岗位信息集合 + * + * @param post 岗位信息 + * @return 岗位列表 + */ + public List selectPostList(SysPost post); + + /** + * 查询所有岗位 + * + * @return 岗位列表 + */ + public List selectPostAll(); + + /** + * 通过岗位ID查询岗位信息 + * + * @param postId 岗位ID + * @return 角色对象信息 + */ + public SysPost selectPostById(Long postId); + + /** + * 根据用户ID获取岗位选择框列表 + * + * @param userId 用户ID + * @return 选中岗位ID列表 + */ + public List selectPostListByUserId(Long userId); + + /** + * 校验岗位名称 + * + * @param post 岗位信息 + * @return 结果 + */ + public String checkPostNameUnique(SysPost post); + + /** + * 校验岗位编码 + * + * @param post 岗位信息 + * @return 结果 + */ + public String checkPostCodeUnique(SysPost post); + + /** + * 通过岗位ID查询岗位使用数量 + * + * @param postId 岗位ID + * @return 结果 + */ + public int countUserPostById(Long postId); + + /** + * 删除岗位信息 + * + * @param postId 岗位ID + * @return 结果 + */ + public int deletePostById(Long postId); + + /** + * 批量删除岗位信息 + * + * @param postIds 需要删除的岗位ID + * @return 结果 + */ + public int deletePostByIds(Long[] postIds); + + /** + * 新增保存岗位信息 + * + * @param post 岗位信息 + * @return 结果 + */ + public int insertPost(SysPost post); + + /** + * 修改保存岗位信息 + * + * @param post 岗位信息 + * @return 结果 + */ + public int updatePost(SysPost post); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysRoleService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysRoleService.java new file mode 100644 index 0000000..0db73d4 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysRoleService.java @@ -0,0 +1,173 @@ +package com.ruoyi.system.service; + +import java.util.List; +import java.util.Set; +import com.ruoyi.common.core.domain.entity.SysRole; +import com.ruoyi.system.domain.SysUserRole; + +/** + * 角色业务层 + * + * @author #author# + */ +public interface ISysRoleService +{ + /** + * 根据条件分页查询角色数据 + * + * @param role 角色信息 + * @return 角色数据集合信息 + */ + public List selectRoleList(SysRole role); + + /** + * 根据用户ID查询角色列表 + * + * @param userId 用户ID + * @return 角色列表 + */ + public List selectRolesByUserId(Long userId); + + /** + * 根据用户ID查询角色权限 + * + * @param userId 用户ID + * @return 权限列表 + */ + public Set selectRolePermissionByUserId(Long userId); + + /** + * 查询所有角色 + * + * @return 角色列表 + */ + public List selectRoleAll(); + + /** + * 根据用户ID获取角色选择框列表 + * + * @param userId 用户ID + * @return 选中角色ID列表 + */ + public List selectRoleListByUserId(Long userId); + + /** + * 通过角色ID查询角色 + * + * @param roleId 角色ID + * @return 角色对象信息 + */ + public SysRole selectRoleById(Long roleId); + + /** + * 校验角色名称是否唯一 + * + * @param role 角色信息 + * @return 结果 + */ + public String checkRoleNameUnique(SysRole role); + + /** + * 校验角色权限是否唯一 + * + * @param role 角色信息 + * @return 结果 + */ + public String checkRoleKeyUnique(SysRole role); + + /** + * 校验角色是否允许操作 + * + * @param role 角色信息 + */ + public void checkRoleAllowed(SysRole role); + + /** + * 校验角色是否有数据权限 + * + * @param roleId 角色id + */ + public void checkRoleDataScope(Long roleId); + + /** + * 通过角色ID查询角色使用数量 + * + * @param roleId 角色ID + * @return 结果 + */ + public int countUserRoleByRoleId(Long roleId); + + /** + * 新增保存角色信息 + * + * @param role 角色信息 + * @return 结果 + */ + public int insertRole(SysRole role); + + /** + * 修改保存角色信息 + * + * @param role 角色信息 + * @return 结果 + */ + public int updateRole(SysRole role); + + /** + * 修改角色状态 + * + * @param role 角色信息 + * @return 结果 + */ + public int updateRoleStatus(SysRole role); + + /** + * 修改数据权限信息 + * + * @param role 角色信息 + * @return 结果 + */ + public int authDataScope(SysRole role); + + /** + * 通过角色ID删除角色 + * + * @param roleId 角色ID + * @return 结果 + */ + public int deleteRoleById(Long roleId); + + /** + * 批量删除角色信息 + * + * @param roleIds 需要删除的角色ID + * @return 结果 + */ + public int deleteRoleByIds(Long[] roleIds); + + /** + * 取消授权用户角色 + * + * @param userRole 用户和角色关联信息 + * @return 结果 + */ + public int deleteAuthUser(SysUserRole userRole); + + /** + * 批量取消授权用户角色 + * + * @param roleId 角色ID + * @param userIds 需要取消授权的用户数据ID + * @return 结果 + */ + public int deleteAuthUsers(Long roleId, Long[] userIds); + + /** + * 批量选择授权用户角色 + * + * @param roleId 角色ID + * @param userIds 需要删除的用户数据ID + * @return 结果 + */ + public int insertAuthUsers(Long roleId, Long[] userIds); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysUserOnlineService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysUserOnlineService.java new file mode 100644 index 0000000..9d60a6e --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysUserOnlineService.java @@ -0,0 +1,48 @@ +package com.ruoyi.system.service; + +import com.ruoyi.common.core.domain.model.LoginUser; +import com.ruoyi.system.domain.SysUserOnline; + +/** + * 在线用户 服务层 + * + * @author #author# + */ +public interface ISysUserOnlineService +{ + /** + * 通过登录地址查询信息 + * + * @param ipaddr 登录地址 + * @param user 用户信息 + * @return 在线用户信息 + */ + public SysUserOnline selectOnlineByIpaddr(String ipaddr, LoginUser user); + + /** + * 通过用户名称查询信息 + * + * @param userName 用户名称 + * @param user 用户信息 + * @return 在线用户信息 + */ + public SysUserOnline selectOnlineByUserName(String userName, LoginUser user); + + /** + * 通过登录地址/用户名称查询信息 + * + * @param ipaddr 登录地址 + * @param userName 用户名称 + * @param user 用户信息 + * @return 在线用户信息 + */ + public SysUserOnline selectOnlineByInfo(String ipaddr, String userName, LoginUser user); + + /** + * 设置在线用户信息 + * + * @param user 用户信息 + * @return 在线用户 + */ + public SysUserOnline loginUserToUserOnline(LoginUser user); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysUserService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysUserService.java new file mode 100644 index 0000000..fb777b8 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysUserService.java @@ -0,0 +1,206 @@ +package com.ruoyi.system.service; + +import java.util.List; +import com.ruoyi.common.core.domain.entity.SysUser; + +/** + * 用户 业务层 + * + * @author #author# + */ +public interface ISysUserService +{ + /** + * 根据条件分页查询用户列表 + * + * @param user 用户信息 + * @return 用户信息集合信息 + */ + public List selectUserList(SysUser user); + + /** + * 根据条件分页查询已分配用户角色列表 + * + * @param user 用户信息 + * @return 用户信息集合信息 + */ + public List selectAllocatedList(SysUser user); + + /** + * 根据条件分页查询未分配用户角色列表 + * + * @param user 用户信息 + * @return 用户信息集合信息 + */ + public List selectUnallocatedList(SysUser user); + + /** + * 通过用户名查询用户 + * + * @param userName 用户名 + * @return 用户对象信息 + */ + public SysUser selectUserByUserName(String userName); + + /** + * 通过用户ID查询用户 + * + * @param userId 用户ID + * @return 用户对象信息 + */ + public SysUser selectUserById(Long userId); + + /** + * 根据用户ID查询用户所属角色组 + * + * @param userName 用户名 + * @return 结果 + */ + public String selectUserRoleGroup(String userName); + + /** + * 根据用户ID查询用户所属岗位组 + * + * @param userName 用户名 + * @return 结果 + */ + public String selectUserPostGroup(String userName); + + /** + * 校验用户名称是否唯一 + * + * @param user 用户信息 + * @return 结果 + */ + public String checkUserNameUnique(SysUser user); + + /** + * 校验手机号码是否唯一 + * + * @param user 用户信息 + * @return 结果 + */ + public String checkPhoneUnique(SysUser user); + + /** + * 校验email是否唯一 + * + * @param user 用户信息 + * @return 结果 + */ + public String checkEmailUnique(SysUser user); + + /** + * 校验用户是否允许操作 + * + * @param user 用户信息 + */ + public void checkUserAllowed(SysUser user); + + /** + * 校验用户是否有数据权限 + * + * @param userId 用户id + */ + public void checkUserDataScope(Long userId); + + /** + * 新增用户信息 + * + * @param user 用户信息 + * @return 结果 + */ + public int insertUser(SysUser user); + + /** + * 注册用户信息 + * + * @param user 用户信息 + * @return 结果 + */ + public boolean registerUser(SysUser user); + + /** + * 修改用户信息 + * + * @param user 用户信息 + * @return 结果 + */ + public int updateUser(SysUser user); + + /** + * 用户授权角色 + * + * @param userId 用户ID + * @param roleIds 角色组 + */ + public void insertUserAuth(Long userId, Long[] roleIds); + + /** + * 修改用户状态 + * + * @param user 用户信息 + * @return 结果 + */ + public int updateUserStatus(SysUser user); + + /** + * 修改用户基本信息 + * + * @param user 用户信息 + * @return 结果 + */ + public int updateUserProfile(SysUser user); + + /** + * 修改用户头像 + * + * @param userName 用户名 + * @param avatar 头像地址 + * @return 结果 + */ + public boolean updateUserAvatar(String userName, String avatar); + + /** + * 重置用户密码 + * + * @param user 用户信息 + * @return 结果 + */ + public int resetPwd(SysUser user); + + /** + * 重置用户密码 + * + * @param userName 用户名 + * @param password 密码 + * @return 结果 + */ + public int resetUserPwd(String userName, String password); + + /** + * 通过用户ID删除用户 + * + * @param userId 用户ID + * @return 结果 + */ + public int deleteUserById(Long userId); + + /** + * 批量删除用户信息 + * + * @param userIds 需要删除的用户ID + * @return 结果 + */ + public int deleteUserByIds(Long[] userIds); + + /** + * 导入用户数据 + * + * @param userList 用户数据列表 + * @param isUpdateSupport 是否更新支持,如果已存在,则进行更新数据 + * @param operName 操作用户 + * @return 结果 + */ + public String importUser(List userList, Boolean isUpdateSupport, String operName); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysConfigServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysConfigServiceImpl.java new file mode 100644 index 0000000..bc76d04 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysConfigServiceImpl.java @@ -0,0 +1,232 @@ +package com.ruoyi.system.service.impl; + +import java.util.Collection; +import java.util.List; +import javax.annotation.PostConstruct; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.common.annotation.DataSource; +import com.ruoyi.common.constant.CacheConstants; +import com.ruoyi.common.constant.UserConstants; +import com.ruoyi.common.core.redis.RedisCache; +import com.ruoyi.common.core.text.Convert; +import com.ruoyi.common.enums.DataSourceType; +import com.ruoyi.common.exception.ServiceException; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.system.domain.SysConfig; +import com.ruoyi.system.mapper.SysConfigMapper; +import com.ruoyi.system.service.ISysConfigService; + +/** + * 参数配置 服务层实现 + * + * @author #author# + */ +@Service +public class SysConfigServiceImpl implements ISysConfigService +{ + @Autowired + private SysConfigMapper configMapper; + + @Autowired + private RedisCache redisCache; + + /** + * 项目启动时,初始化参数到缓存 + */ + @PostConstruct + public void init() + { + loadingConfigCache(); + } + + /** + * 查询参数配置信息 + * + * @param configId 参数配置ID + * @return 参数配置信息 + */ + @Override + @DataSource(DataSourceType.MASTER) + public SysConfig selectConfigById(Long configId) + { + SysConfig config = new SysConfig(); + config.setConfigId(configId); + return configMapper.selectConfig(config); + } + + /** + * 根据键名查询参数配置信息 + * + * @param configKey 参数key + * @return 参数键值 + */ + @Override + public String selectConfigByKey(String configKey) + { + String configValue = Convert.toStr(redisCache.getCacheObject(getCacheKey(configKey))); + if (StringUtils.isNotEmpty(configValue)) + { + return configValue; + } + SysConfig config = new SysConfig(); + config.setConfigKey(configKey); + SysConfig retConfig = configMapper.selectConfig(config); + if (StringUtils.isNotNull(retConfig)) + { + redisCache.setCacheObject(getCacheKey(configKey), retConfig.getConfigValue()); + return retConfig.getConfigValue(); + } + return StringUtils.EMPTY; + } + + /** + * 获取验证码开关 + * + * @return true开启,false关闭 + */ + @Override + public boolean selectCaptchaEnabled() + { + String captchaEnabled = selectConfigByKey("sys.account.captchaEnabled"); + if (StringUtils.isEmpty(captchaEnabled)) + { + return true; + } + return Convert.toBool(captchaEnabled); + } + + /** + * 查询参数配置列表 + * + * @param config 参数配置信息 + * @return 参数配置集合 + */ + @Override + public List selectConfigList(SysConfig config) + { + return configMapper.selectConfigList(config); + } + + /** + * 新增参数配置 + * + * @param config 参数配置信息 + * @return 结果 + */ + @Override + public int insertConfig(SysConfig config) + { + int row = configMapper.insertConfig(config); + if (row > 0) + { + redisCache.setCacheObject(getCacheKey(config.getConfigKey()), config.getConfigValue()); + } + return row; + } + + /** + * 修改参数配置 + * + * @param config 参数配置信息 + * @return 结果 + */ + @Override + public int updateConfig(SysConfig config) + { + SysConfig temp = configMapper.selectConfigById(config.getConfigId()); + if (!StringUtils.equals(temp.getConfigKey(), config.getConfigKey())) + { + redisCache.deleteObject(getCacheKey(temp.getConfigKey())); + } + + int row = configMapper.updateConfig(config); + if (row > 0) + { + redisCache.setCacheObject(getCacheKey(config.getConfigKey()), config.getConfigValue()); + } + return row; + } + + /** + * 批量删除参数信息 + * + * @param configIds 需要删除的参数ID + */ + @Override + public void deleteConfigByIds(Long[] configIds) + { + for (Long configId : configIds) + { + SysConfig config = selectConfigById(configId); + if (StringUtils.equals(UserConstants.YES, config.getConfigType())) + { + throw new ServiceException(String.format("内置参数【%1$s】不能删除 ", config.getConfigKey())); + } + configMapper.deleteConfigById(configId); + redisCache.deleteObject(getCacheKey(config.getConfigKey())); + } + } + + /** + * 加载参数缓存数据 + */ + @Override + public void loadingConfigCache() + { + List configsList = configMapper.selectConfigList(new SysConfig()); + for (SysConfig config : configsList) + { + redisCache.setCacheObject(getCacheKey(config.getConfigKey()), config.getConfigValue()); + } + } + + /** + * 清空参数缓存数据 + */ + @Override + public void clearConfigCache() + { + Collection keys = redisCache.keys(CacheConstants.SYS_CONFIG_KEY + "*"); + redisCache.deleteObject(keys); + } + + /** + * 重置参数缓存数据 + */ + @Override + public void resetConfigCache() + { + clearConfigCache(); + loadingConfigCache(); + } + + /** + * 校验参数键名是否唯一 + * + * @param config 参数配置信息 + * @return 结果 + */ + @Override + public String checkConfigKeyUnique(SysConfig config) + { + Long configId = StringUtils.isNull(config.getConfigId()) ? -1L : config.getConfigId(); + SysConfig info = configMapper.checkConfigKeyUnique(config.getConfigKey()); + if (StringUtils.isNotNull(info) && info.getConfigId().longValue() != configId.longValue()) + { + return UserConstants.NOT_UNIQUE; + } + return UserConstants.UNIQUE; + } + + /** + * 设置cache key + * + * @param configKey 参数键 + * @return 缓存键key + */ + private String getCacheKey(String configKey) + { + return CacheConstants.SYS_CONFIG_KEY + configKey; + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java new file mode 100644 index 0000000..fd65555 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java @@ -0,0 +1,338 @@ +package com.ruoyi.system.service.impl; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.stream.Collectors; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.common.annotation.DataScope; +import com.ruoyi.common.constant.UserConstants; +import com.ruoyi.common.core.domain.TreeSelect; +import com.ruoyi.common.core.domain.entity.SysDept; +import com.ruoyi.common.core.domain.entity.SysRole; +import com.ruoyi.common.core.domain.entity.SysUser; +import com.ruoyi.common.core.text.Convert; +import com.ruoyi.common.exception.ServiceException; +import com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.common.utils.spring.SpringUtils; +import com.ruoyi.system.mapper.SysDeptMapper; +import com.ruoyi.system.mapper.SysRoleMapper; +import com.ruoyi.system.service.ISysDeptService; + +/** + * 部门管理 服务实现 + * + * @author #author# + */ +@Service +public class SysDeptServiceImpl implements ISysDeptService +{ + @Autowired + private SysDeptMapper deptMapper; + + @Autowired + private SysRoleMapper roleMapper; + + /** + * 查询部门管理数据 + * + * @param dept 部门信息 + * @return 部门信息集合 + */ + @Override + @DataScope(deptAlias = "d") + public List selectDeptList(SysDept dept) + { + return deptMapper.selectDeptList(dept); + } + + /** + * 查询部门树结构信息 + * + * @param dept 部门信息 + * @return 部门树信息集合 + */ + @Override + public List selectDeptTreeList(SysDept dept) + { + List depts = SpringUtils.getAopProxy(this).selectDeptList(dept); + return buildDeptTreeSelect(depts); + } + + /** + * 构建前端所需要树结构 + * + * @param depts 部门列表 + * @return 树结构列表 + */ + @Override + public List buildDeptTree(List depts) + { + List returnList = new ArrayList(); + List tempList = depts.stream().map(SysDept::getDeptId).collect(Collectors.toList()); + for (SysDept dept : depts) + { + // 如果是顶级节点, 遍历该父节点的所有子节点 + if (!tempList.contains(dept.getParentId())) + { + recursionFn(depts, dept); + returnList.add(dept); + } + } + if (returnList.isEmpty()) + { + returnList = depts; + } + return returnList; + } + + /** + * 构建前端所需要下拉树结构 + * + * @param depts 部门列表 + * @return 下拉树结构列表 + */ + @Override + public List buildDeptTreeSelect(List depts) + { + List deptTrees = buildDeptTree(depts); + return deptTrees.stream().map(TreeSelect::new).collect(Collectors.toList()); + } + + /** + * 根据角色ID查询部门树信息 + * + * @param roleId 角色ID + * @return 选中部门列表 + */ + @Override + public List selectDeptListByRoleId(Long roleId) + { + SysRole role = roleMapper.selectRoleById(roleId); + return deptMapper.selectDeptListByRoleId(roleId, role.isDeptCheckStrictly()); + } + + /** + * 根据部门ID查询信息 + * + * @param deptId 部门ID + * @return 部门信息 + */ + @Override + public SysDept selectDeptById(Long deptId) + { + return deptMapper.selectDeptById(deptId); + } + + /** + * 根据ID查询所有子部门(正常状态) + * + * @param deptId 部门ID + * @return 子部门数 + */ + @Override + public int selectNormalChildrenDeptById(Long deptId) + { + return deptMapper.selectNormalChildrenDeptById(deptId); + } + + /** + * 是否存在子节点 + * + * @param deptId 部门ID + * @return 结果 + */ + @Override + public boolean hasChildByDeptId(Long deptId) + { + int result = deptMapper.hasChildByDeptId(deptId); + return result > 0; + } + + /** + * 查询部门是否存在用户 + * + * @param deptId 部门ID + * @return 结果 true 存在 false 不存在 + */ + @Override + public boolean checkDeptExistUser(Long deptId) + { + int result = deptMapper.checkDeptExistUser(deptId); + return result > 0; + } + + /** + * 校验部门名称是否唯一 + * + * @param dept 部门信息 + * @return 结果 + */ + @Override + public String checkDeptNameUnique(SysDept dept) + { + Long deptId = StringUtils.isNull(dept.getDeptId()) ? -1L : dept.getDeptId(); + SysDept info = deptMapper.checkDeptNameUnique(dept.getDeptName(), dept.getParentId()); + if (StringUtils.isNotNull(info) && info.getDeptId().longValue() != deptId.longValue()) + { + return UserConstants.NOT_UNIQUE; + } + return UserConstants.UNIQUE; + } + + /** + * 校验部门是否有数据权限 + * + * @param deptId 部门id + */ + @Override + public void checkDeptDataScope(Long deptId) + { + if (!SysUser.isAdmin(SecurityUtils.getUserId())) + { + SysDept dept = new SysDept(); + dept.setDeptId(deptId); + List depts = SpringUtils.getAopProxy(this).selectDeptList(dept); + if (StringUtils.isEmpty(depts)) + { + throw new ServiceException("没有权限访问部门数据!"); + } + } + } + + /** + * 新增保存部门信息 + * + * @param dept 部门信息 + * @return 结果 + */ + @Override + public int insertDept(SysDept dept) + { + SysDept info = deptMapper.selectDeptById(dept.getParentId()); + // 如果父节点不为正常状态,则不允许新增子节点 + if (!UserConstants.DEPT_NORMAL.equals(info.getStatus())) + { + throw new ServiceException("部门停用,不允许新增"); + } + dept.setAncestors(info.getAncestors() + "," + dept.getParentId()); + return deptMapper.insertDept(dept); + } + + /** + * 修改保存部门信息 + * + * @param dept 部门信息 + * @return 结果 + */ + @Override + public int updateDept(SysDept dept) + { + SysDept newParentDept = deptMapper.selectDeptById(dept.getParentId()); + SysDept oldDept = deptMapper.selectDeptById(dept.getDeptId()); + if (StringUtils.isNotNull(newParentDept) && StringUtils.isNotNull(oldDept)) + { + String newAncestors = newParentDept.getAncestors() + "," + newParentDept.getDeptId(); + String oldAncestors = oldDept.getAncestors(); + dept.setAncestors(newAncestors); + updateDeptChildren(dept.getDeptId(), newAncestors, oldAncestors); + } + int result = deptMapper.updateDept(dept); + if (UserConstants.DEPT_NORMAL.equals(dept.getStatus()) && StringUtils.isNotEmpty(dept.getAncestors()) + && !StringUtils.equals("0", dept.getAncestors())) + { + // 如果该部门是启用状态,则启用该部门的所有上级部门 + updateParentDeptStatusNormal(dept); + } + return result; + } + + /** + * 修改该部门的父级部门状态 + * + * @param dept 当前部门 + */ + private void updateParentDeptStatusNormal(SysDept dept) + { + String ancestors = dept.getAncestors(); + Long[] deptIds = Convert.toLongArray(ancestors); + deptMapper.updateDeptStatusNormal(deptIds); + } + + /** + * 修改子元素关系 + * + * @param deptId 被修改的部门ID + * @param newAncestors 新的父ID集合 + * @param oldAncestors 旧的父ID集合 + */ + public void updateDeptChildren(Long deptId, String newAncestors, String oldAncestors) + { + List children = deptMapper.selectChildrenDeptById(deptId); + for (SysDept child : children) + { + child.setAncestors(child.getAncestors().replaceFirst(oldAncestors, newAncestors)); + } + if (children.size() > 0) + { + deptMapper.updateDeptChildren(children); + } + } + + /** + * 删除部门管理信息 + * + * @param deptId 部门ID + * @return 结果 + */ + @Override + public int deleteDeptById(Long deptId) + { + return deptMapper.deleteDeptById(deptId); + } + + /** + * 递归列表 + */ + private void recursionFn(List list, SysDept t) + { + // 得到子节点列表 + List childList = getChildList(list, t); + t.setChildren(childList); + for (SysDept tChild : childList) + { + if (hasChild(list, tChild)) + { + recursionFn(list, tChild); + } + } + } + + /** + * 得到子节点列表 + */ + private List getChildList(List list, SysDept t) + { + List tlist = new ArrayList(); + Iterator it = list.iterator(); + while (it.hasNext()) + { + SysDept n = (SysDept) it.next(); + if (StringUtils.isNotNull(n.getParentId()) && n.getParentId().longValue() == t.getDeptId().longValue()) + { + tlist.add(n); + } + } + return tlist; + } + + /** + * 判断是否有子节点 + */ + private boolean hasChild(List list, SysDept t) + { + return getChildList(list, t).size() > 0; + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictDataServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictDataServiceImpl.java new file mode 100644 index 0000000..af66b81 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictDataServiceImpl.java @@ -0,0 +1,111 @@ +package com.ruoyi.system.service.impl; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.common.core.domain.entity.SysDictData; +import com.ruoyi.common.utils.DictUtils; +import com.ruoyi.system.mapper.SysDictDataMapper; +import com.ruoyi.system.service.ISysDictDataService; + +/** + * 字典 业务层处理 + * + * @author #author# + */ +@Service +public class SysDictDataServiceImpl implements ISysDictDataService +{ + @Autowired + private SysDictDataMapper dictDataMapper; + + /** + * 根据条件分页查询字典数据 + * + * @param dictData 字典数据信息 + * @return 字典数据集合信息 + */ + @Override + public List selectDictDataList(SysDictData dictData) + { + return dictDataMapper.selectDictDataList(dictData); + } + + /** + * 根据字典类型和字典键值查询字典数据信息 + * + * @param dictType 字典类型 + * @param dictValue 字典键值 + * @return 字典标签 + */ + @Override + public String selectDictLabel(String dictType, String dictValue) + { + return dictDataMapper.selectDictLabel(dictType, dictValue); + } + + /** + * 根据字典数据ID查询信息 + * + * @param dictCode 字典数据ID + * @return 字典数据 + */ + @Override + public SysDictData selectDictDataById(Long dictCode) + { + return dictDataMapper.selectDictDataById(dictCode); + } + + /** + * 批量删除字典数据信息 + * + * @param dictCodes 需要删除的字典数据ID + */ + @Override + public void deleteDictDataByIds(Long[] dictCodes) + { + for (Long dictCode : dictCodes) + { + SysDictData data = selectDictDataById(dictCode); + dictDataMapper.deleteDictDataById(dictCode); + List dictDatas = dictDataMapper.selectDictDataByType(data.getDictType()); + DictUtils.setDictCache(data.getDictType(), dictDatas); + } + } + + /** + * 新增保存字典数据信息 + * + * @param data 字典数据信息 + * @return 结果 + */ + @Override + public int insertDictData(SysDictData data) + { + int row = dictDataMapper.insertDictData(data); + if (row > 0) + { + List dictDatas = dictDataMapper.selectDictDataByType(data.getDictType()); + DictUtils.setDictCache(data.getDictType(), dictDatas); + } + return row; + } + + /** + * 修改保存字典数据信息 + * + * @param data 字典数据信息 + * @return 结果 + */ + @Override + public int updateDictData(SysDictData data) + { + int row = dictDataMapper.updateDictData(data); + if (row > 0) + { + List dictDatas = dictDataMapper.selectDictDataByType(data.getDictType()); + DictUtils.setDictCache(data.getDictType(), dictDatas); + } + return row; + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictTypeServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictTypeServiceImpl.java new file mode 100644 index 0000000..3e1a18c --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictTypeServiceImpl.java @@ -0,0 +1,223 @@ +package com.ruoyi.system.service.impl; + +import java.util.Comparator; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; +import javax.annotation.PostConstruct; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import com.ruoyi.common.constant.UserConstants; +import com.ruoyi.common.core.domain.entity.SysDictData; +import com.ruoyi.common.core.domain.entity.SysDictType; +import com.ruoyi.common.exception.ServiceException; +import com.ruoyi.common.utils.DictUtils; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.system.mapper.SysDictDataMapper; +import com.ruoyi.system.mapper.SysDictTypeMapper; +import com.ruoyi.system.service.ISysDictTypeService; + +/** + * 字典 业务层处理 + * + * @author #author# + */ +@Service +public class SysDictTypeServiceImpl implements ISysDictTypeService +{ + @Autowired + private SysDictTypeMapper dictTypeMapper; + + @Autowired + private SysDictDataMapper dictDataMapper; + + /** + * 项目启动时,初始化字典到缓存 + */ + @PostConstruct + public void init() + { + loadingDictCache(); + } + + /** + * 根据条件分页查询字典类型 + * + * @param dictType 字典类型信息 + * @return 字典类型集合信息 + */ + @Override + public List selectDictTypeList(SysDictType dictType) + { + return dictTypeMapper.selectDictTypeList(dictType); + } + + /** + * 根据所有字典类型 + * + * @return 字典类型集合信息 + */ + @Override + public List selectDictTypeAll() + { + return dictTypeMapper.selectDictTypeAll(); + } + + /** + * 根据字典类型查询字典数据 + * + * @param dictType 字典类型 + * @return 字典数据集合信息 + */ + @Override + public List selectDictDataByType(String dictType) + { + List dictDatas = DictUtils.getDictCache(dictType); + if (StringUtils.isNotEmpty(dictDatas)) + { + return dictDatas; + } + dictDatas = dictDataMapper.selectDictDataByType(dictType); + if (StringUtils.isNotEmpty(dictDatas)) + { + DictUtils.setDictCache(dictType, dictDatas); + return dictDatas; + } + return null; + } + + /** + * 根据字典类型ID查询信息 + * + * @param dictId 字典类型ID + * @return 字典类型 + */ + @Override + public SysDictType selectDictTypeById(Long dictId) + { + return dictTypeMapper.selectDictTypeById(dictId); + } + + /** + * 根据字典类型查询信息 + * + * @param dictType 字典类型 + * @return 字典类型 + */ + @Override + public SysDictType selectDictTypeByType(String dictType) + { + return dictTypeMapper.selectDictTypeByType(dictType); + } + + /** + * 批量删除字典类型信息 + * + * @param dictIds 需要删除的字典ID + */ + @Override + public void deleteDictTypeByIds(Long[] dictIds) + { + for (Long dictId : dictIds) + { + SysDictType dictType = selectDictTypeById(dictId); + if (dictDataMapper.countDictDataByType(dictType.getDictType()) > 0) + { + throw new ServiceException(String.format("%1$s已分配,不能删除", dictType.getDictName())); + } + dictTypeMapper.deleteDictTypeById(dictId); + DictUtils.removeDictCache(dictType.getDictType()); + } + } + + /** + * 加载字典缓存数据 + */ + @Override + public void loadingDictCache() + { + SysDictData dictData = new SysDictData(); + dictData.setStatus("0"); + Map> dictDataMap = dictDataMapper.selectDictDataList(dictData).stream().collect(Collectors.groupingBy(SysDictData::getDictType)); + for (Map.Entry> entry : dictDataMap.entrySet()) + { + DictUtils.setDictCache(entry.getKey(), entry.getValue().stream().sorted(Comparator.comparing(SysDictData::getDictSort)).collect(Collectors.toList())); + } + } + + /** + * 清空字典缓存数据 + */ + @Override + public void clearDictCache() + { + DictUtils.clearDictCache(); + } + + /** + * 重置字典缓存数据 + */ + @Override + public void resetDictCache() + { + clearDictCache(); + loadingDictCache(); + } + + /** + * 新增保存字典类型信息 + * + * @param dict 字典类型信息 + * @return 结果 + */ + @Override + public int insertDictType(SysDictType dict) + { + int row = dictTypeMapper.insertDictType(dict); + if (row > 0) + { + DictUtils.setDictCache(dict.getDictType(), null); + } + return row; + } + + /** + * 修改保存字典类型信息 + * + * @param dict 字典类型信息 + * @return 结果 + */ + @Override + @Transactional + public int updateDictType(SysDictType dict) + { + SysDictType oldDict = dictTypeMapper.selectDictTypeById(dict.getDictId()); + dictDataMapper.updateDictDataType(oldDict.getDictType(), dict.getDictType()); + int row = dictTypeMapper.updateDictType(dict); + if (row > 0) + { + List dictDatas = dictDataMapper.selectDictDataByType(dict.getDictType()); + DictUtils.setDictCache(dict.getDictType(), dictDatas); + } + return row; + } + + /** + * 校验字典类型称是否唯一 + * + * @param dict 字典类型 + * @return 结果 + */ + @Override + public String checkDictTypeUnique(SysDictType dict) + { + Long dictId = StringUtils.isNull(dict.getDictId()) ? -1L : dict.getDictId(); + SysDictType dictType = dictTypeMapper.checkDictTypeUnique(dict.getDictType()); + if (StringUtils.isNotNull(dictType) && dictType.getDictId().longValue() != dictId.longValue()) + { + return UserConstants.NOT_UNIQUE; + } + return UserConstants.UNIQUE; + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysLogininforServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysLogininforServiceImpl.java new file mode 100644 index 0000000..3ab1326 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysLogininforServiceImpl.java @@ -0,0 +1,65 @@ +package com.ruoyi.system.service.impl; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.system.domain.SysLogininfor; +import com.ruoyi.system.mapper.SysLogininforMapper; +import com.ruoyi.system.service.ISysLogininforService; + +/** + * 系统访问日志情况信息 服务层处理 + * + * @author #author# + */ +@Service +public class SysLogininforServiceImpl implements ISysLogininforService +{ + + @Autowired + private SysLogininforMapper logininforMapper; + + /** + * 新增系统登录日志 + * + * @param logininfor 访问日志对象 + */ + @Override + public void insertLogininfor(SysLogininfor logininfor) + { + logininforMapper.insertLogininfor(logininfor); + } + + /** + * 查询系统登录日志集合 + * + * @param logininfor 访问日志对象 + * @return 登录记录集合 + */ + @Override + public List selectLogininforList(SysLogininfor logininfor) + { + return logininforMapper.selectLogininforList(logininfor); + } + + /** + * 批量删除系统登录日志 + * + * @param infoIds 需要删除的登录日志ID + * @return 结果 + */ + @Override + public int deleteLogininforByIds(Long[] infoIds) + { + return logininforMapper.deleteLogininforByIds(infoIds); + } + + /** + * 清空系统登录日志 + */ + @Override + public void cleanLogininfor() + { + logininforMapper.cleanLogininfor(); + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java new file mode 100644 index 0000000..6b652cc --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java @@ -0,0 +1,531 @@ +package com.ruoyi.system.service.impl; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.common.constant.Constants; +import com.ruoyi.common.constant.UserConstants; +import com.ruoyi.common.core.domain.TreeSelect; +import com.ruoyi.common.core.domain.entity.SysMenu; +import com.ruoyi.common.core.domain.entity.SysRole; +import com.ruoyi.common.core.domain.entity.SysUser; +import com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.system.domain.vo.MetaVo; +import com.ruoyi.system.domain.vo.RouterVo; +import com.ruoyi.system.mapper.SysMenuMapper; +import com.ruoyi.system.mapper.SysRoleMapper; +import com.ruoyi.system.mapper.SysRoleMenuMapper; +import com.ruoyi.system.service.ISysMenuService; + +/** + * 菜单 业务层处理 + * + * @author #author# + */ +@Service +public class SysMenuServiceImpl implements ISysMenuService +{ + public static final String PREMISSION_STRING = "perms[\"{0}\"]"; + + @Autowired + private SysMenuMapper menuMapper; + + @Autowired + private SysRoleMapper roleMapper; + + @Autowired + private SysRoleMenuMapper roleMenuMapper; + + /** + * 根据用户查询系统菜单列表 + * + * @param userId 用户ID + * @return 菜单列表 + */ + @Override + public List selectMenuList(Long userId) + { + return selectMenuList(new SysMenu(), userId); + } + + /** + * 查询系统菜单列表 + * + * @param menu 菜单信息 + * @return 菜单列表 + */ + @Override + public List selectMenuList(SysMenu menu, Long userId) + { + List menuList = null; + // 管理员显示所有菜单信息 + if (SysUser.isAdmin(userId)) + { + menuList = menuMapper.selectMenuList(menu); + } + else + { + menu.getParams().put("userId", userId); + menuList = menuMapper.selectMenuListByUserId(menu); + } + return menuList; + } + + /** + * 根据用户ID查询权限 + * + * @param userId 用户ID + * @return 权限列表 + */ + @Override + public Set selectMenuPermsByUserId(Long userId) + { + List perms = menuMapper.selectMenuPermsByUserId(userId); + Set permsSet = new HashSet<>(); + for (String perm : perms) + { + if (StringUtils.isNotEmpty(perm)) + { + permsSet.addAll(Arrays.asList(perm.trim().split(","))); + } + } + return permsSet; + } + + /** + * 根据角色ID查询权限 + * + * @param roleId 角色ID + * @return 权限列表 + */ + @Override + public Set selectMenuPermsByRoleId(Long roleId) + { + List perms = menuMapper.selectMenuPermsByRoleId(roleId); + Set permsSet = new HashSet<>(); + for (String perm : perms) + { + if (StringUtils.isNotEmpty(perm)) + { + permsSet.addAll(Arrays.asList(perm.trim().split(","))); + } + } + return permsSet; + } + + /** + * 根据用户ID查询菜单 + * + * @param userId 用户名称 + * @return 菜单列表 + */ + @Override + public List selectMenuTreeByUserId(Long userId) + { + List menus = null; + if (SecurityUtils.isAdmin(userId)) + { + menus = menuMapper.selectMenuTreeAll(); + } + else + { + menus = menuMapper.selectMenuTreeByUserId(userId); + } + return getChildPerms(menus, 0); + } + + /** + * 根据角色ID查询菜单树信息 + * + * @param roleId 角色ID + * @return 选中菜单列表 + */ + @Override + public List selectMenuListByRoleId(Long roleId) + { + SysRole role = roleMapper.selectRoleById(roleId); + return menuMapper.selectMenuListByRoleId(roleId, role.isMenuCheckStrictly()); + } + + /** + * 构建前端路由所需要的菜单 + * + * @param menus 菜单列表 + * @return 路由列表 + */ + @Override + public List buildMenus(List menus) + { + List routers = new LinkedList(); + for (SysMenu menu : menus) + { + RouterVo router = new RouterVo(); + router.setHidden("1".equals(menu.getVisible())); + router.setName(getRouteName(menu)); + router.setPath(getRouterPath(menu)); + router.setComponent(getComponent(menu)); + router.setQuery(menu.getQuery()); + router.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon(), StringUtils.equals("1", menu.getIsCache()), menu.getPath())); + List cMenus = menu.getChildren(); + if (!cMenus.isEmpty() && cMenus.size() > 0 && UserConstants.TYPE_DIR.equals(menu.getMenuType())) + { + router.setAlwaysShow(true); + router.setRedirect("noRedirect"); + router.setChildren(buildMenus(cMenus)); + } + else if (isMenuFrame(menu)) + { + router.setMeta(null); + List childrenList = new ArrayList(); + RouterVo children = new RouterVo(); + children.setPath(menu.getPath()); + children.setComponent(menu.getComponent()); + children.setName(StringUtils.capitalize(menu.getPath())); + children.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon(), StringUtils.equals("1", menu.getIsCache()), menu.getPath())); + children.setQuery(menu.getQuery()); + childrenList.add(children); + router.setChildren(childrenList); + } + else if (menu.getParentId().intValue() == 0 && isInnerLink(menu)) + { + router.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon())); + router.setPath("/"); + List childrenList = new ArrayList(); + RouterVo children = new RouterVo(); + String routerPath = innerLinkReplaceEach(menu.getPath()); + children.setPath(routerPath); + children.setComponent(UserConstants.INNER_LINK); + children.setName(StringUtils.capitalize(routerPath)); + children.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon(), menu.getPath())); + childrenList.add(children); + router.setChildren(childrenList); + } + routers.add(router); + } + return routers; + } + + /** + * 构建前端所需要树结构 + * + * @param menus 菜单列表 + * @return 树结构列表 + */ + @Override + public List buildMenuTree(List menus) + { + List returnList = new ArrayList(); + List tempList = menus.stream().map(SysMenu::getMenuId).collect(Collectors.toList()); + for (Iterator iterator = menus.iterator(); iterator.hasNext();) + { + SysMenu menu = (SysMenu) iterator.next(); + // 如果是顶级节点, 遍历该父节点的所有子节点 + if (!tempList.contains(menu.getParentId())) + { + recursionFn(menus, menu); + returnList.add(menu); + } + } + if (returnList.isEmpty()) + { + returnList = menus; + } + return returnList; + } + + /** + * 构建前端所需要下拉树结构 + * + * @param menus 菜单列表 + * @return 下拉树结构列表 + */ + @Override + public List buildMenuTreeSelect(List menus) + { + List menuTrees = buildMenuTree(menus); + return menuTrees.stream().map(TreeSelect::new).collect(Collectors.toList()); + } + + /** + * 根据菜单ID查询信息 + * + * @param menuId 菜单ID + * @return 菜单信息 + */ + @Override + public SysMenu selectMenuById(Long menuId) + { + return menuMapper.selectMenuById(menuId); + } + + /** + * 是否存在菜单子节点 + * + * @param menuId 菜单ID + * @return 结果 + */ + @Override + public boolean hasChildByMenuId(Long menuId) + { + int result = menuMapper.hasChildByMenuId(menuId); + return result > 0; + } + + /** + * 查询菜单使用数量 + * + * @param menuId 菜单ID + * @return 结果 + */ + @Override + public boolean checkMenuExistRole(Long menuId) + { + int result = roleMenuMapper.checkMenuExistRole(menuId); + return result > 0; + } + + /** + * 新增保存菜单信息 + * + * @param menu 菜单信息 + * @return 结果 + */ + @Override + public int insertMenu(SysMenu menu) + { + return menuMapper.insertMenu(menu); + } + + /** + * 修改保存菜单信息 + * + * @param menu 菜单信息 + * @return 结果 + */ + @Override + public int updateMenu(SysMenu menu) + { + return menuMapper.updateMenu(menu); + } + + /** + * 删除菜单管理信息 + * + * @param menuId 菜单ID + * @return 结果 + */ + @Override + public int deleteMenuById(Long menuId) + { + return menuMapper.deleteMenuById(menuId); + } + + /** + * 校验菜单名称是否唯一 + * + * @param menu 菜单信息 + * @return 结果 + */ + @Override + public String checkMenuNameUnique(SysMenu menu) + { + Long menuId = StringUtils.isNull(menu.getMenuId()) ? -1L : menu.getMenuId(); + SysMenu info = menuMapper.checkMenuNameUnique(menu.getMenuName(), menu.getParentId()); + if (StringUtils.isNotNull(info) && info.getMenuId().longValue() != menuId.longValue()) + { + return UserConstants.NOT_UNIQUE; + } + return UserConstants.UNIQUE; + } + + /** + * 获取路由名称 + * + * @param menu 菜单信息 + * @return 路由名称 + */ + public String getRouteName(SysMenu menu) + { + String routerName = StringUtils.capitalize(menu.getPath()); + // 非外链并且是一级目录(类型为目录) + if (isMenuFrame(menu)) + { + routerName = StringUtils.EMPTY; + } + return routerName; + } + + /** + * 获取路由地址 + * + * @param menu 菜单信息 + * @return 路由地址 + */ + public String getRouterPath(SysMenu menu) + { + String routerPath = menu.getPath(); + // 内链打开外网方式 + if (menu.getParentId().intValue() != 0 && isInnerLink(menu)) + { + routerPath = innerLinkReplaceEach(routerPath); + } + // 非外链并且是一级目录(类型为目录) + if (0 == menu.getParentId().intValue() && UserConstants.TYPE_DIR.equals(menu.getMenuType()) + && UserConstants.NO_FRAME.equals(menu.getIsFrame())) + { + routerPath = "/" + menu.getPath(); + } + // 非外链并且是一级目录(类型为菜单) + else if (isMenuFrame(menu)) + { + routerPath = "/"; + } + return routerPath; + } + + /** + * 获取组件信息 + * + * @param menu 菜单信息 + * @return 组件信息 + */ + public String getComponent(SysMenu menu) + { + String component = UserConstants.LAYOUT; + if (StringUtils.isNotEmpty(menu.getComponent()) && !isMenuFrame(menu)) + { + component = menu.getComponent(); + } + else if (StringUtils.isEmpty(menu.getComponent()) && menu.getParentId().intValue() != 0 && isInnerLink(menu)) + { + component = UserConstants.INNER_LINK; + } + else if (StringUtils.isEmpty(menu.getComponent()) && isParentView(menu)) + { + component = UserConstants.PARENT_VIEW; + } + return component; + } + + /** + * 是否为菜单内部跳转 + * + * @param menu 菜单信息 + * @return 结果 + */ + public boolean isMenuFrame(SysMenu menu) + { + return menu.getParentId().intValue() == 0 && UserConstants.TYPE_MENU.equals(menu.getMenuType()) + && menu.getIsFrame().equals(UserConstants.NO_FRAME); + } + + /** + * 是否为内链组件 + * + * @param menu 菜单信息 + * @return 结果 + */ + public boolean isInnerLink(SysMenu menu) + { + return menu.getIsFrame().equals(UserConstants.NO_FRAME) && StringUtils.ishttp(menu.getPath()); + } + + /** + * 是否为parent_view组件 + * + * @param menu 菜单信息 + * @return 结果 + */ + public boolean isParentView(SysMenu menu) + { + return menu.getParentId().intValue() != 0 && UserConstants.TYPE_DIR.equals(menu.getMenuType()); + } + + /** + * 根据父节点的ID获取所有子节点 + * + * @param list 分类表 + * @param parentId 传入的父节点ID + * @return String + */ + public List getChildPerms(List list, int parentId) + { + List returnList = new ArrayList(); + for (Iterator iterator = list.iterator(); iterator.hasNext();) + { + SysMenu t = (SysMenu) iterator.next(); + // 一、根据传入的某个父节点ID,遍历该父节点的所有子节点 + if (t.getParentId() == parentId) + { + recursionFn(list, t); + returnList.add(t); + } + } + return returnList; + } + + /** + * 递归列表 + * + * @param list 分类表 + * @param t 子节点 + */ + private void recursionFn(List list, SysMenu t) + { + // 得到子节点列表 + List childList = getChildList(list, t); + t.setChildren(childList); + for (SysMenu tChild : childList) + { + if (hasChild(list, tChild)) + { + recursionFn(list, tChild); + } + } + } + + /** + * 得到子节点列表 + */ + private List getChildList(List list, SysMenu t) + { + List tlist = new ArrayList(); + Iterator it = list.iterator(); + while (it.hasNext()) + { + SysMenu n = (SysMenu) it.next(); + if (n.getParentId().longValue() == t.getMenuId().longValue()) + { + tlist.add(n); + } + } + return tlist; + } + + /** + * 判断是否有子节点 + */ + private boolean hasChild(List list, SysMenu t) + { + return getChildList(list, t).size() > 0; + } + + /** + * 内链域名特殊字符替换 + * + * @return 替换后的内链域名 + */ + public String innerLinkReplaceEach(String path) + { + return StringUtils.replaceEach(path, new String[] { Constants.HTTP, Constants.HTTPS, Constants.WWW, "." }, + new String[] { "", "", "", "/" }); + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysNoticeServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysNoticeServiceImpl.java new file mode 100644 index 0000000..7367535 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysNoticeServiceImpl.java @@ -0,0 +1,92 @@ +package com.ruoyi.system.service.impl; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.system.domain.SysNotice; +import com.ruoyi.system.mapper.SysNoticeMapper; +import com.ruoyi.system.service.ISysNoticeService; + +/** + * 公告 服务层实现 + * + * @author #author# + */ +@Service +public class SysNoticeServiceImpl implements ISysNoticeService +{ + @Autowired + private SysNoticeMapper noticeMapper; + + /** + * 查询公告信息 + * + * @param noticeId 公告ID + * @return 公告信息 + */ + @Override + public SysNotice selectNoticeById(Long noticeId) + { + return noticeMapper.selectNoticeById(noticeId); + } + + /** + * 查询公告列表 + * + * @param notice 公告信息 + * @return 公告集合 + */ + @Override + public List selectNoticeList(SysNotice notice) + { + return noticeMapper.selectNoticeList(notice); + } + + /** + * 新增公告 + * + * @param notice 公告信息 + * @return 结果 + */ + @Override + public int insertNotice(SysNotice notice) + { + return noticeMapper.insertNotice(notice); + } + + /** + * 修改公告 + * + * @param notice 公告信息 + * @return 结果 + */ + @Override + public int updateNotice(SysNotice notice) + { + return noticeMapper.updateNotice(notice); + } + + /** + * 删除公告对象 + * + * @param noticeId 公告ID + * @return 结果 + */ + @Override + public int deleteNoticeById(Long noticeId) + { + return noticeMapper.deleteNoticeById(noticeId); + } + + /** + * 批量删除公告信息 + * + * @param noticeIds 需要删除的公告ID + * @return 结果 + */ + @Override + public int deleteNoticeByIds(Long[] noticeIds) + { + return noticeMapper.deleteNoticeByIds(noticeIds); + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysOperLogServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysOperLogServiceImpl.java new file mode 100644 index 0000000..c57733d --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysOperLogServiceImpl.java @@ -0,0 +1,76 @@ +package com.ruoyi.system.service.impl; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.system.domain.SysOperLog; +import com.ruoyi.system.mapper.SysOperLogMapper; +import com.ruoyi.system.service.ISysOperLogService; + +/** + * 操作日志 服务层处理 + * + * @author #author# + */ +@Service +public class SysOperLogServiceImpl implements ISysOperLogService +{ + @Autowired + private SysOperLogMapper operLogMapper; + + /** + * 新增操作日志 + * + * @param operLog 操作日志对象 + */ + @Override + public void insertOperlog(SysOperLog operLog) + { + operLogMapper.insertOperlog(operLog); + } + + /** + * 查询系统操作日志集合 + * + * @param operLog 操作日志对象 + * @return 操作日志集合 + */ + @Override + public List selectOperLogList(SysOperLog operLog) + { + return operLogMapper.selectOperLogList(operLog); + } + + /** + * 批量删除系统操作日志 + * + * @param operIds 需要删除的操作日志ID + * @return 结果 + */ + @Override + public int deleteOperLogByIds(Long[] operIds) + { + return operLogMapper.deleteOperLogByIds(operIds); + } + + /** + * 查询操作日志详细 + * + * @param operId 操作ID + * @return 操作日志对象 + */ + @Override + public SysOperLog selectOperLogById(Long operId) + { + return operLogMapper.selectOperLogById(operId); + } + + /** + * 清空操作日志 + */ + @Override + public void cleanOperLog() + { + operLogMapper.cleanOperLog(); + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysPostServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysPostServiceImpl.java new file mode 100644 index 0000000..d670050 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysPostServiceImpl.java @@ -0,0 +1,178 @@ +package com.ruoyi.system.service.impl; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.common.constant.UserConstants; +import com.ruoyi.common.exception.ServiceException; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.system.domain.SysPost; +import com.ruoyi.system.mapper.SysPostMapper; +import com.ruoyi.system.mapper.SysUserPostMapper; +import com.ruoyi.system.service.ISysPostService; + +/** + * 岗位信息 服务层处理 + * + * @author #author# + */ +@Service +public class SysPostServiceImpl implements ISysPostService +{ + @Autowired + private SysPostMapper postMapper; + + @Autowired + private SysUserPostMapper userPostMapper; + + /** + * 查询岗位信息集合 + * + * @param post 岗位信息 + * @return 岗位信息集合 + */ + @Override + public List selectPostList(SysPost post) + { + return postMapper.selectPostList(post); + } + + /** + * 查询所有岗位 + * + * @return 岗位列表 + */ + @Override + public List selectPostAll() + { + return postMapper.selectPostAll(); + } + + /** + * 通过岗位ID查询岗位信息 + * + * @param postId 岗位ID + * @return 角色对象信息 + */ + @Override + public SysPost selectPostById(Long postId) + { + return postMapper.selectPostById(postId); + } + + /** + * 根据用户ID获取岗位选择框列表 + * + * @param userId 用户ID + * @return 选中岗位ID列表 + */ + @Override + public List selectPostListByUserId(Long userId) + { + return postMapper.selectPostListByUserId(userId); + } + + /** + * 校验岗位名称是否唯一 + * + * @param post 岗位信息 + * @return 结果 + */ + @Override + public String checkPostNameUnique(SysPost post) + { + Long postId = StringUtils.isNull(post.getPostId()) ? -1L : post.getPostId(); + SysPost info = postMapper.checkPostNameUnique(post.getPostName()); + if (StringUtils.isNotNull(info) && info.getPostId().longValue() != postId.longValue()) + { + return UserConstants.NOT_UNIQUE; + } + return UserConstants.UNIQUE; + } + + /** + * 校验岗位编码是否唯一 + * + * @param post 岗位信息 + * @return 结果 + */ + @Override + public String checkPostCodeUnique(SysPost post) + { + Long postId = StringUtils.isNull(post.getPostId()) ? -1L : post.getPostId(); + SysPost info = postMapper.checkPostCodeUnique(post.getPostCode()); + if (StringUtils.isNotNull(info) && info.getPostId().longValue() != postId.longValue()) + { + return UserConstants.NOT_UNIQUE; + } + return UserConstants.UNIQUE; + } + + /** + * 通过岗位ID查询岗位使用数量 + * + * @param postId 岗位ID + * @return 结果 + */ + @Override + public int countUserPostById(Long postId) + { + return userPostMapper.countUserPostById(postId); + } + + /** + * 删除岗位信息 + * + * @param postId 岗位ID + * @return 结果 + */ + @Override + public int deletePostById(Long postId) + { + return postMapper.deletePostById(postId); + } + + /** + * 批量删除岗位信息 + * + * @param postIds 需要删除的岗位ID + * @return 结果 + */ + @Override + public int deletePostByIds(Long[] postIds) + { + for (Long postId : postIds) + { + SysPost post = selectPostById(postId); + if (countUserPostById(postId) > 0) + { + throw new ServiceException(String.format("%1$s已分配,不能删除", post.getPostName())); + } + } + return postMapper.deletePostByIds(postIds); + } + + /** + * 新增保存岗位信息 + * + * @param post 岗位信息 + * @return 结果 + */ + @Override + public int insertPost(SysPost post) + { + return postMapper.insertPost(post); + } + + /** + * 修改保存岗位信息 + * + * @param post 岗位信息 + * @return 结果 + */ + @Override + public int updatePost(SysPost post) + { + return postMapper.updatePost(post); + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysRoleServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysRoleServiceImpl.java new file mode 100644 index 0000000..5457fa6 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysRoleServiceImpl.java @@ -0,0 +1,424 @@ +package com.ruoyi.system.service.impl; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import com.ruoyi.common.annotation.DataScope; +import com.ruoyi.common.constant.UserConstants; +import com.ruoyi.common.core.domain.entity.SysRole; +import com.ruoyi.common.core.domain.entity.SysUser; +import com.ruoyi.common.exception.ServiceException; +import com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.common.utils.spring.SpringUtils; +import com.ruoyi.system.domain.SysRoleDept; +import com.ruoyi.system.domain.SysRoleMenu; +import com.ruoyi.system.domain.SysUserRole; +import com.ruoyi.system.mapper.SysRoleDeptMapper; +import com.ruoyi.system.mapper.SysRoleMapper; +import com.ruoyi.system.mapper.SysRoleMenuMapper; +import com.ruoyi.system.mapper.SysUserRoleMapper; +import com.ruoyi.system.service.ISysRoleService; + +/** + * 角色 业务层处理 + * + * @author #author# + */ +@Service +public class SysRoleServiceImpl implements ISysRoleService +{ + @Autowired + private SysRoleMapper roleMapper; + + @Autowired + private SysRoleMenuMapper roleMenuMapper; + + @Autowired + private SysUserRoleMapper userRoleMapper; + + @Autowired + private SysRoleDeptMapper roleDeptMapper; + + /** + * 根据条件分页查询角色数据 + * + * @param role 角色信息 + * @return 角色数据集合信息 + */ + @Override + @DataScope(deptAlias = "d") + public List selectRoleList(SysRole role) + { + return roleMapper.selectRoleList(role); + } + + /** + * 根据用户ID查询角色 + * + * @param userId 用户ID + * @return 角色列表 + */ + @Override + public List selectRolesByUserId(Long userId) + { + List userRoles = roleMapper.selectRolePermissionByUserId(userId); + List roles = selectRoleAll(); + for (SysRole role : roles) + { + for (SysRole userRole : userRoles) + { + if (role.getRoleId().longValue() == userRole.getRoleId().longValue()) + { + role.setFlag(true); + break; + } + } + } + return roles; + } + + /** + * 根据用户ID查询权限 + * + * @param userId 用户ID + * @return 权限列表 + */ + @Override + public Set selectRolePermissionByUserId(Long userId) + { + List perms = roleMapper.selectRolePermissionByUserId(userId); + Set permsSet = new HashSet<>(); + for (SysRole perm : perms) + { + if (StringUtils.isNotNull(perm)) + { + permsSet.addAll(Arrays.asList(perm.getRoleKey().trim().split(","))); + } + } + return permsSet; + } + + /** + * 查询所有角色 + * + * @return 角色列表 + */ + @Override + public List selectRoleAll() + { + return SpringUtils.getAopProxy(this).selectRoleList(new SysRole()); + } + + /** + * 根据用户ID获取角色选择框列表 + * + * @param userId 用户ID + * @return 选中角色ID列表 + */ + @Override + public List selectRoleListByUserId(Long userId) + { + return roleMapper.selectRoleListByUserId(userId); + } + + /** + * 通过角色ID查询角色 + * + * @param roleId 角色ID + * @return 角色对象信息 + */ + @Override + public SysRole selectRoleById(Long roleId) + { + return roleMapper.selectRoleById(roleId); + } + + /** + * 校验角色名称是否唯一 + * + * @param role 角色信息 + * @return 结果 + */ + @Override + public String checkRoleNameUnique(SysRole role) + { + Long roleId = StringUtils.isNull(role.getRoleId()) ? -1L : role.getRoleId(); + SysRole info = roleMapper.checkRoleNameUnique(role.getRoleName()); + if (StringUtils.isNotNull(info) && info.getRoleId().longValue() != roleId.longValue()) + { + return UserConstants.NOT_UNIQUE; + } + return UserConstants.UNIQUE; + } + + /** + * 校验角色权限是否唯一 + * + * @param role 角色信息 + * @return 结果 + */ + @Override + public String checkRoleKeyUnique(SysRole role) + { + Long roleId = StringUtils.isNull(role.getRoleId()) ? -1L : role.getRoleId(); + SysRole info = roleMapper.checkRoleKeyUnique(role.getRoleKey()); + if (StringUtils.isNotNull(info) && info.getRoleId().longValue() != roleId.longValue()) + { + return UserConstants.NOT_UNIQUE; + } + return UserConstants.UNIQUE; + } + + /** + * 校验角色是否允许操作 + * + * @param role 角色信息 + */ + @Override + public void checkRoleAllowed(SysRole role) + { + if (StringUtils.isNotNull(role.getRoleId()) && role.isAdmin()) + { + throw new ServiceException("不允许操作超级管理员角色"); + } + } + + /** + * 校验角色是否有数据权限 + * + * @param roleId 角色id + */ + @Override + public void checkRoleDataScope(Long roleId) + { + if (!SysUser.isAdmin(SecurityUtils.getUserId())) + { + SysRole role = new SysRole(); + role.setRoleId(roleId); + List roles = SpringUtils.getAopProxy(this).selectRoleList(role); + if (StringUtils.isEmpty(roles)) + { + throw new ServiceException("没有权限访问角色数据!"); + } + } + } + + /** + * 通过角色ID查询角色使用数量 + * + * @param roleId 角色ID + * @return 结果 + */ + @Override + public int countUserRoleByRoleId(Long roleId) + { + return userRoleMapper.countUserRoleByRoleId(roleId); + } + + /** + * 新增保存角色信息 + * + * @param role 角色信息 + * @return 结果 + */ + @Override + @Transactional + public int insertRole(SysRole role) + { + // 新增角色信息 + roleMapper.insertRole(role); + return insertRoleMenu(role); + } + + /** + * 修改保存角色信息 + * + * @param role 角色信息 + * @return 结果 + */ + @Override + @Transactional + public int updateRole(SysRole role) + { + // 修改角色信息 + roleMapper.updateRole(role); + // 删除角色与菜单关联 + roleMenuMapper.deleteRoleMenuByRoleId(role.getRoleId()); + return insertRoleMenu(role); + } + + /** + * 修改角色状态 + * + * @param role 角色信息 + * @return 结果 + */ + @Override + public int updateRoleStatus(SysRole role) + { + return roleMapper.updateRole(role); + } + + /** + * 修改数据权限信息 + * + * @param role 角色信息 + * @return 结果 + */ + @Override + @Transactional + public int authDataScope(SysRole role) + { + // 修改角色信息 + roleMapper.updateRole(role); + // 删除角色与部门关联 + roleDeptMapper.deleteRoleDeptByRoleId(role.getRoleId()); + // 新增角色和部门信息(数据权限) + return insertRoleDept(role); + } + + /** + * 新增角色菜单信息 + * + * @param role 角色对象 + */ + public int insertRoleMenu(SysRole role) + { + int rows = 1; + // 新增用户与角色管理 + List list = new ArrayList(); + for (Long menuId : role.getMenuIds()) + { + SysRoleMenu rm = new SysRoleMenu(); + rm.setRoleId(role.getRoleId()); + rm.setMenuId(menuId); + list.add(rm); + } + if (list.size() > 0) + { + rows = roleMenuMapper.batchRoleMenu(list); + } + return rows; + } + + /** + * 新增角色部门信息(数据权限) + * + * @param role 角色对象 + */ + public int insertRoleDept(SysRole role) + { + int rows = 1; + // 新增角色与部门(数据权限)管理 + List list = new ArrayList(); + for (Long deptId : role.getDeptIds()) + { + SysRoleDept rd = new SysRoleDept(); + rd.setRoleId(role.getRoleId()); + rd.setDeptId(deptId); + list.add(rd); + } + if (list.size() > 0) + { + rows = roleDeptMapper.batchRoleDept(list); + } + return rows; + } + + /** + * 通过角色ID删除角色 + * + * @param roleId 角色ID + * @return 结果 + */ + @Override + @Transactional + public int deleteRoleById(Long roleId) + { + // 删除角色与菜单关联 + roleMenuMapper.deleteRoleMenuByRoleId(roleId); + // 删除角色与部门关联 + roleDeptMapper.deleteRoleDeptByRoleId(roleId); + return roleMapper.deleteRoleById(roleId); + } + + /** + * 批量删除角色信息 + * + * @param roleIds 需要删除的角色ID + * @return 结果 + */ + @Override + @Transactional + public int deleteRoleByIds(Long[] roleIds) + { + for (Long roleId : roleIds) + { + checkRoleAllowed(new SysRole(roleId)); + checkRoleDataScope(roleId); + SysRole role = selectRoleById(roleId); + if (countUserRoleByRoleId(roleId) > 0) + { + throw new ServiceException(String.format("%1$s已分配,不能删除", role.getRoleName())); + } + } + // 删除角色与菜单关联 + roleMenuMapper.deleteRoleMenu(roleIds); + // 删除角色与部门关联 + roleDeptMapper.deleteRoleDept(roleIds); + return roleMapper.deleteRoleByIds(roleIds); + } + + /** + * 取消授权用户角色 + * + * @param userRole 用户和角色关联信息 + * @return 结果 + */ + @Override + public int deleteAuthUser(SysUserRole userRole) + { + return userRoleMapper.deleteUserRoleInfo(userRole); + } + + /** + * 批量取消授权用户角色 + * + * @param roleId 角色ID + * @param userIds 需要取消授权的用户数据ID + * @return 结果 + */ + @Override + public int deleteAuthUsers(Long roleId, Long[] userIds) + { + return userRoleMapper.deleteUserRoleInfos(roleId, userIds); + } + + /** + * 批量选择授权用户角色 + * + * @param roleId 角色ID + * @param userIds 需要授权的用户数据ID + * @return 结果 + */ + @Override + public int insertAuthUsers(Long roleId, Long[] userIds) + { + // 新增用户与角色管理 + List list = new ArrayList(); + for (Long userId : userIds) + { + SysUserRole ur = new SysUserRole(); + ur.setUserId(userId); + ur.setRoleId(roleId); + list.add(ur); + } + return userRoleMapper.batchUserRole(list); + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserOnlineServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserOnlineServiceImpl.java new file mode 100644 index 0000000..3c5aaad --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserOnlineServiceImpl.java @@ -0,0 +1,96 @@ +package com.ruoyi.system.service.impl; + +import org.springframework.stereotype.Service; +import com.ruoyi.common.core.domain.model.LoginUser; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.system.domain.SysUserOnline; +import com.ruoyi.system.service.ISysUserOnlineService; + +/** + * 在线用户 服务层处理 + * + * @author #author# + */ +@Service +public class SysUserOnlineServiceImpl implements ISysUserOnlineService +{ + /** + * 通过登录地址查询信息 + * + * @param ipaddr 登录地址 + * @param user 用户信息 + * @return 在线用户信息 + */ + @Override + public SysUserOnline selectOnlineByIpaddr(String ipaddr, LoginUser user) + { + if (StringUtils.equals(ipaddr, user.getIpaddr())) + { + return loginUserToUserOnline(user); + } + return null; + } + + /** + * 通过用户名称查询信息 + * + * @param userName 用户名称 + * @param user 用户信息 + * @return 在线用户信息 + */ + @Override + public SysUserOnline selectOnlineByUserName(String userName, LoginUser user) + { + if (StringUtils.equals(userName, user.getUsername())) + { + return loginUserToUserOnline(user); + } + return null; + } + + /** + * 通过登录地址/用户名称查询信息 + * + * @param ipaddr 登录地址 + * @param userName 用户名称 + * @param user 用户信息 + * @return 在线用户信息 + */ + @Override + public SysUserOnline selectOnlineByInfo(String ipaddr, String userName, LoginUser user) + { + if (StringUtils.equals(ipaddr, user.getIpaddr()) && StringUtils.equals(userName, user.getUsername())) + { + return loginUserToUserOnline(user); + } + return null; + } + + /** + * 设置在线用户信息 + * + * @param user 用户信息 + * @return 在线用户 + */ + @Override + public SysUserOnline loginUserToUserOnline(LoginUser user) + { + if (StringUtils.isNull(user) || StringUtils.isNull(user.getUser())) + { + return null; + } + SysUserOnline sysUserOnline = new SysUserOnline(); + sysUserOnline.setTokenId(user.getToken()); + sysUserOnline.setUserName(user.getUsername()); + sysUserOnline.setIpaddr(user.getIpaddr()); + sysUserOnline.setLoginLocation(user.getLoginLocation()); + sysUserOnline.setBrowser(user.getBrowser()); + sysUserOnline.setOs(user.getOs()); + sysUserOnline.setLoginTime(user.getLoginTime()); + if (StringUtils.isNotNull(user.getUser().getDept())) + { + sysUserOnline.setDeptName(user.getUser().getDept().getDeptName()); + } + return sysUserOnline; + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java new file mode 100644 index 0000000..a0b037c --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java @@ -0,0 +1,543 @@ +package com.ruoyi.system.service.impl; + +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; +import javax.validation.Validator; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; +import com.ruoyi.common.annotation.DataScope; +import com.ruoyi.common.constant.UserConstants; +import com.ruoyi.common.core.domain.entity.SysRole; +import com.ruoyi.common.core.domain.entity.SysUser; +import com.ruoyi.common.exception.ServiceException; +import com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.common.utils.bean.BeanValidators; +import com.ruoyi.common.utils.spring.SpringUtils; +import com.ruoyi.system.domain.SysPost; +import com.ruoyi.system.domain.SysUserPost; +import com.ruoyi.system.domain.SysUserRole; +import com.ruoyi.system.mapper.SysPostMapper; +import com.ruoyi.system.mapper.SysRoleMapper; +import com.ruoyi.system.mapper.SysUserMapper; +import com.ruoyi.system.mapper.SysUserPostMapper; +import com.ruoyi.system.mapper.SysUserRoleMapper; +import com.ruoyi.system.service.ISysConfigService; +import com.ruoyi.system.service.ISysUserService; + +/** + * 用户 业务层处理 + * + * @author #author# + */ +@Service +public class SysUserServiceImpl implements ISysUserService +{ + private static final Logger log = LoggerFactory.getLogger(SysUserServiceImpl.class); + + @Autowired + private SysUserMapper userMapper; + + @Autowired + private SysRoleMapper roleMapper; + + @Autowired + private SysPostMapper postMapper; + + @Autowired + private SysUserRoleMapper userRoleMapper; + + @Autowired + private SysUserPostMapper userPostMapper; + + @Autowired + private ISysConfigService configService; + + @Autowired + protected Validator validator; + + /** + * 根据条件分页查询用户列表 + * + * @param user 用户信息 + * @return 用户信息集合信息 + */ + @Override + @DataScope(deptAlias = "d", userAlias = "u") + public List selectUserList(SysUser user) + { + return userMapper.selectUserList(user); + } + + /** + * 根据条件分页查询已分配用户角色列表 + * + * @param user 用户信息 + * @return 用户信息集合信息 + */ + @Override + @DataScope(deptAlias = "d", userAlias = "u") + public List selectAllocatedList(SysUser user) + { + return userMapper.selectAllocatedList(user); + } + + /** + * 根据条件分页查询未分配用户角色列表 + * + * @param user 用户信息 + * @return 用户信息集合信息 + */ + @Override + @DataScope(deptAlias = "d", userAlias = "u") + public List selectUnallocatedList(SysUser user) + { + return userMapper.selectUnallocatedList(user); + } + + /** + * 通过用户名查询用户 + * + * @param userName 用户名 + * @return 用户对象信息 + */ + @Override + public SysUser selectUserByUserName(String userName) + { + return userMapper.selectUserByUserName(userName); + } + + /** + * 通过用户ID查询用户 + * + * @param userId 用户ID + * @return 用户对象信息 + */ + @Override + public SysUser selectUserById(Long userId) + { + return userMapper.selectUserById(userId); + } + + /** + * 查询用户所属角色组 + * + * @param userName 用户名 + * @return 结果 + */ + @Override + public String selectUserRoleGroup(String userName) + { + List list = roleMapper.selectRolesByUserName(userName); + if (CollectionUtils.isEmpty(list)) + { + return StringUtils.EMPTY; + } + return list.stream().map(SysRole::getRoleName).collect(Collectors.joining(",")); + } + + /** + * 查询用户所属岗位组 + * + * @param userName 用户名 + * @return 结果 + */ + @Override + public String selectUserPostGroup(String userName) + { + List list = postMapper.selectPostsByUserName(userName); + if (CollectionUtils.isEmpty(list)) + { + return StringUtils.EMPTY; + } + return list.stream().map(SysPost::getPostName).collect(Collectors.joining(",")); + } + + /** + * 校验用户名称是否唯一 + * + * @param user 用户信息 + * @return 结果 + */ + @Override + public String checkUserNameUnique(SysUser user) + { + Long userId = StringUtils.isNull(user.getUserId()) ? -1L : user.getUserId(); + SysUser info = userMapper.checkUserNameUnique(user.getUserName()); + if (StringUtils.isNotNull(info) && info.getUserId().longValue() != userId.longValue()) + { + return UserConstants.NOT_UNIQUE; + } + return UserConstants.UNIQUE; + } + + /** + * 校验手机号码是否唯一 + * + * @param user 用户信息 + * @return + */ + @Override + public String checkPhoneUnique(SysUser user) + { + Long userId = StringUtils.isNull(user.getUserId()) ? -1L : user.getUserId(); + SysUser info = userMapper.checkPhoneUnique(user.getPhonenumber()); + if (StringUtils.isNotNull(info) && info.getUserId().longValue() != userId.longValue()) + { + return UserConstants.NOT_UNIQUE; + } + return UserConstants.UNIQUE; + } + + /** + * 校验email是否唯一 + * + * @param user 用户信息 + * @return + */ + @Override + public String checkEmailUnique(SysUser user) + { + Long userId = StringUtils.isNull(user.getUserId()) ? -1L : user.getUserId(); + SysUser info = userMapper.checkEmailUnique(user.getEmail()); + if (StringUtils.isNotNull(info) && info.getUserId().longValue() != userId.longValue()) + { + return UserConstants.NOT_UNIQUE; + } + return UserConstants.UNIQUE; + } + + /** + * 校验用户是否允许操作 + * + * @param user 用户信息 + */ + @Override + public void checkUserAllowed(SysUser user) + { + if (StringUtils.isNotNull(user.getUserId()) && user.isAdmin()) + { + throw new ServiceException("不允许操作超级管理员用户"); + } + } + + /** + * 校验用户是否有数据权限 + * + * @param userId 用户id + */ + @Override + public void checkUserDataScope(Long userId) + { + if (!SysUser.isAdmin(SecurityUtils.getUserId())) + { + SysUser user = new SysUser(); + user.setUserId(userId); + List users = SpringUtils.getAopProxy(this).selectUserList(user); + if (StringUtils.isEmpty(users)) + { + throw new ServiceException("没有权限访问用户数据!"); + } + } + } + + /** + * 新增保存用户信息 + * + * @param user 用户信息 + * @return 结果 + */ + @Override + @Transactional + public int insertUser(SysUser user) + { + // 新增用户信息 + int rows = userMapper.insertUser(user); + // 新增用户岗位关联 + insertUserPost(user); + // 新增用户与角色管理 + insertUserRole(user); + return rows; + } + + /** + * 注册用户信息 + * + * @param user 用户信息 + * @return 结果 + */ + @Override + public boolean registerUser(SysUser user) + { + return userMapper.insertUser(user) > 0; + } + + /** + * 修改保存用户信息 + * + * @param user 用户信息 + * @return 结果 + */ + @Override + @Transactional + public int updateUser(SysUser user) + { + Long userId = user.getUserId(); + // 删除用户与角色关联 + userRoleMapper.deleteUserRoleByUserId(userId); + // 新增用户与角色管理 + insertUserRole(user); + // 删除用户与岗位关联 + userPostMapper.deleteUserPostByUserId(userId); + // 新增用户与岗位管理 + insertUserPost(user); + return userMapper.updateUser(user); + } + + /** + * 用户授权角色 + * + * @param userId 用户ID + * @param roleIds 角色组 + */ + @Override + @Transactional + public void insertUserAuth(Long userId, Long[] roleIds) + { + userRoleMapper.deleteUserRoleByUserId(userId); + insertUserRole(userId, roleIds); + } + + /** + * 修改用户状态 + * + * @param user 用户信息 + * @return 结果 + */ + @Override + public int updateUserStatus(SysUser user) + { + return userMapper.updateUser(user); + } + + /** + * 修改用户基本信息 + * + * @param user 用户信息 + * @return 结果 + */ + @Override + public int updateUserProfile(SysUser user) + { + return userMapper.updateUser(user); + } + + /** + * 修改用户头像 + * + * @param userName 用户名 + * @param avatar 头像地址 + * @return 结果 + */ + @Override + public boolean updateUserAvatar(String userName, String avatar) + { + return userMapper.updateUserAvatar(userName, avatar) > 0; + } + + /** + * 重置用户密码 + * + * @param user 用户信息 + * @return 结果 + */ + @Override + public int resetPwd(SysUser user) + { + return userMapper.updateUser(user); + } + + /** + * 重置用户密码 + * + * @param userName 用户名 + * @param password 密码 + * @return 结果 + */ + @Override + public int resetUserPwd(String userName, String password) + { + return userMapper.resetUserPwd(userName, password); + } + + /** + * 新增用户角色信息 + * + * @param user 用户对象 + */ + public void insertUserRole(SysUser user) + { + this.insertUserRole(user.getUserId(), user.getRoleIds()); + } + + /** + * 新增用户岗位信息 + * + * @param user 用户对象 + */ + public void insertUserPost(SysUser user) + { + Long[] posts = user.getPostIds(); + if (StringUtils.isNotEmpty(posts)) + { + // 新增用户与岗位管理 + List list = new ArrayList(posts.length); + for (Long postId : posts) + { + SysUserPost up = new SysUserPost(); + up.setUserId(user.getUserId()); + up.setPostId(postId); + list.add(up); + } + userPostMapper.batchUserPost(list); + } + } + + /** + * 新增用户角色信息 + * + * @param userId 用户ID + * @param roleIds 角色组 + */ + public void insertUserRole(Long userId, Long[] roleIds) + { + if (StringUtils.isNotEmpty(roleIds)) + { + // 新增用户与角色管理 + List list = new ArrayList(roleIds.length); + for (Long roleId : roleIds) + { + SysUserRole ur = new SysUserRole(); + ur.setUserId(userId); + ur.setRoleId(roleId); + list.add(ur); + } + userRoleMapper.batchUserRole(list); + } + } + + /** + * 通过用户ID删除用户 + * + * @param userId 用户ID + * @return 结果 + */ + @Override + @Transactional + public int deleteUserById(Long userId) + { + // 删除用户与角色关联 + userRoleMapper.deleteUserRoleByUserId(userId); + // 删除用户与岗位表 + userPostMapper.deleteUserPostByUserId(userId); + return userMapper.deleteUserById(userId); + } + + /** + * 批量删除用户信息 + * + * @param userIds 需要删除的用户ID + * @return 结果 + */ + @Override + @Transactional + public int deleteUserByIds(Long[] userIds) + { + for (Long userId : userIds) + { + checkUserAllowed(new SysUser(userId)); + checkUserDataScope(userId); + } + // 删除用户与角色关联 + userRoleMapper.deleteUserRole(userIds); + // 删除用户与岗位关联 + userPostMapper.deleteUserPost(userIds); + return userMapper.deleteUserByIds(userIds); + } + + /** + * 导入用户数据 + * + * @param userList 用户数据列表 + * @param isUpdateSupport 是否更新支持,如果已存在,则进行更新数据 + * @param operName 操作用户 + * @return 结果 + */ + @Override + public String importUser(List userList, Boolean isUpdateSupport, String operName) + { + if (StringUtils.isNull(userList) || userList.size() == 0) + { + throw new ServiceException("导入用户数据不能为空!"); + } + int successNum = 0; + int failureNum = 0; + StringBuilder successMsg = new StringBuilder(); + StringBuilder failureMsg = new StringBuilder(); + String password = configService.selectConfigByKey("sys.user.initPassword"); + for (SysUser user : userList) + { + try + { + // 验证是否存在这个用户 + SysUser u = userMapper.selectUserByUserName(user.getUserName()); + if (StringUtils.isNull(u)) + { + BeanValidators.validateWithException(validator, user); + user.setPassword(SecurityUtils.encryptPassword(password)); + user.setCreateBy(operName); + this.insertUser(user); + successNum++; + successMsg.append("
" + successNum + "、账号 " + user.getUserName() + " 导入成功"); + } + else if (isUpdateSupport) + { + BeanValidators.validateWithException(validator, user); + checkUserAllowed(user); + checkUserDataScope(user.getUserId()); + user.setUpdateBy(operName); + this.updateUser(user); + successNum++; + successMsg.append("
" + successNum + "、账号 " + user.getUserName() + " 更新成功"); + } + else + { + failureNum++; + failureMsg.append("
" + failureNum + "、账号 " + user.getUserName() + " 已存在"); + } + } + catch (Exception e) + { + failureNum++; + String msg = "
" + failureNum + "、账号 " + user.getUserName() + " 导入失败:"; + failureMsg.append(msg + e.getMessage()); + log.error(msg, e); + } + } + if (failureNum > 0) + { + failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum + " 条数据格式不正确,错误如下:"); + throw new ServiceException(failureMsg.toString()); + } + else + { + successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:"); + } + return successMsg.toString(); + } +} diff --git a/ruoyi-system/src/main/resources/mapper/system/SysConfigMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysConfigMapper.xml new file mode 100644 index 0000000..ca39f47 --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/system/SysConfigMapper.xml @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + select config_id, config_name, config_key, config_value, config_type, create_by, create_time, update_by, update_time, remark + from sys_config + + + + + + + and config_id = #{configId} + + + and config_key = #{configKey} + + + + + + + + + + + + + + insert into sys_config ( + config_name, + config_key, + config_value, + config_type, + create_by, + remark, + create_time + )values( + #{configName}, + #{configKey}, + #{configValue}, + #{configType}, + #{createBy}, + #{remark}, + sysdate() + ) + + + + update sys_config + + config_name = #{configName}, + config_key = #{configKey}, + config_value = #{configValue}, + config_type = #{configType}, + update_by = #{updateBy}, + remark = #{remark}, + update_time = sysdate() + + where config_id = #{configId} + + + + delete from sys_config where config_id = #{configId} + + + + delete from sys_config where config_id in + + #{configId} + + + + \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml new file mode 100644 index 0000000..cf439f6 --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml @@ -0,0 +1,159 @@ + + + + + + + + + + + + + + + + + + + + + + + + select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status, d.del_flag, d.create_by, d.create_time + from sys_dept d + + + + + + + + + + + + + + + + + + + + insert into sys_dept( + dept_id, + parent_id, + dept_name, + ancestors, + order_num, + leader, + phone, + email, + status, + create_by, + create_time + )values( + #{deptId}, + #{parentId}, + #{deptName}, + #{ancestors}, + #{orderNum}, + #{leader}, + #{phone}, + #{email}, + #{status}, + #{createBy}, + sysdate() + ) + + + + update sys_dept + + parent_id = #{parentId}, + dept_name = #{deptName}, + ancestors = #{ancestors}, + order_num = #{orderNum}, + leader = #{leader}, + phone = #{phone}, + email = #{email}, + status = #{status}, + update_by = #{updateBy}, + update_time = sysdate() + + where dept_id = #{deptId} + + + + update sys_dept set ancestors = + + when #{item.deptId} then #{item.ancestors} + + where dept_id in + + #{item.deptId} + + + + + update sys_dept set status = '0' where dept_id in + + #{deptId} + + + + + update sys_dept set del_flag = '2' where dept_id = #{deptId} + + + \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/system/SysDictDataMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysDictDataMapper.xml new file mode 100644 index 0000000..8da9030 --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/system/SysDictDataMapper.xml @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + select dict_code, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, remark + from sys_dict_data + + + + + + + + + + + + + + delete from sys_dict_data where dict_code = #{dictCode} + + + + delete from sys_dict_data where dict_code in + + #{dictCode} + + + + + update sys_dict_data + + dict_sort = #{dictSort}, + dict_label = #{dictLabel}, + dict_value = #{dictValue}, + dict_type = #{dictType}, + css_class = #{cssClass}, + list_class = #{listClass}, + is_default = #{isDefault}, + status = #{status}, + remark = #{remark}, + update_by = #{updateBy}, + update_time = sysdate() + + where dict_code = #{dictCode} + + + + update sys_dict_data set dict_type = #{newDictType} where dict_type = #{oldDictType} + + + + insert into sys_dict_data( + dict_sort, + dict_label, + dict_value, + dict_type, + css_class, + list_class, + is_default, + status, + remark, + create_by, + create_time + )values( + #{dictSort}, + #{dictLabel}, + #{dictValue}, + #{dictType}, + #{cssClass}, + #{listClass}, + #{isDefault}, + #{status}, + #{remark}, + #{createBy}, + sysdate() + ) + + + \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/system/SysDictTypeMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysDictTypeMapper.xml new file mode 100644 index 0000000..55b4075 --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/system/SysDictTypeMapper.xml @@ -0,0 +1,105 @@ + + + + + + + + + + + + + + + + + select dict_id, dict_name, dict_type, status, create_by, create_time, remark + from sys_dict_type + + + + + + + + + + + + + + delete from sys_dict_type where dict_id = #{dictId} + + + + delete from sys_dict_type where dict_id in + + #{dictId} + + + + + update sys_dict_type + + dict_name = #{dictName}, + dict_type = #{dictType}, + status = #{status}, + remark = #{remark}, + update_by = #{updateBy}, + update_time = sysdate() + + where dict_id = #{dictId} + + + + insert into sys_dict_type( + dict_name, + dict_type, + status, + remark, + create_by, + create_time + )values( + #{dictName}, + #{dictType}, + #{status}, + #{remark}, + #{createBy}, + sysdate() + ) + + + \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/system/SysLogininforMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysLogininforMapper.xml new file mode 100644 index 0000000..b8178fa --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/system/SysLogininforMapper.xml @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + insert into sys_logininfor (user_name, status, ipaddr, login_location, browser, os, msg, login_time) + values (#{userName}, #{status}, #{ipaddr}, #{loginLocation}, #{browser}, #{os}, #{msg}, sysdate()) + + + + + + delete from sys_logininfor where info_id in + + #{infoId} + + + + + truncate table sys_logininfor + + + \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/system/SysMenuMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysMenuMapper.xml new file mode 100644 index 0000000..6762007 --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/system/SysMenuMapper.xml @@ -0,0 +1,202 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select menu_id, menu_name, parent_id, order_num, path, component, `query`, is_frame, is_cache, menu_type, visible, status, ifnull(perms,'') as perms, icon, create_time + from sys_menu + + + + + + + + + + + + + + + + + + + + + + + + + + update sys_menu + + menu_name = #{menuName}, + parent_id = #{parentId}, + order_num = #{orderNum}, + path = #{path}, + component = #{component}, + `query` = #{query}, + is_frame = #{isFrame}, + is_cache = #{isCache}, + menu_type = #{menuType}, + visible = #{visible}, + status = #{status}, + perms = #{perms}, + icon = #{icon}, + remark = #{remark}, + update_by = #{updateBy}, + update_time = sysdate() + + where menu_id = #{menuId} + + + + insert into sys_menu( + menu_id, + parent_id, + menu_name, + order_num, + path, + component, + `query`, + is_frame, + is_cache, + menu_type, + visible, + status, + perms, + icon, + remark, + create_by, + create_time + )values( + #{menuId}, + #{parentId}, + #{menuName}, + #{orderNum}, + #{path}, + #{component}, + #{query}, + #{isFrame}, + #{isCache}, + #{menuType}, + #{visible}, + #{status}, + #{perms}, + #{icon}, + #{remark}, + #{createBy}, + sysdate() + ) + + + + delete from sys_menu where menu_id = #{menuId} + + + \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/system/SysNoticeMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysNoticeMapper.xml new file mode 100644 index 0000000..65d3079 --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/system/SysNoticeMapper.xml @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + select notice_id, notice_title, notice_type, cast(notice_content as char) as notice_content, status, create_by, create_time, update_by, update_time, remark + from sys_notice + + + + + + + + insert into sys_notice ( + notice_title, + notice_type, + notice_content, + status, + remark, + create_by, + create_time + )values( + #{noticeTitle}, + #{noticeType}, + #{noticeContent}, + #{status}, + #{remark}, + #{createBy}, + sysdate() + ) + + + + update sys_notice + + notice_title = #{noticeTitle}, + notice_type = #{noticeType}, + notice_content = #{noticeContent}, + status = #{status}, + update_by = #{updateBy}, + update_time = sysdate() + + where notice_id = #{noticeId} + + + + delete from sys_notice where notice_id = #{noticeId} + + + + delete from sys_notice where notice_id in + + #{noticeId} + + + + \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/system/SysOperLogMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysOperLogMapper.xml new file mode 100644 index 0000000..018a747 --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/system/SysOperLogMapper.xml @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + + + select oper_id, title, business_type, method, request_method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_location, oper_param, json_result, status, error_msg, oper_time + from sys_oper_log + + + + insert into sys_oper_log(title, business_type, method, request_method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_location, oper_param, json_result, status, error_msg, oper_time) + values (#{title}, #{businessType}, #{method}, #{requestMethod}, #{operatorType}, #{operName}, #{deptName}, #{operUrl}, #{operIp}, #{operLocation}, #{operParam}, #{jsonResult}, #{status}, #{errorMsg}, sysdate()) + + + + + + delete from sys_oper_log where oper_id in + + #{operId} + + + + + + + truncate table sys_oper_log + + + \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/system/SysPostMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysPostMapper.xml new file mode 100644 index 0000000..227c459 --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/system/SysPostMapper.xml @@ -0,0 +1,122 @@ + + + + + + + + + + + + + + + + + + + select post_id, post_code, post_name, post_sort, status, create_by, create_time, remark + from sys_post + + + + + + + + + + + + + + + + + + update sys_post + + post_code = #{postCode}, + post_name = #{postName}, + post_sort = #{postSort}, + status = #{status}, + remark = #{remark}, + update_by = #{updateBy}, + update_time = sysdate() + + where post_id = #{postId} + + + + insert into sys_post( + post_id, + post_code, + post_name, + post_sort, + status, + remark, + create_by, + create_time + )values( + #{postId}, + #{postCode}, + #{postName}, + #{postSort}, + #{status}, + #{remark}, + #{createBy}, + sysdate() + ) + + + + delete from sys_post where post_id = #{postId} + + + + delete from sys_post where post_id in + + #{postId} + + + + \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/system/SysRoleDeptMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysRoleDeptMapper.xml new file mode 100644 index 0000000..7c4139b --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/system/SysRoleDeptMapper.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + delete from sys_role_dept where role_id=#{roleId} + + + + + + delete from sys_role_dept where role_id in + + #{roleId} + + + + + insert into sys_role_dept(role_id, dept_id) values + + (#{item.roleId},#{item.deptId}) + + + + \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/system/SysRoleMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysRoleMapper.xml new file mode 100644 index 0000000..52306c2 --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/system/SysRoleMapper.xml @@ -0,0 +1,152 @@ + + + + + + + + + + + + + + + + + + + + + + + select distinct r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.menu_check_strictly, r.dept_check_strictly, + r.status, r.del_flag, r.create_time, r.remark + from sys_role r + left join sys_user_role ur on ur.role_id = r.role_id + left join sys_user u on u.user_id = ur.user_id + left join sys_dept d on u.dept_id = d.dept_id + + + + + + + + + + + + + + + + + + + + insert into sys_role( + role_id, + role_name, + role_key, + role_sort, + data_scope, + menu_check_strictly, + dept_check_strictly, + status, + remark, + create_by, + create_time + )values( + #{roleId}, + #{roleName}, + #{roleKey}, + #{roleSort}, + #{dataScope}, + #{menuCheckStrictly}, + #{deptCheckStrictly}, + #{status}, + #{remark}, + #{createBy}, + sysdate() + ) + + + + update sys_role + + role_name = #{roleName}, + role_key = #{roleKey}, + role_sort = #{roleSort}, + data_scope = #{dataScope}, + menu_check_strictly = #{menuCheckStrictly}, + dept_check_strictly = #{deptCheckStrictly}, + status = #{status}, + remark = #{remark}, + update_by = #{updateBy}, + update_time = sysdate() + + where role_id = #{roleId} + + + + update sys_role set del_flag = '2' where role_id = #{roleId} + + + + update sys_role set del_flag = '2' where role_id in + + #{roleId} + + + + \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/system/SysRoleMenuMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysRoleMenuMapper.xml new file mode 100644 index 0000000..cb60a85 --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/system/SysRoleMenuMapper.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + delete from sys_role_menu where role_id=#{roleId} + + + + delete from sys_role_menu where role_id in + + #{roleId} + + + + + insert into sys_role_menu(role_id, menu_id) values + + (#{item.roleId},#{item.menuId}) + + + + \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml new file mode 100644 index 0000000..d86c444 --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml @@ -0,0 +1,221 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, + d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status, + r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status + from sys_user u + left join sys_dept d on u.dept_id = d.dept_id + left join sys_user_role ur on u.user_id = ur.user_id + left join sys_role r on r.role_id = ur.role_id + + + + + + + + + + + + + + + + + + + + insert into sys_user( + user_id, + dept_id, + user_name, + nick_name, + email, + avatar, + phonenumber, + sex, + password, + status, + create_by, + remark, + create_time + )values( + #{userId}, + #{deptId}, + #{userName}, + #{nickName}, + #{email}, + #{avatar}, + #{phonenumber}, + #{sex}, + #{password}, + #{status}, + #{createBy}, + #{remark}, + sysdate() + ) + + + + update sys_user + + dept_id = #{deptId}, + user_name = #{userName}, + nick_name = #{nickName}, + email = #{email}, + phonenumber = #{phonenumber}, + sex = #{sex}, + avatar = #{avatar}, + password = #{password}, + status = #{status}, + login_ip = #{loginIp}, + login_date = #{loginDate}, + update_by = #{updateBy}, + remark = #{remark}, + update_time = sysdate() + + where user_id = #{userId} + + + + update sys_user set status = #{status} where user_id = #{userId} + + + + update sys_user set avatar = #{avatar} where user_name = #{userName} + + + + update sys_user set password = #{password} where user_name = #{userName} + + + + update sys_user set del_flag = '2' where user_id = #{userId} + + + + update sys_user set del_flag = '2' where user_id in + + #{userId} + + + + \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/system/SysUserPostMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysUserPostMapper.xml new file mode 100644 index 0000000..2b90bc4 --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/system/SysUserPostMapper.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + delete from sys_user_post where user_id=#{userId} + + + + + + delete from sys_user_post where user_id in + + #{userId} + + + + + insert into sys_user_post(user_id, post_id) values + + (#{item.userId},#{item.postId}) + + + + \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/system/SysUserRoleMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysUserRoleMapper.xml new file mode 100644 index 0000000..dd72689 --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/system/SysUserRoleMapper.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + delete from sys_user_role where user_id=#{userId} + + + + + + delete from sys_user_role where user_id in + + #{userId} + + + + + insert into sys_user_role(user_id, role_id) values + + (#{item.userId},#{item.roleId}) + + + + + delete from sys_user_role where user_id=#{userId} and role_id=#{roleId} + + + + delete from sys_user_role where role_id=#{roleId} and user_id in + + #{userId} + + + \ No newline at end of file diff --git a/sql/dba.sql b/sql/dba.sql new file mode 100644 index 0000000..a8156a0 --- /dev/null +++ b/sql/dba.sql @@ -0,0 +1,1251 @@ +/* + Navicat Premium Data Transfer + + Source Server : 本地数据库 + Source Server Type : MySQL + Source Server Version : 50738 + Source Host : localhost:3306 + Source Schema : dba + + Target Server Type : MySQL + Target Server Version : 50738 + File Encoding : 65001 + + Date: 01/04/2024 09:01:56 +*/ + +SET NAMES utf8mb4; +SET FOREIGN_KEY_CHECKS = 0; + +-- ---------------------------- +-- Table structure for business_template +-- ---------------------------- +DROP TABLE IF EXISTS `business_template`; +CREATE TABLE `business_template` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', + `title` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '标题', + `context` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '内容', + `open` char(10) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '是否开放', + `create_by` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '创建人', + `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `update_by` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '修改人', + `update_time` datetime(0) NULL DEFAULT NULL COMMENT '修改时间', + `deleted` bigint(20) NULL DEFAULT 0 COMMENT '是否删除', + `remark` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1774443791038652418 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '模版表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of business_template +-- ---------------------------- +INSERT INTO `business_template` VALUES (1774327297961119745, '测试', 'test', '1', 'admin', '2024-03-31 14:46:08', NULL, NULL, 0, NULL); +INSERT INTO `business_template` VALUES (1774432972057894914, '测试2', '123123', '0', 'admin', '2024-03-31 21:46:03', 'admin', '2024-03-31 21:56:33', 0, NULL); +INSERT INTO `business_template` VALUES (1774438528533504001, 'test1', '123', '1', 'test1', '2024-03-31 22:08:07', NULL, NULL, 0, NULL); +INSERT INTO `business_template` VALUES (1774443791038652417, '这是测试', '123123', '0', 'admin', '2024-03-31 22:29:02', 'admin', '2024-03-31 22:30:45', 0, NULL); + +-- ---------------------------- +-- Table structure for business_template_prop +-- ---------------------------- +DROP TABLE IF EXISTS `business_template_prop`; +CREATE TABLE `business_template_prop` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', + `title` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '标题', + `comp_type` char(10) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '组件类型(0单选框 1多选框)', + `field_name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '字段名', + `plac_prompt` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '占位提示', + `default_value` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '默认值', + `optional_value` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '可选值', + `open` char(10) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '是否开放', + `temp_id` bigint(20) NULL DEFAULT NULL COMMENT '模版id', + `sort` int(6) NULL DEFAULT 0 COMMENT '排序', + `create_by` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '创建人', + `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `update_by` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '修改人', + `update_time` datetime(0) NULL DEFAULT NULL COMMENT '修改时间', + `deleted` bigint(20) NULL DEFAULT 0 COMMENT '是否删除', + `remark` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1774444094773370883 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '模版属性表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of business_template_prop +-- ---------------------------- +INSERT INTO `business_template_prop` VALUES (12312312312, '爱好', '1', 'like', '请选择爱好', NULL, '0,电影|1,篮球', '1', 1774327297961119745, 0, 'admin', '2024-03-31 15:39:05', NULL, NULL, 0, NULL); +INSERT INTO `business_template_prop` VALUES (1774327728992964609, '性别', '0', 'sex', '请选择性别', NULL, '0,男|1,女', '1', 1774327297961119745, 0, 'admin', '2024-03-31 14:47:51', NULL, NULL, 0, NULL); +INSERT INTO `business_template_prop` VALUES (1774340622648369155, '姓名', '2', 'name', '请输入姓名', NULL, NULL, '1', 1774327297961119745, 0, 'admin', '2024-03-31 15:39:05', NULL, NULL, 0, NULL); +INSERT INTO `business_template_prop` VALUES (1774379056024895489, '多行', '3', 'doubleRows', '测试多行', NULL, NULL, NULL, 1774327297961119745, 0, 'admin', '2024-03-31 18:11:48', NULL, NULL, 0, NULL); +INSERT INTO `business_template_prop` VALUES (1774379229778132993, '密码', '4', 'pwd', NULL, NULL, NULL, NULL, 1774327297961119745, 0, 'admin', '2024-03-31 18:12:29', NULL, NULL, 0, NULL); +INSERT INTO `business_template_prop` VALUES (1774379365837160450, '计数器', '5', 'calcNum', NULL, NULL, NULL, NULL, 1774327297961119745, 0, 'admin', '2024-03-31 18:13:02', NULL, NULL, 0, NULL); +INSERT INTO `business_template_prop` VALUES (1774379705177325569, '下拉', '6', 'selected', NULL, NULL, '0,选择一|1,选择二', NULL, 1774327297961119745, 0, 'admin', '2024-03-31 18:14:23', NULL, NULL, 0, NULL); +INSERT INTO `business_template_prop` VALUES (1774379799100375041, '开关', '7', 'openOrClose', NULL, NULL, NULL, NULL, 1774327297961119745, 0, 'admin', '2024-03-31 18:14:45', NULL, NULL, 0, NULL); +INSERT INTO `business_template_prop` VALUES (1774379921293033474, '时间选择', '8', 'selectTime', NULL, NULL, NULL, NULL, 1774327297961119745, 0, 'admin', '2024-03-31 18:15:14', NULL, NULL, 0, NULL); +INSERT INTO `business_template_prop` VALUES (1774380021302018049, '时间范围', '9', 'beginEndTime', NULL, NULL, NULL, NULL, 1774327297961119745, 0, 'admin', '2024-03-31 18:15:38', NULL, NULL, 0, NULL); +INSERT INTO `business_template_prop` VALUES (1774441701222490114, 'ceshi', '2', '123', NULL, NULL, NULL, NULL, 1774438528533504001, 0, 'test1', '2024-03-31 22:20:44', NULL, NULL, 0, NULL); +INSERT INTO `business_template_prop` VALUES (1774444094773370882, '这是测试', '0', 'test', NULL, NULL, '1,张三|2,李四', NULL, 1774443791038652417, 0, 'admin', '2024-03-31 22:30:14', NULL, NULL, 0, NULL); + +-- ---------------------------- +-- Table structure for business_template_prop_value +-- ---------------------------- +DROP TABLE IF EXISTS `business_template_prop_value`; +CREATE TABLE `business_template_prop_value` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', + `prop_id` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '字段id', + `prop_name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '字段名称', + `prop_type` char(10) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '字段类型', + `value_key` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '值键', + `value_text` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '值描述', + `value_sources` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '原值对象', + `temp_id` bigint(20) NULL DEFAULT NULL COMMENT '模版id', + `create_by` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '创建人', + `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `update_by` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '修改人', + `update_time` datetime(0) NULL DEFAULT NULL COMMENT '修改时间', + `deleted` bigint(20) NULL DEFAULT 0 COMMENT '是否删除', + `remark` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1774445984785481731 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '模版属性值表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of business_template_prop_value +-- ---------------------------- +INSERT INTO `business_template_prop_value` VALUES (1774396727323815937, '12312312312', 'like', '1', '[0, 1]', '电影,篮球', '[0, 1]', 1774327297961119745, 'admin', '2024-03-31 19:22:01', 'admin', '2024-03-31 21:40:05', 0, NULL); +INSERT INTO `business_template_prop_value` VALUES (1774396727407702018, '1774327728992964609', 'sex', '0', '1', '女', '1', 1774327297961119745, 'admin', '2024-03-31 19:22:01', 'admin', '2024-03-31 21:40:05', 0, NULL); +INSERT INTO `business_template_prop_value` VALUES (1774396727470616578, '1774340622648369155', 'name', '2', '123', '123', '123', 1774327297961119745, 'admin', '2024-03-31 19:22:01', 'admin', '2024-03-31 21:40:05', 0, NULL); +INSERT INTO `business_template_prop_value` VALUES (1774396727470616579, '1774379056024895489', 'doubleRows', '3', '1231231231234345436梵蒂冈合法的', '1231231231234345436梵蒂冈合法的', '1231231231234345436梵蒂冈合法的', 1774327297961119745, 'admin', '2024-03-31 19:22:01', 'admin', '2024-03-31 21:40:05', 0, NULL); +INSERT INTO `business_template_prop_value` VALUES (1774396727470616580, '1774379229778132993', 'pwd', '4', '123', '123', '123', 1774327297961119745, 'admin', '2024-03-31 19:22:01', 'admin', '2024-03-31 21:40:05', 0, NULL); +INSERT INTO `business_template_prop_value` VALUES (1774396727470616581, '1774379365837160450', 'calcNum', '5', '1', '1', '1', 1774327297961119745, 'admin', '2024-03-31 19:22:01', 'admin', '2024-03-31 21:40:05', 0, NULL); +INSERT INTO `business_template_prop_value` VALUES (1774396727470616582, '1774379705177325569', 'selected', '6', '1', '选择二', '1', 1774327297961119745, 'admin', '2024-03-31 19:22:01', 'admin', '2024-03-31 21:40:05', 0, NULL); +INSERT INTO `business_template_prop_value` VALUES (1774396727537725441, '1774379799100375041', 'openOrClose', '7', 'false', 'false', 'false', 1774327297961119745, 'admin', '2024-03-31 19:22:01', 'admin', '2024-03-31 21:40:05', 0, NULL); +INSERT INTO `business_template_prop_value` VALUES (1774396727537725442, '1774379921293033474', 'selectTime', '8', '19:21:53', '19:21:53', '19:21:53', 1774327297961119745, 'admin', '2024-03-31 19:22:01', 'admin', '2024-03-31 21:40:05', 0, NULL); +INSERT INTO `business_template_prop_value` VALUES (1774396727537725443, '1774380021302018049', 'beginEndTime', '9', '[08:00:00, 08:00:00]', '[08:00:00, 08:00:00]', '[08:00:00, 08:00:00]', 1774327297961119745, 'admin', '2024-03-31 19:22:01', 'admin', '2024-03-31 21:40:05', 0, NULL); +INSERT INTO `business_template_prop_value` VALUES (1774444309521735682, '1774444094773370882', 'test', '0', '1', '张三', '1', 1774443791038652417, 'admin', '2024-03-31 22:31:06', NULL, NULL, 0, NULL); +INSERT INTO `business_template_prop_value` VALUES (1774445984785481730, '1774441701222490114', '123', '2', '123', '123', '123', 1774438528533504001, 'test1', '2024-03-31 22:37:45', NULL, NULL, 0, NULL); + +-- ---------------------------- +-- Table structure for gen_table +-- ---------------------------- +DROP TABLE IF EXISTS `gen_table`; +CREATE TABLE `gen_table` ( + `table_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '编号', + `table_name` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '表名称', + `table_comment` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '表描述', + `sub_table_name` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '关联子表的表名', + `sub_table_fk_name` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '子表关联的外键名', + `class_name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '实体类名称', + `tpl_category` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT 'crud' COMMENT '使用的模板(crud单表操作 tree树表操作)', + `package_name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '生成包路径', + `module_name` varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '生成模块名', + `business_name` varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '生成业务名', + `function_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '生成功能名', + `function_author` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '生成功能作者', + `gen_type` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '0' COMMENT '生成代码方式(0zip压缩包 1自定义路径)', + `gen_path` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '/' COMMENT '生成路径(不填默认项目路径)', + `options` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '其它生成选项', + `create_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '创建者', + `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `update_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '更新者', + `update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + `remark` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`table_id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '代码生成业务表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of gen_table +-- ---------------------------- +INSERT INTO `gen_table` VALUES (1, 'business_template', '问卷调查表', NULL, NULL, 'BusinessTemplate', 'crud', 'com.ruoyi.business', 'business', 'template', '模版管理', 'ruoyi', '0', '/', '{\"parentMenuId\":\"2000\"}', 'admin', '2024-03-31 03:13:37', '', '2024-03-31 14:59:13', NULL); +INSERT INTO `gen_table` VALUES (2, 'business_template_prop', '模版属性表', NULL, NULL, 'BusinessTemplateProp', 'crud', 'com.ruoyi.business', 'business', 'templateProp', '模版属性', 'ruoyi', '0', '/', '{\"parentMenuId\":2000}', 'admin', '2024-03-31 14:23:17', '', '2024-03-31 14:35:33', NULL); +INSERT INTO `gen_table` VALUES (3, 'business_template_prop_value', '模版属性值表', NULL, NULL, 'BusinessTemplatePropValue', 'crud', 'com.ruoyi.business', 'business', 'templatePropValue', '模版属性值', 'ruoyi', '0', '/', '{\"parentMenuId\":2000}', 'admin', '2024-03-31 15:54:59', '', '2024-03-31 15:56:23', NULL); + +-- ---------------------------- +-- Table structure for gen_table_column +-- ---------------------------- +DROP TABLE IF EXISTS `gen_table_column`; +CREATE TABLE `gen_table_column` ( + `column_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '编号', + `table_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '归属表编号', + `column_name` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '列名称', + `column_comment` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '列描述', + `column_type` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '列类型', + `java_type` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'JAVA类型', + `java_field` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'JAVA字段名', + `is_pk` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '是否主键(1是)', + `is_increment` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '是否自增(1是)', + `is_required` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '是否必填(1是)', + `is_insert` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '是否为插入字段(1是)', + `is_edit` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '是否编辑字段(1是)', + `is_list` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '是否列表字段(1是)', + `is_query` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '是否查询字段(1是)', + `query_type` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT 'EQ' COMMENT '查询方式(等于、不等于、大于、小于、范围)', + `html_type` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '显示类型(文本框、文本域、下拉框、复选框、单选框、日期控件)', + `dict_type` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '字典类型', + `sort` int(11) NULL DEFAULT NULL COMMENT '排序', + `create_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '创建者', + `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `update_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '更新者', + `update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`column_id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 40 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '代码生成业务表字段' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of gen_table_column +-- ---------------------------- +INSERT INTO `gen_table_column` VALUES (1, '1', 'id', '主键', 'bigint(20)', 'Long', 'id', '1', '1', NULL, '1', NULL, NULL, NULL, 'EQ', 'input', '', 1, 'admin', '2024-03-31 03:13:37', '', '2024-03-31 14:59:13'); +INSERT INTO `gen_table_column` VALUES (2, '1', 'title', '标题', 'varchar(100)', 'String', 'title', '0', '0', NULL, '1', '1', '1', '1', 'EQ', 'input', '', 2, 'admin', '2024-03-31 03:13:37', '', '2024-03-31 14:59:13'); +INSERT INTO `gen_table_column` VALUES (3, '1', 'context', '内容', 'varchar(100)', 'String', 'context', '0', '0', NULL, '1', '1', '1', '1', 'EQ', 'input', '', 3, 'admin', '2024-03-31 03:13:37', '', '2024-03-31 14:59:13'); +INSERT INTO `gen_table_column` VALUES (5, '1', 'create_by', '创建人', 'varchar(100)', 'String', 'createBy', '0', '0', NULL, '0', NULL, NULL, NULL, 'EQ', 'input', '', 5, 'admin', '2024-03-31 03:13:37', '', '2024-03-31 14:59:13'); +INSERT INTO `gen_table_column` VALUES (6, '1', 'create_time', '创建时间', 'datetime', 'Date', 'createTime', '0', '0', NULL, '0', NULL, NULL, NULL, 'EQ', 'datetime', '', 6, 'admin', '2024-03-31 03:13:37', '', '2024-03-31 14:59:13'); +INSERT INTO `gen_table_column` VALUES (7, '1', 'update_by', '修改人', 'varchar(100)', 'String', 'updateBy', '0', '0', NULL, '0', '0', NULL, NULL, 'EQ', 'input', '', 7, 'admin', '2024-03-31 03:13:37', '', '2024-03-31 14:59:13'); +INSERT INTO `gen_table_column` VALUES (8, '1', 'update_time', '修改时间', 'datetime', 'Date', 'updateTime', '0', '0', NULL, '0', '0', NULL, NULL, 'EQ', 'datetime', '', 8, 'admin', '2024-03-31 03:13:37', '', '2024-03-31 14:59:13'); +INSERT INTO `gen_table_column` VALUES (9, '1', 'deleted', '是否删除', 'bigint(20)', 'Long', 'deleted', '0', '0', NULL, '0', '0', '0', '0', 'EQ', 'input', '', 9, 'admin', '2024-03-31 03:13:37', '', '2024-03-31 14:59:13'); +INSERT INTO `gen_table_column` VALUES (10, '1', 'remark', '备注', 'varchar(100)', 'String', 'remark', '0', '0', NULL, '0', '0', '0', NULL, 'EQ', 'input', '', 10, 'admin', '2024-03-31 03:13:37', '', '2024-03-31 14:59:13'); +INSERT INTO `gen_table_column` VALUES (11, '1', 'open', '是否开放', 'char(10)', 'String', 'open', '0', '0', NULL, '1', '1', '1', '1', 'EQ', 'select', 'open', 4, '', '2024-03-31 14:23:14', '', '2024-03-31 14:59:13'); +INSERT INTO `gen_table_column` VALUES (12, '2', 'id', '主键', 'bigint(20)', 'Long', 'id', '1', '1', NULL, '0', NULL, NULL, NULL, 'EQ', 'input', '', 1, 'admin', '2024-03-31 14:23:17', '', '2024-03-31 14:35:33'); +INSERT INTO `gen_table_column` VALUES (13, '2', 'title', '标题', 'varchar(100)', 'String', 'title', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 2, 'admin', '2024-03-31 14:23:17', '', '2024-03-31 14:35:33'); +INSERT INTO `gen_table_column` VALUES (14, '2', 'comp_type', '组件类型(0单选框 1多选框)', 'char(10)', 'String', 'compType', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'select', 'comp_type', 3, 'admin', '2024-03-31 14:23:17', '', '2024-03-31 14:35:33'); +INSERT INTO `gen_table_column` VALUES (15, '2', 'field_name', '字段名', 'varchar(100)', 'String', 'fieldName', '0', '0', '1', '1', '1', '1', '1', 'LIKE', 'input', '', 4, 'admin', '2024-03-31 14:23:17', '', '2024-03-31 14:35:33'); +INSERT INTO `gen_table_column` VALUES (16, '2', 'plac_prompt', '占位提示', 'varchar(100)', 'String', 'placPrompt', '0', '0', '0', '1', '1', '1', '1', 'EQ', 'input', '', 5, 'admin', '2024-03-31 14:23:17', '', '2024-03-31 14:35:33'); +INSERT INTO `gen_table_column` VALUES (17, '2', 'default_value', '默认值', 'text', 'String', 'defaultValue', '0', '0', '0', '1', '1', '1', '1', 'EQ', 'textarea', '', 6, 'admin', '2024-03-31 14:23:17', '', '2024-03-31 14:35:33'); +INSERT INTO `gen_table_column` VALUES (18, '2', 'open', '是否开放', 'char(10)', 'String', 'open', '0', '0', NULL, '1', '1', '1', '1', 'EQ', 'input', '', 8, 'admin', '2024-03-31 14:23:17', '', '2024-03-31 14:35:33'); +INSERT INTO `gen_table_column` VALUES (19, '2', 'temp_id', '模版id', 'bigint(20)', 'Long', 'tempId', '0', '0', NULL, '1', '1', '1', '1', 'EQ', 'select', '', 9, 'admin', '2024-03-31 14:23:17', '', '2024-03-31 14:35:33'); +INSERT INTO `gen_table_column` VALUES (20, '2', 'create_by', '创建人', 'varchar(100)', 'String', 'createBy', '0', '0', NULL, '0', NULL, NULL, NULL, 'EQ', 'input', '', 10, 'admin', '2024-03-31 14:23:17', '', '2024-03-31 14:35:33'); +INSERT INTO `gen_table_column` VALUES (21, '2', 'create_time', '创建时间', 'datetime', 'Date', 'createTime', '0', '0', NULL, '0', NULL, NULL, NULL, 'EQ', 'datetime', '', 11, 'admin', '2024-03-31 14:23:17', '', '2024-03-31 14:35:33'); +INSERT INTO `gen_table_column` VALUES (22, '2', 'update_by', '修改人', 'varchar(100)', 'String', 'updateBy', '0', '0', NULL, '0', '0', NULL, NULL, 'EQ', 'input', '', 12, 'admin', '2024-03-31 14:23:17', '', '2024-03-31 14:35:33'); +INSERT INTO `gen_table_column` VALUES (23, '2', 'update_time', '修改时间', 'datetime', 'Date', 'updateTime', '0', '0', NULL, '0', '0', NULL, NULL, 'EQ', 'datetime', '', 13, 'admin', '2024-03-31 14:23:17', '', '2024-03-31 14:35:33'); +INSERT INTO `gen_table_column` VALUES (24, '2', 'deleted', '是否删除', 'bigint(20)', 'Long', 'deleted', '0', '0', NULL, '0', '0', '0', '0', 'EQ', 'input', '', 14, 'admin', '2024-03-31 14:23:17', '', '2024-03-31 14:35:33'); +INSERT INTO `gen_table_column` VALUES (25, '2', 'remark', '备注', 'varchar(100)', 'String', 'remark', '0', '0', NULL, '0', '0', '0', NULL, 'EQ', 'input', '', 15, 'admin', '2024-03-31 14:23:17', '', '2024-03-31 14:35:33'); +INSERT INTO `gen_table_column` VALUES (26, '2', 'optional_value', '可选值', 'varchar(100)', 'String', 'optionalValue', '0', '0', NULL, '1', '1', '1', '1', 'EQ', 'input', '', 7, '', '2024-03-31 14:27:58', '', '2024-03-31 14:35:33'); +INSERT INTO `gen_table_column` VALUES (27, '3', 'id', '主键', 'bigint(20)', 'Long', 'id', '1', '1', NULL, '1', NULL, NULL, NULL, 'EQ', 'input', '', 1, 'admin', '2024-03-31 15:54:59', '', '2024-03-31 18:23:24'); +INSERT INTO `gen_table_column` VALUES (28, '3', 'prop_id', '字段id', 'varchar(100)', 'String', 'propId', '0', '0', NULL, '1', '1', '1', '1', 'EQ', 'input', '', 2, 'admin', '2024-03-31 15:54:59', '', '2024-03-31 18:23:24'); +INSERT INTO `gen_table_column` VALUES (29, '3', 'prop_name', '字段名称', 'char(10)', 'String', 'propName', '0', '0', NULL, '1', '1', '1', '1', 'LIKE', 'input', '', 3, 'admin', '2024-03-31 15:54:59', '', '2024-03-31 18:23:24'); +INSERT INTO `gen_table_column` VALUES (30, '3', 'value_key', '值键', 'varchar(100)', 'String', 'valueKey', '0', '0', NULL, '1', '1', '1', '1', 'EQ', 'input', '', 5, 'admin', '2024-03-31 15:54:59', '', '2024-03-31 18:23:24'); +INSERT INTO `gen_table_column` VALUES (31, '3', 'value_text', '值描述', 'varchar(100)', 'String', 'valueText', '0', '0', NULL, '1', '1', '1', '1', 'EQ', 'input', '', 6, 'admin', '2024-03-31 15:54:59', '', '2024-03-31 18:23:24'); +INSERT INTO `gen_table_column` VALUES (32, '3', 'temp_id', '模版id', 'bigint(20)', 'Long', 'tempId', '0', '0', NULL, '1', '1', '1', '1', 'EQ', 'input', '', 7, 'admin', '2024-03-31 15:54:59', '', '2024-03-31 18:23:24'); +INSERT INTO `gen_table_column` VALUES (33, '3', 'create_by', '创建人', 'varchar(100)', 'String', 'createBy', '0', '0', NULL, '1', NULL, NULL, NULL, 'EQ', 'input', '', 8, 'admin', '2024-03-31 15:54:59', '', '2024-03-31 18:23:24'); +INSERT INTO `gen_table_column` VALUES (34, '3', 'create_time', '创建时间', 'datetime', 'Date', 'createTime', '0', '0', NULL, '1', NULL, NULL, NULL, 'EQ', 'datetime', '', 9, 'admin', '2024-03-31 15:54:59', '', '2024-03-31 18:23:24'); +INSERT INTO `gen_table_column` VALUES (35, '3', 'update_by', '修改人', 'varchar(100)', 'String', 'updateBy', '0', '0', NULL, '1', '1', NULL, NULL, 'EQ', 'input', '', 10, 'admin', '2024-03-31 15:54:59', '', '2024-03-31 18:23:24'); +INSERT INTO `gen_table_column` VALUES (36, '3', 'update_time', '修改时间', 'datetime', 'Date', 'updateTime', '0', '0', NULL, '1', '1', NULL, NULL, 'EQ', 'datetime', '', 11, 'admin', '2024-03-31 15:54:59', '', '2024-03-31 18:23:24'); +INSERT INTO `gen_table_column` VALUES (37, '3', 'deleted', '是否删除', 'bigint(20)', 'Long', 'deleted', '0', '0', NULL, '1', '1', '1', '1', 'EQ', 'input', '', 12, 'admin', '2024-03-31 15:54:59', '', '2024-03-31 18:23:24'); +INSERT INTO `gen_table_column` VALUES (38, '3', 'remark', '备注', 'varchar(100)', 'String', 'remark', '0', '0', NULL, '1', '1', '1', NULL, 'EQ', 'input', '', 13, 'admin', '2024-03-31 15:54:59', '', '2024-03-31 18:23:24'); +INSERT INTO `gen_table_column` VALUES (39, '3', 'prop_type', '字段类型', 'char(10)', 'String', 'propType', '0', '0', NULL, '1', '1', '1', '1', 'EQ', 'select', '', 4, '', '2024-03-31 18:23:24', '', NULL); + +-- ---------------------------- +-- Table structure for qrtz_blob_triggers +-- ---------------------------- +DROP TABLE IF EXISTS `qrtz_blob_triggers`; +CREATE TABLE `qrtz_blob_triggers` ( + `sched_name` varchar(120) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '调度名称', + `trigger_name` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 'qrtz_triggers表trigger_name的外键', + `trigger_group` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 'qrtz_triggers表trigger_group的外键', + `blob_data` blob NULL COMMENT '存放持久化Trigger对象', + PRIMARY KEY (`sched_name`, `trigger_name`, `trigger_group`) USING BTREE, + CONSTRAINT `qrtz_blob_triggers_ibfk_1` FOREIGN KEY (`sched_name`, `trigger_name`, `trigger_group`) REFERENCES `qrtz_triggers` (`sched_name`, `trigger_name`, `trigger_group`) ON DELETE RESTRICT ON UPDATE RESTRICT +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = 'Blob类型的触发器表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of qrtz_blob_triggers +-- ---------------------------- + +-- ---------------------------- +-- Table structure for qrtz_calendars +-- ---------------------------- +DROP TABLE IF EXISTS `qrtz_calendars`; +CREATE TABLE `qrtz_calendars` ( + `sched_name` varchar(120) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '调度名称', + `calendar_name` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '日历名称', + `calendar` blob NOT NULL COMMENT '存放持久化calendar对象', + PRIMARY KEY (`sched_name`, `calendar_name`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '日历信息表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of qrtz_calendars +-- ---------------------------- + +-- ---------------------------- +-- Table structure for qrtz_cron_triggers +-- ---------------------------- +DROP TABLE IF EXISTS `qrtz_cron_triggers`; +CREATE TABLE `qrtz_cron_triggers` ( + `sched_name` varchar(120) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '调度名称', + `trigger_name` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 'qrtz_triggers表trigger_name的外键', + `trigger_group` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 'qrtz_triggers表trigger_group的外键', + `cron_expression` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 'cron表达式', + `time_zone_id` varchar(80) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '时区', + PRIMARY KEY (`sched_name`, `trigger_name`, `trigger_group`) USING BTREE, + CONSTRAINT `qrtz_cron_triggers_ibfk_1` FOREIGN KEY (`sched_name`, `trigger_name`, `trigger_group`) REFERENCES `qrtz_triggers` (`sched_name`, `trigger_name`, `trigger_group`) ON DELETE RESTRICT ON UPDATE RESTRICT +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = 'Cron类型的触发器表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of qrtz_cron_triggers +-- ---------------------------- + +-- ---------------------------- +-- Table structure for qrtz_fired_triggers +-- ---------------------------- +DROP TABLE IF EXISTS `qrtz_fired_triggers`; +CREATE TABLE `qrtz_fired_triggers` ( + `sched_name` varchar(120) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '调度名称', + `entry_id` varchar(95) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '调度器实例id', + `trigger_name` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 'qrtz_triggers表trigger_name的外键', + `trigger_group` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 'qrtz_triggers表trigger_group的外键', + `instance_name` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '调度器实例名', + `fired_time` bigint(13) NOT NULL COMMENT '触发的时间', + `sched_time` bigint(13) NOT NULL COMMENT '定时器制定的时间', + `priority` int(11) NOT NULL COMMENT '优先级', + `state` varchar(16) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '状态', + `job_name` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '任务名称', + `job_group` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '任务组名', + `is_nonconcurrent` varchar(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '是否并发', + `requests_recovery` varchar(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '是否接受恢复执行', + PRIMARY KEY (`sched_name`, `entry_id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '已触发的触发器表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of qrtz_fired_triggers +-- ---------------------------- + +-- ---------------------------- +-- Table structure for qrtz_job_details +-- ---------------------------- +DROP TABLE IF EXISTS `qrtz_job_details`; +CREATE TABLE `qrtz_job_details` ( + `sched_name` varchar(120) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '调度名称', + `job_name` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '任务名称', + `job_group` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '任务组名', + `description` varchar(250) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '相关介绍', + `job_class_name` varchar(250) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '执行任务类名称', + `is_durable` varchar(1) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '是否持久化', + `is_nonconcurrent` varchar(1) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '是否并发', + `is_update_data` varchar(1) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '是否更新数据', + `requests_recovery` varchar(1) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '是否接受恢复执行', + `job_data` blob NULL COMMENT '存放持久化job对象', + PRIMARY KEY (`sched_name`, `job_name`, `job_group`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '任务详细信息表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of qrtz_job_details +-- ---------------------------- + +-- ---------------------------- +-- Table structure for qrtz_locks +-- ---------------------------- +DROP TABLE IF EXISTS `qrtz_locks`; +CREATE TABLE `qrtz_locks` ( + `sched_name` varchar(120) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '调度名称', + `lock_name` varchar(40) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '悲观锁名称', + PRIMARY KEY (`sched_name`, `lock_name`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '存储的悲观锁信息表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of qrtz_locks +-- ---------------------------- + +-- ---------------------------- +-- Table structure for qrtz_paused_trigger_grps +-- ---------------------------- +DROP TABLE IF EXISTS `qrtz_paused_trigger_grps`; +CREATE TABLE `qrtz_paused_trigger_grps` ( + `sched_name` varchar(120) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '调度名称', + `trigger_group` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 'qrtz_triggers表trigger_group的外键', + PRIMARY KEY (`sched_name`, `trigger_group`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '暂停的触发器表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of qrtz_paused_trigger_grps +-- ---------------------------- + +-- ---------------------------- +-- Table structure for qrtz_scheduler_state +-- ---------------------------- +DROP TABLE IF EXISTS `qrtz_scheduler_state`; +CREATE TABLE `qrtz_scheduler_state` ( + `sched_name` varchar(120) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '调度名称', + `instance_name` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '实例名称', + `last_checkin_time` bigint(13) NOT NULL COMMENT '上次检查时间', + `checkin_interval` bigint(13) NOT NULL COMMENT '检查间隔时间', + PRIMARY KEY (`sched_name`, `instance_name`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '调度器状态表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of qrtz_scheduler_state +-- ---------------------------- + +-- ---------------------------- +-- Table structure for qrtz_simple_triggers +-- ---------------------------- +DROP TABLE IF EXISTS `qrtz_simple_triggers`; +CREATE TABLE `qrtz_simple_triggers` ( + `sched_name` varchar(120) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '调度名称', + `trigger_name` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 'qrtz_triggers表trigger_name的外键', + `trigger_group` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 'qrtz_triggers表trigger_group的外键', + `repeat_count` bigint(7) NOT NULL COMMENT '重复的次数统计', + `repeat_interval` bigint(12) NOT NULL COMMENT '重复的间隔时间', + `times_triggered` bigint(10) NOT NULL COMMENT '已经触发的次数', + PRIMARY KEY (`sched_name`, `trigger_name`, `trigger_group`) USING BTREE, + CONSTRAINT `qrtz_simple_triggers_ibfk_1` FOREIGN KEY (`sched_name`, `trigger_name`, `trigger_group`) REFERENCES `qrtz_triggers` (`sched_name`, `trigger_name`, `trigger_group`) ON DELETE RESTRICT ON UPDATE RESTRICT +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '简单触发器的信息表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of qrtz_simple_triggers +-- ---------------------------- + +-- ---------------------------- +-- Table structure for qrtz_simprop_triggers +-- ---------------------------- +DROP TABLE IF EXISTS `qrtz_simprop_triggers`; +CREATE TABLE `qrtz_simprop_triggers` ( + `sched_name` varchar(120) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '调度名称', + `trigger_name` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 'qrtz_triggers表trigger_name的外键', + `trigger_group` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 'qrtz_triggers表trigger_group的外键', + `str_prop_1` varchar(512) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'String类型的trigger的第一个参数', + `str_prop_2` varchar(512) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'String类型的trigger的第二个参数', + `str_prop_3` varchar(512) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'String类型的trigger的第三个参数', + `int_prop_1` int(11) NULL DEFAULT NULL COMMENT 'int类型的trigger的第一个参数', + `int_prop_2` int(11) NULL DEFAULT NULL COMMENT 'int类型的trigger的第二个参数', + `long_prop_1` bigint(20) NULL DEFAULT NULL COMMENT 'long类型的trigger的第一个参数', + `long_prop_2` bigint(20) NULL DEFAULT NULL COMMENT 'long类型的trigger的第二个参数', + `dec_prop_1` decimal(13, 4) NULL DEFAULT NULL COMMENT 'decimal类型的trigger的第一个参数', + `dec_prop_2` decimal(13, 4) NULL DEFAULT NULL COMMENT 'decimal类型的trigger的第二个参数', + `bool_prop_1` varchar(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'Boolean类型的trigger的第一个参数', + `bool_prop_2` varchar(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'Boolean类型的trigger的第二个参数', + PRIMARY KEY (`sched_name`, `trigger_name`, `trigger_group`) USING BTREE, + CONSTRAINT `qrtz_simprop_triggers_ibfk_1` FOREIGN KEY (`sched_name`, `trigger_name`, `trigger_group`) REFERENCES `qrtz_triggers` (`sched_name`, `trigger_name`, `trigger_group`) ON DELETE RESTRICT ON UPDATE RESTRICT +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '同步机制的行锁表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of qrtz_simprop_triggers +-- ---------------------------- + +-- ---------------------------- +-- Table structure for qrtz_triggers +-- ---------------------------- +DROP TABLE IF EXISTS `qrtz_triggers`; +CREATE TABLE `qrtz_triggers` ( + `sched_name` varchar(120) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '调度名称', + `trigger_name` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '触发器的名字', + `trigger_group` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '触发器所属组的名字', + `job_name` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 'qrtz_job_details表job_name的外键', + `job_group` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 'qrtz_job_details表job_group的外键', + `description` varchar(250) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '相关介绍', + `next_fire_time` bigint(13) NULL DEFAULT NULL COMMENT '上一次触发时间(毫秒)', + `prev_fire_time` bigint(13) NULL DEFAULT NULL COMMENT '下一次触发时间(默认为-1表示不触发)', + `priority` int(11) NULL DEFAULT NULL COMMENT '优先级', + `trigger_state` varchar(16) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '触发器状态', + `trigger_type` varchar(8) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '触发器的类型', + `start_time` bigint(13) NOT NULL COMMENT '开始时间', + `end_time` bigint(13) NULL DEFAULT NULL COMMENT '结束时间', + `calendar_name` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '日程表名称', + `misfire_instr` smallint(2) NULL DEFAULT NULL COMMENT '补偿执行的策略', + `job_data` blob NULL COMMENT '存放持久化job对象', + PRIMARY KEY (`sched_name`, `trigger_name`, `trigger_group`) USING BTREE, + INDEX `sched_name`(`sched_name`, `job_name`, `job_group`) USING BTREE, + CONSTRAINT `qrtz_triggers_ibfk_1` FOREIGN KEY (`sched_name`, `job_name`, `job_group`) REFERENCES `qrtz_job_details` (`sched_name`, `job_name`, `job_group`) ON DELETE RESTRICT ON UPDATE RESTRICT +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '触发器详细信息表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of qrtz_triggers +-- ---------------------------- + +-- ---------------------------- +-- Table structure for sys_config +-- ---------------------------- +DROP TABLE IF EXISTS `sys_config`; +CREATE TABLE `sys_config` ( + `config_id` int(5) NOT NULL AUTO_INCREMENT COMMENT '参数主键', + `config_name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '参数名称', + `config_key` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '参数键名', + `config_value` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '参数键值', + `config_type` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT 'N' COMMENT '系统内置(Y是 N否)', + `create_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '创建者', + `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `update_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '更新者', + `update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + `remark` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`config_id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 6 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '参数配置表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of sys_config +-- ---------------------------- +INSERT INTO `sys_config` VALUES (1, '主框架页-默认皮肤样式名称', 'sys.index.skinName', 'skin-blue', 'Y', 'admin', '2024-03-31 01:19:12', '', NULL, '蓝色 skin-blue、绿色 skin-green、紫色 skin-purple、红色 skin-red、黄色 skin-yellow'); +INSERT INTO `sys_config` VALUES (2, '用户管理-账号初始密码', 'sys.user.initPassword', '123456', 'Y', 'admin', '2024-03-31 01:19:12', '', NULL, '初始化密码 123456'); +INSERT INTO `sys_config` VALUES (3, '主框架页-侧边栏主题', 'sys.index.sideTheme', 'theme-dark', 'Y', 'admin', '2024-03-31 01:19:12', '', NULL, '深色主题theme-dark,浅色主题theme-light'); +INSERT INTO `sys_config` VALUES (4, '账号自助-验证码开关', 'sys.account.captchaEnabled', 'true', 'Y', 'admin', '2024-03-31 01:19:12', '', NULL, '是否开启验证码功能(true开启,false关闭)'); +INSERT INTO `sys_config` VALUES (5, '账号自助-是否开启用户注册功能', 'sys.account.registerUser', 'true', 'Y', 'admin', '2024-03-31 01:19:12', 'admin', '2024-03-31 02:03:41', '是否开启注册用户功能(true开启,false关闭)'); + +-- ---------------------------- +-- Table structure for sys_dept +-- ---------------------------- +DROP TABLE IF EXISTS `sys_dept`; +CREATE TABLE `sys_dept` ( + `dept_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '部门id', + `parent_id` bigint(20) NULL DEFAULT 0 COMMENT '父部门id', + `ancestors` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '祖级列表', + `dept_name` varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '部门名称', + `order_num` int(4) NULL DEFAULT 0 COMMENT '显示顺序', + `leader` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '负责人', + `phone` varchar(11) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '联系电话', + `email` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '邮箱', + `status` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '0' COMMENT '部门状态(0正常 1停用)', + `del_flag` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '0' COMMENT '删除标志(0代表存在 2代表删除)', + `create_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '创建者', + `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `update_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '更新者', + `update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`dept_id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 101 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '部门表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of sys_dept +-- ---------------------------- +INSERT INTO `sys_dept` VALUES (100, 0, '0', '总公司', 0, '开发者', '15888888888', 'ry@qq.com', '0', '0', 'admin', '2024-03-31 01:19:09', '', NULL); + +-- ---------------------------- +-- Table structure for sys_dict_data +-- ---------------------------- +DROP TABLE IF EXISTS `sys_dict_data`; +CREATE TABLE `sys_dict_data` ( + `dict_code` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '字典编码', + `dict_sort` int(4) NULL DEFAULT 0 COMMENT '字典排序', + `dict_label` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '字典标签', + `dict_value` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '字典键值', + `dict_type` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '字典类型', + `css_class` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '样式属性(其他样式扩展)', + `list_class` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '表格回显样式', + `is_default` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT 'N' COMMENT '是否默认(Y是 N否)', + `status` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '0' COMMENT '状态(0正常 1停用)', + `create_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '创建者', + `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `update_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '更新者', + `update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + `remark` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`dict_code`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 112 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '字典数据表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of sys_dict_data +-- ---------------------------- +INSERT INTO `sys_dict_data` VALUES (1, 1, '男', '0', 'sys_user_sex', '', '', 'Y', '0', 'admin', '2024-03-31 01:19:12', '', NULL, '性别男'); +INSERT INTO `sys_dict_data` VALUES (2, 2, '女', '1', 'sys_user_sex', '', '', 'N', '0', 'admin', '2024-03-31 01:19:12', '', NULL, '性别女'); +INSERT INTO `sys_dict_data` VALUES (3, 3, '未知', '2', 'sys_user_sex', '', '', 'N', '0', 'admin', '2024-03-31 01:19:12', '', NULL, '性别未知'); +INSERT INTO `sys_dict_data` VALUES (4, 1, '显示', '0', 'sys_show_hide', '', 'primary', 'Y', '0', 'admin', '2024-03-31 01:19:12', '', NULL, '显示菜单'); +INSERT INTO `sys_dict_data` VALUES (5, 2, '隐藏', '1', 'sys_show_hide', '', 'danger', 'N', '0', 'admin', '2024-03-31 01:19:12', '', NULL, '隐藏菜单'); +INSERT INTO `sys_dict_data` VALUES (6, 1, '正常', '0', 'sys_normal_disable', '', 'primary', 'Y', '0', 'admin', '2024-03-31 01:19:12', '', NULL, '正常状态'); +INSERT INTO `sys_dict_data` VALUES (7, 2, '停用', '1', 'sys_normal_disable', '', 'danger', 'N', '0', 'admin', '2024-03-31 01:19:12', '', NULL, '停用状态'); +INSERT INTO `sys_dict_data` VALUES (8, 1, '正常', '0', 'sys_job_status', '', 'primary', 'Y', '0', 'admin', '2024-03-31 01:19:12', '', NULL, '正常状态'); +INSERT INTO `sys_dict_data` VALUES (9, 2, '暂停', '1', 'sys_job_status', '', 'danger', 'N', '0', 'admin', '2024-03-31 01:19:12', '', NULL, '停用状态'); +INSERT INTO `sys_dict_data` VALUES (10, 1, '默认', 'DEFAULT', 'sys_job_group', '', '', 'Y', '0', 'admin', '2024-03-31 01:19:12', '', NULL, '默认分组'); +INSERT INTO `sys_dict_data` VALUES (11, 2, '系统', 'SYSTEM', 'sys_job_group', '', '', 'N', '0', 'admin', '2024-03-31 01:19:12', '', NULL, '系统分组'); +INSERT INTO `sys_dict_data` VALUES (12, 1, '是', 'Y', 'sys_yes_no', '', 'primary', 'Y', '0', 'admin', '2024-03-31 01:19:12', '', NULL, '系统默认是'); +INSERT INTO `sys_dict_data` VALUES (13, 2, '否', 'N', 'sys_yes_no', '', 'danger', 'N', '0', 'admin', '2024-03-31 01:19:12', '', NULL, '系统默认否'); +INSERT INTO `sys_dict_data` VALUES (14, 1, '通知', '1', 'sys_notice_type', '', 'warning', 'Y', '0', 'admin', '2024-03-31 01:19:12', '', NULL, '通知'); +INSERT INTO `sys_dict_data` VALUES (15, 2, '公告', '2', 'sys_notice_type', '', 'success', 'N', '0', 'admin', '2024-03-31 01:19:12', '', NULL, '公告'); +INSERT INTO `sys_dict_data` VALUES (16, 1, '正常', '0', 'sys_notice_status', '', 'primary', 'Y', '0', 'admin', '2024-03-31 01:19:12', '', NULL, '正常状态'); +INSERT INTO `sys_dict_data` VALUES (17, 2, '关闭', '1', 'sys_notice_status', '', 'danger', 'N', '0', 'admin', '2024-03-31 01:19:12', '', NULL, '关闭状态'); +INSERT INTO `sys_dict_data` VALUES (18, 99, '其他', '0', 'sys_oper_type', '', 'info', 'N', '0', 'admin', '2024-03-31 01:19:12', '', NULL, '其他操作'); +INSERT INTO `sys_dict_data` VALUES (19, 1, '新增', '1', 'sys_oper_type', '', 'info', 'N', '0', 'admin', '2024-03-31 01:19:12', '', NULL, '新增操作'); +INSERT INTO `sys_dict_data` VALUES (20, 2, '修改', '2', 'sys_oper_type', '', 'info', 'N', '0', 'admin', '2024-03-31 01:19:12', '', NULL, '修改操作'); +INSERT INTO `sys_dict_data` VALUES (21, 3, '删除', '3', 'sys_oper_type', '', 'danger', 'N', '0', 'admin', '2024-03-31 01:19:12', '', NULL, '删除操作'); +INSERT INTO `sys_dict_data` VALUES (22, 4, '授权', '4', 'sys_oper_type', '', 'primary', 'N', '0', 'admin', '2024-03-31 01:19:12', '', NULL, '授权操作'); +INSERT INTO `sys_dict_data` VALUES (23, 5, '导出', '5', 'sys_oper_type', '', 'warning', 'N', '0', 'admin', '2024-03-31 01:19:12', '', NULL, '导出操作'); +INSERT INTO `sys_dict_data` VALUES (24, 6, '导入', '6', 'sys_oper_type', '', 'warning', 'N', '0', 'admin', '2024-03-31 01:19:12', '', NULL, '导入操作'); +INSERT INTO `sys_dict_data` VALUES (25, 7, '强退', '7', 'sys_oper_type', '', 'danger', 'N', '0', 'admin', '2024-03-31 01:19:12', '', NULL, '强退操作'); +INSERT INTO `sys_dict_data` VALUES (26, 8, '生成代码', '8', 'sys_oper_type', '', 'warning', 'N', '0', 'admin', '2024-03-31 01:19:12', '', NULL, '生成操作'); +INSERT INTO `sys_dict_data` VALUES (27, 9, '清空数据', '9', 'sys_oper_type', '', 'danger', 'N', '0', 'admin', '2024-03-31 01:19:12', '', NULL, '清空操作'); +INSERT INTO `sys_dict_data` VALUES (28, 1, '成功', '0', 'sys_common_status', '', 'primary', 'N', '0', 'admin', '2024-03-31 01:19:12', '', NULL, '正常状态'); +INSERT INTO `sys_dict_data` VALUES (29, 2, '失败', '1', 'sys_common_status', '', 'danger', 'N', '0', 'admin', '2024-03-31 01:19:12', '', NULL, '停用状态'); +INSERT INTO `sys_dict_data` VALUES (100, 0, '单选框组', '0', 'comp_type', NULL, 'default', 'N', '0', 'admin', '2024-03-31 14:24:26', 'admin', '2024-03-31 17:32:10', NULL); +INSERT INTO `sys_dict_data` VALUES (101, 0, '多选框组', '1', 'comp_type', NULL, 'default', 'N', '0', 'admin', '2024-03-31 14:24:45', 'admin', '2024-03-31 17:32:22', NULL); +INSERT INTO `sys_dict_data` VALUES (102, 0, '关闭', '0', 'open', NULL, 'default', 'N', '0', 'admin', '2024-03-31 14:36:45', '', NULL, NULL); +INSERT INTO `sys_dict_data` VALUES (103, 0, '开放', '1', 'open', NULL, 'default', 'N', '0', 'admin', '2024-03-31 14:36:53', '', NULL, NULL); +INSERT INTO `sys_dict_data` VALUES (104, 0, '单行文本', '2', 'comp_type', NULL, 'default', 'N', '0', 'admin', '2024-03-31 15:46:08', 'admin', '2024-03-31 17:31:57', NULL); +INSERT INTO `sys_dict_data` VALUES (105, 0, '多行文本', '3', 'comp_type', NULL, 'default', 'N', '0', 'admin', '2024-03-31 17:32:38', '', NULL, NULL); +INSERT INTO `sys_dict_data` VALUES (106, 0, '密码', '4', 'comp_type', NULL, 'default', 'N', '0', 'admin', '2024-03-31 17:32:48', 'admin', '2024-03-31 17:32:53', NULL); +INSERT INTO `sys_dict_data` VALUES (107, 0, '计数器', '5', 'comp_type', NULL, 'default', 'N', '0', 'admin', '2024-03-31 17:33:12', 'admin', '2024-03-31 17:33:16', NULL); +INSERT INTO `sys_dict_data` VALUES (108, 0, '下拉选择', '6', 'comp_type', NULL, 'default', 'N', '0', 'admin', '2024-03-31 17:33:55', '', NULL, NULL); +INSERT INTO `sys_dict_data` VALUES (109, 0, '开关', '7', 'comp_type', NULL, 'default', 'N', '0', 'admin', '2024-03-31 17:34:12', '', NULL, NULL); +INSERT INTO `sys_dict_data` VALUES (110, 0, '时间选择', '8', 'comp_type', NULL, 'default', 'N', '0', 'admin', '2024-03-31 17:35:01', '', NULL, NULL); +INSERT INTO `sys_dict_data` VALUES (111, 0, '时间范围', '9', 'comp_type', NULL, 'default', 'N', '0', 'admin', '2024-03-31 17:35:29', '', NULL, NULL); + +-- ---------------------------- +-- Table structure for sys_dict_type +-- ---------------------------- +DROP TABLE IF EXISTS `sys_dict_type`; +CREATE TABLE `sys_dict_type` ( + `dict_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '字典主键', + `dict_name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '字典名称', + `dict_type` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '字典类型', + `status` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '0' COMMENT '状态(0正常 1停用)', + `create_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '创建者', + `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `update_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '更新者', + `update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + `remark` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`dict_id`) USING BTREE, + UNIQUE INDEX `dict_type`(`dict_type`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 102 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '字典类型表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of sys_dict_type +-- ---------------------------- +INSERT INTO `sys_dict_type` VALUES (1, '用户性别', 'sys_user_sex', '0', 'admin', '2024-03-31 01:19:12', '', NULL, '用户性别列表'); +INSERT INTO `sys_dict_type` VALUES (2, '菜单状态', 'sys_show_hide', '0', 'admin', '2024-03-31 01:19:12', '', NULL, '菜单状态列表'); +INSERT INTO `sys_dict_type` VALUES (3, '系统开关', 'sys_normal_disable', '0', 'admin', '2024-03-31 01:19:12', '', NULL, '系统开关列表'); +INSERT INTO `sys_dict_type` VALUES (4, '任务状态', 'sys_job_status', '0', 'admin', '2024-03-31 01:19:12', '', NULL, '任务状态列表'); +INSERT INTO `sys_dict_type` VALUES (5, '任务分组', 'sys_job_group', '0', 'admin', '2024-03-31 01:19:12', '', NULL, '任务分组列表'); +INSERT INTO `sys_dict_type` VALUES (6, '系统是否', 'sys_yes_no', '0', 'admin', '2024-03-31 01:19:12', '', NULL, '系统是否列表'); +INSERT INTO `sys_dict_type` VALUES (7, '通知类型', 'sys_notice_type', '0', 'admin', '2024-03-31 01:19:12', '', NULL, '通知类型列表'); +INSERT INTO `sys_dict_type` VALUES (8, '通知状态', 'sys_notice_status', '0', 'admin', '2024-03-31 01:19:12', '', NULL, '通知状态列表'); +INSERT INTO `sys_dict_type` VALUES (9, '操作类型', 'sys_oper_type', '0', 'admin', '2024-03-31 01:19:12', '', NULL, '操作类型列表'); +INSERT INTO `sys_dict_type` VALUES (10, '系统状态', 'sys_common_status', '0', 'admin', '2024-03-31 01:19:12', '', NULL, '登录状态列表'); +INSERT INTO `sys_dict_type` VALUES (100, '组件类型', 'comp_type', '0', 'admin', '2024-03-31 14:24:08', '', NULL, NULL); +INSERT INTO `sys_dict_type` VALUES (101, '是否开放', 'open', '0', 'admin', '2024-03-31 14:36:25', '', NULL, NULL); + +-- ---------------------------- +-- Table structure for sys_job +-- ---------------------------- +DROP TABLE IF EXISTS `sys_job`; +CREATE TABLE `sys_job` ( + `job_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '任务ID', + `job_name` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '任务名称', + `job_group` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'DEFAULT' COMMENT '任务组名', + `invoke_target` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '调用目标字符串', + `cron_expression` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT 'cron执行表达式', + `misfire_policy` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '3' COMMENT '计划执行错误策略(1立即执行 2执行一次 3放弃执行)', + `concurrent` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '1' COMMENT '是否并发执行(0允许 1禁止)', + `status` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '0' COMMENT '状态(0正常 1暂停)', + `create_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '创建者', + `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `update_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '更新者', + `update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + `remark` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '备注信息', + PRIMARY KEY (`job_id`, `job_name`, `job_group`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '定时任务调度表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of sys_job +-- ---------------------------- +INSERT INTO `sys_job` VALUES (1, '系统默认(无参)', 'DEFAULT', 'ryTask.ryNoParams', '0/10 * * * * ?', '3', '1', '1', 'admin', '2024-03-31 01:19:12', '', NULL, ''); +INSERT INTO `sys_job` VALUES (2, '系统默认(有参)', 'DEFAULT', 'ryTask.ryParams(\'ry\')', '0/15 * * * * ?', '3', '1', '1', 'admin', '2024-03-31 01:19:12', '', NULL, ''); +INSERT INTO `sys_job` VALUES (3, '系统默认(多参)', 'DEFAULT', 'ryTask.ryMultipleParams(\'ry\', true, 2000L, 316.50D, 100)', '0/20 * * * * ?', '3', '1', '1', 'admin', '2024-03-31 01:19:12', '', NULL, ''); + +-- ---------------------------- +-- Table structure for sys_job_log +-- ---------------------------- +DROP TABLE IF EXISTS `sys_job_log`; +CREATE TABLE `sys_job_log` ( + `job_log_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '任务日志ID', + `job_name` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '任务名称', + `job_group` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '任务组名', + `invoke_target` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '调用目标字符串', + `job_message` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '日志信息', + `status` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '0' COMMENT '执行状态(0正常 1失败)', + `exception_info` varchar(2000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '异常信息', + `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + PRIMARY KEY (`job_log_id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '定时任务调度日志表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of sys_job_log +-- ---------------------------- + +-- ---------------------------- +-- Table structure for sys_logininfor +-- ---------------------------- +DROP TABLE IF EXISTS `sys_logininfor`; +CREATE TABLE `sys_logininfor` ( + `info_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '访问ID', + `user_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '用户账号', + `ipaddr` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '登录IP地址', + `login_location` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '登录地点', + `browser` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '浏览器类型', + `os` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '操作系统', + `status` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '0' COMMENT '登录状态(0成功 1失败)', + `msg` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '提示消息', + `login_time` datetime(0) NULL DEFAULT NULL COMMENT '访问时间', + PRIMARY KEY (`info_id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 124 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '系统访问记录' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of sys_logininfor +-- ---------------------------- +INSERT INTO `sys_logininfor` VALUES (100, 'admin', '127.0.0.1', '内网IP', 'Firefox 11', 'Windows 10', '0', '登录成功', '2024-03-31 01:53:30'); +INSERT INTO `sys_logininfor` VALUES (101, 'admin', '127.0.0.1', '内网IP', 'Firefox 11', 'Windows 10', '0', '退出成功', '2024-03-31 01:58:17'); +INSERT INTO `sys_logininfor` VALUES (102, 'admin', '127.0.0.1', '内网IP', 'Firefox 11', 'Windows 10', '0', '登录成功', '2024-03-31 02:03:26'); +INSERT INTO `sys_logininfor` VALUES (103, 'admin', '127.0.0.1', '内网IP', 'Firefox 11', 'Windows 10', '0', '退出成功', '2024-03-31 02:03:45'); +INSERT INTO `sys_logininfor` VALUES (104, 'admin', '127.0.0.1', '内网IP', 'Firefox 11', 'Windows 10', '0', '登录成功', '2024-03-31 02:05:01'); +INSERT INTO `sys_logininfor` VALUES (105, 'admin', '127.0.0.1', '内网IP', 'Firefox 11', 'Windows 10', '0', '登录成功', '2024-03-31 03:13:27'); +INSERT INTO `sys_logininfor` VALUES (106, 'admin', '127.0.0.1', '内网IP', 'Firefox 11', 'Windows 10', '0', '登录成功', '2024-03-31 13:33:57'); +INSERT INTO `sys_logininfor` VALUES (107, 'admin', '127.0.0.1', '内网IP', 'Firefox 11', 'Windows 10', '0', '退出成功', '2024-03-31 14:57:00'); +INSERT INTO `sys_logininfor` VALUES (108, 'admin', '127.0.0.1', '内网IP', 'Firefox 11', 'Windows 10', '0', '登录成功', '2024-03-31 14:57:10'); +INSERT INTO `sys_logininfor` VALUES (109, 'admin', '127.0.0.1', '内网IP', 'Firefox 11', 'Windows 10', '0', '登录成功', '2024-03-31 18:08:39'); +INSERT INTO `sys_logininfor` VALUES (110, 'admin', '127.0.0.1', '内网IP', 'Firefox 11', 'Windows 10', '0', '登录成功', '2024-03-31 19:09:32'); +INSERT INTO `sys_logininfor` VALUES (111, 'admin', '127.0.0.1', '内网IP', 'Firefox 11', 'Windows 10', '0', '登录成功', '2024-03-31 21:05:07'); +INSERT INTO `sys_logininfor` VALUES (112, 'admin', '127.0.0.1', '内网IP', 'Firefox 11', 'Windows 10', '0', '退出成功', '2024-03-31 22:05:44'); +INSERT INTO `sys_logininfor` VALUES (113, 'test1', '127.0.0.1', '内网IP', 'Firefox 11', 'Windows 10', '0', '登录成功', '2024-03-31 22:05:55'); +INSERT INTO `sys_logininfor` VALUES (114, 'test1', '127.0.0.1', '内网IP', 'Firefox 11', 'Windows 10', '0', '退出成功', '2024-03-31 22:06:01'); +INSERT INTO `sys_logininfor` VALUES (115, 'admin', '127.0.0.1', '内网IP', 'Firefox 11', 'Windows 10', '0', '登录成功', '2024-03-31 22:06:28'); +INSERT INTO `sys_logininfor` VALUES (116, 'admin', '127.0.0.1', '内网IP', 'Firefox 11', 'Windows 10', '0', '退出成功', '2024-03-31 22:07:41'); +INSERT INTO `sys_logininfor` VALUES (117, 'test1', '127.0.0.1', '内网IP', 'Firefox 11', 'Windows 10', '0', '登录成功', '2024-03-31 22:07:54'); +INSERT INTO `sys_logininfor` VALUES (118, 'test1', '127.0.0.1', '内网IP', 'Firefox 11', 'Windows 10', '0', '退出成功', '2024-03-31 22:21:15'); +INSERT INTO `sys_logininfor` VALUES (119, 'admin', '127.0.0.1', '内网IP', 'Firefox 11', 'Windows 10', '0', '登录成功', '2024-03-31 22:21:21'); +INSERT INTO `sys_logininfor` VALUES (120, 'admin', '127.0.0.1', '内网IP', 'Firefox 11', 'Windows 10', '0', '退出成功', '2024-03-31 22:28:30'); +INSERT INTO `sys_logininfor` VALUES (121, 'admin', '127.0.0.1', '内网IP', 'Firefox 11', 'Windows 10', '0', '登录成功', '2024-03-31 22:28:46'); +INSERT INTO `sys_logininfor` VALUES (122, 'admin', '127.0.0.1', '内网IP', 'Firefox 11', 'Windows 10', '0', '退出成功', '2024-03-31 22:35:17'); +INSERT INTO `sys_logininfor` VALUES (123, 'test1', '127.0.0.1', '内网IP', 'Firefox 11', 'Windows 10', '0', '登录成功', '2024-03-31 22:35:35'); + +-- ---------------------------- +-- Table structure for sys_menu +-- ---------------------------- +DROP TABLE IF EXISTS `sys_menu`; +CREATE TABLE `sys_menu` ( + `menu_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '菜单ID', + `menu_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '菜单名称', + `parent_id` bigint(20) NULL DEFAULT 0 COMMENT '父菜单ID', + `order_num` int(4) NULL DEFAULT 0 COMMENT '显示顺序', + `path` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '路由地址', + `component` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '组件路径', + `query` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '路由参数', + `is_frame` int(1) NULL DEFAULT 1 COMMENT '是否为外链(0是 1否)', + `is_cache` int(1) NULL DEFAULT 0 COMMENT '是否缓存(0缓存 1不缓存)', + `menu_type` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '菜单类型(M目录 C菜单 F按钮)', + `visible` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '0' COMMENT '菜单状态(0显示 1隐藏)', + `status` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '0' COMMENT '菜单状态(0正常 1停用)', + `perms` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '权限标识', + `icon` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '#' COMMENT '菜单图标', + `create_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '创建者', + `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `update_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '更新者', + `update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + `remark` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '备注', + PRIMARY KEY (`menu_id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 2030 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '菜单权限表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of sys_menu +-- ---------------------------- +INSERT INTO `sys_menu` VALUES (1, '系统管理', 0, 1, 'system', NULL, '', 1, 0, 'M', '0', '0', '', 'system', 'admin', '2024-03-31 01:19:09', '', NULL, '系统管理目录'); +INSERT INTO `sys_menu` VALUES (2, '系统监控', 0, 2, 'monitor', NULL, '', 1, 0, 'M', '0', '0', '', 'monitor', 'admin', '2024-03-31 01:19:09', '', NULL, '系统监控目录'); +INSERT INTO `sys_menu` VALUES (3, '系统工具', 0, 3, 'tool', NULL, '', 1, 0, 'M', '0', '0', '', 'tool', 'admin', '2024-03-31 01:19:09', '', NULL, '系统工具目录'); +INSERT INTO `sys_menu` VALUES (100, '用户管理', 1, 1, 'user', 'system/user/index', '', 1, 0, 'C', '0', '0', 'system:user:list', 'user', 'admin', '2024-03-31 01:19:09', '', NULL, '用户管理菜单'); +INSERT INTO `sys_menu` VALUES (101, '角色管理', 1, 2, 'role', 'system/role/index', '', 1, 0, 'C', '0', '0', 'system:role:list', 'peoples', 'admin', '2024-03-31 01:19:09', '', NULL, '角色管理菜单'); +INSERT INTO `sys_menu` VALUES (102, '菜单管理', 1, 3, 'menu', 'system/menu/index', '', 1, 0, 'C', '0', '0', 'system:menu:list', 'tree-table', 'admin', '2024-03-31 01:19:09', '', NULL, '菜单管理菜单'); +INSERT INTO `sys_menu` VALUES (103, '部门管理', 1, 4, 'dept', 'system/dept/index', '', 1, 0, 'C', '0', '0', 'system:dept:list', 'tree', 'admin', '2024-03-31 01:19:09', '', NULL, '部门管理菜单'); +INSERT INTO `sys_menu` VALUES (104, '岗位管理', 1, 5, 'post', 'system/post/index', '', 1, 0, 'C', '0', '0', 'system:post:list', 'post', 'admin', '2024-03-31 01:19:09', '', NULL, '岗位管理菜单'); +INSERT INTO `sys_menu` VALUES (105, '字典管理', 1, 6, 'dict', 'system/dict/index', '', 1, 0, 'C', '0', '0', 'system:dict:list', 'dict', 'admin', '2024-03-31 01:19:09', '', NULL, '字典管理菜单'); +INSERT INTO `sys_menu` VALUES (106, '参数设置', 1, 7, 'config', 'system/config/index', '', 1, 0, 'C', '0', '0', 'system:config:list', 'edit', 'admin', '2024-03-31 01:19:09', '', NULL, '参数设置菜单'); +INSERT INTO `sys_menu` VALUES (107, '通知公告', 1, 8, 'notice', 'system/notice/index', '', 1, 0, 'C', '0', '0', 'system:notice:list', 'message', 'admin', '2024-03-31 01:19:09', '', NULL, '通知公告菜单'); +INSERT INTO `sys_menu` VALUES (108, '日志管理', 1, 9, 'log', '', '', 1, 0, 'M', '0', '0', '', 'log', 'admin', '2024-03-31 01:19:09', '', NULL, '日志管理菜单'); +INSERT INTO `sys_menu` VALUES (109, '在线用户', 2, 1, 'online', 'monitor/online/index', '', 1, 0, 'C', '0', '0', 'monitor:online:list', 'online', 'admin', '2024-03-31 01:19:09', '', NULL, '在线用户菜单'); +INSERT INTO `sys_menu` VALUES (110, '定时任务', 2, 2, 'job', 'monitor/job/index', '', 1, 0, 'C', '0', '0', 'monitor:job:list', 'job', 'admin', '2024-03-31 01:19:09', '', NULL, '定时任务菜单'); +INSERT INTO `sys_menu` VALUES (111, '数据监控', 2, 3, 'druid', 'monitor/druid/index', '', 1, 0, 'C', '0', '0', 'monitor:druid:list', 'druid', 'admin', '2024-03-31 01:19:09', '', NULL, '数据监控菜单'); +INSERT INTO `sys_menu` VALUES (112, '服务监控', 2, 4, 'server', 'monitor/server/index', '', 1, 0, 'C', '0', '0', 'monitor:server:list', 'server', 'admin', '2024-03-31 01:19:09', '', NULL, '服务监控菜单'); +INSERT INTO `sys_menu` VALUES (113, '缓存监控', 2, 5, 'cache', 'monitor/cache/index', '', 1, 0, 'C', '0', '0', 'monitor:cache:list', 'redis', 'admin', '2024-03-31 01:19:09', '', NULL, '缓存监控菜单'); +INSERT INTO `sys_menu` VALUES (114, '缓存列表', 2, 6, 'cacheList', 'monitor/cache/list', '', 1, 0, 'C', '0', '0', 'monitor:cache:list', 'redis-list', 'admin', '2024-03-31 01:19:09', '', NULL, '缓存列表菜单'); +INSERT INTO `sys_menu` VALUES (115, '表单构建', 3, 1, 'build', 'tool/build/index', '', 1, 0, 'C', '0', '0', 'tool:build:list', 'build', 'admin', '2024-03-31 01:19:09', '', NULL, '表单构建菜单'); +INSERT INTO `sys_menu` VALUES (116, '代码生成', 3, 2, 'gen', 'tool/gen/index', '', 1, 0, 'C', '0', '0', 'tool:gen:list', 'code', 'admin', '2024-03-31 01:19:09', '', NULL, '代码生成菜单'); +INSERT INTO `sys_menu` VALUES (117, '系统接口', 3, 3, 'swagger', 'tool/swagger/index', '', 1, 0, 'C', '0', '0', 'tool:swagger:list', 'swagger', 'admin', '2024-03-31 01:19:09', '', NULL, '系统接口菜单'); +INSERT INTO `sys_menu` VALUES (500, '操作日志', 108, 1, 'operlog', 'monitor/operlog/index', '', 1, 0, 'C', '0', '0', 'monitor:operlog:list', 'form', 'admin', '2024-03-31 01:19:09', '', NULL, '操作日志菜单'); +INSERT INTO `sys_menu` VALUES (501, '登录日志', 108, 2, 'logininfor', 'monitor/logininfor/index', '', 1, 0, 'C', '0', '0', 'monitor:logininfor:list', 'logininfor', 'admin', '2024-03-31 01:19:09', '', NULL, '登录日志菜单'); +INSERT INTO `sys_menu` VALUES (1000, '用户查询', 100, 1, '', '', '', 1, 0, 'F', '0', '0', 'system:user:query', '#', 'admin', '2024-03-31 01:19:09', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1001, '用户新增', 100, 2, '', '', '', 1, 0, 'F', '0', '0', 'system:user:add', '#', 'admin', '2024-03-31 01:19:09', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1002, '用户修改', 100, 3, '', '', '', 1, 0, 'F', '0', '0', 'system:user:edit', '#', 'admin', '2024-03-31 01:19:09', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1003, '用户删除', 100, 4, '', '', '', 1, 0, 'F', '0', '0', 'system:user:remove', '#', 'admin', '2024-03-31 01:19:09', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1004, '用户导出', 100, 5, '', '', '', 1, 0, 'F', '0', '0', 'system:user:export', '#', 'admin', '2024-03-31 01:19:09', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1005, '用户导入', 100, 6, '', '', '', 1, 0, 'F', '0', '0', 'system:user:import', '#', 'admin', '2024-03-31 01:19:09', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1006, '重置密码', 100, 7, '', '', '', 1, 0, 'F', '0', '0', 'system:user:resetPwd', '#', 'admin', '2024-03-31 01:19:09', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1007, '角色查询', 101, 1, '', '', '', 1, 0, 'F', '0', '0', 'system:role:query', '#', 'admin', '2024-03-31 01:19:09', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1008, '角色新增', 101, 2, '', '', '', 1, 0, 'F', '0', '0', 'system:role:add', '#', 'admin', '2024-03-31 01:19:09', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1009, '角色修改', 101, 3, '', '', '', 1, 0, 'F', '0', '0', 'system:role:edit', '#', 'admin', '2024-03-31 01:19:09', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1010, '角色删除', 101, 4, '', '', '', 1, 0, 'F', '0', '0', 'system:role:remove', '#', 'admin', '2024-03-31 01:19:09', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1011, '角色导出', 101, 5, '', '', '', 1, 0, 'F', '0', '0', 'system:role:export', '#', 'admin', '2024-03-31 01:19:09', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1012, '菜单查询', 102, 1, '', '', '', 1, 0, 'F', '0', '0', 'system:menu:query', '#', 'admin', '2024-03-31 01:19:09', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1013, '菜单新增', 102, 2, '', '', '', 1, 0, 'F', '0', '0', 'system:menu:add', '#', 'admin', '2024-03-31 01:19:09', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1014, '菜单修改', 102, 3, '', '', '', 1, 0, 'F', '0', '0', 'system:menu:edit', '#', 'admin', '2024-03-31 01:19:09', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1015, '菜单删除', 102, 4, '', '', '', 1, 0, 'F', '0', '0', 'system:menu:remove', '#', 'admin', '2024-03-31 01:19:09', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1016, '部门查询', 103, 1, '', '', '', 1, 0, 'F', '0', '0', 'system:dept:query', '#', 'admin', '2024-03-31 01:19:09', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1017, '部门新增', 103, 2, '', '', '', 1, 0, 'F', '0', '0', 'system:dept:add', '#', 'admin', '2024-03-31 01:19:09', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1018, '部门修改', 103, 3, '', '', '', 1, 0, 'F', '0', '0', 'system:dept:edit', '#', 'admin', '2024-03-31 01:19:09', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1019, '部门删除', 103, 4, '', '', '', 1, 0, 'F', '0', '0', 'system:dept:remove', '#', 'admin', '2024-03-31 01:19:09', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1020, '岗位查询', 104, 1, '', '', '', 1, 0, 'F', '0', '0', 'system:post:query', '#', 'admin', '2024-03-31 01:19:09', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1021, '岗位新增', 104, 2, '', '', '', 1, 0, 'F', '0', '0', 'system:post:add', '#', 'admin', '2024-03-31 01:19:09', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1022, '岗位修改', 104, 3, '', '', '', 1, 0, 'F', '0', '0', 'system:post:edit', '#', 'admin', '2024-03-31 01:19:09', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1023, '岗位删除', 104, 4, '', '', '', 1, 0, 'F', '0', '0', 'system:post:remove', '#', 'admin', '2024-03-31 01:19:09', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1024, '岗位导出', 104, 5, '', '', '', 1, 0, 'F', '0', '0', 'system:post:export', '#', 'admin', '2024-03-31 01:19:09', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1025, '字典查询', 105, 1, '#', '', '', 1, 0, 'F', '0', '0', 'system:dict:query', '#', 'admin', '2024-03-31 01:19:09', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1026, '字典新增', 105, 2, '#', '', '', 1, 0, 'F', '0', '0', 'system:dict:add', '#', 'admin', '2024-03-31 01:19:09', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1027, '字典修改', 105, 3, '#', '', '', 1, 0, 'F', '0', '0', 'system:dict:edit', '#', 'admin', '2024-03-31 01:19:09', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1028, '字典删除', 105, 4, '#', '', '', 1, 0, 'F', '0', '0', 'system:dict:remove', '#', 'admin', '2024-03-31 01:19:09', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1029, '字典导出', 105, 5, '#', '', '', 1, 0, 'F', '0', '0', 'system:dict:export', '#', 'admin', '2024-03-31 01:19:09', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1030, '参数查询', 106, 1, '#', '', '', 1, 0, 'F', '0', '0', 'system:config:query', '#', 'admin', '2024-03-31 01:19:09', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1031, '参数新增', 106, 2, '#', '', '', 1, 0, 'F', '0', '0', 'system:config:add', '#', 'admin', '2024-03-31 01:19:09', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1032, '参数修改', 106, 3, '#', '', '', 1, 0, 'F', '0', '0', 'system:config:edit', '#', 'admin', '2024-03-31 01:19:09', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1033, '参数删除', 106, 4, '#', '', '', 1, 0, 'F', '0', '0', 'system:config:remove', '#', 'admin', '2024-03-31 01:19:09', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1034, '参数导出', 106, 5, '#', '', '', 1, 0, 'F', '0', '0', 'system:config:export', '#', 'admin', '2024-03-31 01:19:09', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1035, '公告查询', 107, 1, '#', '', '', 1, 0, 'F', '0', '0', 'system:notice:query', '#', 'admin', '2024-03-31 01:19:09', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1036, '公告新增', 107, 2, '#', '', '', 1, 0, 'F', '0', '0', 'system:notice:add', '#', 'admin', '2024-03-31 01:19:09', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1037, '公告修改', 107, 3, '#', '', '', 1, 0, 'F', '0', '0', 'system:notice:edit', '#', 'admin', '2024-03-31 01:19:09', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1038, '公告删除', 107, 4, '#', '', '', 1, 0, 'F', '0', '0', 'system:notice:remove', '#', 'admin', '2024-03-31 01:19:09', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1039, '操作查询', 500, 1, '#', '', '', 1, 0, 'F', '0', '0', 'monitor:operlog:query', '#', 'admin', '2024-03-31 01:19:09', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1040, '操作删除', 500, 2, '#', '', '', 1, 0, 'F', '0', '0', 'monitor:operlog:remove', '#', 'admin', '2024-03-31 01:19:09', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1041, '日志导出', 500, 3, '#', '', '', 1, 0, 'F', '0', '0', 'monitor:operlog:export', '#', 'admin', '2024-03-31 01:19:09', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1042, '登录查询', 501, 1, '#', '', '', 1, 0, 'F', '0', '0', 'monitor:logininfor:query', '#', 'admin', '2024-03-31 01:19:09', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1043, '登录删除', 501, 2, '#', '', '', 1, 0, 'F', '0', '0', 'monitor:logininfor:remove', '#', 'admin', '2024-03-31 01:19:09', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1044, '日志导出', 501, 3, '#', '', '', 1, 0, 'F', '0', '0', 'monitor:logininfor:export', '#', 'admin', '2024-03-31 01:19:09', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1045, '账户解锁', 501, 4, '#', '', '', 1, 0, 'F', '0', '0', 'monitor:logininfor:unlock', '#', 'admin', '2024-03-31 01:19:09', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1046, '在线查询', 109, 1, '#', '', '', 1, 0, 'F', '0', '0', 'monitor:online:query', '#', 'admin', '2024-03-31 01:19:09', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1047, '批量强退', 109, 2, '#', '', '', 1, 0, 'F', '0', '0', 'monitor:online:batchLogout', '#', 'admin', '2024-03-31 01:19:09', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1048, '单条强退', 109, 3, '#', '', '', 1, 0, 'F', '0', '0', 'monitor:online:forceLogout', '#', 'admin', '2024-03-31 01:19:09', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1049, '任务查询', 110, 1, '#', '', '', 1, 0, 'F', '0', '0', 'monitor:job:query', '#', 'admin', '2024-03-31 01:19:09', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1050, '任务新增', 110, 2, '#', '', '', 1, 0, 'F', '0', '0', 'monitor:job:add', '#', 'admin', '2024-03-31 01:19:09', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1051, '任务修改', 110, 3, '#', '', '', 1, 0, 'F', '0', '0', 'monitor:job:edit', '#', 'admin', '2024-03-31 01:19:09', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1052, '任务删除', 110, 4, '#', '', '', 1, 0, 'F', '0', '0', 'monitor:job:remove', '#', 'admin', '2024-03-31 01:19:09', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1053, '状态修改', 110, 5, '#', '', '', 1, 0, 'F', '0', '0', 'monitor:job:changeStatus', '#', 'admin', '2024-03-31 01:19:09', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1054, '任务导出', 110, 6, '#', '', '', 1, 0, 'F', '0', '0', 'monitor:job:export', '#', 'admin', '2024-03-31 01:19:09', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1055, '生成查询', 116, 1, '#', '', '', 1, 0, 'F', '0', '0', 'tool:gen:query', '#', 'admin', '2024-03-31 01:19:09', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1056, '生成修改', 116, 2, '#', '', '', 1, 0, 'F', '0', '0', 'tool:gen:edit', '#', 'admin', '2024-03-31 01:19:09', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1057, '生成删除', 116, 3, '#', '', '', 1, 0, 'F', '0', '0', 'tool:gen:remove', '#', 'admin', '2024-03-31 01:19:09', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1058, '导入代码', 116, 4, '#', '', '', 1, 0, 'F', '0', '0', 'tool:gen:import', '#', 'admin', '2024-03-31 01:19:09', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1059, '预览代码', 116, 5, '#', '', '', 1, 0, 'F', '0', '0', 'tool:gen:preview', '#', 'admin', '2024-03-31 01:19:09', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1060, '生成代码', 116, 6, '#', '', '', 1, 0, 'F', '0', '0', 'tool:gen:code', '#', 'admin', '2024-03-31 01:19:09', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (2000, '问卷调查', 0, 0, 'questionnaire', NULL, NULL, 1, 0, 'M', '0', '0', NULL, 'checkbox', 'admin', '2024-03-31 03:15:46', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (2007, '模版管理', 2000, 1, 'template', 'business/template/index', NULL, 1, 1, 'C', '0', '0', 'business:template:list', '#', 'admin', '2024-03-31 14:39:33', 'admin', '2024-03-31 22:33:50', '模版管理菜单'); +INSERT INTO `sys_menu` VALUES (2008, '模版管理查询', 2007, 1, '#', '', NULL, 1, 0, 'F', '0', '0', 'business:template:query', '#', 'admin', '2024-03-31 14:39:33', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (2009, '模版管理新增', 2007, 2, '#', '', NULL, 1, 0, 'F', '0', '0', 'business:template:add', '#', 'admin', '2024-03-31 14:39:33', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (2010, '模版管理修改', 2007, 3, '#', '', NULL, 1, 0, 'F', '0', '0', 'business:template:edit', '#', 'admin', '2024-03-31 14:39:33', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (2011, '模版管理删除', 2007, 4, '#', '', NULL, 1, 0, 'F', '0', '0', 'business:template:remove', '#', 'admin', '2024-03-31 14:39:33', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (2012, '模版管理导出', 2007, 5, '#', '', NULL, 1, 0, 'F', '0', '0', 'business:template:export', '#', 'admin', '2024-03-31 14:39:33', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (2013, '模版属性', 2000, 1, 'templateProp', 'business/templateProp/index', NULL, 1, 1, 'C', '0', '0', 'business:templateProp:list', '#', 'admin', '2024-03-31 14:39:41', 'admin', '2024-03-31 22:33:54', '模版属性菜单'); +INSERT INTO `sys_menu` VALUES (2014, '模版属性查询', 2013, 1, '#', '', NULL, 1, 0, 'F', '0', '0', 'business:templateProp:query', '#', 'admin', '2024-03-31 14:39:41', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (2015, '模版属性新增', 2013, 2, '#', '', NULL, 1, 0, 'F', '0', '0', 'business:templateProp:add', '#', 'admin', '2024-03-31 14:39:41', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (2016, '模版属性修改', 2013, 3, '#', '', NULL, 1, 0, 'F', '0', '0', 'business:templateProp:edit', '#', 'admin', '2024-03-31 14:39:41', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (2017, '模版属性删除', 2013, 4, '#', '', NULL, 1, 0, 'F', '0', '0', 'business:templateProp:remove', '#', 'admin', '2024-03-31 14:39:41', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (2018, '模版属性导出', 2013, 5, '#', '', NULL, 1, 0, 'F', '0', '0', 'business:templateProp:export', '#', 'admin', '2024-03-31 14:39:41', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (2021, '问卷调查', 2000, 1, 'survey', 'business/survey/index', NULL, 1, 1, 'C', '0', '0', 'business:template:list', '#', 'admin', '2024-03-31 15:00:21', 'admin', '2024-03-31 22:33:58', '问卷调查菜单'); +INSERT INTO `sys_menu` VALUES (2022, '填写问卷', 2000, 1, 'surveySubmit', 'business/surveySubmit/index', '', 1, 1, 'C', '1', '0', 'business:template:list', '#', 'admin', '2024-03-31 15:04:24', 'admin', '2024-03-31 22:34:03', '填写问卷'); +INSERT INTO `sys_menu` VALUES (2029, '问卷统计', 2000, 1, 'countGroup', 'business/countGroup/index', '', 1, 1, 'C', '1', '0', 'business:countGroup:list', '#', 'admin', '2024-03-31 15:04:24', 'admin', '2024-03-31 22:34:07', '问卷统计'); + +-- ---------------------------- +-- Table structure for sys_notice +-- ---------------------------- +DROP TABLE IF EXISTS `sys_notice`; +CREATE TABLE `sys_notice` ( + `notice_id` int(4) NOT NULL AUTO_INCREMENT COMMENT '公告ID', + `notice_title` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '公告标题', + `notice_type` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '公告类型(1通知 2公告)', + `notice_content` longblob NULL COMMENT '公告内容', + `status` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '0' COMMENT '公告状态(0正常 1关闭)', + `create_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '创建者', + `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `update_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '更新者', + `update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + `remark` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`notice_id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '通知公告表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of sys_notice +-- ---------------------------- +INSERT INTO `sys_notice` VALUES (1, '温馨提醒:2018-07-01 若依新版本发布啦', '2', 0xE696B0E78988E69CACE58685E5AEB9, '0', 'admin', '2024-03-31 01:19:12', '', NULL, '管理员'); +INSERT INTO `sys_notice` VALUES (2, '维护通知:2018-07-01 若依系统凌晨维护', '1', 0xE7BBB4E68AA4E58685E5AEB9, '0', 'admin', '2024-03-31 01:19:12', '', NULL, '管理员'); + +-- ---------------------------- +-- Table structure for sys_oper_log +-- ---------------------------- +DROP TABLE IF EXISTS `sys_oper_log`; +CREATE TABLE `sys_oper_log` ( + `oper_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '日志主键', + `title` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '模块标题', + `business_type` int(2) NULL DEFAULT 0 COMMENT '业务类型(0其它 1新增 2修改 3删除)', + `method` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '方法名称', + `request_method` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '请求方式', + `operator_type` int(1) NULL DEFAULT 0 COMMENT '操作类别(0其它 1后台用户 2手机端用户)', + `oper_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '操作人员', + `dept_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '部门名称', + `oper_url` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '请求URL', + `oper_ip` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '主机地址', + `oper_location` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '操作地点', + `oper_param` varchar(2000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '请求参数', + `json_result` varchar(2000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '返回参数', + `status` int(1) NULL DEFAULT 0 COMMENT '操作状态(0正常 1异常)', + `error_msg` varchar(2000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '错误消息', + `oper_time` datetime(0) NULL DEFAULT NULL COMMENT '操作时间', + PRIMARY KEY (`oper_id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 220 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '操作日志记录' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of sys_oper_log +-- ---------------------------- +INSERT INTO `sys_oper_log` VALUES (100, '参数管理', 2, 'com.ruoyi.web.controller.system.SysConfigController.edit()', 'PUT', 1, 'admin', NULL, '/system/config', '127.0.0.1', '内网IP', '{\"configId\":5,\"configKey\":\"sys.account.registerUser\",\"configName\":\"账号自助-是否开启用户注册功能\",\"configType\":\"Y\",\"configValue\":\"true\",\"createBy\":\"admin\",\"createTime\":\"2024-03-31 01:19:12\",\"params\":{},\"remark\":\"是否开启注册用户功能(true开启,false关闭)\",\"updateBy\":\"admin\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2024-03-31 02:03:41'); +INSERT INTO `sys_oper_log` VALUES (101, '代码生成', 6, 'com.ruoyi.generator.controller.GenController.importTableSave()', 'POST', 1, 'admin', NULL, '/tool/gen/importTable', '127.0.0.1', '内网IP', '\"business_template\"', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2024-03-31 03:13:37'); +INSERT INTO `sys_oper_log` VALUES (102, '菜单管理', 1, 'com.ruoyi.web.controller.system.SysMenuController.add()', 'POST', 1, 'admin', NULL, '/system/menu', '127.0.0.1', '内网IP', '{\"children\":[],\"createBy\":\"admin\",\"icon\":\"checkbox\",\"isCache\":\"0\",\"isFrame\":\"1\",\"menuName\":\"问卷调查\",\"menuType\":\"M\",\"orderNum\":0,\"params\":{},\"parentId\":0,\"path\":\"questionnaire\",\"status\":\"0\",\"visible\":\"0\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2024-03-31 03:15:46'); +INSERT INTO `sys_oper_log` VALUES (103, '代码生成', 2, 'com.ruoyi.generator.controller.GenController.editSave()', 'PUT', 1, 'admin', NULL, '/tool/gen', '127.0.0.1', '内网IP', '{\"businessName\":\"template\",\"className\":\"BusinessTemplate\",\"columns\":[{\"capJavaField\":\"Id\",\"columnComment\":\"主键\",\"columnId\":1,\"columnName\":\"id\",\"columnType\":\"bigint(20)\",\"createBy\":\"admin\",\"createTime\":\"2024-03-31 03:13:37\",\"dictType\":\"\",\"edit\":false,\"htmlType\":\"input\",\"increment\":true,\"insert\":true,\"isIncrement\":\"1\",\"isInsert\":\"1\",\"isPk\":\"1\",\"javaField\":\"id\",\"javaType\":\"Long\",\"list\":false,\"params\":{},\"pk\":true,\"query\":false,\"queryType\":\"EQ\",\"required\":false,\"sort\":1,\"superColumn\":false,\"tableId\":1,\"updateBy\":\"\",\"usableColumn\":false},{\"capJavaField\":\"Title\",\"columnComment\":\"标题\",\"columnId\":2,\"columnName\":\"title\",\"columnType\":\"varchar(100)\",\"createBy\":\"admin\",\"createTime\":\"2024-03-31 03:13:37\",\"dictType\":\"\",\"edit\":true,\"htmlType\":\"input\",\"increment\":false,\"insert\":true,\"isEdit\":\"1\",\"isIncrement\":\"0\",\"isInsert\":\"1\",\"isList\":\"1\",\"isPk\":\"0\",\"isQuery\":\"1\",\"javaField\":\"title\",\"javaType\":\"String\",\"list\":true,\"params\":{},\"pk\":false,\"query\":true,\"queryType\":\"EQ\",\"required\":false,\"sort\":2,\"superColumn\":false,\"tableId\":1,\"updateBy\":\"\",\"usableColumn\":false},{\"capJavaField\":\"Context\",\"columnComment\":\"内容\",\"columnId\":3,\"columnName\":\"context\",\"columnType\":\"varchar(100)\",\"createBy\":\"admin\",\"createTime\":\"2024-03-31 03:13:37\",\"dictType\":\"\",\"edit\":true,\"htmlType\":\"input\",\"increment\":false,\"insert\":true,\"isEdit\":\"1\",\"isIncrement\":\"0\",\"isInsert\":\"1\",\"isList\":\"1\",\"isPk\":\"0\",\"isQuery\":\"1\",\"javaField\":\"context\",\"javaType\":\"String\",\"list\":true,\"params\":{},\"pk\":false,\"query\":true,\"queryType\":\"EQ\",\"required\":false,\"sort\":3,\"superColumn\":false,\"tableId\":1,\"updateBy\":\"\",\"usableColumn\":false},{\"capJavaField\":\"TempValue\",\"columnComment\":\"模版值\",\"columnId\":4,\"columnName\":\"temp_value\",\"columnType\":\"text\",\"createBy\":\"admin\",\"createTime\":\"2024-03-31 03:13:37\",\"dictType\":\"\",\"edit\":true,\"htmlType\":\"textarea\",\"increment\":false,\"insert\":true,\"isEdit\":\"1\",\"isIncrement\":\"0\",\"isInsert\":\"1\",\"isList\":\"1\",\"isPk\":\"0\",\"isQuery\":\"1\",\"javaField\":\"tempValue\",\"javaType\":\"String\",\"list\":true,\"params\":{},\"pk\":false,\"query\":', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2024-03-31 03:16:31'); +INSERT INTO `sys_oper_log` VALUES (104, '代码生成', 2, 'com.ruoyi.generator.controller.GenController.editSave()', 'PUT', 1, 'admin', NULL, '/tool/gen', '127.0.0.1', '内网IP', '{\"businessName\":\"template\",\"className\":\"BusinessTemplate\",\"columns\":[{\"capJavaField\":\"Id\",\"columnComment\":\"主键\",\"columnId\":1,\"columnName\":\"id\",\"columnType\":\"bigint(20)\",\"createBy\":\"admin\",\"createTime\":\"2024-03-31 03:13:37\",\"dictType\":\"\",\"edit\":false,\"htmlType\":\"input\",\"increment\":true,\"insert\":false,\"isIncrement\":\"1\",\"isInsert\":\"0\",\"isPk\":\"1\",\"javaField\":\"id\",\"javaType\":\"Long\",\"list\":false,\"params\":{},\"pk\":true,\"query\":false,\"queryType\":\"EQ\",\"required\":false,\"sort\":1,\"superColumn\":false,\"tableId\":1,\"updateBy\":\"\",\"updateTime\":\"2024-03-31 03:16:31\",\"usableColumn\":false},{\"capJavaField\":\"Title\",\"columnComment\":\"标题\",\"columnId\":2,\"columnName\":\"title\",\"columnType\":\"varchar(100)\",\"createBy\":\"admin\",\"createTime\":\"2024-03-31 03:13:37\",\"dictType\":\"\",\"edit\":true,\"htmlType\":\"input\",\"increment\":false,\"insert\":true,\"isEdit\":\"1\",\"isIncrement\":\"0\",\"isInsert\":\"1\",\"isList\":\"1\",\"isPk\":\"0\",\"isQuery\":\"1\",\"javaField\":\"title\",\"javaType\":\"String\",\"list\":true,\"params\":{},\"pk\":false,\"query\":true,\"queryType\":\"EQ\",\"required\":false,\"sort\":2,\"superColumn\":false,\"tableId\":1,\"updateBy\":\"\",\"updateTime\":\"2024-03-31 03:16:31\",\"usableColumn\":false},{\"capJavaField\":\"Context\",\"columnComment\":\"内容\",\"columnId\":3,\"columnName\":\"context\",\"columnType\":\"varchar(100)\",\"createBy\":\"admin\",\"createTime\":\"2024-03-31 03:13:37\",\"dictType\":\"\",\"edit\":true,\"htmlType\":\"input\",\"increment\":false,\"insert\":true,\"isEdit\":\"1\",\"isIncrement\":\"0\",\"isInsert\":\"1\",\"isList\":\"1\",\"isPk\":\"0\",\"isQuery\":\"1\",\"javaField\":\"context\",\"javaType\":\"String\",\"list\":true,\"params\":{},\"pk\":false,\"query\":true,\"queryType\":\"EQ\",\"required\":false,\"sort\":3,\"superColumn\":false,\"tableId\":1,\"updateBy\":\"\",\"updateTime\":\"2024-03-31 03:16:31\",\"usableColumn\":false},{\"capJavaField\":\"TempValue\",\"columnComment\":\"模版值\",\"columnId\":4,\"columnName\":\"temp_value\",\"columnType\":\"text\",\"createBy\":\"admin\",\"createTime\":\"2024-03-31 03:13:37\",\"dictType\":\"\",\"edit\":true,\"htmlType\":\"textarea\",\"increment\":false,\"insert\":true,\"isEdit\":\"1\",\"isIncrement\":\"0\",\"isInsert\":\"1\",\"isList\":\"1\",\"isPk\"', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2024-03-31 03:17:18'); +INSERT INTO `sys_oper_log` VALUES (105, '代码生成', 2, 'com.ruoyi.generator.controller.GenController.editSave()', 'PUT', 1, 'admin', NULL, '/tool/gen', '127.0.0.1', '内网IP', '{\"businessName\":\"template\",\"className\":\"BusinessTemplate\",\"columns\":[{\"capJavaField\":\"Id\",\"columnComment\":\"主键\",\"columnId\":1,\"columnName\":\"id\",\"columnType\":\"bigint(20)\",\"createBy\":\"admin\",\"createTime\":\"2024-03-31 03:13:37\",\"dictType\":\"\",\"edit\":false,\"htmlType\":\"input\",\"increment\":true,\"insert\":false,\"isIncrement\":\"1\",\"isInsert\":\"0\",\"isPk\":\"1\",\"javaField\":\"id\",\"javaType\":\"Long\",\"list\":false,\"params\":{},\"pk\":true,\"query\":false,\"queryType\":\"EQ\",\"required\":false,\"sort\":1,\"superColumn\":false,\"tableId\":1,\"updateBy\":\"\",\"updateTime\":\"2024-03-31 03:17:18\",\"usableColumn\":false},{\"capJavaField\":\"Title\",\"columnComment\":\"标题\",\"columnId\":2,\"columnName\":\"title\",\"columnType\":\"varchar(100)\",\"createBy\":\"admin\",\"createTime\":\"2024-03-31 03:13:37\",\"dictType\":\"\",\"edit\":true,\"htmlType\":\"input\",\"increment\":false,\"insert\":true,\"isEdit\":\"1\",\"isIncrement\":\"0\",\"isInsert\":\"1\",\"isList\":\"1\",\"isPk\":\"0\",\"isQuery\":\"1\",\"javaField\":\"title\",\"javaType\":\"String\",\"list\":true,\"params\":{},\"pk\":false,\"query\":true,\"queryType\":\"EQ\",\"required\":false,\"sort\":2,\"superColumn\":false,\"tableId\":1,\"updateBy\":\"\",\"updateTime\":\"2024-03-31 03:17:18\",\"usableColumn\":false},{\"capJavaField\":\"Context\",\"columnComment\":\"内容\",\"columnId\":3,\"columnName\":\"context\",\"columnType\":\"varchar(100)\",\"createBy\":\"admin\",\"createTime\":\"2024-03-31 03:13:37\",\"dictType\":\"\",\"edit\":true,\"htmlType\":\"input\",\"increment\":false,\"insert\":true,\"isEdit\":\"1\",\"isIncrement\":\"0\",\"isInsert\":\"1\",\"isList\":\"1\",\"isPk\":\"0\",\"isQuery\":\"1\",\"javaField\":\"context\",\"javaType\":\"String\",\"list\":true,\"params\":{},\"pk\":false,\"query\":true,\"queryType\":\"EQ\",\"required\":false,\"sort\":3,\"superColumn\":false,\"tableId\":1,\"updateBy\":\"\",\"updateTime\":\"2024-03-31 03:17:18\",\"usableColumn\":false},{\"capJavaField\":\"TempValue\",\"columnComment\":\"模版值\",\"columnId\":4,\"columnName\":\"temp_value\",\"columnType\":\"text\",\"createBy\":\"admin\",\"createTime\":\"2024-03-31 03:13:37\",\"dictType\":\"\",\"edit\":true,\"htmlType\":\"textarea\",\"increment\":false,\"insert\":true,\"isEdit\":\"1\",\"isIncrement\":\"0\",\"isInsert\":\"1\",\"isList\":\"1\",\"isPk\"', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2024-03-31 03:17:35'); +INSERT INTO `sys_oper_log` VALUES (106, '代码生成', 8, 'com.ruoyi.generator.controller.GenController.batchGenCode()', 'GET', 1, 'admin', NULL, '/tool/gen/batchGenCode', '127.0.0.1', '内网IP', '{\"tables\":\"business_template\"}', NULL, 0, NULL, '2024-03-31 03:34:27'); +INSERT INTO `sys_oper_log` VALUES (107, '模版管理', 1, 'com.ruoyi.business.controller.BusinessTemplateController.add()', 'POST', 1, 'admin', NULL, '/business/template', '127.0.0.1', '内网IP', '{\"params\":{}}', NULL, 1, 'Invalid bound statement (not found): com.ruoyi.business.mapper.BusinessTemplateMapper.insert', '2024-03-31 03:53:18'); +INSERT INTO `sys_oper_log` VALUES (108, '模版管理', 1, 'com.ruoyi.business.controller.BusinessTemplateController.add()', 'POST', 1, 'admin', NULL, '/business/template', '127.0.0.1', '内网IP', '{\"params\":{}}', NULL, 1, 'Invalid bound statement (not found): com.ruoyi.business.mapper.BusinessTemplateMapper.insert', '2024-03-31 03:54:16'); +INSERT INTO `sys_oper_log` VALUES (109, '模版管理', 1, 'com.ruoyi.business.controller.BusinessTemplateController.add()', 'POST', 1, 'admin', NULL, '/business/template', '127.0.0.1', '内网IP', '{\"params\":{}}', NULL, 1, 'Invalid bound statement (not found): com.ruoyi.business.mapper.BusinessTemplateMapper.insert', '2024-03-31 03:54:16'); +INSERT INTO `sys_oper_log` VALUES (110, '模版管理', 1, 'com.ruoyi.business.controller.BusinessTemplateController.add()', 'POST', 1, 'admin', NULL, '/business/template', '127.0.0.1', '内网IP', '{\"params\":{},\"tempValue\":\"\\n\\n\\n\"}', NULL, 1, 'Invalid bound statement (not found): com.ruoyi.business.mapper.BusinessTemplateMapper.insert', '2024-03-31 03:55:51'); +INSERT INTO `sys_oper_log` VALUES (111, '模版管理', 1, 'com.ruoyi.business.controller.BusinessTemplateController.add()', 'POST', 1, 'admin', NULL, '/business/template', '127.0.0.1', '内网IP', '{\"params\":{},\"tempValue\":\"\\n\\n\\n\",\"title\":\"ceshi\"}', NULL, 1, 'Invalid bound statement (not found): com.ruoyi.business.mapper.BusinessTemplateMapper.insert', '2024-03-31 03:55:51'); +INSERT INTO `sys_oper_log` VALUES (112, '模版管理', 1, 'com.ruoyi.business.controller.BusinessTemplateController.add()', 'POST', 1, 'admin', NULL, '/business/template', '127.0.0.1', '内网IP', '{\"params\":{},\"tempValue\":\"\\n\\n\\n\",\"title\":\"ceshi\"}', NULL, 1, 'Invalid bound statement (not found): com.ruoyi.business.mapper.BusinessTemplateMapper.insert', '2024-03-31 03:56:58'); +INSERT INTO `sys_oper_log` VALUES (113, '模版管理', 1, 'com.ruoyi.business.controller.BusinessTemplateController.add()', 'POST', 1, 'admin', NULL, '/business/template', '127.0.0.1', '内网IP', '{\"params\":{},\"tempValue\":\"\\n\\n\\n\"}', NULL, 1, 'Invalid bound statement (not found): com.ruoyi.business.mapper.BusinessTemplateMapper.insert', '2024-03-31 03:56:58'); +INSERT INTO `sys_oper_log` VALUES (114, '模版管理', 1, 'com.ruoyi.business.controller.BusinessTemplateController.add()', 'POST', 1, 'admin', NULL, '/business/template', '127.0.0.1', '内网IP', '{\"params\":{},\"tempValue\":\"\\n\\n\\n\",\"title\":\"ceshi\"}', NULL, 1, 'Invalid bound statement (not found): com.ruoyi.business.mapper.BusinessTemplateMapper.insert', '2024-03-31 03:59:35'); +INSERT INTO `sys_oper_log` VALUES (115, '模版管理', 1, 'com.ruoyi.business.controller.BusinessTemplateController.add()', 'POST', 1, 'admin', NULL, '/business/template', '127.0.0.1', '内网IP', '{\"params\":{},\"tempValue\":\"\\n\\n\\n\"}', NULL, 1, 'Invalid bound statement (not found): com.ruoyi.business.mapper.BusinessTemplateMapper.insert', '2024-03-31 03:59:35'); +INSERT INTO `sys_oper_log` VALUES (116, '模版管理', 1, 'com.ruoyi.business.controller.BusinessTemplateController.add()', 'POST', 1, 'admin', NULL, '/business/template', '127.0.0.1', '内网IP', '{\"params\":{},\"tempValue\":\"\\n\\n\\n\",\"title\":\"ceshi\"}', NULL, 1, 'nested exception is org.apache.ibatis.exceptions.PersistenceException: \r\n### Error updating database. Cause: java.lang.IllegalStateException: Type handler was null on parameter mapping for property \'params\'. It was either not specified and/or could not be found for the javaType (java.util.Map) : jdbcType (null) combination.\r\n### The error may exist in com/ruoyi/business/mapper/BusinessTemplateMapper.java (best guess)\r\n### The error may involve com.ruoyi.business.mapper.BusinessTemplateMapper.insert\r\n### The error occurred while executing an update\r\n### Cause: java.lang.IllegalStateException: Type handler was null on parameter mapping for property \'params\'. It was either not specified and/or could not be found for the javaType (java.util.Map) : jdbcType (null) combination.', '2024-03-31 04:10:33'); +INSERT INTO `sys_oper_log` VALUES (117, '模版管理', 1, 'com.ruoyi.business.controller.BusinessTemplateController.add()', 'POST', 1, 'admin', NULL, '/business/template', '127.0.0.1', '内网IP', '{\"params\":{},\"tempValue\":\"\\n\\n\\n\"}', NULL, 1, 'nested exception is org.apache.ibatis.exceptions.PersistenceException: \r\n### Error updating database. Cause: java.lang.IllegalStateException: Type handler was null on parameter mapping for property \'params\'. It was either not specified and/or could not be found for the javaType (java.util.Map) : jdbcType (null) combination.\r\n### The error may exist in com/ruoyi/business/mapper/BusinessTemplateMapper.java (best guess)\r\n### The error may involve com.ruoyi.business.mapper.BusinessTemplateMapper.insert\r\n### The error occurred while executing an update\r\n### Cause: java.lang.IllegalStateException: Type handler was null on parameter mapping for property \'params\'. It was either not specified and/or could not be found for the javaType (java.util.Map) : jdbcType (null) combination.', '2024-03-31 04:10:33'); +INSERT INTO `sys_oper_log` VALUES (118, '模版管理', 1, 'com.ruoyi.business.controller.BusinessTemplateController.add()', 'POST', 1, 'admin', NULL, '/business/template', '127.0.0.1', '内网IP', '{\"createBy\":\"admin\",\"createTime\":\"2024-03-31 04:14:19\",\"id\":\"1774168297470779393\",\"params\":{},\"tempValue\":\"\\n\\n\\n\",\"title\":\"ceshi\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2024-03-31 04:14:19'); +INSERT INTO `sys_oper_log` VALUES (119, '模版管理', 1, 'com.ruoyi.business.controller.BusinessTemplateController.add()', 'POST', 1, 'admin', NULL, '/business/template', '127.0.0.1', '内网IP', '{\"createBy\":\"admin\",\"createTime\":\"2024-03-31 04:14:19\",\"id\":\"1774168297470779394\",\"params\":{},\"tempValue\":\"\\n\\n\\n\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2024-03-31 04:14:19'); +INSERT INTO `sys_oper_log` VALUES (120, '模版管理', 1, 'com.ruoyi.business.controller.BusinessTemplateController.add()', 'POST', 1, 'admin', NULL, '/business/template', '127.0.0.1', '内网IP', '{\"createBy\":\"admin\",\"createTime\":\"2024-03-31 04:28:47\",\"id\":\"1774171941196881922\",\"params\":{},\"tempValue\":\"\\n" - }) - List getCardInfoByNumber(List number); -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/dao/CtClickFarmingDao.java b/wjcy-common/src/main/java/me/zhengjie/dao/CtClickFarmingDao.java deleted file mode 100644 index 1669d9e..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/dao/CtClickFarmingDao.java +++ /dev/null @@ -1,90 +0,0 @@ -package me.zhengjie.dao; - -import com.baomidou.mybatisplus.core.conditions.Wrapper; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import me.zhengjie.entity.CtBuyerClickSuccess; -import me.zhengjie.entity.CtClickFarmYdParams; -import me.zhengjie.entity.CtClickFarming; -import me.zhengjie.service.vo.CtClickFarmEditDetailVO; -import me.zhengjie.service.vo.CtClickFarmingDetailVO; -import me.zhengjie.service.vo.CtClickFarmingVO; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Select; - -import java.util.List; - -/** - * 刷单Excel信息(CtClickFarming)表数据库访问层 - * - * @author rch - * @since 2022-08-16 - */ -@Mapper -public interface CtClickFarmingDao extends BaseMapper { - - // @Select("select farming.* from ct_click_farming farming left join ct_click_order clickOrder on farming.ct_click_order_id = clickOrder.id ${ew.customSqlSegment} ") - @Select("SELECT\n" + - "\tfarming.*,\n" + - "\tbuyer.contntry_short as country,\n" + - "\tbuyer.account\n" + - "FROM\n" + - "\tct_click_farming farming\n" + - "\tLEFT JOIN ct_click_order clickOrder ON farming.ct_click_order_id = clickOrder.id\n" + - "\tLEFT JOIN ct_buyer buyer ON buyer.id = farming.buyer_id\n" + - "${ew.customSqlSegment}") - IPage searchPageList(IPage page, Wrapper ew); - - @Select("select * from ct_click_farming where id = #{id} for update") - CtClickFarming getByIdLock(Long id); - - @Select("SELECT t1.*, t2.account AS buyer_name FROM ct_click_farming t1 LEFT JOIN ct_buyer t2 ON t1.buyer_id = t2.id where t1.id = #{id}") - CtClickFarmEditDetailVO getEditDetailById(Long id); - - @Select("SELECT t1.*, t2.account AS buyer_name FROM ct_click_farming t1 LEFT JOIN ct_buyer t2 ON t1.buyer_id = t2.id where t1.id = #{id}") - CtClickFarmingDetailVO getDetailById(Long id); - -// @Select("select buyer_id, count(1) as successCount from ct_click_farming where account != #{buyerAccount} and `status` = 3 GROUP BY buyer_id;") -// @Select("SELECT\n" + -// "\tclick.buyer_id,\n" + -// "\tcount( 1 ) AS successCount \n" + -// "FROM\n" + -// "\tct_click_farming AS click \t\n" + -// "\tLEFT JOIN ct_buyer AS buyer ON buyer.id = click.buyer_id and click.account != #{buyerAccount} AND click.status = 3\n" + -// "\tAND buyer.occupy_status = 2 AND buyer.country = #{country} and click.shopName != #{shopName} And ct\n" + -// "GROUP BY\n" + -// "\tbuyer_id;") -// @Select("SELECT click.buyer_id, count( 1 ) AS successCount, click.created_at FROM ct_click_farming AS click LEFT JOIN ct_buyer AS buyer ON buyer.id = click.buyer_id AND click.account != #{buyerAccount} AND click.STATUS = 3 AND buyer.occupy_status = 2 AND buyer.country = #{country} AND click.shop_name != #{shopName} GROUP BY buyer_id HAVING created_at < DATE_SUB(CURDATE(), INTERVAL 1 MONTH)") - @Select("SELECT click.buyer_id, count(1) AS successCount, click.status, click.created_at FROM ct_click_farming AS click LEFT JOIN ct_buyer AS buyer ON buyer.id = click.buyer_id AND click.account != #{buyerAccount} AND buyer.occupy_status = 2 AND buyer.country = #{country} AND click.shop_name != #{shopName} GROUP BY buyer_id HAVING created_at < DATE_SUB(CURDATE(), INTERVAL 1 MONTH) AND STATUS = 3") - List ruleGetCtBuyer(String buyerAccount, String country, String shopName); - - @Select("SELECT\n" + - "\tfarming.id,\n" + - "\tfarming.key_word as keyWord,\n" + - "\tfarming.number,\n" + - "\tfarming.params_type,\n" + - "\tfarming.specification,\n" + - "\tfarming.color,\n" + - "\tfarming.item,\n" + - "\tfarming.exchange,\n" + - "\tfarming.link,\n" + - "\tfarming.section_min as sectionMin,\n" + - "\tfarming.section_max as sectionMax,\n" + - "\tfarming.amessage,\n" + - "\tbuyer.contntry_short as country,\n" + - "\tbuyer.account,\n" + - "\tbuyer.pwd,\n" + - "\tctVpn.link as vpnShare,\n" + - "\tctCard.term_of_validity as termOfValidity,\n" + - "\tCONCAT(ctCard.holder_surname, \" \",ctCard.holder_name) AS cardName,\n" + - "\tctCard.number as cardNumber,\n" + - "\tctCard.pwd as cardPwd\n" + - "FROM\n" + - "\tct_click_farming farming\n" + - "\tLEFT JOIN ct_click_order clickOrder ON farming.ct_click_order_id = clickOrder.id\n" + - "\tLEFT JOIN ct_buyer buyer ON buyer.id = farming.buyer_id\n" + - "\tLEFT JOIN ct_vpn ctVpn ON buyer.vpn_id = ctVpn.id\n" + - "\tLEFT JOIN ct_card ctCard ON buyer.card_id = ctCard.id where farming.id = #{id}") - CtClickFarmYdParams getCtClickFarmYdParams(Long id); -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/dao/CtClickOrderDao.java b/wjcy-common/src/main/java/me/zhengjie/dao/CtClickOrderDao.java deleted file mode 100644 index b90cfa3..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/dao/CtClickOrderDao.java +++ /dev/null @@ -1,100 +0,0 @@ -package me.zhengjie.dao; - -import com.baomidou.mybatisplus.core.conditions.Wrapper; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import me.zhengjie.entity.CtClickFarmingOrderInfo; -import me.zhengjie.entity.CtClickOrder; -import me.zhengjie.service.vo.CtClickOrderDetailVO; -import me.zhengjie.service.vo.CtClickOrderListVO; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Select; - -/** - * 刷单-订单信息(CtClickOrder)表数据库访问层 - * - * @author rch - * @since 2022-09-14 - */ -@Mapper -public interface CtClickOrderDao extends BaseMapper { - - /** - * 分页查询 - * @param page - * @param ew - */ - //TODO sql 修改 -// @Select("SELECT\n" + -// "\t`order`.platform_id, \n" + -// "\t`order`.company_id, \n" + -// "\t`order`.id, \n" + -// "\t`order`.created_at, \n" + -// "\t`order`.updated_at, \n" + -// "\t`order`.amount, \n" + -// "\t`order`.shop, \n" + -// "\t`order`.order_id, \n" + -// "\t`order`.comment, \n" + -// "\t`order`.account, \n" + -// "\t`order`.pwd, \n" + -// "\tcompany.`name` AS companyName, \n" + -// "\tplatform.`name` AS platformName\n" + -// "FROM\n" + -// "\tct_click_order AS `order`\n" + -// "\tLEFT JOIN\n" + -// "\tct_platform AS platform\n" + -// "\tON \n" + -// "\t\t`order`.platform_id = platform.id\n" + -// "\tLEFT JOIN\n" + -// "\tct_company AS company\n" + -// "\tON \n" + -// "\t\t`order`.company_id = company.id ${ew.customSqlSegment} ") - @Select("SELECT clickOrder.company_id, clickOrder.type, clickOrder.status, clickOrder.id, clickOrder.created_at, clickOrder.updated_at, clickOrder.amount, clickOrder.shop, clickOrder.order_id, clickOrder.comment, company.name AS companyName FROM ct_click_order AS clickOrder LEFT JOIN ct_company AS company ON clickOrder.company_id = company.id ${ew.customSqlSegment}") - IPage searchPageList(IPage page, Wrapper ew); - - @Select("SELECT\n" + - "\tclickOrder.id,\n" + - "\tclickOrder.order_id,\n" + - "\tclickOrder.COMMENT,\n" + - "\tclickOrder.STATUS,\n" + - "\tclickOrder.paths,\n" + - "\tbuyer.country,\n" + - "\tbuyer.account,\n" + - "\tbuyer.pwd,\n" + - "\tctVpn.link as vpnShare\n" + - "FROM\n" + - "\tct_click_order clickOrder\n" + - "\tLEFT JOIN ct_click_farming clickFarming ON clickOrder.id = clickFarming.ct_click_order_id \n" + - "\tLEFT JOIN ct_buyer buyer ON buyer.id = clickFarming.buyer_id\n" + - "\tLEFT JOIN ct_vpn ctVpn ON buyer.vpn_id = ctVpn.id\n" + - "WHERE \n" + - "\tclickOrder.id = #{orderId}") - CtClickFarmingOrderInfo getClickFarmOrderById(Long orderId); - - @Select("select * from ct_click_order where id = #{id} for update") - CtClickOrder getByIdLock(Long id); - - @Select("SELECT\n" + - "\tclickOrder.id,\n" + - "\tclickOrder.created_at,\n" + - "\tclickOrder.updated_at,\n" + - "\tclickOrder.prices_number,\n" + - "\tclickOrder.payment_results,\n" + - "\tclickOrder.order_id,\n" + - "\tclickOrder.COMMENT,\n" + -// "\tclickOrder.status,\n" + -// "\tclickOrder.platform_id,\n" + - "\tclickOrder.company_id,\n" + - "\tclickOrder.amount,\n" + - "\tclickOrder.shop,\n" + - "\tclickOrder.shop_name,\n" + - "\tclickOrder.order_date,\n" + - "\tclickOrder.paths\n" + - "FROM\n" + - "\tct_click_order clickOrder\n" + - "\tLEFT JOIN ct_click_farming clickFarming ON clickOrder.id = clickFarming.ct_click_order_id \n" + - "WHERE\n" + - "\tclickOrder.id = #{orderId}") - CtClickOrderDetailVO getClickOrderDetailById(Long id); -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/dao/CtCompanyDao.java b/wjcy-common/src/main/java/me/zhengjie/dao/CtCompanyDao.java deleted file mode 100644 index a5ff0de..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/dao/CtCompanyDao.java +++ /dev/null @@ -1,34 +0,0 @@ -package me.zhengjie.dao; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import me.zhengjie.entity.CtCompany; -import me.zhengjie.entity.CtCompanyInfo; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.apache.ibatis.annotations.Select; - -import java.util.List; - -/** - * 公司信息(CtCompany)表数据库访问层 - * - * @author zhw - * @since 2022-07-14 - */ -@Mapper -public interface CtCompanyDao extends BaseMapper { - - @Select({ - "" - }) - List getByName(@Param("names") List names); - - @Select("select id,name from ct_company") - List getCompanyList(); -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/dao/CtDhPayDao.java b/wjcy-common/src/main/java/me/zhengjie/dao/CtDhPayDao.java deleted file mode 100644 index 3bc6536..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/dao/CtDhPayDao.java +++ /dev/null @@ -1,24 +0,0 @@ -package me.zhengjie.dao; - -import com.baomidou.mybatisplus.core.conditions.Wrapper; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import me.zhengjie.entity.CtDhPay; -import me.zhengjie.service.vo.CtBuyerListVO; -import me.zhengjie.service.vo.CtDhPayListVO; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Select; - -/** - * 平台信息(CtDyPay)表数据库访问层 - * - * @author rch - * @since 2022-07-28 - */ -@Mapper -public interface CtDhPayDao extends BaseMapper { - - @Select("select * from ct_dh_pay ${ew.customSqlSegment}") - IPage searchPageList(IPage page, Wrapper ew); -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/dao/CtExcelDao.java b/wjcy-common/src/main/java/me/zhengjie/dao/CtExcelDao.java deleted file mode 100644 index 1291b82..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/dao/CtExcelDao.java +++ /dev/null @@ -1,17 +0,0 @@ -package me.zhengjie.dao; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import me.zhengjie.entity.CtExcel; -import org.apache.ibatis.annotations.Mapper; - -/** - * Excel 导入信息(CtExcel)表数据库访问层 - * - * @author makejava - * @since 2022-06-23 10:37:44 - */ -@Mapper -public interface CtExcelDao extends BaseMapper { - -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/dao/CtExcelImportInfoDao.java b/wjcy-common/src/main/java/me/zhengjie/dao/CtExcelImportInfoDao.java deleted file mode 100644 index 94f2f76..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/dao/CtExcelImportInfoDao.java +++ /dev/null @@ -1,17 +0,0 @@ -package me.zhengjie.dao; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import me.zhengjie.entity.CtExcelImportInfo; -import org.apache.ibatis.annotations.Mapper; - -/** - * Excel导入信息(CtExcelImportInfo)表数据库访问层 - * - * @author rch - * @since 2022-06-23 - */ -@Mapper -public interface CtExcelImportInfoDao extends BaseMapper { - -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/dao/CtOrderDao.java b/wjcy-common/src/main/java/me/zhengjie/dao/CtOrderDao.java deleted file mode 100644 index c20f9da..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/dao/CtOrderDao.java +++ /dev/null @@ -1,17 +0,0 @@ -package me.zhengjie.dao; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import me.zhengjie.entity.CtOrder; -import org.apache.ibatis.annotations.Mapper; - -/** - * (CtOrder)表数据库访问层 - * - * @author rch - * @since 2022-07-01 - */ -@Mapper -public interface CtOrderDao extends BaseMapper { - -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/dao/CtPlatformDao.java b/wjcy-common/src/main/java/me/zhengjie/dao/CtPlatformDao.java deleted file mode 100644 index 486b02c..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/dao/CtPlatformDao.java +++ /dev/null @@ -1,17 +0,0 @@ -package me.zhengjie.dao; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import me.zhengjie.entity.CtPlatform; -import org.apache.ibatis.annotations.Mapper; - -/** - * 平台信息(CtPlatform)表数据库访问层 - * - * @author rch - * @since 2022-06-23 10:37:44 - */ -@Mapper -public interface CtPlatformDao extends BaseMapper { - -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/dao/CtRebotDao.java b/wjcy-common/src/main/java/me/zhengjie/dao/CtRebotDao.java deleted file mode 100644 index 589314c..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/dao/CtRebotDao.java +++ /dev/null @@ -1,41 +0,0 @@ -package me.zhengjie.dao; - -import com.baomidou.mybatisplus.core.conditions.Wrapper; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import me.zhengjie.base.BaseEntity; -import me.zhengjie.entity.CtRebot; -import me.zhengjie.service.vo.CtRebotListVO; -import me.zhengjie.utils.PageUtils; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Select; -import org.apache.ibatis.annotations.Update; - -import java.util.List; - -/** - * 影刀设备-机器人信息(CtRebot)表数据库访问层 - * - * @author rch - * @since 2022-07-23 - */ -@Mapper -public interface CtRebotDao extends BaseMapper { - - @Select("select * from ct_rebot where account_name = #{accountName} for update") - CtRebot getByAccountNameLock(String accountName); - - - @Select("select * from ct_rebot ${ew.customSqlSegment}") - IPage searchRebotList(IPage page, Wrapper ew); - - @Select("select account_name from ct_rebot") - List getAccountNameList(); - - @Select("select robot_client_uuid from ct_rebot") - List getClientUuidList(); - - @Update("update ct_rebot set status = #{newStatus} where id = #{id} and status = #{oldStatus}") - Boolean updateNewStatusByOldStatus(Long id, Integer newStatus, Integer oldStatus); -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/dao/CtResponseOrderAddressDao.java b/wjcy-common/src/main/java/me/zhengjie/dao/CtResponseOrderAddressDao.java deleted file mode 100644 index e2195fb..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/dao/CtResponseOrderAddressDao.java +++ /dev/null @@ -1,17 +0,0 @@ -package me.zhengjie.dao; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import me.zhengjie.entity.CtResponseOrderAddress; -import org.apache.ibatis.annotations.Mapper; - -/** - * 下注成功订单响应收货地址信息(CtResponseOrderAddress)表数据库访问层 - * - * @author rch - * @since 2022-07-01 - */ -@Mapper -public interface CtResponseOrderAddressDao extends BaseMapper { - -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/dao/CtResponseOrderDao.java b/wjcy-common/src/main/java/me/zhengjie/dao/CtResponseOrderDao.java deleted file mode 100644 index 5824efb..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/dao/CtResponseOrderDao.java +++ /dev/null @@ -1,17 +0,0 @@ -package me.zhengjie.dao; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import me.zhengjie.entity.CtResponseOrder; -import org.apache.ibatis.annotations.Mapper; - -/** - * 下单成功响应订单商品信息(CtResponseOrder)表数据库访问层 - * - * @author rch - * @since 2022-07-01 - */ -@Mapper -public interface CtResponseOrderDao extends BaseMapper { - -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/dao/CtResponseOrderProductDao.java b/wjcy-common/src/main/java/me/zhengjie/dao/CtResponseOrderProductDao.java deleted file mode 100644 index 0ff58c8..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/dao/CtResponseOrderProductDao.java +++ /dev/null @@ -1,17 +0,0 @@ -package me.zhengjie.dao; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import me.zhengjie.entity.CtResponseOrderProduct; -import org.apache.ibatis.annotations.Mapper; - -/** - * 下单订单响应产品信息(CtResponseOrderProduct)表数据库访问层 - * - * @author rch - * @since 2022-07-01 - */ -@Mapper -public interface CtResponseOrderProductDao extends BaseMapper { - -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/dao/CtVpnDao.java b/wjcy-common/src/main/java/me/zhengjie/dao/CtVpnDao.java deleted file mode 100644 index 7d0aa3e..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/dao/CtVpnDao.java +++ /dev/null @@ -1,35 +0,0 @@ -package me.zhengjie.dao; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import me.zhengjie.entity.CtVpn; -import me.zhengjie.entity.CtVpnInfo; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Select; - -import java.util.List; - -/** - * VPN信息表(CtVpn)表数据库访问层 - * - * @author rch - * @since 2022-07-07 - */ -@Mapper -public interface CtVpnDao extends BaseMapper { - - @Select("select ip_address from ct_vpn") - List getIpList(); - - //@Select("select id,ip_address from ct_vpn where ip_address in ${ipAddress}") - @Select({ - "" - }) - List getVpnInfoByIp(List ipAddress); - -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/dao/DhAddCarDao.java b/wjcy-common/src/main/java/me/zhengjie/dao/DhAddCarDao.java deleted file mode 100644 index 89e96ba..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/dao/DhAddCarDao.java +++ /dev/null @@ -1,61 +0,0 @@ -package me.zhengjie.dao; - -import com.baomidou.mybatisplus.core.conditions.Wrapper; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import me.zhengjie.entity.DhAddCar; -import me.zhengjie.service.vo.dhaddcar.DhAddCarVO; -import me.zhengjie.service.vo.dhaddcar.DhAddCarListVO; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Select; - -/** - * 敦煌加入购物车(DhAddCar)表数据库访问层 - * - * @author rch - * @since 2022-11-17 09:11:53 - */ -@Mapper -public interface DhAddCarDao extends BaseMapper { - - @Select("SELECT\n" + - "\tdhAddCar.*,\n" + - "\tbuyer.id AS buyerId,\n" + - "\tbuyer.account,\n" + - "\tbuyer.contntry_short AS country,\n" + - "\tcompany.NAME AS companyName\n" + - "\t\n" + - "FROM\n" + - "\tdh_add_car AS dhAddCar\n" + - "LEFT JOIN\n" + - "\tct_buyer buyer ON dhAddCar.buyer_id = buyer.id\n" + - "LEFT JOIN\n" + - "\tct_company company ON buyer.company_id = company.id\n" + - "\t${ew.customSqlSegment}") - IPage searchPageList(IPage page, Wrapper ew); - - - @Select("SELECT\n" + - " dhAddCar.id,\n" + - "\tdhAddCar.params_type,\n" + - "\tdhAddCar.car_good_ids AS carGoodIds,\n" + - "\tbuyer.id AS buyerId,\n" + - "\tbuyer.account,\n" + - "\tbuyer.contntry_short as country,\n" + - "\tbuyer.pwd,\n" + - "\tvpn.link as vpnShare,\n" + - "\tdhAddCar.status,\n" + - "\tcompany.NAME AS companyName\n" + - "FROM\n" + - "\tdh_add_car AS dhAddCar\n" + - "\tLEFT JOIN ct_buyer buyer ON dhAddCar.buyer_id = buyer.id\n" + - "\tLEFT JOIN ct_vpn vpn ON buyer.vpn_id = vpn.id\n" + - "\tLEFT JOIN\n" + - "\tct_company company ON buyer.company_id = company.id\n" + - "\tWHERE dhAddCar.id = #{id}") - DhAddCarVO getDetailById(Long id); - - @Select("select * from dh_add_car where id = #{id}") - DhAddCar getByIdLock(Long id); -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/dao/DhAddCarOrderDao.java b/wjcy-common/src/main/java/me/zhengjie/dao/DhAddCarOrderDao.java deleted file mode 100644 index c103c95..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/dao/DhAddCarOrderDao.java +++ /dev/null @@ -1,48 +0,0 @@ -package me.zhengjie.dao; - -import com.baomidou.mybatisplus.core.conditions.Wrapper; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import me.zhengjie.entity.DhAddCarOrder; -import me.zhengjie.service.vo.dhaddcar.DhAddCarListVO; -import me.zhengjie.service.vo.dhcarorder.DhAddCarOrderListVO; -import me.zhengjie.service.vo.dhcarorder.DhCarOrderParamsVO; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Select; - -/** - * 敦煌-加购物车-订单(DhAddCarOrder)表数据库访问层 - * - * @author rch - * @since 2022-11-17 09:11:57 - */ -@Mapper -public interface DhAddCarOrderDao extends BaseMapper { - - @Select("select * from dh_add_car_order where id = #{id} for update") - DhAddCarOrder getByIdLock(Long id); - - @Select("select * from dh_add_car_order ${ew.customSqlSegment}") - IPage searchPageList(IPage page, Wrapper ew); - - @Select("SELECT\n" + - "\tdhAddCarOrder.id,\n" + - "\tdhAddCarOrder.order_id,\n" + - "\tdhAddCar.params_type,\n" + - "\tdhAddCar.car_good_ids AS carGoodIds,\n" + - "\tbuyer.id AS buyerId,\n" + - "\tbuyer.account,\n" + - "\tbuyer.contntry_short AS country,\n" + - "\tbuyer.pwd,\n" + - "\tvpn.link AS vpnShare\n" + - "FROM\n" + - "\tdh_add_car_order as dhAddCarOrder\n" + - "\tLEFT JOIN dh_add_car dhAddCar ON dhAddCar.id = dhAddCarOrder.add_car_id\n" + - "\tLEFT JOIN ct_buyer buyer ON dhAddCar.buyer_id = buyer.id\n" + - "\tLEFT JOIN ct_vpn vpn ON buyer.vpn_id = vpn.id\n" + - "\tLEFT JOIN ct_company company ON buyer.company_id = company.id \n" + - "WHERE\n" + - "\tdhAddCarOrder.id = #{id}") - DhCarOrderParamsVO getYdParams(Long id); -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/dao/DhCarGoodsDao.java b/wjcy-common/src/main/java/me/zhengjie/dao/DhCarGoodsDao.java deleted file mode 100644 index 8aa8743..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/dao/DhCarGoodsDao.java +++ /dev/null @@ -1,17 +0,0 @@ -package me.zhengjie.dao; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import me.zhengjie.entity.DhCarGoods; -import org.apache.ibatis.annotations.Mapper; - -/** - * 敦煌-加入购物车商品信息(DhCarGoods)表数据库访问层 - * - * @author makejava - * @since 2022-11-17 09:12:01 - */ -@Mapper -public interface DhCarGoodsDao extends BaseMapper { - -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/dao/LoginIpDao.java b/wjcy-common/src/main/java/me/zhengjie/dao/LoginIpDao.java deleted file mode 100644 index 0acee04..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/dao/LoginIpDao.java +++ /dev/null @@ -1,17 +0,0 @@ -package me.zhengjie.dao; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import me.zhengjie.entity.LoginIp; -import org.apache.ibatis.annotations.Mapper; - -/** - * (LoginIp)表数据库访问层 - * - * @author zeng - * @since 2022-03-21 14:07:01 - */ -@Mapper -public interface LoginIpDao extends BaseMapper { - -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/dao/SettingSiteDao.java b/wjcy-common/src/main/java/me/zhengjie/dao/SettingSiteDao.java deleted file mode 100644 index b4f548f..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/dao/SettingSiteDao.java +++ /dev/null @@ -1,17 +0,0 @@ -package me.zhengjie.dao; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import me.zhengjie.entity.CtSettingSite; -import org.apache.ibatis.annotations.Mapper; - -/** - * 站点配置(CtSettingSite)表数据库访问层 - * - * @author rch - * @since 2021-11-23 - */ -@Mapper -public interface SettingSiteDao extends BaseMapper { - String getValueByKey(String key); -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/dao/SysQuartzJobDao.java b/wjcy-common/src/main/java/me/zhengjie/dao/SysQuartzJobDao.java deleted file mode 100644 index ca96b7c..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/dao/SysQuartzJobDao.java +++ /dev/null @@ -1,26 +0,0 @@ -package me.zhengjie.dao; - -import com.baomidou.mybatisplus.core.conditions.Wrapper; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import me.zhengjie.entity.SysQuartzJob; -import me.zhengjie.service.vo.SysQuartzJobListVO; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Select; - -/** - * 定时任务(SysQuartzJob)表数据库访问层 - * - * @author zhw - * @since 2022-07-21 - */ -@Mapper -public interface SysQuartzJobDao extends BaseMapper { - - @Select("select * from sys_quartz_job ${ew.customSqlSegment}") - IPage searchPageList(IPage page, Wrapper ew); - - @Select("select * from sys_quartz_job where task_num = #{taskNum}") - SysQuartzJob getByTaskNum(String taskNum); -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/dao/SysQuartzLogDao.java b/wjcy-common/src/main/java/me/zhengjie/dao/SysQuartzLogDao.java deleted file mode 100644 index 64b4ba5..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/dao/SysQuartzLogDao.java +++ /dev/null @@ -1,23 +0,0 @@ -package me.zhengjie.dao; - -import com.baomidou.mybatisplus.core.conditions.Wrapper; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import me.zhengjie.entity.SysQuartzLog; -import me.zhengjie.service.vo.SysQuartzLogListVO; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Select; - -/** - * 定时任务(SysQuartzLog)表数据库访问层 - * - * @author rch - * @since 2022-07-20 - */ -@Mapper -public interface SysQuartzLogDao extends BaseMapper { - - @Select("select * from sys_quartz_log ${ew.customSqlSegment} ") - IPage searchPageList(IPage page, Wrapper ew); -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/dao/mapper/CtDhPayService.xml b/wjcy-common/src/main/java/me/zhengjie/dao/mapper/CtDhPayService.xml deleted file mode 100644 index 25a0430..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/dao/mapper/CtDhPayService.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/wjcy-common/src/main/java/me/zhengjie/dto/Dto.java b/wjcy-common/src/main/java/me/zhengjie/dto/Dto.java deleted file mode 100644 index 159b385..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/dto/Dto.java +++ /dev/null @@ -1,73 +0,0 @@ -package me.zhengjie.dto; - - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import me.zhengjie.error.ErrorCodeEnum; - -import java.io.Serializable; -import java.util.HashMap; -import java.util.Map; - -/** - *

- * 请求结果通用数据结构 - *

- * - * @author: zeng - * @since: 2020-07-01 - */ -@Data -@NoArgsConstructor -@AllArgsConstructor -@Slf4j -public class Dto implements Serializable { - - private int code; - - private String message; - - private T data; - - private Dto(Object data) { - this.code = 200; - this.message = "请求成功"; - this.data =(T) data; - } - - private Dto(int code, String message) { - this.code = code; - this.message = message; - } - - public Dto setData(String key, Object value) { - if (this.data == null) { - data = (T)new HashMap(16); - } - ((Map) data).put(key, value); - return this; - } - - public static Dto returnResult(Object data) { - return new Dto(data); - } - - public static Dto returnErrorResult(String message) { - return new Dto(-1, message); - } - - public static Dto getInstance(ErrorCodeEnum errorCodeEnum) { - log.error("---枚举类返回错误信息:--return error:" + errorCodeEnum.getDesc()); - return new Dto(errorCodeEnum.getCode(), errorCodeEnum.getDesc()); - } - - public boolean success(Dto dto){ - if (dto.getCode() == 200) { - return true; - } else { - return false; - } - } -} diff --git a/wjcy-common/src/main/java/me/zhengjie/dto/PageDTO.java b/wjcy-common/src/main/java/me/zhengjie/dto/PageDTO.java deleted file mode 100644 index ed0fa84..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/dto/PageDTO.java +++ /dev/null @@ -1,49 +0,0 @@ -package me.zhengjie.dto; - -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import lombok.Data; - -import javax.validation.constraints.Min; -import javax.validation.constraints.NotNull; -import java.io.Serializable; - -/** - * @Description 分页查询参数 - * @Date 2022-06-22 - * @Author rch - */ -@Data -public class PageDTO implements Serializable { - - private static final long serialVersionUID = 1L; - - /** 当前页码 */ - @Min(value = 1) - @NotNull - private Integer page; - /** 页面大小 */ - @Min(value = 1) - @NotNull - private Integer pageSize; - /** 排序字段 */ - private String sort; - /** 排序方式 asc/desc */ - private String order; - - /** 获取mysql limit 分页的起始位置 */ - public Integer getLimitStart() { - int i = (page-1)*pageSize; - return i > 0 ? i : 0; - } - - public IPage getiPage(){ - return new Page(page, pageSize); - } - - - public boolean isAsc() { - return "asc".equalsIgnoreCase(order); - } - -} diff --git a/wjcy-common/src/main/java/me/zhengjie/dto/StatementAggregateDTO.java b/wjcy-common/src/main/java/me/zhengjie/dto/StatementAggregateDTO.java deleted file mode 100644 index ba9bf10..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/dto/StatementAggregateDTO.java +++ /dev/null @@ -1,38 +0,0 @@ -package me.zhengjie.dto; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; -import me.zhengjie.utils.PageUtils; - -import java.util.List; - -/** - * 本页合计、总计DTO - * @author zeng - * @since 2021/10/11 19:37 - */ -@Data -@NoArgsConstructor -@AllArgsConstructor -public class StatementAggregateDTO { - - /** 列表 */ - private List list; - - /** 本页小计 */ - private T pageTotal; - - /** 总计 */ - private T aggregate; - - /** 总记录数 */ - private Long total; - - public StatementAggregateDTO(PageUtils pageUtils, T pageTotal, T aggregate) { - this.list = pageUtils.getList(); - this.pageTotal = pageTotal; - this.aggregate = aggregate; - this.total = pageUtils.getTotal(); - } -} diff --git a/wjcy-common/src/main/java/me/zhengjie/entity/CtApply.java b/wjcy-common/src/main/java/me/zhengjie/entity/CtApply.java deleted file mode 100644 index f09b9de..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/entity/CtApply.java +++ /dev/null @@ -1,73 +0,0 @@ -package me.zhengjie.entity; - -import com.baomidou.mybatisplus.annotation.FieldFill; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.extension.activerecord.Model; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.Date; - -/** - * 影刀应用信息(CtApply)表实体类 - * - * @author rch - * @since 2022-07-23 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -@ApiModel -public class CtApply extends Model { - - @TableId(value = "id", type = IdType.AUTO) - @ApiModelProperty(value = "id") - private Long id; - - @TableField(fill = FieldFill.INSERT) - @ApiModelProperty(value = "创建时间") - private String createdAt; - - @TableField(fill = FieldFill.INSERT_UPDATE) - @ApiModelProperty(value = "修改时间") - private String updatedAt; - - /** 操作人账号*/ - @TableField(fill = FieldFill.INSERT_UPDATE) - @ApiModelProperty(value = "操作人账号") - private String gmName; - - /** 应用名称 */ - @ApiModelProperty(value = "应用名称") - private String name; - - /** 任务名称 */ - @ApiModelProperty(value = "任务名称") - private String taskName; - - /** 方法名称 */ - @ApiModelProperty(value = "方法名称") - private String methodName; - - /** accessKeyId */ - @ApiModelProperty(value = "accessKeyId") - private String accessKeyId; - - /** accessKeySecret */ - @ApiModelProperty(value = "accessKeySecret") - private String accessKeySecret; - - /** 应用id */ - @ApiModelProperty(value = "应用id") - private String robotUuid; - - /** 备注 */ - @ApiModelProperty(value = "备注") - private String remark; -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/entity/CtBrowse.java b/wjcy-common/src/main/java/me/zhengjie/entity/CtBrowse.java deleted file mode 100644 index 2a64547..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/entity/CtBrowse.java +++ /dev/null @@ -1,45 +0,0 @@ -package me.zhengjie.entity; - -import com.baomidou.mybatisplus.annotation.FieldFill; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.extension.activerecord.Model; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * 浏览收藏(CtBrowse)表实体类 - * - * @author rch - * @since 2022-11-04 09:45:31 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class CtBrowse extends Model { - - @TableId(value = "id", type = IdType.AUTO) - private Long id; - @TableField(fill = FieldFill.INSERT) - private String createdAt; - @TableField(fill = FieldFill.INSERT_UPDATE) - private String updatedAt; - /** 操作人账号*/ - @TableField(fill = FieldFill.INSERT_UPDATE) - private String gmName; - - /** 买家ID */ - private Long buyerId; - - /** 收藏链接 */ - private String linkUrl; - - /** 状态描述 */ - private String paymentResults; - - /** 状态 1.待执行 2.执行中 3.执行成功 4.执行失败 */ - private Integer status; -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/entity/CtBrowseYdParams.java b/wjcy-common/src/main/java/me/zhengjie/entity/CtBrowseYdParams.java deleted file mode 100644 index 89f99a6..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/entity/CtBrowseYdParams.java +++ /dev/null @@ -1,33 +0,0 @@ -package me.zhengjie.entity; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * 浏览好评订单影刀参数 - * - * @author rch - * @since 2022-11-07 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class CtBrowseYdParams { - private Long id; - - /** 国家 */ - private String country; - - /** 账号 */ - private String account; - - /** 密码 */ - private String pwd; - - /** vpn分享链接 */ - private String vpnShare; - - /** 收藏链接 */ - private String linkUrl; -} diff --git a/wjcy-common/src/main/java/me/zhengjie/entity/CtBuyer.java b/wjcy-common/src/main/java/me/zhengjie/entity/CtBuyer.java deleted file mode 100644 index 49ab741..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/entity/CtBuyer.java +++ /dev/null @@ -1,103 +0,0 @@ -package me.zhengjie.entity; - -import com.baomidou.mybatisplus.annotation.FieldFill; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.extension.activerecord.Model; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.math.BigDecimal; -/** - * 买家信息表(CtBuyer)表实体类 - * - * @author rch - * @since 2022-06-22 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class CtBuyer extends Model { - - @TableId(value = "id", type = IdType.AUTO) - private Long id; - @TableField(fill = FieldFill.INSERT) - private String createdAt; - @TableField(fill = FieldFill.INSERT_UPDATE) - private String updatedAt; - /** 操作人账号*/ - @TableField(fill = FieldFill.INSERT_UPDATE) - private String gmName; - - /** 昵称*/ - private String nickName; - /** 账号*/ - private String account; - /** 密码*/ - private String pwd; - /** 公司id */ - private Long companyId; - /** 平台id */ - private Integer platformId; - /** 平台名称 */ -// private String platformName; - - // TODO 导入需要的字段接着往下添加 - - /** 国家 */ - private String contntryShort; - /** 邮件 */ - private String email; - /** Email密码 */ - private String emailPwd; - /** VPN_ID(导入excel里包含) */ - private Long vpnId; - /** 信用卡ID */ - private Long cardId; - /** 用户等级(导入默认内部账号) 1.普通 2.精品 3.压力 4.内部账号 */ - private Integer level; - /** 占用状态 1.已占用 2.未占用 */ - private Integer occupyStatus; - /** 占用账户 */ - private String occupyAccount; - /** 账户余额 */ - private BigDecimal balance; - /** 账户购买总金额 */ - private BigDecimal buyTotalMoney; - /** mac */ - private String mac; - /** route_mac*/ - private String routeMac; - /** Cookies值 */ - private String cookies; - /** 过期时间 */ - private String expireDate; - /** 状态(导入默认正常) 1.待注册 2待验证 3.待完善 4.正常 5.异常 6.可用但已用 7.删除 */ - private Integer status; - - // ==================地址信息相关========================================begin - /** 地址1 */ - private String addressline1; - /** 国家 */ - private String country; - /** 州 */ - private String state; - /** 电话 */ - private String tel; - /** lastname */ - private String lastname; - /** 税号 */ - private String vatNumber; - /** 城市 */ - private String city; - /** 地址2 */ - private String addressline2; - /** firstname */ - private String firstname; - /** 邮政编码 */ - private String postalcode; - // ==================地址信息相关========================================end -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/entity/CtBuyerClickSuccess.java b/wjcy-common/src/main/java/me/zhengjie/entity/CtBuyerClickSuccess.java deleted file mode 100644 index 13f46d8..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/entity/CtBuyerClickSuccess.java +++ /dev/null @@ -1,19 +0,0 @@ -package me.zhengjie.entity; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * 统计买家刷单成功个数信息 - * - * @author rch - * @create 2022-10-10 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class CtBuyerClickSuccess { - private Long buyerId; - private Integer successCount; -} diff --git a/wjcy-common/src/main/java/me/zhengjie/entity/CtBuyerContactInfo.java b/wjcy-common/src/main/java/me/zhengjie/entity/CtBuyerContactInfo.java deleted file mode 100644 index a680207..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/entity/CtBuyerContactInfo.java +++ /dev/null @@ -1,45 +0,0 @@ -package me.zhengjie.entity; - -import com.baomidou.mybatisplus.annotation.FieldFill; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.extension.activerecord.Model; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.math.BigDecimal; - -/** - * 买家收款地址信息 - * - * @author rch - * @since 2022-07-18 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class CtBuyerContactInfo { - /** 地址1 */ - private String addressline1; - /** 国家 */ - private String country; - /** 州 */ - private String state; - /** 电话 */ - private String tel; - /** lastname */ - private String lastname; - /** 税号 */ - private String vatNumber; - /** 城市 */ - private String city; - /** 地址2 */ - private String addressline2; - /** firstname */ - private String firstname; - /** 邮政编码 */ - private String postalcode; -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/entity/CtBuyerExport.java b/wjcy-common/src/main/java/me/zhengjie/entity/CtBuyerExport.java deleted file mode 100644 index 92efaa9..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/entity/CtBuyerExport.java +++ /dev/null @@ -1,71 +0,0 @@ -package me.zhengjie.entity; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; -import me.zhengjie.utils.excel.ExcelExport; - - -/** - * 买家信息(CtBuyer)表实体类 导出对象信息 - * @author zhw - * @since 2022-07-14 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class CtBuyerExport { - - - @ExcelExport(value = "昵称") - /** 昵称*/ - private String nickName; - /** 账号*/ - @ExcelExport(value = "账号") - private String account; - /** 密码*/ - @ExcelExport(value = "密码") - private String pwd; - /** 公司名称 */ - @ExcelExport(value = "公司名称") - private String companyName; - /** 平台名称 */ - @ExcelExport(value = "平台名称") - private String platformName; - /** 国家 */ - @ExcelExport(value = "所属国家") - private String contntryShort; - /** VPN_IP地址*/ - @ExcelExport(value = "VPN_IP地址") - private String vpnIp; - /** 信用卡卡号 */ - @ExcelExport(value = "信用卡卡号") - private String cardNumber; - /** 地址1 */ - @ExcelExport(value = "地址1") - private String addressline1; - /** 国家 */ - @ExcelExport(value = "国家") - private String country; - /** 州 */ - @ExcelExport(value = "州") - private String state; - /** 电话 */ - @ExcelExport(value = "电话") - private String tel; - /** lastname */ - @ExcelExport(value = "lastname") - private String lastname; - /** 城市 */ - @ExcelExport(value = "城市") - private String city; - /** firstname */ - @ExcelExport(value = "firstname") - private String firstname; - /** 邮政编码 */ - @ExcelExport(value = "邮政编码") - private String postalcode; - /** 异常信息 */ - @ExcelExport(value = "异常信息") - private String error; -} diff --git a/wjcy-common/src/main/java/me/zhengjie/entity/CtBuyerExportTemple.java b/wjcy-common/src/main/java/me/zhengjie/entity/CtBuyerExportTemple.java deleted file mode 100644 index c92d084..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/entity/CtBuyerExportTemple.java +++ /dev/null @@ -1,67 +0,0 @@ -package me.zhengjie.entity; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; -import me.zhengjie.utils.excel.ExcelExport; - - -/** - * 买家信息(CtBuyer)表实体类 导出excel模板 - * @author zhw - * @since 2022-07-18 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class CtBuyerExportTemple { - - @ExcelExport(value = "昵称") - /** 昵称*/ - private String nickName; - /** 账号*/ - @ExcelExport(value = "账号") - private String account; - /** 密码*/ - @ExcelExport(value = "密码") - private String pwd; - /** 公司名称 */ - @ExcelExport(value = "公司名称") - private String companyName; - /** 平台名称 */ - @ExcelExport(value = "平台名称") - private String platformName; - /** 国家 */ - @ExcelExport(value = "所属国家") - private String contntryShort; - /** VPN_IP地址*/ - @ExcelExport(value = "VPN_IP地址") - private String vpnIp; - /** 信用卡卡号 */ - @ExcelExport(value = "信用卡卡号") - private String cardNumber; - /** 地址1 */ - @ExcelExport(value = "地址1") - private String addressline1; - /** 国家 */ - @ExcelExport(value = "国家") - private String country; - /** 州 */ - @ExcelExport(value = "州") - private String state; - /** 电话 */ - @ExcelExport(value = "电话") - private String tel; - /** lastname */ - @ExcelExport(value = "lastname") - private String lastname; - /** 城市 */ - @ExcelExport(value = "城市") - private String city; - /** firstname */ - @ExcelExport(value = "firstname") - private String firstname; - /** 邮政编码 */ - @ExcelExport(value = "邮政编码") - private String postalcode; -} diff --git a/wjcy-common/src/main/java/me/zhengjie/entity/CtBuyerImport.java b/wjcy-common/src/main/java/me/zhengjie/entity/CtBuyerImport.java deleted file mode 100644 index 742bbdb..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/entity/CtBuyerImport.java +++ /dev/null @@ -1,84 +0,0 @@ -package me.zhengjie.entity; - -import com.baomidou.mybatisplus.annotation.FieldFill; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; -import me.zhengjie.utils.excel.ExcelImport; - -/** - * Buyer信息(CtBuyer)表实体类 Import - * - * @author zhw - * @since 2022-07-14 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class CtBuyerImport { - - private int rowNum; - private String rowTips; - - @TableId(value = "id", type = IdType.AUTO) - private Long id; - @TableField(fill = FieldFill.INSERT) - private String createdAt; - @TableField(fill = FieldFill.INSERT_UPDATE) - private String updatedAt; - /** 操作人账号*/ - @TableField(fill = FieldFill.INSERT_UPDATE) - private String gmName; - - @ExcelImport(value = "昵称", required = true) - /** 昵称*/ - private String nickName; - /** 账号*/ - @ExcelImport(value = "账号", required = true, unique = true) - private String account; - /** 密码*/ - @ExcelImport(value = "密码", required = true) - private String pwd; - /** 公司名称 */ - @ExcelImport(value = "公司名称", required = true) - private String companyName; - /** 平台名称 */ - @ExcelImport(value = "平台名称", required = true) - private String platformName; - /** 国家 */ - @ExcelImport(value = "所属国家", required = true) - private String contntryShort; - /** VPN_IP地址*/ - @ExcelImport(value = "VPN_IP地址", required = true) - private String vpnIp; - /** 信用卡卡号 */ - @ExcelImport(value = "信用卡卡号") - private String cardNumber; - /** 地址1 */ - @ExcelImport(value = "地址1", required = true) - private String addressline1; - /** 国家 */ - @ExcelImport(value = "国家", required = true) - private String country; - /** 州 */ - @ExcelImport(value = "州", required = true) - private String state; - /** 电话 */ - @ExcelImport(value = "电话", required = true) - private String tel; - /** lastname */ - @ExcelImport(value = "lastname", required = true) - private String lastname; - /** 城市 */ - @ExcelImport(value = "城市", required = true) - private String city; - /** firstname */ - @ExcelImport(value = "firstname", required = true) - private String firstname; - /** 邮政编码 */ - @ExcelImport(value = "邮政编码", required = true) - private String postalcode; -} diff --git a/wjcy-common/src/main/java/me/zhengjie/entity/CtCard.java b/wjcy-common/src/main/java/me/zhengjie/entity/CtCard.java deleted file mode 100644 index 777745f..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/entity/CtCard.java +++ /dev/null @@ -1,80 +0,0 @@ -package me.zhengjie.entity; - -import com.baomidou.mybatisplus.annotation.FieldFill; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.extension.activerecord.Model; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.math.BigDecimal; -import java.util.Date; - -/** - * 信用卡信息(CtCard)表实体类 - * - * @author rch - * @since 2022-07-07 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class CtCard extends Model { - - @TableId(value = "id", type = IdType.AUTO) - private Long id; - @TableField(fill = FieldFill.INSERT) - private String createdAt; - @TableField(fill = FieldFill.INSERT_UPDATE) - private String updatedAt; - /** 操作人账号*/ - @TableField(fill = FieldFill.INSERT_UPDATE) - private String gmName; - - /** 父ID */ - private Long parentId; - /** 卡号 */ - private String number; -// /** PIN码 */ -// private String pinNumber; - /** 持卡人姓氏 */ - private String holderSurname; - /** 持卡人名称 */ - private String holderName; - /** 有效期 */ - private String termOfValidity; - /** 余额 */ - private BigDecimal balance; - /** 累计消费 */ - private BigDecimal sumConsume; - /** 开卡日期 */ - private Date openDate; - /** 所属国家 */ - private String contntryShort; - /** 信用卡类型 1.Payoneer 2.万事达虚拟卡 3.Visa信用卡 */ - private Integer type; - /** 所属厂商:1.AmzKeys 2.Airwallex */ - private Integer cardDealer; - /** 身份证号 */ - private String idNumber; - /** 省份 */ - private String province; - /** 城市 */ - private String country; - /** 地址 */ - private String address; - /** 手机号 */ - private String phone; - /** 邮箱 */ - private String email; - /** 登陆账号 */ - private String account; - /** 密码 */ - private String pwd; - /** 状态:1.正常、2.异常、3.已删除 */ - private Integer status; - /** 备注 */ - private String remarks; -} \ No newline at end of file diff --git a/wjcy-common/src/main/java/me/zhengjie/entity/CtCardExport.java b/wjcy-common/src/main/java/me/zhengjie/entity/CtCardExport.java deleted file mode 100644 index 7ed9aae..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/entity/CtCardExport.java +++ /dev/null @@ -1,40 +0,0 @@ -package me.zhengjie.entity; - -import com.baomidou.mybatisplus.extension.activerecord.Model; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; -import me.zhengjie.utils.excel.ExcelExport; - -/** - * 信用卡信息(CtCard)表实体类 导出对象信息 - * - * @author rch - * @since 2022-07-07 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class CtCardExport extends Model { - /** 卡号 */ - @ExcelExport(value = "卡号") - private String number; -// /** PIN码 */ -// @ExcelExport(value = "PIN码") -// private String pinNumber; - /** 有效期 */ - @ExcelExport(value = "有效期") - private String termOfValidity; - /** 信用卡类型 1.Payoneer 2.万事达虚拟卡 3.Visa信用卡 */ - @ExcelExport(value = "信用卡类型", kv = "1-Payoneer;2-万事达虚拟卡;3-Visa信用卡") - private Integer type; - /** 所属厂商:1.AmzKeys 2.Airwallex */ - @ExcelExport(value = "所属厂商", kv = "1-AmzKeys;2-Airwallex") - private Integer cardDealer; - /** 状态:1.正常、2.异常、3.已删除 */ - @ExcelExport(value = "状态", kv = "1-正常;2-异常;3-已删除") - private Integer status; - /** 异常信息 */ - @ExcelExport(value = "异常信息") - private String error; -} \ No newline at end of file diff --git a/wjcy-common/src/main/java/me/zhengjie/entity/CtCardExportTemple.java b/wjcy-common/src/main/java/me/zhengjie/entity/CtCardExportTemple.java deleted file mode 100644 index 45d23c8..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/entity/CtCardExportTemple.java +++ /dev/null @@ -1,46 +0,0 @@ -package me.zhengjie.entity; - -import com.baomidou.mybatisplus.extension.activerecord.Model; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; -import me.zhengjie.utils.excel.ExcelExport; - -/** - * 信用卡信息(CtCard)表实体类 导出模版对象信息 - * - * @author rch - * @since 2022-07-07 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class CtCardExportTemple extends Model { - /** 卡号 */ - @ExcelExport(value = "卡号") - private String number; - /** PIN码 */ -// @ExcelExport(value = "PIN码") -// private String pinNumber; - /** 密码 */ - @ExcelExport(value = "密码") - private String pwd; - /** 有效期 */ - @ExcelExport(value = "有效期(文本:yyyy-MM-dd)") - private String termOfValidity; - /** 信用卡类型 1.Payoneer 2.万事达虚拟卡 3.Visa信用卡 */ - @ExcelExport(value = "信用卡类型", kv = "1-Payoneer;2-万事达虚拟卡;3-Visa信用卡") - private Integer type; - /** 所属厂商:1.AmzKeys 2.Airwallex */ - @ExcelExport(value = "所属厂商", kv = "1-AmzKeys;2-Airwallex") - private Integer cardDealer; - /** 状态:1.正常、2.异常、3.已删除 */ - @ExcelExport(value = "状态", kv = "1-正常;2-异常;3-已删除") - private Integer status; - /** 持卡人姓氏 */ - @ExcelExport(value = "持卡人姓氏") - private String holderSurname; - /** 持卡人名称 */ - @ExcelExport(value = "持卡人名称") - private String holderName; -} \ No newline at end of file diff --git a/wjcy-common/src/main/java/me/zhengjie/entity/CtCardImport.java b/wjcy-common/src/main/java/me/zhengjie/entity/CtCardImport.java deleted file mode 100644 index 16f2235..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/entity/CtCardImport.java +++ /dev/null @@ -1,96 +0,0 @@ -package me.zhengjie.entity; - -import com.baomidou.mybatisplus.annotation.FieldFill; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.extension.activerecord.Model; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; -import me.zhengjie.utils.excel.ExcelImport; - -import java.math.BigDecimal; -import java.util.Date; - -/** - * 信用卡信息(CtCard)表实体类 Import - * - * @author rch - * @since 2022-07-07 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class CtCardImport extends Model { - - /** Excel 行号 */ - private int rowNum; - - /** Excel 错误提示 */ - private String rowTips; - - @TableId(value = "id", type = IdType.AUTO) - private Long id; - @TableField(fill = FieldFill.INSERT) - private String createdAt; - @TableField(fill = FieldFill.INSERT_UPDATE) - private String updatedAt; - /** 操作人账号*/ - @TableField(fill = FieldFill.INSERT_UPDATE) - private String gmName; - - /** 父ID */ - private Long parentId; - /** 卡号 */ - @ExcelImport(value = "卡号", required = true, unique = true) - private String number; -// /** PIN码 */ -// @ExcelImport(value = "PIN码", required = true, unique = true) -// private String pinNumber; - /** 持卡人姓氏 */ - @ExcelImport(value = "持卡人姓氏") - private String holderSurname; - /** 持卡人名称 */ - @ExcelImport(value = "持卡人名称") - private String holderName; - /** 有效期 */ - @ExcelImport(value = "有效期(文本:yyyy-MM-dd)", required = true) - private String termOfValidity; - /** 余额 */ - private BigDecimal balance; - /** 累计消费 */ - private BigDecimal sumConsume; - /** 开卡日期 */ - private Date openDate; - /** 所属国家 */ - private String contntryShort; - /** 信用卡类型 1.Payoneer 2.万事达虚拟卡 3.Visa信用卡 */ - @ExcelImport(value = "信用卡类型", kv = "1-Payoneer;2-万事达虚拟卡;3-Visa信用卡", required = true) - private Integer type; - /** 所属厂商:1.AmzKeys 2.Airwallex */ - @ExcelImport(value = "所属厂商", kv = "1-AmzKeys;2-Airwallex", required = true) - private Integer cardDealer; - /** 身份证号 */ - private String idNumber; - /** 省份 */ - private String province; - /** 城市 */ - private String country; - /** 地址 */ - private String address; - /** 手机号 */ - private String phone; - /** 邮箱 */ - private String email; - /** 登陆账号 */ - private String account; - /** 密码 */ - @ExcelImport(value = "密码") - private String pwd; - /** 状态:1.正常、2.异常、3.已删除 */ - @ExcelImport(value = "状态", kv = "1-正常;2-异常;3-已删除", required = true) - private Integer status; - /** 备注 */ - private String remarks; -} \ No newline at end of file diff --git a/wjcy-common/src/main/java/me/zhengjie/entity/CtCardInfo.java b/wjcy-common/src/main/java/me/zhengjie/entity/CtCardInfo.java deleted file mode 100644 index 70d4443..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/entity/CtCardInfo.java +++ /dev/null @@ -1,22 +0,0 @@ -package me.zhengjie.entity; - - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * Card(CtCard)表实体类 - * - * @author zhw - * @since 2022-07-14 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class CtCardInfo { - /** id */ - private Long id; - /** 信用卡卡号 */ - private String number; -} diff --git a/wjcy-common/src/main/java/me/zhengjie/entity/CtClickFarmSupplyMentYdParams.java b/wjcy-common/src/main/java/me/zhengjie/entity/CtClickFarmSupplyMentYdParams.java deleted file mode 100644 index e700dee..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/entity/CtClickFarmSupplyMentYdParams.java +++ /dev/null @@ -1,41 +0,0 @@ -package me.zhengjie.entity; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * 刷单补录 - * - * @author rch - * @since 2022-08-16 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class CtClickFarmSupplyMentYdParams { - - private Long id; - /** 刷单类型 */ - private Integer paramsType; - /** 国家 */ - private String country; - /** 账号 */ - private String account; - /** 密码 */ - private String pwd; - /** vpn分享链接 */ - private String vpnShare; - - /** item */ - private String item; - /** 有效期 */ - private String termOfValidity; - /** 信用卡持卡人名称 */ - private String cardName; - /** 信用卡卡号 */ - private String cardNumber; - /** 信用卡密码 */ - private String cardPwd; -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/entity/CtClickFarmYdParams.java b/wjcy-common/src/main/java/me/zhengjie/entity/CtClickFarmYdParams.java deleted file mode 100644 index 489e5b1..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/entity/CtClickFarmYdParams.java +++ /dev/null @@ -1,59 +0,0 @@ -package me.zhengjie.entity; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import javax.validation.constraints.NotBlank; - -/** - * 刷单信息 影刀参数 - * - * @author rch - * @since 2022-08-16 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class CtClickFarmYdParams { - - private Long id; - /** 刷单类型 */ - private Integer paramsType; - /** 国家 */ - private String country; - /** 账号 */ - private String account; - /** 密码 */ - private String pwd; - /** 关键词 */ - private String keyWord; - /** 数量 */ - private Integer number; - /** 规格 */ - private String specification; - /** 颜色 */ - private String color; - /** item */ - private String item; - private String exchange; - /** 最小价格区间 */ - private String sectionMin; - /** 最大价格区间 */ - private String sectionMax; - /** vpn分享链接 */ - private String vpnShare; - /** 链接 */ - private String link; - /** 留言 */ - private String amessage; - /** 有效期 */ - private String termOfValidity; - /** 信用卡持卡人名称 */ - private String cardName; - /** 信用卡卡号 */ - private String cardNumber; - /** 信用卡密码 */ - private String cardPwd; -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/entity/CtClickFarming.java b/wjcy-common/src/main/java/me/zhengjie/entity/CtClickFarming.java deleted file mode 100644 index e46c75a..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/entity/CtClickFarming.java +++ /dev/null @@ -1,70 +0,0 @@ -package me.zhengjie.entity; - -import com.baomidou.mybatisplus.annotation.FieldFill; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.extension.activerecord.Model; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * 刷单Excel信息(CtClickFarming)表实体类 - * - * @author rch - * @since 2022-08-16 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class CtClickFarming extends Model { - - @TableId(value = "id", type = IdType.AUTO) - private Long id; - @TableField(fill = FieldFill.INSERT) - private String createdAt; - @TableField(fill = FieldFill.INSERT_UPDATE) - private String updatedAt; - /** 操作人账号*/ - @TableField(fill = FieldFill.INSERT_UPDATE) - private String gmName; - - /** 关联刷单订单ID */ - private Long ctClickOrderId; - /** 买家id */ - private Long buyerId; - /** 刷单类型 */ - private Integer paramsType; - /** 店铺名称 */ - private String shopName; - /** 关键词 */ - private String keyWord; - /** 标题 */ - private String title; - /** 链接 */ - private String link; - /** 数量 */ - private Integer number; - /** 规格 */ - private String specification; - /** 颜色 */ - private String color; - /** item */ - private String item; - /** 优惠劵 */ - private String exchange; - /** 最小价格区间 */ - private String sectionMin; - /** 最大价格区间 */ - private String sectionMax; - /** 执行结果 */ - private String response; - /** 支付订单ID */ - private String payOrderId; - /** 状态 1.待执行 2.执行中 3.执行成功 4.执行失败 */ - private Integer status; - /** 留言 */ - private String amessage; -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/entity/CtClickFarmingExport.java b/wjcy-common/src/main/java/me/zhengjie/entity/CtClickFarmingExport.java deleted file mode 100644 index d26f1cf..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/entity/CtClickFarmingExport.java +++ /dev/null @@ -1,59 +0,0 @@ -package me.zhengjie.entity; - -import com.baomidou.mybatisplus.extension.activerecord.Model; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; -import me.zhengjie.utils.excel.ExcelExport; -import me.zhengjie.utils.excel.ExcelImport; - -/** - * 刷单信息信息(CtCard)表实体类 Import - * - * @author rch - * @since 2022-08-16 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class CtClickFarmingExport { - /** 国家 */ - @ExcelExport(value = "国家") - private String country; - /** 账号 */ - @ExcelExport(value = "账号") - private String account; - /** 密码 */ - @ExcelExport(value = "密码") - private String pwd; - /** 店铺名称 */ - @ExcelExport(value = "店铺名称") - private String shopName; - /** 关键词 */ - @ExcelExport(value = "关键词") - private String keyWord; - /** 标题 */ - @ExcelExport(value = "标题") - private String title; - /** 链接 */ - @ExcelExport(value = "链接") - private String link; - /** 数量 */ - @ExcelExport(value = "数量") - private Integer number; - /** 规格 */ - @ExcelExport(value = "规格") - private String specification; - /** 颜色 */ - @ExcelExport(value = "颜色") - private String color; - /** item */ - @ExcelExport(value = "item") - private String item; - /** vpn分享链接 */ - @ExcelExport(value = "vpn分享链接") - private String vpnShare; - /** 异常信息 */ - @ExcelExport(value = "异常信息") - private String error; -} \ No newline at end of file diff --git a/wjcy-common/src/main/java/me/zhengjie/entity/CtClickFarmingExportTemp.java b/wjcy-common/src/main/java/me/zhengjie/entity/CtClickFarmingExportTemp.java deleted file mode 100644 index 2f3d623..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/entity/CtClickFarmingExportTemp.java +++ /dev/null @@ -1,53 +0,0 @@ -package me.zhengjie.entity; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; -import me.zhengjie.utils.excel.ExcelExport; - -/** - * 刷单信息信息(CtCard)表实体类 Import - * - * @author rch - * @since 2022-08-16 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class CtClickFarmingExportTemp { - /** 账号 */ - @ExcelExport(value = "账号") - private String account; - /** 商品属性类型:1.关键词 2.链接 */ - @ExcelExport(value = "商品属性类型", kv = "1-关键词;2-链接") - private Integer paramsType; - /** 店铺名称 */ - @ExcelExport(value = "店铺名称") - private String shopName; - /** 关键词 */ - @ExcelExport(value = "关键词") - private String keyWord; - /** 标题 */ - @ExcelExport(value = "标题") - private String title; - /** 链接 */ - @ExcelExport(value = "链接") - private String link; - /** 数量 */ - @ExcelExport(value = "数量") - private Integer number; - /** 规格 */ - @ExcelExport(value = "规格") - private String specification; - /** 颜色 */ - @ExcelExport(value = "颜色") - private String color; - @ExcelExport(value = "优惠卷") - private String exchange; - /** 商品item */ - @ExcelExport(value = "商品item") - private String item; - /** 留言 */ - @ExcelExport(value = "留言") - private String amessage; -} \ No newline at end of file diff --git a/wjcy-common/src/main/java/me/zhengjie/entity/CtClickFarmingImport.java b/wjcy-common/src/main/java/me/zhengjie/entity/CtClickFarmingImport.java deleted file mode 100644 index 2144533..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/entity/CtClickFarmingImport.java +++ /dev/null @@ -1,64 +0,0 @@ -package me.zhengjie.entity; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; -import me.zhengjie.utils.excel.ExcelImport; - -/** - * 刷单信息信息(CtCard)表实体类 Import - * - * @author rch - * @since 2022-08-16 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class CtClickFarmingImport { - - /** Excel 行号 */ - private int rowNum; - - /** Excel 错误提示 */ - private String rowTips; - - /** 买家id */ - private Long buyerId; - - /** 账号 */ - @ExcelImport(value = "账号", required = true, unique = true) - private String account; - /** 商品属性类型:1.关键词 2.链接 */ - @ExcelImport(value = "商品属性类型", kv = "1-关键词; 2-链接") - private Integer paramsType; - /** 店铺名称 */ - @ExcelImport(value = "店铺名称") - private String shopName; - /** 关键词 */ - @ExcelImport(value = "关键词") - private String keyWord; - /** 标题 */ - @ExcelImport(value = "标题") - private String title; - /** 链接 */ - @ExcelImport(value = "链接") - private String link; - /** 数量 */ - @ExcelImport(value = "数量") - private Integer number; - /** 规格 */ - @ExcelImport(value = "规格") - private String specification; - /** 颜色 */ - @ExcelImport(value = "颜色") - private String color; - /** item */ - @ExcelImport(value = "商品item") - private String item; - /** 优惠劵 */ - @ExcelImport(value = "优惠卷") - private String exchange; - /** 留言 */ - @ExcelImport(value = "留言", required = true) - private String amessage; -} \ No newline at end of file diff --git a/wjcy-common/src/main/java/me/zhengjie/entity/CtClickFarmingOrderInfo.java b/wjcy-common/src/main/java/me/zhengjie/entity/CtClickFarmingOrderInfo.java deleted file mode 100644 index 280ca9c..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/entity/CtClickFarmingOrderInfo.java +++ /dev/null @@ -1,37 +0,0 @@ -package me.zhengjie.entity; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * 刷单订单信息详情(刷单信息+订单信息) - * - * @author rch - * @since 2022-08-16 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class CtClickFarmingOrderInfo { - - private Long id; - /** 国家 */ - private String country; - /** 账号 */ - private String account; - /** 密码 */ - private String pwd; - /** vpn分享链接 */ - private String vpnShare; - - /** 订单id */ - private String orderId; - /** 评论 */ - private String comment; - /** 状态 1.待执行 2.执行中 3.执行成功 4.执行失败 */ - private Integer status; - /** 图片地址 */ - private String paths; -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/entity/CtClickOrder.java b/wjcy-common/src/main/java/me/zhengjie/entity/CtClickOrder.java deleted file mode 100644 index 9e1ed52..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/entity/CtClickOrder.java +++ /dev/null @@ -1,55 +0,0 @@ -package me.zhengjie.entity; - -import com.baomidou.mybatisplus.annotation.FieldFill; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.extension.activerecord.Model; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * 刷单-订单信息(CtClickOrder)表实体类 - * - * @author rch - * @since 2022-09-14 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class CtClickOrder extends Model { - @TableId(value = "id", type = IdType.AUTO) - private Long id; - @TableField(fill = FieldFill.INSERT) - private String createdAt; - @TableField(fill = FieldFill.INSERT_UPDATE) - private String updatedAt; - /** 操作人账号*/ - @TableField(fill = FieldFill.INSERT_UPDATE) - private String gmName; - /** 公司ID */ - private Long companyId; - /** 类型 1.导入 2.刷单*/ - private Integer type; - /** 总金额 */ - private String amount; - /** 状态描述 */ - private String paymentResults; - /** 店铺名称 */ - private String shop; - /** 购买数量 */ - private String pricesNumber; - /** 订单id */ - private String orderId; - /** 商品名称 */ - private String shopName; - /** 时间 */ - private String orderDate; - /** 评论 */ - private String comment; - /** 图片地址 */ - private String paths; - /** 状态 1.待执行 2.执行中 3.执行成功 4.执行失败 */ - private Integer status; -} diff --git a/wjcy-common/src/main/java/me/zhengjie/entity/CtClickOrderExport.java b/wjcy-common/src/main/java/me/zhengjie/entity/CtClickOrderExport.java deleted file mode 100644 index 3e2935e..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/entity/CtClickOrderExport.java +++ /dev/null @@ -1,37 +0,0 @@ -package me.zhengjie.entity; - - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; -import me.zhengjie.utils.excel.ExcelExport; - -/** - * 刷单订单实体类 导出模版对象信息 - * - * @author rch - * @since 2022-09-27 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class CtClickOrderExport { - - /** 公司名称 */ - @ExcelExport(value = "公司名称") - private String companyName; - /** 总金额 */ - @ExcelExport(value = "总金额") - private String amount; - /** 店铺名称 */ - @ExcelExport(value = "店铺名称") - private String shop; - /** 订单id */ - @ExcelExport(value = "订单id") - private String orderId; - /** 评论 */ - @ExcelExport(value = "评论") - private String comment; - @ExcelExport(value = "异常信息") - private String error; -} diff --git a/wjcy-common/src/main/java/me/zhengjie/entity/CtClickOrderExportTemple.java b/wjcy-common/src/main/java/me/zhengjie/entity/CtClickOrderExportTemple.java deleted file mode 100644 index 49e25f7..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/entity/CtClickOrderExportTemple.java +++ /dev/null @@ -1,39 +0,0 @@ -package me.zhengjie.entity; - - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; -import me.zhengjie.utils.excel.ExcelExport; -import me.zhengjie.utils.excel.ExcelImport; - -/** - * 刷单订单实体类 导出模版对象信息 - * - * @author rch - * @since 2022-09-27 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class CtClickOrderExportTemple { - - /** 平台名称 */ - @ExcelExport(value = "平台名称") - private Integer platformId; - /** 公司名称 */ - @ExcelExport(value = "公司名称") - private Long companyId; - /** 总金额 */ - @ExcelExport(value = "总金额") - private String amount; - /** 店铺名称 */ - @ExcelExport(value = "店铺名称") - private String shop; - /** 订单id */ - @ExcelExport(value = "订单id") - private String orderId; - /** 评论 */ - @ExcelExport(value = "评论") - private String comment; -} diff --git a/wjcy-common/src/main/java/me/zhengjie/entity/CtClickOrderImport.java b/wjcy-common/src/main/java/me/zhengjie/entity/CtClickOrderImport.java deleted file mode 100644 index a4695dc..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/entity/CtClickOrderImport.java +++ /dev/null @@ -1,40 +0,0 @@ -package me.zhengjie.entity; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; -import me.zhengjie.utils.excel.ExcelExport; -import me.zhengjie.utils.excel.ExcelImport; - -/** - * Vpn信息(CtVpn)表实体类 Import - * - * @author rch - * @since 2022-09-27 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class CtClickOrderImport { - private int rowNum; - - private String rowTips; - - /** 公司ID */ - private Long companyId; - /** 公司名称 */ - @ExcelImport(value = "公司名称", required = true) - private String companyName; - /** 总金额 */ - @ExcelImport(value = "总金额", required = true) - private String amount; - /** 店铺名称 */ - @ExcelImport(value = "店铺名称", required = true) - private String shop; - /** 订单id */ - @ExcelImport(value = "订单id", required = true) - private String orderId; - /** 评论 */ - @ExcelImport(value = "评论") - private String comment; -} diff --git a/wjcy-common/src/main/java/me/zhengjie/entity/CtClickOrderYdParams.java b/wjcy-common/src/main/java/me/zhengjie/entity/CtClickOrderYdParams.java deleted file mode 100644 index 9a1b5e6..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/entity/CtClickOrderYdParams.java +++ /dev/null @@ -1,33 +0,0 @@ -package me.zhengjie.entity; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * 刷单订单影刀参数 - * - * @author rch - * @since 2022-10-21 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class CtClickOrderYdParams { - private Long id; - /** 国家 */ - private String country; - /** 账号 */ - private String account; - /** 密码 */ - private String pwd; - /** vpn分享链接 */ - private String vpnShare; - /** 订单id */ - private String orderId; - /** 评论 */ - private String comment; - /** 图片 */ - private String paths; - -} diff --git a/wjcy-common/src/main/java/me/zhengjie/entity/CtCompany.java b/wjcy-common/src/main/java/me/zhengjie/entity/CtCompany.java deleted file mode 100644 index eff48bf..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/entity/CtCompany.java +++ /dev/null @@ -1,43 +0,0 @@ -package me.zhengjie.entity; - -import com.baomidou.mybatisplus.annotation.FieldFill; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.extension.activerecord.Model; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * 公司信息(CtCompany)表实体类 - * - * @author rch - * @since 2022-06-23 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class CtCompany extends Model { - - @TableId(value = "id", type = IdType.AUTO) - private Long id; - @TableField(fill = FieldFill.INSERT) - private String createdAt; - @TableField(fill = FieldFill.INSERT_UPDATE) - private String updatedAt; - /** 操作人账号*/ - @TableField(fill = FieldFill.INSERT_UPDATE) - private String gmName; - /** 名称 */ - private String name; - /** 地址 */ - private String address; - /** 电话 */ - private String phone; - /** 商户码(公司调用api公司唯一标识) */ - private String number; - /** 商户token(公司调用api公司token身份标识) */ - private String token; -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/entity/CtCompanyInfo.java b/wjcy-common/src/main/java/me/zhengjie/entity/CtCompanyInfo.java deleted file mode 100644 index de0f007..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/entity/CtCompanyInfo.java +++ /dev/null @@ -1,23 +0,0 @@ -package me.zhengjie.entity; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * 公司信息(CtCompany)表实体类 - * - * @author zhw - * @since 2022-07-14 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class CtCompanyInfo { - - /** id */ - private Long id; - /** 名称 */ - private String name; - -} diff --git a/wjcy-common/src/main/java/me/zhengjie/entity/CtDhPay.java b/wjcy-common/src/main/java/me/zhengjie/entity/CtDhPay.java deleted file mode 100644 index 222896e..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/entity/CtDhPay.java +++ /dev/null @@ -1,44 +0,0 @@ -package me.zhengjie.entity; - -import com.baomidou.mybatisplus.annotation.FieldFill; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.extension.activerecord.Model; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.Date; - -/** - * 平台信息(CtDyPay)表实体类 - * - * @author rch - * @since 2022-07-28 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class CtDhPay extends Model { - - @TableId(value = "id", type = IdType.AUTO) - private Long id; - @TableField(fill = FieldFill.INSERT) - private String createdAt; - @TableField(fill = FieldFill.INSERT_UPDATE) - private String updatedAt; - /** 操作人账号*/ - @TableField(fill = FieldFill.INSERT_UPDATE) - private String gmName; - - /** 买家名称 */ - private String buyerName; - /** 支付订单ID(敦煌的) */ - private String orderId; - /** 请求响应详情 */ - private String response; - /** 状态 0.待处理 1.支付成功 2.支付失败 */ - private Integer status; -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/entity/CtDhPayExport.java b/wjcy-common/src/main/java/me/zhengjie/entity/CtDhPayExport.java deleted file mode 100644 index 3586977..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/entity/CtDhPayExport.java +++ /dev/null @@ -1,29 +0,0 @@ -package me.zhengjie.entity; - -import com.baomidou.mybatisplus.extension.activerecord.Model; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; -import me.zhengjie.utils.excel.ExcelExport; - -/** - * 敦煌支付信息(CtDhPay)表实体类 Export - * - * @author rch - * @since 2022-07-28 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class CtDhPayExport extends Model { - /** 买家名称 */ - @ExcelExport(value = "买家账号") - private String buyerName; - /** 支付订单ID(敦煌的) */ - @ExcelExport(value = "支付订单") - private String orderId; - - /** 异常信息 */ - @ExcelExport(value = "异常信息") - private String error; -} \ No newline at end of file diff --git a/wjcy-common/src/main/java/me/zhengjie/entity/CtDhPayExportTemple.java b/wjcy-common/src/main/java/me/zhengjie/entity/CtDhPayExportTemple.java deleted file mode 100644 index 4f5614e..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/entity/CtDhPayExportTemple.java +++ /dev/null @@ -1,25 +0,0 @@ -package me.zhengjie.entity; - -import com.baomidou.mybatisplus.extension.activerecord.Model; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; -import me.zhengjie.utils.excel.ExcelExport; - -/** - * 敦煌支付信息(CtDhPay)表实体类 导出模版对象信息 - * - * @author rch - * @since 2022-07-28 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class CtDhPayExportTemple extends Model { - /** 买家名称 */ - @ExcelExport(value = "买家账号") - private String buyerName; - /** 支付订单ID(敦煌的) */ - @ExcelExport(value = "支付订单") - private String orderId; -} \ No newline at end of file diff --git a/wjcy-common/src/main/java/me/zhengjie/entity/CtDhPayImport.java b/wjcy-common/src/main/java/me/zhengjie/entity/CtDhPayImport.java deleted file mode 100644 index 863019c..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/entity/CtDhPayImport.java +++ /dev/null @@ -1,40 +0,0 @@ -package me.zhengjie.entity; - -import com.baomidou.mybatisplus.annotation.FieldFill; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.extension.activerecord.Model; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; -import me.zhengjie.utils.excel.ExcelImport; - -import java.math.BigDecimal; -import java.util.Date; - -/** - * 敦煌支付信息(CtDhPay)表实体类 Import - * - * @author rch - * @since 2022-07-28 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class CtDhPayImport{ - - /** Excel 行号 */ - private int rowNum; - - /** Excel 错误提示 */ - private String rowTips; - - /** 买家名称 */ - @ExcelImport(value = "买家账号", required = true, unique = true) - private String buyerName; - - /** 支付订单ID(敦煌的) */ - @ExcelImport(value = "支付订单", required = true, unique = true) - private String orderId; -} \ No newline at end of file diff --git a/wjcy-common/src/main/java/me/zhengjie/entity/CtExcel.java b/wjcy-common/src/main/java/me/zhengjie/entity/CtExcel.java deleted file mode 100644 index 4c9bef7..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/entity/CtExcel.java +++ /dev/null @@ -1,41 +0,0 @@ -package me.zhengjie.entity; - -import com.baomidou.mybatisplus.annotation.FieldFill; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.extension.activerecord.Model; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * Excel 导入信息(CtExcel)表实体类 - * - * @author rch - * @since 2022-06-23 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class CtExcel extends Model { - - @TableId(value = "id", type = IdType.AUTO) - private Long id; - @TableField(fill = FieldFill.INSERT) - private String createdAt; - @TableField(fill = FieldFill.INSERT_UPDATE) - private String updatedAt; - /** 操作人账号*/ - @TableField(fill = FieldFill.INSERT_UPDATE) - private String gmName; - - /** 备注 */ - private String remarks; - /** excel路径 */ - - private String path; - private String errorPath; - /** 状态 1.待导入 2.导入成功 3.导入失败 */ - private Integer status; -} diff --git a/wjcy-common/src/main/java/me/zhengjie/entity/CtExcelExportInfo.java b/wjcy-common/src/main/java/me/zhengjie/entity/CtExcelExportInfo.java deleted file mode 100644 index f9954c3..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/entity/CtExcelExportInfo.java +++ /dev/null @@ -1,40 +0,0 @@ -package me.zhengjie.entity; - -import com.baomidou.mybatisplus.extension.activerecord.Model; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; -import me.zhengjie.utils.excel.ExcelExport; - -/** - * Excel 导出信息(CtExcelImportInfo)表实体类 - * - * @author rch - * @since 2022-07-18 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class CtExcelExportInfo extends Model { - - /** 公司主键 */ - @ExcelExport("公司主键") - private Long companyId; - - /** 鉴权枚举 */ - @ExcelExport("鉴权枚举") - private Long tokenEnum; - - /** 订单来源 */ - @ExcelExport("订单来源") - private String fromDetailInfo; - - /** 产品信息-JSON */ - @ExcelExport("产品信息") - private String cartList; - - /** 异常信息 */ - @ExcelExport(value = "异常信息") - private String error; -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/entity/CtExcelExportTemple.java b/wjcy-common/src/main/java/me/zhengjie/entity/CtExcelExportTemple.java deleted file mode 100644 index cd9499b..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/entity/CtExcelExportTemple.java +++ /dev/null @@ -1,33 +0,0 @@ -package me.zhengjie.entity; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; -import me.zhengjie.utils.excel.ExcelExport; - -/** - * EXCEL(CtExcel)表实体类 导出excel模板 - * @author zhw - * @since 2022-07-18 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class CtExcelExportTemple { - - /** 公司主键 */ - @ExcelExport("公司主键") - private Long companyId; - - /** 鉴权枚举 */ - @ExcelExport("鉴权枚举") - private Long tokenEnum; - - /** 订单来源 */ - @ExcelExport("订单来源") - private String fromDetailInfo; - - /** 产品信息-JSON */ - @ExcelExport("产品信息") - private String cartList; -} diff --git a/wjcy-common/src/main/java/me/zhengjie/entity/CtExcelImportInfo.java b/wjcy-common/src/main/java/me/zhengjie/entity/CtExcelImportInfo.java deleted file mode 100644 index 153b8ca..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/entity/CtExcelImportInfo.java +++ /dev/null @@ -1,59 +0,0 @@ -package me.zhengjie.entity; - -import com.baomidou.mybatisplus.annotation.FieldFill; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.extension.activerecord.Model; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; -import me.zhengjie.utils.excel.ExcelImport; - -/** - * Excel导入信息(CtExcelImportInfo)表实体类 - * - * @author rch - * @since 2022-06-23 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class CtExcelImportInfo extends Model { - - @TableId(value = "id", type = IdType.AUTO) - private Long id; - @TableField(fill = FieldFill.INSERT) - private String createdAt; - @TableField(fill = FieldFill.INSERT_UPDATE) - private String updatedAt; - /** 操作人账号*/ - @TableField(fill = FieldFill.INSERT_UPDATE) - private String gmName; - - /** 公司主键 */ - @ExcelImport("公司主键") - private Long companyId; - - /** 鉴权枚举 */ - @ExcelImport("鉴权枚举") - private Long tokenEnum; - - /** 订单来源 */ - @ExcelImport("订单来源") - private String fromDetailInfo; - - /** 产品信息-JSON */ - @ExcelImport("产品信息") - private String cartList; - - /** 订单收货地址-JSON */ - private String contactInfo; - - /** 我们平台订单编号 */ - private String orderNo; - - /** 状态 1.待处理 2.处理成功 3.处理失败 */ - private Integer status; -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/entity/CtOrder.java b/wjcy-common/src/main/java/me/zhengjie/entity/CtOrder.java deleted file mode 100644 index 8117c8b..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/entity/CtOrder.java +++ /dev/null @@ -1,55 +0,0 @@ -package me.zhengjie.entity; - -import com.baomidou.mybatisplus.annotation.FieldFill; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.extension.activerecord.Model; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * (CtOrder)表实体类 - * - * @author rch - * @since 2022-06-30 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class CtOrder extends Model { - - @TableId(value = "id", type = IdType.AUTO) - private Long id; - @TableField(fill = FieldFill.INSERT) - private String createdAt; - @TableField(fill = FieldFill.INSERT_UPDATE) - private String updatedAt; - - /** 公司Id */ - private Long companyId; - /** ExcelId 信息 */ - private Long excelInfoId; - /** 买家ID */ - private Long buyerId; - /** 买家buy_access_token */ - private String buyAccessToken; - /** 我们平台订单编号 */ - private String ctOrderNo; - /** 订单号,下单成功响应的订单号(冗余字段 下单成功响应订单信息里有) */ - private Long orderNo; - /** 下单成功响应的产品id( a,b,c 格式) (响应字段很多,先少些几个) */ - private Long responseProductId; - /** 下单成功响应的订单地址id(响应字段很多,先少些几个) */ - private Long responseOrderAddressId; - /** 下单成功响应的订单信息 (响应字段很多,先少些几个) */ - private Long responseOrderId; - /** 响应码信息 */ - private String orderResponseStatus; - /** 响应码信息 */ - private String payResponseStatus; - /** 状态 1.待支付(下单成功) 2.支付成功 3.支付失败*/ - private Integer status; -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/entity/CtParamContactInfo.java b/wjcy-common/src/main/java/me/zhengjie/entity/CtParamContactInfo.java deleted file mode 100644 index 2feb27c..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/entity/CtParamContactInfo.java +++ /dev/null @@ -1,39 +0,0 @@ -package me.zhengjie.entity; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * 下单API请求参数订单收货地址信息 - * - * @author rch - * @since 2022-06-23 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class CtParamContactInfo { - /** 必须 所在国家; 示例值:US 所在国家 */ - private String country; - /** 必须 收货人lastname ;示例值:zhao 收货人firstname */ - private String firstname; - /** 必须 收货人联系电话,固定电话或者移动电话 ;示例值:1311111111 收货人联系电话,固定电话或者移动电话 */ - private String tel; - /** 否 收货人地址1 ;示例值:chengfulu road, hawio 收货人地址2 */ - private String addressline2; - /** 必须 所在州 ;示例值:California 所在州 */ - private String state; - /** 必须 所在城市; 示例值:Chicago 所在城市 */ - private String city; - /** 必须 收货人地址1 ;示例值:chengfulu road, hawio 收货人地址1 */ - private String addressline1; - /** 必须 地址邮编 ;示例值:12345 地址邮编 */ - private String postalcode; - /** 必须 收货人lastname ;示例值:yiyi 收货人lastname */ - private String lastname; - /** 否 税号:BR,AR,EC,AO,LB,TR,KR必填 税号 */ - private String vatNumber; - /** 否 Email地址 ;示例值:zhaoyiyi@163.com Email地址 */ - private String email; -} diff --git a/wjcy-common/src/main/java/me/zhengjie/entity/CtParamProduct.java b/wjcy-common/src/main/java/me/zhengjie/entity/CtParamProduct.java deleted file mode 100644 index 0a8a937..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/entity/CtParamProduct.java +++ /dev/null @@ -1,29 +0,0 @@ -package me.zhengjie.entity; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * 下单Api请求产品信息参数实体类 - * - * @author rch - * @since 2022-06-23 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class CtParamProduct { - /** 必须 产品购买数量 示例值:2 产品数量 */ - private Integer quantity; - /** 否 可以从获取商品运费详情API获取expressType字段(分销API>物流API>dh.dropshipping.ship.get$1.0);示例值:ePacket 物流方式 */ - private String shipType; - /** 否 可根据国家字典查询国家详情(dh.base.countrys.get$1.0); 示例值:CN;默认值:CN 备货国家ID */ - private String stockin; - /** 否 站点 站点 */ - private String siteId; - /** 必须 产品itemcode ;示例值:634706114 产品编码 */ - private Long itemcode; - /** 必须 产品skuMd5,可以从商品详情API获取(分析API>商品API>dh.dropshipping.item.get$1.0) ;示例值:562e86410bd37a7bb4170cfe6e03203f 产品skuMd5 */ - private String skuMd5; -} diff --git a/wjcy-common/src/main/java/me/zhengjie/entity/CtPlatform.java b/wjcy-common/src/main/java/me/zhengjie/entity/CtPlatform.java deleted file mode 100644 index 81ba872..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/entity/CtPlatform.java +++ /dev/null @@ -1,40 +0,0 @@ -package me.zhengjie.entity; - -import com.baomidou.mybatisplus.annotation.FieldFill; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.extension.activerecord.Model; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * 平台信息(CtPlatform)表实体类 - * - * @author rch - * @since 2022-06-23 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class CtPlatform extends Model { - - @TableId(value = "id", type = IdType.AUTO) - private Long id; - @TableField(fill = FieldFill.INSERT) - private String createdAt; - @TableField(fill = FieldFill.INSERT_UPDATE) - private String updatedAt; - /** 操作人账号*/ - @TableField(fill = FieldFill.INSERT_UPDATE) - private String gmName; - - /** 名称 */ - private String name; - /** 地址 */ - private String address; - /** 电话 */ - private String phone; -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/entity/CtRebot.java b/wjcy-common/src/main/java/me/zhengjie/entity/CtRebot.java deleted file mode 100644 index 9c6371d..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/entity/CtRebot.java +++ /dev/null @@ -1,41 +0,0 @@ -package me.zhengjie.entity; - -import com.baomidou.mybatisplus.annotation.FieldFill; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.extension.activerecord.Model; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.Date; - -/** - * 影刀设备-机器人信息(CtRebot)表实体类 - * - * @author rch - * @since 2022-07-23 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class CtRebot extends Model { - - @TableId(value = "id", type = IdType.AUTO) - private Long id; - @TableField(fill = FieldFill.INSERT) - private String createdAt; - @TableField(fill = FieldFill.INSERT_UPDATE) - private String updatedAt; - /** 操作人账号*/ - @TableField(fill = FieldFill.INSERT_UPDATE) - private String gmName; - - /** 机器人账号 */ - private String accountName; - /** 机器人Uuid信息 */ - private String robotClientUuid; - /** 状态 0.未占用 1.占用 */ - private Integer status; -} diff --git a/wjcy-common/src/main/java/me/zhengjie/entity/CtRebotExport.java b/wjcy-common/src/main/java/me/zhengjie/entity/CtRebotExport.java deleted file mode 100644 index c486f3b..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/entity/CtRebotExport.java +++ /dev/null @@ -1,31 +0,0 @@ -package me.zhengjie.entity; - -import com.baomidou.mybatisplus.annotation.FieldFill; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; -import me.zhengjie.utils.excel.ExcelExport; -import me.zhengjie.utils.excel.ExcelImport; - -/** - * 影刀机器人信息(ct_rebot) 导出 - * - * @Author zhw - * @Date 2022-07-25 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class CtRebotExport { - /** 机器人账号 */ - @ExcelExport(value = "机器人账号") - private String accountName; - /** 机器人Uuid信息 */ - @ExcelExport(value = "Uuid信息") - private String robotClientUuid; - @ExcelExport(value = "异常信息") - private String error; -} diff --git a/wjcy-common/src/main/java/me/zhengjie/entity/CtRebotExportTemple.java b/wjcy-common/src/main/java/me/zhengjie/entity/CtRebotExportTemple.java deleted file mode 100644 index d7c80f7..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/entity/CtRebotExportTemple.java +++ /dev/null @@ -1,24 +0,0 @@ -package me.zhengjie.entity; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; -import me.zhengjie.utils.excel.ExcelExport; - -/** - * 机器人模板EXCEL导出(ct_rebot) - * - * @Author zhw - * @Date 2022-07-23 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class CtRebotExportTemple { - /** 机器人账号 */ - @ExcelExport(value = "机器人账号") - private String accountName; - /** 机器人Uuid信息 */ - @ExcelExport(value = "Uuid信息") - private String robotClientUuid; -} diff --git a/wjcy-common/src/main/java/me/zhengjie/entity/CtRebotImport.java b/wjcy-common/src/main/java/me/zhengjie/entity/CtRebotImport.java deleted file mode 100644 index 54fe190..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/entity/CtRebotImport.java +++ /dev/null @@ -1,43 +0,0 @@ -package me.zhengjie.entity; - -import com.baomidou.mybatisplus.annotation.FieldFill; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; -import me.zhengjie.utils.excel.ExcelImport; - -/** - * 影刀机器人信息(ct_rebot) import - * - * @Author zhw - * @Date 2022-07-25 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class CtRebotImport { - - private int romNum; - private String rowTips; - - @TableId(value = "id", type = IdType.AUTO) - private Long id; - @TableField(fill = FieldFill.INSERT) - private String createdAt; - @TableField(fill = FieldFill.INSERT_UPDATE) - private String updatedAt; - /** 操作人账号*/ - @TableField(fill = FieldFill.INSERT_UPDATE) - private String gmName; - - /** 机器人账号 */ - @ExcelImport(value = "机器人账号", required = true) - private String accountName; - /** 机器人Uuid信息 */ - @ExcelImport(value = "Uuid信息", required = true) - private String robotClientUuid; - -} diff --git a/wjcy-common/src/main/java/me/zhengjie/entity/CtResponseOrder.java b/wjcy-common/src/main/java/me/zhengjie/entity/CtResponseOrder.java deleted file mode 100644 index 9d2e35f..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/entity/CtResponseOrder.java +++ /dev/null @@ -1,67 +0,0 @@ -package me.zhengjie.entity; - -import com.baomidou.mybatisplus.annotation.FieldFill; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.extension.activerecord.Model; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.Date; - -/** - * 下单成功响应订单商品信息(CtResponseOrder)表实体类 - * - * @author rch - * @since 2022-06-30 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class CtResponseOrder extends Model { - - @TableId(value = "id", type = IdType.AUTO) - private Long id; - @TableField(fill = FieldFill.INSERT) - private String createdAt; - @TableField(fill = FieldFill.INSERT_UPDATE) - private String updatedAt; - /** 操作人账号*/ - @TableField(fill = FieldFill.INSERT_UPDATE) - private String gmName; - - /** 运费 */ - private Double shipCost; - /** 产品总价 */ - private Double totalPriceOfProduct; - /** 备货期 */ - private Double leadingTime; - /** 订单总价 */ - private Double orderTotal; - /** 卖家Id */ - private String supplierId; - /** 卖家店铺coupon */ - private Double couponOfSeller; - /** 运输方式 */ - private String shipType; - /** 订单优惠 */ - private Double orderSave; - /** 税费手续费 */ - private Double taxCharge; - /** 买家Id */ - private String buyerId; - /** 税费 */ - private Double tax; - /** 促销折扣 */ - private Double promoDiscount; - /** 订单号--这个要特殊处理这个是对应响应的id字段 */ - private Long orderId; - /** DHcoupon */ - private Double couponDiscount; - /** 下单站点 */ - private String siteId; - /** 创建时间 */ - private Date createTime; -} \ No newline at end of file diff --git a/wjcy-common/src/main/java/me/zhengjie/entity/CtResponseOrderAddress.java b/wjcy-common/src/main/java/me/zhengjie/entity/CtResponseOrderAddress.java deleted file mode 100644 index cfecf60..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/entity/CtResponseOrderAddress.java +++ /dev/null @@ -1,53 +0,0 @@ -package me.zhengjie.entity; - -import com.baomidou.mybatisplus.annotation.FieldFill; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.extension.activerecord.Model; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * 下注成功订单响应收货地址信息(CtResponseOrderAddress)表实体类 - * - * @author rch - * @since 2022-06-30 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class CtResponseOrderAddress extends Model { - - @TableId(value = "id", type = IdType.AUTO) - private Long id; - @TableField(fill = FieldFill.INSERT) - private String createdAt; - @TableField(fill = FieldFill.INSERT_UPDATE) - private String updatedAt; - /** 操作人账号*/ - @TableField(fill = FieldFill.INSERT_UPDATE) - private String gmName; - - /** 地址1 */ - private String addressline1; - /** 国家 */ - private String country; - /** 州 */ - private String state; - /** 电话 */ - private String tel; - /** lastname */ - private String lastname; - /** 税号 */ - private String vatNumber; - /** 城市 */ - private String city; - /** 地址2 */ - private String addressline2; - /** firstname */ - private String firstname; - /** 邮政编码 */ - private String postalcode; -} \ No newline at end of file diff --git a/wjcy-common/src/main/java/me/zhengjie/entity/CtResponseOrderProduct.java b/wjcy-common/src/main/java/me/zhengjie/entity/CtResponseOrderProduct.java deleted file mode 100644 index 9682b76..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/entity/CtResponseOrderProduct.java +++ /dev/null @@ -1,96 +0,0 @@ -package me.zhengjie.entity; - -import com.baomidou.mybatisplus.annotation.FieldFill; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.extension.activerecord.Model; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.math.BigDecimal; -import java.util.Date; - -/** - * 下单订单响应产品信息(CtResponseOrderProduct)表实体类 - * - * @author rch - * @since 2022-06-30 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class CtResponseOrderProduct extends Model { - - @TableId(value = "id", type = IdType.AUTO) - private Long id; - @TableField(fill = FieldFill.INSERT) - private String createdAt; - @TableField(fill = FieldFill.INSERT_UPDATE) - private String updatedAt; - /** 操作人账号*/ - @TableField(fill = FieldFill.INSERT_UPDATE) - private String gmName; - - /** 秒杀类型 */ - private String flashDeals; - /** 卖家设置价格 */ - private Double prodPriceOrg; - /** 产品skuId */ - private String skuId; - /** 购买数量 */ - private Integer cateDispId; - /** 商品总金额 */ - private Double amount; - /** 发布类目id */ - private String catePubId; - /** 促销折扣 */ - private Double promDis; - /** 产品单位名称 */ - private String measureName; - /** 短描 */ - private String shortDescription; - /** 卖家承诺运达天数 */ - private Integer promiseDays; - /** 备货国家 */ - private String stockin; - /** 产品图片(小图) */ - private String thumbnailImage; - /** 是否为样品 */ - private String isSample; - /** 最终运费 */ - private Double shipCost; - /** 卖家Id */ - private String supplierId; - /** 跨店满减金额 */ - private BigDecimal crossReduceAmount; - /** 产品itemcode */ - private Integer itemcode; - /** buyer选择的运输方式 */ - private String shipType; - /** 销售价格 */ - private Double originPrice; - /** 产品长描地址 */ - private String htmlUrl; - /** 产品图片(大图) */ - private String imageUrl; - /** 最终价格 */ - private Double price; - /** 产品URL */ - private String productUrl; - /** 备注 */ - private String remark; - /** lots */ - private Integer lots; - /** 产品名称 */ - private String productName; - /** 产品Id */ - private String productId; - /** 产品skumd5 */ - private String skuMd5; - /** 创建时间 */ - private Date createTime; - /** 产品单位Id */ - private String measureId; -} \ No newline at end of file diff --git a/wjcy-common/src/main/java/me/zhengjie/entity/CtSettingSite.java b/wjcy-common/src/main/java/me/zhengjie/entity/CtSettingSite.java deleted file mode 100644 index a2209ea..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/entity/CtSettingSite.java +++ /dev/null @@ -1,43 +0,0 @@ -package me.zhengjie.entity; - - -import com.baomidou.mybatisplus.annotation.FieldFill; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.extension.activerecord.Model; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * 站点配置(CtSettingSite)表实体类 - * - * @author rch - * @since 2022-06-23 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class CtSettingSite extends Model { - - @TableId(value = "id", type = IdType.AUTO) - private Long id; - @TableField(fill = FieldFill.INSERT) - private String createdAt; - @TableField(fill = FieldFill.INSERT_UPDATE) - private String updatedAt; - /** 操作人账号*/ - @TableField(fill = FieldFill.INSERT_UPDATE) - private String gmName; - - /** 设置KEY */ - private String settingKey; - /** 设置value */ - private String settingValue; - /** 中文描述 */ - private String content; - /** 单位 */ - private String unit; -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/entity/CtVpn.java b/wjcy-common/src/main/java/me/zhengjie/entity/CtVpn.java deleted file mode 100644 index 7e613ab..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/entity/CtVpn.java +++ /dev/null @@ -1,55 +0,0 @@ -package me.zhengjie.entity; - -import com.baomidou.mybatisplus.annotation.FieldFill; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.extension.activerecord.Model; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * VPN信息表(CtVpn)表实体类 - * - * @author rch - * @since 2022-07-07 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class CtVpn extends Model { - - @TableId(value = "id", type = IdType.AUTO) - private Long id; - @TableField(fill = FieldFill.INSERT) - private String createdAt; - @TableField(fill = FieldFill.INSERT_UPDATE) - private String updatedAt; - /** 操作人账号*/ - @TableField(fill = FieldFill.INSERT_UPDATE) - private String gmName; - - /** 所属国家简称 */ - private String contntryShort; - /** IP地址 */ - private String ipAddress; - /** 父ip地址 */ - private String parentIpAddress; - /** 端口 */ - private Integer port; - /** 名称 */ - private String name; - /** 密码 */ - private String pwd; - /** VPS类型 1.传统 */ - private Integer vpsType; - /** 经销商 1.V2 */ - private Integer dealer; - /** mac地址 */ - private String mac; - /** 链接 */ - private String link; - /** 经销商 1.可用 2.禁用 */ - private Integer status; -} diff --git a/wjcy-common/src/main/java/me/zhengjie/entity/CtVpnExport.java b/wjcy-common/src/main/java/me/zhengjie/entity/CtVpnExport.java deleted file mode 100644 index cff274d..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/entity/CtVpnExport.java +++ /dev/null @@ -1,45 +0,0 @@ -package me.zhengjie.entity; - - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; -import me.zhengjie.utils.excel.ExcelExport; - -/** - * Vpn信息(CtCard)表实体类 export - * - * @author zhw - * @since 2022-07-13 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class CtVpnExport { - - /** 所属国家简称 */ - @ExcelExport(value = "所属国家简称") - private String contntryShort; - /** IP地址 */ - @ExcelExport(value = "IP地址") - private String ipAddress; - @ExcelExport(value = "端口") - private Integer port; - /** 名称 */ - @ExcelExport(value = "名称") - private String name; - /** 密码 */ - @ExcelExport(value = "密码") - private String pwd; - /** VPS类型 1.传统 */ - @ExcelExport(value = "VPS类型", kv = "1-传统") - private Integer vpsType; - /** 经销商 1.V2 */ - @ExcelExport(value = "经销商", kv = "1-V2") - private Integer dealer; - @ExcelExport(value = "链接") - private String link; - @ExcelExport(value = "异常信息") - private String error; - -} diff --git a/wjcy-common/src/main/java/me/zhengjie/entity/CtVpnExportTemple.java b/wjcy-common/src/main/java/me/zhengjie/entity/CtVpnExportTemple.java deleted file mode 100644 index 1e3bca1..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/entity/CtVpnExportTemple.java +++ /dev/null @@ -1,43 +0,0 @@ -package me.zhengjie.entity; - - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; -import me.zhengjie.utils.excel.ExcelExport; - -/** - * Vpn信息(CtVpn)表实体类 导出模版对象信息 - * - * @author zhw - * @since 2022-07-13 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class CtVpnExportTemple { - - /** 所属国家简称 */ - @ExcelExport(value = "所属国家简称", example = "中国") - private String contntryShort; - /** IP地址 */ - @ExcelExport(value = "IP地址", example = "192.0.0.1") - private String ipAddress; - @ExcelExport(value = "端口", example = "8088") - private Integer port; - /** 名称 */ - @ExcelExport(value = "名称", example = "示例") - private String name; - /** 密码 */ - @ExcelExport(value = "密码", example = "123123") - private String pwd; - /** VPS类型 1.传统 */ - @ExcelExport(value = "VPS类型", kv = "1-传统", example = "传统") - private Integer vpsType; - @ExcelExport(value = "链接", example = "vmess://ew0KICAidiI6ICIyIiwNCiAgInBzIjogIjEwNC4yMjEuMTk5LjgyIiwNCiAgImFkZCI6ICJ1cy1lczM0LmZvYmhlbHAuY29tIiwNCiAgInBvcnQiOiAiMzAwNDMiLA0KICAiaWQiOiAiYzA4NDk5ODQtZWNjNC01MzY3LTlmOTctYTI2ODljNTQ5N2QyIiwNCiAgImFpZCI6ICI2NCIsDQogICJzY3kiOiAiYXV0byIsDQogICJuZXQiOiAidGNwIiwNCiAgInR5cGUiOiAibm9uZSIsDQogICJob3N0IjogIiIsDQogICJwYXRoIjogIiIsDQogICJ0bHMiOiAiIiwNCiAgInNuaSI6ICIiDQp9") - private String link; - /** 经销商 1.V2 */ - @ExcelExport(value = "经销商", kv = "1-V2", example = "V2") - private Integer dealer; - -} diff --git a/wjcy-common/src/main/java/me/zhengjie/entity/CtVpnImport.java b/wjcy-common/src/main/java/me/zhengjie/entity/CtVpnImport.java deleted file mode 100644 index e1cb352..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/entity/CtVpnImport.java +++ /dev/null @@ -1,66 +0,0 @@ -package me.zhengjie.entity; - -import com.baomidou.mybatisplus.annotation.FieldFill; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; -import me.zhengjie.utils.excel.ExcelImport; - -/** - * Vpn信息(CtVpn)表实体类 Import - * - * @author zhw - * @since 2022-07-13 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class CtVpnImport { - private int rowNum; - - private String rowTips; - - @TableId(value = "id", type = IdType.AUTO) - private Long id; - @TableField(fill = FieldFill.INSERT) - private String createdAt; - @TableField(fill = FieldFill.INSERT_UPDATE) - private String updatedAt; - /** 操作人账号*/ - @TableField(fill = FieldFill.INSERT_UPDATE) - private String gmName; - - /** 所属国家简称 */ - @ExcelImport(value = "所属国家简称", required = true) - private String contntryShort; - /** IP地址 */ - @ExcelImport(value = "IP地址", required = true, unique = true) - private String ipAddress; - /** 父ip地址 */ - private String parentIpAddress; - /** 端口 */ - @ExcelImport(value = "端口", required = true) - private Integer port; - /** 名称 */ - @ExcelImport(value = "名称", required = true) - private String name; - /** 密码 */ - @ExcelImport(value = "密码", required = true) - private String pwd; - /** VPS类型 1.传统 */ - @ExcelImport(value = "VPS类型", kv = "1-传统", required = true) - private Integer vpsType; - /** 经销商 1.V2 */ - @ExcelImport(value = "经销商", kv = "1-V2", required = true) - private Integer dealer; - /** mac地址 */ - private String mac; - /** 链接 */ - @ExcelImport(value = "链接", required = true, maxLength = 2000) - private String link; - /** 状态 1.可用 2.禁用 */ - private Integer status; -} diff --git a/wjcy-common/src/main/java/me/zhengjie/entity/CtVpnInfo.java b/wjcy-common/src/main/java/me/zhengjie/entity/CtVpnInfo.java deleted file mode 100644 index 2fd174b..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/entity/CtVpnInfo.java +++ /dev/null @@ -1,23 +0,0 @@ -package me.zhengjie.entity; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - - -/** - * Vpn(CtVpn)表实体类 - * - * @author zhw - * @since 2022-07-14 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class CtVpnInfo { - - /** id */ - private Long id; - /** Ip地址 */ - private String ipAddress; -} diff --git a/wjcy-common/src/main/java/me/zhengjie/entity/DhAddCar.java b/wjcy-common/src/main/java/me/zhengjie/entity/DhAddCar.java deleted file mode 100644 index a0e2c3c..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/entity/DhAddCar.java +++ /dev/null @@ -1,48 +0,0 @@ -package me.zhengjie.entity; - -import java.util.Date; - -import com.baomidou.mybatisplus.annotation.FieldFill; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.extension.activerecord.Model; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.io.Serializable; - -/** - * 敦煌加入购物车(DhAddCar)表实体类 - * - * @author rch - * @since 2022-11-17 09:11:54 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class DhAddCar extends Model { - - @TableId(value = "id", type = IdType.AUTO) - private Long id; - @TableField(fill = FieldFill.INSERT) - private String createdAt; - @TableField(fill = FieldFill.INSERT_UPDATE) - private String updatedAt; - /** 操作人账号*/ - @TableField(fill = FieldFill.INSERT_UPDATE) - private String gmName; - - /** 买家ID */ - private Long buyerId; - /** 商品属性类型:1.关键词 2.链接 */ - private Integer paramsType; - /** 加购物车商品ids */ - private String carGoodIds; - /** 执行结果 */ - private String response; - /** 状态 1.待执行 2.执行中 3.加购成功 4.加购失败 5.下单成功 6.支付成功 7.抓单成功 8.抓单失败 */ - private Integer status; -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/entity/DhAddCarOrder.java b/wjcy-common/src/main/java/me/zhengjie/entity/DhAddCarOrder.java deleted file mode 100644 index 6c656d4..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/entity/DhAddCarOrder.java +++ /dev/null @@ -1,55 +0,0 @@ -package me.zhengjie.entity; - -import java.util.Date; - -import com.baomidou.mybatisplus.annotation.FieldFill; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.extension.activerecord.Model; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.io.Serializable; - -/** - * 敦煌-加购物车-订单(DhAddCarOrder)表实体类 - * - * @author rch - * @since 2022-11-17 09:11:58 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class DhAddCarOrder extends Model { - @TableId(value = "id", type = IdType.AUTO) - private Long id; - @TableField(fill = FieldFill.INSERT) - private String createdAt; - @TableField(fill = FieldFill.INSERT_UPDATE) - private String updatedAt; - /** 操作人账号*/ - @TableField(fill = FieldFill.INSERT_UPDATE) - private String gmName; - - /** 1.导入 2.刷单 */ - private Integer type; - /** 关联敦煌加购的id */ - private Long addCarId; -// /** 关联敦煌加购的ids */ -// private Long addCarIds; - /** 总金额 */ - private String amount; - /** 状态描述 */ - private String paymentResults; - /** 店铺名称 */ - private String shop; - /** 订单id */ - private String orderId; - /** 时间 */ - private String orderDate; - /** 状态 1.待执行 2.执行中 3.执行成功 4.执行失败 */ - private Integer status; -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/entity/DhCarGoods.java b/wjcy-common/src/main/java/me/zhengjie/entity/DhCarGoods.java deleted file mode 100644 index e19bc32..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/entity/DhCarGoods.java +++ /dev/null @@ -1,62 +0,0 @@ -package me.zhengjie.entity; - -import com.baomidou.mybatisplus.annotation.FieldFill; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.extension.activerecord.Model; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.Date; - -/** - * 敦煌-加入购物车商品信息(DhCarGoods)表实体类 - * - * @author makejava - * @since 2022-11-17 09:12:02 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class DhCarGoods extends Model { - - @TableId(value = "id", type = IdType.AUTO) - private Long id; - @TableField(fill = FieldFill.INSERT) - private String createdAt; - @TableField(fill = FieldFill.INSERT_UPDATE) - private String updatedAt; - /** 操作人账号*/ - @TableField(fill = FieldFill.INSERT_UPDATE) - private String gmName; - - /** 商品属性类型:1.关键词 2.链接 */ - private Integer paramsType; - /** 店铺名称 */ - private String shopName; - /** 关键词 */ - private String keyWord; - /** 标题 */ - private String title; - /** 链接 */ - private String link; - /** 数量 */ - private Integer number; - /** 规格 */ - private String specification; - /** 颜色 */ - private String color; - /** item */ - private String item; - /** 最小价格区间 */ - private String sectionMin; - /** 最大价格区间 */ - private String sectionMax; - /** 评论 */ - private String comment; - /** 图片url */ - private String paths; -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/entity/ExcelImportInfo.java b/wjcy-common/src/main/java/me/zhengjie/entity/ExcelImportInfo.java deleted file mode 100644 index 4090e67..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/entity/ExcelImportInfo.java +++ /dev/null @@ -1,38 +0,0 @@ -//package me.zhengjie.entity; -// -//import lombok.AllArgsConstructor; -//import lombok.Data; -//import lombok.NoArgsConstructor; -//import me.zhengjie.utils.excel.ExcelImport; -// -///** -// * Excel导入信息实体类 -// * -// * @author rch -// * @create 2022-06-23 -// */ -//@Data -//@AllArgsConstructor -//@NoArgsConstructor -//public class ExcelImportInfo { -// /** 公司主键 */ -// @ExcelImport("公司主键") -// private Long companyId; -// -// /** 鉴权枚举 */ -// @ExcelImport("鉴权枚举") -// private Integer tokenEnum; -// -// /** 订单来源 */ -// @ExcelImport("订单来源") -// private String fromDetailInfo; -// -// /** 产品信息-JSON */ -// @ExcelImport("产品信息") -// private String cartList; -// -// /** 订单收货地址-JSON */ -// @ExcelImport("订单收货地址") -// private String contactInfo; -// -//} diff --git a/wjcy-common/src/main/java/me/zhengjie/entity/LoginIp.java b/wjcy-common/src/main/java/me/zhengjie/entity/LoginIp.java deleted file mode 100644 index 8a20668..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/entity/LoginIp.java +++ /dev/null @@ -1,39 +0,0 @@ -package me.zhengjie.entity; - -import com.baomidou.mybatisplus.annotation.FieldFill; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.extension.activerecord.Model; -import lombok.Data; - -/** - * (LoginIp)表实体类 - * - * @author rch - * @since 2022-06-23 - */ -@Data -public class LoginIp extends Model { - - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - @TableField(fill = FieldFill.INSERT) - private String createdAt; - @TableField(fill = FieldFill.INSERT_UPDATE) - private String updatedAt; - - /** 开始IP */ - private String ipStart; - /** 结束IP */ - private String ipEnd; - /** 备注 */ - private String remark; - /** 有效截至时间 */ - private String vaildTime; - /** 操作账号 */ - @TableField(fill = FieldFill.INSERT_UPDATE) - private String gmName; - -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/entity/QueryWrapperAndPage.java b/wjcy-common/src/main/java/me/zhengjie/entity/QueryWrapperAndPage.java deleted file mode 100644 index 48d8f52..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/entity/QueryWrapperAndPage.java +++ /dev/null @@ -1,15 +0,0 @@ -package me.zhengjie.entity; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@AllArgsConstructor -@NoArgsConstructor -public class QueryWrapperAndPage { - QueryWrapper queryWrapper; - Page page; -} diff --git a/wjcy-common/src/main/java/me/zhengjie/entity/ResultObj.java b/wjcy-common/src/main/java/me/zhengjie/entity/ResultObj.java deleted file mode 100644 index 21e6c83..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/entity/ResultObj.java +++ /dev/null @@ -1,20 +0,0 @@ -package me.zhengjie.entity; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * 影刀回调响应-resultObj - * - * @author rch - * @create 2022-08-23 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class ResultObj { - private String name; - private String type; - private String value; -} diff --git a/wjcy-common/src/main/java/me/zhengjie/entity/ReturnObje.java b/wjcy-common/src/main/java/me/zhengjie/entity/ReturnObje.java deleted file mode 100644 index 46d863c..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/entity/ReturnObje.java +++ /dev/null @@ -1,28 +0,0 @@ -package me.zhengjie.entity; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.List; - -/** - * 影刀回调返回值-ReturnObj - * - * @author rch - * @create 2022-08-23 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class ReturnObje { - private String msg; - private List result; - private String jobUuid; - private String robotClientName; - private String robotName; - private String robotClientUuid; - private String startTime; - private String endTime; - private String status; -} diff --git a/wjcy-common/src/main/java/me/zhengjie/entity/SysQuartzJob.java b/wjcy-common/src/main/java/me/zhengjie/entity/SysQuartzJob.java deleted file mode 100644 index cdab873..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/entity/SysQuartzJob.java +++ /dev/null @@ -1,70 +0,0 @@ -package me.zhengjie.entity; - -import java.util.Date; - -import com.baomidou.mybatisplus.annotation.FieldFill; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.extension.activerecord.Model; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import javax.validation.constraints.NotNull; -import java.io.Serializable; - -/** - * 定时任务(SysQuartzJob)表实体类 - * - * @author rch - * @since 2022-07-20 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class SysQuartzJob extends Model { - - public static final String JOB_KEY = "JOB_KEY"; - - @TableId(value = "job_id", type = IdType.AUTO) - private Long jobId; - - private String createTime; - private String updateTime; - /** 操作人账号*/ - @TableField(fill = FieldFill.INSERT_UPDATE) - private String gmName; - - private Long taskNum; - /** 类型 1.普通 2.影刀 */ - private Integer type; - /** Spring Bean名称 */ - private String beanName; - /** cron 表达式 */ - private String cronExpression; - /** 状态:1暂停、0启用 */ - private Integer isPause; - /** 任务名称 */ - private String jobName; - /** 方法名称 */ - private String methodName; - /** 参数 */ - private String params; - /** 参数类型 */ - private Integer paramsType; - /** 备注 */ - private String description; - /** 负责人 */ - private String personInCharge; - /** 报警邮箱 */ - private String email; - /** 子任务ID */ - private String subTask; - /** 任务失败后是否暂停 */ - private Integer pauseAfterFailure; - /** 创建者 */ - private String createBy; - /** 更新者 */ - private String updateBy; -} diff --git a/wjcy-common/src/main/java/me/zhengjie/entity/SysQuartzLog.java b/wjcy-common/src/main/java/me/zhengjie/entity/SysQuartzLog.java deleted file mode 100644 index 3ed54bf..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/entity/SysQuartzLog.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.entity; - -import com.baomidou.mybatisplus.extension.activerecord.Model; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.sql.Timestamp; - -/** - * @author rch - * @date 2022-07-20 - */ - -@Data -@AllArgsConstructor -@NoArgsConstructor -public class SysQuartzLog extends Model { - - private Long logId; - /** bean名称 */ - private String beanName; - /** 方法名称 */ - private String methodName; - - /** 参数 */ - private String params; - - /** cron表达式 */ - private String cronExpression; - - /** 状态 */ - private Boolean isSuccess; - - /** 异常详情 */ - private String exceptionDetail; - - /** 执行耗时 */ - private Long time; - - /** 创建时间 */ - private Timestamp createTime; -} diff --git a/wjcy-common/src/main/java/me/zhengjie/entity/YdSign.java b/wjcy-common/src/main/java/me/zhengjie/entity/YdSign.java deleted file mode 100644 index 7e69897..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/entity/YdSign.java +++ /dev/null @@ -1,32 +0,0 @@ -package me.zhengjie.entity; - -import com.baomidou.mybatisplus.annotation.FieldFill; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.extension.activerecord.Model; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * 影刀 鉴权 - * - * @author rch - * @since 2022-07-26 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class YdSign extends Model { - - /** 时间戳 */ - private Long timestamp; - /** accessKeyId */ - private String accessKeyId; - /** accessKeySecret */ - private String accessKeySecret; - /** bodyMd5 */ - private String bodyMd5; -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/entity/YdStartReturn.java b/wjcy-common/src/main/java/me/zhengjie/entity/YdStartReturn.java deleted file mode 100644 index abf9b72..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/entity/YdStartReturn.java +++ /dev/null @@ -1,24 +0,0 @@ -package me.zhengjie.entity; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * 调用影刀启动任务响应信息 - * - * @author rch - * @create 2022-08-24 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class YdStartReturn { - private String code; - private Boolean success; - private TaskUuid data; -} - -class TaskUuid { - private String taskUuid; -} diff --git a/wjcy-common/src/main/java/me/zhengjie/entity/quartz/Boss.java b/wjcy-common/src/main/java/me/zhengjie/entity/quartz/Boss.java deleted file mode 100644 index b6cd0db..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/entity/quartz/Boss.java +++ /dev/null @@ -1,23 +0,0 @@ -package me.zhengjie.entity.quartz; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.List; - -/** - * 调用影刀json信息 - * - * @author rch - * @create 2022-08-01 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class Boss { - private String accountName; - private String robotUuid; - private Long applyId; - private List params; -} diff --git a/wjcy-common/src/main/java/me/zhengjie/entity/quartz/DataInfo.java b/wjcy-common/src/main/java/me/zhengjie/entity/quartz/DataInfo.java deleted file mode 100644 index 97d9a32..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/entity/quartz/DataInfo.java +++ /dev/null @@ -1,19 +0,0 @@ -package me.zhengjie.entity.quartz; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * 调用影刀响应子集信息 - * - * @author rch - * @create 2022-08-01 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class DataInfo { - private String accessToken; - private String expiresIn; -} diff --git a/wjcy-common/src/main/java/me/zhengjie/entity/quartz/JobQueryByUuid.java b/wjcy-common/src/main/java/me/zhengjie/entity/quartz/JobQueryByUuid.java deleted file mode 100644 index f80e95d..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/entity/quartz/JobQueryByUuid.java +++ /dev/null @@ -1,18 +0,0 @@ -package me.zhengjie.entity.quartz; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * 根据影刀任务ID查询影刀任务执行信息 - * - * @author rch - * @create 2022-08-01 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class JobQueryByUuid { - private String jobUuid; -} diff --git a/wjcy-common/src/main/java/me/zhengjie/entity/quartz/JobQueryByUuidData.java b/wjcy-common/src/main/java/me/zhengjie/entity/quartz/JobQueryByUuidData.java deleted file mode 100644 index 54bc9f6..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/entity/quartz/JobQueryByUuidData.java +++ /dev/null @@ -1,28 +0,0 @@ -package me.zhengjie.entity.quartz; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * 根据影刀任务id 查询影刀任务详情信息 - * - * @author rch - * @create 2022-08-01 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class JobQueryByUuidData { - private JobQueryByUuidRobotParams robotParams; - private String jobUuid; - private String status; - private String statusName; - private String robotUuid; - private String robotName; - private String startTime; - private String endTime; - private String remark; - private String robotClientUuid; - private String robotClientName; -} diff --git a/wjcy-common/src/main/java/me/zhengjie/entity/quartz/JobQueryByUuidReturn.java b/wjcy-common/src/main/java/me/zhengjie/entity/quartz/JobQueryByUuidReturn.java deleted file mode 100644 index 3217b49..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/entity/quartz/JobQueryByUuidReturn.java +++ /dev/null @@ -1,93 +0,0 @@ -package me.zhengjie.entity.quartz; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * 根据影刀任务id 查询影刀任务详情信息 - * - * @author rch - * @create 2022-08-01 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class JobQueryByUuidReturn { - private String code; - private Boolean success; - private JobQueryByUuidData data; - - /** - * { - * "data": { - * "jobUuid": "e925cd35-6857-48ae-a4ef-40ceea975e50", - * "status": "error", - * "statusName": "异常", - * "robotUuid": "9107fa36-a6d0-4ac6-932f-8fcbb7deb89b", - * "robotName": "刷单系统", - * "startTime": "2022-09-09 15:14:32", - * "endTime": "2022-09-09 15:15:52", - * "remark": "【e925cd35-6857-48ae-a4ef-40ceea975e50】任务失败,在【1-2清空浏览器数据】中第1行:出错:The tab was closed.", - * "robotParams": { - * "inputs": [ - * { - * "name": "id", - * "value": "4", - * "type": "str" - * }, - * { - * "name": "country", - * "value": "Korea", - * "type": "str" - * }, - * { - * "name": "account", - * "value": "borislanphere553@gmail.com", - * "type": "str" - * }, - * { - * "name": "pwd", - * "value": "sdwjcy2021", - * "type": "str" - * }, - * { - * "name": "keyWord", - * "value": "neck electric massage", - * "type": "str" - * }, - * { - * "name": "number", - * "value": "10", - * "type": "str" - * }, - * { - * "name": "specification", - * "value": "type-c", - * "type": "str" - * }, - * { - * "name": "color", - * "value": "Full Function", - * "type": "str" - * }, - * { - * "name": "item", - * "value": "1005001346919788", - * "type": "str" - * }, - * { - * "name": "vpnShare", - * "value": "ew0KICAidiI6ICIyIiwNCiAgInBzIjogIjEwNC4yMjEuMTk5LjgyIiwNCiAgImFkZCI6ICJ1cy1lczM0LmZvYmhlbHAuY29tIiwNCiAgInBvcnQiOiAiMzAwNDMiLA0KICAiaWQiOiAiYzA4NDk5ODQtZWNjNC01MzY3LTlmOTctYTI2ODljNTQ5N2QyIiwNCiAgImFpZCI6ICI2NCIsDQogICJzY3kiOiAiYXV0byIsDQogICJuZXQiOiAidGNwIiwNCiAgInR5cGUiOiAibm9uZSIsDQogICJob3N0IjogIiIsDQogICJwYXRoIjogIiIsDQogICJ0bHMiOiAiIiwNCiAgInNuaSI6ICIiDQp9", - * "type": "str" - * } - * ] - * }, - * "robotClientUuid": "13d29cc7-3feb-46b5-a02c-66dced9dfeca", - * "robotClientName": "linbiaoyuan@vogocm" - * }, - * "code": 200, - * "success": true - * } - */ -} diff --git a/wjcy-common/src/main/java/me/zhengjie/entity/quartz/JobQueryByUuidRobotParams.java b/wjcy-common/src/main/java/me/zhengjie/entity/quartz/JobQueryByUuidRobotParams.java deleted file mode 100644 index 64c3501..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/entity/quartz/JobQueryByUuidRobotParams.java +++ /dev/null @@ -1,22 +0,0 @@ -package me.zhengjie.entity.quartz; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; -import me.zhengjie.entity.ResultObj; - -import java.util.List; - -/** - * 根据影刀任务id查询影刀 - * - * @author rch - * @create 2022-09-09 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class JobQueryByUuidRobotParams { - private List inputs; - private List outputs; -} diff --git a/wjcy-common/src/main/java/me/zhengjie/entity/quartz/JobQueryReturnResult.java b/wjcy-common/src/main/java/me/zhengjie/entity/quartz/JobQueryReturnResult.java deleted file mode 100644 index 5958ca9..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/entity/quartz/JobQueryReturnResult.java +++ /dev/null @@ -1,22 +0,0 @@ -package me.zhengjie.entity.quartz; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * 根据影刀任务id 查询影刀任务详情信息 - * - * @author rch - * @create 2022-08-01 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class JobQueryReturnResult { - private String id; - private String status; - private String statusName; - private String code; - private Boolean success; -} diff --git a/wjcy-common/src/main/java/me/zhengjie/entity/quartz/Param.java b/wjcy-common/src/main/java/me/zhengjie/entity/quartz/Param.java deleted file mode 100644 index 921efcd..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/entity/quartz/Param.java +++ /dev/null @@ -1,20 +0,0 @@ -package me.zhengjie.entity.quartz; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * 调用影刀真正入参信息 - * - * @author rch - * @create 2022-08-01 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class Param { - private String name; - private String value; - private String type = "str"; -} \ No newline at end of file diff --git a/wjcy-common/src/main/java/me/zhengjie/entity/quartz/Params.java b/wjcy-common/src/main/java/me/zhengjie/entity/quartz/Params.java deleted file mode 100644 index a5782be..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/entity/quartz/Params.java +++ /dev/null @@ -1,22 +0,0 @@ -package me.zhengjie.entity.quartz; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.List; - -/** - * 调用影刀json信息 params里的 params是一个跟业务相关的主建 - * - * @author rch - * @create 2022-08-01 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class Params { - private String accountName; - private Long applyId; - private String params; -} diff --git a/wjcy-common/src/main/java/me/zhengjie/entity/quartz/RebotStatu.java b/wjcy-common/src/main/java/me/zhengjie/entity/quartz/RebotStatu.java deleted file mode 100644 index 415baad..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/entity/quartz/RebotStatu.java +++ /dev/null @@ -1,19 +0,0 @@ -package me.zhengjie.entity.quartz; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * 机器人相应信息子集 - * - * @author rch - * @create 2022-08-01 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class RebotStatu { - private String robotClientUuid; - private String accountName; -} diff --git a/wjcy-common/src/main/java/me/zhengjie/entity/quartz/RebotStatuInfo.java b/wjcy-common/src/main/java/me/zhengjie/entity/quartz/RebotStatuInfo.java deleted file mode 100644 index 33f5e40..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/entity/quartz/RebotStatuInfo.java +++ /dev/null @@ -1,29 +0,0 @@ -package me.zhengjie.entity.quartz; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * 影刀机器人状态信息 - * - * @author rch - * @create 2022-08-01 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class RebotStatuInfo { - /** 状态 connected:已连接 idle:空闲 running:运行中 allocated:已分配 abnormal:异常 offline:离线 */ - private String status; - /** 机器人客户端ip */ - private String clientIp; - /** 机器人uuid */ - private String robotClientUuid; - /** 机器人名称 */ - private String robotClientName; - /** 机器人备注 */ - private String description; - /** 运行备注 */ - private String remark; -} diff --git a/wjcy-common/src/main/java/me/zhengjie/entity/quartz/RebotStatuReturn.java b/wjcy-common/src/main/java/me/zhengjie/entity/quartz/RebotStatuReturn.java deleted file mode 100644 index 20b7669..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/entity/quartz/RebotStatuReturn.java +++ /dev/null @@ -1,20 +0,0 @@ -package me.zhengjie.entity.quartz; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * 机器人相应信息 - * - * @author rch - * @create 2022-08-01 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class RebotStatuReturn { - private String code; - private Boolean success; - private RebotStatuInfo data; -} diff --git a/wjcy-common/src/main/java/me/zhengjie/entity/quartz/SecreInfo.java b/wjcy-common/src/main/java/me/zhengjie/entity/quartz/SecreInfo.java deleted file mode 100644 index c835970..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/entity/quartz/SecreInfo.java +++ /dev/null @@ -1,21 +0,0 @@ -package me.zhengjie.entity.quartz; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * 调用影刀相应信息 - * - * @author rch - * @create 2022-08-01 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class SecreInfo { - private String code; - private Boolean success; - private String requestId; - private DataInfo data; -} diff --git a/wjcy-common/src/main/java/me/zhengjie/entity/quartz/StartYdReturnInfo.java b/wjcy-common/src/main/java/me/zhengjie/entity/quartz/StartYdReturnInfo.java deleted file mode 100644 index fffefe0..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/entity/quartz/StartYdReturnInfo.java +++ /dev/null @@ -1,22 +0,0 @@ -package me.zhengjie.entity.quartz; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * 启动影刀任务响应信息 - * - * @author rch - * @create 2022-10-27 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class StartYdReturnInfo { - private String code; - private Boolean success; - private String requestId; - private String serverInstName; - private String msg; -} diff --git a/wjcy-common/src/main/java/me/zhengjie/enums/BuyerLevelEnum.java b/wjcy-common/src/main/java/me/zhengjie/enums/BuyerLevelEnum.java deleted file mode 100644 index cb93bf3..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/enums/BuyerLevelEnum.java +++ /dev/null @@ -1,77 +0,0 @@ -package me.zhengjie.enums; - -import me.zhengjie.enums.interfaces.IntegerEnum; -import org.apache.commons.lang3.EnumUtils; - -/** - *

- * 用户等级 1.普通 2.精品 3.压力 4.内部账号 - *

- * - * @Author rch - * @Date 2022-07-18 - **/ -public enum BuyerLevelEnum implements IntegerEnum { - /** - * 用户等级 1.普通 2.精品 3.压力 4.内部账号 - */ - - GENERAL(1), - BOUTIQUR(2), - PRESSURE(3), - INNER_ACCOUNT(4); - - private final Integer value; - - private BuyerLevelEnum(Integer value) { - this.value = value; - } - - - @Override - public Integer value() { - return this.value; - } - - /** - * 判断是否存在指定值 - * - * @param value - * @return - */ - public static boolean hasValue(Integer value) { - boolean hasVal = false; - if (getEnum(value) != null) { - hasVal = true; - } - return hasVal; - } - - /** - * 判断是否不存在指定值 - * - * @param value - * @return - */ - public static boolean notHasValue(Integer value) { - return !hasValue(value); - } - - /** - * 获取指定值对应的枚举 - * - * @param value - * @return - */ - public static BuyerLevelEnum getEnum(Integer value) { - if (value == null) { - return null; - } - for (BuyerLevelEnum obj : EnumUtils.getEnumList(BuyerLevelEnum.class)) { - if (obj.eqValue(value)) { - return obj; - } - } - return null; - } -} diff --git a/wjcy-common/src/main/java/me/zhengjie/enums/BuyerOccupyStatusEnum.java b/wjcy-common/src/main/java/me/zhengjie/enums/BuyerOccupyStatusEnum.java deleted file mode 100644 index 3c09adb..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/enums/BuyerOccupyStatusEnum.java +++ /dev/null @@ -1,75 +0,0 @@ -package me.zhengjie.enums; - -import me.zhengjie.enums.interfaces.IntegerEnum; -import org.apache.commons.lang3.EnumUtils; - -/** - *

- * 占用状态 1.已占用 2.未占用 - *

- * - * @Author rch - * @Date 2022-07-18 - **/ -public enum BuyerOccupyStatusEnum implements IntegerEnum { - /** - * 占用状态 1.已占用 2.未占用 - */ - - OCCUPIED(1), - UN_OCCUPIED(2); - - private final Integer value; - - private BuyerOccupyStatusEnum(Integer value) { - this.value = value; - } - - - @Override - public Integer value() { - return this.value; - } - - /** - * 判断是否存在指定值 - * - * @param value - * @return - */ - public static boolean hasValue(Integer value) { - boolean hasVal = false; - if (getEnum(value) != null) { - hasVal = true; - } - return hasVal; - } - - /** - * 判断是否不存在指定值 - * - * @param value - * @return - */ - public static boolean notHasValue(Integer value) { - return !hasValue(value); - } - - /** - * 获取指定值对应的枚举 - * - * @param value - * @return - */ - public static BuyerOccupyStatusEnum getEnum(Integer value) { - if (value == null) { - return null; - } - for (BuyerOccupyStatusEnum obj : EnumUtils.getEnumList(BuyerOccupyStatusEnum.class)) { - if (obj.eqValue(value)) { - return obj; - } - } - return null; - } -} diff --git a/wjcy-common/src/main/java/me/zhengjie/enums/BuyerStatusEnum.java b/wjcy-common/src/main/java/me/zhengjie/enums/BuyerStatusEnum.java deleted file mode 100644 index eb64052..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/enums/BuyerStatusEnum.java +++ /dev/null @@ -1,80 +0,0 @@ -package me.zhengjie.enums; - -import me.zhengjie.enums.interfaces.IntegerEnum; -import org.apache.commons.lang3.EnumUtils; - -/** - *

- * 状态(导入默认正常) 1.待注册 2待验证 3.待完善 4.正常 5.异常 6.可用但已用 7.删除 - *

- * - * @Author rch - * @Date 2022-06-23 - **/ -public enum BuyerStatusEnum implements IntegerEnum { - /** - * 状态(导入默认正常) 1.待注册 2待验证 3.待完善 4.正常 5.异常 6.可用但已用 7.删除', - */ - - TOBE_REGISTER(1), - TOBE_CHECKING(2), - TOBE_PERFECT(3), - NORMAL(4), - AB_NORMAL(5), - AVAILABLE_BUT_USED(6), - DEL(7); - - private final Integer value; - - private BuyerStatusEnum(Integer value) { - this.value = value; - } - - - @Override - public Integer value() { - return this.value; - } - - /** - * 判断是否存在指定值 - * - * @param value - * @return - */ - public static boolean hasValue(Integer value) { - boolean hasVal = false; - if (getEnum(value) != null) { - hasVal = true; - } - return hasVal; - } - - /** - * 判断是否不存在指定值 - * - * @param value - * @return - */ - public static boolean notHasValue(Integer value) { - return !hasValue(value); - } - - /** - * 获取指定值对应的枚举 - * - * @param value - * @return - */ - public static BuyerStatusEnum getEnum(Integer value) { - if (value == null) { - return null; - } - for (BuyerStatusEnum obj : EnumUtils.getEnumList(BuyerStatusEnum.class)) { - if (obj.eqValue(value)) { - return obj; - } - } - return null; - } -} diff --git a/wjcy-common/src/main/java/me/zhengjie/enums/CardDealerTypeEnum.java b/wjcy-common/src/main/java/me/zhengjie/enums/CardDealerTypeEnum.java deleted file mode 100644 index de8c646..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/enums/CardDealerTypeEnum.java +++ /dev/null @@ -1,75 +0,0 @@ -package me.zhengjie.enums; - -import me.zhengjie.enums.interfaces.IntegerEnum; -import org.apache.commons.lang3.EnumUtils; - -/** - *

- * 信用卡所属厂商类型 枚举 - *

- * - * @Author rch - * @Date 2022-07-09 - **/ -public enum CardDealerTypeEnum implements IntegerEnum { - /** - * 所属厂商:1.AmzKeys 2.Airwallex - */ - - AMZKEYS(1), - AIRWALLEX(2); - - private final Integer value; - - private CardDealerTypeEnum(Integer value) { - this.value = value; - } - - - @Override - public Integer value() { - return this.value; - } - - /** - * 判断是否存在指定值 - * - * @param value - * @return - */ - public static boolean hasValue(Integer value) { - boolean hasVal = false; - if (getEnum(value) != null) { - hasVal = true; - } - return hasVal; - } - - /** - * 判断是否不存在指定值 - * - * @param value - * @return - */ - public static boolean notHasValue(Integer value) { - return !hasValue(value); - } - - /** - * 获取指定值对应的枚举 - * - * @param value - * @return - */ - public static CardDealerTypeEnum getEnum(Integer value) { - if (value == null) { - return null; - } - for (CardDealerTypeEnum obj : EnumUtils.getEnumList(CardDealerTypeEnum.class)) { - if (obj.eqValue(value)) { - return obj; - } - } - return null; - } -} diff --git a/wjcy-common/src/main/java/me/zhengjie/enums/CardStatusEnum.java b/wjcy-common/src/main/java/me/zhengjie/enums/CardStatusEnum.java deleted file mode 100644 index 7c2966e..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/enums/CardStatusEnum.java +++ /dev/null @@ -1,76 +0,0 @@ -package me.zhengjie.enums; - -import me.zhengjie.enums.interfaces.IntegerEnum; -import org.apache.commons.lang3.EnumUtils; - -/** - *

- * 信用卡类状态枚举 - *

- * - * @Author rch - * @Date 2022-07-11 - **/ -public enum CardStatusEnum implements IntegerEnum { - /** - * 状态:1.正常、2.异常、3.已删除 - */ - - NORMAL(1), - AB_NORMAL(2), - DEL(3); - - private final Integer value; - - private CardStatusEnum(Integer value) { - this.value = value; - } - - - @Override - public Integer value() { - return this.value; - } - - /** - * 判断是否存在指定值 - * - * @param value - * @return - */ - public static boolean hasValue(Integer value) { - boolean hasVal = false; - if (getEnum(value) != null) { - hasVal = true; - } - return hasVal; - } - - /** - * 判断是否不存在指定值 - * - * @param value - * @return - */ - public static boolean notHasValue(Integer value) { - return !hasValue(value); - } - - /** - * 获取指定值对应的枚举 - * - * @param value - * @return - */ - public static CardStatusEnum getEnum(Integer value) { - if (value == null) { - return null; - } - for (CardStatusEnum obj : EnumUtils.getEnumList(CardStatusEnum.class)) { - if (obj.eqValue(value)) { - return obj; - } - } - return null; - } -} diff --git a/wjcy-common/src/main/java/me/zhengjie/enums/CardTypeEnum.java b/wjcy-common/src/main/java/me/zhengjie/enums/CardTypeEnum.java deleted file mode 100644 index 24db1b5..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/enums/CardTypeEnum.java +++ /dev/null @@ -1,76 +0,0 @@ -package me.zhengjie.enums; - -import me.zhengjie.enums.interfaces.IntegerEnum; -import org.apache.commons.lang3.EnumUtils; - -/** - *

- * 信用卡类型 枚举 - *

- * - * @Author rch - * @Date 2022-07-09 - **/ -public enum CardTypeEnum implements IntegerEnum { - /** - * 信用卡类型 1.Payoneer 2.万事达虚拟卡 3.Visa信用卡 - */ - - PAYONEER(1), - WSD_INVENTED(2), - VISA(3); - - private final Integer value; - - private CardTypeEnum(Integer value) { - this.value = value; - } - - - @Override - public Integer value() { - return this.value; - } - - /** - * 判断是否存在指定值 - * - * @param value - * @return - */ - public static boolean hasValue(Integer value) { - boolean hasVal = false; - if (getEnum(value) != null) { - hasVal = true; - } - return hasVal; - } - - /** - * 判断是否不存在指定值 - * - * @param value - * @return - */ - public static boolean notHasValue(Integer value) { - return !hasValue(value); - } - - /** - * 获取指定值对应的枚举 - * - * @param value - * @return - */ - public static CardTypeEnum getEnum(Integer value) { - if (value == null) { - return null; - } - for (CardTypeEnum obj : EnumUtils.getEnumList(CardTypeEnum.class)) { - if (obj.eqValue(value)) { - return obj; - } - } - return null; - } -} diff --git a/wjcy-common/src/main/java/me/zhengjie/enums/ClickBrowseStatusEnum.java b/wjcy-common/src/main/java/me/zhengjie/enums/ClickBrowseStatusEnum.java deleted file mode 100644 index 650fd7d..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/enums/ClickBrowseStatusEnum.java +++ /dev/null @@ -1,77 +0,0 @@ -package me.zhengjie.enums; - -import me.zhengjie.enums.interfaces.IntegerEnum; -import org.apache.commons.lang3.EnumUtils; - -/** - *

- * 浏览好评状态枚举 - *

- * - * @Author rch - * @Date 2022-11-07 - **/ -public enum ClickBrowseStatusEnum implements IntegerEnum { - /** - * 状态 1.待执行 2.执行中 3.执行成功 4.执行失败 - */ - - TOBE_EXECUTION(1), - IN_EXECUTION(2), - EXECUTION_SUCCESS(3), - EXECUTION_FAILE(4); - - private final Integer value; - - private ClickBrowseStatusEnum(Integer value) { - this.value = value; - } - - - @Override - public Integer value() { - return this.value; - } - - /** - * 判断是否存在指定值 - * - * @param value - * @return - */ - public static boolean hasValue(Integer value) { - boolean hasVal = false; - if (getEnum(value) != null) { - hasVal = true; - } - return hasVal; - } - - /** - * 判断是否不存在指定值 - * - * @param value - * @return - */ - public static boolean notHasValue(Integer value) { - return !hasValue(value); - } - - /** - * 获取指定值对应的枚举 - * - * @param value - * @return - */ - public static ClickBrowseStatusEnum getEnum(Integer value) { - if (value == null) { - return null; - } - for (ClickBrowseStatusEnum obj : EnumUtils.getEnumList(ClickBrowseStatusEnum.class)) { - if (obj.eqValue(value)) { - return obj; - } - } - return null; - } -} diff --git a/wjcy-common/src/main/java/me/zhengjie/enums/ClickFarmingStatusEnum.java b/wjcy-common/src/main/java/me/zhengjie/enums/ClickFarmingStatusEnum.java deleted file mode 100644 index 2f0ae99..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/enums/ClickFarmingStatusEnum.java +++ /dev/null @@ -1,79 +0,0 @@ -package me.zhengjie.enums; - -import me.zhengjie.enums.interfaces.IntegerEnum; -import org.apache.commons.lang3.EnumUtils; - -/** - *

- * 刷单状态枚举 - *

- * - * @Author rch - * @Date 2022-07-11 - **/ -public enum ClickFarmingStatusEnum implements IntegerEnum { - /** - * 状态 1.待执行 2.执行中 3.执行成功 4.执行失败 5.待支付 6.支付成功异常 (加购比较特殊 判断是否有订单号, 执行成功没有订单号是加购物车成功,区分抓单成功) - */ - - TOBE_EXECUTION(1), - IN_EXECUTION(2), - EXECUTION_SUCCESS(3), - EXECUTION_FAILE(4), - AWAITING_PAYMENT(5), - PAY_OK_ERROR(6); - - private final Integer value; - - private ClickFarmingStatusEnum(Integer value) { - this.value = value; - } - - - @Override - public Integer value() { - return this.value; - } - - /** - * 判断是否存在指定值 - * - * @param value - * @return - */ - public static boolean hasValue(Integer value) { - boolean hasVal = false; - if (getEnum(value) != null) { - hasVal = true; - } - return hasVal; - } - - /** - * 判断是否不存在指定值 - * - * @param value - * @return - */ - public static boolean notHasValue(Integer value) { - return !hasValue(value); - } - - /** - * 获取指定值对应的枚举 - * - * @param value - * @return - */ - public static ClickFarmingStatusEnum getEnum(Integer value) { - if (value == null) { - return null; - } - for (ClickFarmingStatusEnum obj : EnumUtils.getEnumList(ClickFarmingStatusEnum.class)) { - if (obj.eqValue(value)) { - return obj; - } - } - return null; - } -} diff --git a/wjcy-common/src/main/java/me/zhengjie/enums/ClickOrderStatusEnum.java b/wjcy-common/src/main/java/me/zhengjie/enums/ClickOrderStatusEnum.java deleted file mode 100644 index 5530634..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/enums/ClickOrderStatusEnum.java +++ /dev/null @@ -1,77 +0,0 @@ -package me.zhengjie.enums; - -import me.zhengjie.enums.interfaces.IntegerEnum; -import org.apache.commons.lang3.EnumUtils; - -/** - *

- * 刷单订单状态枚举 - *

- * - * @Author rch - * @Date 2022-07-11 - **/ -public enum ClickOrderStatusEnum implements IntegerEnum { - /** - * 状态 1.待执行 2.执行中 3.执行成功 4.执行失败 - */ - - TOBE_EXECUTION(1), - IN_EXECUTION(2), - EXECUTION_SUCCESS(3), - EXECUTION_FAILE(4); - - private final Integer value; - - private ClickOrderStatusEnum(Integer value) { - this.value = value; - } - - - @Override - public Integer value() { - return this.value; - } - - /** - * 判断是否存在指定值 - * - * @param value - * @return - */ - public static boolean hasValue(Integer value) { - boolean hasVal = false; - if (getEnum(value) != null) { - hasVal = true; - } - return hasVal; - } - - /** - * 判断是否不存在指定值 - * - * @param value - * @return - */ - public static boolean notHasValue(Integer value) { - return !hasValue(value); - } - - /** - * 获取指定值对应的枚举 - * - * @param value - * @return - */ - public static ClickOrderStatusEnum getEnum(Integer value) { - if (value == null) { - return null; - } - for (ClickOrderStatusEnum obj : EnumUtils.getEnumList(ClickOrderStatusEnum.class)) { - if (obj.eqValue(value)) { - return obj; - } - } - return null; - } -} diff --git a/wjcy-common/src/main/java/me/zhengjie/enums/CtReboteStatusEnum.java b/wjcy-common/src/main/java/me/zhengjie/enums/CtReboteStatusEnum.java deleted file mode 100644 index a4e828b..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/enums/CtReboteStatusEnum.java +++ /dev/null @@ -1,75 +0,0 @@ -package me.zhengjie.enums; - -import me.zhengjie.enums.interfaces.IntegerEnum; -import org.apache.commons.lang3.EnumUtils; - -/** - *

- * 机器人 状态0.未占用 1.占用 - *

- * - * @Author xxs - * @Date 2021/9/26 - **/ -public enum CtReboteStatusEnum implements IntegerEnum { - /** - * 状态0.未占用 1.占用 - */ - - UNOCCUPIED(0), - OCCUPY(1); - - private final Integer value; - - private CtReboteStatusEnum(Integer value) { - this.value = value; - } - - - @Override - public Integer value() { - return this.value; - } - - /** - * 判断是否存在指定值 - * - * @param value - * @return - */ - public static boolean hasValue(Integer value) { - boolean hasVal = false; - if (getEnum(value) != null) { - hasVal = true; - } - return hasVal; - } - - /** - * 判断是否不存在指定值 - * - * @param value - * @return - */ - public static boolean notHasValue(Integer value) { - return !hasValue(value); - } - - /** - * 获取指定值对应的枚举 - * - * @param value - * @return - */ - public static CtReboteStatusEnum getEnum(Integer value) { - if (value == null) { - return null; - } - for (CtReboteStatusEnum obj : EnumUtils.getEnumList(CtReboteStatusEnum.class)) { - if (obj.eqValue(value)) { - return obj; - } - } - return null; - } -} diff --git a/wjcy-common/src/main/java/me/zhengjie/enums/DhAddCarStatusEnum.java b/wjcy-common/src/main/java/me/zhengjie/enums/DhAddCarStatusEnum.java deleted file mode 100644 index 9c7ed42..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/enums/DhAddCarStatusEnum.java +++ /dev/null @@ -1,82 +0,0 @@ -package me.zhengjie.enums; - -import me.zhengjie.enums.interfaces.IntegerEnum; -import org.apache.commons.lang3.EnumUtils; - -/** - *

- * 敦煌加购状态枚举 - *

- * - * @Author rch - * @Date 2022-07-11 - **/ -public enum DhAddCarStatusEnum implements IntegerEnum { - /** - * 状态 1.待执行 2.执行中 3.加购成功 4.加购失败 5.下单成功 6.待抓单 7.抓单中 8.抓单成功 9.抓单失败 - */ - - TOBE_EXECUTION(1), - IN_EXECUTION(2), - Add_CARD_SUCCESS(3), - ADD_CARD_FAILE(4), - ORDER_SUCCESS(5), - TO_BE_CATCH_ORDER(6), - CATCH_ORDER_ING(7), - CATCH_ORDER_SUCCESS(8), - CATCH_ORDER_FAILE(9); - - private final Integer value; - - private DhAddCarStatusEnum(Integer value) { - this.value = value; - } - - - @Override - public Integer value() { - return this.value; - } - - /** - * 判断是否存在指定值 - * - * @param value - * @return - */ - public static boolean hasValue(Integer value) { - boolean hasVal = false; - if (getEnum(value) != null) { - hasVal = true; - } - return hasVal; - } - - /** - * 判断是否不存在指定值 - * - * @param value - * @return - */ - public static boolean notHasValue(Integer value) { - return !hasValue(value); - } - - /** - * 获取指定值对应的枚举 - * - * @param value - * @return - */ - public static DhAddCarStatusEnum getEnum(Integer value) { - if (value == null) { - return null; - } - for (DhAddCarStatusEnum obj : EnumUtils.getEnumList(DhAddCarStatusEnum.class)) { - if (obj.eqValue(value)) { - return obj; - } - } - return null; - } -} diff --git a/wjcy-common/src/main/java/me/zhengjie/enums/DhPayStatusEnum.java b/wjcy-common/src/main/java/me/zhengjie/enums/DhPayStatusEnum.java deleted file mode 100644 index a232181..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/enums/DhPayStatusEnum.java +++ /dev/null @@ -1,77 +0,0 @@ -package me.zhengjie.enums; - -import me.zhengjie.enums.interfaces.IntegerEnum; -import org.apache.commons.lang3.EnumUtils; - -/** - *

- * 敦煌支付状态枚举 - *

- * - * @Author rch - * @Date 2022-07-28 - **/ -public enum DhPayStatusEnum implements IntegerEnum { - /** - * 状态 0.待处理 1.支付成功 2.支付失败 - */ - - TO_BE(0), - PAY_SUCCESS(1), - PAY_FAIL(2), - DEL(3); - - private final Integer value; - - private DhPayStatusEnum(Integer value) { - this.value = value; - } - - - @Override - public Integer value() { - return this.value; - } - - /** - * 判断是否存在指定值 - * - * @param value - * @return - */ - public static boolean hasValue(Integer value) { - boolean hasVal = false; - if (getEnum(value) != null) { - hasVal = true; - } - return hasVal; - } - - /** - * 判断是否不存在指定值 - * - * @param value - * @return - */ - public static boolean notHasValue(Integer value) { - return !hasValue(value); - } - - /** - * 获取指定值对应的枚举 - * - * @param value - * @return - */ - public static DhPayStatusEnum getEnum(Integer value) { - if (value == null) { - return null; - } - for (DhPayStatusEnum obj : EnumUtils.getEnumList(DhPayStatusEnum.class)) { - if (obj.eqValue(value)) { - return obj; - } - } - return null; - } -} diff --git a/wjcy-common/src/main/java/me/zhengjie/enums/ExcelInfoRequestTypeEnum.java b/wjcy-common/src/main/java/me/zhengjie/enums/ExcelInfoRequestTypeEnum.java deleted file mode 100644 index 65a14d2..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/enums/ExcelInfoRequestTypeEnum.java +++ /dev/null @@ -1,75 +0,0 @@ -package me.zhengjie.enums; - -import me.zhengjie.enums.interfaces.IntegerEnum; -import org.apache.commons.lang3.EnumUtils; - -/** - *

- * 请求类型:1.下单请求 2.支付请求 - *

- * - * @Author rch - * @Date 2022-06-23 - **/ -public enum ExcelInfoRequestTypeEnum implements IntegerEnum { - /** - * 请求类型:1.下单请求 2.支付请求 - */ - - BUY_ORDER(1), - PAY_ORDER(2); - - private final Integer value; - - private ExcelInfoRequestTypeEnum(Integer value) { - this.value = value; - } - - - @Override - public Integer value() { - return this.value; - } - - /** - * 判断是否存在指定值 - * - * @param value - * @return - */ - public static boolean hasValue(Integer value) { - boolean hasVal = false; - if (getEnum(value) != null) { - hasVal = true; - } - return hasVal; - } - - /** - * 判断是否不存在指定值 - * - * @param value - * @return - */ - public static boolean notHasValue(Integer value) { - return !hasValue(value); - } - - /** - * 获取指定值对应的枚举 - * - * @param value - * @return - */ - public static ExcelInfoRequestTypeEnum getEnum(Integer value) { - if (value == null) { - return null; - } - for (ExcelInfoRequestTypeEnum obj : EnumUtils.getEnumList(ExcelInfoRequestTypeEnum.class)) { - if (obj.eqValue(value)) { - return obj; - } - } - return null; - } -} diff --git a/wjcy-common/src/main/java/me/zhengjie/enums/ExcelStatusEnum.java b/wjcy-common/src/main/java/me/zhengjie/enums/ExcelStatusEnum.java deleted file mode 100644 index 9cdce5e..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/enums/ExcelStatusEnum.java +++ /dev/null @@ -1,76 +0,0 @@ -package me.zhengjie.enums; - -import me.zhengjie.enums.interfaces.IntegerEnum; -import org.apache.commons.lang3.EnumUtils; - -/** - *

- * 状态1.待导入 2.导入成功 3.导入失败 - *

- * - * @Author rch - * @Date 2022-06-23 - **/ -public enum ExcelStatusEnum implements IntegerEnum { - /** - * 状态1.待导入 2.导入成功 3.导入失败 - */ - - TOBE(1), - SUCCESS(2), - FAILE(3); - - private final Integer value; - - private ExcelStatusEnum(Integer value) { - this.value = value; - } - - - @Override - public Integer value() { - return this.value; - } - - /** - * 判断是否存在指定值 - * - * @param value - * @return - */ - public static boolean hasValue(Integer value) { - boolean hasVal = false; - if (getEnum(value) != null) { - hasVal = true; - } - return hasVal; - } - - /** - * 判断是否不存在指定值 - * - * @param value - * @return - */ - public static boolean notHasValue(Integer value) { - return !hasValue(value); - } - - /** - * 获取指定值对应的枚举 - * - * @param value - * @return - */ - public static ExcelStatusEnum getEnum(Integer value) { - if (value == null) { - return null; - } - for (ExcelStatusEnum obj : EnumUtils.getEnumList(ExcelStatusEnum.class)) { - if (obj.eqValue(value)) { - return obj; - } - } - return null; - } -} diff --git a/wjcy-common/src/main/java/me/zhengjie/enums/LanguageEnum.java b/wjcy-common/src/main/java/me/zhengjie/enums/LanguageEnum.java deleted file mode 100644 index 79ce4d8..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/enums/LanguageEnum.java +++ /dev/null @@ -1,38 +0,0 @@ -package me.zhengjie.enums; - -/** - * 多语言枚举类 - * - * @author zeng - * @since 2021/08/24 10:08 - */ - -public enum LanguageEnum { - - ZH("简体中文"), - - EN("英文"), - - CW("繁体中文"), - ; - - private final String des; - - LanguageEnum(String des) { - this.des = des; - } - - public String getValue() { - return this.name().toLowerCase(); - } - - public static boolean isInclude(String language) { - for (LanguageEnum value : LanguageEnum.values()) { - if (value.getValue().equals(language)) { - return true; - } - } - return false; - } - -} diff --git a/wjcy-common/src/main/java/me/zhengjie/enums/OrderTypeEnum.java b/wjcy-common/src/main/java/me/zhengjie/enums/OrderTypeEnum.java deleted file mode 100644 index 238cda8..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/enums/OrderTypeEnum.java +++ /dev/null @@ -1,75 +0,0 @@ -package me.zhengjie.enums; - -import me.zhengjie.enums.interfaces.IntegerEnum; -import org.apache.commons.lang3.EnumUtils; - -/** - *

- * 刷单订单类型枚举 - *

- * - * @Author rch - * @Date 2022-10-24 - **/ -public enum OrderTypeEnum implements IntegerEnum { - /** - * 状态 1.导入 2.刷单 - */ - - IMPORT(1), - CLICK_FARMING(2); - - private final Integer value; - - private OrderTypeEnum(Integer value) { - this.value = value; - } - - - @Override - public Integer value() { - return this.value; - } - - /** - * 判断是否存在指定值 - * - * @param value - * @return - */ - public static boolean hasValue(Integer value) { - boolean hasVal = false; - if (getEnum(value) != null) { - hasVal = true; - } - return hasVal; - } - - /** - * 判断是否不存在指定值 - * - * @param value - * @return - */ - public static boolean notHasValue(Integer value) { - return !hasValue(value); - } - - /** - * 获取指定值对应的枚举 - * - * @param value - * @return - */ - public static OrderTypeEnum getEnum(Integer value) { - if (value == null) { - return null; - } - for (OrderTypeEnum obj : EnumUtils.getEnumList(OrderTypeEnum.class)) { - if (obj.eqValue(value)) { - return obj; - } - } - return null; - } -} diff --git a/wjcy-common/src/main/java/me/zhengjie/enums/ParamsTypeEnum.java b/wjcy-common/src/main/java/me/zhengjie/enums/ParamsTypeEnum.java deleted file mode 100644 index 59a9f18..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/enums/ParamsTypeEnum.java +++ /dev/null @@ -1,75 +0,0 @@ -package me.zhengjie.enums; - -import me.zhengjie.enums.interfaces.IntegerEnum; -import org.apache.commons.lang3.EnumUtils; - -/** - *

- * 参数类型类型 枚举 - *

- * - * @Author rch - * @Date 2022-07-09 - **/ -public enum ParamsTypeEnum implements IntegerEnum { - /** - * 商品属性类型:1.关键词 2.链接 - */ - - KEY_WORD(1), - LINK(2); - - private final Integer value; - - private ParamsTypeEnum(Integer value) { - this.value = value; - } - - - @Override - public Integer value() { - return this.value; - } - - /** - * 判断是否存在指定值 - * - * @param value - * @return - */ - public static boolean hasValue(Integer value) { - boolean hasVal = false; - if (getEnum(value) != null) { - hasVal = true; - } - return hasVal; - } - - /** - * 判断是否不存在指定值 - * - * @param value - * @return - */ - public static boolean notHasValue(Integer value) { - return !hasValue(value); - } - - /** - * 获取指定值对应的枚举 - * - * @param value - * @return - */ - public static ParamsTypeEnum getEnum(Integer value) { - if (value == null) { - return null; - } - for (ParamsTypeEnum obj : EnumUtils.getEnumList(ParamsTypeEnum.class)) { - if (obj.eqValue(value)) { - return obj; - } - } - return null; - } -} diff --git a/wjcy-common/src/main/java/me/zhengjie/enums/PlatTypeEnum.java b/wjcy-common/src/main/java/me/zhengjie/enums/PlatTypeEnum.java deleted file mode 100644 index 3b96ba6..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/enums/PlatTypeEnum.java +++ /dev/null @@ -1,92 +0,0 @@ -package me.zhengjie.enums; - -import org.apache.commons.lang3.EnumUtils; - -import java.util.Arrays; - -/** - *

- * 平台类型 1.敦煌 - *

- * - * @Author rch - * @Date 2022-07-06 - **/ -public enum PlatTypeEnum { - - //平台类型 1.敦煌 - DH(1, "敦煌"), - SMT(2, "速卖通"), - MB(3, "马帮"); - - - private final Integer type; - private final String desc; - - private PlatTypeEnum(Integer type, String desc) { - this.type = type; - this.desc = desc; - } - - public static String getDescByType(Integer type) { - if (type == null) { - return ""; - } - PlatTypeEnum[] enumAry = PlatTypeEnum.values(); - for(int i = 0; i < Arrays.asList(enumAry).size(); i++){ - if (enumAry[i].getType().equals(type)) { - return enumAry[i].getDesc(); - } - } - return ""; - } - - public static Integer getValueByDesc(String desc) { - PlatTypeEnum[] enumAry = PlatTypeEnum.values(); - for (PlatTypeEnum currencyTypeEnum : enumAry) { - if (currencyTypeEnum.getDesc().equals(desc)) { - return currencyTypeEnum.getType(); - } - } - return null; - } - - /** - * 获取指定值对应的枚举 - * - * @param value - * @return - */ - public static PlatTypeEnum getEnum(Integer value) { - if (value == null) { - return null; - } - for (PlatTypeEnum obj : EnumUtils.getEnumList(PlatTypeEnum.class)) { - if (obj.eqValue(value)) { - return obj; - } - } - return null; - } - - /** - * 值相等 - * - * @param value - * @return - */ - public boolean eqValue(Integer value) { - if (value != null && type.equals(value)) { - return true; - } - return false; - } - - public Integer getType() { - return type; - } - - public String getDesc() { - return desc; - } -} diff --git a/wjcy-common/src/main/java/me/zhengjie/enums/RobotStatusEnum.java b/wjcy-common/src/main/java/me/zhengjie/enums/RobotStatusEnum.java deleted file mode 100644 index adcaa1c..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/enums/RobotStatusEnum.java +++ /dev/null @@ -1,77 +0,0 @@ -package me.zhengjie.enums; - -import org.apache.commons.lang3.EnumUtils; - -/** - *

- * 机器人状态 枚举 - *

- * - * @Author rch - * @Date 2022-07-09 - **/ -public enum RobotStatusEnum{ - /** - * 状态 connected:已连接 idle:空闲 running:运行中 allocated:已分配 abnormal:异常 offline:离线 - */ - - CONNECTED("connected"), - IDLE("idle"), - RUNNING("running"), - ALLOCATED("allocated"), - ABNORMAL("abnormal"), - OFFLINE("offline"); - - private final String value; - - private RobotStatusEnum(String value) { - this.value = value; - } - - - public String value() { - return this.value; - } - - /** - * 判断是否存在指定值 - * - * @param value - * @return - */ - public static boolean hasValue(String value) { - boolean hasVal = false; - if (getEnum(value) != null) { - hasVal = true; - } - return hasVal; - } - - /** - * 判断是否不存在指定值 - * - * @param value - * @return - */ - public static boolean notHasValue(String value) { - return !hasValue(value); - } - - /** - * 获取指定值对应的枚举 - * - * @param value - * @return - */ - public static RobotStatusEnum getEnum(String value) { - if (value == null) { - return null; - } - for (RobotStatusEnum obj : EnumUtils.getEnumList(RobotStatusEnum.class)) { - if (obj.value().equals(value)) { - return obj; - } - } - return null; - } -} diff --git a/wjcy-common/src/main/java/me/zhengjie/enums/TaskInfoEnum.java b/wjcy-common/src/main/java/me/zhengjie/enums/TaskInfoEnum.java deleted file mode 100644 index 421bff1..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/enums/TaskInfoEnum.java +++ /dev/null @@ -1,54 +0,0 @@ -package me.zhengjie.enums; - -import java.util.Arrays; - -/** - *

- * Task 信息枚举 包含task基本信息 - *

- * - * @Author rch - * @Date 2022-08-01 - **/ -public enum TaskInfoEnum { - - // 1.Demo-Task - BOSS_TASK("bossTask", "run"), - CLICK_FARMING("clickFarmTask", "run"), - CLICK_FARMING_SUPPLE_MENY("clickFarmSuppleMentTask", "run"), - WELL_RECEIVED("wellReceivedTask", "run"), - BROWSE("browseTask", "run"), - DH_ADD_CAR_FARMING("dhAddCarTask", "run"), - DH_ADD_CAR_CATCH_ORDER("dhCatchOrderTask", "run"), - DH_WELL_RECEIVED("dhWellReceivedTask", "run"); - - - private final String taskName; - private final String methodName; - - private TaskInfoEnum(String taskName, String methodName) { - this.taskName = taskName; - this.methodName = methodName; - } - - public static String getMethodNameByTaskName(String taskName) { - if (taskName == null) { - return ""; - } - TaskInfoEnum[] enumAry = TaskInfoEnum.values(); - for(int i = 0; i < Arrays.asList(enumAry).size(); i++){ - if (enumAry[i].getTaskName().equals(taskName)) { - return enumAry[i].getMethodName(); - } - } - return ""; - } - - public String getTaskName() { - return taskName; - } - - public String getMethodName() { - return methodName; - } -} diff --git a/wjcy-common/src/main/java/me/zhengjie/enums/TaskIsPauseEnum.java b/wjcy-common/src/main/java/me/zhengjie/enums/TaskIsPauseEnum.java deleted file mode 100644 index 440f9f0..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/enums/TaskIsPauseEnum.java +++ /dev/null @@ -1,75 +0,0 @@ -package me.zhengjie.enums; - -import me.zhengjie.enums.interfaces.IntegerEnum; -import org.apache.commons.lang3.EnumUtils; - -/** - *

- * 状态 1.暂停 2.启用 - *

- * - * @Author rch - * @Date 2022-10-06 - **/ -public enum TaskIsPauseEnum implements IntegerEnum { - /** - * 类型 1.暂停 0.启用 - */ - - IS_PAUSE(1), - NOT_PAUSE(0); - - private final Integer value; - - private TaskIsPauseEnum(Integer value) { - this.value = value; - } - - - @Override - public Integer value() { - return this.value; - } - - /** - * 判断是否存在指定值 - * - * @param value - * @return - */ - public static boolean hasValue(Integer value) { - boolean hasVal = false; - if (getEnum(value) != null) { - hasVal = true; - } - return hasVal; - } - - /** - * 判断是否不存在指定值 - * - * @param value - * @return - */ - public static boolean notHasValue(Integer value) { - return !hasValue(value); - } - - /** - * 获取指定值对应的枚举 - * - * @param value - * @return - */ - public static TaskIsPauseEnum getEnum(Integer value) { - if (value == null) { - return null; - } - for (TaskIsPauseEnum obj : EnumUtils.getEnumList(TaskIsPauseEnum.class)) { - if (obj.eqValue(value)) { - return obj; - } - } - return null; - } -} diff --git a/wjcy-common/src/main/java/me/zhengjie/enums/TaskTypeEnum.java b/wjcy-common/src/main/java/me/zhengjie/enums/TaskTypeEnum.java deleted file mode 100644 index 6f25196..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/enums/TaskTypeEnum.java +++ /dev/null @@ -1,75 +0,0 @@ -package me.zhengjie.enums; - -import me.zhengjie.enums.interfaces.IntegerEnum; -import org.apache.commons.lang3.EnumUtils; - -/** - *

- * 类型 1.普通 2.影刀 - *

- * - * @Author rch - * @Date 2022-07-20 - **/ -public enum TaskTypeEnum implements IntegerEnum { - /** - * 类型 1.普通 2.影刀 - */ - - ORDINARY(1), - SHADOW_KNIFE(2); - - private final Integer value; - - private TaskTypeEnum(Integer value) { - this.value = value; - } - - - @Override - public Integer value() { - return this.value; - } - - /** - * 判断是否存在指定值 - * - * @param value - * @return - */ - public static boolean hasValue(Integer value) { - boolean hasVal = false; - if (getEnum(value) != null) { - hasVal = true; - } - return hasVal; - } - - /** - * 判断是否不存在指定值 - * - * @param value - * @return - */ - public static boolean notHasValue(Integer value) { - return !hasValue(value); - } - - /** - * 获取指定值对应的枚举 - * - * @param value - * @return - */ - public static TaskTypeEnum getEnum(Integer value) { - if (value == null) { - return null; - } - for (TaskTypeEnum obj : EnumUtils.getEnumList(TaskTypeEnum.class)) { - if (obj.eqValue(value)) { - return obj; - } - } - return null; - } -} diff --git a/wjcy-common/src/main/java/me/zhengjie/enums/VpnDealerEnum.java b/wjcy-common/src/main/java/me/zhengjie/enums/VpnDealerEnum.java deleted file mode 100644 index b08953e..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/enums/VpnDealerEnum.java +++ /dev/null @@ -1,74 +0,0 @@ -package me.zhengjie.enums; - -import me.zhengjie.enums.interfaces.IntegerEnum; -import org.apache.commons.lang3.EnumUtils; - -/** - *

- * VPN经销商枚举 - *

- * - * @Author zhw - * @Date 2022-07-18 - **/ -public enum VpnDealerEnum implements IntegerEnum { - /** - * 状态:1.V2 - */ - - V2(1); - - private final Integer value; - - private VpnDealerEnum(Integer value) { - this.value = value; - } - - - @Override - public Integer value() { - return this.value; - } - - /** - * 判断是否存在指定值 - * - * @param value - * @return - */ - public static boolean hasValue(Integer value) { - boolean hasVal = false; - if (getEnum(value) != null) { - hasVal = true; - } - return hasVal; - } - - /** - * 判断是否不存在指定值 - * - * @param value - * @return - */ - public static boolean notHasValue(Integer value) { - return !hasValue(value); - } - - /** - * 获取指定值对应的枚举 - * - * @param value - * @return - */ - public static VpnDealerEnum getEnum(Integer value) { - if (value == null) { - return null; - } - for (VpnDealerEnum obj : EnumUtils.getEnumList(VpnDealerEnum.class)) { - if (obj.eqValue(value)) { - return obj; - } - } - return null; - } -} diff --git a/wjcy-common/src/main/java/me/zhengjie/enums/VpnStatusEnum.java b/wjcy-common/src/main/java/me/zhengjie/enums/VpnStatusEnum.java deleted file mode 100644 index b246388..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/enums/VpnStatusEnum.java +++ /dev/null @@ -1,75 +0,0 @@ -package me.zhengjie.enums; - -import me.zhengjie.enums.interfaces.IntegerEnum; -import org.apache.commons.lang3.EnumUtils; - -/** - *

- * VPN类状态枚举 - *

- * - * @Author zhw - * @Date 2022-07-18 - **/ -public enum VpnStatusEnum implements IntegerEnum { - /** - * 状态:1.可用、2.禁用 - */ - - AVAILABLE(1), - DISABLED(2); - - private final Integer value; - - private VpnStatusEnum(Integer value) { - this.value = value; - } - - - @Override - public Integer value() { - return this.value; - } - - /** - * 判断是否存在指定值 - * - * @param value - * @return - */ - public static boolean hasValue(Integer value) { - boolean hasVal = false; - if (getEnum(value) != null) { - hasVal = true; - } - return hasVal; - } - - /** - * 判断是否不存在指定值 - * - * @param value - * @return - */ - public static boolean notHasValue(Integer value) { - return !hasValue(value); - } - - /** - * 获取指定值对应的枚举 - * - * @param value - * @return - */ - public static VpnStatusEnum getEnum(Integer value) { - if (value == null) { - return null; - } - for (VpnStatusEnum obj : EnumUtils.getEnumList(VpnStatusEnum.class)) { - if (obj.eqValue(value)) { - return obj; - } - } - return null; - } -} diff --git a/wjcy-common/src/main/java/me/zhengjie/enums/VpnTypeEnum.java b/wjcy-common/src/main/java/me/zhengjie/enums/VpnTypeEnum.java deleted file mode 100644 index b52d540..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/enums/VpnTypeEnum.java +++ /dev/null @@ -1,74 +0,0 @@ -package me.zhengjie.enums; - -import me.zhengjie.enums.interfaces.IntegerEnum; -import org.apache.commons.lang3.EnumUtils; - -/** - *

- * VPN类型枚举 - *

- * - * @Author zhw - * @Date 2022-07-18 - **/ -public enum VpnTypeEnum implements IntegerEnum { - /** - * 状态:1.传统 - */ - - TRADITION(1); - - private final Integer value; - - private VpnTypeEnum(Integer value) { - this.value = value; - } - - - @Override - public Integer value() { - return this.value; - } - - /** - * 判断是否存在指定值 - * - * @param value - * @return - */ - public static boolean hasValue(Integer value) { - boolean hasVal = false; - if (getEnum(value) != null) { - hasVal = true; - } - return hasVal; - } - - /** - * 判断是否不存在指定值 - * - * @param value - * @return - */ - public static boolean notHasValue(Integer value) { - return !hasValue(value); - } - - /** - * 获取指定值对应的枚举 - * - * @param value - * @return - */ - public static VpnTypeEnum getEnum(Integer value) { - if (value == null) { - return null; - } - for (VpnTypeEnum obj : EnumUtils.getEnumList(VpnTypeEnum.class)) { - if (obj.eqValue(value)) { - return obj; - } - } - return null; - } -} diff --git a/wjcy-common/src/main/java/me/zhengjie/enums/YesOrNoEnum.java b/wjcy-common/src/main/java/me/zhengjie/enums/YesOrNoEnum.java deleted file mode 100644 index 5b58315..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/enums/YesOrNoEnum.java +++ /dev/null @@ -1,75 +0,0 @@ -package me.zhengjie.enums; - -import me.zhengjie.enums.interfaces.IntegerEnum; -import org.apache.commons.lang3.EnumUtils; - -/** - *

- * Yes or No - *

- * - * @Author xxs - * @Date 2021/9/26 - **/ -public enum YesOrNoEnum implements IntegerEnum { - /** - * 类型型(1.YES 0.NO ) - */ - - YES(1), - NO(0); - - private final Integer value; - - private YesOrNoEnum(Integer value) { - this.value = value; - } - - - @Override - public Integer value() { - return this.value; - } - - /** - * 判断是否存在指定值 - * - * @param value - * @return - */ - public static boolean hasValue(Integer value) { - boolean hasVal = false; - if (getEnum(value) != null) { - hasVal = true; - } - return hasVal; - } - - /** - * 判断是否不存在指定值 - * - * @param value - * @return - */ - public static boolean notHasValue(Integer value) { - return !hasValue(value); - } - - /** - * 获取指定值对应的枚举 - * - * @param value - * @return - */ - public static YesOrNoEnum getEnum(Integer value) { - if (value == null) { - return null; - } - for (YesOrNoEnum obj : EnumUtils.getEnumList(YesOrNoEnum.class)) { - if (obj.eqValue(value)) { - return obj; - } - } - return null; - } -} diff --git a/wjcy-common/src/main/java/me/zhengjie/enums/interfaces/IntegerEnum.java b/wjcy-common/src/main/java/me/zhengjie/enums/interfaces/IntegerEnum.java deleted file mode 100644 index f944411..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/enums/interfaces/IntegerEnum.java +++ /dev/null @@ -1,40 +0,0 @@ -package me.zhengjie.enums.interfaces; - -/** - *

- * Integer类型枚举 - *

- * - * @Author xx - * @Date 2021/7/22 - **/ -public interface IntegerEnum { - - /**值 - * @return - */ - Integer value(); - - /** - * 值相等 - * - * @param value - * @return - */ - default boolean eqValue(Integer value) { - if (value != null && value().equals(value)) { - return true; - } - return false; - } - - /** - * 值不相等 - * - * @param value - * @return - */ - default boolean neValue(Integer value) { - return !eqValue(value); - } -} diff --git a/wjcy-common/src/main/java/me/zhengjie/enums/interfaces/LongEnum.java b/wjcy-common/src/main/java/me/zhengjie/enums/interfaces/LongEnum.java deleted file mode 100644 index 8b210fa..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/enums/interfaces/LongEnum.java +++ /dev/null @@ -1,40 +0,0 @@ -package me.zhengjie.enums.interfaces; - -/** - *

- * Long类型枚举 - *

- * - * @Author xx - * @Date 2021/7/22 - **/ -public interface LongEnum { - - /**值 - * @return - */ - Long value(); - - /** - * 值相等 - * - * @param value - * @return - */ - default boolean eqValue(Long value) { - if (value != null && value().equals(value)) { - return true; - } - return false; - } - - /** - * 值不相等 - * - * @param value - * @return - */ - default boolean neValue(Long value) { - return !eqValue(value); - } -} diff --git a/wjcy-common/src/main/java/me/zhengjie/enums/interfaces/MemberIsUsedEnum.java b/wjcy-common/src/main/java/me/zhengjie/enums/interfaces/MemberIsUsedEnum.java deleted file mode 100644 index e5992be..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/enums/interfaces/MemberIsUsedEnum.java +++ /dev/null @@ -1,71 +0,0 @@ -package me.zhengjie.enums.interfaces; - -import org.apache.commons.lang3.EnumUtils; -/** - *

- * 用户是否使用过 - *

- * - * @Author xx - * @Date 2021/8/11 - **/ -public enum MemberIsUsedEnum implements IntegerEnum { - /** 未使用 */ - UN_USED(0), - /** 已使用*/ - IS_USED(1); - - private final Integer value; - - private MemberIsUsedEnum(Integer value) { - this.value = value; - } - - @Override - public Integer value() { - return this.value; - } - - /** - * 判断是否存在指定值 - * - * @param value - * @return - */ - public static boolean hasValue(Integer value) { - boolean hasVal = false; - if (getEnum(value) != null) { - hasVal = true; - } - return hasVal; - } - - /** - * 判断是否不存在指定值 - * - * @param value - * @return - */ - public static boolean notHasValue(Integer value) { - return !hasValue(value); - } - - /** - * 获取指定值对应的枚举 - * - * @param value - * @return - */ - public static MemberIsUsedEnum getEnum(Integer value) { - if (value == null) { - return null; - } - for (MemberIsUsedEnum obj : EnumUtils.getEnumList(MemberIsUsedEnum.class)) { - if (obj.eqValue(value)) { - return obj; - } - } - return null; - } -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/error/ErrorCodeEnum.java b/wjcy-common/src/main/java/me/zhengjie/error/ErrorCodeEnum.java deleted file mode 100644 index 834a36e..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/error/ErrorCodeEnum.java +++ /dev/null @@ -1,143 +0,0 @@ -package me.zhengjie.error; - -import cn.hutool.core.convert.Convert; -import me.zhengjie.utils.PropertiesUtil; -import me.zhengjie.utils.RequestHolder; - -/** - *

- * 返回错误枚举类型 - *

- * - * @Author xx - * @Date 2021/7/19 - **/ -public enum ErrorCodeEnum { - RETURN_SUCCESS(200, "响应成功"), - UNKNOWN_ERROR(2000,"服务器开小差了....,请稍后再试!"), - BAD_CREDENTIALS(2001,"坏的凭证"), - ENTITY_EXIST(2003,"信息重复添加"), - ENTITY_NOT_FOUND(2004,"数据不存在"), - METHOD_ARGUMENT_NOT_VALID(2005,"数据验证失败异常"), - VALIDATION_ERROR(2006,"参数验证失败"), - HANDLE_BIND_ERROR(2007,"参数绑定失败"), - MESSAGE_NOT_READABLE(2008,"参数解析失败"), - MISSING_REQUEST_HEADER(2009,"缺少请求头参数"), - NO_HANDLER_FOUND(2010,"Not Found"), - METHOD_NOT_SUPPORTED(2011,"不支持当前请求方法"), - MEDIA_TYPE_NOT_SUPPORTED(2012,"不支持当前媒体类型"), - MAX_UPLOAD_SIZE_EXCEEDED(2013,"文件上传-文件大小超过限制"), - NO_PERMISSION_FOR_THIS_OPERATION(1328, "暂无权限"), - UPLOAD_IMG_FORMAT_ERROR(2015,"上传图片格式错误"), - REQUEST_PARAMS_NULL_ERROR(2016,"请求参数空值异常,请检查后重试!"), - SERVER_DESERTION_ERROR(2017,"服务器开小差了....,请稍后再试!"), - FORM_SUBMISSION_REPETITION_ERROR(1360, "操作过于频繁,请稍后再试"), - LOGIN_PWD_ERROR(2218, "密码错误!"), - BLOCKED_ACCOUNT_ERROR(2219, "多次输人错误的密码,账户已被冻结!"), - LOGIN_IP_FORMAT_ERROR(2220, "IP地址格式错误!"), - BLOCKED_LOGIN_IP_ERROR(2221, "非法IP!"), - ERROR_2222(2222, "验证码错误!"), - ERROR_2223(2223, "验证码不存在或已过期!"), - - // 业务 - // 买家 - ERROR_NOT_FIND_BUYER_USER(3000, "买家信息不存在!"), - ERROR_EXIST_FIND_BUYER_USER(3001, "买家信息已存在!"), - ERROR_NOT_UPDATE_EXIST_ORDER_BUYER_USER(3002, "买家存在订单信息,不允许修改token和平台信息"), - ERROR_NOT_DEL_EXIST_ORDER_BUYER_USER(3003, "买家存在订单信息,不允许删除"), - - - // EXCEL - ERROR_NOT_FIND_EXCEL_USER(3100, "卖家信息不存在!"), - - - // 平台 - ERROR_NOT_FIND_PLAT_USER(3200, "平台信息不存在!"), - ERROR_EXITS_COMPANY_INFO(3201,"该平台下存在公司,不允许删除!"), - - // 公司 - ERROR_NOT_FIND_COMPANY(3300, "公司信息不存在!"), - ERROR_EXITS_CT_ORDER_INFO(3201,"该公司下存在订单信息,不允许删除!"), - - // 信用卡 - ERROR_NOT_FIND_CARD_INFO(3300, "信用卡信息不存在,或者已删除或异常!"), - ERROR_NOT_FIND_CARD(3301, "信用卡信息不存在!"), - - //VPN - ERROR_NOT_FIND_VPN(3300, "VPN信息不存在,或者已删除!"), - - //影刀任务信息 - ERROR_NOT_FIND_JOB(3400,"影刀任务信息不存在,或者已删除"), - ERROR_NOT_FIND_TASK(3401,"影刀应用信息异常, 请检查后重试!"), - - //应用信息Apply - ERROR_NOT_FIND_APPLY(3500,"应用信息不存在,或者已删除"), - - //影刀机器人信息 rebot - ERROR_NOT_FIND_REBOT(3600,"机器人信息不存在,或者已删除"), - ERROR_NOT_FIND_OR_OCCUPY(3601, "机器人不存在,或者已占用"), - - // 影刀回调 - ERROR_PARAM_NULL(3700, "影刀回调参数空值异常!"), - ERROR_CALLBACK_SIGN_NULL(3701, "影刀回调鉴权异常!"), - - - // 敦煌支付 - ERROR_DH_PAY_NOT_FIND_OR_SUCCESS(3800,"敦煌支付信息不存在,或已删除!"), - - // 刷单流程 - ERROR_NOT_FIND_CLICKFARMING_INFO(3900, "刷单信息不存在!"), - ERROR_DEL_CLICKFARMING_INFO(3901, "只有待执行的刷单信息才允许删除!"), - ERROR_CLICKFARMING_NOT_TOBE(3902, "刷单信息非待执行状态,请检查后重新操作!"), - ERROR_CLICKFARMING_NOT_SUPPLEMENT(3903, "仅支付成功失败状态才允许补录!"), - ERROR_CLICK_ORDER_NOT_COMMENT(3904, "仅刷单成功状态,才拥有订单信息!"), - - // 订单信息 - ERROR_NOT_FIND_CLICK_ORDER_INFO(4100, "订单信息不存在"), - ERROR_NOT_NULL_ERP_AUTH_TOKEN(4101, "鉴权信息不能为空!"), - ERROR_ERP_AUTH_TOKEN(4102, "鉴权信息错误,请检查后重试!"), - - // 应用 - ERROR_NOT_REPEAT_ID(4200, "应用ID存在重复!"), - ERROR_NOT_FIND_METHOD_NAME(4201, "不存在对应方法名称!"), - - // 浏览信息不存在 - ERROR_NOT_FIND_BROWSE(4300, "浏览信息不存在!"), - - // 敦煌加购 - ERROR_ADD_CAR_KEY_NULL(4400, "关键词类型-商品关键词属性不能为空"), - ERROR_ADD_CAR_LINK_NULL(4401, "链接类型-商品关键词属性不能为空"), - ERROR_ADD_CAR_GOODS_NULL(4403, "商品属性不能为空"), - ERROR_NOT_FIND_ADD_CAR_INFO(4404, "敦煌加购信息不存在,或者已删除或异常!"), - ERROR_DEL_ADD_CAR_INFO(4405, "只有待执行的刷单信息才允许删除!"), - ERROR_NOT_EDIT_ADD_CAR_INFO(4406, "敦煌加购信息仅带执行才允许修改!"), - ERROR_NOT_WELL_RECEIVED_ADD_CAR_INFO(4407, "敦煌加购信息仅抓单成功才允许评论!"); - - private int code; - - private String desc; - /** 初始化 */ - ErrorCodeEnum(int code, String desc) { - this.code = code; - this.desc = desc; - } - /** 获取错误状态码 */ - public int getCode() { - return code; - } - /** 设置错误状态码 */ - public void setCode(int code) { - this.code = code; - } - /** 获取错误描述 */ - public String getDesc() { -// String language = RequestHolder.getLanguage(); -// String message = Convert.toStr(PropertiesUtil.getByCode(code, language), desc); - return desc; - } - /** 设置错误描述 */ - public void setDesc(String desc) { - this.desc = desc; - } - -} diff --git a/wjcy-common/src/main/java/me/zhengjie/exception/BadConfigurationException.java b/wjcy-common/src/main/java/me/zhengjie/exception/BadConfigurationException.java deleted file mode 100644 index ede3691..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/exception/BadConfigurationException.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright 2019-2020 the original author or authors. - * - * 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 me.zhengjie.exception; - -/** - * 统一关于错误配置信息 异常 - * - * @author: liaojinlong - * @date: 2020/6/10 18:06 - */ -public class BadConfigurationException extends RuntimeException { - /** - * Constructs a new runtime exception with {@code null} as its - * detail message. The cause is not initialized, and may subsequently be - * initialized by a call to {@link #initCause}. - */ - public BadConfigurationException() { - super(); - } - - /** - * Constructs a new runtime exception with the specified detail message. - * The cause is not initialized, and may subsequently be initialized by a - * call to {@link #initCause}. - * - * @param message the detail message. The detail message is saved for - * later retrieval by the {@link #getMessage()} method. - */ - public BadConfigurationException(String message) { - super(message); - } - - /** - * Constructs a new runtime exception with the specified detail message and - * cause.

Note that the detail message associated with - * {@code cause} is not automatically incorporated in - * this runtime exception's detail message. - * - * @param message the detail message (which is saved for later retrieval - * by the {@link #getMessage()} method). - * @param cause the cause (which is saved for later retrieval by the - * {@link #getCause()} method). (A {@code null} value is - * permitted, and indicates that the cause is nonexistent or - * unknown.) - * @since 1.4 - */ - public BadConfigurationException(String message, Throwable cause) { - super(message, cause); - } - - /** - * Constructs a new runtime exception with the specified cause and a - * detail message of {@code (cause==null ? null : cause.toString())} - * (which typically contains the class and detail message of - * {@code cause}). This constructor is useful for runtime exceptions - * that are little more than wrappers for other throwables. - * - * @param cause the cause (which is saved for later retrieval by the - * {@link #getCause()} method). (A {@code null} value is - * permitted, and indicates that the cause is nonexistent or - * unknown.) - * @since 1.4 - */ - public BadConfigurationException(Throwable cause) { - super(cause); - } - - /** - * Constructs a new runtime exception with the specified detail - * message, cause, suppression enabled or disabled, and writable - * stack trace enabled or disabled. - * - * @param message the detail message. - * @param cause the cause. (A {@code null} value is permitted, - * and indicates that the cause is nonexistent or unknown.) - * @param enableSuppression whether or not suppression is enabled - * or disabled - * @param writableStackTrace whether or not the stack trace should - * be writable - * @since 1.7 - */ - protected BadConfigurationException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) { - super(message, cause, enableSuppression, writableStackTrace); - } -} diff --git a/wjcy-common/src/main/java/me/zhengjie/exception/BadRequestException.java b/wjcy-common/src/main/java/me/zhengjie/exception/BadRequestException.java deleted file mode 100644 index 3501adc..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/exception/BadRequestException.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.exception; - -import lombok.Getter; -import me.zhengjie.error.ErrorCodeEnum; -import org.springframework.http.HttpStatus; -import static org.springframework.http.HttpStatus.BAD_REQUEST; - -/** - * @author Zheng Jie - * @date 2018-11-23 - * 统一异常处理 - */ -@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(Integer status,String msg){ - super(msg); - this.status = status; - } - public BadRequestException(ErrorCodeEnum errorCodeEnum){ - super(errorCodeEnum.getDesc()); - this.status = errorCodeEnum.getCode(); - } -} diff --git a/wjcy-common/src/main/java/me/zhengjie/exception/EntityExistException.java b/wjcy-common/src/main/java/me/zhengjie/exception/EntityExistException.java deleted file mode 100644 index 03f9bf2..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/exception/EntityExistException.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.exception; - -import org.springframework.util.StringUtils; - -/** - * @author Zheng Jie - * @date 2018-11-23 - */ -public class EntityExistException extends RuntimeException { - - public EntityExistException(Class clazz, String field, String val) { - super(EntityExistException.generateMessage(clazz.getSimpleName(), field, val)); - } - - private static String generateMessage(String entity, String field, String val) { - return StringUtils.capitalize(entity) - + " with " + field + " "+ val + " existed"; - } -} \ No newline at end of file diff --git a/wjcy-common/src/main/java/me/zhengjie/exception/EntityNotFoundException.java b/wjcy-common/src/main/java/me/zhengjie/exception/EntityNotFoundException.java deleted file mode 100644 index bcdc956..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/exception/EntityNotFoundException.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.exception; - -import org.springframework.util.StringUtils; - -/** - * @author Zheng Jie - * @date 2018-11-23 - */ -public class EntityNotFoundException extends RuntimeException { - - public EntityNotFoundException(Class clazz, String field, String val) { - super(EntityNotFoundException.generateMessage(clazz.getSimpleName(), field, val)); - } - - private static String generateMessage(String entity, String field, String val) { - return StringUtils.capitalize(entity) - + " with " + field + " "+ val + " does not exist"; - } -} \ No newline at end of file diff --git a/wjcy-common/src/main/java/me/zhengjie/exception/handler/ApiError.java b/wjcy-common/src/main/java/me/zhengjie/exception/handler/ApiError.java deleted file mode 100644 index 5112730..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/exception/handler/ApiError.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.exception.handler; - -import com.fasterxml.jackson.annotation.JsonFormat; -import lombok.Data; -import java.time.LocalDateTime; - -/** - * @author Zheng Jie - * @date 2018-11-23 - */ -@Data -class ApiError { - - private Integer status = 400; - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime timestamp; - private String message; - - private ApiError() { - timestamp = LocalDateTime.now(); - } - - public static ApiError error(String message){ - ApiError apiError = new ApiError(); - apiError.setMessage(message); - return apiError; - } - - public static ApiError error(Integer status, String message){ - ApiError apiError = new ApiError(); - apiError.setStatus(status); - apiError.setMessage(message); - return apiError; - } -} - - diff --git a/wjcy-common/src/main/java/me/zhengjie/exception/handler/GlobalExceptionHandler.java b/wjcy-common/src/main/java/me/zhengjie/exception/handler/GlobalExceptionHandler.java deleted file mode 100644 index 4561bae..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/exception/handler/GlobalExceptionHandler.java +++ /dev/null @@ -1,197 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.exception.handler; - -import cn.hutool.core.util.ObjectUtil; -import lombok.extern.slf4j.Slf4j; -import me.zhengjie.dto.Dto; -import me.zhengjie.exception.BadRequestException; -import me.zhengjie.exception.EntityExistException; -import me.zhengjie.exception.EntityNotFoundException; -import me.zhengjie.utils.ThrowableUtil; -import org.springframework.http.converter.HttpMessageNotReadableException; -import org.springframework.security.access.AccessDeniedException; -import org.springframework.security.authentication.BadCredentialsException; -import org.springframework.validation.BindException; -import org.springframework.validation.FieldError; -import org.springframework.validation.ObjectError; -import org.springframework.web.HttpMediaTypeNotSupportedException; -import org.springframework.web.HttpRequestMethodNotSupportedException; -import org.springframework.web.bind.MethodArgumentNotValidException; -import org.springframework.web.bind.MissingRequestHeaderException; -import org.springframework.web.bind.annotation.ExceptionHandler; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.bind.annotation.RestControllerAdvice; -import org.springframework.web.multipart.MaxUploadSizeExceededException; -import org.springframework.web.servlet.NoHandlerFoundException; - -import javax.annotation.Resource; -import javax.validation.ValidationException; -import java.util.List; - -import static me.zhengjie.error.ErrorCodeEnum.*; -import static me.zhengjie.error.ErrorCodeEnum.MAX_UPLOAD_SIZE_EXCEEDED; - -/** - * @author Zheng Jie - * @date 2018-11-23 - */ -@Slf4j -@RestControllerAdvice -public class GlobalExceptionHandler { - - /** - * 不允许访问的异常 - */ - @ExceptionHandler(AccessDeniedException.class) - public Dto accessDeniedException(Throwable e) { - // 打印堆栈信息 - log.error(NO_PERMISSION_FOR_THIS_OPERATION.getCode()+ThrowableUtil.getStackTrace(e)); - return Dto.getInstance(NO_PERMISSION_FOR_THIS_OPERATION); - } - - /** - * 处理所有不可知的异常 - */ - @ExceptionHandler(Throwable.class) - public Dto handleException(Throwable e) { - // 打印堆栈信息 - log.error(UNKNOWN_ERROR.getCode()+ThrowableUtil.getStackTrace(e)); - return Dto.getInstance(UNKNOWN_ERROR); - } - - /** - * BadCredentialsException - */ - @ExceptionHandler(BadCredentialsException.class) - public Dto badCredentialsException(BadCredentialsException e) { - // 打印堆栈信息 - log.error(BAD_CREDENTIALS.getCode()+ThrowableUtil.getStackTrace(e)); - return Dto.getInstance(BAD_CREDENTIALS); - } - - /** - * 处理自定义异常 - */ - @ExceptionHandler(value = BadRequestException.class) - public Dto badRequestException(BadRequestException e) { - // 打印堆栈信息 - log.error(e.getStatus()+ThrowableUtil.getStackTrace(e)); - Dto dto = Dto.returnResult(false); - dto.setCode(e.getStatus()); - dto.setMessage(e.getMessage()); - return dto; - } - - /** - * 处理 EntityExist - */ - @ExceptionHandler(value = EntityExistException.class) - public Dto entityExistException(EntityExistException e) { - // 打印堆栈信息 - log.error(ENTITY_EXIST.getCode()+ThrowableUtil.getStackTrace(e)); - return Dto.getInstance(ENTITY_EXIST); - } - - /** - * 处理 EntityNotFound - */ - @ExceptionHandler(value = EntityNotFoundException.class) - public Dto entityNotFoundException(EntityNotFoundException e) { - // 打印堆栈信息 - log.error(ENTITY_NOT_FOUND.getCode()+ThrowableUtil.getStackTrace(e)); - return Dto.getInstance(ENTITY_NOT_FOUND); - } - - /** - * 处理所有接口数据验证异常 - */ - @ExceptionHandler(MethodArgumentNotValidException.class) - public Dto handleMethodArgumentNotValidException(MethodArgumentNotValidException e) { - // 打印堆栈信息 - log.error(ThrowableUtil.getStackTrace(e)); - StringBuffer sbf = new StringBuffer(); - List allErrors = e.getBindingResult().getAllErrors(); - for (ObjectError allError : allErrors) { - if (allError instanceof FieldError) { - FieldError fieldError = (FieldError)allError; - sbf.append("["+fieldError.getField() + ":" + fieldError.getDefaultMessage() + "] "); - } - } - Dto dto = Dto.getInstance(METHOD_ARGUMENT_NOT_VALID); - if (ObjectUtil.isNotEmpty(sbf)) { - dto.setMessage(sbf.toString()); - } - return dto; - } - - @ExceptionHandler(ValidationException.class) - @ResponseBody - public Dto handleValidationException(ValidationException e) { - log.error(VALIDATION_ERROR.getCode()+ThrowableUtil.getStackTrace(e)); - return Dto.getInstance(VALIDATION_ERROR); - } - - @ExceptionHandler(BindException.class) - @ResponseBody - public Dto handleBindException(BindException e) { - log.error(HANDLE_BIND_ERROR.getCode()+ThrowableUtil.getStackTrace(e)); - return Dto.getInstance(HANDLE_BIND_ERROR); - } - - @ExceptionHandler(HttpMessageNotReadableException.class) - @ResponseBody - public Dto handleHttpMessageNotReadableException(HttpMessageNotReadableException e) { - log.error(MESSAGE_NOT_READABLE.getCode()+ThrowableUtil.getStackTrace(e)); - return Dto.getInstance(MESSAGE_NOT_READABLE); - } - - @ExceptionHandler(MissingRequestHeaderException.class) - @ResponseBody - public Dto missingRequestHeaderException(MissingRequestHeaderException e) { - log.error(MISSING_REQUEST_HEADER.getCode()+ThrowableUtil.getStackTrace(e)); - return Dto.getInstance(MISSING_REQUEST_HEADER); - } - - @ExceptionHandler(NoHandlerFoundException.class) - @ResponseBody - public Dto noHandlerFoundException(NoHandlerFoundException e) { - log.error(NO_HANDLER_FOUND.getCode()+ThrowableUtil.getStackTrace(e)); - return Dto.getInstance(NO_HANDLER_FOUND); - } - - @ExceptionHandler(HttpRequestMethodNotSupportedException.class) - @ResponseBody - public Dto handleHttpRequestMethodNotSupportedException(HttpRequestMethodNotSupportedException e) { - log.error(METHOD_NOT_SUPPORTED.getCode()+ThrowableUtil.getStackTrace(e)); - return Dto.getInstance(METHOD_NOT_SUPPORTED); - } - - @ExceptionHandler(HttpMediaTypeNotSupportedException.class) - @ResponseBody - public Dto handleHttpMediaTypeNotSupportedException(HttpMediaTypeNotSupportedException e) { - log.error(MEDIA_TYPE_NOT_SUPPORTED.getCode()+ThrowableUtil.getStackTrace(e)); - return Dto.getInstance(MEDIA_TYPE_NOT_SUPPORTED); - } - - @ExceptionHandler(value = MaxUploadSizeExceededException.class) - @ResponseBody - public Dto maxUploadSizeExceededException(MaxUploadSizeExceededException e) { - log.error(MAX_UPLOAD_SIZE_EXCEEDED.getCode()+ThrowableUtil.getStackTrace(e)); - return Dto.getInstance(MAX_UPLOAD_SIZE_EXCEEDED); - } - -} diff --git a/wjcy-common/src/main/java/me/zhengjie/mybatis/LambdaQueryWrapperImpl.java b/wjcy-common/src/main/java/me/zhengjie/mybatis/LambdaQueryWrapperImpl.java deleted file mode 100644 index d1911cb..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/mybatis/LambdaQueryWrapperImpl.java +++ /dev/null @@ -1,29 +0,0 @@ -package me.zhengjie.mybatis; - -import cn.hutool.core.util.ObjectUtil; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; - -/* - * - * @Description - * @Date 2021/12/6 - * @Author zeng - */ -public class LambdaQueryWrapperImpl extends LambdaQueryWrapper { - - private String name; - - @Override - public String getCustomSqlSegment() { - String customSqlSegment = super.getCustomSqlSegment(); - if (ObjectUtil.isNotEmpty(name)) { - customSqlSegment = customSqlSegment.replaceAll("ew.", name + "."); - } - return customSqlSegment; - } - - public void setName(String name) { - this.name = name; - } - -} diff --git a/wjcy-common/src/main/java/me/zhengjie/service/CtApplyService.java b/wjcy-common/src/main/java/me/zhengjie/service/CtApplyService.java deleted file mode 100644 index c67a12d..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/CtApplyService.java +++ /dev/null @@ -1,42 +0,0 @@ -package me.zhengjie.service; - -import com.baomidou.mybatisplus.core.conditions.Wrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.service.IService; -import me.zhengjie.entity.CtApply; -import me.zhengjie.service.vo.CtApplyListVO; -import me.zhengjie.utils.PageUtils; - -import java.util.List; - -/** - * 影刀应用信息(CtApply)表服务接口 - * - * @author rch - * @since 2022-07-23 - */ -public interface CtApplyService extends IService { - - /** - * 分页查询 - * @param page - * @param ew - * @return PageUtils - */ - PageUtils searchPageList(IPage page, Wrapper ew); - - /** - * 查询所有应用信息 - * @return LIST - */ - List getAllApplyName(); - - /** - * 根据方法应用对应的TaskName和Method查询应用信息 - * @param taskName - * @param method - * @return - */ - CtApply getApplyByTaskAndMethod(String taskName, String method); -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/service/CtBrowseService.java b/wjcy-common/src/main/java/me/zhengjie/service/CtBrowseService.java deleted file mode 100644 index b0b8401..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/CtBrowseService.java +++ /dev/null @@ -1,41 +0,0 @@ -package me.zhengjie.service; - -import com.baomidou.mybatisplus.core.conditions.Wrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.service.IService; -import me.zhengjie.entity.CtBrowse; -import me.zhengjie.service.vo.CtBrowseDetailVO; -import me.zhengjie.service.vo.CtBrowseListVO; -import me.zhengjie.utils.PageUtils; - -/** - * 浏览收藏(CtBrowse)表服务接口 - * - * @author rch - * @since 2022-11-04 09:45:32 - */ -public interface CtBrowseService extends IService { - - /** - * 分页查询 - * @param page - * @param ew - * @return - */ - PageUtils searchPageList(IPage page, Wrapper ew); - - /** - * 获取好评刷单信息-加锁 - * @param id - * @return - */ - CtBrowse getByIdLock(Long id); - - /** - * 根据id获取详情 - * @param id - * @return - */ - CtBrowseDetailVO getBrowseDetailById(Long id); -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/service/CtBuyerService.java b/wjcy-common/src/main/java/me/zhengjie/service/CtBuyerService.java deleted file mode 100644 index b6c71d9..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/CtBuyerService.java +++ /dev/null @@ -1,50 +0,0 @@ -package me.zhengjie.service; - -import com.baomidou.mybatisplus.core.conditions.Wrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.service.IService; -import me.zhengjie.entity.CtBuyer; -import me.zhengjie.service.vo.CtBuyerDetailVO; -import me.zhengjie.service.vo.CtBuyerListVO; -import me.zhengjie.utils.PageUtils; - -import java.util.List; -import java.util.Map; - -/** - * 买家表(CtBuyer)表服务接口 - * - * @author rch - * @since 2022-06-22 - */ -public interface CtBuyerService extends IService { - - /** - * 分页查询买家信息 - * @param page - * @param ew - * @return - */ - PageUtils searchPageList(IPage page, Wrapper ew); - - /** - * 根据Id获取详情信息 - * @param id - * @return - */ - CtBuyerDetailVO getDetailById(Long id); - - List getAllAccount(); - - String getPwdByName(String name); - - CtBuyer getBuyerOccupyStatusLock(String buyerName); - - /** - * 根据买家账号 返回存在的买家信息 - * @param buyerAccountList - * @return - */ - Map getBuyerList(List buyerAccountList); -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/service/CtCardService.java b/wjcy-common/src/main/java/me/zhengjie/service/CtCardService.java deleted file mode 100644 index 6727e2e..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/CtCardService.java +++ /dev/null @@ -1,26 +0,0 @@ -package me.zhengjie.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import me.zhengjie.entity.CtCard; -import me.zhengjie.entity.CtCardInfo; - -import java.util.List; - -/** - * 信用卡信息(CtCard)表服务接口 - * - * @author rch - * @since 2022-07-07 - */ -public interface CtCardService extends IService { - - List getNumberList(); - - /** - * 根据信用卡号查询信用卡信息 - * @param number - * @return ctCardInfo(id,number) - */ - List getCardInfoByNumber(List number); -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/service/CtClickFarmingService.java b/wjcy-common/src/main/java/me/zhengjie/service/CtClickFarmingService.java deleted file mode 100644 index f88d31f..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/CtClickFarmingService.java +++ /dev/null @@ -1,36 +0,0 @@ -package me.zhengjie.service; - -import com.baomidou.mybatisplus.core.conditions.Wrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.service.IService; -import me.zhengjie.entity.CtBuyerClickSuccess; -import me.zhengjie.entity.CtClickFarmYdParams; -import me.zhengjie.entity.CtClickFarming; -import me.zhengjie.service.vo.CtClickFarmEditDetailVO; -import me.zhengjie.service.vo.CtClickFarmingDetailVO; -import me.zhengjie.service.vo.CtClickFarmingVO; -import me.zhengjie.utils.PageUtils; - -import java.util.List; - -/** - * 刷单Excel信息(CtClickFarming)表服务接口 - * - * @author rch - * @since 2022-08-16 - */ -public interface CtClickFarmingService extends IService { - - PageUtils searchPageList(IPage page, Wrapper ew); - - CtClickFarming getByIdLock(Long id); - - CtClickFarmEditDetailVO getEditDetailById(Long id); - - CtClickFarmingDetailVO getDetailById(Long id); - - List ruleGetCtBuyer(String buyerAccount, String country, String shopName); - - CtClickFarmYdParams getCtClickFarmYdParams(Long valueOf); -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/service/CtClickOrderService.java b/wjcy-common/src/main/java/me/zhengjie/service/CtClickOrderService.java deleted file mode 100644 index 30b471c..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/CtClickOrderService.java +++ /dev/null @@ -1,65 +0,0 @@ -package me.zhengjie.service; - -import com.baomidou.mybatisplus.core.conditions.Wrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.service.IService; -import me.zhengjie.entity.CtClickFarmingOrderInfo; -import me.zhengjie.entity.CtClickOrder; -import me.zhengjie.service.vo.CtClickOrderDetailVO; -import me.zhengjie.service.vo.CtClickOrderListVO; -import me.zhengjie.utils.PageUtils; - -import java.util.List; - -/** - * 刷单-订单信息(CtClickOrder)表服务接口 - * - * @author rch - * @since 2022-09-14 - */ -public interface CtClickOrderService extends IService { - - /** - * 返回实际存在的订单id - * @param importOrderIdList - * @return - */ - List getOrderId(List importOrderIdList); - - /** - * 分页查询 - * @param page - * @param ew - * @return - */ - PageUtils searchPageList(IPage page, Wrapper ew); - - /** - * 手动补录刷单信息对应的订单信息 - * @param clickFarmingId - * @param ctClickOrder - */ - Boolean supplement(Long clickFarmingId, CtClickOrder ctClickOrder); - - /** - * 根据订单id 获取刷单订单详情信息 - * @param orderId - * @return - */ - CtClickFarmingOrderInfo getClickFarmOrderById(Long orderId); - - /** - * 悲观锁根据id获取刷单订单信息 - * @param valueOf - * @return - */ - CtClickOrder getByIdLock(Long valueOf); - - /** - * 根据订单Id获取订单详情 - * @param id - * @return - */ - CtClickOrderDetailVO getClickOrderDetailById(Long id); -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/service/CtCompanyService.java b/wjcy-common/src/main/java/me/zhengjie/service/CtCompanyService.java deleted file mode 100644 index 10d4c04..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/CtCompanyService.java +++ /dev/null @@ -1,34 +0,0 @@ -package me.zhengjie.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import me.zhengjie.entity.CtCompany; -import me.zhengjie.entity.CtCompanyInfo; - -import java.util.List; -import java.util.Map; - -/** - * 公司信息(CtCompany)表服务接口 - * - * @author makejava - * @since 2022-06-23 10:37:44 - */ -public interface CtCompanyService extends IService { - - /** - * 根据公司名字 获取公司信息 - * @param name - * @return - */ - List getByNmae(List name); - - List getCompanyList(); - - /** - * 根据名称返回存在的公司信息 Map形式 key:id value:公司名称 - * @param platNameList - * @return - */ - Map getNameList(List platNameList); -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/service/CtDhPayService.java b/wjcy-common/src/main/java/me/zhengjie/service/CtDhPayService.java deleted file mode 100644 index 22612f4..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/CtDhPayService.java +++ /dev/null @@ -1,29 +0,0 @@ -package me.zhengjie.service; - -import com.baomidou.mybatisplus.core.conditions.Wrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.service.IService; -import me.zhengjie.entity.CtDhPay; -import me.zhengjie.service.vo.CtDhPayListVO; -import me.zhengjie.utils.PageUtils; - -/** - * 平台信息(CtDyPay)表服务接口 - * - * @author rch - * @since 2022-07-28 - */ -public interface CtDhPayService extends IService { - - PageUtils searchPageList(IPage page, Wrapper ew); - - void toPay(); - - /** - * 调用支付接口 - * @param ctDhPay - * @return - */ - public Boolean payOrderApi(CtDhPay ctDhPay); -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/service/CtExcelImportInfoService.java b/wjcy-common/src/main/java/me/zhengjie/service/CtExcelImportInfoService.java deleted file mode 100644 index 9f2ba5a..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/CtExcelImportInfoService.java +++ /dev/null @@ -1,23 +0,0 @@ -package me.zhengjie.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import me.zhengjie.entity.CtExcelImportInfo; - -import java.io.IOException; - -/** - * Excel导入信息(CtExcelImportInfo)表服务接口 - * - * @author rch - * @since 2022-06-23 - */ -public interface CtExcelImportInfoService extends IService { - - /** - * Excel 数据导入Mysql - * - * TODO 先做一版批量导入的,如果导入过程错误先不考虑 - */ - void importExcel() throws IOException; -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/service/CtExcelService.java b/wjcy-common/src/main/java/me/zhengjie/service/CtExcelService.java deleted file mode 100644 index a3d470b..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/CtExcelService.java +++ /dev/null @@ -1,15 +0,0 @@ -package me.zhengjie.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import me.zhengjie.entity.CtExcel; - -/** - * Excel 导入信息(CtExcel)表服务接口 - * - * @author makejava - * @since 2022-06-23 10:37:44 - */ -public interface CtExcelService extends IService { - -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/service/CtOrderService.java b/wjcy-common/src/main/java/me/zhengjie/service/CtOrderService.java deleted file mode 100644 index 0bba1ec..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/CtOrderService.java +++ /dev/null @@ -1,31 +0,0 @@ -package me.zhengjie.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import me.zhengjie.entity.CtExcelImportInfo; -import me.zhengjie.entity.CtOrder; -import org.springframework.stereotype.Service; - -/** - * (CtOrder)表服务接口 - * - * @author rch - * @since 2022-07-01 - */ -@Service -public interface CtOrderService extends IService { - - /** - * Excel 数据转换存储到订单表里 Order 一对多 - */ - void excelToOrder(); - - Boolean buyOrderApi(CtExcelImportInfo ctExcelImportInfo); - - /** - * 订单支付 - */ - void toPay(); - - Boolean payOrderApi(CtOrder ctOrder); -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/service/CtPlatformService.java b/wjcy-common/src/main/java/me/zhengjie/service/CtPlatformService.java deleted file mode 100644 index 37611dd..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/CtPlatformService.java +++ /dev/null @@ -1,24 +0,0 @@ -package me.zhengjie.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import me.zhengjie.entity.CtPlatform; - -import java.util.List; -import java.util.Map; - -/** - * 平台信息(CtPlatform)表服务接口 - * - * @author makejava - * @since 2022-06-23 10:37:44 - */ -public interface CtPlatformService extends IService { - - /** - * 返回存在的对应名称的平台信息名称 - * @param platNameList - * @return - */ - Map getNameList(List platNameList); -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/service/CtRebotService.java b/wjcy-common/src/main/java/me/zhengjie/service/CtRebotService.java deleted file mode 100644 index b784caf..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/CtRebotService.java +++ /dev/null @@ -1,63 +0,0 @@ -package me.zhengjie.service; - -import com.baomidou.mybatisplus.core.conditions.Wrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.service.IService; -import me.zhengjie.dto.Dto; -import me.zhengjie.entity.CtRebot; -import me.zhengjie.service.vo.CtRebotListVO; -import me.zhengjie.utils.PageUtils; -import org.springframework.data.convert.JodaTimeConverters; -import org.springframework.web.multipart.MultipartFile; - -import javax.servlet.http.HttpServletResponse; -import java.util.List; - -/** - * 影刀设备-机器人信息(CtRebot)表服务接口 - * - * @author rch - * @since 2022-07-23 - */ -public interface CtRebotService extends IService { - - CtRebot getByAccountNameLock(String accountName); - - /** - * 分页查询 影刀机器人信息 - * @param page - * @param wr - * @return PageUtils - */ - PageUtils searchPageList(IPage page, Wrapper wr); - - /** - * excel导入机器人信息 - * @param file - * @param response - * @return Dto - */ - Dto importRebot(MultipartFile file, HttpServletResponse response) throws Exception; - - /** - * 获取所有机器人名称 - * @return LIST - */ - List getAccountNameList(); - - /** - * 获取所有uuid信息 - * @return LIST - */ - List getClientUuidList(); - - /** - * 根据id和老状态 修改新状态 - * @param id - * @param newStatus - * @param oldStatus - * @return - */ - Boolean updateNewStatusByOldStatus(Long id, Integer newStatus, Integer oldStatus); -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/service/CtResponseOrderAddressService.java b/wjcy-common/src/main/java/me/zhengjie/service/CtResponseOrderAddressService.java deleted file mode 100644 index c639064..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/CtResponseOrderAddressService.java +++ /dev/null @@ -1,17 +0,0 @@ -package me.zhengjie.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import me.zhengjie.entity.CtResponseOrderAddress; -import org.springframework.stereotype.Service; - -/** - * 下注成功订单响应收货地址信息(CtResponseOrderAddress)表服务接口 - * - * @author rch - * @since 2022-07-01 - */ -@Service -public interface CtResponseOrderAddressService extends IService { - -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/service/CtResponseOrderProductService.java b/wjcy-common/src/main/java/me/zhengjie/service/CtResponseOrderProductService.java deleted file mode 100644 index 956fb20..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/CtResponseOrderProductService.java +++ /dev/null @@ -1,17 +0,0 @@ -package me.zhengjie.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import me.zhengjie.entity.CtResponseOrderProduct; -import org.springframework.stereotype.Service; - -/** - * 下单订单响应产品信息(CtResponseOrderProduct)表服务接口 - * - * @author rch - * @since 2022-07-01 - */ -@Service -public interface CtResponseOrderProductService extends IService { - -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/service/CtResponseOrderService.java b/wjcy-common/src/main/java/me/zhengjie/service/CtResponseOrderService.java deleted file mode 100644 index 99d8a84..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/CtResponseOrderService.java +++ /dev/null @@ -1,17 +0,0 @@ -package me.zhengjie.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import me.zhengjie.entity.CtResponseOrder; -import org.springframework.stereotype.Service; - -/** - * 下单成功响应订单商品信息(CtResponseOrder)表服务接口 - * - * @author rch - * @since 2022-07-01 - */ -@Service -public interface CtResponseOrderService extends IService { - -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/service/CtVpnService.java b/wjcy-common/src/main/java/me/zhengjie/service/CtVpnService.java deleted file mode 100644 index d4327c2..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/CtVpnService.java +++ /dev/null @@ -1,24 +0,0 @@ -package me.zhengjie.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import me.zhengjie.entity.CtVpn; -import me.zhengjie.entity.CtVpnInfo; - -import java.util.List; - -/** - * VPN信息表(CtVpn)表服务接口 - * - * @author rch - * @since 2022-07-07 - */ -public interface CtVpnService extends IService { - - List getIpList(); - - /** - * 根据ip地址查询vpn信息(id、ip地址) - */ - List getVpnInfoByIp(List ipAddress); -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/service/DhAddCarOrderService.java b/wjcy-common/src/main/java/me/zhengjie/service/DhAddCarOrderService.java deleted file mode 100644 index 861fc33..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/DhAddCarOrderService.java +++ /dev/null @@ -1,41 +0,0 @@ -package me.zhengjie.service; - -import com.baomidou.mybatisplus.core.conditions.Wrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.service.IService; -import me.zhengjie.entity.DhAddCarOrder; -import me.zhengjie.service.vo.dhcarorder.DhAddCarOrderListVO; -import me.zhengjie.service.vo.dhcarorder.DhCarOrderParamsVO; -import me.zhengjie.utils.PageUtils; - -/** - * 敦煌-加购物车-订单(DhAddCarOrder)表服务接口 - * - * @author rch - * @since 2022-11-17 09:11:59 - */ -public interface DhAddCarOrderService extends IService { - - /** - * 加锁获取敦煌购物车抓单信息 - * @param valueOf - * @return - */ - DhAddCarOrder getByIdLock(Long valueOf); - - /** - * 分页查询 - * @param page - * @param ew - * @return - */ - PageUtils searchPageList(IPage page, Wrapper ew); - - /** - * 获取敦煌加购-好评影刀参数 - * @param valueOf - * @return - */ - DhCarOrderParamsVO getYdParams(Long valueOf); -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/service/DhAddCarService.java b/wjcy-common/src/main/java/me/zhengjie/service/DhAddCarService.java deleted file mode 100644 index 59c02b5..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/DhAddCarService.java +++ /dev/null @@ -1,49 +0,0 @@ -package me.zhengjie.service; - -import com.baomidou.mybatisplus.core.conditions.Wrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.service.IService; -import me.zhengjie.entity.DhAddCar; -import me.zhengjie.service.vo.dhaddcar.DhAddCarVO; -import me.zhengjie.service.vo.dhaddcar.DhAddCarListVO; -import me.zhengjie.service.vo.dhaddcar.DhAddCarYdParamsVO; -import me.zhengjie.utils.PageUtils; - -/** - * 敦煌加入购物车(DhAddCar)表服务接口 - * - * @author makejava - * @since 2022-11-17 09:11:55 - */ -public interface DhAddCarService extends IService { - - /** - * 分页查询 - * @param page - * @param ew - * @return - */ - PageUtils searchPageList(IPage page, Wrapper ew); - - /** - * 根据id获取加购信息 - * @param id - * @return - */ - DhAddCarVO getDetailById(Long id); - - /** - * 根据id加悲观锁查询 - * @param id - * @return - */ - DhAddCar getByIdLock(Long id); - - /** - * 拼接影刀参数 - * @param id - * @return - */ - DhAddCarYdParamsVO getAddCarYdParams(Long id); -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/service/DhCarGoodsService.java b/wjcy-common/src/main/java/me/zhengjie/service/DhCarGoodsService.java deleted file mode 100644 index 7546ef4..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/DhCarGoodsService.java +++ /dev/null @@ -1,15 +0,0 @@ -package me.zhengjie.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import me.zhengjie.entity.DhCarGoods; - -/** - * 敦煌-加入购物车商品信息(DhCarGoods)表服务接口 - * - * @author makejava - * @since 2022-11-17 09:12:03 - */ -public interface DhCarGoodsService extends IService { - -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/service/FileUploadService.java b/wjcy-common/src/main/java/me/zhengjie/service/FileUploadService.java deleted file mode 100644 index e7af6ee..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/FileUploadService.java +++ /dev/null @@ -1,20 +0,0 @@ -package me.zhengjie.service; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.List; - -/** - *

- * 图片上传服务 - *

- * - * @Author xx - * @Date 2021/7/26 - **/ -public interface FileUploadService { - - List uploadify(HttpServletRequest request, HttpServletResponse response) - throws IOException; -} diff --git a/wjcy-common/src/main/java/me/zhengjie/service/LoginIpService.java b/wjcy-common/src/main/java/me/zhengjie/service/LoginIpService.java deleted file mode 100644 index a0bfcad..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/LoginIpService.java +++ /dev/null @@ -1,58 +0,0 @@ -package me.zhengjie.service; - -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.service.IService; -import me.zhengjie.entity.LoginIp; -import me.zhengjie.utils.PageUtils; - -import java.util.List; - -/** - * (LoginIp)表服务接口 - * - * @author zeng - * @since 2022-03-21 14:07:01 - */ -public interface LoginIpService extends IService { - - String LOGIN_IP_LIST = "LOGIN_IP_LIST"; - - /** - * 获取IP列表 - * @author: zeng - * @param iPage - */ - PageUtils getList(IPage iPage); - - /** - * 新增 - * @author: zeng - */ - boolean addIp(LoginIp ip); - - /** - * 查询所有有效白名单IP段 - * @return - */ - List getAll(); - - /** - * 编辑 - * @author: zeng - */ - boolean updateIp(LoginIp ip); - - /** - * 删除 - * @author: zeng - */ - boolean deleteIp(Integer id); - - /** - * 是否是白名单 - * @author: zeng - */ - boolean whiteListFlag(String ip); - -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/service/SettingSiteService.java b/wjcy-common/src/main/java/me/zhengjie/service/SettingSiteService.java deleted file mode 100644 index a3a2097..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/SettingSiteService.java +++ /dev/null @@ -1,25 +0,0 @@ -package me.zhengjie.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import me.zhengjie.entity.CtSettingSite; - -/** - * 站点配置(CtSettingSite)表服务接口 - * - * @author xxs - * @since 2021-11-17 - */ -public interface SettingSiteService extends IService { - - String getValue(String key); - - boolean saveOrUpdateByKey(String key, String value); - - /** - * Google认证器开关 - * @auth xxs - * @return - */ - Boolean getGooleAuthSwitch(); -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/service/SysQuartzLogService.java b/wjcy-common/src/main/java/me/zhengjie/service/SysQuartzLogService.java deleted file mode 100644 index 0b56c21..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/SysQuartzLogService.java +++ /dev/null @@ -1,21 +0,0 @@ -package me.zhengjie.service; - -import com.baomidou.mybatisplus.core.conditions.Wrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.service.IService; -import me.zhengjie.entity.SysQuartzJob; -import me.zhengjie.entity.SysQuartzLog; -import me.zhengjie.service.vo.SysQuartzLogListVO; -import me.zhengjie.utils.PageUtils; - -/** - * 定时任务(SysQuartzJob)表服务接口 - * - * @author rch - * @since 2022-07-20 - */ -public interface SysQuartzLogService extends IService { - - PageUtils searchPageList(IPage page, Wrapper wrapper); -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/service/YdQuartzService.java b/wjcy-common/src/main/java/me/zhengjie/service/YdQuartzService.java deleted file mode 100644 index 619bdf5..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/YdQuartzService.java +++ /dev/null @@ -1,74 +0,0 @@ -package me.zhengjie.service; - -import me.zhengjie.entity.quartz.JobQueryByUuidReturn; -import me.zhengjie.service.redission.LockCallBack; - -/** - * 影刀定时任务Service - * - * @author rch - * @since 2022-08-01 - */ -public interface YdQuartzService{ - - Object executeOnLock(String lockKey, long time, long timeout, LockCallBack callBack) throws Exception; - - public String exec(String str) throws Exception; - - - /** - * 刷单 任务执行逻辑 - * @param str - * @return - * @throws Exception - */ - public Boolean clickFarmExec(String str) throws Exception; - - /** - * 敦煌加购 任务执行逻辑 - * @param str - * @return - * @throws Exception - */ - public Boolean addCarExec(String str) throws Exception; - - - /** - * 敦煌-加购-抓单 - * @param str - * @return - * @throws Exception - */ - public Boolean catchOrderExec(String str) throws Exception; - - public JobQueryByUuidReturn queryJobUuid(String uuid, String accessKeyId, String accessKeySecret); - - /** - * 刷单任务-补录(有订单信息-支付失败) - * @param str - * @return - */ - Boolean clickFarmSuppleMentExec(String str) throws Exception; - - /** - * 敦煌 - * @param str - * @return - * @throws Exception - */ - public Object dhWellReceivedExec(String str) throws Exception; - /** - * 好评 - * @param str - * @return - */ - Object wellReceivedExec(String str) throws Exception; - - /** - * 浏览收藏 - * @param str - * @return - */ - Object browseTaskExec(String str) throws Exception; -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/service/impl/CtApplyServiceImpl.java b/wjcy-common/src/main/java/me/zhengjie/service/impl/CtApplyServiceImpl.java deleted file mode 100644 index c0b0190..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/impl/CtApplyServiceImpl.java +++ /dev/null @@ -1,44 +0,0 @@ -package me.zhengjie.service.impl; - -import com.baomidou.mybatisplus.core.conditions.Wrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import me.zhengjie.dao.CtApplyDao; -import me.zhengjie.entity.CtApply; -import me.zhengjie.service.CtApplyService; -import me.zhengjie.service.vo.CtApplyListVO; -import me.zhengjie.utils.PageUtils; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; - -/** - * 影刀应用信息(CtApply)表服务实现类 - * - * @author rch - * @since 2022-07-23 - */ -@Service -public class CtApplyServiceImpl extends ServiceImpl implements CtApplyService { - - @Resource - private CtApplyDao ctApplyDao; - - @Override - public PageUtils searchPageList(IPage page, Wrapper ew) { - ctApplyDao.searchPageList(page, ew); - return new PageUtils<>(page.getTotal(),page.getRecords()); - } - - @Override - public List getAllApplyName() { - return ctApplyDao.getAllApplyName(); - } - - @Override - public CtApply getApplyByTaskAndMethod(String taskName, String method) { - return ctApplyDao.getApplyByTaskAndMethod(taskName, method); - } -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/service/impl/CtBrowseServiceImpl.java b/wjcy-common/src/main/java/me/zhengjie/service/impl/CtBrowseServiceImpl.java deleted file mode 100644 index 2b7896d..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/impl/CtBrowseServiceImpl.java +++ /dev/null @@ -1,44 +0,0 @@ -package me.zhengjie.service.impl; - -import com.baomidou.mybatisplus.core.conditions.Wrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import me.zhengjie.dao.CtBrowseDao; -import me.zhengjie.entity.CtBrowse; -import me.zhengjie.service.CtBrowseService; -import me.zhengjie.service.vo.CtBrowseDetailVO; -import me.zhengjie.service.vo.CtBrowseListVO; -import me.zhengjie.utils.PageUtils; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; - -/** - * 浏览收藏(CtBrowse)表服务实现类 - * - * @author rch - * @since 2022-11-04 09:45:33 - */ -@Service -public class CtBrowseServiceImpl extends ServiceImpl implements CtBrowseService { - - @Resource - private CtBrowseDao ctBrowseDao; - - @Override - public PageUtils searchPageList(IPage page, Wrapper ew) { - ctBrowseDao.searchPageList(page, ew); - return new PageUtils(page.getTotal(), page.getRecords()); - } - - @Override - public CtBrowse getByIdLock(Long id) { - return ctBrowseDao.getByIdLock(id); - } - - @Override - public CtBrowseDetailVO getBrowseDetailById(Long id) { - return ctBrowseDao.getBrowseDetailById(id); - } -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/service/impl/CtBuyerServiceImpl.java b/wjcy-common/src/main/java/me/zhengjie/service/impl/CtBuyerServiceImpl.java deleted file mode 100644 index 889a0ca..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/impl/CtBuyerServiceImpl.java +++ /dev/null @@ -1,69 +0,0 @@ -package me.zhengjie.service.impl; - -import cn.hutool.core.util.ObjectUtil; -import com.baomidou.mybatisplus.core.conditions.Wrapper; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import me.zhengjie.dao.CtBuyerDao; -import me.zhengjie.entity.CtBuyer; -import me.zhengjie.service.CtBuyerService; -import me.zhengjie.service.vo.CtBuyerDetailVO; -import me.zhengjie.service.vo.CtBuyerListVO; -import me.zhengjie.utils.PageUtils; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - -/** - * 买家表(CtBuyer)表服务实现类 - * - * @author rch - * @since 2022-06-22 - */ -@Service -public class CtBuyerServiceImpl extends ServiceImpl implements CtBuyerService { - - @Resource - private CtBuyerDao ctBuyerDao; - - @Override - public PageUtils searchPageList(IPage page, Wrapper ew) { - ctBuyerDao.searchPageList(page, ew); - return new PageUtils(page.getTotal(), page.getRecords()); - } - - @Override - public CtBuyerDetailVO getDetailById(Long id) { - return ctBuyerDao.getDetailById(id); - } - - @Override - public List getAllAccount(){ return ctBuyerDao.getAllAccount();} - - @Override - public String getPwdByName(String name) { - return ctBuyerDao.getPwdByName(name); - } - - @Override - public CtBuyer getBuyerOccupyStatusLock(String buyerName) { - return ctBuyerDao.getBuyerOccupyStatusLock(buyerName); - } - - @Override - public Map getBuyerList(List buyerAccountList) { - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.in("account", buyerAccountList); - - List ctBuyerList = list(queryWrapper); - if (ObjectUtil.isNotEmpty(ctBuyerList)) { - return ctBuyerList.stream().collect(Collectors.toMap(CtBuyer::getAccount, CtBuyer->CtBuyer)); - } - return null; - } -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/service/impl/CtCardServiceImpl.java b/wjcy-common/src/main/java/me/zhengjie/service/impl/CtCardServiceImpl.java deleted file mode 100644 index e36521c..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/impl/CtCardServiceImpl.java +++ /dev/null @@ -1,33 +0,0 @@ -package me.zhengjie.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import me.zhengjie.dao.CtCardDao; -import me.zhengjie.entity.CtCard; -import me.zhengjie.entity.CtCardInfo; -import me.zhengjie.service.CtCardService; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; - -/** - * 信用卡信息(CtCard)表服务实现类 - * - * @author rch - * @since 2022-07-07 - */ -@Service -public class CtCardServiceImpl extends ServiceImpl implements CtCardService { - - @Resource - private CtCardDao ctCardDao; - - @Override - public List getNumberList() { - return ctCardDao.getNumberList(); - } - - @Override - public List getCardInfoByNumber(List number){ return ctCardDao.getCardInfoByNumber(number);} -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/service/impl/CtClickFarmingServiceImpl.java b/wjcy-common/src/main/java/me/zhengjie/service/impl/CtClickFarmingServiceImpl.java deleted file mode 100644 index ea01a9d..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/impl/CtClickFarmingServiceImpl.java +++ /dev/null @@ -1,62 +0,0 @@ -package me.zhengjie.service.impl; - -import com.baomidou.mybatisplus.core.conditions.Wrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import me.zhengjie.dao.CtClickFarmingDao; -import me.zhengjie.entity.CtBuyerClickSuccess; -import me.zhengjie.entity.CtClickFarmYdParams; -import me.zhengjie.entity.CtClickFarming; -import me.zhengjie.service.CtClickFarmingService; -import me.zhengjie.service.vo.CtClickFarmEditDetailVO; -import me.zhengjie.service.vo.CtClickFarmingDetailVO; -import me.zhengjie.service.vo.CtClickFarmingVO; -import me.zhengjie.utils.PageUtils; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; - -/** - * 刷单Excel信息(CtClickFarming)表服务实现类 - * - * @author rch - * @since 2022-08-16 - */ -@Service -public class CtClickFarmingServiceImpl extends ServiceImpl implements CtClickFarmingService { - - @Resource - private CtClickFarmingDao ctClickFarmingDao; - @Override - public PageUtils searchPageList(IPage page, Wrapper ew) { - ctClickFarmingDao.searchPageList(page, ew); - return new PageUtils(page.getTotal(), page.getRecords()); - } - - @Override - public CtClickFarming getByIdLock(Long id) { - return ctClickFarmingDao.getByIdLock(id); - } - - @Override - public CtClickFarmEditDetailVO getEditDetailById(Long id) { - return ctClickFarmingDao.getEditDetailById(id); - } - - @Override - public CtClickFarmingDetailVO getDetailById(Long id) { - return ctClickFarmingDao.getDetailById(id); - } - - @Override - public List ruleGetCtBuyer(String buyerAccount, String country, String shopName) { - return ctClickFarmingDao.ruleGetCtBuyer(buyerAccount, country, shopName); - } - - @Override - public CtClickFarmYdParams getCtClickFarmYdParams(Long id) { - return ctClickFarmingDao.getCtClickFarmYdParams(id); - } -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/service/impl/CtClickOrderServiceImpl.java b/wjcy-common/src/main/java/me/zhengjie/service/impl/CtClickOrderServiceImpl.java deleted file mode 100644 index 1b0f3e1..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/impl/CtClickOrderServiceImpl.java +++ /dev/null @@ -1,90 +0,0 @@ -package me.zhengjie.service.impl; - -import cn.hutool.core.util.ObjectUtil; -import com.baomidou.mybatisplus.core.conditions.Wrapper; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import me.zhengjie.dao.CtClickOrderDao; -import me.zhengjie.entity.CtClickFarming; -import me.zhengjie.entity.CtClickFarmingOrderInfo; -import me.zhengjie.entity.CtClickOrder; -import me.zhengjie.enums.ClickFarmingStatusEnum; -import me.zhengjie.service.CtClickFarmingService; -import me.zhengjie.service.CtClickOrderService; -import me.zhengjie.service.vo.CtClickOrderDetailVO; -import me.zhengjie.service.vo.CtClickOrderListVO; -import me.zhengjie.utils.PageUtils; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import javax.annotation.Resource; -import java.util.ArrayList; -import java.util.List; -import java.util.stream.Collectors; - -/** - * 刷单-订单信息(CtClickOrder)表服务实现类 - * - * @author rch - * @since 2022-09-14 - */ -@Service -public class CtClickOrderServiceImpl extends ServiceImpl implements CtClickOrderService { - - @Resource - private CtClickOrderDao ctClickOrderDao; - @Resource - private CtClickFarmingService ctClickFarmingService; - - @Override - public List getOrderId(List importOrderIdList) { - List orderIdList = new ArrayList<>(); - QueryWrapper queryWrapper = new QueryWrapper(); - queryWrapper.in("order_id", importOrderIdList) - .select("order_id"); - List queryClickOrderIdList = list(queryWrapper); - if (ObjectUtil.isNotEmpty(queryClickOrderIdList)) { - orderIdList = queryClickOrderIdList.stream().map(q->q.getOrderId()).collect(Collectors.toList()); - } - return orderIdList; - } - - @Override - public PageUtils searchPageList(IPage page, Wrapper ew) { - ctClickOrderDao.searchPageList(page, ew); - return new PageUtils(page.getTotal(), page.getRecords()); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public Boolean supplement(Long clickFarmingId, CtClickOrder ctClickOrder) { - Boolean saveBoolean = save(ctClickOrder); - if (!saveBoolean) { - return false; - } - Long ctOrderId = ctClickOrder.getId(); - CtClickFarming ctClickFarming = new CtClickFarming(); - ctClickFarming.setId(clickFarmingId); - ctClickFarming.setCtClickOrderId(ctOrderId); - ctClickFarming.setStatus(ClickFarmingStatusEnum.EXECUTION_SUCCESS.value()); - - return ctClickFarmingService.updateById(ctClickFarming); - } - - @Override - public CtClickFarmingOrderInfo getClickFarmOrderById(Long orderId) { - return ctClickOrderDao.getClickFarmOrderById(orderId); - } - - @Override - public CtClickOrder getByIdLock(Long id) { - return ctClickOrderDao.getByIdLock(id); - } - - @Override - public CtClickOrderDetailVO getClickOrderDetailById(Long id) { - return ctClickOrderDao.getClickOrderDetailById(id); - } -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/service/impl/CtCompanyServiceImpl.java b/wjcy-common/src/main/java/me/zhengjie/service/impl/CtCompanyServiceImpl.java deleted file mode 100644 index e5948ac..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/impl/CtCompanyServiceImpl.java +++ /dev/null @@ -1,53 +0,0 @@ -package me.zhengjie.service.impl; - -import cn.hutool.core.util.ObjectUtil; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import me.zhengjie.dao.CtCompanyDao; -import me.zhengjie.entity.CtCompany; -import me.zhengjie.entity.CtCompanyInfo; -import me.zhengjie.entity.CtPlatform; -import me.zhengjie.service.CtCompanyService; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - -/** - * 公司信息(CtCompany)表服务实现类 - * - * @author makejava - * @since 2022-06-23 10:37:44 - */ -@Service -public class CtCompanyServiceImpl extends ServiceImpl implements CtCompanyService { - - @Resource - private CtCompanyDao ctCompanyDao; - - @Override - public List getByNmae(List name) { - return ctCompanyDao.getByName(name); - } - - @Override - public List getCompanyList() { - return ctCompanyDao.getCompanyList(); - } - - @Override - public Map getNameList(List platNameList) { - Map ctCompanyMap = new HashMap<>(16); - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.in("name", platNameList).select("id", "name"); - List ctCompanyList = list(queryWrapper); - if (ObjectUtil.isNotEmpty(ctCompanyList)) { - ctCompanyMap = ctCompanyList.stream().collect(Collectors.toMap(CtCompany::getId, CtCompany::getName)); - } - return ctCompanyMap; - } -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/service/impl/CtDhPayServiceImpl.java b/wjcy-common/src/main/java/me/zhengjie/service/impl/CtDhPayServiceImpl.java deleted file mode 100644 index bf25565..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/impl/CtDhPayServiceImpl.java +++ /dev/null @@ -1,100 +0,0 @@ -package me.zhengjie.service.impl; - -import cn.hutool.core.util.ObjectUtil; -import cn.hutool.json.JSONUtil; -import com.baomidou.mybatisplus.core.conditions.Wrapper; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import me.zhengjie.config.DhApiProperties; -import me.zhengjie.constant.PublicConstant; -import me.zhengjie.dao.CtDhPayDao; -import me.zhengjie.entity.CtDhPay; -import me.zhengjie.entity.CtDhPayExport; -import me.zhengjie.enums.DhPayStatusEnum; -import me.zhengjie.enums.ExcelStatusEnum; -import me.zhengjie.service.CtBuyerService; -import me.zhengjie.service.CtDhPayService; -import me.zhengjie.service.vo.CtBuyerListVO; -import me.zhengjie.service.vo.CtDhPayListVO; -import me.zhengjie.service.vo.PayOrderVO; -import me.zhengjie.utils.HttpClientUtil; -import me.zhengjie.utils.PageUtils; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * 平台信息(CtDyPay)表服务实现类 - * - * @author rch - * @since 2022-07-28 - */ -@Service -public class CtDhPayServiceImpl extends ServiceImpl implements CtDhPayService { - - @Resource - private CtDhPayDao ctDhPayDao; - - @Resource - private CtBuyerService ctBuyerService; - - @Override - public PageUtils searchPageList(IPage page, Wrapper ew) { - ctDhPayDao.searchPageList(page, ew); - return new PageUtils(page.getTotal(), page.getRecords()); - } - - @Override - public void toPay() { - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("status", DhPayStatusEnum.TO_BE.value()); - List ctDhPayList = list(queryWrapper); - - // for 循环下单处理 - for (CtDhPay ctDhPay :ctDhPayList) { - payOrderApi(ctDhPay); - } - } - - @Override - public Boolean payOrderApi(CtDhPay ctDhPay) { - - // TODO 参数检验验证 - - String buyerName = ctDhPay.getBuyerName(); - String pwd = ctBuyerService.getPwdByName(buyerName); - if (ObjectUtil.isEmpty(pwd)) { - return false; - } - - Map params = new HashMap<>(16); - // 统一请求参数 - params.put("timestamp", System.currentTimeMillis()); - params.put("v", DhApiProperties.PAY_ORDER_V); - params.put("access_token", pwd); - params.put("method", DhApiProperties.PAY_ORDER_METHOD); - - // boby - params.put("orderNo", ctDhPay.getOrderId()); - - String responseStr = HttpClientUtil.doPostHttp(DhApiProperties.PAY_ORDER_URL, params); - PayOrderVO payOrderVO = JSONUtil.toBean(responseStr, PayOrderVO.class); - Boolean requestBoolean = false; - // 成功 修改订单状态 以及填充接口响应信息 - if (ObjectUtil.isNotEmpty(payOrderVO) && PublicConstant.RESPONSE_SUCCESS.equals(payOrderVO.getResult()) && PublicConstant.DH_REQUEST_SUCCESS_STATUS_CODE.equals(payOrderVO.getStatus().getCode())) { - requestBoolean = true; - } - - Integer status = requestBoolean ? DhPayStatusEnum.PAY_SUCCESS.value() : DhPayStatusEnum.PAY_FAIL.value(); - CtDhPay updateCtDhPay = new CtDhPay(); - updateCtDhPay.setId(ctDhPay.getId()); - updateCtDhPay.setResponse(JSONUtil.toJsonStr(payOrderVO)); - updateCtDhPay.setStatus(status); - return updateById(updateCtDhPay); - } -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/service/impl/CtExcelImportInfoServiceImpl.java b/wjcy-common/src/main/java/me/zhengjie/service/impl/CtExcelImportInfoServiceImpl.java deleted file mode 100644 index 0a86ff5..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/impl/CtExcelImportInfoServiceImpl.java +++ /dev/null @@ -1,174 +0,0 @@ -package me.zhengjie.service.impl; - -import cn.hutool.core.bean.BeanUtil; -import cn.hutool.core.lang.Snowflake; -import cn.hutool.core.util.ObjectUtil; -import cn.hutool.json.JSONUtil; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import lombok.extern.slf4j.Slf4j; -import me.zhengjie.config.PropertiesConfig; -import me.zhengjie.config.SystemConfig; -import me.zhengjie.constant.PublicConstant; -import me.zhengjie.dao.CtExcelImportInfoDao; -import me.zhengjie.entity.*; -import me.zhengjie.enums.ExcelInfoRequestTypeEnum; -import me.zhengjie.enums.ExcelStatusEnum; -import me.zhengjie.service.CtBuyerService; -import me.zhengjie.service.CtCompanyService; -import me.zhengjie.service.CtExcelImportInfoService; -import me.zhengjie.service.CtExcelService; -import me.zhengjie.utils.excel.ExcelUtils; -import org.springframework.beans.BeanUtils; -import org.springframework.context.annotation.Bean; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.io.File; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.stream.Collectors; - -/** - * Excel导入信息(CtExcelImportInfo)表服务实现类 - * - * @author rch - * @since 2022-06-23 - */ -@Slf4j -@Service -public class CtExcelImportInfoServiceImpl extends ServiceImpl implements CtExcelImportInfoService { - - @Resource - private CtExcelService ctExcelService; - @Resource - private CtCompanyService ctCompanyService; - @Resource - private CtBuyerService ctBuyerService; - @Resource - private PropertiesConfig propertiesConfig; - @Resource - private Snowflake snowflake; - - @Override - public void importExcel() throws IOException { - LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); - queryWrapper.eq(CtExcel::getStatus, ExcelStatusEnum.TOBE.value()); - - List ctExcelList = ctExcelService.list(queryWrapper); - // 导入存储数据库业务逻辑 - if (ObjectUtil.isNotEmpty(ctExcelList)) { - - // TODO -判断公司和token 是否匹配 不匹配则导入失败 - - // 符合条件的往下走 - String errorUrlPath = saveExcel(ctExcelList); - LambdaQueryWrapper updateStatusQW = new LambdaQueryWrapper<>(); - List ctExcelIdList = ctExcelList.stream().map(CtExcel::getId).collect(Collectors.toList()); - updateStatusQW.in(CtExcel::getId, ctExcelIdList); - - int status = ObjectUtil.isEmpty(errorUrlPath) ? ExcelStatusEnum.SUCCESS.value() : ExcelStatusEnum.FAILE.value(); - // 不符合条件的 直接失败 - CtExcel updateCtExcel = new CtExcel(); - updateCtExcel.setErrorPath(errorUrlPath); - updateCtExcel.setStatus(status); - ctExcelService.update(updateCtExcel, updateStatusQW); - } - } - - /** - * 导入业务逻辑 - * @param ctExcelList - * @return - */ - public String saveExcel(List ctExcelList) throws IOException { - - String returnDataStr = null; - List excelImportInfoList = new ArrayList<>(); - - for (CtExcel ctExcel:ctExcelList) { - String platImageUrl = SystemConfig.IMG_PATH; - String pathUrl = ctExcel.getPath(); - String excelPathUrl = platImageUrl + pathUrl; - - // 读取文件 - File file = new File(excelPathUrl); - try { - List excelImportInfoTempList = ExcelUtils.readFile(file, CtExcelImportInfo.class); - if (ObjectUtil.isNotEmpty(excelImportInfoTempList)) { - excelImportInfoList.addAll(excelImportInfoTempList); - } - } catch (Exception exception) { - System.out.println(exception.getMessage()); - } - } - - // 存储mysql - if (ObjectUtil.isNotEmpty(excelImportInfoList)) { - - - List addCtExcelImportInfoList = new ArrayList<>(); - List errorCtExcelExportInfoList = new ArrayList<>(); - - List companyIdList = excelImportInfoList.stream().map(CtExcelImportInfo::getCompanyId).collect(Collectors.toList()); - QueryWrapper queryWrapperCompany = new QueryWrapper<>(); - queryWrapperCompany.in("id", companyIdList); - List ctCompanyList = ctCompanyService.list(queryWrapperCompany); - - List buyerIdList = excelImportInfoList.stream().map(CtExcelImportInfo::getTokenEnum).collect(Collectors.toList()); - QueryWrapper queryWrapperBuyer = new QueryWrapper<>(); - queryWrapperBuyer.in("id", buyerIdList); - List ctBuyerList = ctBuyerService.list(queryWrapperBuyer); - - // 新增订单编号 - for (CtExcelImportInfo ctExcelImportInfo:excelImportInfoList) { - CtExcelExportInfo ctExcelExportInfo = new CtExcelExportInfo(); - BeanUtil.copyProperties(ctExcelImportInfo, ctExcelExportInfo); - // TODO 检验Excel 导入的文件是否符合要求 符合要求导入 不符合要求则直接Excel错误信息导出 - StringBuffer errorStrBuf = new StringBuffer(); - if (ObjectUtil.isEmpty(ctCompanyList) - || ctCompanyList.stream().filter(c->c.getId().equals(ctExcelImportInfo.getCompanyId())).count() <= 0) { - errorStrBuf.append("公司信息不存在!"); - errorStrBuf.append(";"); - } - - if (ObjectUtil.isEmpty(ctBuyerList) - || ctBuyerList.stream().filter(c->c.getId().equals(ctExcelImportInfo.getTokenEnum())).count() <= 0) { - errorStrBuf.append("买家信息不存在!"); - errorStrBuf.append(";"); - } - - if (ObjectUtil.isNotEmpty(errorStrBuf)) { - ctExcelExportInfo.setError(errorStrBuf.toString()); - errorCtExcelExportInfoList.add(ctExcelExportInfo); - } else { - CtBuyerContactInfo ctBuyerContactInfo = new CtBuyerContactInfo(); - CtBuyer ctBuyer = ctBuyerList.stream().filter(c->c.getId().equals(ctExcelImportInfo.getTokenEnum())).findFirst().get(); - // 取出收款地址信息 - BeanUtil.copyProperties(ctBuyer, ctBuyerContactInfo); - - ctExcelImportInfo.setOrderNo(snowflake.nextIdStr()); - ctExcelImportInfo.setContactInfo(JSONUtil.toJsonStr(ctBuyerContactInfo)); - addCtExcelImportInfoList.add(ctExcelImportInfo); - } - } - - // TODO 不符合条件的 Excel 导出 返回导出excel url url = errorExcelUrl; - String filePath = propertiesConfig.getUploadImgPath().get(PublicConstant.EXPORT_EXCEL_FILE_TYPE); - String fileName = "下单信息导入异常信息表-" + snowflake.nextIdStr(); - if (ObjectUtil.isNotEmpty(errorCtExcelExportInfoList)) { - ExcelUtils.exportFile(SystemConfig.IMG_PATH + filePath, fileName, errorCtExcelExportInfoList); - returnDataStr = SystemConfig.FILE_VISIT_ADDR + filePath + fileName + ".xlsx"; - // returnDataStr = "http://localhost:8008/file" + filePath + fileName + ".xlsx"; - } - // 如何条件的导入 - if (ObjectUtil.isNotEmpty(addCtExcelImportInfoList)) { - saveBatch(addCtExcelImportInfoList); - } - } - return returnDataStr; - } -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/service/impl/CtExcelServiceImpl.java b/wjcy-common/src/main/java/me/zhengjie/service/impl/CtExcelServiceImpl.java deleted file mode 100644 index 6cfbb08..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/impl/CtExcelServiceImpl.java +++ /dev/null @@ -1,19 +0,0 @@ -package me.zhengjie.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import me.zhengjie.dao.CtExcelDao; -import me.zhengjie.entity.CtExcel; -import me.zhengjie.service.CtExcelService; -import org.springframework.stereotype.Service; - -/** - * Excel 导入信息(CtExcel)表服务实现类 - * - * @author makejava - * @since 2022-06-23 10:37:44 - */ -@Service -public class CtExcelServiceImpl extends ServiceImpl implements CtExcelService { - -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/service/impl/CtOrderServiceImpl.java b/wjcy-common/src/main/java/me/zhengjie/service/impl/CtOrderServiceImpl.java deleted file mode 100644 index 9fe1f5b..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/impl/CtOrderServiceImpl.java +++ /dev/null @@ -1,196 +0,0 @@ -package me.zhengjie.service.impl; - -import cn.hutool.core.bean.BeanUtil; -import cn.hutool.core.util.ObjectUtil; -import cn.hutool.json.JSONUtil; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import me.zhengjie.config.DhApiProperties; -import me.zhengjie.constant.PublicConstant; -import me.zhengjie.dao.CtOrderDao; -import me.zhengjie.entity.*; -import me.zhengjie.enums.ExcelStatusEnum; -import me.zhengjie.service.*; -import me.zhengjie.service.vo.*; -import me.zhengjie.utils.HttpClientUtil; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import javax.annotation.Resource; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * (CtOrder)表服务实现类 - * - * @author rch - * @since 2022-07-01 - */ -@Service -public class CtOrderServiceImpl extends ServiceImpl implements CtOrderService { - - @Resource - private CtExcelImportInfoService ctExcelImportInfoService; - @Resource - private CtResponseOrderService ctResponseOrderService; - @Resource - private CtResponseOrderAddressService ctResponseOrderAddressService; - @Resource - private CtResponseOrderProductService ctResponseOrderProductService; - @Resource - private CtBuyerService ctBuyerService; - - @Override - public void excelToOrder() { - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("status", ExcelStatusEnum.TOBE.value()); - List ctExcelImportInfoList = ctExcelImportInfoService.list(queryWrapper); - - for (CtExcelImportInfo ctExcelImportInfo:ctExcelImportInfoList) { - buyOrderApi(ctExcelImportInfo); - } - } - - @Transactional(rollbackFor = Exception.class) - public Boolean buyOrderApi(CtExcelImportInfo ctExcelImportInfo) { - - // TODO 请求参数解析 检验 -先不做 - - // 获取买家access_token - Long buyerId = ctExcelImportInfo.getTokenEnum(); - CtBuyer ctBuyer = ctBuyerService.getById(buyerId); - - Map params = new HashMap<>(); - // 统一请求参数 - params.put("timestamp", System.currentTimeMillis()); - params.put("v", DhApiProperties.BUY_ORDER_V); - params.put("access_token", ctBuyer.getPwd()); - params.put("method", DhApiProperties.BUY_ORDER_METHOD); - - // boby - params.put("fromDetailInfo", ctExcelImportInfo.getFromDetailInfo()); - String carList = ctExcelImportInfo.getCartList(); - String contacInfo = ctExcelImportInfo.getContactInfo(); - params.put("cartList", carList); - params.put("contactInfo", contacInfo); - - - String responseStr = HttpClientUtil.doPostHttp(DhApiProperties.BUY_ORDER_URL, params); - - // 请求响应转对象 - BuyOrderVO buyOrderVO = JSONUtil.toBean(responseStr, BuyOrderVO.class); - System.out.println("buyOrderVO: " + buyOrderVO.toString()); - - Boolean saveOrderBathResult = false; - // 业务逻辑处理 数据处理 - if (ObjectUtil.isNotEmpty(buyOrderVO) && PublicConstant.DH_REQUEST_SUCCESS_STATUS_CODE.equals(buyOrderVO.getStatus().getCode())) { - // 接口响应码以及响应信息 - OrderResponStatusVO orderResponStatus = buyOrderVO.getStatus(); - // 请求接口响应内容 - List OrderResponseList = buyOrderVO.getOrderList(); - - List orderList = new ArrayList<>(); - Long companyId = ctExcelImportInfo.getCompanyId(); - - for (OrderResponseVO orderResponseVO:OrderResponseList) { - CtOrder ctOrder = new CtOrder(); - ctOrder.setCompanyId(companyId); - ctOrder.setBuyerId(buyerId); - ctOrder.setBuyAccessToken(ctBuyer.getPwd()); - ctOrder.setExcelInfoId(ctExcelImportInfo.getId()); - ctOrder.setCtOrderNo(ctExcelImportInfo.getOrderNo()); - ctOrder.setOrderResponseStatus(JSONUtil.toJsonStr(orderResponStatus)); - - // ct_response_order - CtResponseOrder ctResponseOrder = new CtResponseOrder(); - BuyOrderResponseOrderVO buyOrderResponseOrderVO = orderResponseVO.getOrderInfo(); - BeanUtil.copyProperties(buyOrderResponseOrderVO, ctResponseOrder); - System.out.println("======ctResponseOrder:" + ctResponseOrder); - // order 特殊处理 对应响应的id - Long responseOrderId = buyOrderResponseOrderVO.getId(); - ctResponseOrder.setOrderId(responseOrderId); - ctResponseOrderService.save(ctResponseOrder); - Long saveResponseOrderId = ctResponseOrder.getId(); - ctOrder.setResponseOrderId(saveResponseOrderId); - ctOrder.setOrderNo(responseOrderId); - - // ct_response_address - CtResponseOrderAddress ctResponseOrderAddress = new CtResponseOrderAddress(); - BuyOrderResponseAddressVO buyOrderResponseAddress = orderResponseVO.getOrderContactInfo(); - BeanUtil.copyProperties(buyOrderResponseAddress, ctResponseOrderAddress); - System.out.println("======ctResponseOrderAddress:" + ctResponseOrderAddress); - ctResponseOrderAddressService.save(ctResponseOrderAddress); - Long responseOrderAddressId = ctResponseOrderAddress.getId(); - ctOrder.setResponseOrderAddressId(responseOrderAddressId); - - // ct_response_product - // TODO -这里商品响应是一个集合 这里目前看都是单个,先不考虑 - CtResponseOrderProduct ctResponseOrderProduct = new CtResponseOrderProduct(); - List buyOrderResponseProductList = orderResponseVO.getCartList(); - BeanUtil.copyProperties(buyOrderResponseProductList.get(0), ctResponseOrderProduct); - System.out.println("======ctResponseOrderProduct:" + ctResponseOrderProduct); - ctResponseOrderProductService.save(ctResponseOrderProduct); - Long responseproductId = ctResponseOrderProduct.getId(); - ctOrder.setResponseProductId(responseproductId); - - orderList.add(ctOrder); - } - - saveOrderBathResult = saveBatch(orderList); - } - - // 修改Excel状态 - Integer status = saveOrderBathResult ? ExcelStatusEnum.SUCCESS.value() : ExcelStatusEnum.FAILE.value(); - CtExcelImportInfo updateCtExcelImportInfo = new CtExcelImportInfo(); - updateCtExcelImportInfo.setId(ctExcelImportInfo.getId()); - updateCtExcelImportInfo.setStatus(status); - ctExcelImportInfoService.updateById(updateCtExcelImportInfo); - - return true; - } - - @Override - public void toPay() { - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("status", ExcelStatusEnum.TOBE.value()); - List ctOrderList = list(queryWrapper); - - for (CtOrder ctOrder:ctOrderList) { - payOrderApi(ctOrder); - } - } - - @Override - public Boolean payOrderApi(CtOrder ctOrder) { - - // TODO 参数检验验证 - - Map params = new HashMap<>(); - // 统一请求参数 - params.put("timestamp", System.currentTimeMillis()); - params.put("v", DhApiProperties.PAY_ORDER_V); - params.put("access_token", ctOrder.getBuyAccessToken()); - params.put("method", DhApiProperties.PAY_ORDER_METHOD); - - // boby - params.put("orderNo", ctOrder.getOrderNo()); - - String responseStr = HttpClientUtil.doPostHttp(DhApiProperties.PAY_ORDER_URL, params); - PayOrderVO payOrderVO = JSONUtil.toBean(responseStr, PayOrderVO.class); - Boolean requestBoolean = false; - // 成功 修改订单状态 以及填充接口响应信息 - if (ObjectUtil.isNotEmpty(payOrderVO) && PublicConstant.RESPONSE_SUCCESS.equals(payOrderVO.getResult()) && PublicConstant.DH_REQUEST_SUCCESS_STATUS_CODE.equals(payOrderVO.getStatus().getCode())) { - requestBoolean = true; - } - - Integer status = requestBoolean ? ExcelStatusEnum.SUCCESS.value() : ExcelStatusEnum.FAILE.value(); - CtOrder updateCtOrder = new CtOrder(); - updateCtOrder.setId(ctOrder.getId()); - updateCtOrder.setPayResponseStatus(JSONUtil.toJsonStr(payOrderVO)); - updateCtOrder.setStatus(status); - return updateById(updateCtOrder); - } -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/service/impl/CtPlatformServiceImpl.java b/wjcy-common/src/main/java/me/zhengjie/service/impl/CtPlatformServiceImpl.java deleted file mode 100644 index b399b7b..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/impl/CtPlatformServiceImpl.java +++ /dev/null @@ -1,37 +0,0 @@ -package me.zhengjie.service.impl; - -import cn.hutool.core.util.ObjectUtil; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import me.zhengjie.dao.CtPlatformDao; -import me.zhengjie.entity.CtPlatform; -import me.zhengjie.service.CtPlatformService; -import org.springframework.stereotype.Service; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - -/** - * 平台信息(CtPlatform)表服务实现类 - * - * @author makejava - * @since 2022-06-23 10:37:44 - */ -@Service -public class CtPlatformServiceImpl extends ServiceImpl implements CtPlatformService { - - @Override - public Map getNameList(List platNameList) { - Map ctPlatformMap = new HashMap<>(16); - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.in("name", platNameList).select("id", "name"); - List ctPlatformList = list(queryWrapper); - if (ObjectUtil.isNotEmpty(ctPlatformList)) { - ctPlatformMap = ctPlatformList.stream().collect(Collectors.toMap(CtPlatform::getId, CtPlatform::getName)); - } - return ctPlatformMap; - } -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/service/impl/CtRebotServiceImpl.java b/wjcy-common/src/main/java/me/zhengjie/service/impl/CtRebotServiceImpl.java deleted file mode 100644 index 93120c8..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/impl/CtRebotServiceImpl.java +++ /dev/null @@ -1,127 +0,0 @@ -package me.zhengjie.service.impl; - -import cn.hutool.core.bean.BeanUtil; -import cn.hutool.core.lang.Snowflake; -import cn.hutool.core.util.ObjectUtil; -import com.baomidou.mybatisplus.core.conditions.Wrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import me.zhengjie.config.PropertiesConfig; -import me.zhengjie.config.SystemConfig; -import me.zhengjie.constant.PublicConstant; -import me.zhengjie.dao.CtRebotDao; -import me.zhengjie.dto.Dto; -import me.zhengjie.entity.CtRebot; -import me.zhengjie.entity.CtRebotExport; -import me.zhengjie.entity.CtRebotImport; -import me.zhengjie.service.CtRebotService; -import me.zhengjie.service.vo.CtRebotListVO; -import me.zhengjie.utils.PageUtils; -import me.zhengjie.utils.excel.ExcelUtils; -import org.springframework.stereotype.Service; -import org.springframework.web.multipart.MultipartFile; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; -import java.util.ArrayList; -import java.util.List; - -/** - * 影刀设备-机器人信息(CtRebot)表服务实现类 - * - * @author rch - * @since 2022-07-23 - */ -@Service -public class CtRebotServiceImpl extends ServiceImpl implements CtRebotService { - - @Resource - private CtRebotDao ctRebotDao; - @Resource - private PropertiesConfig propertiesConfig; - @Resource - private Snowflake snowflake; - - @Override - public CtRebot getByAccountNameLock(String accountName) { - return ctRebotDao.getByAccountNameLock(accountName); - } - - @Override - public PageUtils searchPageList(IPage page, Wrapper ew) { - ctRebotDao.searchRebotList(page,ew); - return new PageUtils<>(page.getTotal(),page.getRecords()); - } - - @Override - public Dto importRebot(MultipartFile file, HttpServletResponse response)throws Exception { - List ctRebotImportList = ExcelUtils.readMultipartFile(file,CtRebotImport.class); - if(ObjectUtil.isEmpty(ctRebotImportList)){ - return Dto.returnResult(false); - } - - List addCtRebotList = new ArrayList<>(); - List ctRebotExportList = new ArrayList<>(); - List rebotNameList = getAccountNameList(); - List rebotUuidList = getClientUuidList(); - - for(CtRebotImport ctRebotImport : ctRebotImportList){ - CtRebotExport ctRebotExport = new CtRebotExport(); - BeanUtil.copyProperties(ctRebotImport,ctRebotExport); - - StringBuffer errorBuffer = new StringBuffer(); - String rowTips = ctRebotImport.getRowTips(); - if(ObjectUtil.isNotEmpty(rowTips)){ - errorBuffer.append(rowTips); - errorBuffer.append(";"); - } - if(rebotNameList.contains(ctRebotImport.getAccountName())){ - errorBuffer.append("已存在该名称对应的机器人信息"); - errorBuffer.append(";"); - } - if(rebotUuidList.contains(ctRebotImport.getRobotClientUuid())){ - errorBuffer.append("已存在该Uuid对应的机器人信息"); - errorBuffer.append(";"); - } - if(ObjectUtil.isNotEmpty(errorBuffer)){ - ctRebotExport.setError(errorBuffer.toString()); - ctRebotExportList.add(ctRebotExport); - }else{ - CtRebot ctRebot = new CtRebot(); - BeanUtil.copyProperties(ctRebotImport,ctRebot); - addCtRebotList.add(ctRebot); - } - } - - String returnDataStr = null; - String filePath = propertiesConfig.getUploadImgPath().get(PublicConstant.EXPORT_EXCEL_FILE_TYPE); - String fileName = "机器人导入异常信息表-" + snowflake.nextIdStr(); - if(ObjectUtil.isNotEmpty(ctRebotExportList)){ - ExcelUtils.exportFile(SystemConfig.IMG_PATH + filePath, fileName, ctRebotExportList); - returnDataStr = SystemConfig.FILE_VISIT_ADDR + filePath + fileName + ".xlsx"; - //returnDataStr = "http://localhost:8008/file" + filePath + fileName + ".xlsx"; - } - - if(ObjectUtil.isNotEmpty(addCtRebotList)){ - saveBatch(addCtRebotList); - } - - return Dto.returnResult(ObjectUtil.isEmpty(returnDataStr) ? true : returnDataStr); - } - - @Override - public List getAccountNameList() { - return ctRebotDao.getAccountNameList(); - } - - @Override - public List getClientUuidList() { - return ctRebotDao.getClientUuidList(); - } - - @Override - public Boolean updateNewStatusByOldStatus(Long id, Integer newStatus, Integer oldStatus) { - return ctRebotDao.updateNewStatusByOldStatus(id, newStatus, oldStatus); - } -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/service/impl/CtResponseOrderAddressServiceImpl.java b/wjcy-common/src/main/java/me/zhengjie/service/impl/CtResponseOrderAddressServiceImpl.java deleted file mode 100644 index 96ee9e6..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/impl/CtResponseOrderAddressServiceImpl.java +++ /dev/null @@ -1,19 +0,0 @@ -package me.zhengjie.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import me.zhengjie.dao.CtResponseOrderAddressDao; -import me.zhengjie.entity.CtResponseOrderAddress; -import me.zhengjie.service.CtResponseOrderAddressService; -import org.springframework.stereotype.Service; - -/** - * 下注成功订单响应收货地址信息(CtResponseOrderAddress)表服务实现类 - * - * @author rch - * @since 2022-07-01 - */ -@Service -public class CtResponseOrderAddressServiceImpl extends ServiceImpl implements CtResponseOrderAddressService { - -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/service/impl/CtResponseOrderProductServiceImpl.java b/wjcy-common/src/main/java/me/zhengjie/service/impl/CtResponseOrderProductServiceImpl.java deleted file mode 100644 index 9045753..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/impl/CtResponseOrderProductServiceImpl.java +++ /dev/null @@ -1,19 +0,0 @@ -package me.zhengjie.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import me.zhengjie.dao.CtResponseOrderProductDao; -import me.zhengjie.entity.CtResponseOrderProduct; -import me.zhengjie.service.CtResponseOrderProductService; -import org.springframework.stereotype.Service; - -/** - * 下单订单响应产品信息(CtResponseOrderProduct)表服务实现类 - * - * @author rch - * @since 2022-07-01 - */ -@Service -public class CtResponseOrderProductServiceImpl extends ServiceImpl implements CtResponseOrderProductService { - -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/service/impl/CtResponseOrderServiceImpl.java b/wjcy-common/src/main/java/me/zhengjie/service/impl/CtResponseOrderServiceImpl.java deleted file mode 100644 index 1aab77d..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/impl/CtResponseOrderServiceImpl.java +++ /dev/null @@ -1,19 +0,0 @@ -package me.zhengjie.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import me.zhengjie.dao.CtResponseOrderDao; -import me.zhengjie.entity.CtResponseOrder; -import me.zhengjie.service.CtResponseOrderService; -import org.springframework.stereotype.Service; - -/** - * 下单成功响应订单商品信息(CtResponseOrder)表服务实现类 - * - * @author rch - * @since 2022-07-01 - */ -@Service -public class CtResponseOrderServiceImpl extends ServiceImpl implements CtResponseOrderService { - -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/service/impl/CtVpnServiceImpl.java b/wjcy-common/src/main/java/me/zhengjie/service/impl/CtVpnServiceImpl.java deleted file mode 100644 index db2730a..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/impl/CtVpnServiceImpl.java +++ /dev/null @@ -1,31 +0,0 @@ -package me.zhengjie.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import me.zhengjie.dao.CtVpnDao; -import me.zhengjie.entity.CtVpn; -import me.zhengjie.entity.CtVpnInfo; -import me.zhengjie.service.CtVpnService; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; - -/** - * VPN信息表(CtVpn)表服务实现类 - * - * @author rch - * @since 2022-07-07 - */ -@Service -public class CtVpnServiceImpl extends ServiceImpl implements CtVpnService { - - @Resource - private CtVpnDao ctVpnDao; - - @Override - public List getIpList() { return ctVpnDao.getIpList(); } - - @Override - public List getVpnInfoByIp(List ipAddress){ return ctVpnDao.getVpnInfoByIp(ipAddress);} -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/service/impl/DhAddCarOrderServiceImpl.java b/wjcy-common/src/main/java/me/zhengjie/service/impl/DhAddCarOrderServiceImpl.java deleted file mode 100644 index 3d9143b..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/impl/DhAddCarOrderServiceImpl.java +++ /dev/null @@ -1,98 +0,0 @@ -package me.zhengjie.service.impl; - -import cn.hutool.core.bean.BeanUtil; -import cn.hutool.core.util.ObjectUtil; -import com.baomidou.mybatisplus.core.conditions.Wrapper; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import me.zhengjie.dao.DhAddCarOrderDao; -import me.zhengjie.dao.DhCarGoodsDao; -import me.zhengjie.entity.DhAddCarOrder; -import me.zhengjie.entity.DhCarGoods; -import me.zhengjie.enums.ParamsTypeEnum; -import me.zhengjie.service.DhAddCarOrderService; -import me.zhengjie.service.vo.dhaddcar.DhAddCarVO; -import me.zhengjie.service.vo.dhcargood.DhCarGoodKeyVO; -import me.zhengjie.service.vo.dhcargood.DhCarGoodLinkVO; -import me.zhengjie.service.vo.dhcarorder.DhAddCarOrderListVO; -import me.zhengjie.service.vo.dhcarorder.DhCarOrderParamsVO; -import me.zhengjie.utils.PageUtils; -import org.springframework.cloud.context.config.annotation.RefreshScope; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -/** - * 敦煌-加购物车-订单(DhAddCarOrder)表服务实现类 - * - * @author rch - * @since 2022-11-17 09:12:00 - */ -@Service -public class DhAddCarOrderServiceImpl extends ServiceImpl implements DhAddCarOrderService { - - @Resource - private DhAddCarOrderDao dhAddCarOrderDao; - - @Resource - private DhCarGoodsDao dhCarGoodsDao; - - @Override - public DhAddCarOrder getByIdLock(Long id) { - return dhAddCarOrderDao.getByIdLock(id); - } - - @Override - public PageUtils searchPageList(IPage page, Wrapper ew) { - dhAddCarOrderDao.searchPageList(page, ew); - return new PageUtils(page.getTotal(), page.getRecords()); - } - - @Override - public DhCarOrderParamsVO getYdParams(Long id) { - DhCarOrderParamsVO dhCarOrderParamsVO = dhAddCarOrderDao.getYdParams(id); - if (ObjectUtil.isEmpty(dhCarOrderParamsVO)) { - return dhCarOrderParamsVO; - } - - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("params_type", dhCarOrderParamsVO.getParamsType()); - queryWrapper.in("id", Arrays.asList(dhCarOrderParamsVO.getCarGoodIds().split(","))); - List DhCarGoods = dhCarGoodsDao.selectList(queryWrapper); - if (ObjectUtil.isEmpty(DhCarGoods)) { - return dhCarOrderParamsVO; - } - - List carGoodKeyList = new ArrayList<>(); - List carGoodLinkList = new ArrayList<>(); - for (DhCarGoods dhCarGoods:DhCarGoods) { - if (ParamsTypeEnum.KEY_WORD.eqValue(dhCarOrderParamsVO.getParamsType())) { - - DhCarGoodKeyVO dhCarGoodKeyVO = new DhCarGoodKeyVO(); - BeanUtil.copyProperties(dhCarGoods, dhCarGoodKeyVO); - carGoodKeyList.add(dhCarGoodKeyVO); - } else if (ParamsTypeEnum.LINK.eqValue(dhCarOrderParamsVO.getParamsType())) { - - DhCarGoodLinkVO dhCarGoodLinkVO = new DhCarGoodLinkVO(); - BeanUtil.copyProperties(dhCarGoods, dhCarGoodLinkVO); - carGoodLinkList.add(dhCarGoodLinkVO); - } else { - continue; - } - } - - if (ObjectUtil.isNotEmpty(carGoodKeyList)) { - dhCarOrderParamsVO.setCarGoodKeys(carGoodKeyList); - } - - if (ObjectUtil.isNotEmpty(carGoodLinkList)) { - dhCarOrderParamsVO.setCarGoodLinks(carGoodLinkList); - } - return dhCarOrderParamsVO; - } -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/service/impl/DhAddCarServiceImpl.java b/wjcy-common/src/main/java/me/zhengjie/service/impl/DhAddCarServiceImpl.java deleted file mode 100644 index 9b45a16..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/impl/DhAddCarServiceImpl.java +++ /dev/null @@ -1,108 +0,0 @@ -package me.zhengjie.service.impl; - -import cn.hutool.core.bean.BeanUtil; -import cn.hutool.core.util.ObjectUtil; -import com.baomidou.mybatisplus.core.conditions.Wrapper; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import me.zhengjie.dao.DhAddCarDao; -import me.zhengjie.entity.DhAddCar; -import me.zhengjie.entity.DhCarGoods; -import me.zhengjie.enums.ParamsTypeEnum; -import me.zhengjie.service.DhAddCarService; -import me.zhengjie.service.DhCarGoodsService; -import me.zhengjie.service.vo.dhaddcar.DhAddCarListVO; -import me.zhengjie.service.vo.dhaddcar.DhAddCarVO; -import me.zhengjie.service.vo.dhaddcar.DhAddCarYdParamsVO; -import me.zhengjie.service.vo.dhcargood.DhCarGoodKeyVO; -import me.zhengjie.service.vo.dhcargood.DhCarGoodLinkVO; -import me.zhengjie.utils.PageUtils; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -/** - * 敦煌加入购物车(DhAddCar)表服务实现类 - * - * @author rch - * @since 2022-11-17 09:11:56 - */ -@Service -public class DhAddCarServiceImpl extends ServiceImpl implements DhAddCarService { - - @Resource - private DhAddCarDao dhAddCarDao; - @Resource - private DhCarGoodsService dhCarGoodsService; - - @Override - public PageUtils searchPageList(IPage page, Wrapper ew) { - dhAddCarDao.searchPageList(page, ew); - return new PageUtils(page.getTotal(), page.getRecords()); - } - - @Override - public DhAddCarVO getDetailById(Long id) { - DhAddCarVO dhAddCarVO = dhAddCarDao.getDetailById(id); - if (ObjectUtil.isEmpty(dhAddCarVO)) { - return dhAddCarVO; - } - - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("params_type", dhAddCarVO.getParamsType()); - queryWrapper.in("id", Arrays.asList(dhAddCarVO.getCarGoodIds().split(","))); - List DhCarGoods = dhCarGoodsService.list(queryWrapper); - if (ObjectUtil.isEmpty(DhCarGoods)) { - return dhAddCarVO; - } - - List carGoodKeyList = new ArrayList<>(); - List carGoodLinkList = new ArrayList<>(); - for (DhCarGoods dhCarGoods:DhCarGoods) { - if (ParamsTypeEnum.KEY_WORD.eqValue(dhAddCarVO.getParamsType())) { - - DhCarGoodKeyVO dhCarGoodKeyVO = new DhCarGoodKeyVO(); - BeanUtil.copyProperties(dhCarGoods, dhCarGoodKeyVO); - carGoodKeyList.add(dhCarGoodKeyVO); - } else if (ParamsTypeEnum.LINK.eqValue(dhAddCarVO.getParamsType())) { - - DhCarGoodLinkVO dhCarGoodLinkVO = new DhCarGoodLinkVO(); - BeanUtil.copyProperties(dhCarGoods, dhCarGoodLinkVO); - carGoodLinkList.add(dhCarGoodLinkVO); - } else { - continue; - } - } - - if (ObjectUtil.isNotEmpty(carGoodKeyList)) { - dhAddCarVO.setCarGoodKeys(carGoodKeyList); - } - - if (ObjectUtil.isNotEmpty(carGoodLinkList)) { - dhAddCarVO.setCarGoodLinks(carGoodLinkList); - } - return dhAddCarVO; - } - - @Override - public DhAddCar getByIdLock(Long id) { - return dhAddCarDao.getByIdLock(id); - } - - @Override - public DhAddCarYdParamsVO getAddCarYdParams(Long id) { - DhAddCarYdParamsVO dhAddCarYdParamsVO = new DhAddCarYdParamsVO(); - DhAddCarVO dhAddCarVO = getDetailById(id); - if (ObjectUtil.isEmpty(dhAddCarVO)) { - return dhAddCarYdParamsVO; - } - - BeanUtil.copyProperties(dhAddCarVO, dhAddCarYdParamsVO); - return dhAddCarYdParamsVO; - } -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/service/impl/DhCarGoodsServiceImpl.java b/wjcy-common/src/main/java/me/zhengjie/service/impl/DhCarGoodsServiceImpl.java deleted file mode 100644 index f18256a..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/impl/DhCarGoodsServiceImpl.java +++ /dev/null @@ -1,19 +0,0 @@ -package me.zhengjie.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import me.zhengjie.dao.DhCarGoodsDao; -import me.zhengjie.entity.DhCarGoods; -import me.zhengjie.service.DhCarGoodsService; -import org.springframework.stereotype.Service; - -/** - * 敦煌-加入购物车商品信息(DhCarGoods)表服务实现类 - * - * @author makejava - * @since 2022-11-17 09:12:04 - */ -@Service -public class DhCarGoodsServiceImpl extends ServiceImpl implements DhCarGoodsService { - -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/service/impl/FileUploadServiceImpl.java b/wjcy-common/src/main/java/me/zhengjie/service/impl/FileUploadServiceImpl.java deleted file mode 100644 index 37d22fa..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/impl/FileUploadServiceImpl.java +++ /dev/null @@ -1,130 +0,0 @@ -package me.zhengjie.service.impl; - - -import cn.hutool.core.convert.Convert; -import cn.hutool.core.lang.Snowflake; -import cn.hutool.core.map.MapUtil; -import cn.hutool.core.util.ObjectUtil; -import lombok.extern.slf4j.Slf4j; -import me.zhengjie.config.PropertiesConfig; -import me.zhengjie.config.SystemConfig; -import me.zhengjie.exception.BadRequestException; -import me.zhengjie.service.FileUploadService; -import org.springframework.stereotype.Service; -import org.springframework.util.FileCopyUtils; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.multipart.MultipartHttpServletRequest; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.File; -import java.io.IOException; -import java.time.LocalDate; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - -import static me.zhengjie.error.ErrorCodeEnum.UPLOAD_IMG_FORMAT_ERROR; -/** - *

- * 图片上传服务 - *

- * - * @Author xx - * @Date 2021/7/26 - **/ -@Slf4j -@Service -public class FileUploadServiceImpl implements FileUploadService { - - @Resource - private Snowflake snowflake; - @Resource - private PropertiesConfig config; - - @Override - public List uploadify(HttpServletRequest request, HttpServletResponse response) throws IOException { - response.setCharacterEncoding("utf-8"); - response.setContentType("application/json;charset=utf-8"); - response.setHeader("Cache-Control", "no-cache"); - Integer type = Convert.toInt(request.getParameter("type")); - - MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; - Map fileMap = multipartRequest.getFileMap(); - // 如果有传文件路径,则为替换文件, - String fileUrl = request.getParameter("fileUrl"); - - List returnStr = new ArrayList(); - if (ObjectUtil.isNotEmpty(fileUrl)) { - for (String key : fileMap.keySet()) { - MultipartFile multipartFile = fileMap.get(key); - isTrue(multipartFile,type); - // 文件覆盖 - File uploadFile = new File(SystemConfig.IMG_PATH + "/" + fileUrl); - - FileCopyUtils.copy(multipartFile.getBytes(), uploadFile); - returnStr.add(MapUtil.of("path", fileUrl)); - break; - } - }else { - for (String key : fileMap.keySet()) { - MultipartFile mf = fileMap.get(key); - isTrue(mf,type); - // 文件保存路径 - String filePath = config.getUploadImgPath().get(type); - filePath = filePath + LocalDate.now().toString().replaceAll("-","")+"/"; - - File file = new File(SystemConfig.IMG_PATH + filePath); - if (!file.exists()) { - file.mkdirs(); - } - // 文件名 - String fileEnd = mf.getOriginalFilename(); - fileEnd = fileEnd.substring(fileEnd.lastIndexOf(".")); - String newfileName = snowflake.nextIdStr() + fileEnd; - // 文件保存到本地 - File uploadFile = new File(file.getAbsolutePath() + "/" + newfileName); - FileCopyUtils.copy(mf.getBytes(), uploadFile); - String path = filePath + newfileName; - returnStr.add(MapUtil.of("path", path)); - } - } - - return returnStr; - } - - - /** - * 上传文件验证,如果验证不通过将抛出异常 - * - * @author: zeng - */ - private void isTrue(MultipartFile mf,Integer type) { - int maxFileSize = SystemConfig.MAX_FILE_SIZE; - if (type.equals(8)){ - maxFileSize = SystemConfig.VIDEO_MAX_FILE_SIZE; - } - if (mf.getSize()>(maxFileSize*1024*1024)){ - throw new BadRequestException(2005, "文件大小不超过于" + maxFileSize + "M"); - } - String fileEnd = mf.getOriginalFilename(); - fileEnd = fileEnd.substring(fileEnd.lastIndexOf(".")); - // 文件格式验证 - if (!imgFormat(fileEnd.substring(1))){ - UPLOAD_IMG_FORMAT_ERROR.setDesc(fileEnd+" 上传图片格式错误"); - throw new BadRequestException(UPLOAD_IMG_FORMAT_ERROR); - } - } - - - private boolean imgFormat(String fileEnd) { - for (String s : config.getSustainImgFormat()) { - if (s.equalsIgnoreCase(fileEnd)) { - return true; - } - } - return false; - } - -} diff --git a/wjcy-common/src/main/java/me/zhengjie/service/impl/LoginIpServiceImpl.java b/wjcy-common/src/main/java/me/zhengjie/service/impl/LoginIpServiceImpl.java deleted file mode 100644 index bf9256f..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/impl/LoginIpServiceImpl.java +++ /dev/null @@ -1,121 +0,0 @@ -package me.zhengjie.service.impl; - -import cn.hutool.core.util.ObjectUtil; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import lombok.RequiredArgsConstructor; -import me.zhengjie.dao.LoginIpDao; -import me.zhengjie.entity.LoginIp; -import me.zhengjie.service.LoginIpService; -import me.zhengjie.service.vo.LoginIpVO; -import me.zhengjie.utils.DateUtil; -import me.zhengjie.utils.LoginIpUtil; -import me.zhengjie.utils.PageUtils; -import me.zhengjie.utils.RedisUtils; -import org.springframework.stereotype.Service; - -import java.time.LocalDateTime; -import java.util.ArrayList; -import java.util.List; - -/** - * (LoginIp)表服务实现类 - * - * @author zeng - * @since 2022-03-21 14:07:01 - */ -@Service -@RequiredArgsConstructor -public class LoginIpServiceImpl extends ServiceImpl implements LoginIpService { - - final RedisUtils redisUtils; - - @Override - public PageUtils getList(IPage iPage) { - LambdaQueryWrapper lqw = new LambdaQueryWrapper<>(); - lqw.orderByDesc(LoginIp::getId); - page(iPage, lqw); - ArrayList arrayList = new ArrayList(); - for (LoginIp record : iPage.getRecords()) { - LoginIpVO loginIpVO = new LoginIpVO(record); - arrayList.add(loginIpVO); - } - return new PageUtils(iPage.getTotal(), arrayList); - } - - @Override - public boolean addIp(LoginIp ip) { - if (save(ip)) { - redisUtils.lPush(LoginIpService.LOGIN_IP_LIST, ip); - return true; - } - return false; - } - - @Override - public List getAll() { - List list = redisUtils.lGet(LoginIpService.LOGIN_IP_LIST, 0, -1); - if (ObjectUtil.isEmpty(list)) { - LambdaQueryWrapper lqw = new LambdaQueryWrapper<>(); - lqw.ge(LoginIp::getVaildTime, DateUtil.getCurrentTime()).or(q->q.eq(LoginIp::getVaildTime,"")); - return list(lqw); - } - return list; - } - - @Override - public boolean updateIp(LoginIp ip) { - if (updateById(ip)) { - List list = getAll(); - for (LoginIp loginIp : list) { - if (loginIp.getId().equals(ip.getId())) { - redisUtils.lRemove(LoginIpService.LOGIN_IP_LIST, 1, loginIp); - break; - } - } - redisUtils.lPush(LoginIpService.LOGIN_IP_LIST, ip); - return true; - } - return false; - } - - @Override - public boolean deleteIp(Integer id) { - if (removeById(id)) { - List list = getAll(); - for (LoginIp loginIp : list) { - if (loginIp.getId().equals(id)) { - redisUtils.lRemove(LoginIpService.LOGIN_IP_LIST, 1, loginIp); - } - } - } - return false; - } - - @Override - public boolean whiteListFlag(String ip) { - List ipList = getAll(); - if (ObjectUtil.isNotEmpty(ipList)) { - boolean flag = false; - for (LoginIp loginIp : ipList) { - if (ObjectUtil.isNotEmpty(loginIp.getVaildTime())) { - LocalDateTime localDateTime = DateUtil.parseLocalDateTimeFormatyMdHms(loginIp.getVaildTime()); - if (localDateTime.isBefore(LocalDateTime.now())) { - // 失效 - redisUtils.lRemove(LoginIpService.LOGIN_IP_LIST, 1, loginIp); - continue; - } - } - if (LoginIpUtil.ipExistsInRange(ip, loginIp.getIpStart(), loginIp.getIpEnd())) { - return true; - } - } - return false; - } - return true; - } - - -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/service/impl/SettingSiteServiceImpl.java b/wjcy-common/src/main/java/me/zhengjie/service/impl/SettingSiteServiceImpl.java deleted file mode 100644 index 56538f3..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/impl/SettingSiteServiceImpl.java +++ /dev/null @@ -1,75 +0,0 @@ -package me.zhengjie.service.impl; - -import cn.hutool.core.util.ObjectUtil; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import lombok.extern.slf4j.Slf4j; -import me.zhengjie.dao.SettingSiteDao; -import me.zhengjie.entity.CtSettingSite; -import me.zhengjie.service.SettingSiteService; -import me.zhengjie.utils.RedisUtils; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; - -import static me.zhengjie.constant.PublicConstant.CACHE_OVER_TIME; -import static me.zhengjie.constant.PublicConstant.SETTING_SITE_PREFIX; - -/** - * 站点配置(CtSettingSite)表服务实现类 - * - * @author makejava - * @since 2021-11-17 17:02:11 - */ -@Service -@Slf4j -public class SettingSiteServiceImpl extends ServiceImpl implements SettingSiteService { - @Resource - private RedisUtils redisUtils; - @Resource - private SettingSiteDao settingSiteDao; - - @Override - public String getValue(String key) { - String prefix = String.format(SETTING_SITE_PREFIX, key); - Object value = redisUtils.get(prefix); - - if (ObjectUtil.isNotEmpty(value)) { - return value.toString(); - } - String valueByKey = settingSiteDao.getValueByKey(key); - redisUtils.set(prefix, valueByKey, CACHE_OVER_TIME); - return valueByKey; - } - - @Override - public boolean saveOrUpdateByKey(String key, String value) { - LambdaQueryWrapper lqw = new LambdaQueryWrapper(); - lqw.eq(CtSettingSite::getSettingKey, key); - boolean boo; - if (count(lqw) > 0) { - LambdaUpdateWrapper luw = new LambdaUpdateWrapper(); - luw.eq(CtSettingSite::getSettingKey, key); - luw.set(CtSettingSite::getSettingValue, value); - boo = update(luw); - }else { - CtSettingSite site = new CtSettingSite(); - site.setContent(""); - site.setSettingKey(key); - site.setSettingValue(value); - boo = save(site); - } - if (boo) { - String prefix = String.format(SETTING_SITE_PREFIX, key); - redisUtils.set(prefix, value, CACHE_OVER_TIME); - } - return boo; - } - - @Override - public Boolean getGooleAuthSwitch() { - return "1".equals(settingSiteDao.getValueByKey("googleAuth")) ? true : false; - } -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/service/impl/SysQuartzJobServiceImpl.java b/wjcy-common/src/main/java/me/zhengjie/service/impl/SysQuartzJobServiceImpl.java deleted file mode 100644 index 1975f7c..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/impl/SysQuartzJobServiceImpl.java +++ /dev/null @@ -1,63 +0,0 @@ -//package me.zhengjie.service.impl; -// -//import cn.hutool.core.bean.BeanUtil; -//import com.baomidou.mybatisplus.core.conditions.Wrapper; -//import com.baomidou.mybatisplus.core.metadata.IPage; -//import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -//import lombok.RequiredArgsConstructor; -//import me.zhengjie.dao.SysQuartzJobDao; -//import me.zhengjie.entity.SysQuartzJob; -//import me.zhengjie.enums.TaskTypeEnum; -//import me.zhengjie.service.SysQuartzJobService; -//import me.zhengjie.service.vo.SysQuartzJobListVO; -//import me.zhengjie.utils.PageUtils; -//import me.zhengjie.utils.RedisUtils; -//import org.apache.logging.log4j.core.layout.SyslogLayout; -//import org.springframework.stereotype.Service; -// -//import javax.annotation.Resource; -// -///** -// * 定时任务(SysQuartzJob)表服务实现类 -// * -// * @author rch -// * @since 2022-07-20 -// */ -//@Service -//@RequiredArgsConstructor -//public class SysQuartzJobServiceImpl extends ServiceImpl implements SysQuartzJobService { -// -// @Resource -// private SysQuartzJobService sysQuartzJobService; -// @Resource -// private SysQuartzJobDao sysQuartzJobDao; -// -// private final QuartzJobRepository quartzJobRepository; -// private final QuartzLogRepository quartzLogRepository; -// private final QuartzManage quartzManage; -// private final RedisUtils redisUtils; -// -// @Override -// public PageUtils searchPageList(IPage page, Wrapper wrapper) { -// sysQuartzJobDao.searchPageList(page,wrapper); -// return new PageUtils(page.getTotal(),page.getRecords()); -// } -// -// @Override -// public boolean modifyJobStatus(Long jobId) { -// SysQuartzJob sysQuartzJobIsExist = sysQuartzJobService.getById(jobId); -// if(sysQuartzJobIsExist == null){ -// return false; -// }else{ -// SysQuartzJob sysQuartzJob = new SysQuartzJob(); -// BeanUtil.copyProperties(sysQuartzJobIsExist,sysQuartzJob); -// if(sysQuartzJob.getIsPause() == 0){ -// sysQuartzJob.setIsPause(1); -// }else{ -// sysQuartzJob.setIsPause(0); -// } -// return sysQuartzJobService.updateById(sysQuartzJob); -// } -// } -//} -// diff --git a/wjcy-common/src/main/java/me/zhengjie/service/impl/SysQuartzLogServiceImpl.java b/wjcy-common/src/main/java/me/zhengjie/service/impl/SysQuartzLogServiceImpl.java deleted file mode 100644 index aac7886..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/impl/SysQuartzLogServiceImpl.java +++ /dev/null @@ -1,35 +0,0 @@ -package me.zhengjie.service.impl; - -import com.baomidou.mybatisplus.core.conditions.Wrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import me.zhengjie.dao.SysQuartzJobDao; -import me.zhengjie.dao.SysQuartzLogDao; -import me.zhengjie.entity.SysQuartzJob; -import me.zhengjie.entity.SysQuartzLog; -import me.zhengjie.service.SysQuartzLogService; -import me.zhengjie.service.vo.SysQuartzLogListVO; -import me.zhengjie.utils.PageUtils; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; - -/** - * 定时任务(SysQuartzJob)表服务实现类 - * - * @author rch - * @since 2022-07-20 - */ -@Service -public class SysQuartzLogServiceImpl extends ServiceImpl implements SysQuartzLogService { - - @Resource - private SysQuartzLogDao sysQuartzLogDao; - - @Override - public PageUtils searchPageList(IPage page, Wrapper wrapper) { - sysQuartzLogDao.searchPageList(page, wrapper); - return new PageUtils(page.getTotal(), page.getRecords()); - } -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/service/impl/YdQuartzServiceImpl.java b/wjcy-common/src/main/java/me/zhengjie/service/impl/YdQuartzServiceImpl.java deleted file mode 100644 index d0b54b9..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/impl/YdQuartzServiceImpl.java +++ /dev/null @@ -1,464 +0,0 @@ -package me.zhengjie.service.impl; - -import cn.hutool.core.util.ObjectUtil; -import cn.hutool.json.JSONUtil; -import lombok.extern.slf4j.Slf4j; -import me.zhengjie.config.BeanFactory; -import me.zhengjie.constant.Constants; -import me.zhengjie.entity.*; -import me.zhengjie.entity.quartz.*; -import me.zhengjie.enums.*; -import me.zhengjie.exception.BadRequestException; -import me.zhengjie.service.*; -import me.zhengjie.service.redission.LockCallBack; -import me.zhengjie.utils.HttpClientUtil; -import me.zhengjie.utils.RedissonUtil; -import org.redisson.api.RLock; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import javax.annotation.Resource; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; -import java.util.stream.Collectors; - -/** - * 影刀定时任务Service 实现类 - * - * @author rch - * @create 2022-08-01 - */ -@Service -@Slf4j -public class YdQuartzServiceImpl implements YdQuartzService { - - @Resource - private CtRebotService ctRebotService; - @Resource - private CtApplyService ctApplyService; - @Resource - private RedissonUtil redissonUtil; - @Resource - private CtClickFarmingService ctClickFarmingService; - @Resource - private CtBuyerService ctBuyerService; - @Resource - private CtClickOrderService ctClickOrderService; - @Resource - private DhAddCarOrderService dhAddCarOrderService; - @Resource - private DhAddCarService dhAddCarService; - @Resource - private CtBrowseService ctBrowseService; - - @Override - public Object executeOnLock(String lockKey, long time, long timeout, LockCallBack callBack) throws Exception { - RLock lock = redissonUtil.getRLock(lockKey); - String currentTime = me.zhengjie.utils.DateUtil.getCurrentTime(); - try { - log.info(currentTime + " 获取锁============= {}",lockKey); - if (lock.tryLock(time, timeout, TimeUnit.SECONDS)) { - System.out.println("run111 ====== lock success "); - return callBack.execute(true); - } else { - System.out.println("run111 ====== lock fail "); - throw new BadRequestException(" lock fail "); - } - } catch (Exception e) { - throw e; - } finally { - lock.unlock(); - log.info(currentTime+" 释放锁============= {}",lockKey); - } - } - - @Override - @Transactional(rollbackFor = Exception.class) - public String exec(String str) throws Exception { - Boss boss = JSONUtil.toBean(str, Boss.class); - // 1.根据设备id获取设备信息 for update - CtRebot ctRebot = ctRebotService.getByAccountNameLock(boss.getAccountName()); - System.out.println(JSONUtil.toJsonStr(ctRebot)); - if (ObjectUtil.isEmpty(ctRebot) || !YesOrNoEnum.NO.eqValue(ctRebot.getStatus())) { - // 有问题 不执行 - log.info("机器人设备信息不存在,或者机器人状态不可用!"); - throw new BadRequestException("机器人设备信息不存在,或者机器人状态不可用!"); - } - - // TODO 这里需要根据应用获取 appKey appSecret信息 - CtApply ctApply = ctApplyService.getById(boss.getApplyId()); - if (ObjectUtil.isEmpty(ctApply) - || ObjectUtil.isEmpty(ctApply.getRobotUuid()) - || ObjectUtil.isEmpty(ctApply.getAccessKeyId()) - || ObjectUtil.isEmpty(ctApply.getAccessKeySecret())) { - log.info("影刀应用信息不存在,或者影刀应用信息异常!"); - throw new BadRequestException("影刀应用信息不存在,或者影刀应用信息异常!"); - } - - // 判断买家是否占用 - List paramList = boss.getParams().stream().filter(n->n.getName().equals("account")).collect(Collectors.toList()); - if (ObjectUtil.isEmpty(paramList)) { - throw new BadRequestException("买家信息不存在!"); - } - String buyerName = paramList.get(0).getValue(); - CtBuyer ctBuyer = ctBuyerService.getBuyerOccupyStatusLock(buyerName); - if (ObjectUtil.isEmpty(ctBuyer) || BuyerOccupyStatusEnum.OCCUPIED.value().equals(ctBuyer.getOccupyStatus())) { - throw new BadRequestException("买家信息不存在,或者已占用状态!"); - } - - boss.setRobotUuid(ctApply.getRobotUuid()); - // token - Map params = new HashMap<>(16); - params.put("accessKeyId", ctApply.getAccessKeyId()); - params.put("accessKeySecret", ctApply.getAccessKeySecret()); - SecreInfo secreInfo = JSONUtil.toBean(HttpClientUtil.getHttp(Constants.GET_SECRET, params), SecreInfo.class); - if (!secreInfo.getSuccess()) { - log.info("=========鉴权异常=========="); - throw new BadRequestException("请求影刀鉴权异常!"); - } - String token = secreInfo.getData().getAccessToken(); - System.out.println("====token===="); - Map headers = new HashMap<>(16); - headers.put("Accept", "application/json"); - headers.put("Content-Type", "application/json;charset=utf-8"); - headers.put("authorization", "Bearer " + token); - - // 判断是否在线 - RebotStatu rebotStatu = new RebotStatu(ctRebot.getRobotClientUuid(), ctRebot.getAccountName()); - String returnStr = HttpClientUtil.postJson(Constants.REBOT_STATU, headers, JSONUtil.toJsonStr(rebotStatu), "utf-8"); - RebotStatuReturn rebotStatuReturn = JSONUtil.toBean(returnStr, RebotStatuReturn.class); - // 状态 connected:已连接 idle:空闲 running:运行中 allocated:已分配 abnormal:异常 offline:离线 - if (RobotStatusEnum.OFFLINE.value().equals(rebotStatuReturn.getData().getStatus())) { - log.info("=======设备不在线====="); - throw new BadRequestException("设备不在线!"); - } else if (RobotStatusEnum.RUNNING.value().equals(rebotStatuReturn.getData().getStatus())) { - log.info("=======设备运行中====="); - throw new BadRequestException("设备运行中!"); - } else if (RobotStatusEnum.ALLOCATED.value().equals(rebotStatuReturn.getData().getStatus())) { - log.info("=======设备已分配====="); - throw new BadRequestException("设备已分配!"); - } else if (RobotStatusEnum.ABNORMAL.value().equals(rebotStatuReturn.getData().getStatus())) { - log.info("=======设备异常====="); - throw new BadRequestException("设备异常!"); - } - // 启动Job - String returnJobStr = null; - CtRebot updateCtRebot = new CtRebot(); - updateCtRebot.setId(ctRebot.getId()); - updateCtRebot.setStatus(YesOrNoEnum.YES.value()); - CtRebotService ctRebotService = BeanFactory.getBean(CtRebotService.class); - Boolean resultBoolean = ctRebotService.updateById(updateCtRebot); - if (resultBoolean) { - // 修改买家信息占用状态 - ctBuyer.setOccupyStatus(BuyerOccupyStatusEnum.OCCUPIED.value()); - if (ctBuyerService.updateById(ctBuyer)) { - returnJobStr = HttpClientUtil.postJson(Constants.STAT_JOB_URL, headers, JSONUtil.toJsonStr(boss), "utf-8"); - StartYdReturnInfo startYdReturnInfo = JSONUtil.toBean(returnJobStr, StartYdReturnInfo.class); - if (startYdReturnInfo.getSuccess()) { - log.info("run111 执行成功,返回结果为: {}" + returnJobStr); - } else { - throw new BadRequestException(startYdReturnInfo.getMsg()); - } - } else { - log.info("run111 执行成功。 但是修改设备状态失败----- 此处该预警"); - throw new BadRequestException("修改设备状态失败!"); - } - } else { - log.info("run111 执行成功。 但是修改设备状态失败----- 此处该预警"); - throw new BadRequestException("修改设备状态失败!"); - } - return returnJobStr; - } - - @Override - @Transactional(rollbackFor = Exception.class) - public Boolean clickFarmExec(String str) throws Exception { - System.out.println("================================ClickFarmTask=========================4"); - // 只有真正发起了执行 状态才修改为执行中 回调后修改成功 或者失败 - // TODO 这里根据响应结果 修改平台状态 类型,根据boss里面的 执行中 别的任务如果想再执行这个刷单信息, 不允许执行。 执行前加锁查询, 带执行状态才可以往下走 - // 修改状态为 执行中。 - - Boss boss = JSONUtil.toBean(str, Boss.class); - List paramList = boss.getParams(); - // 获取ID - String id = paramList.stream().filter(p->p.getName().equals("id")).collect(Collectors.toList()).get(0).getValue(); - CtClickFarming ctClickFarming = ctClickFarmingService.getByIdLock(Long.valueOf(id)); - if (ClickFarmingStatusEnum.IN_EXECUTION.value().equals(ctClickFarming.getStatus())) { - throw new BadRequestException("该定时任务对应的刷单信息已经执行中状态,请检查后重试!"); - } - - if (ClickFarmingStatusEnum.EXECUTION_SUCCESS.value().equals(ctClickFarming.getStatus())) { - throw new BadRequestException("该定时任务对应的刷单信息已执行成功,请检查后重试!"); - } - - String returnStartJobStr = exec(str); - if (ObjectUtil.isEmpty(returnStartJobStr)) { - throw new BadRequestException("调用影刀启动任务失败! response:" + returnStartJobStr); - } - - YdStartReturn ydStartReturn = JSONUtil.toBean(returnStartJobStr, YdStartReturn.class); - if (!ydStartReturn.getSuccess()) { - throw new BadRequestException("调用影刀启动任务失败! response:" + returnStartJobStr); - } - - // 修改状态 带执行 - 》 执行中 - CtClickFarming updateCtClickFarming = new CtClickFarming(); - updateCtClickFarming.setId(ctClickFarming.getId()); - updateCtClickFarming.setStatus(ClickFarmingStatusEnum.IN_EXECUTION.value()); - return ctClickFarmingService.updateById(updateCtClickFarming); - } - - - @Override - @Transactional(rollbackFor = Exception.class) - public Boolean addCarExec(String str) throws Exception { - System.out.println("================================ClickFarmTask=========================4"); - // 只有真正发起了执行 状态才修改为执行中 回调后修改成功 或者失败 - // TODO 这里根据响应结果 修改平台状态 类型,根据boss里面的 执行中 别的任务如果想再执行这个刷单信息, 不允许执行。 执行前加锁查询, 带执行状态才可以往下走 - // 修改状态为 执行中。 - - Boss boss = JSONUtil.toBean(str, Boss.class); - List paramList = boss.getParams(); - // 获取ID - String id = paramList.stream().filter(p->p.getName().equals("id")).collect(Collectors.toList()).get(0).getValue(); - DhAddCar dhAddCar = dhAddCarService.getByIdLock(Long.valueOf(id)); - if (!DhAddCarStatusEnum.TOBE_EXECUTION.value().equals(dhAddCar.getStatus()) && !DhAddCarStatusEnum.ADD_CARD_FAILE.value().equals(dhAddCar.getStatus())) { - throw new BadRequestException("该定时任务对应的敦煌加购必须带执行或执行失败,请检查后重试!"); - } - - if (DhAddCarStatusEnum.Add_CARD_SUCCESS.value().equals(dhAddCar.getStatus())) { - throw new BadRequestException("该定时任务对应的敦煌加购已执行成功,请检查后重试!"); - } - - String returnStartJobStr = exec(str); - if (ObjectUtil.isEmpty(returnStartJobStr)) { - throw new BadRequestException("调用影刀启动任务失败! response:" + returnStartJobStr); - } - - YdStartReturn ydStartReturn = JSONUtil.toBean(returnStartJobStr, YdStartReturn.class); - if (!ydStartReturn.getSuccess()) { - throw new BadRequestException("调用影刀启动任务失败! response:" + returnStartJobStr); - } - - // 修改状态 带执行 - 》 执行中 - DhAddCar updateDhAddCar = new DhAddCar(); - updateDhAddCar.setId(dhAddCar.getId()); - updateDhAddCar.setStatus(ClickFarmingStatusEnum.IN_EXECUTION.value()); - return dhAddCarService.updateById(updateDhAddCar); - } - - - @Override - @Transactional(rollbackFor = Exception.class) - public Boolean catchOrderExec(String str) throws Exception { - System.out.println("================================catchOrderExec=========================4"); - // 只有真正发起了执行 状态才修改为执行中 回调后修改成功 或者失败 - // TODO 这里根据响应结果 修改平台状态 类型,根据boss里面的 执行中 别的任务如果想再执行这个刷单信息, 不允许执行。 执行前加锁查询, 带执行状态才可以往下走 - // 修改状态为 执行中。 - - Boss boss = JSONUtil.toBean(str, Boss.class); - List paramList = boss.getParams(); - // 获取ID - String id = paramList.stream().filter(p->p.getName().equals("id")).collect(Collectors.toList()).get(0).getValue(); - DhAddCar dhAddCar = dhAddCarService.getByIdLock(Long.valueOf(id)); - if (!DhAddCarStatusEnum.TO_BE_CATCH_ORDER.value().equals(dhAddCar.getStatus()) && !DhAddCarStatusEnum.CATCH_ORDER_FAILE.value().equals(dhAddCar.getStatus())) { - throw new BadRequestException("该定时任务对应的敦煌加购抓单必须是待抓单或者抓单失败状态!"); - } - - String returnStartJobStr = exec(str); - if (ObjectUtil.isEmpty(returnStartJobStr)) { - throw new BadRequestException("调用影刀启动任务失败! response:" + returnStartJobStr); - } - - YdStartReturn ydStartReturn = JSONUtil.toBean(returnStartJobStr, YdStartReturn.class); - if (!ydStartReturn.getSuccess()) { - throw new BadRequestException("调用影刀启动任务失败! response:" + returnStartJobStr); - } - - // 修改状态 带抓单/抓单失败 - 》 抓单中 - DhAddCar updateDhAddCar = new DhAddCar(); - updateDhAddCar.setId(dhAddCar.getId()); - updateDhAddCar.setStatus(DhAddCarStatusEnum.CATCH_ORDER_ING.value()); - return dhAddCarService.updateById(updateDhAddCar); - } - - - // TODO 这里查询任务结果然后返回, 在回调哪里 调用这个方法,然后解析参数, 入参 出参 和执行结果状态等。 - @Override - @Transactional(rollbackFor = Exception.class) - public JobQueryByUuidReturn queryJobUuid(String uuid, String accessKeyId, String accessKeySecret) { - // token - Map params = new HashMap<>(16); - params.put("accessKeyId", accessKeyId); - params.put("accessKeySecret", accessKeySecret); - String response = HttpClientUtil.getHttp(Constants.GET_SECRET, params); - log.error("鉴权请求结果:" +response); - SecreInfo secreInfo = JSONUtil.toBean(response, SecreInfo.class); - if (ObjectUtil.isEmpty(secreInfo) || !secreInfo.getSuccess()) { - log.info("=========鉴权异常=========="); - throw new BadRequestException("请求影刀鉴权异常!"); - } - String token = secreInfo.getData().getAccessToken(); - Map headers = new HashMap<>(16); - headers.put("Accept", "application/json"); - headers.put("Content-Type", "application/json;charset=utf-8"); - headers.put("authorization", "Bearer " + token); - - // 判断是否在线 - JobQueryByUuid jobQueryByUuid = new JobQueryByUuid(); - jobQueryByUuid.setJobUuid(uuid); - String returnStr = HttpClientUtil.postJson(Constants.QUERY_JOB_URL, headers, JSONUtil.toJsonStr(jobQueryByUuid), "utf-8"); - log.info("====returnStr====" + returnStr); - JobQueryByUuidReturn jobQueryByUuidReturn = JSONUtil.toBean(returnStr, JobQueryByUuidReturn.class); - - return jobQueryByUuidReturn; - } - - @Override - @Transactional(rollbackFor = Exception.class) - public Boolean clickFarmSuppleMentExec(String str) throws Exception { - System.out.println("================================ClickFarmSuppleMentTask=========================4"); - // 只有真正发起了执行 状态才修改为执行中 回调后修改成功 或者失败 - // TODO 这里根据响应结果 修改平台状态 类型,根据boss里面的 执行中 别的任务如果想再执行这个刷单信息, 不允许执行。 执行前加锁查询, 带执行状态才可以往下走 - // 修改状态为 执行中。 - - Boss boss = JSONUtil.toBean(str, Boss.class); - List paramList = boss.getParams(); - // 获取ID - String id = paramList.stream().filter(p->p.getName().equals("id")).collect(Collectors.toList()).get(0).getValue(); - CtClickFarming ctClickFarming = ctClickFarmingService.getByIdLock(Long.valueOf(id)); - if (!ClickFarmingStatusEnum.AWAITING_PAYMENT.value().equals(ctClickFarming.getStatus())) { - throw new BadRequestException("仅待支付状态才允许补录,请检查后重试!"); - } - - String returnStartJobStr = exec(str); - if (ObjectUtil.isEmpty(returnStartJobStr)) { - throw new BadRequestException("调用影刀启动任务失败! response:" + returnStartJobStr); - } - - YdStartReturn ydStartReturn = JSONUtil.toBean(returnStartJobStr, YdStartReturn.class); - if (!ydStartReturn.getSuccess()) { - throw new BadRequestException("调用影刀启动任务失败! response:" + returnStartJobStr); - } - - // 修改状态 带执行 - 》 执行中 - CtClickFarming updateCtClickFarming = new CtClickFarming(); - updateCtClickFarming.setId(ctClickFarming.getId()); - updateCtClickFarming.setStatus(ClickFarmingStatusEnum.IN_EXECUTION.value()); - return ctClickFarmingService.updateById(updateCtClickFarming); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public Object dhWellReceivedExec(String str) throws Exception { - System.out.println("================================WellReceivedExec=========================4"); - // 只有真正发起了执行 状态才修改为执行中 回调后修改成功 或者失败 - // 修改状态为 执行中。 - - Boss boss = JSONUtil.toBean(str, Boss.class); - List paramList = boss.getParams(); - // 获取ID - String id = paramList.stream().filter(p->p.getName().equals("id")).collect(Collectors.toList()).get(0).getValue(); - DhAddCarOrder dhAddCarOrder = dhAddCarOrderService.getByIdLock(Long.valueOf(id)); - if (ClickOrderStatusEnum.IN_EXECUTION.value().equals(dhAddCarOrder.getStatus())) { - throw new BadRequestException("该定时任务对应的敦煌加购好评信息已经执行中状态,请检查后重试!"); - } - - if (ClickFarmingStatusEnum.EXECUTION_SUCCESS.value().equals(dhAddCarOrder.getStatus())) { - throw new BadRequestException("该定时任务对应的敦煌加购好评信息已执行成功,请检查后重试!"); - } - - String returnStartJobStr = exec(str); - if (ObjectUtil.isEmpty(returnStartJobStr)) { - throw new BadRequestException("调用影刀启动任务失败! response:" + returnStartJobStr); - } - - YdStartReturn ydStartReturn = JSONUtil.toBean(returnStartJobStr, YdStartReturn.class); - if (!ydStartReturn.getSuccess()) { - throw new BadRequestException("调用影刀启动任务失败! response:" + returnStartJobStr); - } - - // 修改状态 带执行 - 》 执行中 - DhAddCarOrder updateDhAddCarOrder = new DhAddCarOrder(); - updateDhAddCarOrder.setId(dhAddCarOrder.getId()); - updateDhAddCarOrder.setStatus(ClickOrderStatusEnum.IN_EXECUTION.value()); - return dhAddCarOrderService.updateById(updateDhAddCarOrder); - } - - - @Override - @Transactional(rollbackFor = Exception.class) - public Object wellReceivedExec(String str) throws Exception { - System.out.println("================================WellReceivedExec=========================4"); - // 只有真正发起了执行 状态才修改为执行中 回调后修改成功 或者失败 - // 修改状态为 执行中。 - - Boss boss = JSONUtil.toBean(str, Boss.class); - List paramList = boss.getParams(); - // 获取ID - String id = paramList.stream().filter(p->p.getName().equals("id")).collect(Collectors.toList()).get(0).getValue(); - CtClickOrder ctClickOrder = ctClickOrderService.getByIdLock(Long.valueOf(id)); - if (ClickOrderStatusEnum.IN_EXECUTION.value().equals(ctClickOrder.getStatus())) { - throw new BadRequestException("该定时任务对应的敦煌加购好评信息已经执行中状态,请检查后重试!"); - } - - if (ClickFarmingStatusEnum.EXECUTION_SUCCESS.value().equals(ctClickOrder.getStatus())) { - throw new BadRequestException("该定时任务对应的敦煌加购好评信息已执行成功,请检查后重试!"); - } - - String returnStartJobStr = exec(str); - if (ObjectUtil.isEmpty(returnStartJobStr)) { - throw new BadRequestException("调用影刀启动任务失败! response:" + returnStartJobStr); - } - - YdStartReturn ydStartReturn = JSONUtil.toBean(returnStartJobStr, YdStartReturn.class); - if (!ydStartReturn.getSuccess()) { - throw new BadRequestException("调用影刀启动任务失败! response:" + returnStartJobStr); - } - - // 修改状态 带执行 - 》 执行中 - CtClickOrder updateCtClickOrder = new CtClickOrder(); - updateCtClickOrder.setId(ctClickOrder.getId()); - updateCtClickOrder.setStatus(ClickOrderStatusEnum.IN_EXECUTION.value()); - return ctClickOrderService.updateById(updateCtClickOrder); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public Object browseTaskExec(String str) throws Exception { - System.out.println("================================browseTaskExec=========================4"); - // 只有真正发起了执行 状态才修改为执行中 回调后修改成功 或者失败 - // 修改状态为 执行中。 - - Boss boss = JSONUtil.toBean(str, Boss.class); - List paramList = boss.getParams(); - // 获取ID - String id = paramList.stream().filter(p->p.getName().equals("id")).collect(Collectors.toList()).get(0).getValue(); - CtBrowse ctBrowse = ctBrowseService.getByIdLock(Long.valueOf(id)); - if (ClickOrderStatusEnum.IN_EXECUTION.value().equals(ctBrowse.getStatus())) { - throw new BadRequestException("该定时任务对应的订单信息已经执行中状态,请检查后重试!"); - } - - if (ClickFarmingStatusEnum.EXECUTION_SUCCESS.value().equals(ctBrowse.getStatus())) { - throw new BadRequestException("该定时任务对应的订单信息已执行成功,请检查后重试!"); - } - - String returnStartJobStr = exec(str); - if (ObjectUtil.isEmpty(returnStartJobStr)) { - throw new BadRequestException("调用影刀启动任务失败! response:" + returnStartJobStr); - } - - YdStartReturn ydStartReturn = JSONUtil.toBean(returnStartJobStr, YdStartReturn.class); - if (!ydStartReturn.getSuccess()) { - throw new BadRequestException("调用影刀启动任务失败! response:" + returnStartJobStr); - } - - // 修改状态 带执行 - 》 执行中 - CtBrowse updateCtBrowse = new CtBrowse(); - updateCtBrowse.setId(ctBrowse.getId()); - updateCtBrowse.setStatus(ClickOrderStatusEnum.IN_EXECUTION.value()); - return ctBrowseService.updateById(updateCtBrowse); - } -} diff --git a/wjcy-common/src/main/java/me/zhengjie/service/redission/LockCallBack.java b/wjcy-common/src/main/java/me/zhengjie/service/redission/LockCallBack.java deleted file mode 100644 index 8d8b5ff..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/redission/LockCallBack.java +++ /dev/null @@ -1,8 +0,0 @@ -package me.zhengjie.service.redission; - -@FunctionalInterface -public interface LockCallBack { - - Object execute(T t); - -} diff --git a/wjcy-common/src/main/java/me/zhengjie/service/vo/AdminGoogleAuthInfoVO.java b/wjcy-common/src/main/java/me/zhengjie/service/vo/AdminGoogleAuthInfoVO.java deleted file mode 100644 index 4e5973e..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/vo/AdminGoogleAuthInfoVO.java +++ /dev/null @@ -1,31 +0,0 @@ -package me.zhengjie.service.vo; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - *

- * Admin 秘钥信息 - *

- * - * @author: rch - * @since: 2020-08-26 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class AdminGoogleAuthInfoVO { - - /** Google 总开关 */ - private Boolean gogoleAuthSwitch; - - /** 用户信息 */ - private String userName; - - /** 二维码url 信息 */ - private String qrBarCodeUrl; - - /** 明文秘钥 */ - private String secret; -} diff --git a/wjcy-common/src/main/java/me/zhengjie/service/vo/BuyOrderResponseAddressVO.java b/wjcy-common/src/main/java/me/zhengjie/service/vo/BuyOrderResponseAddressVO.java deleted file mode 100644 index 2364b02..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/vo/BuyOrderResponseAddressVO.java +++ /dev/null @@ -1,39 +0,0 @@ -package me.zhengjie.service.vo; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * 下注成功订单响应收货地址信息(CtResponseOrderAddress)表实体类 - * - * @author rch - * @since 2022-06-23 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class BuyOrderResponseAddressVO { - - /** 地址1 */ - private String addressline1; - /** 国家 */ - private String country; - /** 州 */ - private String state; - /** 电话 */ - private String tel; - /** lastname */ - private String lastname; - /** 税号 */ - private String vatNumber; - /** 城市 */ - private String city; - /** 地址2 */ - private String addressline2; - /** firstname */ - private String firstname; - /** 邮政编码 */ - private String postalcode; -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/service/vo/BuyOrderResponseOrderVO.java b/wjcy-common/src/main/java/me/zhengjie/service/vo/BuyOrderResponseOrderVO.java deleted file mode 100644 index be0997d..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/vo/BuyOrderResponseOrderVO.java +++ /dev/null @@ -1,54 +0,0 @@ -package me.zhengjie.service.vo; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.Date; - -/** - * 下单成功响应订单商品信息(CtResponseOrder)表实体类 - * - * @author rch - * @since 2022-06-23 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class BuyOrderResponseOrderVO { - - private Long id; - /** 运费 */ - private Double shipCost; - /** 产品总价 */ - private Double totalPriceOfProduct; - /** 备货期 */ - private Double leadingTime; - /** 订单总价 */ - private Double orderTotal; - /** 卖家Id */ - private String supplierId; - /** 卖家店铺coupon */ - private Double couponOfSeller; - /** 运输方式 */ - private String shipType; - /** 订单优惠 */ - private Double orderSave; - /** 税费手续费 */ - private Double taxCharge; - /** 买家Id */ - private String buyerId; - /** 税费 */ - private Double tax; - /** 促销折扣 */ - private Double promoDiscount; - /** 订单号--这个要特殊处理这个是对应响应的id字段 */ - private Long orderId; - /** DHcoupon */ - private Double couponDiscount; - /** 下单站点 */ - private String siteId; - /** 创建时间 */ - private Date createTime; -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/service/vo/BuyOrderResponseProductVO.java b/wjcy-common/src/main/java/me/zhengjie/service/vo/BuyOrderResponseProductVO.java deleted file mode 100644 index 5f603a5..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/vo/BuyOrderResponseProductVO.java +++ /dev/null @@ -1,81 +0,0 @@ -package me.zhengjie.service.vo; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.math.BigDecimal; -import java.util.Date; - -/** - * 下单订单响应产品信息(CtResponseOrderProduct)表实体类 - * - * @author rch - * @since 2022-06-23 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class BuyOrderResponseProductVO { - - /** 秒杀类型 */ - private String flashDeals; - /** 卖家设置价格 */ - private Double prodPriceOrg; - /** 产品skuId */ - private String skuId; - /** 购买数量 */ - private Integer cateDispId; - /** 商品总金额 */ - private Double amount; - /** 发布类目id */ - private String catePubId; - /** 促销折扣 */ - private Double promDis; - /** 产品单位名称 */ - private String measureName; - /** 短描 */ - private String shortDescription; - /** 卖家承诺运达天数 */ - private Integer promiseDays; - /** 备货国家 */ - private String stockin; - /** 产品图片(小图) */ - private String thumbnailImage; - /** 是否为样品 */ - private String isSample; - /** 最终运费 */ - private Double shipCost; - /** 卖家Id */ - private String supplierId; - /** 跨店满减金额 */ - private BigDecimal crossReduceAmount; - /** 产品itemcode */ - private Integer itemcode; - /** buyer选择的运输方式 */ - private String shipType; - /** 销售价格 */ - private Double originPrice; - /** 产品长描地址 */ - private String htmlUrl; - /** 产品图片(大图) */ - private String imageUrl; - /** 最终价格 */ - private Double price; - /** 产品URL */ - private String productUrl; - /** 备注 */ - private String remark; - /** lots */ - private Integer lots; - /** 产品名称 */ - private String productName; - /** 产品Id */ - private String productId; - /** 产品skumd5 */ - private String skuMd5; - /** 创建时间 */ - private Date createTime; - /** 产品单位Id */ - private String measureId; -} \ No newline at end of file diff --git a/wjcy-common/src/main/java/me/zhengjie/service/vo/BuyOrderVO.java b/wjcy-common/src/main/java/me/zhengjie/service/vo/BuyOrderVO.java deleted file mode 100644 index 37dd881..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/vo/BuyOrderVO.java +++ /dev/null @@ -1,24 +0,0 @@ -package me.zhengjie.service.vo; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.List; - -/** - * 订单下单API响应对象 - * - * @author rch - * @create 2022-06-27 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class BuyOrderVO { - - /** 接口响应状态 响应码 响应内容等信息*/ - private OrderResponStatusVO status; - /** 接口响应订单信息 */ - private List orderList; -} diff --git a/wjcy-common/src/main/java/me/zhengjie/service/vo/CtApplyInfoVO.java b/wjcy-common/src/main/java/me/zhengjie/service/vo/CtApplyInfoVO.java deleted file mode 100644 index e1c57a1..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/vo/CtApplyInfoVO.java +++ /dev/null @@ -1,19 +0,0 @@ -package me.zhengjie.service.vo; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * 应用信息(ct_apply) VO - * @Author zhw - * @Date 2022-08-01 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class CtApplyInfoVO { - - private Long id; - private String name; -} diff --git a/wjcy-common/src/main/java/me/zhengjie/service/vo/CtApplyListVO.java b/wjcy-common/src/main/java/me/zhengjie/service/vo/CtApplyListVO.java deleted file mode 100644 index 04270b8..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/vo/CtApplyListVO.java +++ /dev/null @@ -1,68 +0,0 @@ -package me.zhengjie.service.vo; - - -import com.baomidou.mybatisplus.annotation.FieldFill; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * 应用信息表(CtApply)表实体类 分页查询VO - * @author zhw - * @Data 2022-07-23 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -@ApiModel("应用信息表") -public class CtApplyListVO { - - @ApiModelProperty(value = "id") - private Long id; - - @ApiModelProperty(value = "平台Id") - private Long platformId; - - @ApiModelProperty(value = "创建时间") - private String createdAt; - - @ApiModelProperty(value = "修改时间") - private String updatedAt; - - /** 操作人账号 */ - @ApiModelProperty(value = "操作人账号") - private String gmName; - - /** 应用名称 */ - @ApiModelProperty(value = "应用名称") - private String name; - - /** 任务名称 */ - @ApiModelProperty(value = "任务名称") - private String taskName; - - /** 方法名称 */ - @ApiModelProperty(value = "方法名称") - private String methodName; - - /** accessKeyID */ - @ApiModelProperty(value = "accessKeyID") - private String accessKeyId; - - /** accessKeySecret */ - @ApiModelProperty(value = "accessKeySecret") - private String accessKeySecret; - - /** 应用id */ - @ApiModelProperty(value = "应用id") - private String robotUuid; - - /** 备注 */ - @ApiModelProperty(value = "备注") - private String remark; -} diff --git a/wjcy-common/src/main/java/me/zhengjie/service/vo/CtBrowseDetailVO.java b/wjcy-common/src/main/java/me/zhengjie/service/vo/CtBrowseDetailVO.java deleted file mode 100644 index 0a4b4ff..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/vo/CtBrowseDetailVO.java +++ /dev/null @@ -1,73 +0,0 @@ -package me.zhengjie.service.vo; - -import com.baomidou.mybatisplus.annotation.FieldFill; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.math.BigDecimal; -import java.util.Date; - -/** - * 收藏浏览信息表(CtCard)表实体类 详情Detail - * - * @author rch - * @since 2022-07-09 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -@ApiModel("收藏浏览详情") -public class CtBrowseDetailVO { - - @ApiModelProperty(value = "id") - private Long id; - - @ApiModelProperty(value = "创建时间") - private String createdAt; - - @ApiModelProperty(value = "修改时间") - private String updatedAt; - - /** 操作人账号*/ - @ApiModelProperty(value = "操作人账号") - private String gmName; - - /** 买家ID */ - @ApiModelProperty(value = "买家ID") - private Long buyerId; - - /** 国家 */ - @ApiModelProperty(value = "国家") - private String country; - - /** 账号 */ - @ApiModelProperty(value = "账号") - private String account; - - /** 密码 */ - @ApiModelProperty(value = "密码") - private String pwd; - - /** vpn分享链接 */ - @ApiModelProperty(value = "vpn分享链接") - private String vpnShare; - - /** 收藏链接 */ - @ApiModelProperty(value = "收藏链接") - private String linkUrl; - - /** 状态描述 */ - @ApiModelProperty(value = "状态描述") - private String paymentResults; - - /** 状态 1.待执行 2.执行中 3.执行成功 4.执行失败 */ - @ApiModelProperty(value = "状态 1.待执行 2.执行中 3.执行成功 4.执行失败") - private Integer status; -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/service/vo/CtBrowseListVO.java b/wjcy-common/src/main/java/me/zhengjie/service/vo/CtBrowseListVO.java deleted file mode 100644 index 02d75fa..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/vo/CtBrowseListVO.java +++ /dev/null @@ -1,63 +0,0 @@ -package me.zhengjie.service.vo; - -import com.baomidou.mybatisplus.extension.activerecord.Model; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.Date; - -/** - * 浏览收藏(CtBrowse)表实体类 VO - * - * @author rch - * @since 2022-11-04 09:45:31 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -@ApiModel("浏览收藏VO") -public class CtBrowseListVO extends Model { - /** 主键ID */ - @ApiModelProperty(value = "主键ID") - private Long id; - - /** 买家ID */ - @ApiModelProperty(value = "买家ID") - private Long buyerId; - - /** 国家 */ - @ApiModelProperty(value = "国家") - private String country; - - /** 账号 */ - @ApiModelProperty(value = "账号") - private String account; - - /** 收藏链接 */ - @ApiModelProperty(value = "收藏链接") - private String linkUrl; - - /** 创建时间 */ - @ApiModelProperty(value = "创建时间") - private Date createdAt; - - /** 修改时间 */ - @ApiModelProperty(value = "修改时间") - private Date updatedAt; - - /** 状态描述 */ - @ApiModelProperty(value = "状态描述") - private String paymentResults; - - /** 状态 1.待执行 2.执行中 3.执行成功 4.执行失败 */ - @ApiModelProperty(value = "状态 1.待执行 2.执行中 3.执行成功 4.执行失败") - private Integer status; - - /** 操作人账号 */ - @ApiModelProperty(value = "操作人账号") - private String gmName; -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/service/vo/CtBuyerClickFarmVO.java b/wjcy-common/src/main/java/me/zhengjie/service/vo/CtBuyerClickFarmVO.java deleted file mode 100644 index 21ff831..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/vo/CtBuyerClickFarmVO.java +++ /dev/null @@ -1,103 +0,0 @@ -package me.zhengjie.service.vo; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.math.BigDecimal; - -/** - * 买家信息表(CtBuyer)表实体类 详情Detail -刷单信息模块使用 - * - * @author rch - * @since 2022-09-20 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class CtBuyerClickFarmVO { - - private Long id; - - /** 创建时间 */ - private String createdAt; - - /** 修改时间 */ - private String updatedAt; - - /** 昵称*/ - private String nickName; - - /** 账号*/ - private String account; - - /** 密码*/ - private String pwd; - - /** 平台名称 */ - private Integer platformId; - - /** 平台名称 */ - private String platformName; - - /** 平台名称 */ - private Integer companyId; - - /** 公司名称 */ - private String companyName; - - /** 操作人账号*/ - private String gmName; - - ////////////////////////////////////// 新增字段 - /** 国家 */ - private String contntryShort; - /** VPN_ID(导入excel里包含) */ - private Long vpnId; - private String ipAddress; - private String link; - - /** 信用卡ID */ - private Long cardId; - private String number; - private String pinNumber; - private String holderSurname; - private String holderName; - - /** 用户等级(导入默认内部账号) 1.普通 2.精品 3.压力 4.内部账号 */ - private Integer level; - /** 占用状态 1.已占用 2.未占用 */ - private Integer occupyStatus; - /** 占用账户 */ - private String occupyAccount; - /** 账户余额 */ - private BigDecimal balance; - /** 账户购买总金额 */ - private BigDecimal buyTotalMoney; - - /** 状态(导入默认正常) 1.待注册 2待验证 3.待完善 4.正常 5.异常 6.可用但已用 7.删除 */ - private Integer status; - - // ==================地址信息相关========================================begin - /** 地址1 */ - private String addressline1; - /** 国家 */ - private String country; - /** 州 */ - private String state; - /** 电话 */ - private String tel; - /** lastname */ - private String lastname; - /** 税号 */ - private String vatNumber; - /** 城市 */ - private String city; - /** 地址2 */ - private String addressline2; - /** firstname */ - private String firstname; - /** 邮政编码 */ - private String postalcode; -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/service/vo/CtBuyerDetailVO.java b/wjcy-common/src/main/java/me/zhengjie/service/vo/CtBuyerDetailVO.java deleted file mode 100644 index 12f1baf..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/vo/CtBuyerDetailVO.java +++ /dev/null @@ -1,162 +0,0 @@ -package me.zhengjie.service.vo; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.math.BigDecimal; - -/** - * 买家信息表(CtBuyer)表实体类 详情Detail - * - * @author rch - * @since 2022-07-07 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -@ApiModel("买家详情") -public class CtBuyerDetailVO { - - @ApiModelProperty(value = "id") - private Long id; - - /** 创建时间 */ - @ApiModelProperty(value = "创建时间") - private String createdAt; - - /** 修改时间 */ - @ApiModelProperty(value = "修改时间") - private String updatedAt; - - /** 昵称 */ - @ApiModelProperty(value = "昵称") - private String nickName; - - /** 账号 */ - @ApiModelProperty(value = "账号") - private String account; - - /** 密码 */ - @ApiModelProperty(value = "密码") - private String pwd; - - /** 平台ID */ - @ApiModelProperty(value = "平台ID") - private Integer platformId; - - /** 平台名称 */ - @ApiModelProperty(value = "平台名称") - private String platformName; - - /** 公司ID */ - @ApiModelProperty(value = "公司ID") - private Integer companyId; - - /** 公司名称 */ - @ApiModelProperty(value = "公司名称") - private String companyName; - - /** 操作人账号*/ - @ApiModelProperty(value = "操作人账号") - private String gmName; - - ////////////////////////////////////// 新增字段 - /** 国家 */ - @ApiModelProperty(value = "国家") - private String contntryShort; - - /** VPN_ID(导入excel里包含) */ - @ApiModelProperty(value = "VPN_ID") - private Long vpnId; - - @ApiModelProperty(value = "Vpn-Ip") - private String ipAddress; - - @ApiModelProperty(value = "vpn分享链接") - private String vpn; - - /** 信用卡ID */ - @ApiModelProperty(value = "信用卡ID") - private Long cardId; - - @ApiModelProperty(value = "信用卡卡号") - private String number; - - @ApiModelProperty(value = "信用卡密码") - private String cardPwd; - - @ApiModelProperty(value = "信用卡姓氏") - private String holderSurname; - - @ApiModelProperty(value = "信用卡名称") - private String holderName; - - /** 用户等级(导入默认内部账号) 1.普通 2.精品 3.压力 4.内部账号 */ - @ApiModelProperty(value = "用户等级(导入默认内部账号) 1.普通 2.精品 3.压力 4.内部账号") - private Integer level; - - /** 占用状态 1.已占用 2.未占用 */ - @ApiModelProperty(value = "占用状态 1.已占用 2.未占用") - private Integer occupyStatus; - - /** 占用账户 */ - @ApiModelProperty(value = "占用账户") - private String occupyAccount; - - /** 账户余额 */ - @ApiModelProperty(value = "账户余额") - private BigDecimal balance; - - /** 账户购买总金额 */ - @ApiModelProperty(value = "账户购买总金额") - private BigDecimal buyTotalMoney; - - /** 状态(导入默认正常) 1.待注册 2待验证 3.待完善 4.正常 5.异常 6.可用但已用 7.删除 */ - @ApiModelProperty(value = "状态(导入默认正常) 1.待注册 2待验证 3.待完善 4.正常 5.异常 6.可用但已用 7.删除") - private Integer status; - - // ==================地址信息相关========================================begin - /** 地址1 */ - @ApiModelProperty(value = "地址1") - private String addressline1; - - /** 国家 */ - @ApiModelProperty(value = "国家") - private String country; - - /** 州 */ - @ApiModelProperty(value = "州") - private String state; - - /** 电话 */ - @ApiModelProperty(value = "电话") - private String tel; - - /** lastname */ - @ApiModelProperty(value = "lastname") - private String lastname; - - /** 税号 */ - @ApiModelProperty(value = "税号") - private String vatNumber; - - /** 城市 */ - @ApiModelProperty(value = "城市") - private String city; - - /** 地址2 */ - @ApiModelProperty(value = "地址2") - private String addressline2; - - /** firstname */ - @ApiModelProperty(value = "firstname") - private String firstname; - - /** 邮政编码 */ - @ApiModelProperty(value = "邮政编码") - private String postalcode; -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/service/vo/CtBuyerListVO.java b/wjcy-common/src/main/java/me/zhengjie/service/vo/CtBuyerListVO.java deleted file mode 100644 index b6a7f57..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/vo/CtBuyerListVO.java +++ /dev/null @@ -1,111 +0,0 @@ -package me.zhengjie.service.vo; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * 买家信息表(CtBuyer)表实体类 分页查询Detail - * - * @author rch - * @since 2022-07-07 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -@ApiModel -public class CtBuyerListVO { - - @ApiModelProperty(value = "Id") - private Long id; - - /** 创建时间 */ - @ApiModelProperty(value = "创建时间") - private String createdAt; - - /** 修改时间 */ - @ApiModelProperty(value = "修改时间") - private String updatedAt; - - /** 昵称 */ - @ApiModelProperty(value = "昵称") - private String nickName; - - /** 账号 */ - @ApiModelProperty(value = "账号") - private String account; - - /** 密码 */ - @ApiModelProperty(value = "密码") - private String pwd; - - /** 平台id */ - @ApiModelProperty(value = "平台id") - private Integer platformId; - - /** 平台名称 */ - @ApiModelProperty(value = "平台名称") - private String platformName; - - /** 公司id */ - @ApiModelProperty(value = "公司id") - private Long companyId; - - /** 公司名称 */ - @ApiModelProperty(value = "公司名称") - private String companyName; - - /** 操作人账号*/ - @ApiModelProperty(value = "操作人账号") - private String gmName; - - ////////////////////////////////////// 新增字段 - /** 国家 */ - @ApiModelProperty(value = "国家") - private String contntryShort; - - /** VPN_ID(导入excel里包含) */ - @ApiModelProperty(value = "VPN_ID") - private Long vpnId; - - @ApiModelProperty(value = "Vpn-Ip") - private String ipAddress; - - @ApiModelProperty(value = "vpn分享链接") - private String vpn; - - /** 信用卡ID */ - @ApiModelProperty(value = "信用卡ID") - private Long cardId; - - @ApiModelProperty(value = "信用卡卡号") - private String number; - - @ApiModelProperty(value = "信用卡密码") - private String cardPwd; - - @ApiModelProperty(value = "信用卡姓氏") - private String holderSurname; - - @ApiModelProperty(value = "信用卡名称") - private String holderName; - - /** 状态(导入默认正常) 1.待注册 2待验证 3.待完善 4.正常 5.异常 6.可用但已用 7.删除 */ - @ApiModelProperty(value = "状态(导入默认正常) 1.待注册 2待验证 3.待完善 4.正常 5.异常 6.可用但已用 7.删除") - private Integer status; - - /** 地址1 */ - @ApiModelProperty(value = "地址1") - private String addressline1; - - /** 国家 */ - @ApiModelProperty(value = "国家") - private String country; - - /** 州 */ - @ApiModelProperty(value = "州") - private String state; -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/service/vo/CtBuyerVO.java b/wjcy-common/src/main/java/me/zhengjie/service/vo/CtBuyerVO.java deleted file mode 100644 index efa7e74..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/vo/CtBuyerVO.java +++ /dev/null @@ -1,47 +0,0 @@ -package me.zhengjie.service.vo; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * 买家信息表(CtBuyer)表实体类 - * - * @author rch - * @since 2022-06-22 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class CtBuyerVO { - - private Long id; - - /** 创建时间 */ - private String createdAt; - - /** 修改时间 */ - private String updatedAt; - - /** 昵称*/ - private String nickName; - - /** 账号*/ - private String account; - - /** 密码*/ - private String pwd; - - /** 平台id */ - private Integer platformId; - - /** 平台名称 */ - private String platformName; - - /** 公司id */ - private Long companyId; - - /** 操作人账号*/ - private String gmName; -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/service/vo/CtCardDetailVO.java b/wjcy-common/src/main/java/me/zhengjie/service/vo/CtCardDetailVO.java deleted file mode 100644 index 270a99b..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/vo/CtCardDetailVO.java +++ /dev/null @@ -1,125 +0,0 @@ -package me.zhengjie.service.vo; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.math.BigDecimal; -import java.util.Date; - -/** - * 信用卡信息表(CtCard)表实体类 详情Detail - * - * @author rch - * @since 2022-07-09 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -@ApiModel("信用卡详情") -public class CtCardDetailVO { - - @ApiModelProperty(value = "Id") - private Long id; - - @ApiModelProperty(value = "创建时间") - private String createdAt; - - @ApiModelProperty(value = "修改时间") - private String updatedAt; - - /** 操作人账号*/ - @ApiModelProperty(value = "操作人账号") - private String gmName; - - /** 父ID */ - @ApiModelProperty(value = "父ID") - private Long parentId; - - /** 卡号 */ - @ApiModelProperty(value = "卡号") - private String number; - -// /** PIN码 */ -// @ApiModelProperty(value = "PIN码") -// private String pinNumber; - - /** 持卡人姓氏 */ - @ApiModelProperty(value = "持卡人姓氏") - private String holderSurname; - - /** 持卡人名称 */ - @ApiModelProperty(value = "持卡人名称") - private String holderName; - - /** 有效期 */ - @ApiModelProperty(value = "有效期") - private Date termOfValidity; - - /** 余额 */ - @ApiModelProperty(value = "余额") - private BigDecimal balance; - - /** 累计消费 */ - @ApiModelProperty(value = "累计消费") - private BigDecimal sumConsume; - - /** 开卡日期 */ - @ApiModelProperty(value = "开卡日期") - private Date openDate; - - /** 所属国家 */ - @ApiModelProperty(value = "所属国家") - private String contntryShort; - - /** 信用卡类型 1.Payoneer 2.万事达虚拟卡 3.Visa信用卡 */ - @ApiModelProperty(value = "信用卡类型 1.Payoneer 2.万事达虚拟卡 3.Visa信用卡") - private Integer type; - - /** 所属厂商:1.AmzKeys 2.Airwallex */ - @ApiModelProperty(value = "所属厂商:1.AmzKeys 2.Airwallex") - private Integer cardDealer; - - /** 身份证号 */ - @ApiModelProperty(value = "身份证号") - private String idNumber; - - /** 省份 */ - @ApiModelProperty(value = "省份") - private String province; - - /** 城市 */ - @ApiModelProperty(value = "城市") - private String country; - - /** 地址 */ - @ApiModelProperty(value = "地址") - private String address; - - /** 手机号 */ - @ApiModelProperty(value = "手机号") - private String phone; - - /** 邮箱 */ - @ApiModelProperty(value = "邮箱") - private String email; - - /** 登陆账号 */ - @ApiModelProperty(value = "登陆账号") - private String account; - - /** 密码 */ - @ApiModelProperty(value = "密码") - private String pwd; - - /** 状态:1.正常、2.异常、3.已删除 */ - @ApiModelProperty(value = "状态:1.正常、2.异常、3.已删除") - private Integer status; - - /** 备注 */ - @ApiModelProperty(value = "备注") - private String remarks; -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/service/vo/CtCardListVO.java b/wjcy-common/src/main/java/me/zhengjie/service/vo/CtCardListVO.java deleted file mode 100644 index fd2225f..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/vo/CtCardListVO.java +++ /dev/null @@ -1,72 +0,0 @@ -package me.zhengjie.service.vo; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.math.BigDecimal; - -/** - * 买家信息表(CtCard)表实体类 分页查询Detail - * - * @author rch - * @since 2022-07-09 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -@ApiModel -public class CtCardListVO { - - @ApiModelProperty(value = "Id") - private Long id; - - @ApiModelProperty(value = "创建时间") - private String createdAt; - - @ApiModelProperty(value = "修改时间") - private String updatedAt; - - /** 操作人账号*/ - @ApiModelProperty(value = "操作人账号") - private String gmName; - - /** 卡号 */ - @ApiModelProperty(value = "卡号") - private String number; - - /** PIN码 */ - @ApiModelProperty(value = "PIN码") - private String pinNumber; - - /** 持卡人姓氏 */ - @ApiModelProperty(value = "持卡人姓氏") - private String holderSurname; - - /** 持卡人名称 */ - @ApiModelProperty(value = "持卡人名称") - private String holderName; - - /** 余额 */ - @ApiModelProperty(value = "余额") - private BigDecimal balance; - - /** 累计消费 */ - @ApiModelProperty(value = "累计消费") - private BigDecimal sumConsume; - - /** 信用卡类型 1.Payoneer 2.万事达虚拟卡 3.Visa信用卡 */ - @ApiModelProperty(value = "信用卡类型 1.Payoneer 2.万事达虚拟卡 3.Visa信用卡") - private Integer type; - - /** 所属厂商:1.AmzKeys 2.Airwallex */ - @ApiModelProperty(value = "所属厂商:1.AmzKeys 2.Airwallex") - private Integer cardDealer; - - /** 状态:1.正常、2.异常、3.已删除 */ - @ApiModelProperty(value = "状态:1.正常、2.异常、3.已删除") - private Integer status; -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/service/vo/CtClickFarmEditDetailVO.java b/wjcy-common/src/main/java/me/zhengjie/service/vo/CtClickFarmEditDetailVO.java deleted file mode 100644 index c789a85..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/vo/CtClickFarmEditDetailVO.java +++ /dev/null @@ -1,63 +0,0 @@ -package me.zhengjie.service.vo; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.Date; - -/** - * 刷单Excel信息(CtClickFarming)表实体类 - 修改详情 - * - * @author rch - * @since 2022-08-16 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class CtClickFarmEditDetailVO { - - private Long id; - /** 关联刷单订单ID */ - private Long ctClickOrderId; - /** 买家id */ - private Long buyerId; - /** 买家名称 */ - private String buyerName; - /** 刷单类型 */ - private Integer type; - /** 刷单类型 */ - private Integer paramsType; - /** 店铺名称 */ - private String shopName; - /** 关键词 */ - private String keyWord; - /** 标题 */ - private String title; - /** 链接 */ - private String link; - /** 数量 */ - private Integer number; - /** 规格 */ - private String specification; - /** 颜色 */ - private String color; - /** item */ - private String item; - private String exchange; - /** 执行结果 */ - private String response; - /** 支付订单ID */ - private String payOrderId; - /** 状态 1.待执行 2.执行中 3.执行成功 4.执行失败 */ - private Integer status; - /** 留言 */ - private String amessage; - /** 创建时间 */ - private Date createdAt; - /** 修改时间 */ - private Date updatedAt; - /** 操作人账号 */ - private String gmName; -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/service/vo/CtClickFarmingDetailVO.java b/wjcy-common/src/main/java/me/zhengjie/service/vo/CtClickFarmingDetailVO.java deleted file mode 100644 index eacd156..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/vo/CtClickFarmingDetailVO.java +++ /dev/null @@ -1,98 +0,0 @@ -package me.zhengjie.service.vo; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; -import java.util.Date; - -/** - * 刷单Excel信息(CtClickFarming)表实体类 - * - * @author rch - * @since 2022-08-16 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -@ApiModel("刷单详情") -public class CtClickFarmingDetailVO { - - @ApiModelProperty(value = "id") - private Long id; - - @ApiModelProperty(value = "买家名称") - private String buyerName; - - /** 商品属性类型 */ - @ApiModelProperty(value = "商品属性类型:1.关键词 2.链接", required = true, allowableValues = "1,2") - private Integer paramsType; - - /** 店铺名称 */ - @ApiModelProperty(value = "店铺名称") - private String shopName; - - /** 关键词 */ - @ApiModelProperty(value = "关键词") - private String keyWord; - - /** 标题 */ - @ApiModelProperty(value = "标题") - private String title; - - /** 链接 */ - @ApiModelProperty(value = "链接") - private String link; - - /** 数量 */ - @ApiModelProperty(value = "数量") - private Integer number; - - /** 规格 */ - @ApiModelProperty(value = "规格") - private String specification; - - /** 颜色 */ - @ApiModelProperty(value = "颜色") - private String color; - - /** item */ - @ApiModelProperty(value = "item") - private String item; - - @ApiModelProperty(value = "优惠劵") - private String exchange; - - /** 执行结果 */ - @ApiModelProperty(value = "执行结果") - private String response; - - /** 支付订单ID */ - @ApiModelProperty(value = "支付订单ID") - private String payOrderId; - - /** 状态 1.待执行 2.执行中 3.执行成功 4.执行失败 5.代付款 6.支付成功后失败 */ - @ApiModelProperty(value = "状态 1.待执行 2.执行中 3.执行成功 4.执行失败 5.代付款 6.支付成功后失败", allowableValues = "1,2,3,4,5,6") - private Integer status; - - /** 留言 */ - @ApiModelProperty(value = "留言") - private String amessage; - - /** 创建时间 */ - @ApiModelProperty(value = "创建时间") - private Date createdAt; - - /** 修改时间 */ - @ApiModelProperty(value = "修改时间") - private Date updatedAt; - - /** 操作人账号 */ - @ApiModelProperty(value = "操作人账号") - private String gmName; -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/service/vo/CtClickFarmingVO.java b/wjcy-common/src/main/java/me/zhengjie/service/vo/CtClickFarmingVO.java deleted file mode 100644 index 44a409e..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/vo/CtClickFarmingVO.java +++ /dev/null @@ -1,59 +0,0 @@ -package me.zhengjie.service.vo; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.Date; - -/** - * 刷单Excel信息(CtClickFarming)表实体类 - * - * @author rch - * @since 2022-08-16 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class CtClickFarmingVO { - - private Long id; - /** 关联刷单订单ID */ - private Long ctClickOrderId; - /** 刷单类型 */ - private Integer paramsType; - /** 国家 */ - private String country; - /** 账号 */ - private String account; - /** 店铺名称 */ - private String shopName; - /** 关键词 */ - private String keyWord; - /** 标题 */ - private String title; - /** 链接 */ - private String link; - /** 数量 */ - private Integer number; - /** 规格 */ - private String specification; - /** 颜色 */ - private String color; - /** item */ - private String item; - private String exchange; - /** 执行结果 */ - private String response; - /** 支付订单ID */ - private String payOrderId; - /** 状态 1.待执行 2.执行中 3.执行成功 4.执行失败 */ - private Integer status; - /** 创建时间 */ - private Date createdAt; - /** 修改时间 */ - private Date updatedAt; - /** 操作人账号 */ - private String gmName; -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/service/vo/CtClickOrderDetailVO.java b/wjcy-common/src/main/java/me/zhengjie/service/vo/CtClickOrderDetailVO.java deleted file mode 100644 index 1fbf249..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/vo/CtClickOrderDetailVO.java +++ /dev/null @@ -1,48 +0,0 @@ -package me.zhengjie.service.vo; - -import com.baomidou.mybatisplus.extension.activerecord.Model; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; -import me.zhengjie.utils.excel.ExcelExport; - -/** - * 刷单-订单信息(CtClickOrder)表实体类 - * - * @author rch - * @since 2022-09-14 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class CtClickOrderDetailVO extends Model { - private Long id; - private String createdAt; - private String updatedAt; - /** 操作人账号*/ - private String gmName; - /** 公司ID */ - private Long companyId; - /** 状态描述 */ - private String paymentResults; - /** 购买数量 */ - private String pricesNumber; - /** 总金额 */ - private String amount; - /** 店铺名称 */ - private String shop; - /** 订单id */ - private String orderId; - /** 商品名称 */ - private String shopName; - /** 时间 */ - private String orderDate; - /** 评论 */ - private String comment; - /** 图片路径 */ - private String paths; - /** 状态 1.待执行 2.执行中 3.执行成功 4.执行失败 */ - private Integer status; - /** 执行结果 */ - private String response; -} diff --git a/wjcy-common/src/main/java/me/zhengjie/service/vo/CtClickOrderListVO.java b/wjcy-common/src/main/java/me/zhengjie/service/vo/CtClickOrderListVO.java deleted file mode 100644 index f99a5b8..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/vo/CtClickOrderListVO.java +++ /dev/null @@ -1,45 +0,0 @@ -package me.zhengjie.service.vo; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; -import me.zhengjie.utils.excel.ExcelExport; - -/** - * 实体类 分页查询Detail - * - * @author rch - * @since 2022-09-27 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class CtClickOrderListVO { - - private Long id; - private String createdAt; - private String updatedAt; - /** 公司ID */ - private Long companyId; - /** 类型 1.刷单 2.导入 */ - private Integer type; - /** 公司Name */ - private String companyName; - /** 账号 */ - private String account; - /** 密码 */ - private String pwd; - /** 总金额 */ - private String amount; - /** 店铺名称 */ - private String shop; - /** 订单id */ - private String orderId; - /** 评论 */ - private String comment; - /** 状态 1.待执行 2.执行中 3.执行成功 4.执行失败 */ - private Integer status; - /** 执行结果 */ - private String response; -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/service/vo/CtCompanyInfoVO.java b/wjcy-common/src/main/java/me/zhengjie/service/vo/CtCompanyInfoVO.java deleted file mode 100644 index 6f1db4b..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/vo/CtCompanyInfoVO.java +++ /dev/null @@ -1,23 +0,0 @@ -package me.zhengjie.service.vo; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * 公司信息(CtPlatform)表实体类 VO - * - * @author rch - * @since 2022-07-07 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class CtCompanyInfoVO { - - private Long id; - - /** 名称 */ - private String name; -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/service/vo/CtCompanyVO.java b/wjcy-common/src/main/java/me/zhengjie/service/vo/CtCompanyVO.java deleted file mode 100644 index c13e35d..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/vo/CtCompanyVO.java +++ /dev/null @@ -1,35 +0,0 @@ -package me.zhengjie.service.vo; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * 公司信息(CtCompany)表实体类 VO - * - * @author rch - * @since 2022-06-28 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class CtCompanyVO { - - private Long id; - private String createdAt; - private String updatedAt; - /** 名称 */ - private String name; - /** 地址 */ - private String address; - /** 电话 */ - private String phone; - /** 商户码(公司调用api公司唯一标识) */ - private String number; - /** 商户token(公司调用api公司token身份标识) */ - private String token; - - /** 操作人账号*/ - private String gmName; -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/service/vo/CtDhPayDetailVO.java b/wjcy-common/src/main/java/me/zhengjie/service/vo/CtDhPayDetailVO.java deleted file mode 100644 index d6f4e98..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/vo/CtDhPayDetailVO.java +++ /dev/null @@ -1,40 +0,0 @@ -package me.zhengjie.service.vo; - -import com.baomidou.mybatisplus.annotation.FieldFill; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.math.BigDecimal; -import java.util.Date; - -/** - * 买家信息表(CtDhPay)表实体类 详情Detail - * - * @author rch - * @since 2022-07-28 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class CtDhPayDetailVO { - - private Long id; - private String createdAt; - private String updatedAt; - /** 操作人账号*/ - private String gmName; - - /** 买家名称 */ - private String buyerName; - /** 支付订单ID(敦煌的) */ - private String orderId; - /** 请求响应详情 */ - private String response; - /** 状态 0.待处理 1.支付成功 2.支付失败 */ - private Integer status; -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/service/vo/CtDhPayListVO.java b/wjcy-common/src/main/java/me/zhengjie/service/vo/CtDhPayListVO.java deleted file mode 100644 index 778ea07..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/vo/CtDhPayListVO.java +++ /dev/null @@ -1,36 +0,0 @@ -package me.zhengjie.service.vo; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.Date; - -/** - * 买家信息表(CtDhPay)表实体类 分页查询Detail - * - * @author rch - * @since 2022-07-07 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class CtDhPayListVO { - - private Long id; - /** 买家名称 */ - private String buyerName; - /** 支付订单ID(敦煌的) */ - private String orderId; - /** 请求响应详情 */ - private String response; - /** 状态 0.待处理 1.支付成功 2.支付失败 */ - private Integer status; - /** 创建时间 */ - private Date createdAt; - /** 修改时间 */ - private Date updatedAt; - /** 操作人账号 */ - private String gmName; -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/service/vo/CtExcelImportInfoVO.java b/wjcy-common/src/main/java/me/zhengjie/service/vo/CtExcelImportInfoVO.java deleted file mode 100644 index c20eda1..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/vo/CtExcelImportInfoVO.java +++ /dev/null @@ -1,42 +0,0 @@ -package me.zhengjie.service.vo; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * ExcelImportInfo 导入信息(CtExcel)表实体类 VO - * - * @author rch - * @since 2022-06-27 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class CtExcelImportInfoVO { - - private Long id; - private String createdAt; - private String updatedAt; - - /** 公司主键 */ - private Long companyId; - - /** 鉴权枚举 */ - private Integer tokenEnum; - - /** 订单来源 */ - private String fromDetailInfo; - - /** 状态 状态 1.待处理 2.处理成功 3.处理失败 */ - private Integer status; - - /** 产品信息-JSON */ - private String cartList; - - /** 订单收货地址-JSON */ - private String contactInfo; - - /** 操作人账号*/ - private String gmName; -} diff --git a/wjcy-common/src/main/java/me/zhengjie/service/vo/CtExcelVO.java b/wjcy-common/src/main/java/me/zhengjie/service/vo/CtExcelVO.java deleted file mode 100644 index 802664b..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/vo/CtExcelVO.java +++ /dev/null @@ -1,31 +0,0 @@ -package me.zhengjie.service.vo; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * Excel 导入信息(CtExcel)表实体类 VO - * - * @author rch - * @since 2022-06-23 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class CtExcelVO { - - private Long id; - private String createdAt; - private String updatedAt; - /** 备注 */ - private String remarks; - /** excel路径 */ - private String path; - private String errorPath; - /** 状态1.待处理 2.已处理 */ - private Integer status; - - /** 操作人账号*/ - private String gmName; -} diff --git a/wjcy-common/src/main/java/me/zhengjie/service/vo/CtOrderVO.java b/wjcy-common/src/main/java/me/zhengjie/service/vo/CtOrderVO.java deleted file mode 100644 index 2fe99ae..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/vo/CtOrderVO.java +++ /dev/null @@ -1,44 +0,0 @@ -package me.zhengjie.service.vo; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * (CtOrder)表实体类 VO - * - * @author rch - * @since 2022-07-01 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class CtOrderVO { - - private Long id; - private String createdAt; - private String updatedAt; - /** 公司Id */ - private Long companyId; - /** ExcelId 信息 */ - private Long excelInfoId; - /** 买家buy_access_token */ - private String buyAccessToken; - /** 我们平台订单编号 */ - private String ctOrderNo; - /** 订单号,下单成功响应的订单号(冗余字段 下单成功响应订单信息里有) */ - private Long orderNo; - /** 下单成功响应的产品id( a,b,c 格式) (响应字段很多,先少些几个) */ - private Long responseProductId; - /** 下单成功响应的订单地址id(响应字段很多,先少些几个) */ - private Long responseOrderAddressId; - /** 下单成功响应的订单信息 (响应字段很多,先少些几个) */ - private Long responseOrderId; - /** 响应码信息 */ - private OrderResponStatusVO orderResponseStatus; - /** 响应码信息 */ - private PayOrderVO payOrderVO; - /** 状态 1.待支付(下单成功) 2.支付成功 3.支付失败*/ - private Integer status; -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/service/vo/CtPlatformInfoVO.java b/wjcy-common/src/main/java/me/zhengjie/service/vo/CtPlatformInfoVO.java deleted file mode 100644 index 6086629..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/vo/CtPlatformInfoVO.java +++ /dev/null @@ -1,23 +0,0 @@ -package me.zhengjie.service.vo; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * 平台信息(CtPlatform)表实体类 VO - * - * @author rch - * @since 2022-06-23 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class CtPlatformInfoVO { - - private Long id; - - /** 名称 */ - private String name; -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/service/vo/CtPlatformVO.java b/wjcy-common/src/main/java/me/zhengjie/service/vo/CtPlatformVO.java deleted file mode 100644 index 6562b7b..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/vo/CtPlatformVO.java +++ /dev/null @@ -1,29 +0,0 @@ -package me.zhengjie.service.vo; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * 平台信息(CtPlatform)表实体类 VO - * - * @author rch - * @since 2022-06-23 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class CtPlatformVO { - - private Long id; - private String createdAt; - private String updatedAt; - /** 名称 */ - private String name; - /** 地址 */ - private String address; - /** 电话 */ - private String phone; - private String gmName; -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/service/vo/CtRebotListVO.java b/wjcy-common/src/main/java/me/zhengjie/service/vo/CtRebotListVO.java deleted file mode 100644 index 02edb77..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/vo/CtRebotListVO.java +++ /dev/null @@ -1,37 +0,0 @@ -package me.zhengjie.service.vo; - -import com.baomidou.mybatisplus.annotation.FieldFill; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * 影刀机器人 分页查询VO - * - * @Author zhw - * @Date 2022-07-23 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class CtRebotListVO { - - - private Long id; - - private String createdAt; - - private String updatedAt; - /** 操作人账号*/ - private String gmName; - - /** 机器人账号 */ - private String accountName; - /** 机器人Uuid信息 */ - private String robotClientUuid; - /** 状态 0.未占用 1.已占用 */ - private Integer status; -} diff --git a/wjcy-common/src/main/java/me/zhengjie/service/vo/CtVpnInfoVO.java b/wjcy-common/src/main/java/me/zhengjie/service/vo/CtVpnInfoVO.java deleted file mode 100644 index 3241d22..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/vo/CtVpnInfoVO.java +++ /dev/null @@ -1,16 +0,0 @@ -package me.zhengjie.service.vo; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@AllArgsConstructor -@NoArgsConstructor -public class CtVpnInfoVO { - - private Long id; - - /** 名称 */ - private String name; -} diff --git a/wjcy-common/src/main/java/me/zhengjie/service/vo/CtVpnVO.java b/wjcy-common/src/main/java/me/zhengjie/service/vo/CtVpnVO.java deleted file mode 100644 index a95a195..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/vo/CtVpnVO.java +++ /dev/null @@ -1,42 +0,0 @@ -package me.zhengjie.service.vo; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@AllArgsConstructor -@NoArgsConstructor -public class CtVpnVO { - - private Long id; - /** 创建时间*/ - private String createdAt; - /** 修改时间*/ - private String updatedAt; - /** 操作人账号*/ - private String gmName; - - /** 所属国家简称 */ - private String contntryShort; - /** IP地址 */ - private String ipAddress; - /** 父ip地址 */ - private String parentIpAddress; - /** 端口 */ - private Integer port; - /** 名称 */ - private String name; - /** 密码 */ - private String pwd; - /** VPS类型 1.传统 */ - private Integer vpsType; - /** 经销商 1.V2 */ - private Integer dealer; - /** mac地址 */ - private String mac; - /** 链接 */ - private String link; - /** 经销商 1.可用 2.禁用 */ - private Integer status; -} diff --git a/wjcy-common/src/main/java/me/zhengjie/service/vo/GoogleAuthInfoVO.java b/wjcy-common/src/main/java/me/zhengjie/service/vo/GoogleAuthInfoVO.java deleted file mode 100644 index e99241f..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/vo/GoogleAuthInfoVO.java +++ /dev/null @@ -1,27 +0,0 @@ -package me.zhengjie.service.vo; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - *

- * 秘钥信息 - *

- * - * @author: rch - * @since: 2020-08-26 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class GoogleAuthInfoVO { - /** 用户信息 */ - private String userName; - - /** 二维码url 信息 */ - private String qrBarCodeUrl; - - /** 明文秘钥 */ - private String secret; -} diff --git a/wjcy-common/src/main/java/me/zhengjie/service/vo/LoginIpVO.java b/wjcy-common/src/main/java/me/zhengjie/service/vo/LoginIpVO.java deleted file mode 100644 index 80b4c10..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/vo/LoginIpVO.java +++ /dev/null @@ -1,57 +0,0 @@ -package me.zhengjie.service.vo; - -import cn.hutool.core.util.ObjectUtil; -import lombok.Data; -import lombok.NoArgsConstructor; -import me.zhengjie.entity.LoginIp; -import me.zhengjie.utils.DateUtil; - -import java.time.LocalDateTime; - -/* - * - * @Description - * @Date 2022/3/21 - * @Author zeng - */ -@Data -@NoArgsConstructor -public class LoginIpVO extends LoginIp { - - // 状态 1:正常 0:失效 - private Integer status; - - - public String getIp() { - StringBuffer sbf = new StringBuffer(getIpStart()); - if (sbf.length() > 0) { - sbf.append("~"); - } - sbf.append(getIpEnd()); - return sbf.toString(); - } - - public Integer getStatus() { - if (ObjectUtil.isNotEmpty(getVaildTime())) { - LocalDateTime localDateTime = DateUtil.parseLocalDateTimeFormatyMdHms(getVaildTime()); - if (localDateTime.isBefore(LocalDateTime.now())) { - return 0; - } - return 1; - } - return 1; - } - - public LoginIpVO(LoginIp loginIp) { - setId(loginIp.getId()); - setIpStart(loginIp.getIpStart()); - setIpEnd(loginIp.getIpEnd()); - setCreatedAt(loginIp.getCreatedAt()); - setUpdatedAt(loginIp.getUpdatedAt()); - setGmName(loginIp.getGmName()); - setRemark(loginIp.getRemark()); - setVaildTime(loginIp.getVaildTime()); - } - - -} diff --git a/wjcy-common/src/main/java/me/zhengjie/service/vo/OrderResponStatusVO.java b/wjcy-common/src/main/java/me/zhengjie/service/vo/OrderResponStatusVO.java deleted file mode 100644 index 73ed2c5..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/vo/OrderResponStatusVO.java +++ /dev/null @@ -1,21 +0,0 @@ -package me.zhengjie.service.vo; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * 订单下单模块响应Status对象VO - * - * @author rch - * @create 2022-06-27 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class OrderResponStatusVO { - private String code; - private String message; - private String solution; - private OrderResponSubErrorVO subErrors; -} diff --git a/wjcy-common/src/main/java/me/zhengjie/service/vo/OrderResponSubErrorVO.java b/wjcy-common/src/main/java/me/zhengjie/service/vo/OrderResponSubErrorVO.java deleted file mode 100644 index fcf8b58..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/vo/OrderResponSubErrorVO.java +++ /dev/null @@ -1,19 +0,0 @@ -package me.zhengjie.service.vo; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * 敦煌接口响应SubError - * - * @author rch - * @create 2022-06-27 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class OrderResponSubErrorVO { - private String code; - private String message; -} diff --git a/wjcy-common/src/main/java/me/zhengjie/service/vo/OrderResponseVO.java b/wjcy-common/src/main/java/me/zhengjie/service/vo/OrderResponseVO.java deleted file mode 100644 index 7c69e07..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/vo/OrderResponseVO.java +++ /dev/null @@ -1,28 +0,0 @@ -package me.zhengjie.service.vo; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.List; - -/** - * 敦煌订单下单响应订单信息 - * - * @author rch - * @create 2022-06-27 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class OrderResponseVO { - - /** 接口响应订单信息 订单信息 */ - private BuyOrderResponseOrderVO orderInfo; - - /** 接口响应订单信息 订单产品信息 */ - private List cartList; - - /** 接口响应订单信息 订单收件地址信息 */ - private BuyOrderResponseAddressVO orderContactInfo; -} diff --git a/wjcy-common/src/main/java/me/zhengjie/service/vo/PayOrderVO.java b/wjcy-common/src/main/java/me/zhengjie/service/vo/PayOrderVO.java deleted file mode 100644 index d623fdc..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/vo/PayOrderVO.java +++ /dev/null @@ -1,23 +0,0 @@ -package me.zhengjie.service.vo; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * 支付下单API响应对象 - * - * @author rch - * @create 2022-06-27 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class PayOrderVO { - - /** 接口响应状态 响应码 响应内容等信息*/ - private OrderResponStatusVO status; - /** 接口响应订单信息 */ - private String result; - private String message; -} diff --git a/wjcy-common/src/main/java/me/zhengjie/service/vo/SettingSiteVO.java b/wjcy-common/src/main/java/me/zhengjie/service/vo/SettingSiteVO.java deleted file mode 100644 index afa4d11..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/vo/SettingSiteVO.java +++ /dev/null @@ -1,31 +0,0 @@ -package me.zhengjie.service.vo; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * 站点配置(SettingSiteVO)表 响应类 - * - * @author zeng - * @since 2020-07-13 10:07:39 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class SettingSiteVO { - - private Long id; - - /** 设置KEY */ - private String settingKey; - - /** 设置value */ - private String settingValue; - - /** 中文描述 */ - private String content; - - /** 单位 */ - private String unit; -} \ No newline at end of file diff --git a/wjcy-common/src/main/java/me/zhengjie/service/vo/SysQuartzJobListVO.java b/wjcy-common/src/main/java/me/zhengjie/service/vo/SysQuartzJobListVO.java deleted file mode 100644 index 282b4a6..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/vo/SysQuartzJobListVO.java +++ /dev/null @@ -1,40 +0,0 @@ -package me.zhengjie.service.vo; - -import com.baomidou.mybatisplus.annotation.FieldFill; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * 影刀任务表(sys_quartz_job)表实体类 分页查询VO - * @author zhw - * @since 2022-07-21 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class SysQuartzJobListVO { - - /** 任务ID */ - private Long jobId; - /** 任务名称 */ - private String jobName; - /** Spring Bean名称 */ - private String beanName; - /** 方法名称 */ - private String methodName; - /** 参数 */ - private String params; - /** cron 表达式 */ - private String cronExpression; - /** 状态:1暂停、0启用 */ - private Integer isPause; - /** 备注 */ - private String description; - /** 创建时间 */ - private String createTime; - -} diff --git a/wjcy-common/src/main/java/me/zhengjie/service/vo/SysQuartzLogListVO.java b/wjcy-common/src/main/java/me/zhengjie/service/vo/SysQuartzLogListVO.java deleted file mode 100644 index 8b79777..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/vo/SysQuartzLogListVO.java +++ /dev/null @@ -1,47 +0,0 @@ -package me.zhengjie.service.vo; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.math.BigDecimal; -import java.sql.Timestamp; - -/** - * 买家信息表(sys_quartz_log)表实体类 分页查询Detail - * - * @author rch - * @since 2022-07-09 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class SysQuartzLogListVO { - - private Long logId; - /** bean名称 */ - private String beanName; - /** 任务名称 */ - private String jobName; - /** 方法名称 */ - private String methodName; - - /** 参数 */ - private String params; - - /** cron表达式 */ - private String cronExpression; - - /** 状态 */ - private Integer isSuccess; - - /** 异常详情 */ - private String exceptionDetail; - - /** 执行耗时 */ - private Long time; - - /** 创建时间 */ - private Timestamp createTime; -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/service/vo/dhaddcar/DhAddCarListVO.java b/wjcy-common/src/main/java/me/zhengjie/service/vo/dhaddcar/DhAddCarListVO.java deleted file mode 100644 index b8ea1ec..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/vo/dhaddcar/DhAddCarListVO.java +++ /dev/null @@ -1,80 +0,0 @@ -package me.zhengjie.service.vo.dhaddcar; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import javax.validation.constraints.NotNull; -import java.util.Date; - -/** - * 敦煌加购信息 DTO - * - * @author rch - * @create 2022-11-17 - */ - -@Data -@AllArgsConstructor -@NoArgsConstructor -@ApiModel("敦煌加购信息") -public class DhAddCarListVO { - - /** ID */ - @ApiModelProperty(value = "ID", required = true) - private Long id; - - /** 商品属性类型:1.关键词 2.链接 */ - @ApiModelProperty(value = "商品属性类型:1.关键词 2.链接", required = true, allowableValues = "1,2") - private Integer paramsType; - - /** 买家ID */ - @ApiModelProperty(value = "买家ID", required = true) - private Integer buyerId; - - /** 账号 */ - @ApiModelProperty(value = "账号") - private String account; - - /** 公司名称 */ - @ApiModelProperty(value = "公司名称") - private String companyName; - - /** 国家 */ - @ApiModelProperty(value = "国家") - private String country; - - /** 加购物车商品ids */ - @ApiModelProperty(value = "加购物车商品ids") - private String carGoodIds; - - /** 执行结果 */ - @ApiModelProperty(value = "执行结果") - private String response; - - /** 状态 1.待执行 2.执行中 3.加购成功 4.加购失败 5.下单成功 6.支付成功 7.抓单成功 8.抓单失败 */ - @ApiModelProperty(value = "状态 1.待执行 2.执行中 3.加购成功 4.加购失败 5.下单成功 6.支付成功 7.抓单成功 8.抓单失败") - private Integer status; - - /** 创建时间 */ - @ApiModelProperty(value = "创建时间") - private Date createdAt; - - /** 修改时间 */ - @ApiModelProperty(value = "修改时间") - private Date updatedAt; - - /** 操作人账号 */ - @ApiModelProperty(value = "操作人账号") - private String gmName; - -// /** 加购物车商品ids */ -// @ApiModelProperty(value = "加购物车商品ids") -// private List carGoodKeys; -// -// /** 加购物车商品ids */ -// @ApiModelProperty(value = "加购物车商品ids") -// private List carGoodLinks; -} diff --git a/wjcy-common/src/main/java/me/zhengjie/service/vo/dhaddcar/DhAddCarVO.java b/wjcy-common/src/main/java/me/zhengjie/service/vo/dhaddcar/DhAddCarVO.java deleted file mode 100644 index 1db1917..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/vo/dhaddcar/DhAddCarVO.java +++ /dev/null @@ -1,65 +0,0 @@ -package me.zhengjie.service.vo.dhaddcar; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; -import me.zhengjie.service.vo.dhcargood.DhCarGoodKeyVO; -import me.zhengjie.service.vo.dhcargood.DhCarGoodLinkVO; - -import java.util.List; - -/** - * 敦煌加购Exit信息 DTO - * - * @author rch - * @create 2022-07-09 - */ - -@Data -@AllArgsConstructor -@NoArgsConstructor -@ApiModel("修改敦煌加购信息回显") -public class DhAddCarVO { - - /** ID */ - @ApiModelProperty(value = "ID", required = true) - private Long id; - - /** 商品属性类型:1.关键词 2.链接 */ - @ApiModelProperty(value = "商品属性类型:1.关键词 2.链接") - private Integer paramsType; - @ApiModelProperty(value = "公司名称", required = true) - private String companyName; - /** 买家ID */ - @ApiModelProperty(value = "买家ID", required = true) - private Integer buyerId; - /** 买家账号 */ - @ApiModelProperty(value = "买家账号", required = true) - private String account; - /** 国家 */ - @ApiModelProperty(value = "国家", required = true) - private String country; - /** 密码 */ - @ApiModelProperty(value = "密码", required = true) - private String pwd; - /** vpn分享链接 */ - private String vpnShare; - - /** 加购物车商品ids */ - @ApiModelProperty(value = "加购物车商品ids") - private String carGoodIds; - - /** 加购物车商品ids */ - @ApiModelProperty(value = "加购物车商品ids") - private List carGoodKeys; - - /** 加购物车商品ids */ - @ApiModelProperty(value = "加购物车商品ids") - private List carGoodLinks; - - /** 状态 1.待执行 2.执行中 3.加购成功 4.加购失败 5.下单成功 6.支付成功 7.抓单成功 8.抓单失败 */ - @ApiModelProperty(value = "状态 1.待执行 2.执行中 3.加购成功 4.加购失败 5.下单成功 6.支付成功 7.抓单成功 8.抓单失败") - private Integer status; -} diff --git a/wjcy-common/src/main/java/me/zhengjie/service/vo/dhaddcar/DhAddCarYdParamsVO.java b/wjcy-common/src/main/java/me/zhengjie/service/vo/dhaddcar/DhAddCarYdParamsVO.java deleted file mode 100644 index acd8943..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/vo/dhaddcar/DhAddCarYdParamsVO.java +++ /dev/null @@ -1,56 +0,0 @@ -package me.zhengjie.service.vo.dhaddcar; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; -import me.zhengjie.service.vo.dhcargood.DhCarGoodKeyVO; -import me.zhengjie.service.vo.dhcargood.DhCarGoodLinkVO; - -import java.util.List; - -/** - * 敦煌加购 影刀参数信息 DTO - * - * @author rch - * @create 2022-07-09 - */ - -@Data -@AllArgsConstructor -@NoArgsConstructor -@ApiModel("修改敦煌加购信息回显") -public class DhAddCarYdParamsVO { - - /** ID */ - @ApiModelProperty(value = "ID", required = true) - private Long id; - - /** 商品属性类型:1.关键词 2.链接 */ - @ApiModelProperty(value = "商品属性类型:1.关键词 2.链接") - private Integer paramsType; - - /** 买家账号 */ - @ApiModelProperty(value = "买家账号", required = true) - private String account; - - /** 国家 */ - @ApiModelProperty(value = "国家", required = true) - private String country; - - /** 密码 */ - @ApiModelProperty(value = "密码", required = true) - private String pwd; - - /** vpn分享链接 */ - private String vpnShare; - - /** 加购物车商品ids */ - @ApiModelProperty(value = "加购物车商品ids") - private List carGoodKeys; - - /** 加购物车商品ids */ - @ApiModelProperty(value = "加购物车商品ids") - private List carGoodLinks; -} diff --git a/wjcy-common/src/main/java/me/zhengjie/service/vo/dhcargood/DhCarGoodKeyVO.java b/wjcy-common/src/main/java/me/zhengjie/service/vo/dhcargood/DhCarGoodKeyVO.java deleted file mode 100644 index 3c8a789..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/vo/dhcargood/DhCarGoodKeyVO.java +++ /dev/null @@ -1,76 +0,0 @@ -package me.zhengjie.service.vo.dhcargood; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.Null; - -/** - * 敦煌-加购商品(根据关键词) VO - * - * @author rch - * @create 2022-07-09 - */ - -@Data -@AllArgsConstructor -@NoArgsConstructor -@ApiModel("敦煌-加购商品(根据关键词)") -public class DhCarGoodKeyVO { - - /** ID */ - @ApiModelProperty(value = "ID", required = true) - private Long id; - - /** 商品属性类型:1.关键词 2.链接 */ - @ApiModelProperty(value = "商品属性类型:1.关键词 2.链接", required = true, allowableValues = "1,2") - private Integer paramsType; - - /** 店铺名称 */ - @ApiModelProperty(value = "NotBlank", required = true) - private String shopName; - - /** 关键词 */ - @ApiModelProperty(value = "关键词", required = true) - private String keyWord; - - /** 标题 */ - @ApiModelProperty(value = "标题", required = true) - private String title; - - /** 数量 */ - @ApiModelProperty(value = "数量", required = true) - private Integer number; - - /** 规格 */ - @ApiModelProperty(value = "规格") - private String specification; - - /** 颜色 */ - @ApiModelProperty(value = "颜色") - private String color; - - /** item */ - @ApiModelProperty(value = "item", required = true) - private String item; - - /** 最小价格区间 */ - @ApiModelProperty(value = "最小价格区间") - private String sectionMin; - - /** 最大价格区间 */ - @ApiModelProperty(value = "最大价格区间") - private String sectionMax; - - /** 评论 */ - @ApiModelProperty(value = "评论") - private String comment; - - /** 图片url */ - @ApiModelProperty(value = "图片url") - private String paths; -} diff --git a/wjcy-common/src/main/java/me/zhengjie/service/vo/dhcargood/DhCarGoodLinkVO.java b/wjcy-common/src/main/java/me/zhengjie/service/vo/dhcargood/DhCarGoodLinkVO.java deleted file mode 100644 index 0a6005e..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/vo/dhcargood/DhCarGoodLinkVO.java +++ /dev/null @@ -1,56 +0,0 @@ -package me.zhengjie.service.vo.dhcargood; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.Null; - -/** - * 敦煌-加购商品(根据链接) VO - * - * @author rch - * @create 2022-07-09 - */ - -@Data -@AllArgsConstructor -@NoArgsConstructor -@ApiModel("敦煌-加购商品(根据链接)") -public class DhCarGoodLinkVO { - - /** ID */ - @ApiModelProperty(value = "ID", required = true) - private Long id; - - /** 商品属性类型:1.关键词 2.链接 */ - @ApiModelProperty(value = "商品属性类型:1.关键词 2.链接", required = true, allowableValues = "1,2") - private Integer paramsType; - - /** 链接 */ - @ApiModelProperty(value = "链接", required = true) - private String link; - - /** 数量 */ - @ApiModelProperty(value = "数量", required = true) - private Integer number; - - /** 规格 */ - @ApiModelProperty(value = "规格", required = true) - private String specification; - - /** 颜色 */ - @ApiModelProperty(value = "颜色", required = true) - private String color; - - /** 评论 */ - @ApiModelProperty(value = "评论") - private String comment; - - /** 图片url */ - @ApiModelProperty(value = "图片url") - private String paths; -} diff --git a/wjcy-common/src/main/java/me/zhengjie/service/vo/dhcarorder/DhAddCarOrderListVO.java b/wjcy-common/src/main/java/me/zhengjie/service/vo/dhcarorder/DhAddCarOrderListVO.java deleted file mode 100644 index c8920e4..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/vo/dhcarorder/DhAddCarOrderListVO.java +++ /dev/null @@ -1,62 +0,0 @@ -package me.zhengjie.service.vo.dhcarorder; - -import com.baomidou.mybatisplus.annotation.FieldFill; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.Date; - -/** - * 敦煌加购订单信息 DTO - * - * @author rch - * @create 2022-12-01 - */ - -@Data -@AllArgsConstructor -@NoArgsConstructor -@ApiModel("敦煌加购信息") -public class DhAddCarOrderListVO { - - @ApiModelProperty(value = "ID") - private Long id; - @ApiModelProperty(value = "创建时间") - private String createdAt; - @ApiModelProperty(value = "修改时间") - private String updatedAt; - /** 操作人账号*/ - @ApiModelProperty(value = "操作人") - private String gmName; - - /** 1.导入 2.刷单 */ - @ApiModelProperty(value = "类型 1.导入 2.刷单") - private Integer type; - /** 关联敦煌加购的id */ - @ApiModelProperty(value = "关联敦煌加购的id") - private Long addCarId; - /** 总金额 */ - @ApiModelProperty(value = "总金额") - private String amount; - /** 状态描述 */ - @ApiModelProperty(value = "状态描述") - private String paymentResults; - /** 店铺名称 */ - @ApiModelProperty(value = "店铺名称") - private String shop; - /** 订单id */ - @ApiModelProperty(value = "订单id") - private String orderId; - /** 时间 */ - @ApiModelProperty(value = "订单时间") - private String orderDate; - /** 状态 1.待执行 2.执行中 3.执行成功 4.执行失败 */ - @ApiModelProperty(value = "状态 1.待执行 2.执行中 3.执行成功 4.执行失败") - private Integer status; -} diff --git a/wjcy-common/src/main/java/me/zhengjie/service/vo/dhcarorder/DhCarOrderParamsVO.java b/wjcy-common/src/main/java/me/zhengjie/service/vo/dhcarorder/DhCarOrderParamsVO.java deleted file mode 100644 index ad98173..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/service/vo/dhcarorder/DhCarOrderParamsVO.java +++ /dev/null @@ -1,59 +0,0 @@ -package me.zhengjie.service.vo.dhcarorder; - -import io.swagger.annotations.ApiModelProperty; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; -import me.zhengjie.service.vo.dhcargood.DhCarGoodKeyVO; -import me.zhengjie.service.vo.dhcargood.DhCarGoodLinkVO; - -import java.util.List; - -/** - * 敦煌加购好评-影刀参数 - * - * @author rch - * @create 2022-12-01 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class DhCarOrderParamsVO { - /** ID */ - @ApiModelProperty(value = "ID", required = true) - private Long id; - - /** 商品属性类型:1.关键词 2.链接 */ - @ApiModelProperty(value = "商品属性类型:1.关键词 2.链接") - private Integer paramsType; - - /** 买家账号 */ - @ApiModelProperty(value = "买家账号", required = true) - private String account; - - /** 国家 */ - @ApiModelProperty(value = "国家", required = true) - private String country; - - /** 密码 */ - @ApiModelProperty(value = "密码", required = true) - private String pwd; - - /** vpn分享链接 */ - private String vpnShare; - - /** 订单ID */ - private String orderId; - - /** 加购物车商品ids */ - @ApiModelProperty(value = "加购物车商品ids") - private String carGoodIds; - - /** 加购物车商品ids */ - @ApiModelProperty(value = "加购物车商品ids") - private List carGoodKeys; - - /** 加购物车商品ids */ - @ApiModelProperty(value = "加购物车商品ids") - private List carGoodLinks; -} diff --git a/wjcy-common/src/main/java/me/zhengjie/utils/CacheKey.java b/wjcy-common/src/main/java/me/zhengjie/utils/CacheKey.java deleted file mode 100644 index 7485713..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/utils/CacheKey.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright 2019-2020 the original author or authors. - * - * 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 me.zhengjie.utils; - -/** - * @author: liaojinlong - * @date: 2020/6/11 15:49 - * @apiNote: 关于缓存的Key集合 - */ -public interface CacheKey { - - /** - * 用户 - */ - String USER_ID = "user::id:"; - /** - * 数据 - */ - String DATA_USER = "data::user:"; - /** - * 菜单 - */ - String MENU_ID = "menu::id:"; - String MENU_USER = "menu::user:"; - /** - * 角色授权 - */ - String ROLE_AUTH = "role::auth:"; - /** - * 角色信息 - */ - String ROLE_ID = "role::id:"; - /** - * 部门 - */ - String DEPT_ID = "dept::id:"; - /** - * 岗位 - */ - String JOB_ID = "job::id:"; - /** - * 数据字典 - */ - String DICT_NAME = "dict::name:"; -} diff --git a/wjcy-common/src/main/java/me/zhengjie/utils/CallBack.java b/wjcy-common/src/main/java/me/zhengjie/utils/CallBack.java deleted file mode 100644 index 9b10812..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/utils/CallBack.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2019-2020 the original author or authors. - * - * 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 me.zhengjie.utils; - -/** - * @author: liaojinlong - * @date: 2020/6/9 17:02 - * @since: 1.0 - * @see {@link SpringContextHolder} - * 针对某些初始化方法,在SpringContextHolder 初始化前时,
- * 可提交一个 提交回调任务。
- * 在SpringContextHolder 初始化后,进行回调使用 - */ - -public interface CallBack { - /** - * 回调执行方法 - */ - void executor(); - - /** - * 本回调任务名称 - * @return / - */ - default String getCallBackName() { - return Thread.currentThread().getId() + ":" + this.getClass().getName(); - } -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/utils/CheckPwdValidator.java b/wjcy-common/src/main/java/me/zhengjie/utils/CheckPwdValidator.java deleted file mode 100644 index 2f10dca..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/utils/CheckPwdValidator.java +++ /dev/null @@ -1,35 +0,0 @@ -package me.zhengjie.utils; - -import cn.hutool.core.util.ObjectUtil; -import me.zhengjie.annotation.CheckPwd; - -import javax.validation.ConstraintValidator; -import javax.validation.ConstraintValidatorContext; -import java.util.regex.Pattern; - -/* - * - * @Description - * @Date 2022/3/21 - * @Author zeng - */ -public class CheckPwdValidator implements ConstraintValidator { - - private CheckPwd checkPwd; - - public static final String p = "^(?=.*\\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[~@#$%\\*-\\+=:,\\\\?\\[\\]\\{}]).{16,64}$"; - - - @Override - public void initialize(CheckPwd constraintAnnotation) { - this.checkPwd = constraintAnnotation; - } - - @Override - public boolean isValid(String value, ConstraintValidatorContext constraintValidatorContext) { - if (ObjectUtil.isEmpty(value)) { - return true; - } - return Pattern.matches(p, value); - } -} diff --git a/wjcy-common/src/main/java/me/zhengjie/utils/CloseUtil.java b/wjcy-common/src/main/java/me/zhengjie/utils/CloseUtil.java deleted file mode 100644 index 98d375b..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/utils/CloseUtil.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.utils; - -import java.io.Closeable; - -/** - * @author Zheng Jie - * @website https://el-admin.vip - * @description 用于关闭各种连接,缺啥补啥 - * @date 2021-03-05 - **/ -public class CloseUtil { - - public static void close(Closeable closeable) { - if (null != closeable) { - try { - closeable.close(); - } catch (Exception e) { - // 静默关闭 - } - } - } - - public static void close(AutoCloseable closeable) { - if (null != closeable) { - try { - closeable.close(); - } catch (Exception e) { - // 静默关闭 - } - } - } -} diff --git a/wjcy-common/src/main/java/me/zhengjie/utils/CronUtils.java b/wjcy-common/src/main/java/me/zhengjie/utils/CronUtils.java deleted file mode 100644 index 14728f8..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/utils/CronUtils.java +++ /dev/null @@ -1,49 +0,0 @@ -package me.zhengjie.utils; - -import java.time.LocalDateTime; -import java.time.format.DateTimeFormatter; - -/** - * 时间日期转cron工具类 - * Spring Task是Quartz的弱版,Quartz支持年份,而Spring Task不支持。Spring Task是6位, - * Quartz可以7位,本代码是基于hutool工具的表达式,是可以支持Quartz。 - * @author rch - * @create 2022-10-06 - */ -public class CronUtils { - - - /** - * 仅一次 - * @param dateStr - * @return - */ - public static String onlyOnce(String dateStr) { - LocalDateTime time = LocalDateTime.parse(dateStr, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); - String cronStr = time.format(DateTimeFormatter.ofPattern("ss mm HH dd MM ? yyyy")); - return cronStr; - } - - /** - * 每天 - * @param timeStr - * @return - */ - public static String everyDay(String timeStr) { - LocalDateTime time = LocalDateTime.parse(timeStr, DateTimeFormatter.ofPattern("HH:mm:ss")); - String cronStr = time.format(DateTimeFormatter.ofPattern("ss mm HH dd * * ?")); - return cronStr; - } - - - /** - * 每周 - * @param timeStr - * @return - */ - public static String everyWeek(String timeStr, String week) { - LocalDateTime time = LocalDateTime.parse(timeStr, DateTimeFormatter.ofPattern("HH:mm:ss")); - String cronStr = time.format(DateTimeFormatter.ofPattern("ss mm HH ? * " + week)); - return cronStr; - } -} diff --git a/wjcy-common/src/main/java/me/zhengjie/utils/DateTimeValidator.java b/wjcy-common/src/main/java/me/zhengjie/utils/DateTimeValidator.java deleted file mode 100644 index 1d22b75..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/utils/DateTimeValidator.java +++ /dev/null @@ -1,46 +0,0 @@ -package me.zhengjie.utils; - - -import cn.hutool.core.util.ObjectUtil; -import me.zhengjie.annotation.DateTime; - -import javax.validation.ConstraintValidator; -import javax.validation.ConstraintValidatorContext; -import java.text.SimpleDateFormat; -/** - *

- * 日期格式效验 - *

- * - * @Author xx - * @Date 2021/7/27 - **/ -public class DateTimeValidator implements ConstraintValidator { - private DateTime dateTime; - - @Override - public void initialize(DateTime dateTime) { - this.dateTime = dateTime; - } - - @Override - public boolean isValid(String value, ConstraintValidatorContext context) { - if (ObjectUtil.isEmpty(value)) { - return true; - } - String format = dateTime.format(); - - if (value.length() != format.length()) { - return false; - } - - SimpleDateFormat simpleDateFormat = new SimpleDateFormat(format); - - try { - simpleDateFormat.parse(value); - } catch (Exception e) { - return false; - } - return true; - } -} diff --git a/wjcy-common/src/main/java/me/zhengjie/utils/DateUtil.java b/wjcy-common/src/main/java/me/zhengjie/utils/DateUtil.java deleted file mode 100644 index 3df2210..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/utils/DateUtil.java +++ /dev/null @@ -1,555 +0,0 @@ -/* - * Copyright 2019-2020 the original author or authors. - * - * 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 me.zhengjie.utils; - -import cn.hutool.core.util.ObjectUtil; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.time.*; -import java.time.format.DateTimeFormatter; -import java.util.*; - -/** - * @author: liaojinlong - * @date: 2020/6/11 16:28 - * @apiNote: JDK 8 新日期类 格式化与字符串转换 工具类 - */ -public class DateUtil { - - private static final Logger LOGGER = LoggerFactory.getLogger(DateUtil.class); - - public static final DateTimeFormatter DFY_MD_HMS = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); - public static final DateTimeFormatter DFY_MD = DateTimeFormatter.ofPattern("yyyy-MM-dd"); - - - /** - * - * 判断某个时间是否在某个时间段内 - * @ xxs - * @param date 待比较的时间 - * @param format 时间格式,eg("HH:mm") - * @param startTimeStr 时间范围的开始时间,eg("06:00") - * @param endTimeStr 时间范围的结束时间,eg("22:00") - * - * */ - public static Boolean isBelong(Date date, String format, String startTimeStr, String endTimeStr){ - //设置日期格式 - SimpleDateFormat df = new SimpleDateFormat(format); - Date beginTime = null; - Date endTime = null; - try { - date = df.parse(df.format(date)); - beginTime = df.parse(startTimeStr); - endTime = df.parse(endTimeStr); - } catch (Exception e) { - e.printStackTrace(); - } - - return belongCalendar(date, beginTime, endTime); - } - - - - /** - * 判断时间是否在时间段内 - * @xxs - * @param nowTime - * @param beginTime - * @param endTime - * @return - */ - public static boolean belongCalendar(Date nowTime, Date beginTime, Date endTime) { - Calendar date = Calendar.getInstance(); - date.setTime(nowTime); - - Calendar begin = Calendar.getInstance(); - begin.setTime(beginTime); - - Calendar end = Calendar.getInstance(); - end.setTime(endTime); - - if (date.after(begin) && date.before(end)) { - return true; - } else { - return false; - } - } - - /** - * 比较两日期格式大小(最新的时间靠前) - * 1: time1time2 - * 0: time1=time2 - * null time1 or time2 日期格式错误 - * - * @param time1 yyyy-MM-dd HH:mm:ss - * @param time2 yyyy-MM-dd HH:mm:ss - * @return - */ - public static Integer compareDate(String time1, String time2) { - try { - LocalDateTime t1 = parseLocalDateTimeFormatyMdHms(time1); - LocalDateTime t2 = parseLocalDateTimeFormatyMdHms(time2); - Long timeStamp1 = getTimeStamp(t1); - Long timeStamp2 = getTimeStamp(t2); - if (timeStamp1 < timeStamp2) { - return 1; - } - if (timeStamp1 > timeStamp2) { - return -1; - } - if (timeStamp1.equals(timeStamp2)) { - return 0; - } - } catch (Exception e) {} - return null; - } - - /** - * 获得指定日期的前一天 - * - * @param specifiedDay - * @return - * @throws Exception - */ - public static String getSpecifiedDayBefore(String specifiedDay) { - Calendar c = Calendar.getInstance(); - Date date = null; - try { - date = new SimpleDateFormat("yy-MM-dd").parse(specifiedDay); - } catch (ParseException e) { - e.printStackTrace(); - } - c.setTime(date); - int day = c.get(Calendar.DATE); - c.set(Calendar.DATE, day - 1); - - String dayBefore = new SimpleDateFormat("yyyy-MM-dd").format(c.getTime()); - return dayBefore; - } - - /** - * 获取今日查询时间 - * - * @return - */ - public static Map getTodayDate(String time) { - Map map = new HashMap(16); - map.put("stime", time + " 00:00:00"); - map.put("etime", time + " 23:59:59"); - return map; - } - - - /** - * 根据发送时间获取有效截止时间 - * - * @param sendTime yyyy-MM-dd HH:mm:ss - * @param days 有效天数 - * @return - */ - public static LocalDate getExpiryDate(String sendTime, Integer days) { - if (ObjectUtil.isEmpty(sendTime)) { - sendTime = getCurrentTime(); - } - return LocalDate.parse(sendTime, DFY_MD_HMS) - .plusDays(days); - } - - /** - * 将年月日时分秒的各种转为cron表达式 - * - * @param time - * @return - */ - public static String toCronString(String time) { - LocalDateTime dateTime = LocalDateTime.parse(time, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); - return dateTime.getSecond() + " " + dateTime.getMinute() + " " + dateTime.getHour() + " " - + dateTime.getDayOfMonth() + " " + dateTime.getMonthValue() + " ? " + dateTime.getYear(); - } - - /** - * 获取当时时间 yyyy-MM-dd HH:mm:ss格式 - * - * @return - */ - public static String getCurrentTime() { - return localDateTimeFormatyMdHms(LocalDateTime.now()); - } - - /** - * 获取系统当前时间 - * - * @return 系统当前时间(年月日) - */ - public static String getCurrentDateHalf() { - SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); - String date = simpleDateFormat.format(new Date()); - return date; - } - /** - * 获取系统未来某天的日期 - * - * @return 系统昨天时间(年月日) - */ - public static String getFutrueDateHalf(Integer day) { - SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); - String date = simpleDateFormat.format(new Date()); - Calendar calendar = new GregorianCalendar(); - calendar.setTime(new Date()); - calendar.add(Calendar.DATE, day); - return simpleDateFormat.format(calendar.getTime()); - } - /** - * 获取系统前12小时时间 - * - * @return 系统前12小时时间(年月日) - */ - public static String getCurrentTimeBeforeTwHour() { - SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - String date = simpleDateFormat.format(new Date()); - Calendar calendar = new GregorianCalendar(); - calendar.setTime(new Date()); - calendar.add(Calendar.HOUR, -12); - return simpleDateFormat.format(calendar.getTime()); - } - /** - * 获取系统昨天时间 - * - * @return 系统昨天时间(年月日) - */ - public static String getYesterDateHalf() { - SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); - String date = simpleDateFormat.format(new Date()); - Calendar calendar = new GregorianCalendar(); - calendar.setTime(new Date()); - calendar.add(Calendar.DATE, -1); - return simpleDateFormat.format(calendar.getTime()); - } - /** - * 获取系统昨天时间 - * - * @return 系统昨天时间(年月日) - */ - public static String getAgoDateHalf(int i) { - SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); - String date = simpleDateFormat.format(new Date()); - Calendar calendar = new GregorianCalendar(); - calendar.setTime(new Date()); - calendar.add(Calendar.DATE, -i); - return simpleDateFormat.format(calendar.getTime()); - } - /** - * 获取系统昨天时间 - * - * @return 系统昨天时间(年月日) - */ - public static String getWeekAgoDateHalf() { - SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); - String date = simpleDateFormat.format(new Date()); - Calendar calendar = new GregorianCalendar(); - calendar.setTime(new Date()); - calendar.add(Calendar.DATE, -7); - return simpleDateFormat.format(calendar.getTime()); - } - /** - * 获取当时时间+10min yyyy-MM-dd HH:mm:ss格式 - * - * @return - */ - public static String getCurrentTimeAddTenMin() { - SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - String date = simpleDateFormat.format(new Date()); - Calendar calendar = new GregorianCalendar(); - calendar.setTime(new Date()); - calendar.add(Calendar.MINUTE, 10); - return simpleDateFormat.format(calendar.getTime()); - } - - /**获取后两分钟 - * @param startTime - * @return - */ - public static String getLaterTimeAddTwoMin(String startTime){ - - SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - Calendar calendar = new GregorianCalendar(); - try { - - calendar.setTime(new SimpleDateFormat("yyyy-MM-dd hh:mm:ss").parse(startTime)); - calendar.add(Calendar.MINUTE, 2); - } catch (Exception exception) { - LOGGER.error(exception.getMessage()); - } - return simpleDateFormat.format(calendar.getTime()); - } - /**获取前一天 - * @param startTime - * @return - */ - public static String getAgoTimeAddDay(String startTime){ - - SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - Calendar calendar = new GregorianCalendar(); - try { - - calendar.setTime(new SimpleDateFormat("yyyy-MM-dd hh:mm:ss").parse(startTime)); - calendar.add(Calendar.HOUR, -24); - } catch (Exception exception) { - LOGGER.error(exception.getMessage()); - } - return simpleDateFormat.format(calendar.getTime()); - } - /**获取后一天 - * @param startTime - * @return - */ - public static String getLaterTimeAddDay(String startTime){ - - SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - Calendar calendar = new GregorianCalendar(); - try { - - calendar.setTime(new SimpleDateFormat("yyyy-MM-dd hh:mm:ss").parse(startTime)); - calendar.add(Calendar.HOUR, 24); - } catch (Exception exception) { - LOGGER.error(exception.getMessage()); - } - return simpleDateFormat.format(calendar.getTime()); - } - /** 获取前十分钟 时间 - * @param startTime - * @return - */ - public static String getEarlyTimeAddTenMin(String startTime){ - - SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - Calendar calendar = new GregorianCalendar(); - try { - - calendar.setTime(new SimpleDateFormat("yyyy-MM-dd hh:mm:ss").parse(startTime)); - calendar.add(Calendar.MINUTE, -10); - } catch (Exception exception) { - LOGGER.error(exception.getMessage()); - } - return simpleDateFormat.format(calendar.getTime()); - } - - /** - * LocalDateTime 转时间戳 - * - * @param localDateTime / - * @return / - */ - public static Long getTimeStamp(LocalDateTime localDateTime) { - return localDateTime.atZone(ZoneId.systemDefault()).toEpochSecond(); - } - - /** - * 时间戳转LocalDateTime - * - * @param timeStamp / - * @return / - */ - public static LocalDateTime fromTimeStamp(Long timeStamp) { - return LocalDateTime.ofEpochSecond(timeStamp, 0, OffsetDateTime.now().getOffset()); - } - - /** - * LocalDateTime 转 Date - * Jdk8 后 不推荐使用 {@link Date} Date - * - * @param localDateTime / - * @return / - */ - public static Date toDate(LocalDateTime localDateTime) { - return Date.from(localDateTime.atZone(ZoneId.systemDefault()).toInstant()); - } - - /** - * LocalDate 转 Date - * Jdk8 后 不推荐使用 {@link Date} Date - * - * @param localDate / - * @return / - */ - public static Date toDate(LocalDate localDate) { - return toDate(localDate.atTime(LocalTime.now(ZoneId.systemDefault()))); - } - - - /** - * Date转 LocalDateTime - * Jdk8 后 不推荐使用 {@link Date} Date - * - * @param date / - * @return / - */ - public static LocalDateTime toLocalDateTime(Date date) { - return LocalDateTime.ofInstant(date.toInstant(), ZoneId.systemDefault()); - } - - /** - * 日期 格式化 - * - * @param localDateTime / - * @param patten / - * @return / - */ - public static String localDateTimeFormat(LocalDateTime localDateTime, String patten) { - DateTimeFormatter df = DateTimeFormatter.ofPattern(patten); - return df.format(localDateTime); - } - - /** - * 日期 格式化 - * - * @param localDateTime / - * @param df / - * @return / - */ - public static String localDateTimeFormat(LocalDateTime localDateTime, DateTimeFormatter df) { - return df.format(localDateTime); - } - - /** - * 日期格式化 yyyy-MM-dd HH:mm:ss - * - * @param localDateTime / - * @return / - */ - public static String localDateTimeFormatyMdHms(LocalDateTime localDateTime) { - return DFY_MD_HMS.format(localDateTime); - } - - /** - * 日期格式化 yyyy-MM-dd - * - * @param localDateTime / - * @return / - */ - public String localDateTimeFormatyMd(LocalDateTime localDateTime) { - return DFY_MD.format(localDateTime); - } - - /** - * 字符串转 LocalDateTime ,字符串格式 yyyy-MM-dd - * - * @param localDateTime / - * @return / - */ - public static LocalDateTime parseLocalDateTimeFormat(String localDateTime, String pattern) { - DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern(pattern); - return LocalDateTime.from(dateTimeFormatter.parse(localDateTime)); - } - - /** - * 字符串转 LocalDateTime ,字符串格式 yyyy-MM-dd - * - * @param localDateTime / - * @return / - */ - public static LocalDateTime parseLocalDateTimeFormat(String localDateTime, DateTimeFormatter dateTimeFormatter) { - return LocalDateTime.from(dateTimeFormatter.parse(localDateTime)); - } - - /** - * 字符串转 LocalDateTime ,字符串格式 yyyy-MM-dd HH:mm:ss - * - * @param localDateTime / - * @return / - */ - public static LocalDateTime parseLocalDateTimeFormatyMdHms(String localDateTime) { - return LocalDateTime.from(DFY_MD_HMS.parse(localDateTime)); - } - - /** - * 字符串转 LocalDate ,字符串格式 yyyy-MM-dd - * @param localDate - * @return - */ - public static LocalDate parseLocalDateFormatyMd(String localDate) { - return LocalDate.from(DFY_MD.parse(localDate)); - } - - /** - * 生成指定时间之前相聚 指定秒的一个时间并返回 - * 时间格式默认常规 年月日 时分秒: 2020-12-07 10:18:25 - * @param endTime - * @param min 相聚多少秒 - * @param max - * @return - */ - public static String getRandmo(String endTime, Integer min, Integer max) { - - if (min > max) { - return null; - } - - try { - SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); - Date endTimeDate = format.parse(endTime); - Random random = new Random(); - long time = random.nextInt(max - min + 1) + min; - Date newDate = new Date(endTimeDate .getTime() - time * 1000); - return format.format(newDate); - }catch (Exception exception) { - return null; - } - } - - /** - * @Description: 获取当天日期再查询日期区间的第几个位置,起始位置从0开始算 - * @Author: zeng - * @param stime - * @param etime - * @return: java.lang.Integer - */ - public static Long getDifferenceDayCount(String stime,String etime) { - if (!ObjectUtil.isAllNotEmpty(stime, etime)) { - return null; - } - LocalDate sLocalDate = parseLocalDateTimeFormatyMdHms(stime).toLocalDate(); - LocalDate eLocalDate = parseLocalDateTimeFormatyMdHms(etime).toLocalDate(); - - return Math.abs(eLocalDate.toEpochDay() - sLocalDate.toEpochDay())+1; - } - - - public static String getHour(long dt) { - //秒数 -// Integer dt = Integer.parseInt(date) ; - if (dt < 3600) { - return Math.round(dt / 60) + "分钟"; - } - int hour = Math.round(dt / 3600); - int minute = Math.round((dt - (hour * 3600)) / 60); - long s = dt - (hour == 0 ? 0 : hour * 3600) - (minute == 0 ? 0 : minute * 60); - return hour == 0 ? "" : hour + "小时" + (minute == 0 ? "" : minute + "分钟") + (s == 0 ? "" : s + "秒"); - - //分钟 -// Integer dt = Integer.parseInt(date) ; -// if (dt < 60) return dt + "分钟"; -// int hour = Math.round(dt / 60); -// int minute = Math.round(dt - (hour * 60)); -// return hour + "小时" + (minute == 0 ? "" : minute + "分钟"); - } - -} diff --git a/wjcy-common/src/main/java/me/zhengjie/utils/ElAdminConstant.java b/wjcy-common/src/main/java/me/zhengjie/utils/ElAdminConstant.java deleted file mode 100644 index 08f9c3c..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/utils/ElAdminConstant.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.utils; - -/** - * 常用静态常量 - * - * @author Zheng Jie - * @date 2018-12-26 - */ -public class ElAdminConstant { - - /** - * 用于IP定位转换 - */ - public static final String REGION = "内网IP|内网IP"; - /** - * win 系统 - */ - public static final String WIN = "win"; - - /** - * mac 系统 - */ - public static final String MAC = "mac"; - - /** - * 常用接口 - */ - public static class Url { - // IP归属地查询 - public static final String IP_URL = "http://whois.pconline.com.cn/ipJson.jsp?ip=%s&json=true"; - } -} diff --git a/wjcy-common/src/main/java/me/zhengjie/utils/EmptyAttributeFiler.java b/wjcy-common/src/main/java/me/zhengjie/utils/EmptyAttributeFiler.java deleted file mode 100644 index c7fdd93..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/utils/EmptyAttributeFiler.java +++ /dev/null @@ -1,76 +0,0 @@ -package me.zhengjie.utils; - - -import cn.hutool.core.util.ObjectUtil; -import lombok.extern.slf4j.Slf4j; - -import java.lang.reflect.Field; -import java.util.List; -/** - *

- * 将数据为空或空字符串的过滤为null(MyBatis 会将空字符串的值也持久化到数据库中) - *

- * - * @Author xx - * @Date 2021/7/19 - **/ -@Slf4j -public class EmptyAttributeFiler { - - /** - * 判断list的所有元素是否都为null - * @param list - * @return - */ - public static boolean isEmpty(List list) { - if (ObjectUtil.isEmpty(list)) { - return true; - } - for (Object o : list) { - if (ObjectUtil.isNotEmpty(o)) { - return false; - } - } - return true; - } - - public static T emptyAttributeFiler(T obj) { - Class clazz = obj.getClass(); - Field[] fields = clazz.getDeclaredFields(); - try { - for (Field field : fields) { - field.setAccessible(true); - if (ObjectUtil.isEmpty(field.get(obj))) { - field.set(obj, null); - } - } - } catch (Exception e) { - log.error("过滤值为空属性失败:" + e.getMessage(), e); - } - return obj; - } - - public static String emptyAttributeFilerToString(Object obj) { - Class clazz = obj.getClass(); - Field[] fields = clazz.getDeclaredFields(); - StringBuffer sbf = new StringBuffer("{"); - try { - int i = 0; - for (Field field : fields) { - field.setAccessible(true); - if (ObjectUtil.isNotEmpty(field.get(obj))) { - if (i != 0) { - sbf.append(","+field.getName() + ":" + field.get(obj)); - continue; - } - sbf.append(field.getName() + ":" + field.get(obj)); - i++; - } - } - } catch (Exception e) { - log.error("过滤值为空属性失败:" + e.getMessage(), e); - } - sbf.append("}"); - return sbf.toString().length()==2?"":sbf.toString(); - } -} diff --git a/wjcy-common/src/main/java/me/zhengjie/utils/EncryptUtils.java b/wjcy-common/src/main/java/me/zhengjie/utils/EncryptUtils.java deleted file mode 100644 index 4f334aa..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/utils/EncryptUtils.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.utils; - -import javax.crypto.Cipher; -import javax.crypto.SecretKey; -import javax.crypto.SecretKeyFactory; -import javax.crypto.spec.DESKeySpec; -import javax.crypto.spec.IvParameterSpec; -import java.nio.charset.StandardCharsets; - -/** - * 加密 - * @author Zheng Jie - * @date 2018-11-23 - */ - -public class EncryptUtils { - - private static final String STR_PARAM = "Passw0rd"; - - private static Cipher cipher; - - private static final IvParameterSpec IV = new IvParameterSpec(STR_PARAM.getBytes(StandardCharsets.UTF_8)); - - private static DESKeySpec getDesKeySpec(String source) throws Exception { - if (source == null || source.length() == 0){ - return null; - } - cipher = Cipher.getInstance("DES/CBC/PKCS5Padding"); - String strKey = "Passw0rd"; - return new DESKeySpec(strKey.getBytes(StandardCharsets.UTF_8)); - } - - /** - * 对称加密 - */ - public static String desEncrypt(String source) throws Exception { - DESKeySpec desKeySpec = getDesKeySpec(source); - SecretKeyFactory keyFactory = SecretKeyFactory.getInstance("DES"); - SecretKey secretKey = keyFactory.generateSecret(desKeySpec); - cipher.init(Cipher.ENCRYPT_MODE, secretKey, IV); - return byte2hex( - cipher.doFinal(source.getBytes(StandardCharsets.UTF_8))).toUpperCase(); - } - - /** - * 对称解密 - */ - public static String desDecrypt(String source) throws Exception { - byte[] src = hex2byte(source.getBytes(StandardCharsets.UTF_8)); - DESKeySpec desKeySpec = getDesKeySpec(source); - SecretKeyFactory keyFactory = SecretKeyFactory.getInstance("DES"); - SecretKey secretKey = keyFactory.generateSecret(desKeySpec); - cipher.init(Cipher.DECRYPT_MODE, secretKey, IV); - byte[] retByte = cipher.doFinal(src); - return new String(retByte); - } - - private static String byte2hex(byte[] inStr) { - String stmp; - StringBuilder out = new StringBuilder(inStr.length * 2); - for (byte b : inStr) { - stmp = Integer.toHexString(b & 0xFF); - if (stmp.length() == 1) { - // 如果是0至F的单位字符串,则添加0 - out.append("0").append(stmp); - } else { - out.append(stmp); - } - } - return out.toString(); - } - - private static byte[] hex2byte(byte[] b) { - int size = 2; - if ((b.length % size) != 0){ - throw new IllegalArgumentException("长度不是偶数"); - } - byte[] b2 = new byte[b.length / 2]; - for (int n = 0; n < b.length; n += size) { - String item = new String(b, n, 2); - b2[n / 2] = (byte) Integer.parseInt(item, 16); - } - return b2; - } -} diff --git a/wjcy-common/src/main/java/me/zhengjie/utils/FileUtil.java b/wjcy-common/src/main/java/me/zhengjie/utils/FileUtil.java deleted file mode 100644 index e8577d0..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/utils/FileUtil.java +++ /dev/null @@ -1,351 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.utils; - -import cn.hutool.core.io.IoUtil; -import cn.hutool.core.util.IdUtil; -import cn.hutool.poi.excel.BigExcelWriter; -import cn.hutool.poi.excel.ExcelUtil; -import me.zhengjie.exception.BadRequestException; -import org.apache.poi.util.IOUtils; -import org.apache.poi.xssf.streaming.SXSSFSheet; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.web.multipart.MultipartFile; -import javax.servlet.ServletOutputStream; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.*; -import java.security.MessageDigest; -import java.text.DecimalFormat; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.List; -import java.util.Map; - -/** - * File工具类,扩展 hutool 工具包 - * - * @author Zheng Jie - * @date 2018-12-27 - */ -public class FileUtil extends cn.hutool.core.io.FileUtil { - - private static final Logger log = LoggerFactory.getLogger(FileUtil.class); - - /** - * 系统临时目录 - *
- * windows 包含路径分割符,但Linux 不包含, - * 在windows \\==\ 前提下, - * 为安全起见 同意拼装 路径分割符, - *
-     *       java.io.tmpdir
-     *       windows : C:\Users/xxx\AppData\Local\Temp\
-     *       linux: /temp
-     * 
- */ - public static final String SYS_TEM_DIR = System.getProperty("java.io.tmpdir") + File.separator; - /** - * 定义GB的计算常量 - */ - private static final int GB = 1024 * 1024 * 1024; - /** - * 定义MB的计算常量 - */ - private static final int MB = 1024 * 1024; - /** - * 定义KB的计算常量 - */ - private static final int KB = 1024; - - /** - * 格式化小数 - */ - private static final DecimalFormat DF = new DecimalFormat("0.00"); - - public static final String IMAGE = "图片"; - public static final String TXT = "文档"; - public static final String MUSIC = "音乐"; - public static final String VIDEO = "视频"; - public static final String OTHER = "其他"; - - - /** - * MultipartFile转File - */ - public static File toFile(MultipartFile multipartFile) { - // 获取文件名 - String fileName = multipartFile.getOriginalFilename(); - // 获取文件后缀 - String prefix = "." + getExtensionName(fileName); - File file = null; - try { - // 用uuid作为文件名,防止生成的临时文件重复 - file = new File(SYS_TEM_DIR + IdUtil.simpleUUID() + prefix); - // MultipartFile to File - multipartFile.transferTo(file); - } catch (IOException e) { - log.error(e.getMessage(), e); - } - return file; - } - - /** - * 获取文件扩展名,不带 . - */ - public static String getExtensionName(String filename) { - if ((filename != null) && (filename.length() > 0)) { - int dot = filename.lastIndexOf('.'); - if ((dot > -1) && (dot < (filename.length() - 1))) { - return filename.substring(dot + 1); - } - } - return filename; - } - - /** - * Java文件操作 获取不带扩展名的文件名 - */ - public static String getFileNameNoEx(String filename) { - if ((filename != null) && (filename.length() > 0)) { - int dot = filename.lastIndexOf('.'); - if ((dot > -1) && (dot < (filename.length()))) { - return filename.substring(0, dot); - } - } - return filename; - } - - /** - * 文件大小转换 - */ - public static String getSize(long size) { - String resultSize; - if (size / GB >= 1) { - //如果当前Byte的值大于等于1GB - resultSize = DF.format(size / (float) GB) + "GB "; - } else if (size / MB >= 1) { - //如果当前Byte的值大于等于1MB - resultSize = DF.format(size / (float) MB) + "MB "; - } else if (size / KB >= 1) { - //如果当前Byte的值大于等于1KB - resultSize = DF.format(size / (float) KB) + "KB "; - } else { - resultSize = size + "B "; - } - return resultSize; - } - - /** - * inputStream 转 File - */ - public static File inputStreamToFile(InputStream ins, String name){ - File file = new File(SYS_TEM_DIR + name); - if (file.exists()) { - return file; - } - OutputStream os = null; - try { - os = new FileOutputStream(file); - int bytesRead; - int len = 8192; - byte[] buffer = new byte[len]; - while ((bytesRead = ins.read(buffer, 0, len)) != -1) { - os.write(buffer, 0, bytesRead); - } - } catch (Exception e) { - e.printStackTrace(); - } finally { - CloseUtil.close(os); - CloseUtil.close(ins); - } - return file; - } - - /** - * 将文件名解析成文件的上传路径 - */ - public static File upload(MultipartFile file, String filePath) { - Date date = new Date(); - SimpleDateFormat format = new SimpleDateFormat("yyyyMMddhhmmssS"); - String name = getFileNameNoEx(file.getOriginalFilename()); - String suffix = getExtensionName(file.getOriginalFilename()); - String nowStr = "-" + format.format(date); - try { - String fileName = name + nowStr + "." + suffix; - String path = filePath + fileName; - // getCanonicalFile 可解析正确各种路径 - File dest = new File(path).getCanonicalFile(); - // 检测是否存在目录 - if (!dest.getParentFile().exists()) { - if (!dest.getParentFile().mkdirs()) { - System.out.println("was not successful."); - } - } - // 文件写入 - file.transferTo(dest); - return dest; - } catch (Exception e) { - log.error(e.getMessage(), e); - } - return null; - } - - /** - * 导出excel - */ - public static void downloadExcel(List> list, HttpServletResponse response) throws IOException { - String tempPath = SYS_TEM_DIR + IdUtil.fastSimpleUUID() + ".xlsx"; - File file = new File(tempPath); - BigExcelWriter writer = ExcelUtil.getBigWriter(file); - // 一次性写出内容,使用默认样式,强制输出标题 - writer.write(list, true); - //response为HttpServletResponse对象 - response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8"); - //test.xls是弹出下载对话框的文件名,不能为中文,中文请自行编码 - response.setHeader("Content-Disposition", "attachment;filename=file.xlsx"); - ServletOutputStream out = response.getOutputStream(); - // 终止后删除临时文件 - file.deleteOnExit(); - writer.flush(out, true); - //此处记得关闭输出Servlet流 - IoUtil.close(out); - } - - public static String getFileType(String type) { - String documents = "txt doc pdf ppt pps xlsx xls docx"; - String music = "mp3 wav wma mpa ram ra aac aif m4a"; - String video = "avi mpg mpe mpeg asf wmv mov qt rm mp4 flv m4v webm ogv ogg"; - String image = "bmp dib pcp dif wmf gif jpg tif eps psd cdr iff tga pcd mpt png jpeg"; - if (image.contains(type)) { - return IMAGE; - } else if (documents.contains(type)) { - return TXT; - } else if (music.contains(type)) { - return MUSIC; - } else if (video.contains(type)) { - return VIDEO; - } else { - return OTHER; - } - } - - public static void checkSize(long maxSize, long size) { - // 1M - int len = 1024 * 1024; - if (size > (maxSize * len)) { - throw new BadRequestException("文件超出规定大小"); - } - } - - /** - * 判断两个文件是否相同 - */ - public static boolean check(File file1, File file2) { - String img1Md5 = getMd5(file1); - String img2Md5 = getMd5(file2); - if(img1Md5 != null){ - return img1Md5.equals(img2Md5); - } - return false; - } - - /** - * 判断两个文件是否相同 - */ - public static boolean check(String file1Md5, String file2Md5) { - return file1Md5.equals(file2Md5); - } - - private static byte[] getByte(File file) { - // 得到文件长度 - byte[] b = new byte[(int) file.length()]; - InputStream in = null; - try { - in = new FileInputStream(file); - try { - System.out.println(in.read(b)); - } catch (IOException e) { - log.error(e.getMessage(), e); - } - } catch (Exception e) { - log.error(e.getMessage(), e); - return null; - } finally { - CloseUtil.close(in); - } - return b; - } - - private static String getMd5(byte[] bytes) { - // 16进制字符 - char[] hexDigits = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'}; - try { - MessageDigest mdTemp = MessageDigest.getInstance("MD5"); - mdTemp.update(bytes); - byte[] md = mdTemp.digest(); - int j = md.length; - char[] str = new char[j * 2]; - int k = 0; - // 移位 输出字符串 - for (byte byte0 : md) { - str[k++] = hexDigits[byte0 >>> 4 & 0xf]; - str[k++] = hexDigits[byte0 & 0xf]; - } - return new String(str); - } catch (Exception e) { - log.error(e.getMessage(), e); - } - return null; - } - - /** - * 下载文件 - * - * @param request / - * @param response / - * @param file / - */ - public static void downloadFile(HttpServletRequest request, HttpServletResponse response, File file, boolean deleteOnExit) { - response.setCharacterEncoding(request.getCharacterEncoding()); - response.setContentType("application/octet-stream"); - FileInputStream fis = null; - try { - fis = new FileInputStream(file); - response.setHeader("Content-Disposition", "attachment; filename=" + file.getName()); - IOUtils.copy(fis, response.getOutputStream()); - response.flushBuffer(); - } catch (Exception e) { - log.error(e.getMessage(), e); - } finally { - if (fis != null) { - try { - fis.close(); - if (deleteOnExit) { - file.deleteOnExit(); - } - } catch (IOException e) { - log.error(e.getMessage(), e); - } - } - } - } - - public static String getMd5(File file) { - return getMd5(getByte(file)); - } -} diff --git a/wjcy-common/src/main/java/me/zhengjie/utils/HexUtil.java b/wjcy-common/src/main/java/me/zhengjie/utils/HexUtil.java deleted file mode 100644 index 96cf5d5..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/utils/HexUtil.java +++ /dev/null @@ -1,51 +0,0 @@ -package me.zhengjie.utils; - -import cn.hutool.core.util.ObjectUtil; -import static jodd.util.CharUtil.HEX_CHARS; -/** - *

- * dy登录加密校验 - *

- * - * @Author xx - * @Date 2021/7/21 - **/ -public class HexUtil { - - public static String toHexString(byte[] bArr, int i, int i2) { - if (bArr == null) { - throw new NullPointerException("bytes is null"); - } else if (i < 0 || i + i2 > bArr.length) { - throw new IndexOutOfBoundsException(); - } else { - int i3 = i2 * 2; - char[] cArr = new char[i3]; - int i4 = 0; - for (int i5 = 0; i5 < i2; i5++) { - int i6 = bArr[i5 + i] & 255; - int i7 = i4 + 1; - cArr[i4] = HEX_CHARS[i6 >> 4]; - i4 = i7 + 1; - cArr[i7] = HEX_CHARS[i6 & 15]; - } - return new String(cArr, 0, i3); - } - } - - - public static String encryptWithXor(String str) { - try { - if (ObjectUtil.isEmpty(str)) { - return null; - } - byte[] bytes = str.getBytes("UTF-8"); - for (int i = 0; i < bytes.length; i++) { - bytes[i] = (byte) (bytes[i] ^ 5); - } - return toHexString(bytes, 0, bytes.length); - } catch (Exception unused) { - return str; - } - } - -} diff --git a/wjcy-common/src/main/java/me/zhengjie/utils/HttpClientUtil.java b/wjcy-common/src/main/java/me/zhengjie/utils/HttpClientUtil.java deleted file mode 100644 index 618c216..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/utils/HttpClientUtil.java +++ /dev/null @@ -1,356 +0,0 @@ -package me.zhengjie.utils; - -import cn.hutool.core.convert.Convert; -import cn.hutool.core.map.MapUtil; -import cn.hutool.core.util.ObjectUtil; -import cn.hutool.core.util.StrUtil; -import cn.hutool.json.JSONUtil; -import lombok.extern.slf4j.Slf4j; -import org.apache.http.HttpEntity; -import org.apache.http.HttpResponse; -import org.apache.http.NameValuePair; -import org.apache.http.client.config.RequestConfig; -import org.apache.http.client.entity.UrlEncodedFormEntity; -import org.apache.http.client.methods.CloseableHttpResponse; -import org.apache.http.client.methods.HttpGet; -import org.apache.http.client.methods.HttpPost; -import org.apache.http.entity.StringEntity; -import org.apache.http.impl.client.CloseableHttpClient; -import org.apache.http.impl.client.HttpClients; -import org.apache.http.message.BasicNameValuePair; -import org.apache.http.util.EntityUtils; - -import java.io.IOException; -import java.nio.charset.Charset; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; - -/** - * @author rch - * @date 2022-06-22 - */ -@Slf4j -public class HttpClientUtil { - - public static String postJson(String url, String body, String charset) { - - String result = null; - if (null == charset) { - charset = "UTF-8"; - } - CloseableHttpClient httpClient = null; - HttpPost httpPost = null; - try { - httpClient = HttpConnectionManager.getInstance().getHttpClient(); - httpPost = new HttpPost(url); - - // 设置连接超时,设置读取超时 - RequestConfig requestConfig = RequestConfig.custom() - .setConnectTimeout(3000) - .setSocketTimeout(3000) - .build(); - httpPost.setConfig(requestConfig); - - httpPost.setHeader("Accept", "application/json"); - httpPost.setHeader("Content-Type", "application/json;charset=utf-8"); - - // 设置参数 - StringEntity se = new StringEntity(body, "UTF-8"); - httpPost.setEntity(se); - HttpResponse response = httpClient.execute(httpPost); - if (response != null) { - HttpEntity resEntity = response.getEntity(); - if (resEntity != null) { - result = EntityUtils.toString(resEntity, charset); - } - } - } catch (Exception ex) { - ex.printStackTrace(); - log.error(ex.getMessage()); - } - - return result; - } - - - public static String postJson(String url, Map heards, String body, String charset) { - - String result = null; - if (null == charset) { - charset = "UTF-8"; - } - CloseableHttpClient httpClient = null; - HttpPost httpPost = null; - try { - httpClient = HttpConnectionManager.getInstance().getHttpClient(); - httpPost = new HttpPost(url); - - // 设置连接超时,设置读取超时 - RequestConfig requestConfig = RequestConfig.custom() - .setConnectTimeout(3000) - .setSocketTimeout(3000) - .build(); - httpPost.setConfig(requestConfig); - - for (Map.Entry heard:heards.entrySet()) { - httpPost.setHeader(heard.getKey(), heard.getValue().toString()); - } - - // 设置参数 - StringEntity se = new StringEntity(body, "UTF-8"); - httpPost.setEntity(se); - HttpResponse response = httpClient.execute(httpPost); - if (response != null) { - HttpEntity resEntity = response.getEntity(); - if (resEntity != null) { - result = EntityUtils.toString(resEntity, charset); - } - } - } catch (Exception ex) { - ex.printStackTrace(); - log.error(ex.getMessage()); - } - - return result; - } - - - /** - * 发送 POST 请求(HTTP),K-V形式 - * - * @param apiUrl - * API接口URL - * @param params - * 参数map - * @return - */ - public static String doPostHttp(String apiUrl, Map params) { - CloseableHttpClient httpClient = HttpClients.createDefault(); - String httpStr = null; - HttpPost httpPost = new HttpPost(apiUrl); - CloseableHttpResponse response = null; - - try { - // 设置连接超时,设置读取超时 - RequestConfig requestConfig = RequestConfig.custom() - .setConnectTimeout(10000) - .setSocketTimeout(10000) - .build(); - httpPost.setConfig(requestConfig); - httpPost.setHeader("Accept", "application/json"); - httpPost.setHeader("Content-Type", "application/x-www-form-urlencoded"); - - List pairList = new ArrayList<>(params.size()); - for (Entry entry : params.entrySet()) { - NameValuePair pair = new BasicNameValuePair(entry.getKey(), Convert.toStr(entry.getValue())); - pairList.add(pair); - } - httpPost.setEntity(new UrlEncodedFormEntity(pairList, Charset.forName("UTF-8"))); - response = httpClient.execute(httpPost); -// System.out.println("http==response.toString():" + response.toString()); - HttpEntity entity = response.getEntity(); - httpStr = EntityUtils.toString(entity, "UTF-8"); - } catch (IOException e) { - e.printStackTrace(); - log.error(e.getMessage()); - } finally { - if (response != null) { - try { - EntityUtils.consume(response.getEntity()); - } catch (IOException e) { - e.printStackTrace(); - log.error(e.getMessage()); - } - } - } - return httpStr; - } - - /** - * 发送 GET 请求(HTTP),K-V形式 - * - * @param apiUrl - * API接口URL - * @param params - * 参数map - * @return - */ - public static String getHttp(String apiUrl,Map params){ - CloseableHttpClient httpClient = null; - CloseableHttpResponse response = null; - String result = ""; - try { - String url = apiUrl; - if(MapUtil.isNotEmpty(params)){ - String paramsStr = ""; - for (String key : params.keySet()) { - if(ObjectUtil.isNotEmpty(params.get(key))){ - if(StrUtil.isNotEmpty(paramsStr)){ - paramsStr += "&" + key + "=" + params.get(key); - }else{ - paramsStr += key + "=" + params.get(key); - } - } - } - if(StrUtil.isNotEmpty(paramsStr)){ - url += "?" + paramsStr; - } - } - httpClient = HttpClients.createDefault(); - System.out.println("url:" + url); - HttpGet httpGet = new HttpGet(url); - // 设置连接超时,设置读取超时 - RequestConfig requestConfig = RequestConfig.custom() - .setConnectTimeout(5000) - .setSocketTimeout(5000) - .build(); - httpGet.setConfig(requestConfig); - response = httpClient.execute(httpGet); - HttpEntity entity = response.getEntity(); - result = EntityUtils.toString(entity, "UTF-8"); - } catch (IOException e) { - e.printStackTrace(); - log.error(e.getMessage()); - } finally { - if (response != null) { - try { - response.close(); - } catch (IOException e) { - e.printStackTrace(); - log.error(e.getMessage()); - } - } - if (httpClient != null) { - try { - httpClient.close(); - } catch (IOException e) { - e.printStackTrace(); - log.error(e.getMessage()); - } - } - } - return result; - } - - - - /** - * 发送 GET 请求(HTTP) - * - * @param apiUrl - * API接口URL - * @return - */ - public static String getUrlHttp(String apiUrl){ - CloseableHttpClient httpClient = null; - CloseableHttpResponse response = null; - String result = ""; - try { - String url = apiUrl; - httpClient = HttpClients.createDefault(); - System.out.println("url:" + url); - HttpGet httpGet = new HttpGet(url); - // 设置连接超时,设置读取超时 - RequestConfig requestConfig = RequestConfig.custom() - .setConnectTimeout(5000) - .setSocketTimeout(5000) - .build(); - httpGet.setConfig(requestConfig); - response = httpClient.execute(httpGet); - HttpEntity entity = response.getEntity(); - result = EntityUtils.toString(entity, "UTF-8"); - } catch (IOException e) { - e.printStackTrace(); - log.error(e.getMessage()); - } finally { - if (response != null) { - try { - response.close(); - } catch (IOException e) { - e.printStackTrace(); - log.error(e.getMessage()); - } - } - if (httpClient != null) { - try { - httpClient.close(); - } catch (IOException e) { - e.printStackTrace(); - log.error(e.getMessage()); - } - } - } - return result; - } - - /** - * 发送 POST 请求(HTTP),K-V形式 - * - * @param apiUrl - * API接口URL - * @param params - * 参数map - * @return - */ - public static String postHttp(String apiUrl,Map params){ - CloseableHttpClient httpClient = null; - CloseableHttpResponse response = null; - String result = ""; - try { - String url = apiUrl; - httpClient = HttpClients.createDefault(); - HttpPost httpPost = new HttpPost(url); - // 设置连接超时,设置读取超时 - RequestConfig requestConfig = RequestConfig.custom() - .setConnectTimeout(5000) - .setSocketTimeout(5000) - .build(); - httpPost.setConfig(requestConfig); - if(MapUtil.isNotEmpty(params)){ - StringEntity se = new StringEntity(JSONUtil.toJsonStr(params), "UTF-8"); - se.setContentType("application/json"); - httpPost.setEntity(se); - } - response = httpClient.execute(httpPost); - HttpEntity entity = response.getEntity(); - result = EntityUtils.toString(entity, "UTF-8"); - } catch (IOException e) { - e.printStackTrace(); - log.error(e.getMessage()); - } finally { - if (response != null) { - try { - EntityUtils.consume(response.getEntity()); - } catch (IOException e) { - e.printStackTrace(); - log.error(e.getMessage()); - } - } - if (httpClient != null) { - try { - httpClient.close(); - } catch (IOException e) { - e.printStackTrace(); - log.error(e.getMessage()); - } - } - } - return result; - } - - - public static void main(String[] args) { - String url = "http://kjw.utest6.com/forcol/a"; - Map params = new HashMap<>(16); - params.put("page",1); - params.put("pageSize",10000); - params.put("beginTime","2022-04-01 21:00:00"); - - String result = postHttp(url,params); - System.out.println(result); - } - -} diff --git a/wjcy-common/src/main/java/me/zhengjie/utils/HttpConnectionManager.java b/wjcy-common/src/main/java/me/zhengjie/utils/HttpConnectionManager.java deleted file mode 100644 index 85dc9c8..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/utils/HttpConnectionManager.java +++ /dev/null @@ -1,57 +0,0 @@ -package me.zhengjie.utils; - - -import org.apache.http.config.Registry; -import org.apache.http.config.RegistryBuilder; -import org.apache.http.conn.socket.ConnectionSocketFactory; -import org.apache.http.conn.socket.LayeredConnectionSocketFactory; -import org.apache.http.conn.socket.PlainConnectionSocketFactory; -import org.apache.http.conn.ssl.SSLConnectionSocketFactory; -import org.apache.http.impl.client.CloseableHttpClient; -import org.apache.http.impl.client.HttpClients; -import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; -import org.springframework.stereotype.Component; - -import javax.net.ssl.SSLContext; -import java.security.NoSuchAlgorithmException; - -@Component -public class HttpConnectionManager { - - private PoolingHttpClientConnectionManager cm = null; - - private static HttpConnectionManager connectionManager; - - public static HttpConnectionManager getInstance() { - if (connectionManager == null) { - synchronized (HttpConnectionManager.class) { - if (connectionManager == null) { - connectionManager = new HttpConnectionManager(); - connectionManager.init(); - } - } - } - return connectionManager; - } - - private void init() { - LayeredConnectionSocketFactory sslsf = null; - try { - sslsf = new SSLConnectionSocketFactory(SSLContext.getDefault()); - } catch (NoSuchAlgorithmException e) { - e.printStackTrace(); - } - - Registry socketFactoryRegistry = RegistryBuilder. create() - .register("https", sslsf).register("http", new PlainConnectionSocketFactory()).build(); - cm = new PoolingHttpClientConnectionManager(socketFactoryRegistry); - cm.setMaxTotal(200); - cm.setDefaultMaxPerRoute(20); - } - - public CloseableHttpClient getHttpClient() { - CloseableHttpClient httpClient = HttpClients.custom().setConnectionManager(cm).build(); - - return httpClient; - } -} diff --git a/wjcy-common/src/main/java/me/zhengjie/utils/IpUtils.java b/wjcy-common/src/main/java/me/zhengjie/utils/IpUtils.java deleted file mode 100644 index 7da2af7..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/utils/IpUtils.java +++ /dev/null @@ -1,380 +0,0 @@ -package me.zhengjie.utils; - -import java.net.InetAddress; -import java.net.UnknownHostException; -import javax.servlet.http.HttpServletRequest; - -/** - * 获取IP方法 - * - * @author ruoyi - */ -public class IpUtils -{ - public final static String REGX_0_255 = "(25[0-5]|2[0-4]\\d|1\\d{2}|[1-9]\\d|\\d)"; - // 匹配 ip - public final static String REGX_IP = "((" + REGX_0_255 + "\\.){3}" + REGX_0_255 + ")"; - public final static String REGX_IP_WILDCARD = "(((\\*\\.){3}\\*)|(" + REGX_0_255 + "(\\.\\*){3})|(" + REGX_0_255 + "\\." + REGX_0_255 + ")(\\.\\*){2}" + "|((" + REGX_0_255 + "\\.){3}\\*))"; - // 匹配网段 - public final static String REGX_IP_SEG = "(" + REGX_IP + "\\-" + REGX_IP + ")"; - - /** - * 获取客户端IP - * - * @return IP地址 - */ - public static String getIpAddr() - { - return getIpAddr(ServletUtils.getRequest()); - } - - /** - * 获取客户端IP - * - * @param request 请求对象 - * @return IP地址 - */ - public static String getIpAddr(HttpServletRequest request) - { - if (request == null) - { - return "unknown"; - } - String ip = request.getHeader("x-forwarded-for"); - if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) - { - ip = request.getHeader("Proxy-Client-IP"); - } - if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) - { - ip = request.getHeader("X-Forwarded-For"); - } - if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) - { - ip = request.getHeader("WL-Proxy-Client-IP"); - } - if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) - { - ip = request.getHeader("X-Real-IP"); - } - - if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) - { - ip = request.getRemoteAddr(); - } - - return "0:0:0:0:0:0:0:1".equals(ip) ? "127.0.0.1" : getMultistageReverseProxyIp(ip); - } - - /** - * 检查是否为内部IP地址 - * - * @param ip IP地址 - * @return 结果 - */ - public static boolean internalIp(String ip) - { - byte[] addr = textToNumericFormatV4(ip); - return internalIp(addr) || "127.0.0.1".equals(ip); - } - - /** - * 检查是否为内部IP地址 - * - * @param addr byte地址 - * @return 结果 - */ - private static boolean internalIp(byte[] addr) - { - if (NewStringUtils.isNull(addr) || addr.length < 2) - { - return true; - } - final byte b0 = addr[0]; - final byte b1 = addr[1]; - // 10.x.x.x/8 - final byte SECTION_1 = 0x0A; - // 172.16.x.x/12 - final byte SECTION_2 = (byte) 0xAC; - final byte SECTION_3 = (byte) 0x10; - final byte SECTION_4 = (byte) 0x1F; - // 192.168.x.x/16 - final byte SECTION_5 = (byte) 0xC0; - final byte SECTION_6 = (byte) 0xA8; - switch (b0) - { - case SECTION_1: - return true; - case SECTION_2: - if (b1 >= SECTION_3 && b1 <= SECTION_4) - { - return true; - } - case SECTION_5: - switch (b1) - { - case SECTION_6: - return true; - } - default: - return false; - } - } - - /** - * 将IPv4地址转换成字节 - * - * @param text IPv4地址 - * @return byte 字节 - */ - public static byte[] textToNumericFormatV4(String text) - { - if (text.length() == 0) - { - return null; - } - - byte[] bytes = new byte[4]; - String[] elements = text.split("\\.", -1); - try - { - long l; - int i; - switch (elements.length) - { - case 1: - l = Long.parseLong(elements[0]); - if ((l < 0L) || (l > 4294967295L)) - { - return null; - } - bytes[0] = (byte) (int) (l >> 24 & 0xFF); - bytes[1] = (byte) (int) ((l & 0xFFFFFF) >> 16 & 0xFF); - bytes[2] = (byte) (int) ((l & 0xFFFF) >> 8 & 0xFF); - bytes[3] = (byte) (int) (l & 0xFF); - break; - case 2: - l = Integer.parseInt(elements[0]); - if ((l < 0L) || (l > 255L)) - { - return null; - } - bytes[0] = (byte) (int) (l & 0xFF); - l = Integer.parseInt(elements[1]); - if ((l < 0L) || (l > 16777215L)) - { - return null; - } - bytes[1] = (byte) (int) (l >> 16 & 0xFF); - bytes[2] = (byte) (int) ((l & 0xFFFF) >> 8 & 0xFF); - bytes[3] = (byte) (int) (l & 0xFF); - break; - case 3: - for (i = 0; i < 2; ++i) - { - l = Integer.parseInt(elements[i]); - if ((l < 0L) || (l > 255L)) - { - return null; - } - bytes[i] = (byte) (int) (l & 0xFF); - } - l = Integer.parseInt(elements[2]); - if ((l < 0L) || (l > 65535L)) - { - return null; - } - bytes[2] = (byte) (int) (l >> 8 & 0xFF); - bytes[3] = (byte) (int) (l & 0xFF); - break; - case 4: - for (i = 0; i < 4; ++i) - { - l = Integer.parseInt(elements[i]); - if ((l < 0L) || (l > 255L)) - { - return null; - } - bytes[i] = (byte) (int) (l & 0xFF); - } - break; - default: - return null; - } - } - catch (NumberFormatException e) - { - return null; - } - return bytes; - } - - /** - * 获取IP地址 - * - * @return 本地IP地址 - */ - public static String getHostIp() - { - try - { - return InetAddress.getLocalHost().getHostAddress(); - } - catch (UnknownHostException e) - { - } - return "127.0.0.1"; - } - - /** - * 获取主机名 - * - * @return 本地主机名 - */ - public static String getHostName() - { - try - { - return InetAddress.getLocalHost().getHostName(); - } - catch (UnknownHostException e) - { - } - return "未知"; - } - - /** - * 从多级反向代理中获得第一个非unknown IP地址 - * - * @param ip 获得的IP地址 - * @return 第一个非unknown IP地址 - */ - public static String getMultistageReverseProxyIp(String ip) - { - // 多级反向代理检测 - if (ip != null && ip.indexOf(",") > 0) - { - final String[] ips = ip.trim().split(","); - for (String subIp : ips) - { - if (false == isUnknown(subIp)) - { - ip = subIp; - break; - } - } - } - return StringUtils.substring(ip, 0, 255); - } - - /** - * 检测给定字符串是否为未知,多用于检测HTTP请求相关 - * - * @param checkString 被检测的字符串 - * @return 是否未知 - */ - public static boolean isUnknown(String checkString) - { - return StringUtils.isBlank(checkString) || "unknown".equalsIgnoreCase(checkString); - } - - /** - * 是否为IP - */ - public static boolean isIP(String ip) - { - return StringUtils.isNotBlank(ip) && ip.matches(REGX_IP); - } - - /** - * 是否为IP,或 *为间隔的通配符地址 - */ - public static boolean isIpWildCard(String ip) - { - return StringUtils.isNotBlank(ip) && ip.matches(REGX_IP_WILDCARD); - } - - /** - * 检测参数是否在ip通配符里 - */ - public static boolean ipIsInWildCardNoCheck(String ipWildCard, String ip) - { - String[] s1 = ipWildCard.split("\\."); - String[] s2 = ip.split("\\."); - boolean isMatchedSeg = true; - for (int i = 0; i < s1.length && !s1[i].equals("*"); i++) - { - if (!s1[i].equals(s2[i])) - { - isMatchedSeg = false; - break; - } - } - return isMatchedSeg; - } - - /** - * 是否为特定格式如:“10.10.10.1-10.10.10.99”的ip段字符串 - */ - public static boolean isIPSegment(String ipSeg) - { - return StringUtils.isNotBlank(ipSeg) && ipSeg.matches(REGX_IP_SEG); - } - - /** - * 判断ip是否在指定网段中 - */ - public static boolean ipIsInNetNoCheck(String iparea, String ip) - { - int idx = iparea.indexOf('-'); - String[] sips = iparea.substring(0, idx).split("\\."); - String[] sipe = iparea.substring(idx + 1).split("\\."); - String[] sipt = ip.split("\\."); - long ips = 0L, ipe = 0L, ipt = 0L; - for (int i = 0; i < 4; ++i) - { - ips = ips << 8 | Integer.parseInt(sips[i]); - ipe = ipe << 8 | Integer.parseInt(sipe[i]); - ipt = ipt << 8 | Integer.parseInt(sipt[i]); - } - if (ips > ipe) - { - long t = ips; - ips = ipe; - ipe = t; - } - return ips <= ipt && ipt <= ipe; - } - - /** - * 校验ip是否符合过滤串规则 - * - * @param filter 过滤IP列表,支持后缀'*'通配,支持网段如:`10.10.10.1-10.10.10.99` - * @param ip 校验IP地址 - * @return boolean 结果 - */ - public static boolean isMatchedIp(String filter, String ip) - { - if (StringUtils.isEmpty(filter) || StringUtils.isEmpty(ip)) - { - return false; - } - String[] ips = filter.split(";"); - for (String iStr : ips) - { - if (isIP(iStr) && iStr.equals(ip)) - { - return true; - } - else if (isIpWildCard(iStr) && ipIsInWildCardNoCheck(iStr, ip)) - { - return true; - } - else if (isIPSegment(iStr) && ipIsInNetNoCheck(iStr, ip)) - { - return true; - } - } - return false; - } -} diff --git a/wjcy-common/src/main/java/me/zhengjie/utils/JsonDealUtils.java b/wjcy-common/src/main/java/me/zhengjie/utils/JsonDealUtils.java deleted file mode 100644 index ecf2793..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/utils/JsonDealUtils.java +++ /dev/null @@ -1,54 +0,0 @@ -package me.zhengjie.utils; - -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; - -import java.util.Iterator; -import java.util.Set; - -/** - * 递归去除Json字符串空值(key和value) - * - * @author rch - * @create 2022-06-27 - */ -public class JsonDealUtils { - - public static JSONObject getNoNullValue(String json) { - JSONObject objTem=JSON.parseObject(json); - JSONObject objRel=JSON.parseObject(json); - return deal(objTem,objRel); - } - - private static JSONObject deal(JSONObject objTem,JSONObject objRel) { - Set keySet = objTem.keySet(); - Iterator iterator = keySet.iterator(); - while(iterator.hasNext()) { - String temp = iterator.next(); - Object objR = objTem.get(temp); - if(temp==null||"".equals(temp)||"null".equals(temp)) { - objRel.remove(temp); - continue; - } - if(objR==null||"".equals(objR.toString())||"null".equals(objR.toString())||"[]".equals(objR.toString())||"{}".equals(objR.toString())) { - objRel.remove(temp); - continue; - } - if(objR instanceof JSONObject) { - JSONObject j=(JSONObject)objR; - JSONObject object2 = (JSONObject)objRel.get(temp); - deal(j,object2); - continue; - } - if(objR instanceof JSONArray) { - JSONArray jsonArray = objTem.getJSONArray(temp); - JSONArray jsonArray2 = objRel.getJSONArray(temp); - for(int i=0;i - * MD5工具类 - *

- * - * @author: rch - * @since: 2020-12-03 - */ - -import java.security.MessageDigest; -import java.security.NoSuchAlgorithmException; - -public class MD5Util { - - /** * 生成16位小写md5加密字符串 * @param sourceStr * @return */ - public static String MD5ToLow16(String sourceStr) { - try { - // 获得MD5摘要算法的 MessageDigest对象 - StringBuffer buf = getMD5StringBuffer(sourceStr); - return buf.toString().substring(8, 24).toLowerCase();// 16位加密 - // return buf.toString();// 32位加密 - } catch (Exception e) { - e.printStackTrace(); - return null; - } - } - - /** * 生成16位大写md5加密字符串 * @param sourceStr * @return */ - public static String MD5ToUpp16(String sourceStr) { - try { - // 获得MD5摘要算法的 MessageDigest对象 - StringBuffer buf = getMD5StringBuffer(sourceStr); - return buf.toString().substring(8, 24).toUpperCase();// 16位加密 - } catch (Exception e) { - e.printStackTrace(); - return null; - } - } - - /** * 生成32位小写md5加密字符串 * @param sourceStr * @return */ - public static String MD5ToLow32(String sourceStr) { - try { - // 获得MD5摘要算法的 MessageDigest对象 - StringBuffer buf = getMD5StringBuffer(sourceStr); - return buf.toString().toLowerCase();// 32位加密 - } catch (Exception e) { - e.printStackTrace(); - return null; - } - } - - /** * 生成32位大写md5加密字符串 * @param sourceStr * @return */ - public static String MD5ToUpp32(String sourceStr) { - try { - StringBuffer buf = getMD5StringBuffer(sourceStr); - - return buf.toString().toUpperCase();// 32位加密 - } catch (Exception e) { - e.printStackTrace(); - return null; - } - } - - /** * 将字符串MD5加密 * @param sourceStr * @return * @throws NoSuchAlgorithmException */ - private static StringBuffer getMD5StringBuffer(String sourceStr) throws NoSuchAlgorithmException { - // 获得MD5摘要算法的 MessageDigest对象 - MessageDigest mdInst = MessageDigest.getInstance("MD5"); - // 使用指定的字节更新摘要 - mdInst.update(sourceStr.getBytes()); - // 获得密文 - byte[] md = mdInst.digest(); - // 把密文转换成十六进制的字符串形式 - StringBuffer buf = new StringBuffer(); - for (int i = 0; i < md.length; i++) { - int tmp = md[i]; - if (tmp < 0){ - tmp += 256; - } - if (tmp < 16){ - buf.append("0"); - } - buf.append(Integer.toHexString(tmp)); - } - return buf; - } - - public static String md5(String str) { - try { - MessageDigest md5 = MessageDigest.getInstance("MD5"); - md5.update((str).getBytes("UTF-8")); - byte b[] = md5.digest(); - - int i; - StringBuffer buf = new StringBuffer(""); - - for (int offset = 0; offset < b.length; offset++) { - i = b[offset]; - if (i < 0) { - i += 256; - } - if (i < 16) { - buf.append("0"); - } - buf.append(Integer.toHexString(i)); - } - return buf.toString(); - } catch (Exception e) { - e.printStackTrace(); - } - return null; - } - - public static void main(String[] args) { -// String str = "1"; -// System.out.println(str); -// System.out.println(MD5ToLow16(str)); -// System.out.println(MD5ToLow32(str)); -// System.out.println(MD5ToUpp16(str)); -// System.out.println(MD5ToUpp32(str)); - String ttt = "sportsCe7vS3j1ziPHwfDDffJ3ivX34Z1cb2S1133687017471620710415600000004www.sportstatus.comzhU33255"; - System.out.println(md5(ttt)); - } -} diff --git a/wjcy-common/src/main/java/me/zhengjie/utils/NewStringUtils.java b/wjcy-common/src/main/java/me/zhengjie/utils/NewStringUtils.java deleted file mode 100644 index 2ce685e..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/utils/NewStringUtils.java +++ /dev/null @@ -1,646 +0,0 @@ -package me.zhengjie.utils; - -import org.springframework.util.AntPathMatcher; - -import java.util.*; - -/** - * 字符串工具类 - * - * @author ruoyi - */ -public class NewStringUtils extends org.apache.commons.lang3.StringUtils -{ - /** 空字符串 */ - private static final String NULLSTR = ""; - - /** 下划线 */ - private static final char SEPARATOR = '_'; - - /** 星号 */ - private static final char ASTERISK = '*'; - - /** - * 获取参数不为空值 - * - * @param value defaultValue 要判断的value - * @return value 返回值 - */ - public static T nvl(T value, T defaultValue) - { - return value != null ? value : defaultValue; - } - - /** - * * 判断一个Collection是否为空, 包含List,Set,Queue - * - * @param coll 要判断的Collection - * @return true:为空 false:非空 - */ - public static boolean isEmpty(Collection coll) - { - return isNull(coll) || coll.isEmpty(); - } - - /** - * * 判断一个Collection是否非空,包含List,Set,Queue - * - * @param coll 要判断的Collection - * @return true:非空 false:空 - */ - public static boolean isNotEmpty(Collection coll) - { - return !isEmpty(coll); - } - - /** - * * 判断一个对象数组是否为空 - * - * @param objects 要判断的对象数组 - ** @return true:为空 false:非空 - */ - public static boolean isEmpty(Object[] objects) - { - return isNull(objects) || (objects.length == 0); - } - - /** - * * 判断一个对象数组是否非空 - * - * @param objects 要判断的对象数组 - * @return true:非空 false:空 - */ - public static boolean isNotEmpty(Object[] objects) - { - return !isEmpty(objects); - } - - /** - * * 判断一个Map是否为空 - * - * @param map 要判断的Map - * @return true:为空 false:非空 - */ - public static boolean isEmpty(Map map) - { - return isNull(map) || map.isEmpty(); - } - - /** - * * 判断一个Map是否为空 - * - * @param map 要判断的Map - * @return true:非空 false:空 - */ - public static boolean isNotEmpty(Map map) - { - return !isEmpty(map); - } - - /** - * * 判断一个字符串是否为空串 - * - * @param str String - * @return true:为空 false:非空 - */ - public static boolean isEmpty(String str) - { - return isNull(str) || NULLSTR.equals(str.trim()); - } - - /** - * * 判断一个字符串是否为非空串 - * - * @param str String - * @return true:非空串 false:空串 - */ - public static boolean isNotEmpty(String str) - { - return !isEmpty(str); - } - - /** - * * 判断一个对象是否为空 - * - * @param object Object - * @return true:为空 false:非空 - */ - public static boolean isNull(Object object) - { - return object == null; - } - - /** - * * 判断一个对象是否非空 - * - * @param object Object - * @return true:非空 false:空 - */ - public static boolean isNotNull(Object object) - { - return !isNull(object); - } - - /** - * * 判断一个对象是否是数组类型(Java基本型别的数组) - * - * @param object 对象 - * @return true:是数组 false:不是数组 - */ - public static boolean isArray(Object object) - { - return isNotNull(object) && object.getClass().isArray(); - } - - /** - * 去空格 - */ - public static String trim(String str) - { - return (str == null ? "" : str.trim()); - } - - /** - * 替换指定字符串的指定区间内字符为"*" - * - * @param str 字符串 - * @param startInclude 开始位置(包含) - * @param endExclude 结束位置(不包含) - * @return 替换后的字符串 - */ - public static String hide(CharSequence str, int startInclude, int endExclude) - { - if (isEmpty(str)) - { - return NULLSTR; - } - final int strLength = str.length(); - if (startInclude > strLength) - { - return NULLSTR; - } - if (endExclude > strLength) - { - endExclude = strLength; - } - if (startInclude > endExclude) - { - // 如果起始位置大于结束位置,不替换 - return NULLSTR; - } - final char[] chars = new char[strLength]; - for (int i = 0; i < strLength; i++) - { - if (i >= startInclude && i < endExclude) - { - chars[i] = ASTERISK; - } - else - { - chars[i] = str.charAt(i); - } - } - return new String(chars); - } - - /** - * 截取字符串 - * - * @param str 字符串 - * @param start 开始 - * @return 结果 - */ - public static String substring(final String str, int start) - { - if (str == null) - { - return NULLSTR; - } - - if (start < 0) - { - start = str.length() + start; - } - - if (start < 0) - { - start = 0; - } - if (start > str.length()) - { - return NULLSTR; - } - - return str.substring(start); - } - - /** - * 截取字符串 - * - * @param str 字符串 - * @param start 开始 - * @param end 结束 - * @return 结果 - */ - public static String substring(final String str, int start, int end) - { - if (str == null) - { - return NULLSTR; - } - - if (end < 0) - { - end = str.length() + end; - } - if (start < 0) - { - start = str.length() + start; - } - - if (end > str.length()) - { - end = str.length(); - } - - if (start > end) - { - return NULLSTR; - } - - if (start < 0) - { - start = 0; - } - if (end < 0) - { - end = 0; - } - - return str.substring(start, end); - } - - /** - * 判断是否为空,并且不是空白字符 - * - * @param str 要判断的value - * @return 结果 - */ - public static boolean hasText(String str) - { - return (str != null && !str.isEmpty() && containsText(str)); - } - - private static boolean containsText(CharSequence str) - { - int strLen = str.length(); - for (int i = 0; i < strLen; i++) - { - if (!Character.isWhitespace(str.charAt(i))) - { - return true; - } - } - return false; - } - - - /** - * 字符串转set - * - * @param str 字符串 - * @param sep 分隔符 - * @return set集合 - */ - public static final Set str2Set(String str, String sep) - { - return new HashSet(str2List(str, sep, true, false)); - } - - /** - * 字符串转list - * - * @param str 字符串 - * @param sep 分隔符 - * @param filterBlank 过滤纯空白 - * @param trim 去掉首尾空白 - * @return list集合 - */ - public static final List str2List(String str, String sep, boolean filterBlank, boolean trim) - { - List list = new ArrayList(); - if (NewStringUtils.isEmpty(str)) - { - return list; - } - - // 过滤空白字符串 - if (filterBlank && NewStringUtils.isBlank(str)) - { - return list; - } - String[] split = str.split(sep); - for (String string : split) - { - if (filterBlank && NewStringUtils.isBlank(string)) - { - continue; - } - if (trim) - { - string = string.trim(); - } - list.add(string); - } - - return list; - } - - /** - * 判断给定的collection列表中是否包含数组array 判断给定的数组array中是否包含给定的元素value - * - * @param collection 给定的集合 - * @param array 给定的数组 - * @return boolean 结果 - */ - public static boolean containsAny(Collection collection, String... array) - { - if (isEmpty(collection) || isEmpty(array)) - { - return false; - } - else - { - for (String str : array) - { - if (collection.contains(str)) - { - return true; - } - } - return false; - } - } - - /** - * 查找指定字符串是否包含指定字符串列表中的任意一个字符串同时串忽略大小写 - * - * @param cs 指定字符串 - * @param searchCharSequences 需要检查的字符串数组 - * @return 是否包含任意一个字符串 - */ - public static boolean containsAnyIgnoreCase(CharSequence cs, CharSequence... searchCharSequences) - { - if (isEmpty(cs) || isEmpty(searchCharSequences)) - { - return false; - } - for (CharSequence testStr : searchCharSequences) - { - if (containsIgnoreCase(cs, testStr)) - { - return true; - } - } - return false; - } - - /** - * 驼峰转下划线命名 - */ - public static String toUnderScoreCase(String str) - { - if (str == null) - { - return null; - } - StringBuilder sb = new StringBuilder(); - // 前置字符是否大写 - boolean preCharIsUpperCase = true; - // 当前字符是否大写 - boolean curreCharIsUpperCase = true; - // 下一字符是否大写 - boolean nexteCharIsUpperCase = true; - for (int i = 0; i < str.length(); i++) - { - char c = str.charAt(i); - if (i > 0) - { - preCharIsUpperCase = Character.isUpperCase(str.charAt(i - 1)); - } - else - { - preCharIsUpperCase = false; - } - - curreCharIsUpperCase = Character.isUpperCase(c); - - if (i < (str.length() - 1)) - { - nexteCharIsUpperCase = Character.isUpperCase(str.charAt(i + 1)); - } - - if (preCharIsUpperCase && curreCharIsUpperCase && !nexteCharIsUpperCase) - { - sb.append(SEPARATOR); - } - else if ((i != 0 && !preCharIsUpperCase) && curreCharIsUpperCase) - { - sb.append(SEPARATOR); - } - sb.append(Character.toLowerCase(c)); - } - - return sb.toString(); - } - - /** - * 是否包含字符串 - * - * @param str 验证字符串 - * @param strs 字符串组 - * @return 包含返回true - */ - public static boolean inStringIgnoreCase(String str, String... strs) - { - if (str != null && strs != null) - { - for (String s : strs) - { - if (str.equalsIgnoreCase(trim(s))) - { - return true; - } - } - } - return false; - } - - /** - * 将下划线大写方式命名的字符串转换为驼峰式。如果转换前的下划线大写方式命名的字符串为空,则返回空字符串。 例如:HELLO_WORLD->HelloWorld - * - * @param name 转换前的下划线大写方式命名的字符串 - * @return 转换后的驼峰式命名的字符串 - */ - public static String convertToCamelCase(String name) - { - StringBuilder result = new StringBuilder(); - // 快速检查 - if (name == null || name.isEmpty()) - { - // 没必要转换 - return ""; - } - else if (!name.contains("_")) - { - // 不含下划线,仅将首字母大写 - return name.substring(0, 1).toUpperCase() + name.substring(1); - } - // 用下划线将原始字符串分割 - String[] camels = name.split("_"); - for (String camel : camels) - { - // 跳过原始字符串中开头、结尾的下换线或双重下划线 - if (camel.isEmpty()) - { - continue; - } - // 首字母大写 - result.append(camel.substring(0, 1).toUpperCase()); - result.append(camel.substring(1).toLowerCase()); - } - return result.toString(); - } - - /** - * 驼峰式命名法 - * 例如:user_name->userName - */ - public static String toCamelCase(String s) - { - if (s == null) - { - return null; - } - if (s.indexOf(SEPARATOR) == -1) - { - return s; - } - s = s.toLowerCase(); - StringBuilder sb = new StringBuilder(s.length()); - boolean upperCase = false; - for (int i = 0; i < s.length(); i++) - { - char c = s.charAt(i); - - if (c == SEPARATOR) - { - upperCase = true; - } - else if (upperCase) - { - sb.append(Character.toUpperCase(c)); - upperCase = false; - } - else - { - sb.append(c); - } - } - return sb.toString(); - } - - /** - * 查找指定字符串是否匹配指定字符串列表中的任意一个字符串 - * - * @param str 指定字符串 - * @param strs 需要检查的字符串数组 - * @return 是否匹配 - */ - public static boolean matches(String str, List strs) - { - if (isEmpty(str) || isEmpty(strs)) - { - return false; - } - for (String pattern : strs) - { - if (isMatch(pattern, str)) - { - return true; - } - } - return false; - } - - /** - * 判断url是否与规则配置: - * ? 表示单个字符; - * * 表示一层路径内的任意字符串,不可跨层级; - * ** 表示任意层路径; - * - * @param pattern 匹配规则 - * @param url 需要匹配的url - * @return - */ - public static boolean isMatch(String pattern, String url) - { - AntPathMatcher matcher = new AntPathMatcher(); - return matcher.match(pattern, url); - } - - @SuppressWarnings("unchecked") - public static T cast(Object obj) - { - return (T) obj; - } - - /** - * 数字左边补齐0,使之达到指定长度。注意,如果数字转换为字符串后,长度大于size,则只保留 最后size个字符。 - * - * @param num 数字对象 - * @param size 字符串指定长度 - * @return 返回数字的字符串格式,该字符串为指定长度。 - */ - public static final String padl(final Number num, final int size) - { - return padl(num.toString(), size, '0'); - } - - /** - * 字符串左补齐。如果原始字符串s长度大于size,则只保留最后size个字符。 - * - * @param s 原始字符串 - * @param size 字符串指定长度 - * @param c 用于补齐的字符 - * @return 返回指定长度的字符串,由原字符串左补齐或截取得到。 - */ - public static final String padl(final String s, final int size, final char c) - { - final StringBuilder sb = new StringBuilder(size); - if (s != null) - { - final int len = s.length(); - if (s.length() <= size) - { - for (int i = size - len; i > 0; i--) - { - sb.append(c); - } - sb.append(s); - } - else - { - return s.substring(len - size, len); - } - } - else - { - for (int i = size; i > 0; i--) - { - sb.append(c); - } - } - return sb.toString(); - } -} diff --git a/wjcy-common/src/main/java/me/zhengjie/utils/OrderGetIndexUtil.java b/wjcy-common/src/main/java/me/zhengjie/utils/OrderGetIndexUtil.java deleted file mode 100644 index 8bce737..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/utils/OrderGetIndexUtil.java +++ /dev/null @@ -1,63 +0,0 @@ -package me.zhengjie.utils; - -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.atomic.AtomicInteger; - -/** - *

- * --顺序访问 - * 第几次访问 % 钱包池中有几个排序钱包 得到 当前应该取钱包池中钱包的索引 实现顺序访问。 - *

- * - * @author: rch - * @date: 2021-09-25 - */ -public class OrderGetIndexUtil { - - private static Map concurrentHashMap = new ConcurrentHashMap<>(16); - - /** - * @param merId 商家id - * @return 指定钱包池中当前该取钱包id 下标索引 - */ - public static int getIncrement(Long merId, Integer walletType, Integer passType) { - - String keyStr = merId + "-" + walletType + "-" + passType; - AtomicInteger atomicInteger = new AtomicInteger(0); - - Integer current; - int next; - do { - current = concurrentHashMap.get(keyStr); - current = current != null ? current : 0; - atomicInteger = new AtomicInteger(current); - next = current >= 2147483647 ? 0 : current+1; - - }while (!atomicInteger.compareAndSet(current, next)); - - concurrentHashMap.put(keyStr, next); - System.out.println("------------第几次访问:次数next="+next); - return next; - } - - public static void main(String[] args) { - for (int i = 0; i < 10; i++) { - if (i % 5 == 0) { - System.out.println("0==" + getIncrement(1L, 1, 1)); - } else if (i % 5 == 1) { - System.out.println("1==" + getIncrement(1L, 2, 1)); - } else if (i % 5 == 2) { - System.out.println("2==" + getIncrement(2L, 1, 1)); - } else if (i % 5 == 3) { - System.out.println("2==" + getIncrement(2L, 2,1)); - } else if (i % 5 == 4) { - System.out.println("3==" + getIncrement(2L, 3,1)); - } else { - System.out.println("!2=" + getIncrement(11L, 3, 1)); - } - } - - System.out.println("2==" + getIncrement(2L, 1, 1)); - } -} diff --git a/wjcy-common/src/main/java/me/zhengjie/utils/PageUtil.java b/wjcy-common/src/main/java/me/zhengjie/utils/PageUtil.java deleted file mode 100644 index 44db68d..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/utils/PageUtil.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.utils; - -import org.springframework.data.domain.Page; -import java.util.*; - -/** - * 分页工具 - * @author Zheng Jie - * @date 2018-12-10 - */ -public class PageUtil extends cn.hutool.core.util.PageUtil { - - /** - * List 分页 - */ - public static List toPage(int page, int size , List list) { - int fromIndex = page * size; - int toIndex = page * size + size; - if(fromIndex > list.size()){ - return new ArrayList(); - } else if(toIndex >= list.size()) { - return list.subList(fromIndex,list.size()); - } else { - return list.subList(fromIndex,toIndex); - } - } - - /** - * Page 数据处理,预防redis反序列化报错 - */ - public static Map toPage(Page page) { - Map map = new LinkedHashMap<>(2); - map.put("content",page.getContent()); - map.put("totalElements",page.getTotalElements()); - return map; - } - - /** - * 自定义分页 - */ - public static Map toPage(Object object, Object totalElements) { - Map map = new LinkedHashMap<>(2); - map.put("content",object); - map.put("totalElements",totalElements); - return map; - } - -} diff --git a/wjcy-common/src/main/java/me/zhengjie/utils/PageUtils.java b/wjcy-common/src/main/java/me/zhengjie/utils/PageUtils.java deleted file mode 100644 index cbf8730..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/utils/PageUtils.java +++ /dev/null @@ -1,55 +0,0 @@ -package me.zhengjie.utils; - -import cn.hutool.core.util.ObjectUtil; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import lombok.Data; - -import java.util.Collections; -import java.util.List; -/** - *

- * 分页查询工具类 - *

- * - * @Author xx - * @Date 2021/7/19 - **/ -@Data -public class PageUtils { - /** - * 总记录数 - */ - private Long total; - /** - * 查询结果 - */ - private List list; - - public PageUtils() { - - } - - public PageUtils(Long total, List list) { - this.total = total; - this.list = list; - } - - public PageUtils(Page page) { - this.total = page.getTotal(); - this.list = page.getRecords(); - } - - public Long getTotal() { - if (ObjectUtil.isNull(total)|| EmptyAttributeFiler.isEmpty(list)) { - return 0L; - } - return total; - } - - public List getList() { - if (EmptyAttributeFiler.isEmpty(list)) { - return Collections.emptyList(); - } - return list; - } -} diff --git a/wjcy-common/src/main/java/me/zhengjie/utils/PopularizeUtil.java b/wjcy-common/src/main/java/me/zhengjie/utils/PopularizeUtil.java deleted file mode 100644 index ebb422e..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/utils/PopularizeUtil.java +++ /dev/null @@ -1,49 +0,0 @@ -package me.zhengjie.utils; - -import cn.hutool.core.lang.UUID; - - -/** - * 推广码生成 工具类 - * - * @author: e - * @since: 2022/01/19 - */ -public class PopularizeUtil { - - public static String[] chars = new String[] { "a", "b", "c", "d", "e", "f", - "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", - "t", "u", "v", "w", "x", "y", "z", "0", "1", "2", "3", "4", "5", - "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H", "I", - "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", - "W", "X", "Y", "Z" }; - - /** - * 创建推广码 - * @return - */ - public static String createPromoCode(){ - return generateShortUuid().toUpperCase(); - //return RandomUtil.randomString(8).toUpperCase(); - } - - - public static String generateShortUuid() { - StringBuffer shortBuffer = new StringBuffer(); - String uuid = UUID.randomUUID().toString().replace("-", ""); - for (int i = 0; i < 8; i++) { - String str = uuid.substring(i * 4, i * 4 + 4); - int x = Integer.parseInt(str, 16); - shortBuffer.append(chars[x % 0x3E]); - } - return shortBuffer.toString(); - - } - - public static void main(String[] args) { - - - } - - -} diff --git a/wjcy-common/src/main/java/me/zhengjie/utils/PropertiesUtil.java b/wjcy-common/src/main/java/me/zhengjie/utils/PropertiesUtil.java deleted file mode 100644 index 3dab51b..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/utils/PropertiesUtil.java +++ /dev/null @@ -1,62 +0,0 @@ -package me.zhengjie.utils; - -import cn.hutool.core.util.ObjectUtil; -import lombok.extern.slf4j.Slf4j; -import me.zhengjie.config.SystemConfig; - -import java.io.*; -import java.util.Properties; - -/* - * - * @Description 读取多语言文本工具类 - * @Date 2021/12/16 - * @Author zeng - */ -@Slf4j -public class PropertiesUtil { - - public static String getByCode(Integer code, String language) { - FileInputStream fis = null; - InputStreamReader isr = null; - BufferedReader br = null; - try { - File file = new File(SystemConfig.LANGUAGE_PATH); - if (file.exists()) { - for (File listFile : file.listFiles()) { - if (listFile.getName().contains(language + ".properties")) { - Properties properties = new Properties(); - fis = new FileInputStream(listFile); - isr = new InputStreamReader(fis, "UTF-8"); - BufferedReader bf = new BufferedReader(isr); - properties.load(bf); - return properties.getProperty(code.toString()); - } - } - } - - } catch (FileNotFoundException e) { - log.error("文件不存在=========================="); - } catch (IOException e) { - log.error("文件读取异常=========================="); - }finally { - try { - if (ObjectUtil.isNotNull(br)) { - br.close(); - } - if (ObjectUtil.isNotNull(isr)) { - isr.close(); - } - if (ObjectUtil.isNotNull(fis)){ - fis.close(); - } - } catch (IOException e) { - e.printStackTrace(); - } - - } - log.error("=============读取多语言文本失败================== code:{} language:{}", code, language); - return null; - } - -} diff --git a/wjcy-common/src/main/java/me/zhengjie/utils/QueryHelp.java b/wjcy-common/src/main/java/me/zhengjie/utils/QueryHelp.java deleted file mode 100644 index 69cb5e2..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/utils/QueryHelp.java +++ /dev/null @@ -1,208 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.utils; - -import cn.hutool.core.collection.CollUtil; -import cn.hutool.core.collection.CollectionUtil; -import cn.hutool.core.util.ObjectUtil; -import lombok.extern.slf4j.Slf4j; -import me.zhengjie.annotation.DataPermission; -import me.zhengjie.annotation.Query; -import javax.persistence.criteria.*; -import java.lang.reflect.Field; -import java.util.*; - -/** - * @author Zheng Jie - * @date 2019-6-4 14:59:48 - */ -@Slf4j -@SuppressWarnings({"unchecked","all"}) -public class QueryHelp { - - public static Predicate getPredicate(Root root, Q query, CriteriaBuilder cb) { - List list = new ArrayList<>(); - if(query == null){ - return cb.and(list.toArray(new Predicate[0])); - } - // 数据权限验证 - DataPermission permission = query.getClass().getAnnotation(DataPermission.class); - if(permission != null){ - // 获取数据权限 - List dataScopes = SecurityUtils.getCurrentUserDataScope(); - if(CollectionUtil.isNotEmpty(dataScopes)){ - if(StringUtils.isNotBlank(permission.joinName()) && StringUtils.isNotBlank(permission.fieldName())) { - Join join = root.join(permission.joinName(), JoinType.LEFT); - list.add(getExpression(permission.fieldName(),join, root).in(dataScopes)); - } else if (StringUtils.isBlank(permission.joinName()) && StringUtils.isNotBlank(permission.fieldName())) { - list.add(getExpression(permission.fieldName(),null, root).in(dataScopes)); - } - } - } - try { - List fields = getAllFields(query.getClass(), new ArrayList<>()); - for (Field field : fields) { - boolean accessible = field.isAccessible(); - // 设置对象的访问权限,保证对private的属性的访 - field.setAccessible(true); - Query q = field.getAnnotation(Query.class); - if (q != null) { - String propName = q.propName(); - String joinName = q.joinName(); - String blurry = q.blurry(); - String attributeName = isBlank(propName) ? field.getName() : propName; - Class fieldType = field.getType(); - Object val = field.get(query); - if (ObjectUtil.isNull(val) || "".equals(val)) { - continue; - } - Join join = null; - // 模糊多字段 - if (ObjectUtil.isNotEmpty(blurry)) { - String[] blurrys = blurry.split(","); - List orPredicate = new ArrayList<>(); - for (String s : blurrys) { - orPredicate.add(cb.like(root.get(s) - .as(String.class), "%" + val.toString() + "%")); - } - Predicate[] p = new Predicate[orPredicate.size()]; - list.add(cb.or(orPredicate.toArray(p))); - continue; - } - if (ObjectUtil.isNotEmpty(joinName)) { - String[] joinNames = joinName.split(">"); - for (String name : joinNames) { - switch (q.join()) { - case LEFT: - if(ObjectUtil.isNotNull(join) && ObjectUtil.isNotNull(val)){ - join = join.join(name, JoinType.LEFT); - } else { - join = root.join(name, JoinType.LEFT); - } - break; - case RIGHT: - if(ObjectUtil.isNotNull(join) && ObjectUtil.isNotNull(val)){ - join = join.join(name, JoinType.RIGHT); - } else { - join = root.join(name, JoinType.RIGHT); - } - break; - case INNER: - if(ObjectUtil.isNotNull(join) && ObjectUtil.isNotNull(val)){ - join = join.join(name, JoinType.INNER); - } else { - join = root.join(name, JoinType.INNER); - } - break; - default: break; - } - } - } - switch (q.type()) { - case EQUAL: - list.add(cb.equal(getExpression(attributeName,join,root) - .as((Class) fieldType),val)); - break; - case GREATER_THAN: - list.add(cb.greaterThanOrEqualTo(getExpression(attributeName,join,root) - .as((Class) fieldType), (Comparable) val)); - break; - case LESS_THAN: - list.add(cb.lessThanOrEqualTo(getExpression(attributeName,join,root) - .as((Class) fieldType), (Comparable) val)); - break; - case LESS_THAN_NQ: - list.add(cb.lessThan(getExpression(attributeName,join,root) - .as((Class) fieldType), (Comparable) val)); - break; - case INNER_LIKE: - list.add(cb.like(getExpression(attributeName,join,root) - .as(String.class), "%" + val.toString() + "%")); - break; - case LEFT_LIKE: - list.add(cb.like(getExpression(attributeName,join,root) - .as(String.class), "%" + val.toString())); - break; - case RIGHT_LIKE: - list.add(cb.like(getExpression(attributeName,join,root) - .as(String.class), val.toString() + "%")); - break; - case IN: - if (CollUtil.isNotEmpty((Collection)val)) { - list.add(getExpression(attributeName,join,root).in((Collection) val)); - } - break; - case NOT_IN: - if (CollUtil.isNotEmpty((Collection)val)) { - list.add(getExpression(attributeName,join,root).in((Collection) val).not()); - } - break; - case NOT_EQUAL: - list.add(cb.notEqual(getExpression(attributeName,join,root), val)); - break; - case NOT_NULL: - list.add(cb.isNotNull(getExpression(attributeName,join,root))); - break; - case IS_NULL: - list.add(cb.isNull(getExpression(attributeName,join,root))); - break; - case BETWEEN: - List between = new ArrayList<>((List)val); - list.add(cb.between(getExpression(attributeName, join, root).as((Class) between.get(0).getClass()), - (Comparable) between.get(0), (Comparable) between.get(1))); - break; - default: break; - } - } - field.setAccessible(accessible); - } - } catch (Exception e) { - log.error(e.getMessage(), e); - } - int size = list.size(); - return cb.and(list.toArray(new Predicate[size])); - } - - @SuppressWarnings("unchecked") - private static Expression getExpression(String attributeName, Join join, Root root) { - if (ObjectUtil.isNotEmpty(join)) { - return join.get(attributeName); - } else { - return root.get(attributeName); - } - } - - private static boolean isBlank(final CharSequence cs) { - int strLen; - if (cs == null || (strLen = cs.length()) == 0) { - return true; - } - for (int i = 0; i < strLen; i++) { - if (!Character.isWhitespace(cs.charAt(i))) { - return false; - } - } - return true; - } - - public static List getAllFields(Class clazz, List fields) { - if (clazz != null) { - fields.addAll(Arrays.asList(clazz.getDeclaredFields())); - getAllFields(clazz.getSuperclass(), fields); - } - return fields; - } -} diff --git a/wjcy-common/src/main/java/me/zhengjie/utils/RedisUtils.java b/wjcy-common/src/main/java/me/zhengjie/utils/RedisUtils.java deleted file mode 100644 index c633b81..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/utils/RedisUtils.java +++ /dev/null @@ -1,903 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.utils; - -import cn.hutool.core.util.ObjectUtil; -import cn.hutool.core.util.StrUtil; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.data.redis.connection.RedisConnection; -import org.springframework.data.redis.connection.RedisConnectionFactory; -import org.springframework.data.redis.core.*; -import org.springframework.data.redis.support.atomic.RedisAtomicLong; -import org.springframework.stereotype.Component; - -import java.util.*; -import java.util.concurrent.TimeUnit; - -/** - * @author / - */ -@Component -@SuppressWarnings({"unchecked", "all"}) -public class RedisUtils { - private static final Logger log = LoggerFactory.getLogger(RedisUtils.class); - private RedisTemplate redisTemplate; - @Value("${jwt.online-key}") - private String onlineKey; - - public static String LOGIN_FAIL_COUNT = "LOGIN_FAIL_COUNT:%s"; - public static String BLOCKED_ACCOUNT = "BLOCKED_ACCOUNT:%s"; - - public RedisUtils(RedisTemplate redisTemplate) { - this.redisTemplate = redisTemplate; - } - - /** - * 指定缓存失效时间 - * - * @param key 键 - * @param time 时间(秒) - */ - public boolean expire(String key, long time) { - try { - if (time > 0) { - redisTemplate.expire(key, time, TimeUnit.SECONDS); - } - } catch (Exception e) { - log.error(e.getMessage(), e); - return false; - } - return true; - } - - /** - * 指定缓存失效时间 - * - * @param key 键 - * @param time 时间(秒) - * @param timeUnit 单位 - */ - public boolean expire(String key, long time, TimeUnit timeUnit) { - try { - if (time > 0) { - redisTemplate.expire(key, time, timeUnit); - } - } catch (Exception e) { - log.error(e.getMessage(), e); - return false; - } - return true; - } - - /** - * 根据 key 获取过期时间 - * - * @param key 键 不能为null - * @return 时间(秒) 返回0代表为永久有效 - */ - public long getExpire(Object key) { - return redisTemplate.getExpire(key, TimeUnit.SECONDS); - } - - /** - * 查找匹配key - * - * @param pattern key - * @return / - */ - public List scan(String pattern) { - ScanOptions options = ScanOptions.scanOptions().match(pattern).build(); - RedisConnectionFactory factory = redisTemplate.getConnectionFactory(); - RedisConnection rc = Objects.requireNonNull(factory).getConnection(); - Cursor cursor = rc.scan(options); - List result = new ArrayList<>(); - while (cursor.hasNext()) { - result.add(new String(cursor.next())); - } - try { - RedisConnectionUtils.releaseConnection(rc, factory); - } catch (Exception e) { - log.error(e.getMessage(), e); - } - return result; - } - - /** - * 分页查询 key - * - * @param patternKey key - * @param page 页码 - * @param size 每页数目 - * @return / - */ - public List findKeysForPage(String patternKey, int page, int size) { - ScanOptions options = ScanOptions.scanOptions().match(patternKey).build(); - RedisConnectionFactory factory = redisTemplate.getConnectionFactory(); - RedisConnection rc = Objects.requireNonNull(factory).getConnection(); - Cursor cursor = rc.scan(options); - List result = new ArrayList<>(size); - int tmpIndex = 0; - int fromIndex = page * size; - int toIndex = page * size + size; - while (cursor.hasNext()) { - if (tmpIndex >= fromIndex && tmpIndex < toIndex) { - result.add(new String(cursor.next())); - tmpIndex++; - continue; - } - // 获取到满足条件的数据后,就可以退出了 - if (tmpIndex >= toIndex) { - break; - } - tmpIndex++; - cursor.next(); - } - try { - RedisConnectionUtils.releaseConnection(rc, factory); - } catch (Exception e) { - log.error(e.getMessage(), e); - } - return result; - } - - /** - * 判断key是否存在 - * - * @param key 键 - * @return true 存在 false不存在 - */ - public boolean hasKey(String key) { - try { - return redisTemplate.hasKey(key); - } catch (Exception e) { - log.error(e.getMessage(), e); - return false; - } - } - - /** - * 删除缓存 - * - * @param key 可以传一个值 或多个 - */ - public void del(String... keys) { - if (keys != null && keys.length > 0) { - if (keys.length == 1) { - boolean result = redisTemplate.delete(keys[0]); - log.debug("--------------------------------------------"); - log.debug(new StringBuilder("删除缓存:").append(keys[0]).append(",结果:").append(result).toString()); - log.debug("--------------------------------------------"); - } else { - Set keySet = new HashSet<>(); - for (String key : keys) { - keySet.addAll(redisTemplate.keys(key)); - } - long count = redisTemplate.delete(keySet); - log.debug("--------------------------------------------"); - log.debug("成功删除缓存:" + keySet.toString()); - log.debug("缓存删除数量:" + count + "个"); - log.debug("--------------------------------------------"); - } - } - } - - /** - * setIfAbsent 如果key 不存在则 set value 并返回true - * 否则返回false; - * @param key - * @param value - * @return - */ - public Boolean setIfAbsent(String key, String value) { - - try { - return redisTemplate.opsForValue().setIfAbsent(key, value); - } catch (Exception e) { - log.error(e.getMessage(), e); - return false; - } - } - - // ============================String============================= - - /** - * 普通缓存获取 - * - * @param key 键 - * @return 值 - */ - public Object get(String key) { - return key == null ? null : redisTemplate.opsForValue().get(key); - } - - /** - * 批量获取 - * - * @param keys - * @return - */ - public List multiGet(List keys) { - Object obj = redisTemplate.opsForValue().multiGet(Collections.singleton(keys)); - return null; - } - - /** - * 普通缓存放入 - * - * @param key 键 - * @param value 值 - * @return true成功 false失败 - */ - public boolean set(String key, Object value) { - try { - redisTemplate.opsForValue().set(key, value); - return true; - } catch (Exception e) { - log.error(e.getMessage(), e); - return false; - } - } - - /** - * 普通缓存放入并设置时间 - * - * @param key 键 - * @param value 值 - * @param time 时间(秒) time要大于0 如果time小于等于0 将设置无限期 - * @return true成功 false 失败 - */ - public boolean set(String key, Object value, long time) { - try { - if (time > 0) { - redisTemplate.opsForValue().set(key, value, time, TimeUnit.SECONDS); - } else { - set(key, value); - } - return true; - } catch (Exception e) { - log.error(e.getMessage(), e); - return false; - } - } - - /** - * 普通缓存放入并设置时间 - * - * @param key 键 - * @param value 值 - * @param time 时间 - * @param timeUnit 类型 - * @return true成功 false 失败 - */ - public boolean set(String key, Object value, long time, TimeUnit timeUnit) { - try { - if (time > 0) { - redisTemplate.opsForValue().set(key, value, time, timeUnit); - } else { - set(key, value); - } - return true; - } catch (Exception e) { - log.error(e.getMessage(), e); - return false; - } - } - - // ================================Map================================= - - /** - * HashGet - * - * @param key 键 不能为null - * @param item 项 不能为null - * @return 值 - */ - public Object hget(String key, String item) { - return redisTemplate.opsForHash().get(key, item); - } - - /** - * 获取hashKey对应的所有键值 - * - * @param key 键 - * @return 对应的多个键值 - */ - public Map hmget(String key) { - return redisTemplate.opsForHash().entries(key); - - } - - /** - * HashSet - * - * @param key 键 - * @param map 对应多个键值 - * @return true 成功 false 失败 - */ - public boolean hmset(String key, Map map) { - try { - redisTemplate.opsForHash().putAll(key, map); - return true; - } catch (Exception e) { - log.error(e.getMessage(), e); - return false; - } - } - - /** - * HashSet 并设置时间 - * - * @param key 键 - * @param map 对应多个键值 - * @param time 时间(秒) - * @return true成功 false失败 - */ - public boolean hmset(String key, Map map, long time) { - try { - redisTemplate.opsForHash().putAll(key, map); - if (time > 0) { - expire(key, time); - } - return true; - } catch (Exception e) { - log.error(e.getMessage(), e); - return false; - } - } - - /** - * 向一张hash表中放入数据,如果不存在将创建 - * - * @param key 键 - * @param item 项 - * @param value 值 - * @return true 成功 false失败 - */ - public boolean hset(String key, String item, Object value) { - try { - redisTemplate.opsForHash().put(key, item, value); - return true; - } catch (Exception e) { - log.error(e.getMessage(), e); - return false; - } - } - - /** - * 向一张hash表中放入数据,如果不存在将创建 - * - * @param key 键 - * @param item 项 - * @param value 值 - * @param time 时间(秒) 注意:如果已存在的hash表有时间,这里将会替换原有的时间 - * @return true 成功 false失败 - */ - public boolean hset(String key, String item, Object value, long time) { - try { - redisTemplate.opsForHash().put(key, item, value); - if (time > 0) { - expire(key, time); - } - return true; - } catch (Exception e) { - log.error(e.getMessage(), e); - return false; - } - } - - /** - * 删除hash表中的值 - * - * @param key 键 不能为null - * @param item 项 可以使多个 不能为null - */ - public void hdel(String key, Object... item) { - redisTemplate.opsForHash().delete(key, item); - } - - /** - * 判断hash表中是否有该项的值 - * - * @param key 键 不能为null - * @param item 项 不能为null - * @return true 存在 false不存在 - */ - public boolean hHasKey(String key, String item) { - return redisTemplate.opsForHash().hasKey(key, item); - } - - /** - * hash递增 如果不存在,就会创建一个 并把新增后的值返回 - * - * @param key 键 - * @param item 项 - * @param by 要增加几(大于0) - * @return - */ - public double hincr(String key, String item, double by) { - return redisTemplate.opsForHash().increment(key, item, by); - } - - /** - * 自增 - * @param key - * @param liveTime 单位秒 - * @return - */ - public Long incrAndExpire(String key, long liveTime) { - RedisAtomicLong entityIdCounter = new RedisAtomicLong(key, redisTemplate.getConnectionFactory()); - Long increment = entityIdCounter.getAndIncrement(); - - if ((null == increment || increment.longValue() == 0) && liveTime > 0) {//初始设置过期时间 - entityIdCounter.expire(liveTime, TimeUnit.SECONDS); - } - - return Long.valueOf(StrUtil.toString(get(key))); - } - - /** - * hash递减 - * - * @param key 键 - * @param item 项 - * @param by 要减少记(小于0) - * @return - */ - public double hdecr(String key, String item, double by) { - return redisTemplate.opsForHash().increment(key, item, -by); - } - - // ============================set============================= - - /** - * 根据key获取Set中的所有值 - * - * @param key 键 - * @return - */ - public Set sGet(String key) { - try { - return redisTemplate.opsForSet().members(key); - } catch (Exception e) { - log.error(e.getMessage(), e); - return null; - } - } - - /** - * 随机返回并删除名称为key的set中的一个元素 - * - * @param key 键 - * @return - */ - public ZSetOperations.TypedTuple randomObj(String key) { - try { - Long xxx = redisTemplate.opsForZSet().size(key); - if (ObjectUtil.isEmpty(xxx)) { - return null; - } - Set> allSet = redisTemplate.opsForZSet().rangeWithScores(key,0,-1); - // 随机数 - int leng = allSet.size(); - Random r = new Random(); - Integer arrayindex = r.nextInt(leng); - List> results = new ArrayList<>(allSet); - ZSetOperations.TypedTuple randomObj = results.get(arrayindex); - return randomObj; - } catch (Exception e) { - log.error(e.getMessage(), e); - return null; - } - } - - /** - * 根据value从一个set中查询,是否存在 - * - * @param key 键 - * @param value 值 - * @return true 存在 false不存在 - */ - public boolean sHasKey(String key, Object value) { - try { - return redisTemplate.opsForSet().isMember(key, value); - } catch (Exception e) { - log.error(e.getMessage(), e); - return false; - } - } - - /** - * 将数据放入set缓存 - * - * @param key 键 - * @param values 值 可以是多个 - * @return 成功个数 - */ - public long sSet(String key, Object... values) { - try { - return redisTemplate.opsForSet().add(key, values); - } catch (Exception e) { - log.error(e.getMessage(), e); - return 0; - } - } - - /** - * 将set数据放入缓存 - * - * @param key 键 - * @param time 时间(秒) - * @param values 值 可以是多个 - * @return 成功个数 - */ - public long sSetAndTime(String key, long time, Object... values) { - try { - Long count = redisTemplate.opsForSet().add(key, values); - if (time > 0) { - expire(key, time); - } - return count; - } catch (Exception e) { - log.error(e.getMessage(), e); - return 0; - } - } - - /** - * 获取set缓存的长度 - * - * @param key 键 - * @return - */ - public long sGetSetSize(String key) { - try { - return redisTemplate.opsForSet().size(key); - } catch (Exception e) { - log.error(e.getMessage(), e); - return 0; - } - } - - /** - * 移除值为value的 - * - * @param key 键 - * @param values 值 可以是多个 - * @return 移除的个数 - */ - public long setRemove(String key, Object... values) { - try { - Long count = redisTemplate.opsForSet().remove(key, values); - return count; - } catch (Exception e) { - log.error(e.getMessage(), e); - return 0; - } - } - - // ===============================list================================= - - /** - * 获取list缓存的内容 - * - * @param key 键 - * @param start 开始 - * @param end 结束 0 到 -1代表所有值 - * @return - */ - public List lGet(String key, long start, long end) { - try { - return redisTemplate.opsForList().range(key, start, end); - } catch (Exception e) { - log.error(e.getMessage(), e); - return null; - } - } - - /** - * rpop - * - * @param key 键 - * @return - */ - public Object rPop(String key) { - try { - return redisTemplate.opsForList().rightPop(key); - } catch (Exception e) { - log.error(e.getMessage(), e); - return null; - } - } - - /** - * rpop - * - * @param key 键 - * @return - */ - public Object lPop(String key) { - try { - return redisTemplate.opsForList().leftPop(key); - } catch (Exception e) { - log.error(e.getMessage(), e); - return null; - } - } - - /** - * rightPush - * - * @param key 键 - * @return - */ - public Object rPush(String key, Object object) { - try { - return redisTemplate.opsForList().rightPush(key, object); - } catch (Exception e) { - log.error(e.getMessage(), e); - return null; - } - } - - /** - * lPush - * - * @param key 键 - * @return - */ - public Object lPush(String key, Object object) { - try { - return redisTemplate.opsForList().leftPush(key, object); - } catch (Exception e) { - log.error(e.getMessage(), e); - return null; - } - } - - /** - * 获取list缓存的长度 - * - * @param key 键 - * @return - */ - public long lGetListSize(String key) { - try { - return redisTemplate.opsForList().size(key); - } catch (Exception e) { - log.error(e.getMessage(), e); - return 0; - } - } - - /** - * 通过索引 获取list中的值 - * - * @param key 键 - * @param index 索引 index>=0时, 0 表头,1 第二个元素,依次类推;index<0时,-1,表尾,-2倒数第二个元素,依次类推 - * @return - */ - public Object lGetIndex(String key, long index) { - try { - return redisTemplate.opsForList().index(key, index); - } catch (Exception e) { - log.error(e.getMessage(), e); - return null; - } - } - - /** - * 将list放入缓存 - * - * @param key 键 - * @param value 值 - * @return - */ - public boolean lSet(String key, Object value) { - try { - redisTemplate.opsForList().leftPush(key, value); - return true; - } catch (Exception e) { - log.error(e.getMessage(), e); - return false; - } - } - - /** - * 将list放入缓存 - * - * @param key 键 - * @param value 值 - * @param time 时间(秒) - * @return - */ - public boolean lSet(String key, Object value, long time) { - try { - redisTemplate.opsForList().rightPush(key, value); - if (time > 0) { - expire(key, time); - } - return true; - } catch (Exception e) { - log.error(e.getMessage(), e); - return false; - } - } - - /** - * 将String放入缓存 - * - * @param key 键 - * @param value 值 - * @param time 时间(秒) - * @return - */ - public boolean put(String key, Object value, long time) { - try { - redisTemplate.opsForValue().set(key, value); - if (time > 0) { - expire(key, time); - } - return true; - } catch (Exception e) { - log.error(e.getMessage(), e); - return false; - } - } - - /** - * 将list放入缓存 - * - * @param key 键 - * @param value 值 - * @return - */ - public boolean lSet(String key, List value) { - try { - redisTemplate.opsForList().rightPushAll(key, value); - return true; - } catch (Exception e) { - log.error(e.getMessage(), e); - return false; - } - } - - /** - * 将list放入缓存 - * - * @param key 键 - * @param value 值 - * @param time 时间(秒) - * @return - */ - public boolean lSet(String key, List value, long time) { - try { - redisTemplate.opsForList().rightPushAll(key, value); - if (time > 0) { - expire(key, time); - } - return true; - } catch (Exception e) { - log.error(e.getMessage(), e); - return false; - } - } - - /** - * 根据索引修改list中的某条数据 - * - * @param key 键 - * @param index 索引 - * @param value 值 - * @return / - */ - public boolean lUpdateIndex(String key, long index, Object value) { - try { - redisTemplate.opsForList().set(key, index, value); - return true; - } catch (Exception e) { - log.error(e.getMessage(), e); - return false; - } - } - - /** - * 移除N个值为value - * - * @param key 键 - * @param count 移除多少个 - * @param value 值 - * @return 移除的个数 - */ - public long lRemove(String key, long count, Object value) { - try { - return redisTemplate.opsForList().remove(key, count, value); - } catch (Exception e) { - log.error(e.getMessage(), e); - return 0; - } - } - - /** - * @param prefix 前缀 - * @param ids id - */ - public void delByKeys(String prefix, Set ids) { - Set keys = new HashSet<>(); - for (Long id : ids) { - keys.addAll(redisTemplate.keys(new StringBuffer(prefix).append(id).toString())); - } - long count = redisTemplate.delete(keys); - // 此处提示可自行删除 - log.debug("--------------------------------------------"); - log.debug("成功删除缓存:" + keys.toString()); - log.debug("缓存删除数量:" + count + "个"); - log.debug("--------------------------------------------"); - } - - // ===============================setsort================================= - - /** - * 添加元素到变量中同时指定元素的分值。 - * @param key - * @param value - * @param score - * @return - */ - public boolean zSortAdd(String key, Object value, double score) { - try { - redisTemplate.opsForZSet().add(key, value, score); - return true; - } catch (Exception e) { - log.error(e.getMessage(), e); - return false; - } - } - - /** - * 根据分值移除区间元素。 - * @param key - * @param min - * @param max - * @return - */ - public Long removeRangeByScore(String key, double min, double max) { - return redisTemplate.opsForZSet().removeRangeByScore(key, min, max); - } - - /** - * 获取变量指定区间的元素。 - * @param key - * @param start - * @param end - * @return - */ - public Set range(String key, long start, long end) { - return redisTemplate.opsForZSet().range(key, start, end); - } - - /** - * 返回有序集 key 中,成员 member 的 score 值。 - * 如果 member 元素不是有序集 key 的成员,或 key 不存在,返回 nil 。 - * @param key - * @param member - * @return - */ - public Double zscore(String key, Object member) { - return redisTemplate.opsForZSet().score(key, member); - } -} diff --git a/wjcy-common/src/main/java/me/zhengjie/utils/RedissonUtil.java b/wjcy-common/src/main/java/me/zhengjie/utils/RedissonUtil.java deleted file mode 100644 index f02ed00..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/utils/RedissonUtil.java +++ /dev/null @@ -1,167 +0,0 @@ -package me.zhengjie.utils; - - -import lombok.extern.slf4j.Slf4j; -import me.zhengjie.exception.BadRequestException; -import org.redisson.api.*; -import org.redisson.config.Config; -import org.springframework.stereotype.Component; - -import javax.annotation.Resource; -import java.io.IOException; -import java.util.concurrent.TimeUnit; - -/** - *

- * redisson - *

- * - * @Author xx - * @Date 2021/8/11 - **/ -@Slf4j -@Component("redissonUtil") -public class RedissonUtil { - - @Resource - private RedissonClient redissonClient; - - public void getRedissonClient() throws IOException { - Config config = redissonClient.getConfig(); -// System.out.println(config.toJSON().toString()); - } - - /**` - * 获取字符串对象 - * - * @param objectName - * @return - */ - public RBucket getRBucket(String objectName) { - RBucket bucket = redissonClient.getBucket(objectName); - return bucket; - } - - /** - * 获取Map对象 - * - * @param objectName - * @return - */ - public RMap getRMap(String objectName) { - RMap map = redissonClient.getMap(objectName); - return map; - } - - /** - * 获取有序集合 - * - * @param objectName - * @return - */ - public RSortedSet getRSortedSet(String objectName) { - RSortedSet sortedSet = redissonClient.getSortedSet(objectName); - return sortedSet; - } - - /** - * 获取集合 - * - * @param objectName - * @return - */ - public RSet getRSet(String objectName) { - RSet rSet = redissonClient.getSet(objectName); - return rSet; - } - - /** - * 获取列表 - * - * @param objectName - * @return - */ - public RList getRList(String objectName) { - RList rList = redissonClient.getList(objectName); - return rList; - } - - /** - * 获取队列 - * - * @param objectName - * @return - */ - public RQueue getRQueue(String objectName) { - RQueue rQueue = redissonClient.getQueue(objectName); - return rQueue; - } - - /** - * 获取双端队列 - * - * @param objectName - * @return - */ - public RDeque getRDeque(String objectName) { - RDeque rDeque = redissonClient.getDeque(objectName); - return rDeque; - } - - - /** - * 获取锁 - * - * @param objectName - * @return - */ - public RLock getRLock(String objectName) { - RLock rLock = redissonClient.getLock(objectName); - return rLock; - } - - /** - * 获取读取锁 - * - * @param objectName - * @return - */ - public RReadWriteLock getRWLock(String objectName) { - RReadWriteLock rwlock = redissonClient.getReadWriteLock(objectName); - return rwlock; - } - - /** - * 获取原子数 - * - * @param objectName - * @return - */ - public RAtomicLong getRAtomicLong(String objectName) { - RAtomicLong rAtomicLong = redissonClient.getAtomicLong(objectName); - return rAtomicLong; - } - - /** - * 获取记数锁 - * - * @param objectName - * @return - */ - public RCountDownLatch getRCountDownLatch(String objectName) { - RCountDownLatch rCountDownLatch = redissonClient.getCountDownLatch(objectName); - return rCountDownLatch; - } - - /** - * 获取消息的Topic - * - * @param objectName - * @return - */ - public RTopic getRTopic(String objectName) { - RTopic rTopic = redissonClient.getTopic(objectName); - return rTopic; - } -} - diff --git a/wjcy-common/src/main/java/me/zhengjie/utils/RequestHolder.java b/wjcy-common/src/main/java/me/zhengjie/utils/RequestHolder.java deleted file mode 100644 index 2720ae5..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/utils/RequestHolder.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.utils; - -import cn.hutool.core.convert.Convert; -import cn.hutool.core.util.ObjectUtil; -import me.zhengjie.enums.LanguageEnum; -import org.springframework.web.context.request.RequestAttributes; -import org.springframework.web.context.request.RequestContextHolder; -import org.springframework.web.context.request.ServletRequestAttributes; -import javax.servlet.http.HttpServletRequest; -import java.util.Objects; - -/** - * 获取 HttpServletRequest - * @author Zheng Jie - * @date 2018-11-24 - */ -public class RequestHolder { - - public static HttpServletRequest getHttpServletRequest() { - return ((ServletRequestAttributes) Objects.requireNonNull(RequestContextHolder.getRequestAttributes())).getRequest(); - } - - public static String getLanguage() { - RequestAttributes requestAttributes = RequestContextHolder.getRequestAttributes(); - if (ObjectUtil.isNull(requestAttributes) || !(requestAttributes instanceof ServletRequestAttributes)) { - return LanguageEnum.ZH.getValue(); - } - HttpServletRequest request = ((ServletRequestAttributes) requestAttributes).getRequest(); - if (ObjectUtil.isNull(request)) { - return LanguageEnum.ZH.getValue(); - } - return Convert.toStr(request.getHeader("language"), LanguageEnum.ZH.getValue()); - } - -} diff --git a/wjcy-common/src/main/java/me/zhengjie/utils/RsaUtils.java b/wjcy-common/src/main/java/me/zhengjie/utils/RsaUtils.java deleted file mode 100644 index b42cec7..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/utils/RsaUtils.java +++ /dev/null @@ -1,202 +0,0 @@ -package me.zhengjie.utils; - -import org.apache.commons.codec.binary.Base64; -import javax.crypto.Cipher; -import java.io.ByteArrayOutputStream; -import java.security.*; -import java.security.interfaces.RSAPrivateKey; -import java.security.interfaces.RSAPublicKey; -import java.security.spec.PKCS8EncodedKeySpec; -import java.security.spec.X509EncodedKeySpec; - -/** - * @author https://www.cnblogs.com/nihaorz/p/10690643.html - * @description Rsa 工具类,公钥私钥生成,加解密 - * @date 2020-05-18 - **/ -public class RsaUtils { - - private static final String SRC = "panpan@123"; - - public static void main(String[] args) throws Exception { -// System.out.println("\n"); -// RsaKeyPair keyPair = generateKeyPair(); -// System.out.println("公钥:" + keyPair.getPublicKey()); -// System.out.println("私钥:" + keyPair.getPrivateKey()); -// System.out.println("\n"); -// test1(keyPair); -// System.out.println("\n"); -// test2(keyPair); -// System.out.println("\n"); - - - String text1 = encryptByPublicKey("MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCdFXJjqlBdh1ri8hS2bEvwjREJyRAqruwtf+c/bgFiBOxuW4LAVIiMnimfnmLiL0/h0Q1YLKjrnFkOwXLvZTgwwCiX1uF5WhOyCsGEEQDhfvFTlInemFNdi8zqWxoONbRBb9wJbqS8K6LtzXu2Oltu5hzqQXKwY+sNCVbKCrt/KwIDAQAB", RsaUtils.SRC); - System.out.println(text1); - } - - /** - * 公钥加密私钥解密 - */ - private static void test1(RsaKeyPair keyPair) throws Exception { - System.out.println("***************** 公钥加密私钥解密开始 *****************"); - String text1 = encryptByPublicKey(keyPair.getPublicKey(), RsaUtils.SRC); - String text2 = decryptByPrivateKey(keyPair.getPrivateKey(), text1); - System.out.println("加密前:" + RsaUtils.SRC); - System.out.println("加密后:" + text1); - System.out.println("解密后:" + text2); - if (RsaUtils.SRC.equals(text2)) { - System.out.println("解密字符串和原始字符串一致,解密成功"); - } else { - System.out.println("解密字符串和原始字符串不一致,解密失败"); - } - System.out.println("***************** 公钥加密私钥解密结束 *****************"); - } - - /** - * 私钥加密公钥解密 - * @throws Exception / - */ - private static void test2(RsaKeyPair keyPair) throws Exception { - System.out.println("***************** 私钥加密公钥解密开始 *****************"); - String text1 = encryptByPrivateKey(keyPair.getPrivateKey(), RsaUtils.SRC); - String text2 = decryptByPublicKey(keyPair.getPublicKey(), text1); - System.out.println("加密前:" + RsaUtils.SRC); - System.out.println("加密后:" + text1); - System.out.println("解密后:" + text2); - if (RsaUtils.SRC.equals(text2)) { - System.out.println("解密字符串和原始字符串一致,解密成功"); - } else { - System.out.println("解密字符串和原始字符串不一致,解密失败"); - } - System.out.println("***************** 私钥加密公钥解密结束 *****************"); - } - - /** - * 公钥解密 - * - * @param publicKeyText 公钥 - * @param text 待解密的信息 - * @return / - * @throws Exception / - */ - public static String decryptByPublicKey(String publicKeyText, String text) throws Exception { - X509EncodedKeySpec x509EncodedKeySpec = new X509EncodedKeySpec(Base64.decodeBase64(publicKeyText)); - KeyFactory keyFactory = KeyFactory.getInstance("RSA"); - PublicKey publicKey = keyFactory.generatePublic(x509EncodedKeySpec); - Cipher cipher = Cipher.getInstance("RSA"); - cipher.init(Cipher.DECRYPT_MODE, publicKey); - byte[] result = doLongerCipherFinal(Cipher.DECRYPT_MODE, cipher, Base64.decodeBase64(text)); - return new String(result); - } - - /** - * 私钥加密 - * - * @param privateKeyText 私钥 - * @param text 待加密的信息 - * @return / - * @throws Exception / - */ - public static String encryptByPrivateKey(String privateKeyText, String text) throws Exception { - PKCS8EncodedKeySpec pkcs8EncodedKeySpec = new PKCS8EncodedKeySpec(Base64.decodeBase64(privateKeyText)); - KeyFactory keyFactory = KeyFactory.getInstance("RSA"); - PrivateKey privateKey = keyFactory.generatePrivate(pkcs8EncodedKeySpec); - Cipher cipher = Cipher.getInstance("RSA"); - cipher.init(Cipher.ENCRYPT_MODE, privateKey); - byte[] result = doLongerCipherFinal(Cipher.ENCRYPT_MODE, cipher, text.getBytes()); - return Base64.encodeBase64String(result); - } - - /** - * 私钥解密 - * - * @param privateKeyText 私钥 - * @param text 待解密的文本 - * @return / - * @throws Exception / - */ - public static String decryptByPrivateKey(String privateKeyText, String text) throws Exception { - PKCS8EncodedKeySpec pkcs8EncodedKeySpec5 = new PKCS8EncodedKeySpec(Base64.decodeBase64(privateKeyText)); - KeyFactory keyFactory = KeyFactory.getInstance("RSA"); - PrivateKey privateKey = keyFactory.generatePrivate(pkcs8EncodedKeySpec5); - Cipher cipher = Cipher.getInstance("RSA"); - cipher.init(Cipher.DECRYPT_MODE, privateKey); - byte[] result = doLongerCipherFinal(Cipher.DECRYPT_MODE, cipher, Base64.decodeBase64(text)); - return new String(result); - } - - /** - * 公钥加密 - * - * @param publicKeyText 公钥 - * @param text 待加密的文本 - * @return / - */ - public static String encryptByPublicKey(String publicKeyText, String text) throws Exception { - X509EncodedKeySpec x509EncodedKeySpec2 = new X509EncodedKeySpec(Base64.decodeBase64(publicKeyText)); - KeyFactory keyFactory = KeyFactory.getInstance("RSA"); - PublicKey publicKey = keyFactory.generatePublic(x509EncodedKeySpec2); - Cipher cipher = Cipher.getInstance("RSA"); - cipher.init(Cipher.ENCRYPT_MODE, publicKey); - byte[] result = doLongerCipherFinal(Cipher.ENCRYPT_MODE, cipher, text.getBytes()); - return Base64.encodeBase64String(result); - } - - private static byte[] doLongerCipherFinal(int opMode,Cipher cipher, byte[] source) throws Exception { - ByteArrayOutputStream out = new ByteArrayOutputStream(); - if (opMode == Cipher.DECRYPT_MODE) { - out.write(cipher.doFinal(source)); - } else { - int offset = 0; - int totalSize = source.length; - while (totalSize - offset > 0) { - int size = Math.min(cipher.getOutputSize(0) - 11, totalSize - offset); - out.write(cipher.doFinal(source, offset, size)); - offset += size; - } - } - out.close(); - return out.toByteArray(); - } - - /** - * 构建RSA密钥对 - * - * @return / - * @throws NoSuchAlgorithmException / - */ - public static RsaKeyPair generateKeyPair() throws NoSuchAlgorithmException { - KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("RSA"); - keyPairGenerator.initialize(1024); - KeyPair keyPair = keyPairGenerator.generateKeyPair(); - RSAPublicKey rsaPublicKey = (RSAPublicKey) keyPair.getPublic(); - RSAPrivateKey rsaPrivateKey = (RSAPrivateKey) keyPair.getPrivate(); - String publicKeyString = Base64.encodeBase64String(rsaPublicKey.getEncoded()); - String privateKeyString = Base64.encodeBase64String(rsaPrivateKey.getEncoded()); - return new RsaKeyPair(publicKeyString, privateKeyString); - } - - - /** - * RSA密钥对对象 - */ - public static class RsaKeyPair { - - private final String publicKey; - private final String privateKey; - - public RsaKeyPair(String publicKey, String privateKey) { - this.publicKey = publicKey; - this.privateKey = privateKey; - } - - public String getPublicKey() { - return publicKey; - } - - public String getPrivateKey() { - return privateKey; - } - - } -} diff --git a/wjcy-common/src/main/java/me/zhengjie/utils/SecurityUtils.java b/wjcy-common/src/main/java/me/zhengjie/utils/SecurityUtils.java deleted file mode 100644 index dfeee43..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/utils/SecurityUtils.java +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.utils; - -import cn.hutool.json.JSONArray; -import cn.hutool.json.JSONObject; -import cn.hutool.json.JSONUtil; -import lombok.extern.slf4j.Slf4j; -import me.zhengjie.exception.BadRequestException; -import me.zhengjie.utils.enums.DataScopeEnum; -import org.springframework.http.HttpStatus; -import org.springframework.security.core.Authentication; -import org.springframework.security.core.context.SecurityContextHolder; -import org.springframework.security.core.userdetails.UserDetails; -import org.springframework.security.core.userdetails.UserDetailsService; -import java.util.List; - -/** - * 获取当前登录的用户 - * @author Zheng Jie - * @date 2019-01-17 - */ -@Slf4j -public class SecurityUtils { - - /** - * 获取当前登录的用户 - * @return UserDetails - */ - public static UserDetails getCurrentUser() { - UserDetailsService userDetailsService = SpringContextHolder.getBean(UserDetailsService.class); - return userDetailsService.loadUserByUsername(getCurrentUsername()); - } - - /** - * 获取系统用户名称 - * - * @return 系统用户名称 - */ - public static String getCurrentUsername() { - final Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); - if (authentication == null) { - throw new BadRequestException(HttpStatus.UNAUTHORIZED, "当前登录状态过期"); - } - if (authentication.getPrincipal() instanceof UserDetails) { - UserDetails userDetails = (UserDetails) authentication.getPrincipal(); - return userDetails.getUsername(); - } - throw new BadRequestException(HttpStatus.UNAUTHORIZED, "找不到当前登录的信息"); - } - - /** - * 获取系统用户ID - * @return 系统用户ID - */ - public static Long getCurrentUserId() { - UserDetails userDetails = getCurrentUser(); - return new JSONObject(new JSONObject(userDetails).get("user")).get("id", Long.class); - } - - /** - * 是否是总商户号 - * @return true:是 - */ - public static boolean isAdmin() { - UserDetails userDetails = getCurrentUser(); - return new JSONObject(new JSONObject(userDetails).get("user")).get("isAdmin", Boolean.class); - } - - - public static boolean isNotAdmin() { - return !isAdmin(); - } - - /** - * 获取当前用户的数据权限 - * @return / - */ - public static List getCurrentUserDataScope(){ - UserDetails userDetails = getCurrentUser(); - JSONArray array = JSONUtil.parseArray(new JSONObject(userDetails).get("dataScopes")); - return JSONUtil.toList(array,Long.class); - } - - /** - * 获取数据权限级别 - * @return 级别 - */ - public static String getDataScopeType() { - List dataScopes = getCurrentUserDataScope(); - if(dataScopes.size() != 0){ - return ""; - } - return DataScopeEnum.ALL.getValue(); - } -} diff --git a/wjcy-common/src/main/java/me/zhengjie/utils/ServletUtils.java b/wjcy-common/src/main/java/me/zhengjie/utils/ServletUtils.java deleted file mode 100644 index 3c68d32..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/utils/ServletUtils.java +++ /dev/null @@ -1,184 +0,0 @@ -package me.zhengjie.utils; - -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.net.URLDecoder; -import java.net.URLEncoder; -import java.util.Collections; -import java.util.HashMap; -import java.util.Map; -import javax.servlet.ServletRequest; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; - -import cn.hutool.core.convert.Convert; -import org.springframework.web.context.request.RequestAttributes; -import org.springframework.web.context.request.RequestContextHolder; -import org.springframework.web.context.request.ServletRequestAttributes; - -/** - * 客户端工具类 - * - * @author - */ -public class ServletUtils -{ - /** - * 获取String参数 - */ - public static String getParameter(String name) - { - return getRequest().getParameter(name); - } - - /** - * 获取String参数 - */ - public static String getParameter(String name, String defaultValue) - { - return Convert.toStr(getRequest().getParameter(name), defaultValue); - } - - /** - * 获取Integer参数 - */ - public static Integer getParameterToInt(String name) - { - return Convert.toInt(getRequest().getParameter(name)); - } - - /** - * 获取Integer参数 - */ - public static Integer getParameterToInt(String name, Integer defaultValue) - { - return Convert.toInt(getRequest().getParameter(name), defaultValue); - } - - /** - * 获取Boolean参数 - */ - public static Boolean getParameterToBool(String name) - { - return Convert.toBool(getRequest().getParameter(name)); - } - - /** - * 获取Boolean参数 - */ - public static Boolean getParameterToBool(String name, Boolean defaultValue) - { - return Convert.toBool(getRequest().getParameter(name), defaultValue); - } - - /** - * 获得所有请求参数 - * - * @param request 请求对象{@link ServletRequest} - * @return Map - */ - public static Map getParams(ServletRequest request) - { - final Map map = request.getParameterMap(); - return Collections.unmodifiableMap(map); - } - - /** - * 获得所有请求参数 - * - * @param request 请求对象{@link ServletRequest} - * @return Map - */ - public static Map getParamMap(ServletRequest request) - { - Map params = new HashMap<>(); - for (Map.Entry entry : getParams(request).entrySet()) - { - params.put(entry.getKey(), StringUtils.join(entry.getValue(), ",")); - } - return params; - } - - /** - * 获取request - */ - public static HttpServletRequest getRequest() - { - return getRequestAttributes().getRequest(); - } - - /** - * 获取response - */ - public static HttpServletResponse getResponse() - { - return getRequestAttributes().getResponse(); - } - - /** - * 获取session - */ - public static HttpSession getSession() - { - return getRequest().getSession(); - } - - public static ServletRequestAttributes getRequestAttributes() - { - RequestAttributes attributes = RequestContextHolder.getRequestAttributes(); - return (ServletRequestAttributes) attributes; - } - - /** - * 将字符串渲染到客户端 - * - * @param response 渲染对象 - * @param string 待渲染的字符串 - */ - public static void renderString(HttpServletResponse response, String string) - { - try - { - response.setStatus(200); - response.setContentType("application/json"); - response.setCharacterEncoding("utf-8"); - response.getWriter().print(string); - } - catch (IOException e) - { - e.printStackTrace(); - } - } - - /** - * 是否是Ajax异步请求 - * - * @param request - */ - public static boolean isAjaxRequest(HttpServletRequest request) - { - String accept = request.getHeader("accept"); - if (accept != null && accept.contains("application/json")) - { - return true; - } - - String xRequestedWith = request.getHeader("X-Requested-With"); - if (xRequestedWith != null && xRequestedWith.contains("XMLHttpRequest")) - { - return true; - } - - String uri = request.getRequestURI(); - if (NewStringUtils.inStringIgnoreCase(uri, ".json", ".xml")) - { - return true; - } - - String ajax = request.getParameter("__ajax"); - return NewStringUtils.inStringIgnoreCase(ajax, "json", "xml"); - } - - -} diff --git a/wjcy-common/src/main/java/me/zhengjie/utils/SpringContextHolder.java b/wjcy-common/src/main/java/me/zhengjie/utils/SpringContextHolder.java deleted file mode 100644 index 4f3aaf6..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/utils/SpringContextHolder.java +++ /dev/null @@ -1,151 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.utils; - -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 java.util.ArrayList; -import java.util.List; -import java.util.Map; - -/** - * @author Jie - * @date 2019-01-07 - */ -@Slf4j -public class SpringContextHolder 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) { - SpringContextHolder.CALL_BACKS.add(callBack); - } else { - log.warn("CallBack:{} 已无法添加!立即执行", callBack.getCallBackName()); - callBack.executor(); - } - } - - /** - * 从静态变量applicationContext中取得Bean, 自动转型为所赋值对象的类型. - */ - @SuppressWarnings("unchecked") - public static T getBean(String name) { - assertContextInjected(); - return (T) applicationContext.getBean(name); - } - - public static Map getBeansOfType(Class tClass) { - assertContextInjected(); - return applicationContext.getBeansOfType(tClass); - } - - /** - * 从静态变量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() { - SpringContextHolder.clearHolder(); - } - - @Override - public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { - if (SpringContextHolder.applicationContext != null) { - log.warn("SpringContextHolder中的ApplicationContext被覆盖, 原有ApplicationContext为:" + SpringContextHolder.applicationContext); - } - SpringContextHolder.applicationContext = applicationContext; - if (addCallback) { - for (CallBack callBack : SpringContextHolder.CALL_BACKS) { - callBack.executor(); - } - CALL_BACKS.clear(); - } - SpringContextHolder.addCallback = false; - } -} diff --git a/wjcy-common/src/main/java/me/zhengjie/utils/StringUtil.java b/wjcy-common/src/main/java/me/zhengjie/utils/StringUtil.java deleted file mode 100644 index c2c474d..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/utils/StringUtil.java +++ /dev/null @@ -1,200 +0,0 @@ -package me.zhengjie.utils; - - -import cn.hutool.core.convert.Convert; -import cn.hutool.core.util.ObjectUtil; - -import java.text.SimpleDateFormat; -import java.time.LocalDate; -import java.util.Calendar; -import java.util.LinkedList; -import java.util.List; -/** - *

- * 驼峰与下划线的属性名互相转换 - *

- * - * @Author xx - * @Date 2021/7/20 - **/ -public class StringUtil { - - /** - * 先按英文逗号打散成字符串数组,在随机从中选择一个返回 - * @author: zeng - */ - public static String spiltAndRandom(String str){ - if (ObjectUtil.isEmpty(str)) { - return null; - } - String[] split = str.split(","); - - int randomNum = (int) (Math.random() * split.length); - return split[randomNum]; - } - - /** - * 验证4段ip地址是否符合规范,并且开始的ip不能大于结束的ip - * - * @return - */ - public static boolean verifyIpAddr(String beginIp, String endIp) { - String[] beginIPsplit = beginIp.split("\\."); - String[] endIPsplit = endIp.split("\\."); - if (beginIPsplit.length == 4 && endIPsplit.length == 4) { - for (int i = 0; i < 4; i++) { - if (Convert.toInt(beginIPsplit[i]) < 0 || Convert.toInt(beginIPsplit[i]) > 255) { - return false; - } - if (Convert.toInt(endIPsplit[i]) < 0 || Convert.toInt(endIPsplit[i]) > 255) { - return false; - } -// if (Convert.toInt(beginIPsplit[i]) > Convert.toInt(endIPsplit[i])) { -// return false; -// } - } - return true; - } - return false; - } - - /** - * 转换为下划线 - * - * @param camelCaseName - * @return - */ - public static String underscoreName(String camelCaseName) { - StringBuilder result = new StringBuilder(); - if (camelCaseName != null && camelCaseName.length() > 0) { - result.append(camelCaseName.substring(0, 1).toLowerCase()); - for (int i = 1; i < camelCaseName.length(); i++) { - char ch = camelCaseName.charAt(i); - if (Character.isUpperCase(ch)) { - result.append("_"); - result.append(Character.toLowerCase(ch)); - } else { - result.append(ch); - } - } - } - return result.toString(); - } - - /** - * 转换为驼峰 - * - * @param underscoreName - * @return - */ - public static String camelCaseName(String underscoreName) { - StringBuilder result = new StringBuilder(); - if (underscoreName != null && underscoreName.length() > 0) { - boolean flag = false; - for (int i = 0; i < underscoreName.length(); i++) { - char ch = underscoreName.charAt(i); - if ("_".charAt(0) == ch) { - flag = true; - } else { - if (flag) { - result.append(Character.toUpperCase(ch)); - flag = false; - } else { - result.append(ch); - } - } - } - } - return result.toString(); - } - - public static String getDeviceType(String userAgent) { - if (ObjectUtil.isNotEmpty(userAgent)) { - - userAgent = userAgent.toUpperCase(); - - if (userAgent.contains("WINDOWS")) { - return "WINDOWS"; - } - if (userAgent.contains("IPHONE")) { - return "IOS"; - } - if (userAgent.contains("HUAWEI")) { - return "华为"; - } - if (userAgent.contains("MI")) { - return "小米"; - } - if (userAgent.contains("VIVO")) { - return "VIVO"; - } - if (userAgent.contains("OPPO")) { - return "OPPO"; - } - if (userAgent.contains("MEIZU")) { - return "魅族"; - } - if (userAgent.contains("SM-")) { - return "三星"; - } - if (userAgent.contains("ANDROID")){ - return "安卓"; - } - } - return "未知"; - } - - //设置时间格式 - static SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); - - /** - * 获取当月第一天 yyyy-MM-dd 格式日期 - * @return - */ - public static String getMonthFirstDay() { - Calendar ca = Calendar.getInstance(); - ca.add(Calendar.MONTH, 0); - ca.set(Calendar.DAY_OF_MONTH, 1); - String firstDay = format.format(ca.getTime()); - return firstDay; - } - /** - * 获取当月最后一天 yyyy-MM-dd 格式日期 - * @return - */ - public static String getMonthLastDay() { - //获得实体类 - Calendar ca = Calendar.getInstance(); - //设置最后一天 - ca.set(Calendar.DAY_OF_MONTH, ca.getActualMaximum(Calendar.DAY_OF_MONTH)); - //最后一天格式化 - String lastDay = format.format(ca.getTime()); - return lastDay; - } - - /** - * 获取当月每天的 yyyy-MM-dd 格式日期 - * @return - */ - public static List getMonthAllDay() { - List list = new LinkedList(); - LocalDate monthFirstDay = DateUtil.parseLocalDateFormatyMd(getMonthFirstDay()); - LocalDate monthLastDay = DateUtil.parseLocalDateFormatyMd(getMonthLastDay()); - while (true) { - list.add(monthFirstDay.toString()); - if (monthFirstDay.equals(monthLastDay)) { - return list; - } - monthFirstDay = monthFirstDay.plusDays(1); - } - } - - - public static void main(String[] args) { - // System.out.println(StringUtil.underscoreName("orderNo")); -// getMonthAllDay().forEach(System.out::println); - - String deviceType = getDeviceType("NX629J(Android/11) (com.hj.bybf8) UniApp/0.28.0 1080x2340"); - System.out.println(deviceType); - } -} diff --git a/wjcy-common/src/main/java/me/zhengjie/utils/StringUtils.java b/wjcy-common/src/main/java/me/zhengjie/utils/StringUtils.java deleted file mode 100644 index b5c2bd6..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/utils/StringUtils.java +++ /dev/null @@ -1,332 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.utils; - -import cn.hutool.http.HttpUtil; -import cn.hutool.json.JSONObject; -import cn.hutool.json.JSONUtil; -import me.zhengjie.config.SystemConfig; -import nl.basjes.parse.useragent.UserAgent; -import nl.basjes.parse.useragent.UserAgentAnalyzer; -import org.lionsoul.ip2region.DataBlock; -import org.lionsoul.ip2region.DbConfig; -import org.lionsoul.ip2region.DbSearcher; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import javax.servlet.http.HttpServletRequest; -import java.io.File; -import java.net.InetAddress; -import java.net.NetworkInterface; -import java.net.UnknownHostException; -import java.util.Calendar; -import java.util.Date; -import java.util.Enumeration; - -/** - * @author Zheng Jie - * 字符串工具类, 继承org.apache.commons.lang3.StringUtils类 - */ -public class StringUtils extends org.apache.commons.lang3.StringUtils { - - private static final Logger log = LoggerFactory.getLogger(StringUtils.class); - private static boolean ipLocal = false; - private static File file = null; - private static DbConfig config; - private static final char SEPARATOR = '_'; - private static final String UNKNOWN = "unknown"; - - private static final UserAgentAnalyzer userAgentAnalyzer = UserAgentAnalyzer - .newBuilder() - .hideMatcherLoadStats() - .withCache(10000) - .withField(UserAgent.AGENT_NAME_VERSION) - .build(); - - - static { - SpringContextHolder.addCallBacks(() -> { - StringUtils.ipLocal = SpringContextHolder.getProperties("ip.local-parsing", false, Boolean.class); - if (ipLocal) { - /* - * 此文件为独享 ,不必关闭 - */ -// String path = "ip2region/ip2region.db"; -// String name = "ip2region.db"; - try { - config = new DbConfig(); - file = new File(SystemConfig.IP2REGION_DB_PATH); - } catch (Exception e) { - log.error(e.getMessage(), e); - } - } - }); - } - - /** - * 驼峰命名法工具 - * - * @return toCamelCase(" hello_world ") == "helloWorld" - * toCapitalizeCamelCase("hello_world") == "HelloWorld" - * toUnderScoreCase("helloWorld") = "hello_world" - */ - public static String toCamelCase(String s) { - if (s == null) { - return null; - } - - s = s.toLowerCase(); - - StringBuilder sb = new StringBuilder(s.length()); - boolean upperCase = false; - for (int i = 0; i < s.length(); i++) { - char c = s.charAt(i); - - if (c == SEPARATOR) { - upperCase = true; - } else if (upperCase) { - sb.append(Character.toUpperCase(c)); - upperCase = false; - } else { - sb.append(c); - } - } - - return sb.toString(); - } - - /** - * 驼峰命名法工具 - * - * @return toCamelCase(" hello_world ") == "helloWorld" - * toCapitalizeCamelCase("hello_world") == "HelloWorld" - * toUnderScoreCase("helloWorld") = "hello_world" - */ - public static String toCapitalizeCamelCase(String s) { - if (s == null) { - return null; - } - s = toCamelCase(s); - return s.substring(0, 1).toUpperCase() + s.substring(1); - } - - /** - * 驼峰命名法工具 - * - * @return toCamelCase(" hello_world ") == "helloWorld" - * toCapitalizeCamelCase("hello_world") == "HelloWorld" - * toUnderScoreCase("helloWorld") = "hello_world" - */ - static String toUnderScoreCase(String s) { - if (s == null) { - return null; - } - - StringBuilder sb = new StringBuilder(); - boolean upperCase = false; - for (int i = 0; i < s.length(); i++) { - char c = s.charAt(i); - - boolean nextUpperCase = true; - - if (i < (s.length() - 1)) { - nextUpperCase = Character.isUpperCase(s.charAt(i + 1)); - } - - if ((i > 0) && Character.isUpperCase(c)) { - if (!upperCase || !nextUpperCase) { - sb.append(SEPARATOR); - } - upperCase = true; - } else { - upperCase = false; - } - - sb.append(Character.toLowerCase(c)); - } - - return sb.toString(); - } - - /** - * 获取ip地址 - */ - public static String getIp(HttpServletRequest request) { - String ip = request.getHeader("X-Real-IP"); - if (ip == null || ip.length() == 0 || UNKNOWN.equalsIgnoreCase(ip)) { - ip = request.getHeader("X-Forwarded-For"); - } - if (ip == null || ip.length() == 0 || UNKNOWN.equalsIgnoreCase(ip)) { - ip = request.getHeader("Proxy-Client-IP"); - } - if (ip == null || ip.length() == 0 || UNKNOWN.equalsIgnoreCase(ip)) { - ip = request.getHeader("WL-Proxy-Client-IP"); - } - if (ip == null || ip.length() == 0 || UNKNOWN.equalsIgnoreCase(ip)) { - ip = request.getRemoteAddr(); - } - String comma = ","; - String localhost = "127.0.0.1"; - if (ip.contains(comma)) { - ip = ip.split(",")[0]; - } - if (localhost.equals(ip)) { - // 获取本机真正的ip地址 - try { - ip = InetAddress.getLocalHost().getHostAddress(); - } catch (UnknownHostException e) { - log.error(e.getMessage(), e); - } - } - return ip; - } - - /** - * 根据ip获取详细地址 - */ - public static String getCityInfo(String ip) { - if (ipLocal) { - return getLocalCityInfo(ip); - } else { - return getHttpCityInfo(ip); - } - } - - /** - * 根据ip获取详细地址 - */ - public static String getHttpCityInfo(String ip) { - String api = String.format(ElAdminConstant.Url.IP_URL, ip); - JSONObject object = JSONUtil.parseObj(HttpUtil.get(api)); - return object.get("addr", String.class); - } - - /** - * 根据ip获取详细地址 - */ - public static String getLocalCityInfo(String ip) { - try { - DataBlock dataBlock = new DbSearcher(config, file.getPath()) - .binarySearch(ip); - String region = dataBlock.getRegion(); - String address = region.replace("0|", ""); - char symbol = '|'; - if (address.charAt(address.length() - 1) == symbol) { - address = address.substring(0, address.length() - 1); - } - return address.equals(ElAdminConstant.REGION) ? "内网IP" : address; - } catch (Exception e) { - log.error(e.getMessage(), e); - } - return ""; - } - - public static String getBrowser(HttpServletRequest request) { - UserAgent.ImmutableUserAgent userAgent = userAgentAnalyzer.parse(request.getHeader("User-Agent")); - return userAgent.get(UserAgent.AGENT_NAME_VERSION).getValue(); - } - - /** - * 获得当天是周几 - */ - public static String getWeekDay() { - String[] weekDays = {"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"}; - Calendar cal = Calendar.getInstance(); - cal.setTime(new Date()); - - int w = cal.get(Calendar.DAY_OF_WEEK) - 1; - if (w < 0) { - w = 0; - } - return weekDays[w]; - } - - /** - * 获取当前机器的IP - * - * @return / - */ - public static String getLocalIp() { - try { - InetAddress candidateAddress = null; - // 遍历所有的网络接口 - for (Enumeration interfaces = NetworkInterface.getNetworkInterfaces(); interfaces.hasMoreElements();) { - NetworkInterface anInterface = interfaces.nextElement(); - // 在所有的接口下再遍历IP - for (Enumeration inetAddresses = anInterface.getInetAddresses(); inetAddresses.hasMoreElements();) { - InetAddress inetAddr = inetAddresses.nextElement(); - // 排除loopback类型地址 - if (!inetAddr.isLoopbackAddress()) { - if (inetAddr.isSiteLocalAddress()) { - // 如果是site-local地址,就是它了 - return inetAddr.getHostAddress(); - } else if (candidateAddress == null) { - // site-local类型的地址未被发现,先记录候选地址 - candidateAddress = inetAddr; - } - } - } - } - if (candidateAddress != null) { - return candidateAddress.getHostAddress(); - } - // 如果没有发现 non-loopback地址.只能用最次选的方案 - InetAddress jdkSuppliedAddress = InetAddress.getLocalHost(); - if (jdkSuppliedAddress == null) { - return ""; - } - return jdkSuppliedAddress.getHostAddress(); - } catch (Exception e) { - return ""; - } - } - - public static String append(String str, char appendValue, int count) { - - StringBuilder stringBuilder = new StringBuilder(str); - for (int i = 0; i < count; i++) { - stringBuilder.append(appendValue); - } - - return stringBuilder.toString(); - } - - - /** - * 首字母大写 - * - * @param string - * @return - */ - public static String toUpperCase4Index(String string) { - char[] methodName = string.toCharArray(); - methodName[0] = toUpperCase(methodName[0]); - return String.valueOf(methodName); - } - - /** - * 字符转成大写 - * - * @param chars - * @return - */ - public static char toUpperCase(char chars) { - if (97 <= chars && chars <= 122) { - chars ^= 32; - } - return chars; - } -} diff --git a/wjcy-common/src/main/java/me/zhengjie/utils/ThrowableUtil.java b/wjcy-common/src/main/java/me/zhengjie/utils/ThrowableUtil.java deleted file mode 100644 index 075a65c..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/utils/ThrowableUtil.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.utils; - -import java.io.PrintWriter; -import java.io.StringWriter; - -/** - * 异常工具 2019-01-06 - * @author Zheng Jie - */ -public class ThrowableUtil { - - /** - * 获取堆栈信息 - */ - public static String getStackTrace(Throwable throwable){ - StringWriter sw = new StringWriter(); - try (PrintWriter pw = new PrintWriter(sw)) { - throwable.printStackTrace(pw); - return sw.toString(); - } - } -} diff --git a/wjcy-common/src/main/java/me/zhengjie/utils/TransformMap.java b/wjcy-common/src/main/java/me/zhengjie/utils/TransformMap.java deleted file mode 100644 index c5aa2be..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/utils/TransformMap.java +++ /dev/null @@ -1,60 +0,0 @@ -package me.zhengjie.utils; - - -import cn.hutool.core.bean.BeanUtil; -import cn.hutool.core.convert.Convert; -import cn.hutool.core.util.ObjectUtil; - -import java.util.Collections; -import java.util.Map; -/** - *

- * DTO 转为 map集合,并过滤时间 - *

- * - * @Author xx - * @Date 2021/7/22 - **/ -public class TransformMap { - - public static Map toMap(Object dto) { - if (dto == null) { - return Collections.emptyMap(); - } - Object obj = EmptyAttributeFiler.emptyAttributeFiler(dto); - Map map = BeanUtil.beanToMap(obj); - if (obj instanceof Map) { - map = (Map)obj; - } - String stime = Convert.toStr(map.get("stime")); - String etime = Convert.toStr(map.get("etime")); - if (ObjectUtil.isAllNotEmpty(stime,etime) && (stime.length()== etime.length() && stime.length()==10)) { - map.put("stime", map.get("stime").toString() + " 00:00:00"); - map.put("etime", map.get("etime").toString() + " 23:59:59"); - } - Integer page = Convert.toInt(map.get("page")); - Integer pageSize = Convert.toInt(map.get("pageSize")); - if (ObjectUtil.isNotNull(page) && ObjectUtil.isNotNull(pageSize)) { - if (page < 1) { - page = 1; - } - if (pageSize < 1) { - pageSize = 10; - map.put("pageSize", 10); - } - map.put("page", (page - 1) * pageSize); - } - Double minPrice =Convert.toDouble(map.get("minPrice")); - if(ObjectUtil.isNotNull(minPrice)){ - map.put("minPrice",minPrice*100); - } - - Double maxPrice =Convert.toDouble(map.get("maxPrice")); - if(ObjectUtil.isNotNull(maxPrice)){ - map.put("maxPrice",maxPrice*100); - } - return map; - } - - -} diff --git a/wjcy-common/src/main/java/me/zhengjie/utils/TransformQueryWrapper.java b/wjcy-common/src/main/java/me/zhengjie/utils/TransformQueryWrapper.java deleted file mode 100644 index f796fd0..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/utils/TransformQueryWrapper.java +++ /dev/null @@ -1,165 +0,0 @@ -package me.zhengjie.utils; - - -import cn.hutool.core.bean.BeanUtil; -import cn.hutool.core.util.ObjectUtil; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import me.zhengjie.entity.QueryWrapperAndPage; - -import java.lang.reflect.Field; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.util.Date; -import java.util.Map; -/** - *

- * DTO 转为 QueryWrapper,并过滤时间 - *

- * - * @Author xx - * @Date 2021/7/20 - **/ -public class TransformQueryWrapper { - - /** - * DTO 转QueryWrapperAndPage - * 时间特殊处理 其他都是等于 - * 参数对象 属性命名 保持与书库驼峰对应 - * @param dto - * @return - */ - public QueryWrapperAndPage dtoToQueryWrapper(Object dto) { - QueryWrapperAndPage queryWrapperAndPage = new QueryWrapperAndPage(); - QueryWrapper queryWrapper = new QueryWrapper<>(); - Page page = new Page<>(1,10); - Map dtoMap = BeanUtil.beanToMap(dto); - if (ObjectUtil.isNotNull(dtoMap.get("stime"))) { - queryWrapper.ge("created_at", dtoMap.get("stime").toString() + " 00:00:00"); - dtoMap.remove("stime"); - } - - if (ObjectUtil.isNotNull(dtoMap.get("etime"))) { - queryWrapper.le("created_at", dtoMap.get("etime").toString() + " 23:59:59"); - dtoMap.remove("etime"); - } - if (ObjectUtil.isNotNull(dtoMap.get("guessStime"))) { - queryWrapper.ge("completion_time", dtoMap.get("guessStime").toString() + " 00:00:00"); - dtoMap.remove("guessStime"); - } - - if (ObjectUtil.isNotNull(dtoMap.get("guessEtime"))) { - queryWrapper.le("completion_time", dtoMap.get("guessEtime").toString() + " 23:59:59"); - dtoMap.remove("guessEtime"); - } - if (ObjectUtil.isNotNull(dtoMap.get("gamestime"))) { - queryWrapper.ge("start_time", dtoMap.get("gamestime").toString() + " 00:00:00"); - dtoMap.remove("gamestime"); - } - - if (ObjectUtil.isNotNull(dtoMap.get("gameetime"))) { - queryWrapper.le("start_time", dtoMap.get("gameetime").toString() + " 23:59:59"); - dtoMap.remove("gameetime"); - } - - if (ObjectUtil.isNotNull(dtoMap.get("releaseStime"))) { - queryWrapper.ge("release_time", dtoMap.get("releaseStime").toString() + " 00:00:00"); - dtoMap.remove("releaseStime"); - } - - if (ObjectUtil.isNotNull(dtoMap.get("releaseEtime"))) { - queryWrapper.le("release_time", dtoMap.get("releaseEtime").toString() + " 23:59:59"); - dtoMap.remove("releaseEtime"); - } - // 封装所有分页信息 - if (ObjectUtil.isNotEmpty(dtoMap.get("page")) && ObjectUtil.isNotEmpty(dtoMap.get("pageSize"))) { - page.setCurrent(Long.valueOf(dtoMap.get("page").toString())); - page.setSize(Long.valueOf(dtoMap.get("pageSize").toString())); - queryWrapperAndPage.setPage(page); - dtoMap.remove("page"); - dtoMap.remove("pageSize"); - } - - // 封装所有查询条件信息 - for (Map.Entry map :dtoMap.entrySet()) { - if (ObjectUtil.isNotEmpty(map.getValue())){ - queryWrapper.eq(StringUtil.underscoreName(map.getKey()), map.getValue()); - } - } - - queryWrapperAndPage.setQueryWrapper(queryWrapper); - - return queryWrapperAndPage; - } - - /** - * 目前都是等值赋值。 需要的话在后续拓展 - * @param model - * @return - */ - public static QueryWrapper toQueryWrapper(Object model) { - - QueryWrapper queryWrapper = new QueryWrapper<>(); - - // 通过反射 赋值 - Field[] field = model.getClass().getDeclaredFields(); - try { - // 遍历所有属性 - for (int j = 0; j < field.length; j++) { - // 获取属性的名字 - String name = field[j].getName(); - // 将属性的首字符大写,方便构造get,set方法 - name = name.substring(0, 1).toUpperCase() + name.substring(1); - // 获取属性的类型 - String type = field[j].getGenericType().toString(); - // 如果type是类类型,则前面包含"class ",后面跟类名 - if ("class java.lang.String".equals(type)) { - Method m = model.getClass().getMethod("get" + name); - // 调用getter方法获取属性值 - String value = (String) m.invoke(model); - if (ObjectUtil.isNotEmpty(value)) { - queryWrapper.eq(name, value); - } - } - if ("class java.lang.Integer".equals(type)) { - Method m = model.getClass().getMethod("get" + name); - Integer value = (Integer) m.invoke(model); - - if (ObjectUtil.isNotEmpty(value)){ - queryWrapper.eq(name, value); - } - } - if ("class java.lang.Boolean".equals(type)) { - Method m = model.getClass().getMethod("get" + name); - Boolean value = (Boolean) m.invoke(model); - - if (ObjectUtil.isNotEmpty(value)){ - queryWrapper.eq(name, value); - } - } - if ("class java.util.Date".equals(type)) { - Method m = model.getClass().getMethod("get" + name); - Date value = (Date) m.invoke(model); - - if (ObjectUtil.isNotEmpty(value)){ - queryWrapper.eq(name, value); - } - } - - // 如果有需要,可以仿照上面继续进行扩充,再增加对其它类型的判断 - } - }catch (NoSuchMethodException e) { - e.printStackTrace(); - } catch (SecurityException e) { - e.printStackTrace(); - } catch (IllegalAccessException e) { - e.printStackTrace(); - } catch (IllegalArgumentException e) { - e.printStackTrace(); - } catch (InvocationTargetException e) { - e.printStackTrace(); - } - - return queryWrapper; - } -} diff --git a/wjcy-common/src/main/java/me/zhengjie/utils/TranslatorUtil.java b/wjcy-common/src/main/java/me/zhengjie/utils/TranslatorUtil.java deleted file mode 100644 index f2bd5d2..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/utils/TranslatorUtil.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.utils; - -import cn.hutool.json.JSONArray; -import java.io.BufferedReader; -import java.io.InputStreamReader; -import java.net.HttpURLConnection; -import java.net.URL; -import java.net.URLEncoder; - -/** - * @author Zheng Jie - * 翻译工具类 - */ -public class TranslatorUtil { - - public static String translate(String word){ - try { - String url = "https://translate.googleapis.com/translate_a/single?" + - "client=gtx&" + - "sl=en" + - "&tl=zh-CN" + - "&dt=t&q=" + URLEncoder.encode(word, "UTF-8"); - - URL obj = new URL(url); - HttpURLConnection con = (HttpURLConnection) obj.openConnection(); - con.setRequestProperty("User-Agent", "Mozilla/5.0"); - - BufferedReader in = new BufferedReader( - new InputStreamReader(con.getInputStream())); - String inputLine; - StringBuilder response = new StringBuilder(); - - while ((inputLine = in.readLine()) != null) { - response.append(inputLine); - } - in.close(); - return parseResult(response.toString()); - }catch (Exception e){ - return word; - } - } - - private static String parseResult(String inputJson){ - JSONArray jsonArray2 = (JSONArray) new JSONArray(inputJson).get(0); - StringBuilder result = new StringBuilder(); - for (Object o : jsonArray2) { - result.append(((JSONArray) o).get(0).toString()); - } - return result.toString(); - } -} diff --git a/wjcy-common/src/main/java/me/zhengjie/utils/ValidationUtil.java b/wjcy-common/src/main/java/me/zhengjie/utils/ValidationUtil.java deleted file mode 100644 index c2c81d2..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/utils/ValidationUtil.java +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.utils; - -import cn.hutool.core.util.ObjectUtil; -import lombok.extern.slf4j.Slf4j; -import me.zhengjie.exception.BadRequestException; -import org.hibernate.validator.internal.constraintvalidators.hv.EmailValidator; - -import java.lang.reflect.Field; - -/** - * 验证工具 - * @author Zheng Jie - * @date 2018-11-23 - */ -@Slf4j -public class ValidationUtil{ - - /** - * 验证空 - */ - public static void isNull(Object obj, String entity, String parameter , Object value){ - if(ObjectUtil.isNull(obj)){ - String msg = entity + " 不存在: "+ parameter +" is "+ value; - throw new BadRequestException(msg); - } - } - - /** - * 验证是否为邮箱 - */ - public static boolean isEmail(String email) { - return new EmailValidator().isValid(email, null); - } - - - /** - * 反射检验对象是否包含指定名称的 变量 - * @param fieldName - * @param obj - * @return - */ - public static Boolean isExistFieldName(String fieldName, Object obj) { - if (obj == null || StringUtils.isEmpty(fieldName)) { - return false; - } - //获取这个类的所有属性 - Field[] fields = obj.getClass().getDeclaredFields(); - //循环遍历所有的fields - for (int i = 0; i < fields.length; i++) { - if (fields[i].getName().equals(fieldName)) { - return true; - } - } - return false; - } - -// /** -// * 判断是否包含 passType -// * @param mqSettlePassCurrencyTypeList -// * @param passType -// * @return -// */ -// public static Boolean isContainPassType(List mqSettlePassCurrencyTypeList, Integer passType) { -// if (ObjectUtil.isEmpty(mqSettlePassCurrencyTypeList) || ObjectUtil.isEmpty(passType)) { -// log.error("---isContainPassType------mqSettlePassCurrencyTypeList-------null"); -// return false; -// } -// List list = mqSettlePassCurrencyTypeList.stream().filter(l->l.getPassType().equals(passType)).collect(Collectors.toList()); -// if (ObjectUtil.isNotEmpty(list)) { -// return true; -// } -// -// log.error("---isContainPassType------mqSettlePassCurrencyTypeList----return---null"); -// return false; -// } -// -// /** -// * 判断是否包含 passType 中的currencyType -// * @param mqSettlePassCurrencyTypeList -// * @param passType -// * @param currencyType -// * @return -// */ -// public static Boolean isContainPassCurrencyType(List mqSettlePassCurrencyTypeList, Integer passType, Integer currencyType) { -// if (ObjectUtil.isEmpty(mqSettlePassCurrencyTypeList) || ObjectUtil.isEmpty(passType) || ObjectUtil.isEmpty(currencyType)) { -// log.error("---isContainPassCurrencyType------mqSettlePassCurrencyTypeList-------null"); -// return false; -// } -// -// List list = mqSettlePassCurrencyTypeList.stream().filter(l->l.getPassType().equals(passType)).collect(Collectors.toList()); -// if (ObjectUtil.isEmpty(list)) { -// log.error("---isContainPassCurrencyType------List----return---false"); -// return false; -// } -// -// for (MqSettlePassCurrencyType mqSettlePassCurrencyType:list) { -// List currencyTypeList = mqSettlePassCurrencyType.getCurrencyList(); -// if (ObjectUtil.isEmpty(currencyTypeList)) { -// continue; -// } -// -// List currencyList = currencyTypeList.stream().filter(c->c.getCurrencyType().equals(currencyType)).collect(Collectors.toList()); -// if (ObjectUtil.isNotEmpty(currencyList)) { -// return true; -// } -// } -// -// log.error("---isContainPassCurrencyType------mqSettlePassCurrencyTypeList----return---false"); -// return false; -// } -} diff --git a/wjcy-common/src/main/java/me/zhengjie/utils/YdCallBackUtil.java b/wjcy-common/src/main/java/me/zhengjie/utils/YdCallBackUtil.java deleted file mode 100644 index 6a6b29f..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/utils/YdCallBackUtil.java +++ /dev/null @@ -1,89 +0,0 @@ -package me.zhengjie.utils; - -import cn.hutool.core.util.ObjectUtil; -import cn.hutool.json.JSONObject; -import cn.hutool.json.JSONUtil; -import lombok.extern.slf4j.Slf4j; -import me.zhengjie.config.BeanFactory; -import me.zhengjie.dto.Dto; -import me.zhengjie.entity.CtApply; -import me.zhengjie.entity.CtRebot; -import me.zhengjie.entity.ReturnObje; -import me.zhengjie.entity.YdSign; -import me.zhengjie.enums.YesOrNoEnum; -import me.zhengjie.error.ErrorCodeEnum; -import me.zhengjie.service.CtRebotService; -import org.springframework.transaction.annotation.Transactional; - -import javax.servlet.http.HttpServletRequest; -import java.util.Map; - -/** - * 影刀回调 - * - * @author rch - * @create 2022-08-23 - */ -@Slf4j -public class YdCallBackUtil { - - @Transactional(rollbackFor = Exception.class) - public Dto callback(HttpServletRequest httpServletRequest, CtApply ctApply, String data){ - log.info("=======影刀回调=======callback"); - String requestUrl = httpServletRequest.getRequestURI(); - Map map = httpServletRequest.getParameterMap(); - if (ObjectUtil.isEmpty(map.get("sign"))) { - return Dto.getInstance(ErrorCodeEnum.ERROR_PARAM_NULL); - } - - String getSign = map.get("sign")[0]; - JSONObject jsonObject = JSONUtil.parseObj(data); - - // 根据task枚举获取 应用信息 取出 accessKey 和 accessKeySecret 用于鉴权 - if (ObjectUtil.isEmpty(ctApply) || ObjectUtil.isEmpty(getSign) - || ObjectUtil.isEmpty(jsonObject) - || ObjectUtil.isEmpty(ctApply.getAccessKeyId()) - || ObjectUtil.isEmpty(ctApply.getAccessKeySecret())) { - return Dto.getInstance(ErrorCodeEnum.ERROR_PARAM_NULL); - } - - String accessKeyId = ctApply.getAccessKeyId(); - String accessKeySecret = ctApply.getAccessKeySecret(); - - // 鉴权 - YdSign ydSign = new YdSign(); - ydSign.setTimestamp(Long.valueOf(map.get("timestamp")[0])); - ydSign.setAccessKeyId(accessKeyId); - ydSign.setAccessKeySecret(accessKeySecret); - ydSign.setBodyMd5(map.get("bodyMd5")[0]); - - log.info("-------map:{}" , JSONUtil.toJsonStr(map)); - log.info("====ydSign====={}", JSONUtil.toJsonStr(ydSign)); - String sign = YdSignUtil.getSign(ydSign); - log.info("====sign:{} ---getSign:{}", sign, getSign); - if (ObjectUtil.isEmpty(sign) || !getSign.equals(sign)) { - return Dto.getInstance(ErrorCodeEnum.ERROR_CALLBACK_SIGN_NULL); - } - - // TODO 获取设备id 然后修改设备状态是未占用 - CtRebotService ctRebotService = BeanFactory.getBean(CtRebotService.class); - ReturnObje returnObje = JSONUtil.toBean(data, ReturnObje.class); - String rebotClientName = returnObje.getRobotClientName(); - CtRebot ctRebot = ctRebotService.getByAccountNameLock(rebotClientName); - if (ObjectUtil.isEmpty(ctRebot)) { - // 有问题 不执行 - System.out.println("===========设备有问题==========="); - return Dto.getInstance(ErrorCodeEnum.ERROR_NOT_FIND_OR_OCCUPY); - } - if (YesOrNoEnum.NO.eqValue(ctRebot.getStatus())) { - return Dto.returnResult(true); - } - - // 修改机器人状态 不管是什么状态,执行完成之后在我们平台就是修改为 待占用即可 - CtRebot updateCtRebot = new CtRebot(); - updateCtRebot.setId(ctRebot.getId()); - updateCtRebot.setStatus(YesOrNoEnum.NO.value()); - Boolean resultBoolean = ctRebotService.updateById(updateCtRebot); - return Dto.returnResult(resultBoolean); - } -} diff --git a/wjcy-common/src/main/java/me/zhengjie/utils/YdParamsCheck.java b/wjcy-common/src/main/java/me/zhengjie/utils/YdParamsCheck.java deleted file mode 100644 index b69eea3..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/utils/YdParamsCheck.java +++ /dev/null @@ -1,54 +0,0 @@ -package me.zhengjie.utils; - -import cn.hutool.core.util.ObjectUtil; -import cn.hutool.json.JSONUtil; -import me.zhengjie.entity.quartz.Boss; -import me.zhengjie.entity.quartz.Param; - -import java.util.List; - -/** - * 检验影刀参数是否是json数组格式 - * - * @author rch - * @create 2022-08-17 - */ -public class YdParamsCheck { - - /** - * params 是json格式则返回true 否则返回false - * @param str - * @return - */ - public static Boolean paramIsJson(String str) { - - if (ObjectUtil.isEmpty(str)) { - return false; - } - - if (!JSONUtil.isJson(str)) { - return false; - } - - Boss boss = JSONUtil.toBean(str, Boss.class); - if (ObjectUtil.isEmpty(boss) || ObjectUtil.isEmpty(boss.getParams())) { - return false; - } - - List paramList = boss.getParams(); - for (Param param:paramList) { - if (ObjectUtil.isEmpty(param)) { - return false; - } - } - - return true; - } - - public static void main(String[] args) { - String str = "{\"accountName\":\"linbiaoyuan@vogocm\",\"applyId\":2,\"params\":1}"; - str = "{\"accountName\":\"linbiaoyuan@vogocm\",\"applyId\":2,\"params\":[{\"name\":\"id\",\"value\":\"1\",\"type\":\"str\"}]}"; - Boolean boolean1 = paramIsJson(str); - System.out.println("==========boolean1:" + boolean1); - } -} diff --git a/wjcy-common/src/main/java/me/zhengjie/utils/YdSignUtil.java b/wjcy-common/src/main/java/me/zhengjie/utils/YdSignUtil.java deleted file mode 100644 index 7acc18d..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/utils/YdSignUtil.java +++ /dev/null @@ -1,94 +0,0 @@ -package me.zhengjie.utils; - -import cn.hutool.core.util.ObjectUtil; -import me.zhengjie.entity.YdSign; - -import javax.crypto.Mac; -import javax.crypto.spec.SecretKeySpec; -import java.nio.charset.Charset; -import java.time.LocalDateTime; -import java.time.ZoneId; -import java.time.format.DateTimeFormatter; -import java.util.Date; - -/** - * 影刀鉴权工具类 - * - * @author rch - * @create 2022-07-26 - */ -public class YdSignUtil { - - private static final char[] DIGITS_LOWER = new char[]{'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};; - - private static final String UTF8_NAME = "UTF-8"; - - private static final Charset UTF8_CHARSET = Charset.forName(UTF8_NAME); - - - public static String getSign(YdSign ydSign) { - String sign = null; - if (ObjectUtil.isEmpty(ydSign) - || ObjectUtil.isEmpty(ydSign.getAccessKeyId()) - || ObjectUtil.isEmpty(ydSign.getTimestamp()) - || ObjectUtil.isEmpty(ydSign.getBodyMd5()) - || ObjectUtil.isEmpty(ydSign.getAccessKeySecret())) { - return sign; - } - - //由回调接口回传 - long timestamp = ydSign.getTimestamp(); - //影刀控制台配置的accessKeyId - String accessKeyId = ydSign.getAccessKeyId(); - //影刀控制台配置的accessKeySecret - String accessKeySecret = ydSign.getAccessKeySecret(); - //由回调接口回传 - String bodyMd5 = ydSign.getBodyMd5(); - DateTimeFormatter pattern = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); - Date date = new Date(timestamp); - LocalDateTime localDateTime = LocalDateTime.ofInstant(date.toInstant(), ZoneId.systemDefault()); - - System.out.println(bodyMd5); - StringBuilder sb = new StringBuilder(); - sb.append("accessKeyId="); - sb.append(accessKeyId); - sb.append("&bodyMd5="); - sb.append(bodyMd5); - sb.append("×tamp="); - sb.append(pattern.format(localDateTime)); - - String originalStr = sb.toString(); - byte[] keyBytes = accessKeySecret.getBytes(); - SecretKeySpec secretKey = new SecretKeySpec(keyBytes, "HmacSHA1"); - try { - Mac mac = Mac.getInstance("HmacSHA1"); - mac.init(secretKey); - byte[] rawHmac = mac.doFinal(originalStr.getBytes(UTF8_CHARSET)); - sign = encodeHex(rawHmac); - System.out.println("sign: " + sign); - } catch (Exception e) { - e.printStackTrace(); - return sign; - } - - return sign; - } - - /** - * 转换16进制 - * - * @param data - * @return - */ - private static String encodeHex(byte[] data) { - int l = data.length; - char[] out = new char[l << 1]; - int i = 0; - - for(int var5 = 0; i < l; ++i) { - out[var5++] = DIGITS_LOWER[(240 & data[i]) >>> 4]; - out[var5++] = DIGITS_LOWER[15 & data[i]]; - } - return new String(out); - } -} diff --git a/wjcy-common/src/main/java/me/zhengjie/utils/enums/CodeBiEnum.java b/wjcy-common/src/main/java/me/zhengjie/utils/enums/CodeBiEnum.java deleted file mode 100644 index 661e0a0..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/utils/enums/CodeBiEnum.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.utils.enums; - -import lombok.AllArgsConstructor; -import lombok.Getter; - -/** - *

- * 验证码业务场景 - *

- * @author Zheng Jie - * @date 2020-05-02 - */ -@Getter -@AllArgsConstructor -public enum CodeBiEnum { - - /* 旧邮箱修改邮箱 */ - ONE(1, "旧邮箱修改邮箱"), - - /* 通过邮箱修改密码 */ - TWO(2, "通过邮箱修改密码"); - - private final Integer code; - private final String description; - - public static CodeBiEnum find(Integer code) { - for (CodeBiEnum value : CodeBiEnum.values()) { - if (code.equals(value.getCode())) { - return value; - } - } - return null; - } - -} diff --git a/wjcy-common/src/main/java/me/zhengjie/utils/enums/CodeEnum.java b/wjcy-common/src/main/java/me/zhengjie/utils/enums/CodeEnum.java deleted file mode 100644 index 916862a..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/utils/enums/CodeEnum.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.utils.enums; - -import lombok.AllArgsConstructor; -import lombok.Getter; - -/** - *

- * 验证码业务场景对应的 Redis 中的 key - *

- * @author Zheng Jie - * @date 2020-05-02 - */ -@Getter -@AllArgsConstructor -public enum CodeEnum { - - /* 通过手机号码重置邮箱 */ - PHONE_RESET_EMAIL_CODE("phone_reset_email_code_", "通过手机号码重置邮箱"), - - /* 通过旧邮箱重置邮箱 */ - EMAIL_RESET_EMAIL_CODE("email_reset_email_code_", "通过旧邮箱重置邮箱"), - - /* 通过手机号码重置密码 */ - PHONE_RESET_PWD_CODE("phone_reset_pwd_code_", "通过手机号码重置密码"), - - /* 通过邮箱重置密码 */ - EMAIL_RESET_PWD_CODE("email_reset_pwd_code_", "通过邮箱重置密码"); - - private final String key; - private final String description; -} diff --git a/wjcy-common/src/main/java/me/zhengjie/utils/enums/DataScopeEnum.java b/wjcy-common/src/main/java/me/zhengjie/utils/enums/DataScopeEnum.java deleted file mode 100644 index 5352b7b..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/utils/enums/DataScopeEnum.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.utils.enums; - -import lombok.AllArgsConstructor; -import lombok.Getter; - -/** - *

- * 数据权限枚举 - *

- * @author Zheng Jie - * @date 2020-05-07 - */ -@Getter -@AllArgsConstructor -public enum DataScopeEnum { - - /* 全部的数据权限 */ - ALL("全部", "全部的数据权限"), - - /* 自己部门的数据权限 */ - THIS_LEVEL("本级", "自己部门的数据权限"), - - /* 自定义的数据权限 */ - CUSTOMIZE("自定义", "自定义的数据权限"); - - private final String value; - private final String description; - - public static DataScopeEnum find(String val) { - for (DataScopeEnum dataScopeEnum : DataScopeEnum.values()) { - if (val.equals(dataScopeEnum.getValue())) { - return dataScopeEnum; - } - } - return null; - } - -} diff --git a/wjcy-common/src/main/java/me/zhengjie/utils/enums/RequestMethodEnum.java b/wjcy-common/src/main/java/me/zhengjie/utils/enums/RequestMethodEnum.java deleted file mode 100644 index 1b65c78..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/utils/enums/RequestMethodEnum.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.utils.enums; - -import lombok.AllArgsConstructor; -import lombok.Getter; - -/** - * @author Zheng Jie - * @website https://el-admin.vip - * @description - * @date 2020-06-10 - **/ -@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 (type.equals(value.getType())) { - return value; - } - } - return ALL; - } -} diff --git a/wjcy-common/src/main/java/me/zhengjie/utils/excel/ExcelClassField.java b/wjcy-common/src/main/java/me/zhengjie/utils/excel/ExcelClassField.java deleted file mode 100644 index 2107f6e..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/utils/excel/ExcelClassField.java +++ /dev/null @@ -1,79 +0,0 @@ -package me.zhengjie.utils.excel; - -import java.util.LinkedHashMap; - -/** - * ExcelClassField - * - * @author rch - * @create 2022-06-22 - */ -public class ExcelClassField { - - /** 字段名称 */ - private String fieldName; - - /** 表头名称 */ - private String name; - - /** 映射关系 */ - private LinkedHashMap kvMap; - - /** 示例值 */ - private Object example; - - /** 排序 */ - private int sort; - - /** 是否为注解字段:0-否,1-是 */ - private int hasAnnotation; - - public String getFieldName() { - return fieldName; - } - - public void setFieldName(String fieldName) { - this.fieldName = fieldName; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public LinkedHashMap getKvMap() { - return kvMap; - } - - public void setKvMap(LinkedHashMap kvMap) { - this.kvMap = kvMap; - } - - public Object getExample() { - return example; - } - - public void setExample(Object example) { - this.example = example; - } - - public int getSort() { - return sort; - } - - public void setSort(int sort) { - this.sort = sort; - } - - public int getHasAnnotation() { - return hasAnnotation; - } - - public void setHasAnnotation(int hasAnnotation) { - this.hasAnnotation = hasAnnotation; - } - -} diff --git a/wjcy-common/src/main/java/me/zhengjie/utils/excel/ExcelExport.java b/wjcy-common/src/main/java/me/zhengjie/utils/excel/ExcelExport.java deleted file mode 100644 index 706d95b..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/utils/excel/ExcelExport.java +++ /dev/null @@ -1,30 +0,0 @@ -package me.zhengjie.utils.excel; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * ExcelExport - * - * @author rch - * @create 2022-06-22 - */ -@Target(ElementType.FIELD) -@Retention(RetentionPolicy.RUNTIME) -public @interface ExcelExport { - - /** 字段名称 */ - String value(); - - /** 导出排序先后: 数字越小越靠前(默认按Java类字段顺序导出) */ - int sort() default 0; - - /** 导出映射,格式如:0-未知;1-男;2-女 */ - String kv() default ""; - - /** 导出模板示例值(有值的话,直接取该值,不做映射) */ - String example() default ""; - -} diff --git a/wjcy-common/src/main/java/me/zhengjie/utils/excel/ExcelImport.java b/wjcy-common/src/main/java/me/zhengjie/utils/excel/ExcelImport.java deleted file mode 100644 index 5110dad..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/utils/excel/ExcelImport.java +++ /dev/null @@ -1,34 +0,0 @@ -package me.zhengjie.utils.excel; - - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * ExcelImport - * - * @author rch - * @create 2022-06-22 - */ -@Target(ElementType.FIELD) -@Retention(RetentionPolicy.RUNTIME) -public @interface ExcelImport { - - /** 字段名称 */ - String value(); - - /** 导出映射,格式如:0-未知;1-男;2-女 */ - String kv() default ""; - - /** 是否为必填字段(默认为非必填) */ - boolean required() default false; - - /** 最大长度(默认255) */ - int maxLength() default 255; - - /** 导入唯一性验证(多个字段则取联合验证) */ - boolean unique() default false; - -} diff --git a/wjcy-common/src/main/java/me/zhengjie/utils/excel/ExcelUtils.java b/wjcy-common/src/main/java/me/zhengjie/utils/excel/ExcelUtils.java deleted file mode 100644 index 59b1998..0000000 --- a/wjcy-common/src/main/java/me/zhengjie/utils/excel/ExcelUtils.java +++ /dev/null @@ -1,993 +0,0 @@ -package me.zhengjie.utils.excel; - -import cn.hutool.core.util.ObjectUtil; -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import org.apache.poi.hssf.usermodel.HSSFDataValidation; -import org.apache.poi.hssf.usermodel.HSSFWorkbook; -import org.apache.poi.poifs.filesystem.POIFSFileSystem; -import org.apache.poi.ss.usermodel.*; -import org.apache.poi.ss.usermodel.ClientAnchor.AnchorType; -import org.apache.poi.ss.util.CellRangeAddress; -import org.apache.poi.ss.util.CellRangeAddressList; -import org.apache.poi.xssf.streaming.SXSSFWorkbook; -import org.apache.poi.xssf.usermodel.XSSFClientAnchor; -import org.apache.poi.xssf.usermodel.XSSFWorkbook; -import org.springframework.web.multipart.MultipartFile; - -import javax.servlet.ServletOutputStream; -import javax.servlet.http.HttpServletResponse; -import java.io.*; -import java.lang.reflect.Field; -import java.math.BigDecimal; -import java.math.RoundingMode; -import java.net.URL; -import java.text.NumberFormat; -import java.text.SimpleDateFormat; -import java.util.*; -import java.util.Map.Entry; -import java.util.regex.Pattern; - -/** - * Excel导入导出工具类 - * - * @author rch - * @create 2022-06-22 - */ -public class ExcelUtils { - private static final String XLSX = ".xlsx"; - private static final String XLS = ".xls"; - public static final String ROW_MERGE = "row_merge"; - public static final String COLUMN_MERGE = "column_merge"; - private static final String DATE_FORMAT = "yyyy-MM-dd HH:mm:ss"; - private static final String ROW_NUM = "rowNum"; - private static final String ROW_DATA = "rowData"; - private static final String ROW_TIPS = "rowTips"; - private static final int CELL_OTHER = 0; - private static final int CELL_ROW_MERGE = 1; - private static final int CELL_COLUMN_MERGE = 2; - private static final int IMG_HEIGHT = 30; - private static final int IMG_WIDTH = 30; - private static final char LEAN_LINE = '/'; - private static final int BYTES_DEFAULT_LENGTH = 10240; - private static final NumberFormat NUMBER_FORMAT = NumberFormat.getNumberInstance(); - - - public static List readFile(File file, Class clazz) throws Exception { - JSONArray array = readFile(file); - return getBeanList(array, clazz); - } - - public static List readMultipartFile(MultipartFile mFile, Class clazz) throws Exception { - JSONArray array = readMultipartFile(mFile); - return getBeanList(array, clazz); - } - - public static JSONArray readFile(File file) throws Exception { - return readExcel(null, file); - } - - public static JSONArray readMultipartFile(MultipartFile mFile) throws Exception { - return readExcel(mFile, null); - } - - public static Map readFileManySheet(File file) throws Exception { - return readExcelManySheet(null, file); - } - - public static Map readFileManySheet(MultipartFile file) throws Exception { - return readExcelManySheet(file, null); - } - - private static List getBeanList(JSONArray array, Class clazz) throws Exception { - List list = new ArrayList<>(); - Map uniqueMap = new HashMap<>(16); - for (int i = 0; i < array.size(); i++) { - list.add(getBean(clazz, array.getJSONObject(i), uniqueMap)); - } - return list; - } - - /** - * 获取每个对象的数据 - */ - private static T getBean(Class c, JSONObject obj, Map uniqueMap) throws Exception { - T t = c.newInstance(); - Field[] fields = c.getDeclaredFields(); - List errMsgList = new ArrayList<>(); - boolean hasRowTipsField = false; - StringBuilder uniqueBuilder = new StringBuilder(); - int rowNum = 0; - for (Field field : fields) { - // 行号 - if (field.getName().equals(ROW_NUM)) { - rowNum = obj.getInteger(ROW_NUM); - field.setAccessible(true); - field.set(t, rowNum); - continue; - } - // 是否需要设置异常信息 - if (field.getName().equals(ROW_TIPS)) { - hasRowTipsField = true; - continue; - } - // 原始数据 - if (field.getName().equals(ROW_DATA)) { - field.setAccessible(true); - field.set(t, obj.toString()); - continue; - } - // 设置对应属性值 - setFieldValue(t, field, obj, uniqueBuilder, errMsgList); - } - // 数据唯一性校验 - if (uniqueBuilder.length() > 0) { - if (uniqueMap.containsValue(uniqueBuilder.toString())) { - Set rowNumKeys = uniqueMap.keySet(); - for (Integer num : rowNumKeys) { - if (uniqueMap.get(num).equals(uniqueBuilder.toString())) { - errMsgList.add(String.format("数据唯一性校验失败,(%s)与第%s行重复)", uniqueBuilder, num)); - } - } - } else { - uniqueMap.put(rowNum, uniqueBuilder.toString()); - } - } - // 失败处理 - if (errMsgList.isEmpty() && !hasRowTipsField) { - return t; - } - StringBuilder sb = new StringBuilder(); - int size = errMsgList.size(); - for (int i = 0; i < size; i++) { - if (i == size - 1) { - sb.append(errMsgList.get(i)); - } else { - sb.append(errMsgList.get(i)).append(";"); - } - } - // 设置错误信息 - for (Field field : fields) { - if (field.getName().equals(ROW_TIPS)) { - field.setAccessible(true); - field.set(t, sb.toString()); - } - } - return t; - } - - private static void setFieldValue(T t, Field field, JSONObject obj, StringBuilder uniqueBuilder, List errMsgList) { - // 获取 ExcelImport 注解属性 - ExcelImport annotation = field.getAnnotation(ExcelImport.class); - if (annotation == null) { - return; - } - String cname = annotation.value(); - if (cname.trim().length() == 0) { - return; - } - // 获取具体值 - String val = null; - if (obj.containsKey(cname)) { - val = getString(obj.getString(cname)); - } - if (val == null) { - return; - } - field.setAccessible(true); - // 判断是否必填 - boolean require = annotation.required(); - if (require && val.isEmpty()) { - errMsgList.add(String.format("[%s]不能为空", cname)); - return; - } - // 数据唯一性获取 - boolean unique = annotation.unique(); - if (unique) { - if (uniqueBuilder.length() > 0) { - uniqueBuilder.append("--").append(val); - } else { - uniqueBuilder.append(val); - } - } - // 判断是否超过最大长度 - int maxLength = annotation.maxLength(); - if (maxLength > 0 && val.length() > maxLength) { - errMsgList.add(String.format("[%s]长度不能超过%s个字符(当前%s个字符)", cname, maxLength, val.length())); - } - // 判断当前属性是否有映射关系 - LinkedHashMap kvMap = getKvMap(annotation.kv()); - if (!kvMap.isEmpty()) { - boolean isMatch = false; - for (String key : kvMap.keySet()) { - if (kvMap.get(key).equals(val)) { - val = key; - isMatch = true; - break; - } - } - if (!isMatch) { - errMsgList.add(String.format("[%s]的值不正确(当前值为%s)", cname, val)); - return; - } - } - // 其余情况根据类型赋值 - String fieldClassName = field.getType().getSimpleName(); - try { - if ("String".equalsIgnoreCase(fieldClassName)) { - field.set(t, val); - } else if ("boolean".equalsIgnoreCase(fieldClassName)) { - field.set(t, Boolean.valueOf(val)); - } else if ("int".equalsIgnoreCase(fieldClassName) || "Integer".equals(fieldClassName)) { - try { - field.set(t, Integer.valueOf(val)); - } catch (NumberFormatException e) { - errMsgList.add(String.format("[%s]的值格式不正确(当前值为%s)", cname, val)); - } - } else if ("double".equalsIgnoreCase(fieldClassName)) { - field.set(t, Double.valueOf(val)); - } else if ("long".equalsIgnoreCase(fieldClassName)) { - field.set(t, Long.valueOf(val)); - } else if ("BigDecimal".equalsIgnoreCase(fieldClassName)) { - field.set(t, new BigDecimal(val)); - } - } catch (Exception e) { - e.printStackTrace(); - } - } - - private static Map readExcelManySheet(MultipartFile mFile, File file) throws IOException { - Workbook book = getWorkbook(mFile, file); - if (book == null) { - return Collections.emptyMap(); - } - Map map = new LinkedHashMap<>(); - for (int i = 0; i < book.getNumberOfSheets(); i++) { - Sheet sheet = book.getSheetAt(i); - JSONArray arr = readSheet(sheet); - map.put(sheet.getSheetName(), arr); - } - book.close(); - return map; - } - - private static JSONArray readExcel(MultipartFile mFile, File file) throws IOException { - Workbook book = getWorkbook(mFile, file); - if (book == null) { - return new JSONArray(); - } - JSONArray array = readSheet(book.getSheetAt(0)); - book.close(); - return array; - } - - private static Workbook getWorkbook(MultipartFile mFile, File file) throws IOException { - boolean fileNotExist = (file == null || !file.exists()); - if (mFile == null && fileNotExist) { - return null; - } - // 解析表格数据 - InputStream in; - String fileName; - if (mFile != null) { - // 上传文件解析 - in = mFile.getInputStream(); - fileName = getString(mFile.getOriginalFilename()).toLowerCase(); - } else { - // 本地文件解析 - in = new FileInputStream(file); - fileName = file.getName().toLowerCase(); - } - Workbook book; - if (fileName.endsWith(XLSX)) { - book = new XSSFWorkbook(in); - } else if (fileName.endsWith(XLS)) { - POIFSFileSystem poifsFileSystem = new POIFSFileSystem(in); - book = new HSSFWorkbook(poifsFileSystem); - } else { - return null; - } - in.close(); - return book; - } - - private static JSONArray readSheet(Sheet sheet) { - // 首行下标 - int rowStart = sheet.getFirstRowNum(); - // 尾行下标 - int rowEnd = sheet.getLastRowNum(); - // 获取表头行 - Row headRow = sheet.getRow(rowStart); - if (headRow == null) { - return new JSONArray(); - } - int cellStart = headRow.getFirstCellNum(); - int cellEnd = headRow.getLastCellNum(); - Map keyMap = new HashMap<>(16); - for (int j = cellStart; j < cellEnd; j++) { - // 获取表头数据 - String val = getCellValue(headRow.getCell(j)); - if (val != null && val.trim().length() != 0) { - keyMap.put(j, val); - } - } - // 如果表头没有数据则不进行解析 - if (keyMap.isEmpty()) { - return (JSONArray) Collections.emptyList(); - } - // 获取每行JSON对象的值 - JSONArray array = new JSONArray(); - // 如果首行与尾行相同,表明只有一行,返回表头数据 - if (rowStart == rowEnd) { - JSONObject obj = new JSONObject(); - // 添加行号 - obj.put(ROW_NUM, 1); - for (int i : keyMap.keySet()) { - obj.put(keyMap.get(i), ""); - } - array.add(obj); - return array; - } - for (int i = rowStart + 1; i <= rowEnd; i++) { - Row eachRow = sheet.getRow(i); - JSONObject obj = new JSONObject(); - // 添加行号 - obj.put(ROW_NUM, i + 1); - StringBuilder sb = new StringBuilder(); - for (int k = cellStart; k < cellEnd; k++) { - if (eachRow != null) { - String val = getCellValue(eachRow.getCell(k)); - // 所有数据添加到里面,用于判断该行是否为空 - sb.append(val); - obj.put(keyMap.get(k), val); - } - } - if (sb.length() > 0) { - array.add(obj); - } - } - return array; - } - - private static String getCellValue(Cell cell) { - // 空白或空 - if (cell == null || cell.getCellTypeEnum() == CellType.BLANK) { - return ""; - } - // String类型 - if (cell.getCellTypeEnum() == CellType.STRING) { - String val = cell.getStringCellValue(); - if (val == null || val.trim().length() == 0) { - return ""; - } - return val.trim(); - } - // 数字类型 - if (cell.getCellTypeEnum() == CellType.NUMERIC) { - String s = cell.getNumericCellValue() + ""; - // 去掉尾巴上的小数点0 - if (Pattern.matches(".*\\.0*", s)) { - return s.split("\\.")[0]; - } else { - return s; - } - } - // 布尔值类型 - if (cell.getCellTypeEnum() == CellType.BOOLEAN) { - return cell.getBooleanCellValue() + ""; - } - // 错误类型 - return cell.getCellFormula(); - } - - public static void exportTemplate(HttpServletResponse response, String fileName, Class clazz) { - exportTemplate(response, fileName, fileName, clazz, false); - } - - public static void exportTemplate(HttpServletResponse response, String fileName, String sheetName, - Class clazz) { - exportTemplate(response, fileName, sheetName, clazz, false); - } - - public static void exportTemplate(HttpServletResponse response, String fileName, Class clazz, - boolean isContainExample) { - exportTemplate(response, fileName, fileName, clazz, isContainExample); - } - - public static void exportTemplate(HttpServletResponse response, String fileName, String sheetName, - Class clazz, boolean isContainExample) { - // 获取表头字段 - List headFieldList = getExcelClassFieldList(clazz); - // 获取表头数据和示例数据 - List> sheetDataList = new ArrayList<>(); - List headList = new ArrayList<>(); - List exampleList = new ArrayList<>(); - Map> selectMap = new LinkedHashMap<>(); - for (int i = 0; i < headFieldList.size(); i++) { - ExcelClassField each = headFieldList.get(i); - headList.add(each.getName()); - exampleList.add(each.getExample()); - LinkedHashMap kvMap = each.getKvMap(); - if (kvMap != null && kvMap.size() > 0) { - selectMap.put(i, new ArrayList<>(kvMap.values())); - } - } - sheetDataList.add(headList); - if (isContainExample) { - sheetDataList.add(exampleList); - } - // 导出数据 - export(response, fileName, sheetName, sheetDataList, selectMap); - } - - private static List getExcelClassFieldList(Class clazz) { - // 解析所有字段 - Field[] fields = clazz.getDeclaredFields(); - boolean hasExportAnnotation = false; - Map> map = new LinkedHashMap<>(); - List sortList = new ArrayList<>(); - for (Field field : fields) { - ExcelClassField cf = getExcelClassField(field); - if (cf.getHasAnnotation() == 1) { - hasExportAnnotation = true; - } - int sort = cf.getSort(); - if (map.containsKey(sort)) { - map.get(sort).add(cf); - } else { - List list = new ArrayList<>(); - list.add(cf); - sortList.add(sort); - map.put(sort, list); - } - } - Collections.sort(sortList); - // 获取表头 - List headFieldList = new ArrayList<>(); - if (hasExportAnnotation) { - for (Integer sort : sortList) { - for (ExcelClassField cf : map.get(sort)) { - if (cf.getHasAnnotation() == 1) { - headFieldList.add(cf); - } - } - } - } else { - headFieldList.addAll(map.get(0)); - } - return headFieldList; - } - - private static ExcelClassField getExcelClassField(Field field) { - ExcelClassField cf = new ExcelClassField(); - String fieldName = field.getName(); - cf.setFieldName(fieldName); - ExcelExport annotation = field.getAnnotation(ExcelExport.class); - // 无 ExcelExport 注解情况 - if (annotation == null) { - cf.setHasAnnotation(0); - cf.setName(fieldName); - cf.setSort(0); - return cf; - } - // 有 ExcelExport 注解情况 - cf.setHasAnnotation(1); - cf.setName(annotation.value()); - String example = getString(annotation.example()); - if (!example.isEmpty()) { - if (isNumeric(example)) { - cf.setExample(Double.valueOf(example)); - } else { - cf.setExample(example); - } - } else { - cf.setExample(""); - } - cf.setSort(annotation.sort()); - // 解析映射 - String kv = getString(annotation.kv()); - cf.setKvMap(getKvMap(kv)); - return cf; - } - - private static LinkedHashMap getKvMap(String kv) { - LinkedHashMap kvMap = new LinkedHashMap<>(); - if (kv.isEmpty()) { - return kvMap; - } - String[] kvs = kv.split(";"); - if (kvs.length == 0) { - return kvMap; - } - for (String each : kvs) { - String[] eachKv = getString(each).split("-"); - if (eachKv.length != 2) { - continue; - } - String k = eachKv[0]; - String v = eachKv[1]; - if (k.isEmpty() || v.isEmpty()) { - continue; - } - kvMap.put(k, v); - } - return kvMap; - } - - /** - * 导出表格到本地 - * - * @param file 本地文件对象 - * @param sheetData 导出数据 - */ - public static void exportFile(File file, List> sheetData) { - if (file == null) { - System.out.println("文件创建失败"); - return; - } - if (sheetData == null) { - sheetData = new ArrayList<>(); - } - Map>> map = new HashMap<>(16); - map.put(file.getName(), sheetData); - export(null, file, file.getName(), map, null); - } - - /** - * 导出表格到本地 - * - * @param 导出数据类似,和K类型保持一致 - * @param filePath 文件父路径(如:D:/doc/excel/) - * @param fileName 文件名称(不带尾缀,如:学生表) - * @param list 导出数据 - * @throws IOException IO异常 - */ - public static File exportFile(String filePath, String fileName, List list) throws IOException { - File file = getFile(filePath, fileName); - List> sheetData = getSheetData(list); - exportFile(file, sheetData); - return file; - } - - /** - * 获取文件 - * - * @param filePath filePath 文件父路径(如:D:/doc/excel/) - * @param fileName 文件名称(不带尾缀,如:用户表) - * @return 本地File文件对象 - */ - private static File getFile(String filePath, String fileName) throws IOException { - String dirPath = getString(filePath); - String fileFullPath; - if (dirPath.isEmpty()) { - fileFullPath = fileName; - } else { - // 判定文件夹是否存在,如果不存在,则级联创建 - File dirFile = new File(dirPath); - if (!dirFile.exists()) { - dirFile.mkdirs(); - } - // 获取文件夹全名 - if (dirPath.endsWith(String.valueOf(LEAN_LINE))) { - fileFullPath = dirPath + fileName + XLSX; - } else { - fileFullPath = dirPath + LEAN_LINE + fileName + XLSX; - } - } - System.out.println(fileFullPath); - File file = new File(fileFullPath); - if (!file.exists()) { - file.createNewFile(); - } - return file; - } - - private static List> getSheetData(List list) { - // 获取表头字段 - List excelClassFieldList = getExcelClassFieldList(list.get(0).getClass()); - List headFieldList = new ArrayList<>(); - List headList = new ArrayList<>(); - Map headFieldMap = new HashMap<>(16); - for (ExcelClassField each : excelClassFieldList) { - String fieldName = each.getFieldName(); - headFieldList.add(fieldName); - headFieldMap.put(fieldName, each); - headList.add(each.getName()); - } - // 添加表头名称 - List> sheetDataList = new ArrayList<>(); - sheetDataList.add(headList); - // 获取表数据 - for (T t : list) { - Map fieldDataMap = getFieldDataMap(t); - Set fieldDataKeys = fieldDataMap.keySet(); - List rowList = new ArrayList<>(); - for (String headField : headFieldList) { - if (!fieldDataKeys.contains(headField)) { - continue; - } - Object data = fieldDataMap.get(headField); - if (data == null) { - rowList.add(""); - continue; - } - ExcelClassField cf = headFieldMap.get(headField); - // 判断是否有映射关系 - LinkedHashMap kvMap = cf.getKvMap(); - if (kvMap == null || kvMap.isEmpty()) { - rowList.add(data); - continue; - } - String val = kvMap.get(data.toString()); - if (isNumeric(val)) { - rowList.add(Double.valueOf(val)); - } else { - rowList.add(val); - } - } - sheetDataList.add(rowList); - } - return sheetDataList; - } - - private static Map getFieldDataMap(T t) { - Map map = new HashMap<>(16); - Field[] fields = t.getClass().getDeclaredFields(); - try { - for (Field field : fields) { - String fieldName = field.getName(); - field.setAccessible(true); - Object object = field.get(t); - map.put(fieldName, object); - } - } catch (IllegalArgumentException | IllegalAccessException e) { - e.printStackTrace(); - } - return map; - } - - public static void exportEmpty(HttpServletResponse response, String fileName) { - List> sheetDataList = new ArrayList<>(); - List headList = new ArrayList<>(); - headList.add("导出无数据"); - sheetDataList.add(headList); - export(response, fileName, sheetDataList); - } - - public static void export(HttpServletResponse response, String fileName, List> sheetDataList) { - export(response, fileName, fileName, sheetDataList, null); - } - - public static void exportManySheet(HttpServletResponse response, String fileName, Map>> sheetMap) { - export(response, null, fileName, sheetMap, null); - } - - - public static void export(HttpServletResponse response, String fileName, String sheetName, - List> sheetDataList) { - export(response, fileName, sheetName, sheetDataList, null); - } - - public static void export(HttpServletResponse response, String fileName, String sheetName, - List> sheetDataList, Map> selectMap) { - - Map>> map = new HashMap<>(16); - map.put(sheetName, sheetDataList); - export(response, null, fileName, map, selectMap); - } - - public static void export(HttpServletResponse response, String fileName, List list, Class template) { - // list 是否为空 - boolean lisIsEmpty = list == null || list.isEmpty(); - // 如果模板数据为空,且导入的数据为空,则导出空文件 - if (template == null && lisIsEmpty) { - exportEmpty(response, fileName); - return; - } - // 如果 list 数据,则导出模板数据 - if (lisIsEmpty) { - exportTemplate(response, fileName, template); - return; - } - // 导出数据 - List> sheetDataList = getSheetData(list); - export(response, fileName, sheetDataList); - } - - public static void export(HttpServletResponse response, String fileName, List> sheetDataList, Map> selectMap) { - export(response, fileName, fileName, sheetDataList, selectMap); - } - - private static void export(HttpServletResponse response, File file, String fileName, - Map>> sheetMap, Map> selectMap) { - // 整个 Excel 表格 book 对象 - SXSSFWorkbook book = new SXSSFWorkbook(); - // 每个 Sheet 页 - Set>>> entries = sheetMap.entrySet(); - for (Entry>> entry : entries) { - List> sheetDataList = entry.getValue(); - Sheet sheet = book.createSheet(entry.getKey()); - Drawing patriarch = sheet.createDrawingPatriarch(); - // 设置表头背景色(灰色) - CellStyle headStyle = book.createCellStyle(); - headStyle.setFillForegroundColor(IndexedColors.GREY_80_PERCENT.index); - headStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND); - headStyle.setAlignment(HorizontalAlignment.CENTER); - headStyle.setFillForegroundColor(IndexedColors.GREY_25_PERCENT.index); - // 设置表身背景色(默认色) - CellStyle rowStyle = book.createCellStyle(); - rowStyle.setAlignment(HorizontalAlignment.CENTER); - rowStyle.setVerticalAlignment(VerticalAlignment.CENTER); - // 设置表格列宽度(默认为15个字节) - sheet.setDefaultColumnWidth(15); - // 创建合并算法数组 - int rowLength = sheetDataList.size(); - int columnLength = sheetDataList.get(0).size(); - int[][] mergeArray = new int[rowLength][columnLength]; - for (int i = 0; i < sheetDataList.size(); i++) { - // 每个 Sheet 页中的行数据 - Row row = sheet.createRow(i); - List rowList = sheetDataList.get(i); - for (int j = 0; j < rowList.size(); j++) { - // 每个行数据中的单元格数据 - Object o = rowList.get(j); - int v = 0; - if (o instanceof URL) { - // 如果要导出图片的话, 链接需要传递 URL 对象 - setCellPicture(book, row, patriarch, i, j, (URL) o); - } else { - Cell cell = row.createCell(j); - if (i == 0) { - // 第一行为表头行,采用灰色底背景 - v = setCellValue(cell, o, headStyle); - } else { - // 其他行为数据行,默认白底色 - v = setCellValue(cell, o, rowStyle); - } - } - mergeArray[i][j] = v; - } - } - // 合并单元格 - mergeCells(sheet, mergeArray); - // 设置下拉列表 - setSelect(sheet, selectMap); - } - // 写数据 - if (response != null) { - // 前端导出 - try { - write(response, book, fileName); - } catch (IOException e) { - e.printStackTrace(); - } - } else { - // 本地导出 - FileOutputStream fos; - try { - fos = new FileOutputStream(file); - ByteArrayOutputStream ops = new ByteArrayOutputStream(); - book.write(ops); - fos.write(ops.toByteArray()); - fos.close(); - } catch (Exception e) { - e.printStackTrace(); - } - } - } - - /** - * 合并当前Sheet页的单元格 - * - * @param sheet 当前 sheet 页 - * @param mergeArray 合并单元格算法 - */ - private static void mergeCells(Sheet sheet, int[][] mergeArray) { - // 横向合并 - for (int x = 0; x < mergeArray.length; x++) { - int[] arr = mergeArray[x]; - boolean merge = false; - int y1 = 0; - int y2 = 0; - for (int y = 0; y < arr.length; y++) { - int value = arr[y]; - if (value == CELL_COLUMN_MERGE) { - if (!merge) { - y1 = y; - } - y2 = y; - merge = true; - } else { - merge = false; - if (y1 > 0) { - sheet.addMergedRegion(new CellRangeAddress(x, x, (y1 - 1), y2)); - } - y1 = 0; - y2 = 0; - } - } - if (y1 > 0) { - sheet.addMergedRegion(new CellRangeAddress(x, x, (y1 - 1), y2)); - } - } - // 纵向合并 - int xLen = mergeArray.length; - int yLen = mergeArray[0].length; - for (int y = 0; y < yLen; y++) { - boolean merge = false; - int x1 = 0; - int x2 = 0; - for (int x = 0; x < xLen; x++) { - int value = mergeArray[x][y]; - if (value == CELL_ROW_MERGE) { - if (!merge) { - x1 = x; - } - x2 = x; - merge = true; - } else { - merge = false; - if (x1 > 0) { - sheet.addMergedRegion(new CellRangeAddress((x1 - 1), x2, y, y)); - } - x1 = 0; - x2 = 0; - } - } - if (x1 > 0) { - sheet.addMergedRegion(new CellRangeAddress((x1 - 1), x2, y, y)); - } - } - } - - private static void write(HttpServletResponse response, SXSSFWorkbook book, String fileName) throws IOException { - response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); - response.setCharacterEncoding("utf-8"); - String name = new String(fileName.getBytes("GBK"), "ISO8859_1") + XLSX; - response.addHeader("Content-Disposition", "attachment;filename=" + name); - ServletOutputStream out = response.getOutputStream(); - book.write(out); - out.flush(); - out.close(); - } - - private static int setCellValue(Cell cell, Object o, CellStyle style) { - // 设置样式 - cell.setCellStyle(style); - // 数据为空时 - if (ObjectUtil.isEmpty(o)) { - cell.setCellType(CellType.STRING); - cell.setCellValue(""); - return CELL_OTHER; - } - // 是否为字符串 - if (o instanceof String) { - String s = o.toString(); - if (isNumeric(s)) { - cell.setCellType(CellType.NUMERIC); - cell.setCellValue(Double.parseDouble(s)); - return CELL_OTHER; - } else { - cell.setCellType(CellType.STRING); - cell.setCellValue(s); - } - if (s.equals(ROW_MERGE)) { - return CELL_ROW_MERGE; - } else if (s.equals(COLUMN_MERGE)) { - return CELL_COLUMN_MERGE; - } else { - return CELL_OTHER; - } - } - // 是否为字符串 - if (o instanceof Integer || o instanceof Long || o instanceof Double || o instanceof Float) { - cell.setCellType(CellType.NUMERIC); - cell.setCellValue(Double.parseDouble(o.toString())); - return CELL_OTHER; - } - // 是否为Boolean - if (o instanceof Boolean) { - cell.setCellType(CellType.BOOLEAN); - cell.setCellValue((Boolean) o); - return CELL_OTHER; - } - // 如果是BigDecimal,则默认3位小数 - if (o instanceof BigDecimal) { - cell.setCellType(CellType.NUMERIC); - cell.setCellValue(((BigDecimal) o).setScale(3, RoundingMode.HALF_UP).doubleValue()); - return CELL_OTHER; - } - // 如果是Date数据,则显示格式化数据 - if (o instanceof Date) { - cell.setCellType(CellType.STRING); - cell.setCellValue(formatDate((Date) o)); - return CELL_OTHER; - } - // 如果是其他,则默认字符串类型 - cell.setCellType(CellType.STRING); - cell.setCellValue(o.toString()); - return CELL_OTHER; - } - - private static void setCellPicture(SXSSFWorkbook wb, Row sr, Drawing patriarch, int x, int y, URL url) { - // 设置图片宽高 - sr.setHeight((short) (IMG_WIDTH * IMG_HEIGHT)); - // (jdk1.7版本try中定义流可自动关闭) - try (InputStream is = url.openStream(); ByteArrayOutputStream outputStream = new ByteArrayOutputStream()) { - byte[] buff = new byte[BYTES_DEFAULT_LENGTH]; - int rc; - while ((rc = is.read(buff, 0, BYTES_DEFAULT_LENGTH)) > 0) { - outputStream.write(buff, 0, rc); - } - // 设置图片位置 - XSSFClientAnchor anchor = new XSSFClientAnchor(0, 0, 0, 0, y, x, y + 1, x + 1); - // 设置这个,图片会自动填满单元格的长宽 - anchor.setAnchorType(AnchorType.MOVE_AND_RESIZE); - patriarch.createPicture(anchor, wb.addPicture(outputStream.toByteArray(), HSSFWorkbook.PICTURE_TYPE_JPEG)); - } catch (Exception e) { - e.printStackTrace(); - } - } - - private static String formatDate(Date date) { - if (date == null) { - return ""; - } - SimpleDateFormat format = new SimpleDateFormat(DATE_FORMAT); - return format.format(date); - } - - private static void setSelect(Sheet sheet, Map> selectMap) { - if (selectMap == null || selectMap.isEmpty()) { - return; - } - Set>> entrySet = selectMap.entrySet(); - for (Entry> entry : entrySet) { - int y = entry.getKey(); - List list = entry.getValue(); - if (list == null || list.isEmpty()) { - continue; - } - String[] arr = new String[list.size()]; - for (int i = 0; i < list.size(); i++) { - arr[i] = list.get(i); - } - DataValidationHelper helper = sheet.getDataValidationHelper(); - CellRangeAddressList addressList = new CellRangeAddressList(1, 65000, y, y); - DataValidationConstraint dvc = helper.createExplicitListConstraint(arr); - DataValidation dv = helper.createValidation(dvc, addressList); - if (dv instanceof HSSFDataValidation) { - dv.setSuppressDropDownArrow(false); - } else { - dv.setSuppressDropDownArrow(true); - dv.setShowErrorBox(true); - } - sheet.addValidationData(dv); - } - } - - private static boolean isNumeric(String str) { - if ("0.0".equals(str)) { - return true; - } - if (str.length() >= 15) { - return false; - } - for (int i = str.length(); --i >= 0; ) { - if (!Character.isDigit(str.charAt(i))) { - return false; - } - } - return true; - } - - private static String getString(String s) { - if (s == null) { - return ""; - } - if (s.isEmpty()) { - return s; - } - return s.trim(); - } -} diff --git a/wjcy-common/src/test/java/me/zhengjie/utils/EncryptUtilsTest.java b/wjcy-common/src/test/java/me/zhengjie/utils/EncryptUtilsTest.java deleted file mode 100644 index f909d9d..0000000 --- a/wjcy-common/src/test/java/me/zhengjie/utils/EncryptUtilsTest.java +++ /dev/null @@ -1,32 +0,0 @@ -package me.zhengjie.utils; - -import org.junit.Test; -import static org.junit.Assert.*; -import static me.zhengjie.utils.EncryptUtils.*; - -public class EncryptUtilsTest { - - /** - * 对称加密 - */ - @Test - public void testDesEncrypt() { - try { - assertEquals("7772841DC6099402", desEncrypt("123456")); - } catch (Exception e) { - e.printStackTrace(); - } - } - - /** - * 对称解密 - */ - @Test - public void testDesDecrypt() { - try { - assertEquals("123456", desDecrypt("7772841DC6099402")); - } catch (Exception e) { - e.printStackTrace(); - } - } -} diff --git a/wjcy-common/src/test/java/me/zhengjie/utils/FileUtilTest.java b/wjcy-common/src/test/java/me/zhengjie/utils/FileUtilTest.java deleted file mode 100644 index f069c15..0000000 --- a/wjcy-common/src/test/java/me/zhengjie/utils/FileUtilTest.java +++ /dev/null @@ -1,36 +0,0 @@ -package me.zhengjie.utils; - -import org.junit.Test; -import org.springframework.mock.web.MockMultipartFile; - -import static org.junit.Assert.*; -import static me.zhengjie.utils.FileUtil.*; - -public class FileUtilTest { - - @Test - public void testToFile() { - long retval = toFile(new MockMultipartFile("foo", (byte[]) null)).getTotalSpace(); - assertEquals(500695072768L, retval); - } - - @Test - public void testGetExtensionName() { - assertEquals("foo", getExtensionName("foo")); - assertEquals("exe", getExtensionName("bar.exe")); - } - - @Test - public void testGetFileNameNoEx() { - assertEquals("foo", getFileNameNoEx("foo")); - assertEquals("bar", getFileNameNoEx("bar.txt")); - } - - @Test - public void testGetSize() { - assertEquals("1000B ", getSize(1000)); - assertEquals("1.00KB ", getSize(1024)); - assertEquals("1.00MB ", getSize(1048576)); - assertEquals("1.00GB ", getSize(1073741824)); - } -} diff --git a/wjcy-common/src/test/java/me/zhengjie/utils/StringUtilsTest.java b/wjcy-common/src/test/java/me/zhengjie/utils/StringUtilsTest.java deleted file mode 100644 index 16de472..0000000 --- a/wjcy-common/src/test/java/me/zhengjie/utils/StringUtilsTest.java +++ /dev/null @@ -1,66 +0,0 @@ -package me.zhengjie.utils; - -import cn.hutool.core.date.DateTime; -import cn.hutool.core.date.DateUtil; -import org.junit.Test; -import org.springframework.mock.web.MockHttpServletRequest; -import org.thymeleaf.util.DateUtils; - -import java.text.SimpleDateFormat; -import java.util.Date; - -import static me.zhengjie.utils.StringUtils.*; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; - -public class StringUtilsTest { - - @Test - public void testToCamelCase() { - assertNull(toCamelCase(null)); - } - - @Test - public void testToCapitalizeCamelCase() { - assertNull(StringUtils.toCapitalizeCamelCase(null)); - assertEquals("HelloWorld", toCapitalizeCamelCase("hello_world")); - } - - @Test - public void testToUnderScoreCase() { - assertNull(StringUtils.toUnderScoreCase(null)); - assertEquals("hello_world", toUnderScoreCase("helloWorld")); - assertEquals("\u0000\u0000", toUnderScoreCase("\u0000\u0000")); - assertEquals("\u0000_a", toUnderScoreCase("\u0000A")); - } - - @Test - public void testGetWeekDay() { - SimpleDateFormat simpleDateformat = new SimpleDateFormat("E"); - assertEquals(simpleDateformat.format(new Date()), getWeekDay()); - } - - @Test - public void testGetIP() { - assertEquals("127.0.0.1", getIp(new MockHttpServletRequest())); - } - - - - @Test - public void test123() { - // 仅一次 - Date date = DateUtil.date(); - System.out.println("date:" + date); - DateTime dateTime = DateUtil.offsetSecond(date, 5); - System.out.println("dateTime:" + dateTime); - - String onlyOnce = CronUtils.onlyOnce(DateUtil.formatDateTime(dateTime)); - String onlyOnce1 = CronUtils.onlyOnce("2022-10-10 10:10:10"); - System.out.println(onlyOnce); - - // 一部到位 - String onlyOnce2 = CronUtils.onlyOnce(DateUtil.formatDateTime(DateUtil.offsetSecond(DateUtil.date(), 5))); - System.out.println(onlyOnce2); - } -} \ No newline at end of file diff --git a/wjcy-generator/pom.xml b/wjcy-generator/pom.xml deleted file mode 100644 index 87d7e4e..0000000 --- a/wjcy-generator/pom.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - wjcy - me.zhengjie - 1.0 - - 4.0.0 - - wjcy-generator - 代码生成模块 - - - 1.9 - - - - - me.zhengjie - wjcy-common - 1.0 - - - - - org.springframework.boot - spring-boot-starter-freemarker - - - - - commons-configuration - commons-configuration - ${configuration.version} - - - \ No newline at end of file diff --git a/wjcy-generator/src/main/java/me/zhengjie/domain/ColumnInfo.java b/wjcy-generator/src/main/java/me/zhengjie/domain/ColumnInfo.java deleted file mode 100644 index fdb962a..0000000 --- a/wjcy-generator/src/main/java/me/zhengjie/domain/ColumnInfo.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.domain; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -import me.zhengjie.utils.GenUtil; -import javax.persistence.*; -import java.io.Serializable; - -/** - * 列的数据信息 - * @author Zheng Jie - * @date 2019-01-02 - */ -@Getter -@Setter -@Entity -@NoArgsConstructor -@Table(name = "code_column_config") -public class ColumnInfo implements Serializable { - - @Id - @Column(name = "column_id") - @ApiModelProperty(value = "ID", hidden = true) - @GeneratedValue(strategy = GenerationType.IDENTITY) - private Long id; - - @ApiModelProperty(value = "表名") - private String tableName; - - @ApiModelProperty(value = "数据库字段名称") - private String columnName; - - @ApiModelProperty(value = "数据库字段类型") - private String columnType; - - @ApiModelProperty(value = "数据库字段键类型") - private String keyType; - - @ApiModelProperty(value = "字段额外的参数") - private String extra; - - @ApiModelProperty(value = "数据库字段描述") - private String remark; - - @ApiModelProperty(value = "是否必填") - private Boolean notNull; - - @ApiModelProperty(value = "是否在列表显示") - private Boolean listShow; - - @ApiModelProperty(value = "是否表单显示") - private Boolean formShow; - - @ApiModelProperty(value = "表单类型") - private String formType; - - @ApiModelProperty(value = "查询 1:模糊 2:精确") - private String queryType; - - @ApiModelProperty(value = "字典名称") - private String dictName; - - @ApiModelProperty(value = "日期注解") - private String dateAnnotation; - - public ColumnInfo(String tableName, String columnName, Boolean notNull, String columnType, String remark, String keyType, String extra) { - this.tableName = tableName; - this.columnName = columnName; - this.columnType = columnType; - this.keyType = keyType; - this.extra = extra; - this.notNull = notNull; - if(GenUtil.PK.equalsIgnoreCase(keyType) && GenUtil.EXTRA.equalsIgnoreCase(extra)){ - this.notNull = false; - } - this.remark = remark; - this.listShow = true; - this.formShow = true; - } -} diff --git a/wjcy-generator/src/main/java/me/zhengjie/domain/GenConfig.java b/wjcy-generator/src/main/java/me/zhengjie/domain/GenConfig.java deleted file mode 100644 index a2d6706..0000000 --- a/wjcy-generator/src/main/java/me/zhengjie/domain/GenConfig.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.domain; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -import javax.persistence.*; -import javax.validation.constraints.NotBlank; -import java.io.Serializable; - -/** - * 代码生成配置 - * @author Zheng Jie - * @date 2019-01-03 - */ -@Getter -@Setter -@Entity -@NoArgsConstructor -@Table(name = "code_gen_config") -public class GenConfig implements Serializable { - - public GenConfig(String tableName) { - this.tableName = tableName; - } - - @Id - @Column(name = "config_id") - @ApiModelProperty(value = "ID", hidden = true) - @GeneratedValue(strategy = GenerationType.IDENTITY) - private Long id; - - @NotBlank - @ApiModelProperty(value = "表名") - private String tableName; - - @ApiModelProperty(value = "接口名称") - private String apiAlias; - - @NotBlank - @ApiModelProperty(value = "包路径") - private String pack; - - @NotBlank - @ApiModelProperty(value = "模块名") - private String moduleName; - - @NotBlank - @ApiModelProperty(value = "前端文件路径") - private String path; - - @ApiModelProperty(value = "前端文件路径") - private String apiPath; - - @ApiModelProperty(value = "作者") - private String author; - - @ApiModelProperty(value = "表前缀") - private String prefix; - - @ApiModelProperty(value = "是否覆盖") - private Boolean cover = false; -} diff --git a/wjcy-generator/src/main/java/me/zhengjie/domain/vo/TableInfo.java b/wjcy-generator/src/main/java/me/zhengjie/domain/vo/TableInfo.java deleted file mode 100644 index 1d3967b..0000000 --- a/wjcy-generator/src/main/java/me/zhengjie/domain/vo/TableInfo.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.domain.vo; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * 表的数据信息 - * @author Zheng Jie - * @date 2019-01-02 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class TableInfo { - - /** 表名称 */ - private Object tableName; - - /** 创建日期 */ - private Object createTime; - - /** 数据库引擎 */ - private Object engine; - - /** 编码集 */ - private Object coding; - - /** 备注 */ - private Object remark; - - -} diff --git a/wjcy-generator/src/main/java/me/zhengjie/repository/ColumnInfoRepository.java b/wjcy-generator/src/main/java/me/zhengjie/repository/ColumnInfoRepository.java deleted file mode 100644 index 4638be2..0000000 --- a/wjcy-generator/src/main/java/me/zhengjie/repository/ColumnInfoRepository.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.repository; - -import me.zhengjie.domain.ColumnInfo; -import org.springframework.data.jpa.repository.JpaRepository; -import java.util.List; - -/** - * @author Zheng Jie - * @date 2019-01-14 - */ -public interface ColumnInfoRepository extends JpaRepository { - - /** - * 查询表信息 - * @param tableName 表格名 - * @return 表信息 - */ - List findByTableNameOrderByIdAsc(String tableName); -} diff --git a/wjcy-generator/src/main/java/me/zhengjie/repository/GenConfigRepository.java b/wjcy-generator/src/main/java/me/zhengjie/repository/GenConfigRepository.java deleted file mode 100644 index 18c9a0c..0000000 --- a/wjcy-generator/src/main/java/me/zhengjie/repository/GenConfigRepository.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.repository; - -import me.zhengjie.domain.GenConfig; -import org.springframework.data.jpa.repository.JpaRepository; - -/** - * @author Zheng Jie - * @date 2019-01-14 - */ -public interface GenConfigRepository extends JpaRepository { - - /** - * 查询表配置 - * @param tableName 表名 - * @return / - */ - GenConfig findByTableName(String tableName); -} diff --git a/wjcy-generator/src/main/java/me/zhengjie/rest/GenConfigController.java b/wjcy-generator/src/main/java/me/zhengjie/rest/GenConfigController.java deleted file mode 100644 index 98ec149..0000000 --- a/wjcy-generator/src/main/java/me/zhengjie/rest/GenConfigController.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.rest; - -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import lombok.RequiredArgsConstructor; -import me.zhengjie.domain.GenConfig; -import me.zhengjie.service.GenConfigService; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; - -/** - * @author Zheng Jie - * @date 2019-01-14 - */ -@RestController -@RequiredArgsConstructor -@RequestMapping("/api/genConfig") -@Api(tags = "系统:代码生成器配置管理") -public class GenConfigController { - - private final GenConfigService genConfigService; - - @ApiOperation("查询") - @GetMapping(value = "/{tableName}") - public ResponseEntity query(@PathVariable String tableName){ - return new ResponseEntity<>(genConfigService.find(tableName), HttpStatus.OK); - } - - @ApiOperation("修改") - @PutMapping - public ResponseEntity update(@Validated @RequestBody GenConfig genConfig){ - return new ResponseEntity<>(genConfigService.update(genConfig.getTableName(), genConfig),HttpStatus.OK); - } -} diff --git a/wjcy-generator/src/main/java/me/zhengjie/rest/GeneratorController.java b/wjcy-generator/src/main/java/me/zhengjie/rest/GeneratorController.java deleted file mode 100644 index ce6a17d..0000000 --- a/wjcy-generator/src/main/java/me/zhengjie/rest/GeneratorController.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.rest; - -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import lombok.RequiredArgsConstructor; -import me.zhengjie.domain.ColumnInfo; -import me.zhengjie.exception.BadRequestException; -import me.zhengjie.service.GenConfigService; -import me.zhengjie.service.GeneratorService; -import me.zhengjie.utils.PageUtil; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.*; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.util.List; - -/** - * @author Zheng Jie - * @date 2019-01-02 - */ -@RestController -@RequiredArgsConstructor -@RequestMapping("/api/generator") -@Api(tags = "系统:代码生成管理") -public class GeneratorController { - - private final GeneratorService generatorService; - private final GenConfigService genConfigService; - - @Value("${generator.enabled}") - private Boolean generatorEnabled; - - @ApiOperation("查询数据库数据") - @GetMapping(value = "/tables/all") - public ResponseEntity queryTables(){ - return new ResponseEntity<>(generatorService.getTables(), HttpStatus.OK); - } - - @ApiOperation("查询数据库数据") - @GetMapping(value = "/tables") - public ResponseEntity queryTables(@RequestParam(defaultValue = "") String name, - @RequestParam(defaultValue = "0")Integer page, - @RequestParam(defaultValue = "10")Integer size){ - int[] startEnd = PageUtil.transToStartEnd(page, size); - return new ResponseEntity<>(generatorService.getTables(name,startEnd), HttpStatus.OK); - } - - @ApiOperation("查询字段数据") - @GetMapping(value = "/columns") - public ResponseEntity queryColumns(@RequestParam String tableName){ - List columnInfos = generatorService.getColumns(tableName); - return new ResponseEntity<>(PageUtil.toPage(columnInfos,columnInfos.size()), HttpStatus.OK); - } - - @ApiOperation("保存字段数据") - @PutMapping - public ResponseEntity save(@RequestBody List columnInfos){ - generatorService.save(columnInfos); - return new ResponseEntity<>(HttpStatus.OK); - } - - @ApiOperation("同步字段数据") - @PostMapping(value = "sync") - public ResponseEntity sync(@RequestBody List tables){ - for (String table : tables) { - generatorService.sync(generatorService.getColumns(table), generatorService.query(table)); - } - return new ResponseEntity<>(HttpStatus.OK); - } - - @ApiOperation("生成代码") - @PostMapping(value = "/{tableName}/{type}") - public ResponseEntity generator(@PathVariable String tableName, @PathVariable Integer type, HttpServletRequest request, HttpServletResponse response){ - if(!generatorEnabled && type == 0){ - throw new BadRequestException("此环境不允许生成代码,请选择预览或者下载查看!"); - } - switch (type){ - // 生成代码 - case 0: generatorService.generator(genConfigService.find(tableName), generatorService.getColumns(tableName)); - break; - // 预览 - case 1: return generatorService.preview(genConfigService.find(tableName), generatorService.getColumns(tableName)); - // 打包 - case 2: generatorService.download(genConfigService.find(tableName), generatorService.getColumns(tableName), request, response); - break; - default: throw new BadRequestException("没有这个选项"); - } - return new ResponseEntity<>(HttpStatus.OK); - } -} diff --git a/wjcy-generator/src/main/java/me/zhengjie/service/GenConfigService.java b/wjcy-generator/src/main/java/me/zhengjie/service/GenConfigService.java deleted file mode 100644 index b5711f4..0000000 --- a/wjcy-generator/src/main/java/me/zhengjie/service/GenConfigService.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.service; - -import me.zhengjie.domain.GenConfig; - -/** - * @author Zheng Jie - * @date 2019-01-14 - */ -public interface GenConfigService { - - /** - * 查询表配置 - * @param tableName 表名 - * @return 表配置 - */ - GenConfig find(String tableName); - - /** - * 更新表配置 - * @param tableName 表名 - * @param genConfig 表配置 - * @return 表配置 - */ - GenConfig update(String tableName, GenConfig genConfig); -} diff --git a/wjcy-generator/src/main/java/me/zhengjie/service/GeneratorService.java b/wjcy-generator/src/main/java/me/zhengjie/service/GeneratorService.java deleted file mode 100644 index b5a1e0a..0000000 --- a/wjcy-generator/src/main/java/me/zhengjie/service/GeneratorService.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.service; - -import me.zhengjie.domain.GenConfig; -import me.zhengjie.domain.ColumnInfo; -import org.springframework.http.ResponseEntity; -import org.springframework.scheduling.annotation.Async; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.util.List; - -/** - * @author Zheng Jie - * @date 2019-01-02 - */ -public interface GeneratorService { - - /** - * 查询数据库元数据 - * @param name 表名 - * @param startEnd 分页参数 - * @return / - */ - Object getTables(String name, int[] startEnd); - - /** - * 得到数据表的元数据 - * @param name 表名 - * @return / - */ - List getColumns(String name); - - /** - * 同步表数据 - * @param columnInfos / - * @param columnInfoList / - */ - void sync(List columnInfos, List columnInfoList); - - /** - * 保持数据 - * @param columnInfos / - */ - void save(List columnInfos); - - /** - * 获取所有table - * @return / - */ - Object getTables(); - - /** - * 代码生成 - * @param genConfig 配置信息 - * @param columns 字段信息 - */ - void generator(GenConfig genConfig, List columns); - - /** - * 预览 - * @param genConfig 配置信息 - * @param columns 字段信息 - * @return / - */ - ResponseEntity preview(GenConfig genConfig, List columns); - - /** - * 打包下载 - * @param genConfig 配置信息 - * @param columns 字段信息 - * @param request / - * @param response / - */ - void download(GenConfig genConfig, List columns, HttpServletRequest request, HttpServletResponse response); - - /** - * 查询数据库的表字段数据数据 - * @param table / - * @return / - */ - List query(String table); -} diff --git a/wjcy-generator/src/main/java/me/zhengjie/service/impl/GenConfigServiceImpl.java b/wjcy-generator/src/main/java/me/zhengjie/service/impl/GenConfigServiceImpl.java deleted file mode 100644 index bc2d061..0000000 --- a/wjcy-generator/src/main/java/me/zhengjie/service/impl/GenConfigServiceImpl.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.service.impl; - -import lombok.RequiredArgsConstructor; -import me.zhengjie.domain.GenConfig; -import me.zhengjie.repository.GenConfigRepository; -import me.zhengjie.service.GenConfigService; -import me.zhengjie.utils.StringUtils; -import org.springframework.stereotype.Service; -import java.io.File; - -/** - * @author Zheng Jie - * @date 2019-01-14 - */ -@Service -@RequiredArgsConstructor -public class GenConfigServiceImpl implements GenConfigService { - - private final GenConfigRepository genConfigRepository; - - @Override - public GenConfig find(String tableName) { - GenConfig genConfig = genConfigRepository.findByTableName(tableName); - if(genConfig == null){ - return new GenConfig(tableName); - } - return genConfig; - } - - @Override - public GenConfig update(String tableName, GenConfig genConfig) { - String separator = File.separator; - String[] paths; - String symbol = "\\"; - if (symbol.equals(separator)) { - paths = genConfig.getPath().split("\\\\"); - } else { - paths = genConfig.getPath().split(File.separator); - } - StringBuilder api = new StringBuilder(); - for (String path : paths) { - api.append(path); - api.append(separator); - if ("src".equals(path)) { - api.append("api"); - break; - } - } - genConfig.setApiPath(api.toString()); - return genConfigRepository.save(genConfig); - } -} diff --git a/wjcy-generator/src/main/java/me/zhengjie/service/impl/GeneratorServiceImpl.java b/wjcy-generator/src/main/java/me/zhengjie/service/impl/GeneratorServiceImpl.java deleted file mode 100644 index 1b1803b..0000000 --- a/wjcy-generator/src/main/java/me/zhengjie/service/impl/GeneratorServiceImpl.java +++ /dev/null @@ -1,203 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.service.impl; - -import cn.hutool.core.collection.CollectionUtil; -import cn.hutool.core.util.ObjectUtil; -import cn.hutool.core.util.ZipUtil; -import lombok.RequiredArgsConstructor; -import me.zhengjie.domain.GenConfig; -import me.zhengjie.domain.ColumnInfo; -import me.zhengjie.domain.vo.TableInfo; -import me.zhengjie.exception.BadRequestException; -import me.zhengjie.repository.ColumnInfoRepository; -import me.zhengjie.service.GeneratorService; -import me.zhengjie.utils.FileUtil; -import me.zhengjie.utils.GenUtil; -import me.zhengjie.utils.PageUtil; -import me.zhengjie.utils.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.stereotype.Service; - -import javax.persistence.EntityManager; -import javax.persistence.PersistenceContext; -import javax.persistence.Query; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.File; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - -/** - * @author Zheng Jie - * @date 2019-01-02 - */ -@Service -@RequiredArgsConstructor -public class GeneratorServiceImpl implements GeneratorService { - private static final Logger log = LoggerFactory.getLogger(GeneratorServiceImpl.class); - @PersistenceContext - private EntityManager em; - - private final ColumnInfoRepository columnInfoRepository; - - @Override - public Object getTables() { - // 使用预编译防止sql注入 - String sql = "select table_name ,create_time , engine, table_collation, table_comment from information_schema.tables " + - "where table_schema = (select database()) " + - "order by create_time desc"; - Query query = em.createNativeQuery(sql); - return query.getResultList(); - } - - @Override - public Object getTables(String name, int[] startEnd) { - // 使用预编译防止sql注入 - String sql = "select table_name ,create_time , engine, table_collation, table_comment from information_schema.tables " + - "where table_schema = (select database()) " + - "and table_name like ? order by create_time desc"; - Query query = em.createNativeQuery(sql); - query.setFirstResult(startEnd[0]); - query.setMaxResults(startEnd[1] - startEnd[0]); - query.setParameter(1, StringUtils.isNotBlank(name) ? ("%" + name + "%") : "%%"); - List result = query.getResultList(); - List tableInfos = new ArrayList<>(); - for (Object obj : result) { - Object[] arr = (Object[]) obj; - tableInfos.add(new TableInfo(arr[0], arr[1], arr[2], arr[3], ObjectUtil.isNotEmpty(arr[4]) ? arr[4] : "-")); - } - Query query1 = em.createNativeQuery("SELECT COUNT(*) from information_schema.tables where table_schema = (select database())"); - Object totalElements = query1.getSingleResult(); - return PageUtil.toPage(tableInfos, totalElements); - } - - @Override - public List getColumns(String tableName) { - List columnInfos = columnInfoRepository.findByTableNameOrderByIdAsc(tableName); - if (CollectionUtil.isNotEmpty(columnInfos)) { - return columnInfos; - } else { - columnInfos = query(tableName); - return columnInfoRepository.saveAll(columnInfos); - } - } - - @Override - public List query(String tableName) { - // 使用预编译防止sql注入 - String sql = "select column_name, is_nullable, data_type, column_comment, column_key, extra from information_schema.columns " + - "where table_name = ? and table_schema = (select database()) order by ordinal_position"; - Query query = em.createNativeQuery(sql); - query.setParameter(1, tableName); - List result = query.getResultList(); - List columnInfos = new ArrayList<>(); - for (Object obj : result) { - Object[] arr = (Object[]) obj; - columnInfos.add( - new ColumnInfo( - tableName, - arr[0].toString(), - "NO".equals(arr[1]), - arr[2].toString(), - ObjectUtil.isNotNull(arr[3]) ? arr[3].toString() : null, - ObjectUtil.isNotNull(arr[4]) ? arr[4].toString() : null, - ObjectUtil.isNotNull(arr[5]) ? arr[5].toString() : null) - ); - } - return columnInfos; - } - - @Override - public void sync(List columnInfos, List columnInfoList) { - // 第一种情况,数据库类字段改变或者新增字段 - for (ColumnInfo columnInfo : columnInfoList) { - // 根据字段名称查找 - List columns = columnInfos.stream().filter(c -> c.getColumnName().equals(columnInfo.getColumnName())).collect(Collectors.toList()); - // 如果能找到,就修改部分可能被字段 - if (CollectionUtil.isNotEmpty(columns)) { - ColumnInfo column = columns.get(0); - column.setColumnType(columnInfo.getColumnType()); - column.setExtra(columnInfo.getExtra()); - column.setKeyType(columnInfo.getKeyType()); - if (StringUtils.isBlank(column.getRemark())) { - column.setRemark(columnInfo.getRemark()); - } - columnInfoRepository.save(column); - } else { - // 如果找不到,则保存新字段信息 - columnInfoRepository.save(columnInfo); - } - } - // 第二种情况,数据库字段删除了 - for (ColumnInfo columnInfo : columnInfos) { - // 根据字段名称查找 - List columns = columnInfoList.stream().filter(c -> c.getColumnName().equals(columnInfo.getColumnName())).collect(Collectors.toList()); - // 如果找不到,就代表字段被删除了,则需要删除该字段 - if (CollectionUtil.isEmpty(columns)) { - columnInfoRepository.delete(columnInfo); - } - } - } - - @Override - public void save(List columnInfos) { - columnInfoRepository.saveAll(columnInfos); - } - - @Override - public void generator(GenConfig genConfig, List columns) { - if (genConfig.getId() == null) { - throw new BadRequestException("请先配置生成器"); - } - try { - GenUtil.generatorCode(columns, genConfig); - } catch (IOException e) { - log.error(e.getMessage(), e); - throw new BadRequestException("生成失败,请手动处理已生成的文件"); - } - } - - @Override - public ResponseEntity preview(GenConfig genConfig, List columns) { - if (genConfig.getId() == null) { - throw new BadRequestException("请先配置生成器"); - } - List> genList = GenUtil.preview(columns, genConfig); - return new ResponseEntity<>(genList, HttpStatus.OK); - } - - @Override - public void download(GenConfig genConfig, List columns, HttpServletRequest request, HttpServletResponse response) { - if (genConfig.getId() == null) { - throw new BadRequestException("请先配置生成器"); - } - try { - File file = new File(GenUtil.download(columns, genConfig)); - String zipPath = file.getPath() + ".zip"; - ZipUtil.zip(file.getPath(), zipPath); - FileUtil.downloadFile(request, response, new File(zipPath), true); - } catch (IOException e) { - throw new BadRequestException("打包失败"); - } - } -} diff --git a/wjcy-generator/src/main/java/me/zhengjie/utils/ColUtil.java b/wjcy-generator/src/main/java/me/zhengjie/utils/ColUtil.java deleted file mode 100644 index b5fcd6b..0000000 --- a/wjcy-generator/src/main/java/me/zhengjie/utils/ColUtil.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.utils; - -import org.apache.commons.configuration.*; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * sql字段转java - * - * @author Zheng Jie - * @date 2019-01-03 - */ -public class ColUtil { - private static final Logger log = LoggerFactory.getLogger(ColUtil.class); - - /** - * 转换mysql数据类型为java数据类型 - * - * @param type 数据库字段类型 - * @return String - */ - static String cloToJava(String type) { - Configuration config = getConfig(); - assert config != null; - return config.getString(type, "unknowType"); - } - - /** - * 获取配置信息 - */ - public static PropertiesConfiguration getConfig() { - try { - return new PropertiesConfiguration("generator.properties"); - } catch (ConfigurationException e) { - log.error(e.getMessage(), e); - } - return null; - } -} diff --git a/wjcy-generator/src/main/java/me/zhengjie/utils/GenUtil.java b/wjcy-generator/src/main/java/me/zhengjie/utils/GenUtil.java deleted file mode 100644 index 566b6d8..0000000 --- a/wjcy-generator/src/main/java/me/zhengjie/utils/GenUtil.java +++ /dev/null @@ -1,420 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.utils; - -import cn.hutool.core.util.StrUtil; -import cn.hutool.extra.template.*; -import lombok.extern.slf4j.Slf4j; -import me.zhengjie.domain.GenConfig; -import me.zhengjie.domain.ColumnInfo; -import org.springframework.util.ObjectUtils; - -import java.io.File; -import java.io.FileWriter; -import java.io.IOException; -import java.io.Writer; -import java.time.LocalDate; -import java.util.*; - -import static me.zhengjie.utils.FileUtil.SYS_TEM_DIR; - -/** - * 代码生成 - * - * @author Zheng Jie - * @date 2019-01-02 - */ -@Slf4j -@SuppressWarnings({"unchecked", "all"}) -public class GenUtil { - - private static final String TIMESTAMP = "Timestamp"; - - private static final String BIGDECIMAL = "BigDecimal"; - - public static final String PK = "PRI"; - - public static final String EXTRA = "auto_increment"; - - /** - * 获取后端代码模板名称 - * - * @return List - */ - private static List getAdminTemplateNames() { - List templateNames = new ArrayList<>(); - templateNames.add("Entity"); - templateNames.add("Dto"); - templateNames.add("Mapper"); - templateNames.add("Controller"); - templateNames.add("QueryCriteria"); - templateNames.add("Service"); - templateNames.add("ServiceImpl"); - templateNames.add("Repository"); - return templateNames; - } - - /** - * 获取前端代码模板名称 - * - * @return List - */ - private static List getFrontTemplateNames() { - List templateNames = new ArrayList<>(); - templateNames.add("index"); - templateNames.add("api"); - return templateNames; - } - - public static List> preview(List columns, GenConfig genConfig) { - Map genMap = getGenMap(columns, genConfig); - List> genList = new ArrayList<>(); - // 获取后端模版 - List templates = getAdminTemplateNames(); - TemplateEngine engine = TemplateUtil.createEngine(new TemplateConfig("template", TemplateConfig.ResourceMode.CLASSPATH)); - for (String templateName : templates) { - Map map = new HashMap<>(1); - Template template = engine.getTemplate("generator/admin/" + templateName + ".ftl"); - map.put("content", template.render(genMap)); - map.put("name", templateName); - genList.add(map); - } - // 获取前端模版 - templates = getFrontTemplateNames(); - for (String templateName : templates) { - Map map = new HashMap<>(1); - Template template = engine.getTemplate("generator/front/" + templateName + ".ftl"); - map.put(templateName, template.render(genMap)); - map.put("content", template.render(genMap)); - map.put("name", templateName); - genList.add(map); - } - return genList; - } - - public static String download(List columns, GenConfig genConfig) throws IOException { - // 拼接的路径:/tmpeladmin-gen-temp/,这个路径在Linux下需要root用户才有权限创建,非root用户会权限错误而失败,更改为: /tmp/eladmin-gen-temp/ - // String tempPath =SYS_TEM_DIR + "eladmin-gen-temp" + File.separator + genConfig.getTableName() + File.separator; - String tempPath = SYS_TEM_DIR + "eladmin-gen-temp" + File.separator + genConfig.getTableName() + File.separator; - Map genMap = getGenMap(columns, genConfig); - TemplateEngine engine = TemplateUtil.createEngine(new TemplateConfig("template", TemplateConfig.ResourceMode.CLASSPATH)); - // 生成后端代码 - List templates = getAdminTemplateNames(); - for (String templateName : templates) { - Template template = engine.getTemplate("generator/admin/" + templateName + ".ftl"); - String filePath = getAdminFilePath(templateName, genConfig, genMap.get("className").toString(), tempPath + "eladmin" + File.separator); - assert filePath != null; - File file = new File(filePath); - // 如果非覆盖生成 - if (!genConfig.getCover() && FileUtil.exist(file)) { - continue; - } - // 生成代码 - genFile(file, template, genMap); - } - // 生成前端代码 - templates = getFrontTemplateNames(); - for (String templateName : templates) { - Template template = engine.getTemplate("generator/front/" + templateName + ".ftl"); - String path = tempPath + "eladmin-web" + File.separator; - String apiPath = path + "src" + File.separator + "api" + File.separator; - String srcPath = path + "src" + File.separator + "views" + File.separator + genMap.get("changeClassName").toString() + File.separator; - String filePath = getFrontFilePath(templateName, apiPath, srcPath, genMap.get("changeClassName").toString()); - assert filePath != null; - File file = new File(filePath); - // 如果非覆盖生成 - if (!genConfig.getCover() && FileUtil.exist(file)) { - continue; - } - // 生成代码 - genFile(file, template, genMap); - } - return tempPath; - } - - public static void generatorCode(List columnInfos, GenConfig genConfig) throws IOException { - Map genMap = getGenMap(columnInfos, genConfig); - TemplateEngine engine = TemplateUtil.createEngine(new TemplateConfig("template", TemplateConfig.ResourceMode.CLASSPATH)); - // 生成后端代码 - List templates = getAdminTemplateNames(); - for (String templateName : templates) { - Template template = engine.getTemplate("generator/admin/" + templateName + ".ftl"); - String rootPath = System.getProperty("user.dir"); - String filePath = getAdminFilePath(templateName, genConfig, genMap.get("className").toString(), rootPath); - - assert filePath != null; - File file = new File(filePath); - - // 如果非覆盖生成 - if (!genConfig.getCover() && FileUtil.exist(file)) { - continue; - } - // 生成代码 - genFile(file, template, genMap); - } - - // 生成前端代码 - templates = getFrontTemplateNames(); - for (String templateName : templates) { - Template template = engine.getTemplate("generator/front/" + templateName + ".ftl"); - String filePath = getFrontFilePath(templateName, genConfig.getApiPath(), genConfig.getPath(), genMap.get("changeClassName").toString()); - - assert filePath != null; - File file = new File(filePath); - - // 如果非覆盖生成 - if (!genConfig.getCover() && FileUtil.exist(file)) { - continue; - } - // 生成代码 - genFile(file, template, genMap); - } - } - - // 获取模版数据 - private static Map getGenMap(List columnInfos, GenConfig genConfig) { - // 存储模版字段数据 - Map genMap = new HashMap<>(16); - // 接口别名 - genMap.put("apiAlias", genConfig.getApiAlias()); - // 包名称 - genMap.put("package", genConfig.getPack()); - // 模块名称 - genMap.put("moduleName", genConfig.getModuleName()); - // 作者 - genMap.put("author", genConfig.getAuthor()); - // 创建日期 - genMap.put("date", LocalDate.now().toString()); - // 表名 - genMap.put("tableName", genConfig.getTableName()); - // 大写开头的类名 - String className = StringUtils.toCapitalizeCamelCase(genConfig.getTableName()); - // 小写开头的类名 - String changeClassName = StringUtils.toCamelCase(genConfig.getTableName()); - // 判断是否去除表前缀 - if (StringUtils.isNotEmpty(genConfig.getPrefix())) { - className = StringUtils.toCapitalizeCamelCase(StrUtil.removePrefix(genConfig.getTableName(), genConfig.getPrefix())); - changeClassName = StringUtils.toCamelCase(StrUtil.removePrefix(genConfig.getTableName(), genConfig.getPrefix())); - } - // 保存类名 - genMap.put("className", className); - // 保存小写开头的类名 - genMap.put("changeClassName", changeClassName); - // 存在 Timestamp 字段 - genMap.put("hasTimestamp", false); - // 查询类中存在 Timestamp 字段 - genMap.put("queryHasTimestamp", false); - // 存在 BigDecimal 字段 - genMap.put("hasBigDecimal", false); - // 查询类中存在 BigDecimal 字段 - genMap.put("queryHasBigDecimal", false); - // 是否需要创建查询 - genMap.put("hasQuery", false); - // 自增主键 - genMap.put("auto", false); - // 存在字典 - genMap.put("hasDict", false); - // 存在日期注解 - genMap.put("hasDateAnnotation", false); - // 保存字段信息 - List> columns = new ArrayList<>(); - // 保存查询字段的信息 - List> queryColumns = new ArrayList<>(); - // 存储字典信息 - List dicts = new ArrayList<>(); - // 存储 between 信息 - List> betweens = new ArrayList<>(); - // 存储不为空的字段信息 - List> isNotNullColumns = new ArrayList<>(); - - for (ColumnInfo column : columnInfos) { - Map listMap = new HashMap<>(16); - // 字段描述 - listMap.put("remark", column.getRemark()); - // 字段类型 - listMap.put("columnKey", column.getKeyType()); - // 主键类型 - String colType = ColUtil.cloToJava(column.getColumnType()); - // 小写开头的字段名 - String changeColumnName = StringUtils.toCamelCase(column.getColumnName()); - // 大写开头的字段名 - String capitalColumnName = StringUtils.toCapitalizeCamelCase(column.getColumnName()); - if (PK.equals(column.getKeyType())) { - // 存储主键类型 - genMap.put("pkColumnType", colType); - // 存储小写开头的字段名 - genMap.put("pkChangeColName", changeColumnName); - // 存储大写开头的字段名 - genMap.put("pkCapitalColName", capitalColumnName); - } - // 是否存在 Timestamp 类型的字段 - if (TIMESTAMP.equals(colType)) { - genMap.put("hasTimestamp", true); - } - // 是否存在 BigDecimal 类型的字段 - if (BIGDECIMAL.equals(colType)) { - genMap.put("hasBigDecimal", true); - } - // 主键是否自增 - if (EXTRA.equals(column.getExtra())) { - genMap.put("auto", true); - } - // 主键存在字典 - if (StringUtils.isNotBlank(column.getDictName())) { - genMap.put("hasDict", true); - dicts.add(column.getDictName()); - } - - // 存储字段类型 - listMap.put("columnType", colType); - // 存储字原始段名称 - listMap.put("columnName", column.getColumnName()); - // 不为空 - listMap.put("istNotNull", column.getNotNull()); - // 字段列表显示 - listMap.put("columnShow", column.getListShow()); - // 表单显示 - listMap.put("formShow", column.getFormShow()); - // 表单组件类型 - listMap.put("formType", StringUtils.isNotBlank(column.getFormType()) ? column.getFormType() : "Input"); - // 小写开头的字段名称 - listMap.put("changeColumnName", changeColumnName); - //大写开头的字段名称 - listMap.put("capitalColumnName", capitalColumnName); - // 字典名称 - listMap.put("dictName", column.getDictName()); - // 日期注解 - listMap.put("dateAnnotation", column.getDateAnnotation()); - if (StringUtils.isNotBlank(column.getDateAnnotation())) { - genMap.put("hasDateAnnotation", true); - } - // 添加非空字段信息 - if (column.getNotNull()) { - isNotNullColumns.add(listMap); - } - // 判断是否有查询,如有则把查询的字段set进columnQuery - if (!StringUtils.isBlank(column.getQueryType())) { - // 查询类型 - listMap.put("queryType", column.getQueryType()); - // 是否存在查询 - genMap.put("hasQuery", true); - if (TIMESTAMP.equals(colType)) { - // 查询中存储 Timestamp 类型 - genMap.put("queryHasTimestamp", true); - } - if (BIGDECIMAL.equals(colType)) { - // 查询中存储 BigDecimal 类型 - genMap.put("queryHasBigDecimal", true); - } - if ("between".equalsIgnoreCase(column.getQueryType())) { - betweens.add(listMap); - } else { - // 添加到查询列表中 - queryColumns.add(listMap); - } - } - // 添加到字段列表中 - columns.add(listMap); - } - // 保存字段列表 - genMap.put("columns", columns); - // 保存查询列表 - genMap.put("queryColumns", queryColumns); - // 保存字段列表 - genMap.put("dicts", dicts); - // 保存查询列表 - genMap.put("betweens", betweens); - // 保存非空字段信息 - genMap.put("isNotNullColumns", isNotNullColumns); - return genMap; - } - - /** - * 定义后端文件路径以及名称 - */ - private static String getAdminFilePath(String templateName, GenConfig genConfig, String className, String rootPath) { - String projectPath = rootPath + File.separator + genConfig.getModuleName(); - String packagePath = projectPath + File.separator + "src" + File.separator + "main" + File.separator + "java" + File.separator; - if (!ObjectUtils.isEmpty(genConfig.getPack())) { - packagePath += genConfig.getPack().replace(".", File.separator) + File.separator; - } - - if ("Entity".equals(templateName)) { - return packagePath + "domain" + File.separator + className + ".java"; - } - - if ("Controller".equals(templateName)) { - return packagePath + "rest" + File.separator + className + "Controller.java"; - } - - if ("Service".equals(templateName)) { - return packagePath + "service" + File.separator + className + "Service.java"; - } - - if ("ServiceImpl".equals(templateName)) { - return packagePath + "service" + File.separator + "impl" + File.separator + className + "ServiceImpl.java"; - } - - if ("Dto".equals(templateName)) { - return packagePath + "service" + File.separator + "dto" + File.separator + className + "Dto.java"; - } - - if ("QueryCriteria".equals(templateName)) { - return packagePath + "service" + File.separator + "dto" + File.separator + className + "QueryCriteria.java"; - } - - if ("Mapper".equals(templateName)) { - return packagePath + "service" + File.separator + "mapstruct" + File.separator + className + "Mapper.java"; - } - - if ("Repository".equals(templateName)) { - return packagePath + "repository" + File.separator + className + "Repository.java"; - } - - return null; - } - - /** - * 定义前端文件路径以及名称 - */ - private static String getFrontFilePath(String templateName, String apiPath, String path, String apiName) { - - if ("api".equals(templateName)) { - return apiPath + File.separator + apiName + ".js"; - } - - if ("index".equals(templateName)) { - return path + File.separator + "index.vue"; - } - - return null; - } - - private static void genFile(File file, Template template, Map map) throws IOException { - // 生成目标文件 - Writer writer = null; - try { - FileUtil.touch(file); - writer = new FileWriter(file); - template.render(map, writer); - } catch (TemplateException | IOException e) { - throw new RuntimeException(e); - } finally { - assert writer != null; - writer.close(); - } - } -} diff --git a/wjcy-logging/pom.xml b/wjcy-logging/pom.xml deleted file mode 100644 index 98d6734..0000000 --- a/wjcy-logging/pom.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - wjcy - me.zhengjie - 1.0 - - 4.0.0 - - wjcy-logging - 日志模块 - - - - me.zhengjie - wjcy-common - 1.0 - - - \ No newline at end of file diff --git a/wjcy-logging/src/main/java/me/zhengjie/annotation/Log.java b/wjcy-logging/src/main/java/me/zhengjie/annotation/Log.java deleted file mode 100644 index ac0a0cd..0000000 --- a/wjcy-logging/src/main/java/me/zhengjie/annotation/Log.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.annotation; - -import me.zhengjie.annotation.type.LogActionType; -import me.zhengjie.annotation.type.LogDaoType; -import me.zhengjie.annotation.type.LogGetIdType; -import me.zhengjie.annotation.type.LogGetValueType; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * @author Zheng Jie - * @date 2018-11-24 - */ -@Target(ElementType.METHOD) -@Retention(RetentionPolicy.RUNTIME) -public @interface Log { - String value() default ""; - - String[] daoNames() default {}; - - LogGetIdType[] idTypes() default {LogGetIdType.ID}; - - LogGetValueType[] valuesTypes() default {LogGetValueType.ID}; - - LogDaoType daoType() default LogDaoType.MyBATISPLUS; - - boolean trueList() default false; - - /** - * 是否启用 - * - * @return - */ - boolean enable() default true; - - LogActionType type() default LogActionType.SELECT; -} diff --git a/wjcy-logging/src/main/java/me/zhengjie/annotation/type/LogActionType.java b/wjcy-logging/src/main/java/me/zhengjie/annotation/type/LogActionType.java deleted file mode 100644 index e99d671..0000000 --- a/wjcy-logging/src/main/java/me/zhengjie/annotation/type/LogActionType.java +++ /dev/null @@ -1,34 +0,0 @@ -package me.zhengjie.annotation.type; - -/** - *

- * 日志类型 - *

- * - * @Author xx - * @Date 2021/7/22 - **/ -public enum LogActionType { - /** - * 增删改查 - */ - ADD("新增"), - SELECT("查询"), - UPDATE("更新"), - DELETE("删除"), - LOGIN("登录"), - EXPORT("导出"); - private String value; - - LogActionType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value; - } -} diff --git a/wjcy-logging/src/main/java/me/zhengjie/annotation/type/LogDaoType.java b/wjcy-logging/src/main/java/me/zhengjie/annotation/type/LogDaoType.java deleted file mode 100644 index 2c96f80..0000000 --- a/wjcy-logging/src/main/java/me/zhengjie/annotation/type/LogDaoType.java +++ /dev/null @@ -1,30 +0,0 @@ -package me.zhengjie.annotation.type; - -/** - *

- *日志使用dao类型 - *

- * - * @Author xx - * @Date 2021/7/22 - **/ -public enum LogDaoType { - /** - * 增删改查 - */ - MyBATISPLUS("myabtisPlus"), - SPRINGDATAJPA("springDataJpa"); - private String value; - - LogDaoType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value; - } -} diff --git a/wjcy-logging/src/main/java/me/zhengjie/annotation/type/LogGetIdType.java b/wjcy-logging/src/main/java/me/zhengjie/annotation/type/LogGetIdType.java deleted file mode 100644 index cb4a005..0000000 --- a/wjcy-logging/src/main/java/me/zhengjie/annotation/type/LogGetIdType.java +++ /dev/null @@ -1,36 +0,0 @@ -package me.zhengjie.annotation.type; - -/** - *

- * 日志获取修改前信息使用id类型 具体有别的在具体添加 - *

- * - * @Author xx - * @Date 2021/7/22 - **/ -public enum LogGetIdType { - - /** ID */ - ID("id"), - /** IDS */ - IDS("ids"), - /** MEMBER_ID */ - MEMBER_ID("memberId"), - /** AUTHMEMBER_ID */ - AUTHMEMBER_ID("authMemberId"), - /** ROOM_Id */ - ROOM_Id("roomId"); - private String value; - - LogGetIdType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value; - } -} diff --git a/wjcy-logging/src/main/java/me/zhengjie/annotation/type/LogGetValueType.java b/wjcy-logging/src/main/java/me/zhengjie/annotation/type/LogGetValueType.java deleted file mode 100644 index 1024cbb..0000000 --- a/wjcy-logging/src/main/java/me/zhengjie/annotation/type/LogGetValueType.java +++ /dev/null @@ -1,32 +0,0 @@ -package me.zhengjie.annotation.type; - -/** - *

- * 日志获取修改前信息使用id对应值 具体有别的在具体添加 - *

- * - * @Author xx - * @Date 2021/7/22 - **/ -public enum LogGetValueType { - - /** ID */ - ID("id"), - /** MEMBER_ID */ - MEMBER_ID("memberId"), - /** ROOM_ID */ - ROOM_ID("roomId"); - private String value; - - LogGetValueType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value; - } -} diff --git a/wjcy-logging/src/main/java/me/zhengjie/aspect/LogAspect.java b/wjcy-logging/src/main/java/me/zhengjie/aspect/LogAspect.java deleted file mode 100644 index 01bce24..0000000 --- a/wjcy-logging/src/main/java/me/zhengjie/aspect/LogAspect.java +++ /dev/null @@ -1,98 +0,0 @@ -///* -// * Copyright 2019-2020 Zheng Jie -// * -// * 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 me.zhengjie.aspect; -// -//import lombok.extern.slf4j.Slf4j; -//import me.zhengjie.domain.Log; -//import me.zhengjie.service.LogService; -//import me.zhengjie.utils.RequestHolder; -//import me.zhengjie.utils.SecurityUtils; -//import me.zhengjie.utils.StringUtils; -//import me.zhengjie.utils.ThrowableUtil; -//import org.aspectj.lang.JoinPoint; -//import org.aspectj.lang.ProceedingJoinPoint; -//import org.aspectj.lang.annotation.AfterThrowing; -//import org.aspectj.lang.annotation.Around; -//import org.aspectj.lang.annotation.Aspect; -//import org.aspectj.lang.annotation.Pointcut; -//import org.springframework.stereotype.Component; -//import javax.servlet.http.HttpServletRequest; -// -///** -// * @author Zheng Jie -// * @date 2018-11-24 -// */ -//@Component -//@Aspect -//@Slf4j -//public class LogAspect { -// -// private final LogService logService; -// -// ThreadLocal currentTime = new ThreadLocal<>(); -// -// public LogAspect(LogService logService) { -// this.logService = logService; -// } -// -// /** -// * 配置切入点 -// */ -// @Pointcut("@annotation(me.zhengjie.annotation.Log)") -// public void logPointcut() { -// // 该方法无方法体,主要为了让同类中其他方法使用此切入点 -// } -// -// /** -// * 配置环绕通知,使用在方法logPointcut()上注册的切入点 -// * -// * @param joinPoint join point for advice -// */ -// @Around("logPointcut()") -// public Object logAround(ProceedingJoinPoint joinPoint) throws Throwable { -// Object result; -// currentTime.set(System.currentTimeMillis()); -// result = joinPoint.proceed(); -// Log log = new Log("INFO",System.currentTimeMillis() - currentTime.get()); -// currentTime.remove(); -// HttpServletRequest request = RequestHolder.getHttpServletRequest(); -// logService.save(getUsername(), StringUtils.getBrowser(request), StringUtils.getIp(request),joinPoint, log); -// return result; -// } -// -// /** -// * 配置异常通知 -// * -// * @param joinPoint join point for advice -// * @param e exception -// */ -// @AfterThrowing(pointcut = "logPointcut()", throwing = "e") -// public void logAfterThrowing(JoinPoint joinPoint, Throwable e) { -// Log log = new Log("ERROR",System.currentTimeMillis() - currentTime.get()); -// currentTime.remove(); -// log.setExceptionDetail(ThrowableUtil.getStackTrace(e).getBytes()); -// HttpServletRequest request = RequestHolder.getHttpServletRequest(); -// logService.save(getUsername(), StringUtils.getBrowser(request), StringUtils.getIp(request), (ProceedingJoinPoint)joinPoint, log); -// } -// -// public String getUsername() { -// try { -// return SecurityUtils.getCurrentUsername(); -// }catch (Exception e){ -// return ""; -// } -// } -//} diff --git a/wjcy-logging/src/main/java/me/zhengjie/domain/Log.java b/wjcy-logging/src/main/java/me/zhengjie/domain/Log.java deleted file mode 100644 index baed7df..0000000 --- a/wjcy-logging/src/main/java/me/zhengjie/domain/Log.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.domain; - -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -import org.hibernate.annotations.CreationTimestamp; -import javax.persistence.*; -import java.io.Serializable; -import java.sql.Timestamp; - - -/** - * @author Zheng Jie - * @date 2018-11-24 - */ -@Entity -@Getter -@Setter -@Table(name = "sys_log") -@NoArgsConstructor -public class Log implements Serializable { - - @Id - @Column(name = "log_id") - @GeneratedValue(strategy = GenerationType.IDENTITY) - private Long id; - - /** 操作用户 */ - private String username; - - /** 描述 */ - private String description; - - /** 方法名 */ - private String method; - - /** 参数 */ - private String params; - - /** 日志类型 */ - private String logType; - - /** 请求ip */ - private String requestIp; - - /** 地址 */ - private String address; - - /** 浏览器 */ - private String browser; - - /** 请求耗时 */ - private Long time; - - /** 异常详细 */ - private String exceptionDetail; - - /** 创建日期 */ - @CreationTimestamp - private Timestamp createTime; - - /** 用户类型 */ - private Integer type; - - /** 日志记录 */ - private String platParams; - - @Transient - private Boolean trueList; - - public Log(String logType, Long time) { - this.logType = logType; - this.time = time; - } - public Log(String logType, Long time, Integer type) { - this.logType = logType; - this.time = time; - this.type = type; - } -} diff --git a/wjcy-logging/src/main/java/me/zhengjie/enums/LogTypeEnum.java b/wjcy-logging/src/main/java/me/zhengjie/enums/LogTypeEnum.java deleted file mode 100644 index eb87f89..0000000 --- a/wjcy-logging/src/main/java/me/zhengjie/enums/LogTypeEnum.java +++ /dev/null @@ -1,33 +0,0 @@ -package me.zhengjie.enums; -/** - *

- * 日志类型 - *

- * - * @Author xx - * @Date 2021/7/22 - **/ -public enum LogTypeEnum { - /** - * 是否展示详情类型 - * 1 修改 - * 0 不展示 - * 2 新增 - */ - - NO_PLAT_PARAMS(0), - SHOW_PLAT_PARAMS(1), - SHOW_ADD_PARAMS(2), - SHOW_LOGIN_PARAMS(3); - - private final Integer value; - - private LogTypeEnum(Integer value) { - this.value = value; - } - - - public Integer value() { - return this.value; - } -} diff --git a/wjcy-logging/src/main/java/me/zhengjie/repository/LogRepository.java b/wjcy-logging/src/main/java/me/zhengjie/repository/LogRepository.java deleted file mode 100644 index 0414b3e..0000000 --- a/wjcy-logging/src/main/java/me/zhengjie/repository/LogRepository.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.repository; - -import me.zhengjie.domain.Log; -import org.springframework.data.jpa.repository.JpaRepository; -import org.springframework.data.jpa.repository.JpaSpecificationExecutor; -import org.springframework.data.jpa.repository.Modifying; -import org.springframework.data.jpa.repository.Query; -import org.springframework.stereotype.Repository; - -import java.util.List; - -/** - * @author Zheng Jie - * @date 2018-11-24 - */ -@Repository -public interface LogRepository extends JpaRepository, JpaSpecificationExecutor { - - /** - * 根据日志类型删除信息 - * @param logType 日志类型 - */ - @Modifying - @Query(value = "delete from sys_log where log_type = ?1", nativeQuery = true) - void deleteByLogType(String logType); - - /** - * 根据日志类型和显示类型删除信息 - * @param logType 日志类型 - */ - @Modifying - @Query(value = " delete from sys_log where log_type = ?1 and type in ?2",nativeQuery = true) - void deleteByLogTypeAndTypeContains(String logType, List typeList); -} diff --git a/wjcy-logging/src/main/java/me/zhengjie/rest/LogController.java b/wjcy-logging/src/main/java/me/zhengjie/rest/LogController.java deleted file mode 100644 index 23d27db..0000000 --- a/wjcy-logging/src/main/java/me/zhengjie/rest/LogController.java +++ /dev/null @@ -1,157 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.rest; - -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import lombok.RequiredArgsConstructor; -import me.zhengjie.annotation.Log; -import me.zhengjie.dto.Dto; -import me.zhengjie.enums.LogTypeEnum; -import me.zhengjie.service.LogService; -import me.zhengjie.service.dto.LogQueryCriteria; -import me.zhengjie.utils.SecurityUtils; -import org.springframework.data.domain.Pageable; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.*; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.Arrays; - -/** - * @author Zheng Jie - * @date 2018-11-24 - */ -@RestController -@RequiredArgsConstructor -@RequestMapping("/api/logs") -@Api(tags = "系统:日志管理") -public class LogController { - - private final LogService logService; - - @Log("导出操作日志数据") - @ApiOperation("导出操作日志数据") - @GetMapping(value = "/queryLog/download") - @PreAuthorize("@el.check('options:export')") - public void downloadLog(HttpServletResponse response, LogQueryCriteria criteria) throws IOException { - criteria.setLogType("INFO"); - criteria.setType(Arrays.asList(LogTypeEnum.SHOW_ADD_PARAMS.value(), LogTypeEnum.SHOW_PLAT_PARAMS.value(), LogTypeEnum.NO_PLAT_PARAMS.value())); - logService.download(logService.queryAll(criteria), response); - } - - @Log("导出登录日志数据") - @ApiOperation("导出登录日志数据") - @GetMapping(value = "/queryLogin/download") - @PreAuthorize("@el.check('login:export')") - public void downloadLogin(HttpServletResponse response, LogQueryCriteria criteria) throws IOException { - criteria.setLogType("INFO"); - criteria.setType(Arrays.asList(LogTypeEnum.SHOW_LOGIN_PARAMS.value())); - logService.download(logService.queryAll(criteria), response); - } - - @Log("导出错误数据") - @ApiOperation("导出错误数据") - @GetMapping(value = "/error/download") -// @PreAuthorize("@el.check()") - public void downloadErrorLog(HttpServletResponse response, LogQueryCriteria criteria) throws IOException { - criteria.setLogType("ERROR"); - logService.download(logService.queryAll(criteria), response); - } - - @GetMapping(value = "/queryLog") - @ApiOperation("日志查询") - @PreAuthorize("@el.check('options:list')") - public ResponseEntity queryLog(LogQueryCriteria criteria, Pageable pageable){ - criteria.setLogType("INFO"); - criteria.setType(Arrays.asList(LogTypeEnum.SHOW_ADD_PARAMS.value(), LogTypeEnum.SHOW_PLAT_PARAMS.value(), LogTypeEnum.NO_PLAT_PARAMS.value())); - return new ResponseEntity<>(logService.queryAll(criteria,pageable), HttpStatus.OK); - } - - @GetMapping(value = "/queryLogin") - @ApiOperation("日志查询") - @PreAuthorize("@el.check('login:list')") - public ResponseEntity queryLogin(LogQueryCriteria criteria, Pageable pageable){ - criteria.setLogType("INFO"); - criteria.setType(Arrays.asList(LogTypeEnum.SHOW_LOGIN_PARAMS.value())); - return new ResponseEntity<>(logService.queryAll(criteria,pageable), HttpStatus.OK); - } - - /** - * 根据id 修改前后日志变化详情 - * @param id - * @return - */ - @GetMapping(value = "/updateDetail/{id}") - @ApiOperation("日志查询") -// @PreAuthorize("@el.check()") - public Dto updateDetail(@PathVariable Long id){ - return Dto.returnResult(logService.queryUpdateDatail(id)); - } - - - - @GetMapping(value = "/user") - @ApiOperation("用户日志查询") - public ResponseEntity queryUserLog(LogQueryCriteria criteria, Pageable pageable){ - criteria.setLogType("INFO"); - criteria.setBlurry(SecurityUtils.getCurrentUsername()); - return new ResponseEntity<>(logService.queryAllByUser(criteria,pageable), HttpStatus.OK); - } - - @GetMapping(value = "/error") - @ApiOperation("错误日志查询") -// @PreAuthorize("@el.check()") - public ResponseEntity queryErrorLog(LogQueryCriteria criteria, Pageable pageable){ - criteria.setLogType("ERROR"); - return new ResponseEntity<>(logService.queryAll(criteria,pageable), HttpStatus.OK); - } - - @GetMapping(value = "/error/{id}") - @ApiOperation("日志异常详情查询") -// @PreAuthorize("@el.check()") - public ResponseEntity queryErrorLogs(@PathVariable Long id){ - return new ResponseEntity<>(logService.findByErrDetail(id), HttpStatus.OK); - } - @DeleteMapping(value = "/del/error") - @Log("删除所有ERROR日志") - @ApiOperation("删除所有ERROR日志") -// @PreAuthorize("@el.check()") - public ResponseEntity delAllErrorLog(){ - logService.delAllByError(); - return new ResponseEntity<>(HttpStatus.OK); - } - - @DeleteMapping(value = "/del/logInfo") - @Log("删除所有INFO操作日志") - @ApiOperation("删除所有INFO操作日志") - @PreAuthorize("@el.check('options:del')") - public ResponseEntity delAllLogInfo(){ - logService.deleteByLogTypeAndType("INFO", Arrays.asList(LogTypeEnum.SHOW_ADD_PARAMS.value(), LogTypeEnum.NO_PLAT_PARAMS.value(), LogTypeEnum.SHOW_PLAT_PARAMS.value())); - return new ResponseEntity<>(HttpStatus.OK); - } - - @DeleteMapping(value = "/del/loginInfo") - @Log("删除所有INFO登录日志") - @ApiOperation("删除所有INFO登录日志") - @PreAuthorize("@el.check('login:del')") - public ResponseEntity delAllLoginInfo(){ - logService.deleteByLogTypeAndType("INFO", Arrays.asList(LogTypeEnum.SHOW_LOGIN_PARAMS.value())); - return new ResponseEntity<>(HttpStatus.OK); - } -} diff --git a/wjcy-logging/src/main/java/me/zhengjie/service/LogService.java b/wjcy-logging/src/main/java/me/zhengjie/service/LogService.java deleted file mode 100644 index 0dc6497..0000000 --- a/wjcy-logging/src/main/java/me/zhengjie/service/LogService.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.service; - -import me.zhengjie.domain.Log; -import me.zhengjie.service.dto.LogQueryCriteria; -import org.aspectj.lang.ProceedingJoinPoint; -import org.springframework.data.domain.Pageable; -import org.springframework.scheduling.annotation.Async; - -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.List; - -/** - * @author Zheng Jie - * @date 2018-11-24 - */ -public interface LogService { - - /** - * 分页查询 - * @param criteria 查询条件 - * @param pageable 分页参数 - * @return / - */ - Object queryAll(LogQueryCriteria criteria, Pageable pageable); - - /** - * 查询全部数据 - * @param criteria 查询条件 - * @return / - */ - List queryAll(LogQueryCriteria criteria); - - /** - * 查询修改数据详情 - * @param id 查询条件 - * @return / - */ - Object queryUpdateDatail(Long id); - - /** - * 查询用户日志 - * @param criteria 查询条件 - * @param pageable 分页参数 - * @return - - */ - Object queryAllByUser(LogQueryCriteria criteria, Pageable pageable); - - /** - * 保存日志数据 - * @param username 用户 - * @param browser 浏览器 - * @param ip 请求IP - * @param joinPoint / - * @param log 日志实体 - */ - @Async - void save(String username, String browser, String ip, ProceedingJoinPoint joinPoint, Log log, Object beforeJson); - - /** - * 查询异常详情 - * @param id 日志ID - * @return Object - */ - Object findByErrDetail(Long id); - - /** - * 导出日志 - * @param logs 待导出的数据 - * @param response / - * @throws IOException / - */ - void download(List logs, HttpServletResponse response) throws IOException; - - /** - * 删除所有错误日志 - */ - void delAllByError(); - - /** - * 删除所有INFO日志 - */ - void delAllByInfo(); - - void deleteByLogTypeAndType(String logType, List typeList); -} diff --git a/wjcy-logging/src/main/java/me/zhengjie/service/dto/LogErrorDTO.java b/wjcy-logging/src/main/java/me/zhengjie/service/dto/LogErrorDTO.java deleted file mode 100644 index bc0d4ec..0000000 --- a/wjcy-logging/src/main/java/me/zhengjie/service/dto/LogErrorDTO.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.service.dto; - -import lombok.Data; -import java.io.Serializable; -import java.sql.Timestamp; - -/** -* @author Zheng Jie -* @date 2019-5-22 -*/ -@Data -public class LogErrorDTO implements Serializable { - - private Long id; - - private String username; - - private String description; - - private String method; - - private String params; - - private String browser; - - private String requestIp; - - private String address; - - private Timestamp createTime; -} \ No newline at end of file diff --git a/wjcy-logging/src/main/java/me/zhengjie/service/dto/LogQueryCriteria.java b/wjcy-logging/src/main/java/me/zhengjie/service/dto/LogQueryCriteria.java deleted file mode 100644 index dcc41f6..0000000 --- a/wjcy-logging/src/main/java/me/zhengjie/service/dto/LogQueryCriteria.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.service.dto; - -import lombok.Data; -import me.zhengjie.annotation.Query; -import java.sql.Timestamp; -import java.util.List; - -/** - * 日志查询类 - * @author Zheng Jie - * @date 2019-6-4 09:23:07 - */ -@Data -public class LogQueryCriteria { - - @Query(blurry = "username,description,address,requestIp,method,params") - private String blurry; - - @Query - private String logType; - - @Query(type = Query.Type.IN) - private List type; - - @Query(type = Query.Type.BETWEEN) - private List createTime; -} diff --git a/wjcy-logging/src/main/java/me/zhengjie/service/dto/LogSmallDTO.java b/wjcy-logging/src/main/java/me/zhengjie/service/dto/LogSmallDTO.java deleted file mode 100644 index d074fd1..0000000 --- a/wjcy-logging/src/main/java/me/zhengjie/service/dto/LogSmallDTO.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.service.dto; - -import lombok.Data; -import java.io.Serializable; -import java.sql.Timestamp; - -/** - * @author Zheng Jie - * @date 2019-5-22 - */ -@Data -public class LogSmallDTO implements Serializable { - - private String description; - - private String requestIp; - - private Long time; - - private String address; - - private String browser; - - private Timestamp createTime; -} diff --git a/wjcy-logging/src/main/java/me/zhengjie/service/impl/LogServiceImpl.java b/wjcy-logging/src/main/java/me/zhengjie/service/impl/LogServiceImpl.java deleted file mode 100644 index 2d449fa..0000000 --- a/wjcy-logging/src/main/java/me/zhengjie/service/impl/LogServiceImpl.java +++ /dev/null @@ -1,233 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.service.impl; - -import cn.hutool.core.lang.Dict; -import cn.hutool.core.util.ObjectUtil; -import cn.hutool.json.JSONArray; -import cn.hutool.json.JSONObject; -import cn.hutool.json.JSONUtil; -import lombok.RequiredArgsConstructor; -import me.zhengjie.domain.Log; -import me.zhengjie.enums.LogTypeEnum; -import me.zhengjie.repository.LogRepository; -import me.zhengjie.service.LogService; -import me.zhengjie.service.dto.LogQueryCriteria; -import me.zhengjie.service.mapstruct.LogErrorMapper; -import me.zhengjie.service.mapstruct.LogSmallMapper; -import me.zhengjie.utils.*; -import org.aspectj.lang.ProceedingJoinPoint; -import org.aspectj.lang.reflect.MethodSignature; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.data.domain.Page; -import org.springframework.data.domain.Pageable; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestParam; - -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.lang.reflect.Method; -import java.lang.reflect.Parameter; -import java.util.*; - -/** - * @author Zheng Jie - * @date 2018-11-24 - */ -@Service -@RequiredArgsConstructor -public class LogServiceImpl implements LogService { - private static final Logger log = LoggerFactory.getLogger(LogServiceImpl.class); - private final LogRepository logRepository; - private final LogErrorMapper logErrorMapper; - private final LogSmallMapper logSmallMapper; - - - @Override - public Object queryAll(LogQueryCriteria criteria, Pageable pageable) { - Page page = logRepository.findAll(((root, criteriaQuery, cb) -> QueryHelp.getPredicate(root, criteria, cb)), pageable); - String status = "ERROR"; - if (status.equals(criteria.getLogType())) { - return PageUtil.toPage(page.map(logErrorMapper::toDto)); - } - return page; - } - - @Override - public List queryAll(LogQueryCriteria criteria) { - return logRepository.findAll(((root, criteriaQuery, cb) -> QueryHelp.getPredicate(root, criteria, cb))); - } - - @Override - public Object queryUpdateDatail(Long id) { - Log log = logRepository.findById(id).orElseGet(Log::new); - ValidationUtil.isNull(log.getId(), "Log", "id", id); - String details = log.getPlatParams(); - return Dict.create().set("platParams", new String(ObjectUtil.isNotNull(details) ? details : "")); - } - - @Override - public Object queryAllByUser(LogQueryCriteria criteria, Pageable pageable) { - Page page = logRepository.findAll(((root, criteriaQuery, cb) -> QueryHelp.getPredicate(root, criteria, cb)), pageable); - return PageUtil.toPage(page.map(logSmallMapper::toDto)); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void save(String username, String browser, String ip, ProceedingJoinPoint joinPoint, Log log, Object beforeJson) { - - MethodSignature signature = (MethodSignature) joinPoint.getSignature(); - Method method = signature.getMethod(); - me.zhengjie.annotation.Log aopLog = method.getAnnotation(me.zhengjie.annotation.Log.class); - - // 方法路径 - String methodName = joinPoint.getTarget().getClass().getName() + "." + signature.getName() + "()"; - - //参数值 - List argValues = new ArrayList<>(Arrays.asList(joinPoint.getArgs())); - - // 修改前的数据整理,仅仅只存储变化的数据即可 - StringBuilder params = new StringBuilder("[ "); - JSONArray jsonArray = new JSONArray(); - boolean showBoolean = false; - if (ObjectUtil.isNotEmpty(beforeJson) && LogTypeEnum.SHOW_PLAT_PARAMS.value().equals(log.getType())) { - jsonArray.add(jsonUnion(argValues.get(0), beforeJson)); - } - - if (LogTypeEnum.SHOW_PLAT_PARAMS.value().equals(log.getType()) || LogTypeEnum.SHOW_ADD_PARAMS.value().equals(log.getType())) { - showBoolean = true; - } - - //参数名称 - for (Object argValue : argValues) { - if (ObjectUtil.isNotEmpty(argValue)) { - params.append(EmptyAttributeFiler.emptyAttributeFilerToString(argValue)).append(" "); - if (showBoolean) { - if (log.getTrueList()) { - jsonArray = new JSONArray(argValue); - } else { - JSONObject tempBefJsonObj = new JSONObject(argValue); - jsonArray.add(tempBefJsonObj); - } - } - } - } - - // 描述 - if (log != null && ObjectUtil.isEmpty(log.getDescription())) { - log.setDescription(aopLog.value()); - } - assert log != null; - log.setRequestIp(ip); - - String loginPath = "login"; - if (loginPath.equals(signature.getName())) { - try { - username = new JSONObject(argValues.get(0)).get("username").toString(); - } catch (Exception e) { - LogServiceImpl.log.error(e.getMessage(), e); - } - } - -// log.setAddress(IpUtils.getIpAddr()); - log.setMethod(methodName); - log.setUsername(username); - log.setParams(params.toString() + " ]"); - if (showBoolean) { - log.setPlatParams(jsonArray.toString()); - } - log.setBrowser(browser); - logRepository.save(log); - } - - /** - * 赋值资源 - * 根据source中的key除吊target中多余的数据。 - * 使target数据结构保持和source一致 - * @param source - * @param target - * @return - */ - public JSONObject jsonUnion(Object source, Object target) { - - JSONObject targetObj = new JSONObject(target); - JSONObject sourceObj = new JSONObject(source); - - - Map objMap = new LinkedHashMap<>(); - - if (ObjectUtil.isNotEmpty(sourceObj)) { - for (Map.Entry sourceEntry: sourceObj.entrySet()) { - String key = sourceEntry.getKey(); - Object value = sourceEntry.getValue(); - - // 判断是否存在key - if (targetObj.containsKey(key)) { - objMap.put(key, targetObj.get(key)); - } - } - } - - return new JSONObject(objMap); - } - - @Override - public Object findByErrDetail(Long id) { - Log log = logRepository.findById(id).orElseGet(Log::new); - ValidationUtil.isNull(log.getId(), "Log", "id", id); - String details = log.getExceptionDetail(); - return Dict.create().set("exception", new String(ObjectUtil.isNotNull(details) ? details : "")); - } - - @Override - public void download(List logs, HttpServletResponse response) throws IOException { - List> list = new ArrayList<>(); - for (Log log : logs) { - Map map = new LinkedHashMap<>(); - map.put("用户名", log.getUsername()); - map.put("IP", log.getRequestIp()); - map.put("IP来源", log.getAddress()); - map.put("描述", log.getDescription()); - map.put("浏览器", log.getBrowser()); - map.put("请求耗时/毫秒", log.getTime()); - map.put("异常详情", new String(ObjectUtil.isNotNull(log.getExceptionDetail()) ? log.getExceptionDetail() : "")); - map.put("创建日期", log.getCreateTime()); - list.add(map); - } - FileUtil.downloadExcel(list, response); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void delAllByError() { - logRepository.deleteByLogType("ERROR"); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void delAllByInfo() { - logRepository.deleteByLogType("INFO"); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void deleteByLogTypeAndType(String logType, List typeList) { - logRepository.deleteByLogTypeAndTypeContains(logType, typeList); - } -} diff --git a/wjcy-logging/src/main/java/me/zhengjie/service/mapstruct/LogErrorMapper.java b/wjcy-logging/src/main/java/me/zhengjie/service/mapstruct/LogErrorMapper.java deleted file mode 100644 index 3ae02c9..0000000 --- a/wjcy-logging/src/main/java/me/zhengjie/service/mapstruct/LogErrorMapper.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.service.mapstruct; - -import me.zhengjie.base.BaseMapper; -import me.zhengjie.domain.Log; -import me.zhengjie.service.dto.LogErrorDTO; -import org.mapstruct.Mapper; -import org.mapstruct.ReportingPolicy; - -/** - * @author Zheng Jie - * @date 2019-5-22 - */ -@Mapper(componentModel = "spring",unmappedTargetPolicy = ReportingPolicy.IGNORE) -public interface LogErrorMapper extends BaseMapper { - -} \ No newline at end of file diff --git a/wjcy-logging/src/main/java/me/zhengjie/service/mapstruct/LogSmallMapper.java b/wjcy-logging/src/main/java/me/zhengjie/service/mapstruct/LogSmallMapper.java deleted file mode 100644 index 9f2972a..0000000 --- a/wjcy-logging/src/main/java/me/zhengjie/service/mapstruct/LogSmallMapper.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.service.mapstruct; - -import me.zhengjie.base.BaseMapper; -import me.zhengjie.domain.Log; -import me.zhengjie.service.dto.LogSmallDTO; -import org.mapstruct.Mapper; -import org.mapstruct.ReportingPolicy; - -/** - * @author Zheng Jie - * @date 2019-5-22 - */ -@Mapper(componentModel = "spring",unmappedTargetPolicy = ReportingPolicy.IGNORE) -public interface LogSmallMapper extends BaseMapper { - -} \ No newline at end of file diff --git a/wjcy-system/pom.xml b/wjcy-system/pom.xml deleted file mode 100644 index 0998697..0000000 --- a/wjcy-system/pom.xml +++ /dev/null @@ -1,128 +0,0 @@ - - - - wjcy - me.zhengjie - 1.0 - - 4.0.0 - jar - wjcy-system - 核心模块 - - - 0.11.1 - - 5.8.0 - - - - - - me.zhengjie - wjcy-generator - 1.0 - - - me.zhengjie - wjcy-common - - - - - - - me.zhengjie - wjcy-tools - 1.0 - - - - - org.springframework.boot - spring-boot-starter-websocket - - - - - io.jsonwebtoken - jjwt-api - ${jjwt.version} - - - io.jsonwebtoken - jjwt-impl - ${jjwt.version} - - - io.jsonwebtoken - jjwt-jackson - ${jjwt.version} - - - - - ch.ethz.ganymed - ganymed-ssh2 - build210 - - - com.jcraft - jsch - 0.1.55 - - - - - com.github.oshi - oshi-core - 5.7.1 - - - - - org.quartz-scheduler - quartz - - - - - org.apache.rocketmq - rocketmq-client - 4.4.0 - - - - - - - - src/main/resources - - **/*.* - - - **/*.db - - true - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - org.apache.maven.plugins - maven-surefire-plugin - - true - - - - - diff --git a/wjcy-system/src/main/java/me/zhengjie/AppRun.java b/wjcy-system/src/main/java/me/zhengjie/AppRun.java deleted file mode 100644 index ed24406..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/AppRun.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie; - -import io.swagger.annotations.Api; -import me.zhengjie.annotation.rest.AnonymousGetMapping; -import me.zhengjie.utils.SpringContextHolder; -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory; -import org.springframework.boot.web.servlet.server.ServletWebServerFactory; -import org.springframework.context.annotation.Bean; -import org.springframework.data.jpa.repository.config.EnableJpaAuditing; -import org.springframework.scheduling.annotation.EnableAsync; -import org.springframework.transaction.annotation.EnableTransactionManagement; -import org.springframework.web.bind.annotation.RestController; - -/** - * 开启审计功能 -> @EnableJpaAuditing - * - * @author Zheng Jie - * @date 2018/11/15 9:20:19 - */ -@EnableAsync -@RestController -@Api(hidden = true) -@SpringBootApplication -@EnableTransactionManagement -@EnableJpaAuditing(auditorAwareRef = "auditorAware") -public class AppRun { - - public static void main(String[] args) { - SpringApplication.run(AppRun.class, args); - } - - @Bean - public SpringContextHolder springContextHolder() { - return new SpringContextHolder(); - } - - @Bean - public ServletWebServerFactory webServerFactory() { - TomcatServletWebServerFactory fa = new TomcatServletWebServerFactory(); - fa.addConnectorCustomizers(connector -> connector.setProperty("relaxedQueryChars", "[]{}")); - return fa; - } - - /** - * 访问首页提示 - * - * @return / - */ - @AnonymousGetMapping("/") - public String index() { - return "Backend service started successfully"; - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/aspect/FormSubmissionAspect.java b/wjcy-system/src/main/java/me/zhengjie/aspect/FormSubmissionAspect.java deleted file mode 100644 index e1cfec0..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/aspect/FormSubmissionAspect.java +++ /dev/null @@ -1,93 +0,0 @@ -package me.zhengjie.aspect; - -import cn.hutool.core.util.ObjectUtil; -import lombok.extern.slf4j.Slf4j; -import me.zhengjie.annotation.FormSubmission; -import me.zhengjie.dto.Dto; -import me.zhengjie.modules.security.config.bean.SecurityProperties; -import me.zhengjie.utils.RedisUtils; -import me.zhengjie.utils.RequestHolder; -import org.aspectj.lang.JoinPoint; -import org.aspectj.lang.ProceedingJoinPoint; -import org.aspectj.lang.annotation.AfterThrowing; -import org.aspectj.lang.annotation.Around; -import org.aspectj.lang.annotation.Aspect; -import org.aspectj.lang.annotation.Pointcut; -import org.aspectj.lang.reflect.MethodSignature; -import org.springframework.stereotype.Component; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.lang.reflect.Method; -import java.util.HashMap; -import java.util.Map; - -import static me.zhengjie.config.constant.Constants.FORM_SUB_TOKEN; -import static me.zhengjie.error.ErrorCodeEnum.FORM_SUBMISSION_REPETITION_ERROR; - -/** - *

- * 表单提交 切面 - *

- * - * @author: rch - * @since: 2022-08-30 - */ -@Component -@Aspect -@Slf4j -public class FormSubmissionAspect { - @Resource - private RedisUtils redisUtils; - @Resource - private SecurityProperties securityProperties; - - /** - * 配置切入点 - */ - @Pointcut("@annotation(me.zhengjie.annotation.FormSubmission)") - public void formSubMissionAspectPointcut() { - } - - /** 配置环绕通知,formSubMissionAspectPointcut()上注册的切入点 */ - @Around("formSubMissionAspectPointcut()") - public Object formSubMissionAspectAround(ProceedingJoinPoint joinPoint) throws Throwable { - MethodSignature signature = (MethodSignature) joinPoint.getSignature(); - Method signatureMethod = signature.getMethod(); - FormSubmission formSubMission = signatureMethod.getAnnotation(FormSubmission.class); - HttpServletRequest request = RequestHolder.getHttpServletRequest(); - String uri = request.getRequestURI(); - String token = request.getHeader(securityProperties.getHeader()); -// Object[] args = joinPoint.getArgs(); // 参数值 - if (formSubMission.isOpen() && ObjectUtil.isNotEmpty(token)) { - -// String key = FORM_SUB_TOKEN + uri + args.toString(); - String key = FORM_SUB_TOKEN + uri; - Long count = redisUtils.incrAndExpire(key, formSubMission.second()); - /** 设置成功count=1 */ - if (count == null || count > 1) { - return Dto.getInstance(FORM_SUBMISSION_REPETITION_ERROR); - } - } - return joinPoint.proceed(); - } - - /** 配置异常通知 */ - @AfterThrowing(pointcut = "formSubMissionAspectPointcut()", throwing = "e") - public void formSubMissionAspectAfterThrowing(JoinPoint joinPoint, Exception e) { - HttpServletRequest request = RequestHolder.getHttpServletRequest(); - String uri = request.getRequestURI(); - // 接口请求的参数 - Object[] args = joinPoint.getArgs(); - // 记录报错信息 - log.error("表单重复提交验证报错,请求的接口地址:{},请求参数:{}",uri,args); - } - - - private Map transitionToMap(Object object) { - if (ObjectUtil.isNotNull(object) && object instanceof Map){ - return (Map) object; - } - return new HashMap(16); - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/config/ConfigurerAdapter.java b/wjcy-system/src/main/java/me/zhengjie/config/ConfigurerAdapter.java deleted file mode 100644 index e76512b..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/config/ConfigurerAdapter.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.config; - -import com.alibaba.fastjson.serializer.SerializerFeature; -import com.alibaba.fastjson.support.config.FastJsonConfig; -import com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.http.MediaType; -import org.springframework.http.converter.HttpMessageConverter; -import org.springframework.web.cors.CorsConfiguration; -import org.springframework.web.cors.UrlBasedCorsConfigurationSource; -import org.springframework.web.filter.CorsFilter; -import org.springframework.web.servlet.config.annotation.EnableWebMvc; -import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; -import java.nio.charset.StandardCharsets; -import java.util.ArrayList; -import java.util.List; - -/** - * WebMvcConfigurer - * - * @author Zheng Jie - * @date 2018-11-30 - */ -@Configuration -@EnableWebMvc -public class ConfigurerAdapter implements WebMvcConfigurer { - - /** 文件配置 */ - private final FileProperties properties; - - public ConfigurerAdapter(FileProperties properties) { - this.properties = properties; - } - - @Bean - public CorsFilter corsFilter() { - UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); - CorsConfiguration config = new CorsConfiguration(); - config.setAllowCredentials(true); - config.addAllowedOrigin("*"); - config.addAllowedHeader("*"); - config.addAllowedMethod("*"); - source.registerCorsConfiguration("/**", config); - return new CorsFilter(source); - } - - @Override - public void addResourceHandlers(ResourceHandlerRegistry registry) { - FileProperties.ElPath path = properties.getPath(); - String avatarUtl = "file:" + path.getAvatar().replace("\\","/"); - String pathUtl = "file:" + path.getPath().replace("\\","/"); - registry.addResourceHandler("/avatar/**").addResourceLocations(avatarUtl).setCachePeriod(0); - registry.addResourceHandler("/file/**").addResourceLocations(pathUtl).setCachePeriod(0); - registry.addResourceHandler("/**").addResourceLocations("classpath:/META-INF/resources/").setCachePeriod(0); - } - - @Override - public void configureMessageConverters(List> converters) { - // 使用 fastjson 序列化,会导致 @JsonIgnore 失效,可以使用 @JSONField(serialize = false) 替换 - FastJsonHttpMessageConverter converter = new FastJsonHttpMessageConverter(); - List supportMediaTypeList = new ArrayList<>(); - supportMediaTypeList.add(MediaType.APPLICATION_JSON_UTF8); - FastJsonConfig config = new FastJsonConfig(); - config.setDateFormat("yyyy-MM-dd HH:mm:ss"); - config.setSerializerFeatures(SerializerFeature.DisableCircularReferenceDetect); - converter.setFastJsonConfig(config); - converter.setSupportedMediaTypes(supportMediaTypeList); - converter.setDefaultCharset(StandardCharsets.UTF_8); - converters.add(converter); - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/config/CorsConfig.java b/wjcy-system/src/main/java/me/zhengjie/config/CorsConfig.java deleted file mode 100644 index 3cd3209..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/config/CorsConfig.java +++ /dev/null @@ -1,20 +0,0 @@ -package me.zhengjie.config; - -import org.springframework.context.annotation.Configuration; -import org.springframework.web.servlet.config.annotation.InterceptorRegistry; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; -/** - *

- * 跨域配置 - *

- * - * @Author xx - * @Date 2021/7/28 - **/ -@Configuration -public class CorsConfig implements WebMvcConfigurer { - @Override - public void addInterceptors(InterceptorRegistry registry) { - registry.addInterceptor(new CorsInterceptor()).addPathPatterns("/**"); - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/config/GoogleAuthProperties.java b/wjcy-system/src/main/java/me/zhengjie/config/GoogleAuthProperties.java deleted file mode 100644 index bd5fcd0..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/config/GoogleAuthProperties.java +++ /dev/null @@ -1,58 +0,0 @@ -package me.zhengjie.config; - -import org.springframework.beans.factory.annotation.Value; -import org.springframework.context.annotation.Configuration; -import org.springframework.stereotype.Component; - -/** - * Google Auth Properties - * @author rch - * @date 2020-08-25 - */ -@Component -@Configuration -public class GoogleAuthProperties { - - public static int SECRET_SIZE; - - public static String SEED; - - public static String RANDOM_NUMBER_ALGORITHM; - - public static String REDIS_GOOGLE_AUTH_KEY; - - public static String QR_CREATE_PREFIX_URL; - - /** default 3 - max 17 (from google docs)最多可偏移的时间*/ - public static int WINDOW_SIZE; - - @Value("${auth.secret_size}") - public void setSecretSize(int secretSize) { - SECRET_SIZE = secretSize; - } - - @Value("${auth.seed}") - public void setSEED(String SEED) { - GoogleAuthProperties.SEED = SEED; - } - - @Value("${auth.random_number_algorithm}") - public void setRandomNumberAlgorithm(String randomNumberAlgorithm) { - RANDOM_NUMBER_ALGORITHM = randomNumberAlgorithm; - } - - @Value("${auth.window_size}") - public void setWindowSize(int window_size) { - GoogleAuthProperties.WINDOW_SIZE = window_size; - } - - @Value("${auth.redis_google_auth_key}") - public void setRedisGoogleAuthKey(String redisGoogleAuthKey) { - REDIS_GOOGLE_AUTH_KEY = redisGoogleAuthKey; - } - - @Value("${auth.qr_create_prefix_url}") - public void setQrCreatePrefixUrl(String qrCreatePrefixUrl) { - QR_CREATE_PREFIX_URL = qrCreatePrefixUrl; - } -} \ No newline at end of file diff --git a/wjcy-system/src/main/java/me/zhengjie/config/WebSocketConfig.java b/wjcy-system/src/main/java/me/zhengjie/config/WebSocketConfig.java deleted file mode 100644 index f55f5c6..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/config/WebSocketConfig.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.config; - -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.web.socket.server.standard.ServerEndpointExporter; - -/** - * @author ZhangHouYing - * @date 2019-08-24 15:44 - */ -@Configuration -public class WebSocketConfig { - - @Bean - public ServerEndpointExporter serverEndpointExporter() { - return new ServerEndpointExporter(); - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/config/thread/AsyncTaskExecutePool.java b/wjcy-system/src/main/java/me/zhengjie/config/thread/AsyncTaskExecutePool.java deleted file mode 100644 index 8df107e..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/config/thread/AsyncTaskExecutePool.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.config.thread; - -import lombok.extern.slf4j.Slf4j; -import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler; -import org.springframework.context.annotation.Configuration; -import org.springframework.scheduling.annotation.AsyncConfigurer; -import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; -import java.util.concurrent.Executor; -import java.util.concurrent.ThreadPoolExecutor; - -/** - * 异步任务线程池装配类 - * @author https://juejin.im/entry/5abb8f6951882555677e9da2 - * @date 2019年10月31日15:06:18 - */ -@Slf4j -@Configuration -public class AsyncTaskExecutePool implements AsyncConfigurer { - - /** 注入配置类 */ - private final AsyncTaskProperties config; - - public AsyncTaskExecutePool(AsyncTaskProperties config) { - this.config = config; - } - - @Override - public Executor getAsyncExecutor() { - ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); - //核心线程池大小 - executor.setCorePoolSize(config.getCorePoolSize()); - //最大线程数 - executor.setMaxPoolSize(config.getMaxPoolSize()); - //队列容量 - executor.setQueueCapacity(config.getQueueCapacity()); - //活跃时间 - executor.setKeepAliveSeconds(config.getKeepAliveSeconds()); - //线程名字前缀 - executor.setThreadNamePrefix("el-async-"); - // setRejectedExecutionHandler:当pool已经达到max size的时候,如何处理新任务 - // CallerRunsPolicy:不在新线程中执行任务,而是由调用者所在的线程来执行 - executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy()); - executor.initialize(); - return executor; - } - - @Override - public AsyncUncaughtExceptionHandler getAsyncUncaughtExceptionHandler() { - return (throwable, method, objects) -> { - log.error("===="+throwable.getMessage()+"====", throwable); - log.error("exception method:"+method.getName()); - }; - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/config/thread/AsyncTaskProperties.java b/wjcy-system/src/main/java/me/zhengjie/config/thread/AsyncTaskProperties.java deleted file mode 100644 index 21fdfd8..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/config/thread/AsyncTaskProperties.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.config.thread; - -import lombok.Data; -import org.springframework.boot.context.properties.ConfigurationProperties; -import org.springframework.stereotype.Component; - -/** - * 线程池配置属性类 - * @author https://juejin.im/entry/5abb8f6951882555677e9da2 - * @date 2019年10月31日14:58:18 - */ -@Data -@Component -@ConfigurationProperties(prefix = "task.pool") -public class AsyncTaskProperties { - - private int corePoolSize; - - private int maxPoolSize; - - private int keepAliveSeconds; - - private int queueCapacity; -} diff --git a/wjcy-system/src/main/java/me/zhengjie/config/thread/TheadFactoryName.java b/wjcy-system/src/main/java/me/zhengjie/config/thread/TheadFactoryName.java deleted file mode 100644 index 4cc8ae9..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/config/thread/TheadFactoryName.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.config.thread; - -import org.springframework.stereotype.Component; - -import java.util.concurrent.ThreadFactory; -import java.util.concurrent.atomic.AtomicInteger; - -/** - * 自定义线程名称 - * @author Zheng Jie - * @date 2019年10月31日17:49:55 - */ -@Component -public class TheadFactoryName implements ThreadFactory { - - private static final AtomicInteger POOL_NUMBER = new AtomicInteger(1); - private final ThreadGroup group; - private final AtomicInteger threadNumber = new AtomicInteger(1); - private final String namePrefix; - - public TheadFactoryName() { - this("el-pool"); - } - - private TheadFactoryName(String name){ - SecurityManager s = System.getSecurityManager(); - group = (s != null) ? s.getThreadGroup() : - Thread.currentThread().getThreadGroup(); - //此时namePrefix就是 name + 第几个用这个工厂创建线程池的 - this.namePrefix = name + - POOL_NUMBER.getAndIncrement(); - } - - @Override - public Thread newThread(Runnable r) { - //此时线程的名字 就是 namePrefix + -thread- + 这个线程池中第几个执行的线程 - Thread t = new Thread(group, r, - namePrefix + "-thread-"+threadNumber.getAndIncrement(), - 0); - if (t.isDaemon()) { - t.setDaemon(false); - } - if (t.getPriority() != Thread.NORM_PRIORITY) { - t.setPriority(Thread.NORM_PRIORITY); - } - return t; - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/config/thread/ThreadPoolExecutorUtil.java b/wjcy-system/src/main/java/me/zhengjie/config/thread/ThreadPoolExecutorUtil.java deleted file mode 100644 index 9a36abd..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/config/thread/ThreadPoolExecutorUtil.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.config.thread; - -import me.zhengjie.utils.SpringContextHolder; - -import java.util.concurrent.ArrayBlockingQueue; -import java.util.concurrent.ThreadPoolExecutor; -import java.util.concurrent.TimeUnit; - -/** - * 用于获取自定义线程池 - * @author Zheng Jie - * @date 2019年10月31日18:16:47 - */ -public class ThreadPoolExecutorUtil { - - public static ThreadPoolExecutor getPoll(){ - AsyncTaskProperties properties = SpringContextHolder.getBean(AsyncTaskProperties.class); - return new ThreadPoolExecutor( - properties.getCorePoolSize(), - properties.getMaxPoolSize(), - properties.getKeepAliveSeconds(), - TimeUnit.SECONDS, - new ArrayBlockingQueue<>(properties.getQueueCapacity()), - new TheadFactoryName() - ); - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/aspect/LogAspect.java b/wjcy-system/src/main/java/me/zhengjie/modules/aspect/LogAspect.java deleted file mode 100644 index 5618c65..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/aspect/LogAspect.java +++ /dev/null @@ -1,154 +0,0 @@ -package me.zhengjie.modules.aspect; - - -import cn.hutool.core.collection.ListUtil; -import cn.hutool.core.util.ObjectUtil; -import com.alibaba.fastjson.JSONObject; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import lombok.extern.slf4j.Slf4j; -import me.zhengjie.annotation.type.LogActionType; -import me.zhengjie.annotation.type.LogDaoType; -import me.zhengjie.annotation.type.LogGetIdType; -import me.zhengjie.config.BeanFactory; -import me.zhengjie.domain.Log; -import me.zhengjie.dto.Dto; -import me.zhengjie.enums.LogTypeEnum; -import me.zhengjie.service.LogService; -import me.zhengjie.utils.*; -import org.aspectj.lang.JoinPoint; -import org.aspectj.lang.ProceedingJoinPoint; -import org.aspectj.lang.annotation.AfterThrowing; -import org.aspectj.lang.annotation.Around; -import org.aspectj.lang.annotation.Aspect; -import org.aspectj.lang.annotation.Pointcut; -import org.aspectj.lang.reflect.MethodSignature; -import org.springframework.stereotype.Component; - -import javax.servlet.http.HttpServletRequest; -import java.lang.reflect.Method; -import java.util.HashMap; -import java.util.Map; - -/** - * @author rch - * @date 2020-08-20 - */ -@Component -@Aspect -@Slf4j -public class LogAspect { - - private final LogService logService; - - ThreadLocal currentTime = new ThreadLocal<>(); - - public LogAspect(LogService logService) { - this.logService = logService; - } - - /** - * 配置切入点 - */ - @Pointcut("@annotation(me.zhengjie.annotation.Log)") - public void logPointcut() { - // 该方法无方法体,主要为了让同类中其他方法使用此切入点 - } - - /** - * 配置环绕通知,使用在方法logPointcut()上注册的切入点 - * - * @param joinPoint join point for advice - */ - @Around("logPointcut()") - public Object logAround(ProceedingJoinPoint joinPoint) throws Throwable { - Object result; - currentTime.set(System.currentTimeMillis()); - - // 判断是否是修改 如果是修改则获取修改前的信息 - // 如果是修改时间记录json数组,第一个为修改前的json 第二个为修改后的json数据 - MethodSignature signature = (MethodSignature) joinPoint.getSignature(); - Method method = signature.getMethod(); - me.zhengjie.annotation.Log aopLog = method.getAnnotation(me.zhengjie.annotation.Log.class); - //修改之前的数据 - JSONObject beforeJson = new JSONObject(); - Integer type = LogTypeEnum.NO_PLAT_PARAMS.value(); - if (LogActionType.UPDATE.equals(aopLog.type()) && ObjectUtil.isNotEmpty(aopLog.daoNames())) { - - //参数值 获取ID - JSONObject afterJson = JSONObject.parseObject(JSONObject.toJSONString(joinPoint.getArgs()[0])); - String[] daoNames = aopLog.daoNames(); - - // mybatis Plus Dao - if (LogDaoType.MyBATISPLUS.equals(aopLog.daoType())) { - type = LogTypeEnum.SHOW_PLAT_PARAMS.value(); - for (int i = 0; i < daoNames.length; i++) { - String daoName = daoNames[i]; - String idKey = aopLog.idTypes()[i].getValue(); - String valueKey = aopLog.valuesTypes()[i].getValue(); - Map queryMap = new HashMap<>(16); - queryMap.put(StringUtil.underscoreName(idKey), Long.valueOf(afterJson.getString(valueKey))); - Object beforeObj = BeanFactory.getBean(daoName, BaseMapper.class).selectByMap(queryMap).get(0); - cn.hutool.json.JSONObject tempBefJsonObj = new cn.hutool.json.JSONObject(beforeObj); - beforeJson.putAll(tempBefJsonObj); - } - } - // springBoot Data Jpa -因为springBoot Data JPa 该种类型 数据库结果映射对象不是json类型。暂定不支持先不修改不管 - if (LogDaoType.SPRINGDATAJPA.equals(aopLog.daoType())) { - // 逻辑大体同上 - } - } - - // 新增 - if (LogActionType.ADD.equals(aopLog.type())) { - type = LogTypeEnum.SHOW_ADD_PARAMS.value(); - } - - // 登录 - if (LogActionType.LOGIN.equals(aopLog.type())) { - type = LogTypeEnum.SHOW_LOGIN_PARAMS.value(); - } - - result = joinPoint.proceed(); - Log log = new Log("INFO", System.currentTimeMillis() - currentTime.get(), type); - log.setTrueList(aopLog.trueList()); - if (LogActionType.LOGIN.equals(aopLog.type())) { - // 记录失败原因 - if (ObjectUtil.isNotNull(result) && result instanceof Dto) { - log.setDescription(((Dto) result).getMessage()); - } - } - currentTime.remove(); - HttpServletRequest request = RequestHolder.getHttpServletRequest(); - logService.save(getUsername(), StringUtils.getBrowser(request), StringUtils.getIp(request), joinPoint, log, beforeJson); - return result; - } - - /** - * 配置异常通知 - * - * @param joinPoint join point for advice - * @param e exception - */ - @AfterThrowing(pointcut = "logPointcut()", throwing = "e") - public void logAfterThrowing(JoinPoint joinPoint, Throwable e) { - System.out.println("---------"); - System.out.println(e); - System.out.println(joinPoint); - long now = System.currentTimeMillis(); - long time = now - currentTime.get(); - Integer value = LogTypeEnum.NO_PLAT_PARAMS.value(); - Log log = new Log("ERROR", time, value); - currentTime.remove(); - log.setExceptionDetail(ThrowableUtil.getStackTrace(e)); - HttpServletRequest request = RequestHolder.getHttpServletRequest(); - logService.save(getUsername(), StringUtils.getBrowser(request), StringUtils.getIp(request), (ProceedingJoinPoint) joinPoint, log, null); - } - - public String getUsername() { - try { - return SecurityUtils.getCurrentUsername(); - } catch (Exception e) { - return ""; - } - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/capital/controller/FileUploadController.java b/wjcy-system/src/main/java/me/zhengjie/modules/capital/controller/FileUploadController.java deleted file mode 100644 index 5a197d6..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/capital/controller/FileUploadController.java +++ /dev/null @@ -1,51 +0,0 @@ -package me.zhengjie.modules.capital.controller; - -import lombok.extern.slf4j.Slf4j; -import me.zhengjie.annotation.Log; -import me.zhengjie.config.SystemConfig; -import me.zhengjie.dto.Dto; -import me.zhengjie.service.FileUploadService; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RestController; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.List; - -/** - *

- * 图片上传 - *

- * - * @author: rch - * @since: 2022-06-22 - */ -@Slf4j -@RestController -public class FileUploadController { - - @Resource - private FileUploadService fileUploadService; - - /** - * 后台管理图片上传 - */ - @Log("图片上传") - @PostMapping("/api/file/uploadFile") - public Dto apiUpload(HttpServletResponse response, HttpServletRequest request) throws IOException { - List filePaths = fileUploadService.uploadify(request, response); - return Dto.returnResult(null).setData("list", filePaths); - } - - /** - * 获取图片域名 - */ - @Log("图片上传") - @GetMapping("/api/file/doMainName") - public Dto doMainName() throws IOException { - return Dto.returnResult(SystemConfig.FILE_VISIT_ADDR); - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/capital/controller/GoogleAuthController.java b/wjcy-system/src/main/java/me/zhengjie/modules/capital/controller/GoogleAuthController.java deleted file mode 100644 index 963532a..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/capital/controller/GoogleAuthController.java +++ /dev/null @@ -1,144 +0,0 @@ -package me.zhengjie.modules.capital.controller; - -import cn.hutool.core.util.ObjectUtil; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import lombok.RequiredArgsConstructor; -import me.zhengjie.annotation.AnonymousAccess; -import me.zhengjie.annotation.Log; -import me.zhengjie.annotation.type.LogActionType; -import me.zhengjie.dto.Dto; -import me.zhengjie.entity.CtSettingSite; -import me.zhengjie.error.ErrorCodeEnum; -import me.zhengjie.modules.system.service.UserService; -import me.zhengjie.modules.system.service.dto.GoogleAuthQrBarCodeUrlDTO; -import me.zhengjie.modules.system.service.dto.UpdateGoogleAuthDTO; -import me.zhengjie.modules.utils.GoogleAuthenticatorUtil; -import me.zhengjie.service.SettingSiteService; -import me.zhengjie.service.vo.AdminGoogleAuthInfoVO; -import me.zhengjie.service.vo.GoogleAuthInfoVO; -import me.zhengjie.utils.SecurityUtils; -import org.springframework.security.core.userdetails.UserDetails; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.validation.Valid; - -/** - *

- * Google Authenticator - *

- * - * @author: rch - * @since: 2020-08-25 - */ -@Validated -@RestController -@RequiredArgsConstructor -@RequestMapping("/api/googleAuth") -public class GoogleAuthController { - - @Resource - private SettingSiteService settingSiteService; - @Resource - private UserService userService; - - private final String GoogleValue = "ConinUnion"; - -// /** -// * 验证身份验证码是否正确 -// * @param googleAuthCodeDTO -// * @return -// */ -// @Log(value = "验证身份验证码是否正确") -// @PostMapping(value = "/authcode") -// public Dto authcode(@Valid @RequestBody GoogleAuthCodeDTO googleAuthCodeDTO) { -// if (!settingSiteService.getGooleAuthSwitch()) { -// return Dto.returnResult(null); -// } -// return Dto.returnResult(GoogleAuthenticatorUtil.authcode(googleAuthCodeDTO.getCodes(), googleAuthCodeDTO.getSavedSecret())); -// } -// -// /** -// * 获取密钥 -// * @param googleAuthGenSecretDTO -// * @return -// */ -// @Log(value = "获取密钥") -// @PostMapping(value = "/genSecret") -// public Dto genSecret(@Valid @RequestBody GoogleAuthGenSecretDTO googleAuthGenSecretDTO, HttpServletRequest request) { -// if (!settingSiteService.getGooleAuthSwitch() || ObjectUtil.isEmpty(userService.findByName(googleAuthGenSecretDTO.getUserName()))) { -// return Dto.returnResult(null); -// } -// // redis 一个用户对应 一次匹配配置的SEED 对应唯一秘钥 -// return Dto.returnResult(GoogleAuthenticatorUtil.genSecret(googleAuthGenSecretDTO.getUserName(), request.getRemoteHost())); -// } - - /** - * 获取二维码图片URL - * @param googleAuthQrBarCodeUrlDTO - * @return - */ - @Log(value = "获取二维码图片URL") - @PostMapping(value = "/getQRBarcodeURL") - public Dto getQRBarcodeURL(@Valid @RequestBody GoogleAuthQrBarCodeUrlDTO googleAuthQrBarCodeUrlDTO, HttpServletRequest request) { - if (ObjectUtil.isEmpty(userService.findByName(googleAuthQrBarCodeUrlDTO.getUserName()))) { - return Dto.returnResult(null); - } - // 没有秘钥会生成一个存储在 redis中 一个用户对应 一次匹配配置的SEED 对应唯一秘钥 - GoogleAuthInfoVO googleAuthInfoVO = new GoogleAuthInfoVO(); - String secretValue = GoogleAuthenticatorUtil.genSecret(googleAuthQrBarCodeUrlDTO.getUserName(), request.getRemoteHost()); - googleAuthInfoVO.setSecret(secretValue); - googleAuthInfoVO.setUserName(googleAuthQrBarCodeUrlDTO.getUserName()); - googleAuthInfoVO.setQrBarCodeUrl(GoogleAuthenticatorUtil.getQRBarcodeURL(googleAuthQrBarCodeUrlDTO.getUserName(), GoogleValue, secretValue)); - return Dto.returnResult(googleAuthInfoVO); - } - - /** - * 判断GoogleAuth 是否开启 - * @return - */ - @Log(value = "判断GoogleAuth 是否开启") - @PostMapping(value = "/getOpenUse") - public Dto getOpenUse(HttpServletRequest request) { - - // 获取admin 信息 - AdminGoogleAuthInfoVO adminGoogleAuthInfoVO = new AdminGoogleAuthInfoVO(); - UserDetails userDetails = SecurityUtils.getCurrentUser(); - if (ObjectUtil.isEmpty(userDetails) || ObjectUtil.isEmpty(userDetails.getUsername())) { - return Dto.getInstance(ErrorCodeEnum.BAD_CREDENTIALS); - } - - String secretValue = GoogleAuthenticatorUtil.genSecret(userDetails.getUsername(), request.getRemoteHost()); - adminGoogleAuthInfoVO.setSecret(secretValue); - adminGoogleAuthInfoVO.setUserName(userDetails.getUsername()); - adminGoogleAuthInfoVO.setQrBarCodeUrl(GoogleAuthenticatorUtil.getQRBarcodeURL(userDetails.getUsername(), GoogleValue, secretValue)); - adminGoogleAuthInfoVO.setGogoleAuthSwitch(settingSiteService.getGooleAuthSwitch()); - - return Dto.returnResult(adminGoogleAuthInfoVO); - } - - - @Log(value = "修改Google开关", type = LogActionType.UPDATE) - @PostMapping(value = "/updateOpenUse") - public Dto updateOpenUse(@Valid @RequestBody UpdateGoogleAuthDTO updateGoogleAuthDTO) { - - Integer value = updateGoogleAuthDTO.getIsOpen(); - CtSettingSite ctSettingSite = new CtSettingSite(); - ctSettingSite.setSettingValue(String.valueOf(value)); - - QueryWrapper ctSettingSiteQuery = new QueryWrapper(); - ctSettingSiteQuery.eq("setting_key", "googleAuth"); - - return Dto.returnResult(settingSiteService.update(ctSettingSite, ctSettingSiteQuery)); - } - - - @Log(value = "获取Google开关") - @GetMapping(value = "/getGoogleSwitch") - @AnonymousAccess - public Dto getGoogleSwitch() { - - return Dto.returnResult(settingSiteService.getGooleAuthSwitch()); - }} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/capital/controller/LoginIpController.java b/wjcy-system/src/main/java/me/zhengjie/modules/capital/controller/LoginIpController.java deleted file mode 100644 index a50fe80..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/capital/controller/LoginIpController.java +++ /dev/null @@ -1,68 +0,0 @@ -package me.zhengjie.modules.capital.controller; - -import lombok.RequiredArgsConstructor; -import me.zhengjie.annotation.Log; -import me.zhengjie.annotation.type.LogActionType; -import me.zhengjie.dto.Dto; -import me.zhengjie.dto.PageDTO; -import me.zhengjie.error.ErrorCodeEnum; -import me.zhengjie.modules.capital.dto.AddLoginIpDTO; -import me.zhengjie.modules.capital.dto.EditLoginIpDTO; -import me.zhengjie.modules.capital.dto.IdDTO; -import me.zhengjie.service.LoginIpService; -import me.zhengjie.utils.PageUtils; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; - -import javax.validation.Valid; - -/* - * - * @Description ip限制 - * @Date 2022/3/21 - * @Author zeng - */ -@Validated -@RestController -@RequestMapping("/api/ip") -@RequiredArgsConstructor -public class LoginIpController { - - final LoginIpService loginIpService; - - @PostMapping("/list") - public Dto list(@RequestBody @Valid PageDTO pageDTO) { - PageUtils pageUtils = loginIpService.getList(pageDTO.getiPage()); - return Dto.returnResult(pageUtils); - } - - @Log(type = LogActionType.ADD,value = "添加ip限制") - @PostMapping("/add") - public Dto addIp(@RequestBody @Valid AddLoginIpDTO dto) { - if (!dto.pass()) { - return Dto.getInstance(ErrorCodeEnum.LOGIN_IP_FORMAT_ERROR); - } - return Dto.returnResult(loginIpService.addIp(dto.getLoginIp())); - } - - @Log(type = LogActionType.UPDATE,value = "修改ip限制") - @PostMapping("/edit") - public Dto editIp(@RequestBody @Valid EditLoginIpDTO dto){ - if (!dto.pass()) { - return Dto.getInstance(ErrorCodeEnum.LOGIN_IP_FORMAT_ERROR); - } - return Dto.returnResult(loginIpService.updateIp(dto.getLoginIp())); - } - - @PostMapping("/getById") - public Dto getIp(@Valid @RequestBody IdDTO idDTO) { - return Dto.returnResult(loginIpService.getById(idDTO.getId())); - } - - @Log(type = LogActionType.DELETE,value = "删除ip限制") - @PostMapping("/del") - public Dto delIp(@Valid @RequestBody IdDTO idDTO) { - return Dto.returnResult(loginIpService.deleteIp(idDTO.getId().intValue())); - } - -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/capital/controller/SettingSiteController.java b/wjcy-system/src/main/java/me/zhengjie/modules/capital/controller/SettingSiteController.java deleted file mode 100644 index 65d4498..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/capital/controller/SettingSiteController.java +++ /dev/null @@ -1,140 +0,0 @@ -package me.zhengjie.modules.capital.controller; - -import cn.hutool.core.bean.BeanUtil; -import cn.hutool.core.map.MapUtil; -import cn.hutool.core.util.ObjectUtil; -import cn.hutool.json.JSONObject; -import cn.hutool.json.JSONUtil; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import me.zhengjie.annotation.FormSubmission; -import me.zhengjie.annotation.Log; -import me.zhengjie.annotation.type.LogActionType; -import me.zhengjie.dto.Dto; -import me.zhengjie.entity.CtSettingSite; -import me.zhengjie.modules.capital.dto.SettingSiteDTO; -import me.zhengjie.service.SettingSiteService; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import javax.annotation.Resource; -import javax.validation.Valid; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - -/** - * 全局配置 控制类 - * - * @author rch - * @date 2020-07-29 - */ -@Validated -@RestController -@RequiredArgsConstructor -@RequestMapping("api/settingSite") -@Slf4j -public class SettingSiteController { - - @Resource - private SettingSiteService settingSiteService; - - - /** - * 获取全局配置 - * - * @return - */ - @Log("获取全局配置") - @PostMapping("/list") - public Dto list() { - List ctSettingSiteList = settingSiteService.list(); - List list = new ArrayList(); - for (CtSettingSite settingSite : ctSettingSiteList) { - Map map = BeanUtil.beanToMap(settingSite); - map.put("settingValue", getSettingValue(settingSite)); - list.add(map); - } - return Dto.returnResult(list); - } - - /** - * 配置全局配置 - * - * @param settingsiteDtoList - * @return - */ - @Log(value = "配置全局配置", type = LogActionType.ADD, trueList = true) - @PostMapping(value = "/save") - @FormSubmission - public Dto save(@Valid @RequestBody List settingsiteDtoList) { - - List updateCtSettingSiteList = new ArrayList<>(); - for (SettingSiteDTO settingSiteDTO : settingsiteDtoList) { - CtSettingSite site = new CtSettingSite(); - BeanUtil.copyProperties(settingSiteDTO, site); - - // 个别设置 可以只修改部分的内容 - switch (settingSiteDTO.getSettingKey()) { - case "shareholderCurrencySettings": { - String value = settingSiteService.getValue("shareholderCurrencySettings"); - JSONObject oldValue = JSONUtil.parseObj(value); - JSONObject updateValue = JSONUtil.parseObj(settingSiteDTO.getSettingValue()); - oldValue.putAll(updateValue); - site.setSettingValue(oldValue.toString()); - } - } - - updateCtSettingSiteList.add(site); - } - if (ObjectUtil.isEmpty(updateCtSettingSiteList)) { - return Dto.returnErrorResult(" Empty List! "); - } - - // 执行批量更新操作 - return Dto.returnResult(settingSiteService.updateBatchById(updateCtSettingSiteList)); - } - - - private Object getSettingValue(CtSettingSite settingSite) { - Object settingValue = settingSite.getSettingValue(); - switch (settingSite.getSettingKey()) { - case "currencyTemplateSettings": { - JSONObject jsonObject = JSONUtil.parseObj(settingSite.getSettingValue()); - List list = new ArrayList(); - for (String key : jsonObject.keySet()) { - JSONObject value = jsonObject.get(key, JSONObject.class); - value.putOpt("currencyName", key); - list.add(value); - } - return list; - } - case "shareholderPoolPublicSettings": { - JSONObject jsonObject = JSONUtil.parseObj(settingSite.getSettingValue()); - return jsonObject; - } - case "shareholderCurrencySettings": { - JSONObject jsonObject = JSONUtil.parseObj(settingSite.getSettingValue()); - List list = new ArrayList(); - for (String key : jsonObject.keySet()) { - Map blockChain = MapUtil.of("passType", key); - JSONObject currencys = jsonObject.get(key, JSONObject.class); - List currencyList = new ArrayList(); - for (String k : currencys.keySet()) { - JSONObject currency = currencys.get(k, JSONObject.class); - currency.putOpt("currencyName", k); - currencyList.add(currency); - } - blockChain.put("currency", currencyList); - list.add(blockChain); - } - - return list; - } - } - return settingValue; - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/capital/dto/AddLoginIpDTO.java b/wjcy-system/src/main/java/me/zhengjie/modules/capital/dto/AddLoginIpDTO.java deleted file mode 100644 index 632652f..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/capital/dto/AddLoginIpDTO.java +++ /dev/null @@ -1,50 +0,0 @@ -package me.zhengjie.modules.capital.dto; - -import cn.hutool.core.util.ObjectUtil; -import lombok.Data; -import me.zhengjie.annotation.DateTime; -import me.zhengjie.entity.LoginIp; -import me.zhengjie.utils.LoginIpUtil; - -import javax.validation.constraints.NotBlank; - -/* - * - * @Description - * @Date 2022/3/21 - * @Author zeng - */ -@Data -public class AddLoginIpDTO { - - /** 开始IP */ - @NotBlank - private String ipStart; - /** 结束IP */ - private String ipEnd; - /** 备注 */ - private String remark; - /** 有效截至时间 */ - @DateTime - private String vaildTime; - - public boolean pass() { - if (!LoginIpUtil.isIP(ipStart)) { - return false; - } - if (ObjectUtil.isNotEmpty(ipEnd) && !LoginIpUtil.isIP(ipEnd)) { - return false; - } - return true; - } - - public LoginIp getLoginIp() { - LoginIp ip = new LoginIp(); - ip.setIpStart(ipStart); - ip.setIpEnd(ipEnd); - ip.setRemark(remark); - ip.setVaildTime(vaildTime); - return ip; - } - -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/capital/dto/EditLoginIpDTO.java b/wjcy-system/src/main/java/me/zhengjie/modules/capital/dto/EditLoginIpDTO.java deleted file mode 100644 index 7a493dd..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/capital/dto/EditLoginIpDTO.java +++ /dev/null @@ -1,26 +0,0 @@ -package me.zhengjie.modules.capital.dto; - -import lombok.Data; -import me.zhengjie.entity.LoginIp; - -import javax.validation.constraints.NotNull; - -/* - * - * @Description - * @Date 2022/3/21 - * @Author zeng - */ -@Data -public class EditLoginIpDTO extends AddLoginIpDTO{ - - @NotNull - private Integer id; - - @Override - public LoginIp getLoginIp() { - LoginIp loginIp = super.getLoginIp(); - loginIp.setId(id); - return loginIp; - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/capital/dto/IdDTO.java b/wjcy-system/src/main/java/me/zhengjie/modules/capital/dto/IdDTO.java deleted file mode 100644 index aee0b34..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/capital/dto/IdDTO.java +++ /dev/null @@ -1,17 +0,0 @@ -package me.zhengjie.modules.capital.dto; - -import lombok.Data; - -import javax.validation.constraints.NotNull; - -/* - * - * @Description IdDTO - * @Date 2021/11/30 - * @Author zeng - */ -@Data -public class IdDTO { - @NotNull - private Long id; -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/capital/dto/RelSettingSiteDTO.java b/wjcy-system/src/main/java/me/zhengjie/modules/capital/dto/RelSettingSiteDTO.java deleted file mode 100644 index 108c95c..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/capital/dto/RelSettingSiteDTO.java +++ /dev/null @@ -1,27 +0,0 @@ -package me.zhengjie.modules.capital.dto; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import javax.validation.Valid; -import javax.validation.constraints.NotNull; -import java.util.List; - -/** - * 全局配置(SettingSiteDTO)表实体类 - * - * @author rch - * @since 2020-07-29 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class RelSettingSiteDTO { - - @NotNull(message = "id不能为空") - private Long id; - - @Valid - List settingSiteList; -} \ No newline at end of file diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/capital/dto/SettingSiteDTO.java b/wjcy-system/src/main/java/me/zhengjie/modules/capital/dto/SettingSiteDTO.java deleted file mode 100644 index 8c9229c..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/capital/dto/SettingSiteDTO.java +++ /dev/null @@ -1,33 +0,0 @@ -package me.zhengjie.modules.capital.dto; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; -import lombok.extern.slf4j.Slf4j; - -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; - -/** - * 全局配置(SettingSiteDTO)表实体类 - * - * @author rch - * @since 2020-07-29 - */ -@Slf4j -@Data -@AllArgsConstructor -@NoArgsConstructor -public class SettingSiteDTO { - - @NotNull(message = "id不能为空") - private Long id; - - /** 设置KEY */ - @NotBlank(message = "设置KEY") - private String settingKey; - - /** 设置value */ - @NotBlank - private String settingValue; -} \ No newline at end of file diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/group/controller/base/CtApplyController.java b/wjcy-system/src/main/java/me/zhengjie/modules/group/controller/base/CtApplyController.java deleted file mode 100644 index aced8ee..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/group/controller/base/CtApplyController.java +++ /dev/null @@ -1,187 +0,0 @@ -package me.zhengjie.modules.group.controller.base; - - -import cn.hutool.core.bean.BeanUtil; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import me.zhengjie.annotation.FormSubmission; -import me.zhengjie.annotation.Log; -import me.zhengjie.dto.Dto; -import me.zhengjie.entity.CtApply; -import me.zhengjie.enums.TaskInfoEnum; -import me.zhengjie.error.ErrorCodeEnum; -import me.zhengjie.modules.group.dto.CtApplyAddDTO; -import me.zhengjie.modules.group.dto.CtApplyListDTO; -import me.zhengjie.modules.group.dto.CtApplyUpdateDTO; -import me.zhengjie.modules.group.dto.IdDTO; -import me.zhengjie.service.CtApplyService; -import me.zhengjie.service.vo.CtApplyListVO; -import me.zhengjie.utils.PageUtils; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import javax.validation.Valid; -import java.util.List; -import java.util.stream.Collectors; - -/** - * Author: zhw - * Data: 2022-07-23 - * Description 应用管理控制层——CtApply - */ -@Validated -@RequestMapping("/api/ctApply") -@RestController -@Api(tags = "业务:应用管理") -public class CtApplyController { - - @Resource - private CtApplyService ctApplyService; - - /** - * 分页查询 - */ - @ApiOperation("分页查询应用数据") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!") - }) - @Log("分页查询应用数据") - @PostMapping("/list") - public Dto getApplyList(@Valid @RequestBody CtApplyListDTO dto){ - PageUtils pageUtils = ctApplyService.searchPageList(dto.getiPage(),dto.getWrapper()); - return Dto.returnResult(pageUtils); - } - - - /** - * 新增应用信息 - * @param dto - * @return Dto - */ - @ApiOperation("新增应用信息") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!"), - @ApiResponse(code = 4200, message = "应用ID存在重复!"), - @ApiResponse(code = 4201, message = "不存在对应方法名称!") - }) - @Log("新增应用信息") - @PostMapping("/add") - @FormSubmission - public Dto addCtApply(@Valid @RequestBody CtApplyAddDTO dto){ - - List applyList = ctApplyService.list(); - List applyIdList = applyList.stream().map(CtApply::getRobotUuid).collect(Collectors.toList()); - if(applyIdList.contains(dto.getRobotUuid())){ - return Dto.getInstance(ErrorCodeEnum.ERROR_NOT_REPEAT_ID); - } - - CtApply ctApply = new CtApply(); - BeanUtil.copyProperties(dto, ctApply); - //任务名首字母小写 - char[] taskNameChars = dto.getTaskName().toCharArray(); - taskNameChars[0] = Character.toLowerCase(taskNameChars[0]); - String taskName = new String(taskNameChars); - String methodName = TaskInfoEnum.getMethodNameByTaskName(taskName); - if(methodName == null || methodName.length() == 0){ - return Dto.getInstance(ErrorCodeEnum.ERROR_NOT_FIND_METHOD_NAME); - } - ctApply.setTaskName(taskName); - ctApply.setMethodName(methodName); - return Dto.returnResult(ctApplyService.save(ctApply)); - } - - /** - * 根据ID删除应用信息 - * @param idDTO - * @return Dto - */ - @ApiOperation("根据ID删除应用信息") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!") - }) - @Log("根据ID删除应用信息") - @PostMapping("/delete") - public Dto delCtApplyById(@Valid @RequestBody IdDTO idDTO){ - return Dto.returnResult(ctApplyService.removeById(idDTO.getId())); - } - - /** - * 根据ID 修改应用信息 - * @param dto - * @return Dto - */ - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!"), - @ApiResponse(code = 4200, message = "应用ID存在重复!"), - @ApiResponse(code = 4201, message = "不存在对应方法名称!") - }) - @ApiOperation("修改应用信息") - @Log("根据ID修改应用信息") - @PostMapping("/edit") - @FormSubmission - public Dto editCtApplyById(@Valid @RequestBody CtApplyUpdateDTO dto){ - CtApply ctApplyIsExist = ctApplyService.getById(dto.getId()); - if(ctApplyIsExist == null){ - return Dto.getInstance(ErrorCodeEnum.ERROR_NOT_FIND_APPLY); - } - CtApply updateCtApply = new CtApply(); - BeanUtil.copyProperties(dto,updateCtApply); - //更新校验 - List applyList = ctApplyService.list(); - List applyIdList = applyList.stream().map(CtApply::getRobotUuid).collect(Collectors.toList()); - if(applyIdList.contains(dto.getRobotUuid()) && !dto.getRobotUuid().equals(ctApplyIsExist.getRobotUuid())){ - return Dto.getInstance(ErrorCodeEnum.ERROR_NOT_REPEAT_ID); - } - - //任务名首字母小写 - char[] taskNameChars = dto.getTaskName().toCharArray(); - taskNameChars[0] = Character.toLowerCase(taskNameChars[0]); - String taskName = new String(taskNameChars); - String methodName = TaskInfoEnum.getMethodNameByTaskName(taskName); - //判断是否存在对应方法名称 - if(methodName == null || methodName.length() == 0){ - return Dto.getInstance(ErrorCodeEnum.ERROR_NOT_FIND_METHOD_NAME); - } - updateCtApply.setTaskName(taskName); - updateCtApply.setMethodName(methodName); - return Dto.returnResult(ctApplyService.updateById(updateCtApply)); - } - - /** - * 根据ID 查询应用信息 - * @param idDTO - * @return Dto - */ - @ApiOperation("查询应用信息") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!") - }) - @Log("根据ID查询应用信息") - @PostMapping("getById") - public Dto getById(@Valid @RequestBody IdDTO idDTO){ - return Dto.returnResult(ctApplyService.getById(idDTO.getId())); - } - - /** - * 获取所有应用信息 - * @return Dto - */ - @ApiOperation("查找所有应用名称") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!") - }) - @Log("查找所有应用名称") - @GetMapping("getAll") - public Dto getAllApply(){ - return Dto.returnResult(ctApplyService.getAllApplyName()); - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/group/controller/base/CtBrowseController.java b/wjcy-system/src/main/java/me/zhengjie/modules/group/controller/base/CtBrowseController.java deleted file mode 100644 index f22c5bd..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/group/controller/base/CtBrowseController.java +++ /dev/null @@ -1,148 +0,0 @@ -package me.zhengjie.modules.group.controller.base; - -import cn.hutool.core.bean.BeanUtil; -import cn.hutool.core.util.ObjectUtil; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import lombok.RequiredArgsConstructor; -import me.zhengjie.annotation.FormSubmission; -import me.zhengjie.annotation.Log; -import me.zhengjie.annotation.type.LogActionType; -import me.zhengjie.dto.Dto; -import me.zhengjie.entity.CtBrowse; -import me.zhengjie.enums.ClickBrowseStatusEnum; -import me.zhengjie.error.ErrorCodeEnum; -import me.zhengjie.modules.group.dto.CtBrowseAddDTO; -import me.zhengjie.modules.group.dto.CtBrowseListDTO; -import me.zhengjie.modules.group.dto.CtBrowseUpdateDTO; -import me.zhengjie.modules.group.dto.IdDTO; -import me.zhengjie.service.CtBrowseService; -import me.zhengjie.service.vo.CtBrowseDetailVO; -import me.zhengjie.service.vo.CtBrowseListVO; -import me.zhengjie.utils.PageUtils; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import javax.annotation.Resource; -import javax.validation.Valid; - - -/** - * - * @Description 浏览收藏 控制类 - * @Date 2022-11-04 - * @Author rch - */ -@Validated -@RequestMapping("/api/ctBrowse") -@RestController -@RequiredArgsConstructor -@Api(tags = "业务:收藏浏览管理") -public class CtBrowseController { - - @Resource - private CtBrowseService ctBrowseService; - - /** - * 分页查询浏览收藏信息 - */ - @ApiOperation("分页查询浏览收藏数据") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!") - }) - @Log("分页查询浏览收藏信息") - @PostMapping("/list") - public Dto getBrowseList(@Valid @RequestBody CtBrowseListDTO dto) { - PageUtils pageUtilsResult = ctBrowseService.searchPageList(dto.getiPage(), dto.getWrapper()); - return Dto.returnResult(pageUtilsResult); - } - - /** - * 新增浏览收藏信息 - */ - @ApiOperation("新增浏览收藏") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!") - }) - @Log(value = "新增浏览收藏信息",type = LogActionType.ADD) - @PostMapping("/add") - @FormSubmission - public Dto addBrowse(@Valid @RequestBody CtBrowseAddDTO dto) { - - CtBrowse ctBrowse = new CtBrowse(); - BeanUtil.copyProperties(dto, ctBrowse); - return Dto.returnResult(ctBrowseService.save(ctBrowse)); - } - - /** - * 根据Id获取浏览收藏详情 - */ - @ApiOperation("根据Id获取浏览收藏详情") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!") - }) - - @Log("根据Id获取浏览收藏详情") - @PostMapping("/getById") - public Dto getBrowseById(@Valid @RequestBody IdDTO idDTO) { - return Dto.returnResult(ctBrowseService.getBrowseDetailById(idDTO.getId())); - } - - - /** - * 根据id删除 - * @author: rch - */ - @ApiOperation("根据id删除") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!"), - @ApiResponse(code = 3300, message = "浏览信息不存在!") - }) - @Log(value = "根据id删除信息",type = LogActionType.DELETE) - @PostMapping("/delete") - public Dto delete(@Valid @RequestBody IdDTO idDTO) { - - // 先查询 - CtBrowse ctBrowse = ctBrowseService.getById(idDTO.getId()); - if (ObjectUtil.isEmpty(ctBrowse) - || !ClickBrowseStatusEnum.TOBE_EXECUTION.eqValue(ctBrowse.getStatus())) { - return Dto.getInstance(ErrorCodeEnum.ERROR_NOT_FIND_BROWSE); - } - return Dto.returnResult(ctBrowseService.removeById(idDTO.getId())); - } - - /** - * 编辑浏览收藏信息 - */ - @ApiOperation("编辑浏览收藏信息") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!"), - @ApiResponse(code = 3301, message = "浏览收藏信息不存在!") - }) - @Log(value = "编辑浏览收藏信息",type = LogActionType.UPDATE) - @PostMapping("/edit") - @FormSubmission - public Dto editBrowse(@Valid @RequestBody CtBrowseUpdateDTO dto) { - - // 根据id 判断是否存在 - CtBrowse ctBrowse = ctBrowseService.getById(dto.getId()); - if (ObjectUtil.isEmpty(ctBrowse)) { - return Dto.getInstance(ErrorCodeEnum.ERROR_NOT_FIND_BROWSE); - } - - CtBrowse updateCtBrowse = new CtBrowse(); - BeanUtil.copyProperties(dto, updateCtBrowse); - - return Dto.returnResult(ctBrowseService.updateById(updateCtBrowse)); - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/group/controller/base/CtBuyerController.java b/wjcy-system/src/main/java/me/zhengjie/modules/group/controller/base/CtBuyerController.java deleted file mode 100644 index 6ef64e9..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/group/controller/base/CtBuyerController.java +++ /dev/null @@ -1,391 +0,0 @@ -package me.zhengjie.modules.group.controller.base; - -import cn.hutool.core.bean.BeanUtil; -import cn.hutool.core.lang.Snowflake; -import cn.hutool.core.util.ObjectUtil; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import io.swagger.annotations.*; -import lombok.RequiredArgsConstructor; -import me.zhengjie.annotation.AnonymousAccess; -import me.zhengjie.annotation.FormSubmission; -import me.zhengjie.annotation.Log; -import me.zhengjie.annotation.type.LogActionType; -import me.zhengjie.config.PropertiesConfig; -import me.zhengjie.config.SystemConfig; -import me.zhengjie.constant.PublicConstant; -import me.zhengjie.dto.Dto; -import me.zhengjie.entity.*; -import me.zhengjie.enums.BuyerStatusEnum; -import me.zhengjie.enums.PlatTypeEnum; -import me.zhengjie.error.ErrorCodeEnum; -import me.zhengjie.modules.group.dto.CtBuyerAddDTO; -import me.zhengjie.modules.group.dto.CtBuyerListDTO; -import me.zhengjie.modules.group.dto.CtBuyerUpdateDTO; -import me.zhengjie.modules.group.dto.IdDTO; -import me.zhengjie.service.*; -import me.zhengjie.service.vo.CtBuyerDetailVO; -import me.zhengjie.service.vo.CtBuyerListVO; -import me.zhengjie.utils.PageUtils; -import me.zhengjie.utils.excel.ExcelUtils; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; -import javax.validation.Valid; -import java.util.ArrayList; -import java.util.List; -import java.util.Optional; -import java.util.stream.Collectors; - - -/** - * - * @Description 群控管理-买家 控制类 - * @Date 2022-06-22 - * @Author rch - */ -@Validated -@RequestMapping("/api/ctBuyer") -@RestController -@RequiredArgsConstructor -@Api(tags = "业务:买家管理") -public class CtBuyerController { - - @Resource - private CtBuyerService ctBuyerService; - @Resource - private CtOrderService ctOrderService; - @Resource - private CtCompanyService ctCompanyService; - @Resource - private CtVpnService ctVpnService; - @Resource - private CtCardService ctCardService; - @Resource - private PropertiesConfig propertiesConfig; - @Resource - private Snowflake snowflake; - - /** - * 分页查询买家信息 - */ - @ApiOperation("分页查询买家数据") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!") - }) - @Log("分页查询买家信息") - @PostMapping("/list") - public Dto getBuyerList(@Valid @RequestBody CtBuyerListDTO dto) { - PageUtils pageUtilsResult = ctBuyerService.searchPageList(dto.getiPage(), dto.getWrapper()); - return Dto.returnResult(pageUtilsResult); - } - - /** - * 新增买家信息 - */ - @ApiOperation("新增买家信息") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!"), - @ApiResponse(code = 3200, message = "平台信息不存在!") - }) - @Log(value = "新增买家信息", type = LogActionType.ADD) - @PostMapping("/add") - @FormSubmission - public Dto addBuyer(@Valid @RequestBody CtBuyerAddDTO dto) { - // 检验 - Dto returnDto = addCheck(dto); - if (ObjectUtil.isNotEmpty(returnDto)) { - return returnDto; - } - - CtBuyer ctBuyer = new CtBuyer(); - BeanUtil.copyProperties(dto, ctBuyer); - return Dto.returnResult(ctBuyerService.save(ctBuyer)); - } - - /** - * 根据id买家信息详情详情 - */ - @ApiOperation("根据id查询买家详情信息") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!") - }) - @Log("根据id查询买家详情信息") - @PostMapping("/getById") - public Dto getBuyerById(@Valid @RequestBody IdDTO idDTO) { - return Dto.returnResult(ctBuyerService.getDetailById(idDTO.getId())); - } - - /** - * 编辑买家信息 - */ - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!"), - @ApiResponse(code = 3000, message = "买家信息不存在!"), - @ApiResponse(code = 3200, message = "平台信息不存在!") - }) - @ApiOperation("编辑买家信息") - @Log(value = "编辑买家信息", type = LogActionType.UPDATE) - @PostMapping("/edit") - @FormSubmission - public Dto editBuyer(@Valid @RequestBody CtBuyerUpdateDTO dto) { - - // 根据id 判断是否存在 - CtBuyer ctBuyer = ctBuyerService.getById(dto.getId()); - if (ObjectUtil.isEmpty(ctBuyer)) { - Dto.getInstance(ErrorCodeEnum.ERROR_NOT_FIND_BUYER_USER); - } - - // 如果修改平台平台信息 以及修改 密码信息 需要判断是否有关联的订单信息 存在则不允许修改 - Dto returnDto = equalsUpdateBuyerInfo(dto, ctBuyer); - if (ObjectUtil.isNotEmpty(returnDto)) { - return returnDto; - } - CtBuyer updateCtBuyer = new CtBuyer(); - BeanUtil.copyProperties(dto, updateCtBuyer); - return Dto.returnResult(ctBuyerService.updateById(updateCtBuyer)); - } - - /** - * 根据id删除买家信息 - * - * @author: rch - */ - @ApiOperation("根据ID删除买家信息") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!") - }) - @Log(value = "根据id删除买家信息", type = LogActionType.DELETE) - @PostMapping("/delete") - public Dto delBuyer(@Valid @RequestBody IdDTO idDTO) { - -// QueryWrapper queryWrapper = new QueryWrapper<>(); -// queryWrapper.eq("buyer_id", idDTO); -// Integer count = ctOrderService.count(queryWrapper); -// if (ObjectUtil.isNotEmpty(count) && count > 0) { -// Dto.getInstance(ErrorCodeEnum.ERROR_NOT_DEL_EXIST_ORDER_BUYER_USER); -// } - - CtBuyer updateCtBuyer = new CtBuyer(); - updateCtBuyer.setId(idDTO.getId()); - updateCtBuyer.setStatus(BuyerStatusEnum.DEL.value()); - - return Dto.returnResult(ctBuyerService.updateById(updateCtBuyer)); - } - - /** - * 新增逻辑 检验 - * - * @param dto - * @return - */ - public Dto addCheck(CtBuyerAddDTO dto) { - // 检验公司是否存在 - if (!ObjectUtil.isNotEmpty(ctCompanyService.getById(dto.getCompanyId()))) { - return Dto.getInstance(ErrorCodeEnum.ERROR_NOT_FIND_COMPANY); - } - - // 检验平台是否正确 - String value = PlatTypeEnum.getDescByType(dto.getPlatformId()); - if (ObjectUtil.isEmpty(value)) { - return Dto.getInstance(ErrorCodeEnum.ERROR_NOT_FIND_PLAT_USER); - } - -// // 判断token是否重复 -// QueryWrapper queryWrapper = new QueryWrapper<>(); -// queryWrapper.eq("pwd", dto.getPwd()); -// Integer count = ctBuyerService.count(queryWrapper); -// if (ObjectUtil.isNotEmpty(count) && count > 1) { -// return Dto.getInstance(ErrorCodeEnum.ERROR_EXIST_FIND_BUYER_USER); -// } - return null; - } - - /** - * 检验是否是允许修改 - * - * @param dto - * @param ctBuyer - * @return - */ - public Dto equalsUpdateBuyerInfo(CtBuyerUpdateDTO dto, CtBuyer ctBuyer) { - Boolean canUpdate = false; - if (ObjectUtil.isNotEmpty(dto.getPwd()) && !dto.getPwd().equals(ctBuyer.getPwd())) { - canUpdate = true; - } - if (ObjectUtil.isNotEmpty(dto.getPlatformId()) && !dto.getPlatformId().equals(ctBuyer.getPlatformId())) { - canUpdate = true; - } - if (ObjectUtil.isNotEmpty(dto.getPlatformId()) && !dto.getPlatformId().equals(ctBuyer.getPlatformId())) { - canUpdate = true; - } - - if (canUpdate) { - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("buyer_id", dto.getId()); - Integer count = ctOrderService.count(queryWrapper); - if (ObjectUtil.isNotEmpty(count) && count > 1) { - return Dto.getInstance(ErrorCodeEnum.ERROR_NOT_UPDATE_EXIST_ORDER_BUYER_USER); - } - } - - // 检验公司是否存在 - if (!ObjectUtil.isNotEmpty(ctCompanyService.getById(dto.getCompanyId()))) { - return Dto.getInstance(ErrorCodeEnum.ERROR_NOT_FIND_COMPANY); - } - -// // 判断token是否重复 -// QueryWrapper queryWrapper = new QueryWrapper<>(); -// queryWrapper.eq("pwd", dto.getPwd()); -// Integer count = ctBuyerService.count(queryWrapper); -// if (ObjectUtil.isNotEmpty(count) && count > 1) { -// return Dto.getInstance(ErrorCodeEnum.ERROR_EXIST_FIND_BUYER_USER); -// } - return null; - } - - /** - * 从Excel导入买家信息 - */ - @ApiOperation("从Excel导入买家信息") - @ApiImplicitParams({ - @ApiImplicitParam(value = "上传文件", name = "file", dataType = "__file", required = true) - }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!") - }) - @Log(value = "Excel买家信息", type = LogActionType.ADD) - @PostMapping("import") - public Dto importBuyer(@RequestPart("file") MultipartFile file, HttpServletResponse response) throws Exception { - List ctBuyerImportList = ExcelUtils.readMultipartFile(file, CtBuyerImport.class); - //当excel表导入为空 - if (ObjectUtil.isEmpty(ctBuyerImportList)) { - return Dto.returnResult(false); - } - - List allBuyerAccount = ctBuyerService.getAllAccount(); - List companyInfoList = new ArrayList<>(); - //根据excel表中公司名称导出表中存在公司信息,自动过滤不存在的 - List buyerCompanyNameList = ctBuyerImportList.stream().map(CtBuyerImport::getCompanyName).collect(Collectors.toList()).stream().distinct().collect(Collectors.toList()); - if (ObjectUtil.isNotEmpty(buyerCompanyNameList)) { - companyInfoList = ctCompanyService.getByNmae(buyerCompanyNameList); - } - //获取VPN列表 - List vpnInfoList = new ArrayList<>(); - List buyerVpnIpList = ctBuyerImportList.stream().map(CtBuyerImport::getVpnIp).collect(Collectors.toList()).stream().distinct().collect(Collectors.toList());; - if (ObjectUtil.isNotEmpty(buyerVpnIpList)) { - vpnInfoList = ctVpnService.getVpnInfoByIp(buyerVpnIpList); - } - //获取信用卡列表 - List cardInfoList = new ArrayList<>(); - List buyerCardNubList = ctBuyerImportList.stream().map(CtBuyerImport::getCardNumber).collect(Collectors.toList()).stream().distinct().collect(Collectors.toList());; - if (ObjectUtil.isNotEmpty(buyerCardNubList)) { - cardInfoList = ctCardService.getCardInfoByNumber(buyerCardNubList); - } - - //批量新增的买家 - List addCtBuyerList = new ArrayList<>(); - //导出异常的买家信息 - List ctBuyerExportList = new ArrayList<>(); - - //循环判断异常 - for (CtBuyerImport ctBuyerImport : ctBuyerImportList) { - //定义一个异常买家实体 - CtBuyerExport ctBuyerExport = new CtBuyerExport(); - BeanUtil.copyProperties(ctBuyerImport, ctBuyerExport); - - StringBuffer errorStrBuf = new StringBuffer(); - //错误信息 - String rowTips = ctBuyerImport.getRowTips(); - if (ObjectUtil.isNotEmpty(rowTips)) { - errorStrBuf.append(rowTips); - errorStrBuf.append(";"); - } - - if (allBuyerAccount.contains(ctBuyerImport.getAccount())) { - errorStrBuf.append("已存在该账号对应的买家信息"); - errorStrBuf.append(";"); - } - //判断是否存在该公司 - if (ObjectUtil.isEmpty(companyInfoList) || companyInfoList.stream().filter(i -> i.getName().equals(ctBuyerExport.getCompanyName())).count() < 1) { - errorStrBuf.append("公司名称不存在!"); - errorStrBuf.append(";"); - } - if (ObjectUtil.isEmpty(vpnInfoList) || vpnInfoList.stream().filter(i -> i.getIpAddress().equals(ctBuyerExport.getVpnIp())).count() < 1) { - errorStrBuf.append("VpnIP信息不存在!"); - errorStrBuf.append(";"); - } - // 敦煌的不需要检验信用卡 - if (!"敦煌".equals(ctBuyerImport.getPlatformName())) { - if (ObjectUtil.isEmpty(cardInfoList) || cardInfoList.stream().filter(i -> i.getNumber().equals(ctBuyerExport.getCardNumber())).count() < 1) { - errorStrBuf.append("信用卡卡号信息不存在!"); - errorStrBuf.append(";"); - } - } - - // 平台 - Integer platId = PlatTypeEnum.getValueByDesc(ctBuyerImport.getPlatformName()); - if (ObjectUtil.isEmpty(platId)) { - errorStrBuf.append("平台信息不存在!"); - errorStrBuf.append(";"); - } - - if (ObjectUtil.isNotEmpty(errorStrBuf)) { - ctBuyerExport.setError(errorStrBuf.toString()); - ctBuyerExportList.add(ctBuyerExport); - } else { - CtBuyer ctBuyer = new CtBuyer(); - BeanUtil.copyProperties(ctBuyerImport, ctBuyer); - //平台ID - ctBuyer.setPlatformId(platId); - //公司ID - Optional ctCompanyInfo = companyInfoList.stream().filter(c -> c.getName().equals(ctBuyerImport.getCompanyName())).findFirst(); - ctBuyer.setCompanyId(ctCompanyInfo.get().getId()); - //VPNiD - Optional ctVpnInfo = vpnInfoList.stream().filter(c -> c.getIpAddress().equals(ctBuyerImport.getVpnIp())).findFirst(); - ctBuyer.setVpnId(ctVpnInfo.get().getId()); - //信用卡ID - Optional ctCardInfo = cardInfoList.stream().filter(c -> c.getNumber().equals(ctBuyerImport.getCardNumber())).findFirst(); - ctBuyer.setCardId(ctCardInfo.get().getId()); - addCtBuyerList.add(ctBuyer); - } - } - String returnDataStr = null; - String filePath = propertiesConfig.getUploadImgPath().get(PublicConstant.EXPORT_EXCEL_FILE_TYPE); - String fileName = "买家导入异常信息表-" + snowflake.nextIdStr(); - if (ObjectUtil.isNotEmpty(ctBuyerExportList)) { - ExcelUtils.exportFile(SystemConfig.IMG_PATH + filePath, fileName, ctBuyerExportList); - returnDataStr = SystemConfig.FILE_VISIT_ADDR + filePath + fileName + ".xlsx"; - // returnDataStr = "http://localhost:8008/file" + filePath + fileName + ".xlsx"; - } - - if (ObjectUtil.isNotEmpty(addCtBuyerList)) { - ctBuyerService.saveBatch(addCtBuyerList); - } - - return Dto.returnResult(ObjectUtil.isEmpty(returnDataStr) ? true : returnDataStr); - } - - /** - * ExcelVpn信息模板导出 - */ - @ApiOperation("买家信息Excel模版导出") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!") - }) - @Log(value = "买家信息Excel模版导出") - @GetMapping("/exportTemp") - @AnonymousAccess - public void exportBuyer(HttpServletResponse response) { - ExcelUtils.exportTemplate(response, "买家导入模板", CtBuyerExportTemple.class); - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/group/controller/base/CtCardController.java b/wjcy-system/src/main/java/me/zhengjie/modules/group/controller/base/CtCardController.java deleted file mode 100644 index e7d0888..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/group/controller/base/CtCardController.java +++ /dev/null @@ -1,307 +0,0 @@ -package me.zhengjie.modules.group.controller.base; - -import cn.hutool.core.bean.BeanUtil; -import cn.hutool.core.date.DateUtil; -import cn.hutool.core.lang.Snowflake; -import cn.hutool.core.util.ObjectUtil; -import com.baomidou.mybatisplus.core.metadata.IPage; -import io.swagger.annotations.*; -import lombok.RequiredArgsConstructor; -import me.zhengjie.annotation.AnonymousAccess; -import me.zhengjie.annotation.FormSubmission; -import me.zhengjie.annotation.Log; -import me.zhengjie.annotation.type.LogActionType; -import me.zhengjie.config.PropertiesConfig; -import me.zhengjie.config.SystemConfig; -import me.zhengjie.constant.PublicConstant; -import me.zhengjie.dto.Dto; -import me.zhengjie.entity.CtCard; -import me.zhengjie.entity.CtCardExport; -import me.zhengjie.entity.CtCardExportTemple; -import me.zhengjie.entity.CtCardImport; -import me.zhengjie.enums.CardStatusEnum; -import me.zhengjie.error.ErrorCodeEnum; -import me.zhengjie.modules.group.dto.CtCardAddDTO; -import me.zhengjie.modules.group.dto.CtCardListDTO; -import me.zhengjie.modules.group.dto.CtCardUpdateDTO; -import me.zhengjie.modules.group.dto.IdDTO; -import me.zhengjie.service.CtCardService; -import me.zhengjie.service.vo.CtCardDetailVO; -import me.zhengjie.service.vo.CtCardListVO; -import me.zhengjie.utils.PageUtils; -import me.zhengjie.utils.excel.ExcelUtils; -import org.springframework.beans.BeanUtils; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; -import javax.validation.Valid; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - - -/** - * - * @Description 群控管理-信用卡 控制类 - * @Date 2022-06-22 - * @Author rch - */ -@Validated -@RequestMapping("/api/ctCard") -@RestController -@RequiredArgsConstructor -@Api(tags = "业务:信用卡管理") -public class CtCardController { - - @Resource - private CtCardService ctCardService; - @Resource - private PropertiesConfig propertiesConfig; - @Resource - private Snowflake snowflake; - - /** - * 分页查询信用卡信息 - */ - @ApiOperation("分页查询信用卡数据") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!") - }) - @Log("分页查询信用卡信息") - @PostMapping("/list") - public Dto getCardList(@Valid @RequestBody CtCardListDTO dto) { - IPage page= ctCardService.page(dto.getiPage(), dto.getWrapper()); - List list = new ArrayList<>(); - for (CtCard record : page.getRecords()) { - CtCardListVO vo = new CtCardListVO(); - BeanUtil.copyProperties(record, vo); - list.add(vo); - } - - PageUtils pageUtils = new PageUtils(page.getTotal(),list); - return Dto.returnResult(pageUtils); - } - - /** - * 新增信用卡信息 - */ - @ApiOperation("新增信用卡") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!") - }) - @Log(value = "新增信用卡信息",type = LogActionType.ADD) - @PostMapping("/add") - @FormSubmission - public Dto addCard(@Valid @RequestBody CtCardAddDTO dto) { - - CtCard ctCard = new CtCard(); - BeanUtil.copyProperties(dto, ctCard); - return Dto.returnResult(ctCardService.save(ctCard)); - } - - /** - * 根据Id获取信用卡详情 - */ - @ApiOperation("根据Id获取信用卡详情") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!") - }) - @Log("根据Id获取信用卡详情") - @PostMapping("/getById") - public Dto getCardById(@Valid @RequestBody IdDTO idDTO) { - return Dto.returnResult(ctCardService.getById(idDTO.getId())); - } - - - /** - * 根据id删除信用卡信息 - * @author: rch - */ - @ApiOperation("根据id删除信用卡信息") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!"), - @ApiResponse(code = 3300, message = "信用卡信息不存在,或者已删除或异常!") - }) - @Log(value = "根据id删除信用卡信息",type = LogActionType.DELETE) - @PostMapping("/delete") - public Dto delCard(@Valid @RequestBody IdDTO idDTO) { - - // 先查询 - CtCard ctCard = ctCardService.getById(idDTO.getId()); - if (ObjectUtil.isEmpty(ctCard) || CardStatusEnum.DEL.eqValue(ctCard.getStatus())) { - return Dto.getInstance(ErrorCodeEnum.ERROR_NOT_FIND_CARD_INFO); - } - - CtCard updateCtCard = new CtCard(); - updateCtCard.setId(idDTO.getId()); - updateCtCard.setStatus(CardStatusEnum.DEL.value()); - - return Dto.returnResult(ctCardService.updateById(updateCtCard)); - } - - - /** - * 根据id修改信用卡状态异常 - * @author: rch - */ - @ApiOperation("根据id修改信用卡状态异常") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!"), - @ApiResponse(code = 3300, message = "信用卡信息不存在,或者已删除或异常!") - }) - @Log(value = "根据id修改信用卡状态异常",type = LogActionType.UPDATE) - @PostMapping("/abMormal") - public Dto abMormal(@Valid @RequestBody IdDTO idDTO) { - - // 先查询 - CtCard ctCard = ctCardService.getById(idDTO.getId()); - if (ObjectUtil.isEmpty(ctCard) || CardStatusEnum.AB_NORMAL.eqValue(ctCard.getStatus())) { - return Dto.getInstance(ErrorCodeEnum.ERROR_NOT_FIND_CARD_INFO); - } - - CtCard updateCtCard = new CtCard(); - updateCtCard.setId(idDTO.getId()); - updateCtCard.setStatus(CardStatusEnum.AB_NORMAL.value()); - - return Dto.returnResult(ctCardService.updateById(updateCtCard)); - } - - - /** - * 编辑信用卡信息 - */ - @ApiOperation("编辑信用卡信息") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!"), - @ApiResponse(code = 3301, message = "信用卡信息不存在!") - }) - @Log(value = "编辑信用卡信息",type = LogActionType.UPDATE) - @PostMapping("/edit") - @FormSubmission - public Dto editCard(@Valid @RequestBody CtCardUpdateDTO dto) { - - // 根据id 判断是否存在 - CtCard ctCard = ctCardService.getById(dto.getId()); - if (ObjectUtil.isEmpty(ctCard)) { - return Dto.getInstance(ErrorCodeEnum.ERROR_NOT_FIND_CARD); - } - - CtCard updateCard = new CtCard(); - BeanUtil.copyProperties(dto, updateCard); - - return Dto.returnResult(ctCardService.updateById(updateCard)); - } - - /** - * Excel导入信用卡信息 - * @param file - * @param response - * @return - * @throws Exception - */ - @ApiOperation("Excel导入信用卡信息") - @ApiImplicitParams({ - @ApiImplicitParam(value = "上传文件", name = "file", dataType = "__file", required = true) - }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!") - }) - @Log(value = "Excel导入信用卡信息",type = LogActionType.ADD) - @PostMapping("/import") - public Dto importCard(@RequestPart("file")MultipartFile file, HttpServletResponse response) throws Exception { - - // TODO 对Excel 信息进行检测 如果不符合要求的 最终要导出错误Excel提示 - List ctCardImportList = ExcelUtils.readMultipartFile(file, CtCardImport.class); - if (ObjectUtil.isEmpty(ctCardImportList)) { - return Dto.returnResult(true); - } - - List addCtCardList = new ArrayList<>(); - List numberValueList = ctCardService.getNumberList(); - List ctCardExportList = new ArrayList<>(); - for (CtCardImport ctCardImport:ctCardImportList) { - CtCardExport ctCardExport = new CtCardExport(); - BeanUtil.copyProperties(ctCardImport, ctCardExport); - - StringBuffer errorStrBuf = new StringBuffer(); - String rowTips = ctCardImport.getRowTips(); - if (ObjectUtil.isNotEmpty(rowTips)) { - errorStrBuf.append(rowTips); - errorStrBuf.append(";"); - } - if (numberValueList.contains(ctCardImport.getNumber())) { - errorStrBuf.append("平台已经存在改卡号对应的信用卡信息!"); - errorStrBuf.append(";"); - } - // 判断日期格式是否正确 - String termOfValidity = ctCardImport.getTermOfValidity(); - String datePattern = "\\d{4}-\\d{1,2}-\\d{1,2}"; - if (!termOfValidity.matches(datePattern)) { - errorStrBuf.append("时间格式错误(yyyy-MM-dd)!"); - errorStrBuf.append(";"); - } - if (ObjectUtil.isNotEmpty(errorStrBuf)) { - ctCardExport.setError(errorStrBuf.toString()); - ctCardExportList.add(ctCardExport); - } else { - CtCard ctCard = new CtCard(); - BeanUtils.copyProperties(ctCardImport, ctCard); - addCtCardList.add(ctCard); - } - } - - String returnDataStr = null; - String filePath = propertiesConfig.getUploadImgPath().get(PublicConstant.EXPORT_EXCEL_FILE_TYPE); - String fileName = "信用卡导入异常信息表-" + snowflake.nextIdStr(); - if (ObjectUtil.isNotEmpty(ctCardExportList)) { - ExcelUtils.exportFile(SystemConfig.IMG_PATH + filePath, fileName, ctCardExportList); - returnDataStr = SystemConfig.FILE_VISIT_ADDR + filePath + fileName + ".xlsx"; -// returnDataStr = "http://localhost:8008/file" + filePath + fileName + ".xlsx"; - } - - if (ObjectUtil.isNotEmpty(addCtCardList)) { - ctCardService.saveBatch(addCtCardList); - } - - return Dto.returnResult(returnDataStr); - -// // 剔除已经有的了 -// List numberList = ctCardList.stream().map(CtCard::getNumber).collect(Collectors.toList()); -// if (ObjectUtil.isEmpty(numberValueList)) { -// return Dto.returnResult(true); -// } -// List finalNumberList = (List) CollectionUtils.subtract(numberList, numberValueList); -// if (ObjectUtil.isEmpty(finalNumberList)) { -// return Dto.returnResult(true); -// } -// ctCardList = ctCardList.stream().filter(c-> finalNumberList.contains(c.getNumber())).collect(Collectors.toList()); - - } - - - /** - * Excel信用卡信息模版导出 - * @param response - */ - @ApiOperation("Excel信用卡信息模版导出") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!") - }) - @Log(value = "Excel信用卡信息模版导出") - @GetMapping("/exportTemp") - @AnonymousAccess - public void importCard(HttpServletResponse response) { - ExcelUtils.exportTemplate(response, "信用卡模版", CtCardExportTemple.class); - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/group/controller/base/CtClickFarmingController.java b/wjcy-system/src/main/java/me/zhengjie/modules/group/controller/base/CtClickFarmingController.java deleted file mode 100644 index 3e481cc..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/group/controller/base/CtClickFarmingController.java +++ /dev/null @@ -1,301 +0,0 @@ -package me.zhengjie.modules.group.controller.base; - -import cn.hutool.core.bean.BeanUtil; -import cn.hutool.core.lang.Snowflake; -import cn.hutool.core.util.ObjectUtil; -import io.swagger.annotations.*; -import lombok.RequiredArgsConstructor; -import me.zhengjie.annotation.AnonymousAccess; -import me.zhengjie.annotation.FormSubmission; -import me.zhengjie.annotation.Log; -import me.zhengjie.annotation.type.LogActionType; -import me.zhengjie.config.PropertiesConfig; -import me.zhengjie.config.SystemConfig; -import me.zhengjie.constant.PublicConstant; -import me.zhengjie.dto.Dto; -import me.zhengjie.entity.*; -import me.zhengjie.enums.ClickFarmingStatusEnum; -import me.zhengjie.enums.ParamsTypeEnum; -import me.zhengjie.error.ErrorCodeEnum; -import me.zhengjie.modules.group.dto.CtClickFarmingAddDTO; -import me.zhengjie.modules.group.dto.CtClickFarmingDTO; -import me.zhengjie.modules.group.dto.CtClickFarmingEditDTO; -import me.zhengjie.modules.group.dto.IdDTO; -import me.zhengjie.service.CtBuyerService; -import me.zhengjie.service.CtClickFarmingService; -import me.zhengjie.service.vo.CtClickFarmEditDetailVO; -import me.zhengjie.service.vo.CtClickFarmingDetailVO; -import me.zhengjie.service.vo.CtClickFarmingVO; -import me.zhengjie.utils.PageUtils; -import me.zhengjie.utils.excel.ExcelUtils; -import org.springframework.beans.BeanUtils; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; -import javax.validation.Valid; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; -/** - * - * @Description 群控管理-刷单信息 控制类 - * @Date 2022-06-22 - * @Author rch - */ -@Validated -@RequestMapping("/api/clickFarming") -@RestController -@RequiredArgsConstructor -@Api(tags = "业务:刷单信息管理") -public class CtClickFarmingController { - - @Resource - private CtClickFarmingService ctClickFarmingService; - @Resource - private PropertiesConfig propertiesConfig; - @Resource - private CtBuyerService ctBuyerService; - @Resource - private Snowflake snowflake; - - /** - * 分页查询刷单信息 - */ - @ApiOperation("分页查询刷单数据") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!") - }) - @Log("分页查询刷单信息") - @PostMapping("/list") - public Dto getClickFarmingList(@Valid @RequestBody CtClickFarmingDTO dto) { - PageUtils pageUtilsResult = ctClickFarmingService.searchPageList(dto.getiPage(), dto.getWrapper()); - return Dto.returnResult(pageUtilsResult); - } - - /** - * 新增刷单信息 - */ - @ApiOperation("新增刷单信息") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!") - }) - @Log(value = "新增刷单信息",type = LogActionType.ADD) - @PostMapping("/add") - @FormSubmission - public Dto addClickFarming(@Valid @RequestBody CtClickFarmingAddDTO dto) { - - CtClickFarming ctClickFarming = new CtClickFarming(); - BeanUtil.copyProperties(dto, ctClickFarming); - return Dto.returnResult(ctClickFarmingService.save(ctClickFarming)); - } - - /** - * 根据id获取刷单信息 - */ - @ApiOperation("根据id获取刷单信息") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!") - }) - @Log("根据id获取刷单信息") - @PostMapping("/getById") - public Dto getById(@Valid @RequestBody IdDTO idDTO) { - return Dto.returnResult(ctClickFarmingService.getDetailById(idDTO.getId())); - } - - /** - * 根据id获取修改回显信息 - */ - @ApiOperation("根据id获取修改回显信息") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!") - }) - @Log("根据id获取修改回显信息") - @PostMapping("/getEditDetailById") - public Dto getEditDetailById(@Valid @RequestBody IdDTO idDTO) { - return Dto.returnResult(ctClickFarmingService.getEditDetailById(idDTO.getId())); - } - - /** - * 根据id删除刷单信息 - * @author: rch - */ - @ApiOperation("根据id删除刷单信息") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!"), - @ApiResponse(code = 3300, message = "信用卡信息不存在,或者已删除或异常!"), - @ApiResponse(code = 3901, message = "只有待执行的刷单信息才允许删除!") - }) - @Log(value = "根据id删除刷单信息",type = LogActionType.DELETE) - @PostMapping("/delete") - public Dto delClickFarming(@Valid @RequestBody IdDTO idDTO) { - - // 先查询 - CtClickFarming ctClickFarming = ctClickFarmingService.getById(idDTO.getId()); - if (ObjectUtil.isEmpty(ctClickFarming)) { - return Dto.getInstance(ErrorCodeEnum.ERROR_NOT_FIND_CARD_INFO); - } - - if (!ClickFarmingStatusEnum.TOBE_EXECUTION.eqValue(ctClickFarming.getStatus())) { - return Dto.getInstance(ErrorCodeEnum.ERROR_DEL_CLICKFARMING_INFO); - } - - return Dto.returnResult(ctClickFarmingService.removeById(idDTO.getId())); - } - - /** - * 编辑刷单信息 - */ - @ApiOperation("编辑刷单信息") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!"), - @ApiResponse(code = 3900, message ="刷单信息不存在!") - }) - @Log(value = "编辑刷单信息",type = LogActionType.UPDATE) - @PostMapping("/edit") - @FormSubmission - public Dto editClickFarming(@Valid @RequestBody CtClickFarmingEditDTO dto) { - // 判断状态 只有待执行状态太允许修改 - CtClickFarming ctClickFarming = ctClickFarmingService.getByIdLock(dto.getId()); - if (ObjectUtil.isEmpty(ctClickFarming)) { - return Dto.getInstance(ErrorCodeEnum.ERROR_NOT_FIND_CLICKFARMING_INFO); - } - - CtClickFarming updateCtClickFarming = new CtClickFarming(); - BeanUtil.copyProperties(dto, updateCtClickFarming); - - return Dto.returnResult(ctClickFarmingService.updateById(updateCtClickFarming)); - } - - /** - * - * @param file - * @param response - * @return - * @throws Exception - */ - @ApiOperation("Excel刷单信息导入") - @ApiImplicitParams({ - @ApiImplicitParam(value = "上传文件", name = "file", dataType = "__file", required = true) - }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!") - }) - @Log(value = "Excel刷单信息导入",type = LogActionType.ADD) - @PostMapping("/import") - public Dto importClickFarming(@RequestPart("file")MultipartFile file, HttpServletResponse response) throws Exception { - - // TODO 对Excel 信息进行检测 如果不符合要求的 最终要导出错误Excel提示 - List ctClickFarmingImportList = ExcelUtils.readMultipartFile(file, CtClickFarmingImport.class); - if (ObjectUtil.isEmpty(ctClickFarmingImportList)) { - return Dto.returnResult(true); - } - - List addCtClickFarmingList = new ArrayList<>(); - List ctClickFarmingExportList = new ArrayList<>(); - - // 买家id - List buyerAccountList = ctClickFarmingImportList.stream().map(c->c.getAccount()).collect(Collectors.toList()); - Map buyerMap = ctBuyerService.getBuyerList(buyerAccountList); - - for (CtClickFarmingImport ctClickFarmingImport:ctClickFarmingImportList) { - CtClickFarmingExport ctClickFarmingExport = new CtClickFarmingExport(); - BeanUtil.copyProperties(ctClickFarmingImport, ctClickFarmingExport); - - StringBuffer errorStrBuf = new StringBuffer(); - String rowTips = ctClickFarmingImport.getRowTips(); - if (ObjectUtil.isNotEmpty(rowTips)) { - errorStrBuf.append(rowTips); - errorStrBuf.append(";"); - } - - if (ObjectUtil.isEmpty(ctClickFarmingImport.getSpecification())) { - errorStrBuf.append("规格-必填!"); - errorStrBuf.append(";"); - } - if (ObjectUtil.isEmpty(ctClickFarmingImport.getColor())) { - errorStrBuf.append("颜色-必填!"); - errorStrBuf.append(";"); - } - if (ObjectUtil.isEmpty(ctClickFarmingImport.getExchange())) { - errorStrBuf.append("优惠劵-必填!"); - errorStrBuf.append(";"); - } - - // 判断类型 - if (ParamsTypeEnum.KEY_WORD.eqValue(ctClickFarmingImport.getParamsType())) { - if (ObjectUtil.isEmpty(ctClickFarmingImport.getKeyWord())) { - errorStrBuf.append("关键词-必填!"); - errorStrBuf.append(";"); - } - if (ObjectUtil.isEmpty(ctClickFarmingImport.getTitle())) { - errorStrBuf.append("标题-必填!"); - errorStrBuf.append(";"); - } - if (ObjectUtil.isEmpty(ctClickFarmingImport.getItem())) { - errorStrBuf.append("item-必填!"); - errorStrBuf.append(";"); - } - } else { - if (ObjectUtil.isEmpty(ctClickFarmingImport.getLink())) { - errorStrBuf.append("链接-必填!"); - errorStrBuf.append(";"); - } - } - - if (ObjectUtil.isEmpty(buyerMap) || !buyerMap.containsKey(ctClickFarmingImport.getAccount())) { - errorStrBuf.append("买家信息不存在!"); - errorStrBuf.append(";"); - } else { - Long buyerId = buyerMap.entrySet().stream().collect(Collectors.toMap(entity -> entity.getKey(), entity -> entity.getValue())).get(ctClickFarmingImport.getAccount()).getId(); - ctClickFarmingImport.setBuyerId(buyerId); - } - if (ObjectUtil.isNotEmpty(errorStrBuf)) { - ctClickFarmingExport.setError(errorStrBuf.toString()); - ctClickFarmingExportList.add(ctClickFarmingExport); - } else { - CtClickFarming ctClickFarming = new CtClickFarming(); - BeanUtils.copyProperties(ctClickFarmingImport, ctClickFarming); - addCtClickFarmingList.add(ctClickFarming); - } - } - - String returnDataStr = null; - String filePath = propertiesConfig.getUploadImgPath().get(PublicConstant.EXPORT_EXCEL_FILE_TYPE); - String fileName = "刷单信息导入异常信息表-" + snowflake.nextIdStr(); - if (ObjectUtil.isNotEmpty(ctClickFarmingExportList)) { - ExcelUtils.exportFile(SystemConfig.IMG_PATH + filePath, fileName, ctClickFarmingExportList); - returnDataStr = SystemConfig.FILE_VISIT_ADDR + filePath + fileName + ".xlsx"; -// returnDataStr = "http://localhost:8008/file" + filePath + fileName + ".xlsx"; - } - - if (ObjectUtil.isNotEmpty(addCtClickFarmingList)) { - ctClickFarmingService.saveBatch(addCtClickFarmingList); - } - - return Dto.returnResult(returnDataStr); - } - - @ApiOperation("Excel刷单信息模版导出") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!") - }) - @Log(value = "Excel刷单信息模版导出") - @GetMapping("/exportTemp") - @AnonymousAccess - public void importClickFarming(HttpServletResponse response) { - ExcelUtils.exportTemplate(response, "刷单信息模版", CtClickFarmingExportTemp.class); - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/group/controller/base/CtClickOrderController.java b/wjcy-system/src/main/java/me/zhengjie/modules/group/controller/base/CtClickOrderController.java deleted file mode 100644 index fadc5d1..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/group/controller/base/CtClickOrderController.java +++ /dev/null @@ -1,330 +0,0 @@ -package me.zhengjie.modules.group.controller.base; - -import cn.hutool.core.bean.BeanUtil; -import cn.hutool.core.lang.Snowflake; -import cn.hutool.core.util.ObjectUtil; -import io.swagger.annotations.*; -import lombok.RequiredArgsConstructor; -import me.zhengjie.annotation.AnonymousAccess; -import me.zhengjie.annotation.Log; -import me.zhengjie.annotation.rest.AnonymousPostMapping; -import me.zhengjie.annotation.type.LogActionType; -import me.zhengjie.config.PropertiesConfig; -import me.zhengjie.config.SystemConfig; -import me.zhengjie.constant.Constants; -import me.zhengjie.constant.PublicConstant; -import me.zhengjie.dto.Dto; -import me.zhengjie.entity.*; -import me.zhengjie.enums.ClickFarmingStatusEnum; -import me.zhengjie.enums.OrderTypeEnum; -import me.zhengjie.error.ErrorCodeEnum; -import me.zhengjie.modules.group.dto.*; -import me.zhengjie.service.CtClickFarmingService; -import me.zhengjie.service.CtClickOrderService; -import me.zhengjie.service.CtCompanyService; -import me.zhengjie.service.vo.CtClickOrderDetailVO; -import me.zhengjie.service.vo.CtClickOrderListVO; -import me.zhengjie.utils.PageUtils; -import me.zhengjie.utils.excel.ExcelUtils; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.validation.Valid; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - - -/** - * - * @Description 群控管理-刷单信息订单 控制类 - * @Date 2022-06-22 - * @Author rch - */ -@Validated -@RequestMapping("/api/clickOrder") -@RestController -@RequiredArgsConstructor -@Api(tags = "业务:刷单订单管理") -public class CtClickOrderController { - - @Resource - private CtClickOrderService ctClickOrderService; - @Resource - private CtCompanyService ctCompanyService; - @Resource - private PropertiesConfig propertiesConfig; - @Resource - private CtClickFarmingService ctClickFarmingService; - @Resource - private Snowflake snowflake; - - /** - * 分页查询刷单订单信息 - */ - @ApiOperation("分页查询刷单订单信息") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!") - }) - @Log("分页查询刷单订单信息") - @PostMapping("/list") - @AnonymousAccess - public Dto getClickOrderList(@Valid @RequestBody CtClickOrderListDTO dto) { - PageUtils pageUtilsResult = ctClickOrderService.searchPageList(dto.getiPage(), dto.getWrapper()); - return Dto.returnResult(pageUtilsResult); - } - - /** - * 开放刷单订单接口给到ERP - * @param dto - * @return - */ - @ApiOperation("开放刷单订单接口") - @ApiImplicitParam(value = "鉴权token", name = "erpToken", paramType = "header", dataType = "String", required = true) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!"), - @ApiResponse(code = 4101, message = "鉴权信息不能为空!"), - @ApiResponse(code = 4102, message = "鉴权信息错误,请检查后重试!") - }) - @Log(value = "开放刷单订单接口") - @AnonymousPostMapping(value = "/searchClickOrder") - public Dto searchClickOrder(@Valid @RequestBody SearchOrderListDTO dto, HttpServletRequest request) { - - // 1.权限检验 - String erpToken = request.getHeader("erpToken"); - if (ObjectUtil.isEmpty(erpToken)) { - return Dto.getInstance(ErrorCodeEnum.ERROR_NOT_NULL_ERP_AUTH_TOKEN); - } - - if (!Constants.ERP_AUTH_TOKEN.equals(erpToken)) { - return Dto.getInstance(ErrorCodeEnum.ERROR_ERP_AUTH_TOKEN); - } - - // 2.根据请求条件查询记录并返回 - PageUtils pageUtilsResult = ctClickOrderService.searchPageList(dto.getiPage(), dto.getWrapper()); - return Dto.returnResult(pageUtilsResult); - } - - /** - * 根据id刷单信息详情详情 - */ - @ApiOperation("根据id刷单信息详情详情") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!") - }) - @Log("根据id刷单信息详情详情") - @PostMapping("/getById") - public Dto getCardById(@Valid @RequestBody IdDTO idDTO) { - // 获取 - CtClickOrderDetailVO ctClickOrderDetailVO = ctClickOrderService.getClickOrderDetailById(idDTO.getId()); -// if (ObjectUtil.isNotEmpty(ctClickOrderDetailVO.getPaths())) { -// List pathStrList = new ArrayList<>(); -// List pathList = Arrays.asList(ctClickOrderDetailVO.getPaths().split(",")); -// for (String path:pathList) { -//// path = "http://localhost:8008/file" + path; -// path = SystemConfig.FILE_VISIT_ADDR + path; -// pathStrList.add(path); -// } -// ctClickOrderDetailVO.setPaths(pathStrList.stream().collect(Collectors.joining(","))); -// } - return Dto.returnResult(ctClickOrderDetailVO); - } - - - /** - * 新增订单评论信息 - */ - @ApiOperation("新增订单评论信息") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!") - }) - @Log(value = "新增订单评论信息") - @PostMapping("/add") - public Dto add(@Valid @RequestBody CtClickOrderAddDto ctClickOrderAddDto) { - - // 保证仅仅 下单成功并且支付失败状态才允许执行 - - CtClickOrder addCtClickOrder = new CtClickOrder(); - addCtClickOrder.setType(OrderTypeEnum.IMPORT.value()); - BeanUtil.copyProperties(ctClickOrderAddDto, addCtClickOrder); - return Dto.returnResult(ctClickOrderService.save(addCtClickOrder)); - } - - /** - * 刷单订单导入 - */ - @ApiOperation("Excel刷单订单导入") - @ApiImplicitParams({ - @ApiImplicitParam(value = "上传文件", name = "file", dataType = "__file", required = true) - }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!") - }) - @Log(value = "Excel刷单订单导入",type = LogActionType.ADD) - @PostMapping("import") - public Dto importOrder(@RequestPart("file") MultipartFile file, HttpServletResponse response)throws Exception{ - - //TODO 对Excel 信息进行检测 如果不符合要求的 最终要导出错误Excel提示 - List ctClickOrderImportList = ExcelUtils.readMultipartFile(file, CtClickOrderImport.class); - if(ObjectUtil.isEmpty(ctClickOrderImportList)){ - return Dto.returnResult(true); - } - - List addCtClickOrderList = new ArrayList<>(); - // 订单id 唯一 - List importOrderIdList = ctClickOrderImportList.stream().map(c->c.getOrderId()).collect(Collectors.toList()); - importOrderIdList = ctClickOrderService.getOrderId(importOrderIdList); - // 判断公司信息是否存在 - List companyNameList = ctClickOrderImportList.stream().map(c->c.getCompanyName()).collect(Collectors.toList()); - Map companyNameMap = ctCompanyService.getNameList(companyNameList); - - List ctClickOrderExportList = new ArrayList<>(); - for(CtClickOrderImport ctClickOrderImport : ctClickOrderImportList) { - CtClickOrderExport ctClickOrderExport = new CtClickOrderExport(); - BeanUtil.copyProperties(ctClickOrderImport, ctClickOrderExport); - - StringBuffer errorStrBuf = new StringBuffer(); - String rowTips = ctClickOrderImport.getRowTips(); - if (ObjectUtil.isNotEmpty((rowTips))) { - errorStrBuf.append(rowTips); - errorStrBuf.append(";"); - } - - String resultStr = checkImportInfo(importOrderIdList, companyNameMap, ctClickOrderImport); - if (ObjectUtil.isNotEmpty(resultStr)) { - errorStrBuf.append(resultStr); - errorStrBuf.append(";"); - } - - Long companyNameId = companyNameMap.entrySet().stream().collect(Collectors.toMap(entity -> entity.getValue(), entity -> entity.getKey())).get(ctClickOrderImport.getCompanyName()); - ctClickOrderImport.setCompanyId(companyNameId); - if (ObjectUtil.isNotEmpty(errorStrBuf)) { - ctClickOrderExport.setError(errorStrBuf.toString()); - ctClickOrderExportList.add(ctClickOrderExport); - } else { - CtClickOrder ctClickOrder = new CtClickOrder(); - BeanUtil.copyProperties(ctClickOrderImport, ctClickOrder); - ctClickOrder.setType(OrderTypeEnum.IMPORT.value()); - addCtClickOrderList.add(ctClickOrder); - } - } - - String returnDataStr = null; - String filePath = propertiesConfig.getUploadImgPath().get(PublicConstant.EXPORT_EXCEL_FILE_TYPE); - String fileName = "刷单订单导入异常信息表-" + snowflake.nextIdStr(); - if(ObjectUtil.isNotEmpty(ctClickOrderExportList)){ - ExcelUtils.exportFile(SystemConfig.IMG_PATH + filePath, fileName, ctClickOrderExportList); - returnDataStr = SystemConfig.FILE_VISIT_ADDR + filePath + fileName + ".xlsx"; - // returnDataStr = "http://localhost:8008/file" + filePath + fileName + ".xlsx"; - } - - if(ObjectUtil.isNotEmpty(addCtClickOrderList)){ - ctClickOrderService.saveBatch(addCtClickOrderList); - } - - return Dto.returnResult(returnDataStr); - } - - - - /** - * Excel订单模版导出 - */ - @ApiOperation("Excel订单模版导出") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!") - }) - @Log(value = "Excel订单模版导出") - @GetMapping("/exportTemp") - @AnonymousAccess - public void exportVpn(HttpServletResponse response) { - ExcelUtils.exportTemplate(response, "订单导入模板", CtClickOrderExportTemple.class, true); - } - - /** - * 补录订单信息 - * 仅仅 下单成功并且支付失败状态才允许执行此接口 - */ - @ApiOperation("补录订单信息") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!"), - @ApiResponse(code = 3900, message = "刷单信息不存在!"), - @ApiResponse(code = 3903, message = "仅支付成功失败状态才允许补录!") - }) - @Log(value = "补录订单信息") - @PostMapping("/supplement") - public Dto supplementOrder(@Valid @RequestBody CtClickOrderSupplementDto ctClickOrderSupplementDto) { - - // 保证仅仅 下单成功并且支付失败状态才允许执行 - Long clickFarmingId = ctClickOrderSupplementDto.getClickFarmingId(); - CtClickFarming ctClickFarming = ctClickFarmingService.getById(clickFarmingId); - if (ObjectUtil.isEmpty(ctClickFarming)) { - return Dto.getInstance(ErrorCodeEnum.ERROR_NOT_FIND_CLICKFARMING_INFO); - } - if (!ClickFarmingStatusEnum.PAY_OK_ERROR.value().equals(ctClickFarming.getStatus())) { - return Dto.getInstance(ErrorCodeEnum.ERROR_CLICKFARMING_NOT_SUPPLEMENT); - } - - CtClickOrder ctClickOrder = new CtClickOrder(); - BeanUtil.copyProperties(ctClickOrderSupplementDto, ctClickOrder); - // 补录订单信息 - return Dto.returnResult(ctClickOrderService.supplement(clickFarmingId, ctClickOrder)); - } - - - /** - * 新增评论信息 - */ - @ApiOperation("新增评论信息") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!"), - @ApiResponse(code = 4100, message = "订单信息不存在") - }) - @Log(value = "新增评论信息") - @PostMapping("/comment") - public Dto comment(@Valid @RequestBody CtClickOrderCommentDto ctClickOrderCommentDto) { - - // 保证仅仅 下单成功并且支付失败状态才允许执行 - CtClickOrder ctClickOrder = ctClickOrderService.getById(ctClickOrderCommentDto.getId()); - if (ObjectUtil.isEmpty(ctClickOrder)) { - return Dto.getInstance(ErrorCodeEnum.ERROR_NOT_FIND_CLICK_ORDER_INFO); - } - - CtClickOrder updateCtClickOrder = new CtClickOrder(); - BeanUtil.copyProperties(ctClickOrderCommentDto, updateCtClickOrder); - return Dto.returnResult(ctClickOrderService.updateById(updateCtClickOrder)); - } - - /** - * 导入数据内容检验 - * @param importOrderIdList - * @param companyNameMap - * @param ctClickOrderImport - * @return - */ - public String checkImportInfo(List importOrderIdList, Map companyNameMap, CtClickOrderImport ctClickOrderImport) { - if (ObjectUtil.isNotEmpty(companyNameMap)) { - if (!companyNameMap.containsValue(ctClickOrderImport.getCompanyName())) { - return "对应名称的公司不存在!"; - } - } else if(ObjectUtil.isNotEmpty(ctClickOrderImport)) { - if (importOrderIdList.contains(ctClickOrderImport.getOrderId())) { - return "该笔订单已存在!"; - } - } - return null; - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/group/controller/base/CtCompanyController.java b/wjcy-system/src/main/java/me/zhengjie/modules/group/controller/base/CtCompanyController.java deleted file mode 100644 index 88fa0fb..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/group/controller/base/CtCompanyController.java +++ /dev/null @@ -1,187 +0,0 @@ -package me.zhengjie.modules.group.controller.base; - -import cn.hutool.core.bean.BeanUtil; -import cn.hutool.core.util.ObjectUtil; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import me.zhengjie.annotation.FormSubmission; -import me.zhengjie.annotation.Log; -import me.zhengjie.annotation.type.LogActionType; -import me.zhengjie.dto.Dto; -import me.zhengjie.entity.CtBuyer; -import me.zhengjie.entity.CtCompany; -import me.zhengjie.entity.CtOrder; -import me.zhengjie.error.ErrorCodeEnum; -import me.zhengjie.modules.group.dto.CtCompanyAddDTO; -import me.zhengjie.modules.group.dto.CtCompanyListDTO; -import me.zhengjie.modules.group.dto.CtCompanyUpdateDTO; -import me.zhengjie.modules.group.dto.IdDTO; -import me.zhengjie.service.CtCompanyService; -import me.zhengjie.service.CtOrderService; -import me.zhengjie.service.vo.CtCompanyInfoVO; -import me.zhengjie.service.vo.CtCompanyVO; -import me.zhengjie.utils.PageUtils; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import javax.validation.Valid; -import java.util.ArrayList; -import java.util.List; - - -/** - * - * @Description 群控管理-公司 控制类 - * @Date 2022-06-23 - * @Author rch - */ -@Validated -@RequestMapping("/api/ctCompany") -@RestController -@Api(tags = "业务:公司信息管理") -public class CtCompanyController { - - @Resource - private CtCompanyService ctCompanyService; - @Resource - private CtOrderService ctOrderService; - - /** - * 分页查询公司信息 - */ - @ApiOperation("分页查询公司信息") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!") - }) - @Log("分页查询公司信息") - @PostMapping("/list") - public Dto getCompanyList(@Valid @RequestBody CtCompanyListDTO dto) { - IPage page = ctCompanyService.page(dto.getiPage(), dto.getWrapper()); - List list = new ArrayList<>(); - for (CtCompany record : page.getRecords()) { - CtCompanyVO ctCompanyVO = new CtCompanyVO(); - BeanUtil.copyProperties(record, ctCompanyVO); - list.add(ctCompanyVO); - } - PageUtils pageUtils = new PageUtils(page.getTotal(),list); - return Dto.returnResult(pageUtils); - } - - /** - * 新增公司信息 - */ - @ApiOperation("新增公司信息") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!") - }) - @Log(value = "新增公司信息",type = LogActionType.ADD) - @PostMapping("/add") - @FormSubmission - public Dto addCompany(@Valid @RequestBody CtCompanyAddDTO dto) { - CtCompany ctCompany = new CtCompany(); - BeanUtil.copyProperties(dto, ctCompany); - - // TODO 商户码(公司调用api公司唯一标识) -按照一定规则生成 - ctCompany.setNumber("666666"); - // TODO 商户token(公司调用api公司token身份标识)-按照一定规则生成 - ctCompany.setToken("7777777"); - return Dto.returnResult(ctCompanyService.save(ctCompany)); - } - - /** - * 根据id公司信息详情 - */ - @ApiOperation("根据id公司信息详情") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!") - }) - @Log("根据id公司信息详情详情") - @PostMapping("/getById") - public Dto getCompanyById(@Valid @RequestBody IdDTO idDTO) { - return Dto.returnResult(ctCompanyService.getById(idDTO.getId())); - } - - /** - * 编辑公司信息 - */ - @ApiOperation("编辑公司信息") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!"), - @ApiResponse(code = 3300, message = "公司信息不存在!") - }) - @Log(value = "编辑公司信息",type = LogActionType.UPDATE) - @PostMapping("/edit") - @FormSubmission - public Dto editCompany(@Valid @RequestBody CtCompanyUpdateDTO dto) { - - // TODO 检验平台ID和平台名称是否一致 - - // 根据id 判断是否存在 - CtCompany ctCompany = ctCompanyService.getById(dto.getId()); - if (ObjectUtil.isEmpty(ctCompany)) { - return Dto.getInstance(ErrorCodeEnum.ERROR_NOT_FIND_COMPANY); - } - - CtCompany updateCtCompany = new CtCompany(); - BeanUtil.copyProperties(dto, updateCtCompany); - return Dto.returnResult(ctCompanyService.updateById(updateCtCompany)); - } - - /** - * 根据id删除公司信息 - * @author: rch - */ - @ApiOperation("根据id删除公司信息") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!"), - @ApiResponse(code = 3201, message = "该公司下存在订单信息,不允许删除!") - }) - @Log(value = "根据id删除公司信息",type = LogActionType.DELETE) - @PostMapping("/delete") - public Dto delCompany(@Valid @RequestBody IdDTO idDTO) { - // 判断公司下存在订单信息则不允许删除 - QueryWrapper ctOrderQueryWrapper = new QueryWrapper<>(); - ctOrderQueryWrapper.eq("company_id", idDTO.getId()); - Integer count = ctOrderService.count(ctOrderQueryWrapper); - if (ObjectUtil.isNotEmpty(count) && count > 0) { - return Dto.getInstance(ErrorCodeEnum.ERROR_EXITS_CT_ORDER_INFO); - } - - return Dto.returnResult(ctCompanyService.removeById(idDTO.getId())); - } - - /** - * 获取所有公司信息 (公司id 公司名称) - * 为新增 公司提供公司所属公司服务 - * @return - */ - @ApiOperation("获取所有公司信息") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!") - }) - @Log(value = "获取所有公司信息") - @GetMapping("/getAll") - public Dto allCompany() { - List ctCompanyList = ctCompanyService.list(); - List ctCompanyInfoVOList = new ArrayList<>(); - if (ObjectUtil.isNotEmpty(ctCompanyList)) { - for (CtCompany ctCompany:ctCompanyList) { - CtCompanyInfoVO ctCompanyInfoVO = new CtCompanyInfoVO(); - BeanUtil.copyProperties(ctCompany, ctCompanyInfoVO); - ctCompanyInfoVOList.add(ctCompanyInfoVO); - } - } - return Dto.returnResult(ctCompanyInfoVOList); - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/group/controller/base/CtDhPayController.java b/wjcy-system/src/main/java/me/zhengjie/modules/group/controller/base/CtDhPayController.java deleted file mode 100644 index 1fbf0b9..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/group/controller/base/CtDhPayController.java +++ /dev/null @@ -1,300 +0,0 @@ -package me.zhengjie.modules.group.controller.base; - -import cn.hutool.core.bean.BeanUtil; -import cn.hutool.core.lang.Snowflake; -import cn.hutool.core.util.ObjectUtil; -import com.alibaba.fastjson.JSON; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.qiniu.util.Json; -import io.swagger.annotations.*; -import lombok.RequiredArgsConstructor; -import me.zhengjie.annotation.AnonymousAccess; -import me.zhengjie.annotation.FormSubmission; -import me.zhengjie.annotation.Log; -import me.zhengjie.annotation.type.LogActionType; -import me.zhengjie.config.PropertiesConfig; -import me.zhengjie.config.SystemConfig; -import me.zhengjie.constant.PublicConstant; -import me.zhengjie.dto.Dto; -import me.zhengjie.entity.CtDhPay; -import me.zhengjie.entity.CtDhPayExport; -import me.zhengjie.entity.CtDhPayExportTemple; -import me.zhengjie.entity.CtDhPayImport; -import me.zhengjie.enums.DhPayStatusEnum; -import me.zhengjie.error.ErrorCodeEnum; -import me.zhengjie.modules.group.dto.CtDhPayAddDTO; -import me.zhengjie.modules.group.dto.CtDhPayListDTO; -import me.zhengjie.modules.group.dto.IdDTO; -import me.zhengjie.service.CtDhPayService; -import me.zhengjie.service.vo.CtDhPayDetailVO; -import me.zhengjie.service.vo.CtDhPayListVO; -import me.zhengjie.utils.PageUtils; -import me.zhengjie.utils.excel.ExcelUtils; -import org.springframework.beans.BeanUtils; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; -import javax.validation.Valid; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.regex.Pattern; -import java.util.stream.Collectors; - - -/** - * @Description 群控管理-敦煌支付 控制类 - * @Date 2022-06-22 - * @Author rch - */ -@Validated -@RequestMapping("/api/dhPay") -@RestController -@RequiredArgsConstructor -@Api(tags = "业务:敦煌支付管理") -public class CtDhPayController { - - @Resource - private PropertiesConfig propertiesConfig; - @Resource - private Snowflake snowflake; - @Resource - private CtDhPayService ctDhPayService; - - /** - * 分页查询敦煌支付信息 - */ - @ApiOperation("分页查询敦煌支付信息") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!") - }) - @Log("分页查询敦煌支付信息") - @PostMapping("/list") - @AnonymousAccess - public Dto getDhPayList(@Valid @RequestBody CtDhPayListDTO dto) { - PageUtils pageUtilsResult = ctDhPayService.searchPageList(dto.getiPage(), dto.getWrapper()); - return Dto.returnResult(pageUtilsResult); - } - - /** - * 新增敦煌支付信息 - */ - @ApiOperation("新增敦煌支付信息") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!") - }) - @Log(value = "新增敦煌支付信息", type = LogActionType.ADD) - @PostMapping("/add") - @AnonymousAccess - @FormSubmission - public Dto addDhPay(@Valid @RequestBody CtDhPayAddDTO dto) { - List ctCardList = new ArrayList<>(); - List errCtDhPay = new ArrayList<>(); - String orderIdListStr = dto.getOrderId(); - String[] orderIdList = orderIdListStr.split(","); - List allCtDhPay = ctDhPayService.list(); - for (String orderId : orderIdList) { - CtDhPay ctDhPay = new CtDhPay(); - ctDhPay.setBuyerName(dto.getBuyerName()); - ctDhPay.setOrderId(orderId); - - // TODO 剔除已经存在的 同导入逻辑的检验 - List anyMatchList = allCtDhPay.stream().filter(d -> d.getBuyerName().equals(ctDhPay.getBuyerName()) && d.getOrderId().equals(ctDhPay.getOrderId())).collect(Collectors.toList()); - if (ObjectUtil.isNotEmpty(anyMatchList)) { - errCtDhPay.add(ctDhPay); - } else { - ctCardList.add(ctDhPay); - } - } - if (ObjectUtil.isNotEmpty(errCtDhPay)) { - StringBuffer errStrBuffer = new StringBuffer(); - errStrBuffer.append("该买家对应的订单编号"); - for (int i = 0; i < errCtDhPay.size(); i++) { - CtDhPay errPay = errCtDhPay.get(i); - if (i != 0) { - errStrBuffer.append("、"); - } - errStrBuffer.append(errPay.getOrderId()); - } - errStrBuffer.append("存在重复信息,新增失败"); - if (ObjectUtil.isNotEmpty(ctCardList)) { - ctDhPayService.saveBatch(ctCardList); - } - return Dto.returnErrorResult(errStrBuffer.toString()); - } else { - if (ObjectUtil.isNotEmpty(ctCardList)) { - return Dto.returnResult(ctDhPayService.saveBatch(ctCardList)); - } - } - return Dto.returnResult(true); - } - - /** - * 根据id敦煌支付信息 - */ - @ApiOperation("根据id敦煌支付信息") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!") - }) - @Log("根据id敦煌支付信息") - @PostMapping("/getById") - @AnonymousAccess - public Dto getDhPayById(@Valid @RequestBody IdDTO idDTO) { - return Dto.returnResult(ctDhPayService.getById(idDTO.getId())); - } - - - /** - * 根据id删除敦煌支付信息 - * - * @author: rch - */ - @ApiOperation("根据id删除敦煌支付信息") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!"), - @ApiResponse(code = 3800, message = "敦煌支付信息不存在,或已删除!") - }) - @Log(value = "根据id删除敦煌支付信息", type = LogActionType.DELETE) - @PostMapping("/delete") - @AnonymousAccess - public Dto delDhPay(@Valid @RequestBody IdDTO idDTO) { - - // 先查询 - CtDhPay ctDhPay = ctDhPayService.getById(idDTO.getId()); - if (ObjectUtil.isEmpty(ctDhPay) || DhPayStatusEnum.DEL.eqValue(ctDhPay.getStatus())) { - return Dto.getInstance(ErrorCodeEnum.ERROR_DH_PAY_NOT_FIND_OR_SUCCESS); - } - - CtDhPay updateCtDhPay = new CtDhPay(); - updateCtDhPay.setId(idDTO.getId()); - updateCtDhPay.setStatus(DhPayStatusEnum.DEL.value()); - - return Dto.returnResult(ctDhPayService.updateById(updateCtDhPay)); - } - - - /** - * Excel敦煌支付信息导入 - * @param file - * @param response - * @return - * @throws Exception - */ - @ApiOperation("Excel敦煌支付信息导入") - @ApiImplicitParams({ - @ApiImplicitParam(value = "上传文件", name = "file", dataType = "__file", required = true) - }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!") - }) - @Log(value = "Excel敦煌支付信息导入", type = LogActionType.ADD) - @PostMapping("/import") - public Dto importCard(@RequestPart("file") MultipartFile file, HttpServletResponse response) throws Exception { - - // TODO 对Excel 信息进行检测 如果不符合要求的 最终要导出错误Excel提示 - List ctDhPayImportList = ExcelUtils.readMultipartFile(file, CtDhPayImport.class); - if (ObjectUtil.isEmpty(ctDhPayImportList)) { - return Dto.returnResult(true); - } - - List addCtDhPayList = new ArrayList<>(); - List errCtDhPayList = new ArrayList<>(); - List ctDhPayExportList = new ArrayList<>(); - - List buyerNameList = ctDhPayImportList.stream().map(CtDhPayImport::getBuyerName).collect(Collectors.toList()); - List orderIdList = ctDhPayImportList.stream().map(CtDhPayImport::getOrderId).collect(Collectors.toList()); - - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.in("buyer_name", buyerNameList); - queryWrapper.or(); - queryWrapper.in("order_id", orderIdList); - List queryCtDhPay = ctDhPayService.list(queryWrapper); - - for (CtDhPayImport ctDhPayImport : ctDhPayImportList) { - CtDhPayExport ctDhPayExport = new CtDhPayExport(); - BeanUtil.copyProperties(ctDhPayImport, ctDhPayExport); - StringBuffer errorStrBuf = new StringBuffer(); - String rowTips = ctDhPayImport.getRowTips(); - if (ObjectUtil.isNotEmpty(rowTips)) { - errorStrBuf.append(rowTips); - errorStrBuf.append(";"); - } - //判断订单号是否按照规格输入 - String regex = "^[0-9]+(,[0-9]+)*$"; - if (!Pattern.matches(regex, ctDhPayImport.getOrderId())) { - errorStrBuf.append("订单编号格式输入错误,请重新输入"); - } else { - String[] orderIdArr = ctDhPayImport.getOrderId().split(","); - for (String orderId : orderIdArr) { - CtDhPay ctDhPay = new CtDhPay(); - ctDhPay.setBuyerName(ctDhPayImport.getBuyerName()); - ctDhPay.setOrderId(orderId); - - List anyMatchList = queryCtDhPay.stream().filter(d -> d.getBuyerName().equals(ctDhPay.getBuyerName()) && d.getOrderId().equals(ctDhPay.getOrderId())).collect(Collectors.toList()); - if (ObjectUtil.isNotEmpty(anyMatchList)) { - errCtDhPayList.add(ctDhPay); - } else { - addCtDhPayList.add(ctDhPay); - } - } - if (ObjectUtil.isNotEmpty(errCtDhPayList)) { - errorStrBuf.append("该买家对应的订单编号"); - for (int i = 0; i < errCtDhPayList.size(); i++) { - CtDhPay errPay = errCtDhPayList.get(i); - if (i != 0) { - errorStrBuf.append("、"); - } - errorStrBuf.append(errPay.getOrderId()); - } - errorStrBuf.append("存在重复信息,新增失败"); - } - } - - if (ObjectUtil.isNotEmpty(errorStrBuf)) { - ctDhPayExport.setError(errorStrBuf.toString()); - ctDhPayExportList.add(ctDhPayExport); - } - } - - String returnDataStr = null; - String filePath = propertiesConfig.getUploadImgPath().get(PublicConstant.EXPORT_EXCEL_FILE_TYPE); - String fileName = "敦煌支付导入异常信息表-" + snowflake.nextIdStr(); - if (ObjectUtil.isNotEmpty(ctDhPayExportList)) { - ExcelUtils.exportFile(SystemConfig.IMG_PATH + filePath, fileName, ctDhPayExportList); - returnDataStr = SystemConfig.FILE_VISIT_ADDR + filePath + fileName + ".xlsx"; - //returnDataStr = "http://localhost:8008/file" + filePath + fileName + ".xlsx"; - } - - //拆分订单编号,分多条数据存入 - if (ObjectUtil.isNotEmpty(addCtDhPayList)) { - ctDhPayService.saveBatch(addCtDhPayList); - } - - return Dto.returnResult(returnDataStr); - } - - - /** - * Excel敦煌支付信息模版导出 - * @param response - */ - @ApiOperation("Excel敦煌支付信息模版导出") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!") - }) - @Log(value = "Excel敦煌支付信息模版导出") - @GetMapping("/exportTemp") - @AnonymousAccess - public void importCard(HttpServletResponse response) { - ExcelUtils.exportTemplate(response, "敦煌支付模版", CtDhPayExportTemple.class); - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/group/controller/base/CtExcelController.java b/wjcy-system/src/main/java/me/zhengjie/modules/group/controller/base/CtExcelController.java deleted file mode 100644 index eaf3575..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/group/controller/base/CtExcelController.java +++ /dev/null @@ -1,157 +0,0 @@ -package me.zhengjie.modules.group.controller.base; - -import cn.hutool.core.bean.BeanUtil; -import cn.hutool.core.util.ObjectUtil; -import com.baomidou.mybatisplus.core.metadata.IPage; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import me.zhengjie.annotation.AnonymousAccess; -import me.zhengjie.annotation.FormSubmission; -import me.zhengjie.annotation.Log; -import me.zhengjie.annotation.type.LogActionType; -import me.zhengjie.dto.Dto; -import me.zhengjie.entity.CtBuyer; -import me.zhengjie.entity.CtExcel; -import me.zhengjie.entity.CtExcelExportTemple; -import me.zhengjie.error.ErrorCodeEnum; -import me.zhengjie.modules.group.dto.CtExcelAddDTO; -import me.zhengjie.modules.group.dto.CtExcelListDTO; -import me.zhengjie.modules.group.dto.CtExcelUpdateDTO; -import me.zhengjie.modules.group.dto.IdDTO; -import me.zhengjie.service.CtExcelService; -import me.zhengjie.service.vo.CtExcelVO; -import me.zhengjie.utils.PageUtils; -import me.zhengjie.utils.excel.ExcelUtils; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; -import javax.validation.Valid; -import java.util.ArrayList; -import java.util.List; - - -/** - * - * @Description Excel相关操作 控制类 - * @Date 2022-06-22 - * @Author rch - */ -@Validated -@RequestMapping("/api/ctExcel") -@RestController -@Api(tags = "业务:Excel管理") -public class CtExcelController { - - @Resource - private CtExcelService ctExcelService; - - /** - * 分页查询Excel信息 - */ - @ApiOperation("分页查询Excel信息") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!") - }) - @Log("分页查询Excel信息") - @PostMapping("/list") - public Dto getExcelList(@Valid @RequestBody CtExcelListDTO dto) { - IPage page = ctExcelService.page(dto.getiPage(), dto.getWrapper()); - List list = new ArrayList<>(); - for (CtExcel record : page.getRecords()) { - CtExcelVO ctExcelVO = new CtExcelVO(); - BeanUtil.copyProperties(record, ctExcelVO); - list.add(ctExcelVO); - } - PageUtils pageUtils = new PageUtils(page.getTotal(),list); - return Dto.returnResult(pageUtils); - } - - /** - * 新增Excel信息 - */ - @ApiOperation("新增Excel信息") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!") - }) - @Log(value = "新增导入Excel信息",type = LogActionType.ADD) - @PostMapping("/add") - @FormSubmission - public Dto addExcel(@Valid @RequestBody CtExcelAddDTO dto) { - CtExcel ctExcel = new CtExcel(); - BeanUtil.copyProperties(dto, ctExcel); - return Dto.returnResult(ctExcelService.save(ctExcel)); - } - - /** - * 根据id获取Excel信息 - */ - @ApiOperation("根据id获取Excel信息") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!") - }) - @Log("根据id获取Excel信息") - @PostMapping("/getById") - public Dto getExcelById(@Valid @RequestBody IdDTO idDTO) { - return Dto.returnResult(ctExcelService.getById(idDTO.getId())); - } - - /** - * 编辑Excel信息 - */ - @ApiOperation("编辑Excel信息") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!"), - @ApiResponse(code = 3100, message = "卖家信息不存在!") - }) - @Log(value = "编辑Excel信息",type = LogActionType.UPDATE) - @PostMapping("/edit") - @FormSubmission - public Dto editExcel(@Valid @RequestBody CtExcelUpdateDTO dto) { - // 根据id 判断是否存在 - CtExcel ctExcel = ctExcelService.getById(dto.getId()); - if (ObjectUtil.isEmpty(ctExcel)) { - return Dto.getInstance(ErrorCodeEnum.ERROR_NOT_FIND_EXCEL_USER); - } - - CtExcel updateCtExcel = new CtExcel(); - BeanUtil.copyProperties(dto, updateCtExcel); - return Dto.returnResult(ctExcelService.updateById(updateCtExcel)); - } - - /** - * 根据id删除Excel信息 - * @author: rch - */ - @ApiOperation("根据id删除Excel信息") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!") - }) - @Log(value = "根据id删除Excel信息",type = LogActionType.DELETE) - @PostMapping("/delete") - public Dto delExcel(@Valid @RequestBody IdDTO idDTO) { - return Dto.returnResult(ctExcelService.removeById(idDTO.getId())); - } - - /** - * Excel模板下载 - */ - @ApiOperation("Excel模板下载") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!") - }) - @Log(value = "Excel模板下载") - @GetMapping("/exportTemp") - public void importExcel(HttpServletResponse response){ - ExcelUtils.exportTemplate(response, "Excel导入模板", CtExcelExportTemple.class); - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/group/controller/base/CtExcelInfoController.java b/wjcy-system/src/main/java/me/zhengjie/modules/group/controller/base/CtExcelInfoController.java deleted file mode 100644 index 9606354..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/group/controller/base/CtExcelInfoController.java +++ /dev/null @@ -1,120 +0,0 @@ -package me.zhengjie.modules.group.controller.base; - -import cn.hutool.core.bean.BeanUtil; -import com.baomidou.mybatisplus.core.metadata.IPage; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import me.zhengjie.annotation.Log; -import me.zhengjie.dto.Dto; -import me.zhengjie.entity.CtBuyer; -import me.zhengjie.entity.CtExcelImportInfo; -import me.zhengjie.modules.group.dto.CtExcelImportInfoListDTO; -import me.zhengjie.modules.group.dto.IdDTO; -import me.zhengjie.service.CtExcelImportInfoService; -import me.zhengjie.service.vo.CtExcelImportInfoVO; -import me.zhengjie.utils.PageUtils; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import javax.annotation.Resource; -import javax.validation.Valid; -import java.util.ArrayList; -import java.util.List; - - -/** - * - * @Description Excel导入信息相关操作 控制类 - * @Date 2022-06-22 - * @Author rch - */ -@Validated -@RequestMapping("/api/ctExcelInfo") -@RestController -@Api(tags = "业务:Excel导入信息管理") -public class CtExcelInfoController { - - @Resource - private CtExcelImportInfoService ctExcelImportInfoService; - - /** - * 分页查询ExcelInfo信息 - */ - @ApiOperation("分页查询ExcelInfo信息") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!") - }) - @Log("分页查询ExcelInfo信息") - @PostMapping("/list") - public Dto getExcelInfoList(@Valid @RequestBody CtExcelImportInfoListDTO dto) { - IPage page = ctExcelImportInfoService.page(dto.getiPage(), dto.getWrapper()); - List list = new ArrayList<>(); - for (CtExcelImportInfo record : page.getRecords()) { - CtExcelImportInfoVO ctExcelImportInfoVO = new CtExcelImportInfoVO(); - BeanUtil.copyProperties(record, ctExcelImportInfoVO); - list.add(ctExcelImportInfoVO); - } - PageUtils pageUtils = new PageUtils(page.getTotal(),list); - return Dto.returnResult(pageUtils); - } - - - /** - * 根据id获取ExcelInfo信息 - */ - @ApiOperation("根据id获取ExcelInfo信息") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!") - }) - @Log("根据id获取ExcelInfo信息") - @PostMapping("/getById") - public Dto getExcelInfoById(@Valid @RequestBody IdDTO idDTO) { - return Dto.returnResult(ctExcelImportInfoService.getById(idDTO.getId())); - } - -// /** -// * 新增Excel信息 -// */ -// @Log(value = "新增导入Excel信息",type = LogActionType.ADD) -// @PostMapping("/add") -// public Dto addExcelInfo(@Valid @RequestBody CtExcelAddDTO dto) { -// CtExcel ctExcel = new CtExcel(); -// BeanUtil.copyProperties(dto, ctExcel); -// return Dto.returnResult(ctExcelService.save(ctExcel)); -// } - - -// /** -// * 编辑Excel信息 -// */ -// @Log(value = "编辑Excel信息",type = LogActionType.UPDATE) -// @PostMapping("/edit") -// public Dto editExcelInfo(@Valid @RequestBody CtExcelUpdateDTO dto) { -// // 根据id 判断是否存在 -// CtExcel ctExcel = ctExcelService.getById(dto.getId()); -// if (ObjectUtil.isEmpty(ctExcel)) { -// Dto.getInstance(ErrorCodeEnum.ERROR_NOT_FIND_EXCEL_USER); -// } -// -// CtExcel updateCtExcel = new CtExcel(); -// BeanUtil.copyProperties(dto, updateCtExcel); -// return Dto.returnResult(ctExcelService.updateById(updateCtExcel)); -// } - -// /** -// * 根据id删除Excel信息 -// * @author: rch -// */ -// @Log(value = "根据id删除Excel信息",type = LogActionType.DELETE) -// @PostMapping("/delete") -// public Dto delExcelInfo(@Valid @RequestBody IdDTO idDTO) { -// return Dto.returnResult(ctExcelService.removeById(idDTO.getId())); -// } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/group/controller/base/CtOrderController.java b/wjcy-system/src/main/java/me/zhengjie/modules/group/controller/base/CtOrderController.java deleted file mode 100644 index 26e7b31..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/group/controller/base/CtOrderController.java +++ /dev/null @@ -1,165 +0,0 @@ -package me.zhengjie.modules.group.controller.base; - -import cn.hutool.core.bean.BeanUtil; -import cn.hutool.core.util.ObjectUtil; -import cn.hutool.json.JSONUtil; -import com.baomidou.mybatisplus.core.metadata.IPage; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import me.zhengjie.annotation.Log; -import me.zhengjie.dto.Dto; -import me.zhengjie.entity.*; -import me.zhengjie.modules.group.dto.CtOrderListDTO; -import me.zhengjie.modules.group.dto.IdDTO; -import me.zhengjie.service.CtOrderService; -import me.zhengjie.service.CtResponseOrderAddressService; -import me.zhengjie.service.CtResponseOrderProductService; -import me.zhengjie.service.CtResponseOrderService; -import me.zhengjie.service.vo.CtOrderVO; -import me.zhengjie.service.vo.OrderResponStatusVO; -import me.zhengjie.service.vo.PayOrderVO; -import me.zhengjie.utils.PageUtils; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import javax.annotation.Resource; -import javax.validation.Valid; -import java.util.ArrayList; -import java.util.List; - - -/** - * - * @Description 群控管理- 敦煌下订单信息 控制类 - * @Date 2022-06-30 - * @Author rch - */ -@Validated -@RequestMapping("/api/dhOrder") -@RestController -@Api(tags = "业务:敦煌下单管理") -public class CtOrderController { - - @Resource - private CtOrderService ctOrderService; - @Resource - private CtResponseOrderService ctResponseOrderService; - @Resource - private CtResponseOrderAddressService ctResponseOrderAddressService; - @Resource - private CtResponseOrderProductService ctResponseOrderProductService; - - /** - * 分页查询敦煌下订单信息 - */ - @ApiOperation("分页查询敦煌下订单信息") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!") - }) - @Log("分页查询敦煌下订单信息") - @PostMapping("/list") - public Dto getOrderList(@Valid @RequestBody CtOrderListDTO dto) { - IPage page = ctOrderService.page(dto.getiPage(), dto.getWrapper()); - List list = new ArrayList<>(); - for (CtOrder record : page.getRecords()) { - CtOrderVO ctOrderVO = new CtOrderVO(); - BeanUtil.copyProperties(record, ctOrderVO); - - // 下单状态转换 - OrderResponStatusVO orderResponStatusVO = JSONUtil.toBean(record.getOrderResponseStatus(), OrderResponStatusVO.class); - ctOrderVO.setOrderResponseStatus(orderResponStatusVO); - // 支付状态转换 - PayOrderVO payOrderVO = JSONUtil.toBean(record.getPayResponseStatus(), PayOrderVO.class); - ctOrderVO.setPayOrderVO(payOrderVO); - - list.add(ctOrderVO); - } - PageUtils pageUtils = new PageUtils(page.getTotal(),list); - return Dto.returnResult(pageUtils); - } - - /** - * 根据id获取敦煌下订单 - */ - @ApiOperation("根据id获取敦煌下订单") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!") - }) - @Log("根据id获取敦煌下订单") - @PostMapping("/getById") - public Dto getOrderById(@Valid @RequestBody IdDTO idDTO) { - CtOrder ctOrder = ctOrderService.getById(idDTO.getId()); - if (ObjectUtil.isEmpty(ctOrder)) { - return Dto.returnResult(ctOrder); - } - CtOrderVO ctOrderVO = new CtOrderVO(); - BeanUtil.copyProperties(ctOrder, ctOrderVO); - - // 下单状态转换 - OrderResponStatusVO orderResponStatusVO = JSONUtil.toBean(ctOrder.getOrderResponseStatus(), OrderResponStatusVO.class); - ctOrderVO.setOrderResponseStatus(orderResponStatusVO); - // 支付状态转换 - PayOrderVO payOrderVO = JSONUtil.toBean(ctOrder.getPayResponseStatus(), PayOrderVO.class); - ctOrderVO.setPayOrderVO(payOrderVO); - - return Dto.returnResult(ctOrderVO); - } - - - - /** - * 根据id敦煌响应订单信息 - * @param idDTO - * @return - */ - @ApiOperation("根据id敦煌响应订单信息") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!") - }) - @Log("根据id敦煌响应订单信息") - @PostMapping("/getOrderInfoById") - public Dto getOrderInfoById(@Valid @RequestBody IdDTO idDTO) { - return Dto.returnResult(ctResponseOrderService.getById(idDTO.getId())); - } - - - /** - * 根据id敦煌订单收件信息 - * @param idDTO - * @return - */ - @ApiOperation("根据id敦煌订单收件信息") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!") - }) - @Log("根据id敦煌订单收件信息") - @PostMapping("/getOrderAddressById") - public Dto getOrderAddressById(@Valid @RequestBody IdDTO idDTO) { - return Dto.returnResult(ctResponseOrderAddressService.getById(idDTO.getId())); - } - - /** - * 根根据id敦煌订单产品信息 - * @param idDTO - * @return - */ - @ApiOperation("根据id敦煌订单产品信息") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!") - }) - @Log("根据id敦煌订单产品信息") - @PostMapping("/getOrderProductById") - public Dto getOrderProductById(@Valid @RequestBody IdDTO idDTO) { - return Dto.returnResult(ctResponseOrderProductService.getById(idDTO.getId())); - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/group/controller/base/CtPlatformController.java b/wjcy-system/src/main/java/me/zhengjie/modules/group/controller/base/CtPlatformController.java deleted file mode 100644 index f78a278..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/group/controller/base/CtPlatformController.java +++ /dev/null @@ -1,136 +0,0 @@ -//package me.zhengjie.modules.group.controller; -// -//import cn.hutool.core.bean.BeanUtil; -//import cn.hutool.core.util.ObjectUtil; -//import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -//import com.baomidou.mybatisplus.core.metadata.IPage; -//import me.zhengjie.annotation.Log; -//import me.zhengjie.annotation.type.LogActionType; -//import me.zhengjie.dto.Dto; -//import me.zhengjie.entity.CtBuyer; -//import me.zhengjie.entity.CtCompany; -//import me.zhengjie.entity.CtPlatform; -//import me.zhengjie.error.ErrorCodeEnum; -//import me.zhengjie.modules.group.dto.*; -//import me.zhengjie.service.CtCompanyService; -//import me.zhengjie.service.CtPlatformService; -//import me.zhengjie.service.vo.CtPlatformInfoVO; -//import me.zhengjie.service.vo.CtPlatformVO; -//import me.zhengjie.utils.PageUtils; -//import org.springframework.context.annotation.Bean; -//import org.springframework.validation.annotation.Validated; -//import org.springframework.web.bind.annotation.*; -// -//import javax.annotation.Resource; -//import javax.validation.Valid; -//import java.util.ArrayList; -//import java.util.List; -// -// -///** -// * -// * @Description 群控管理-平台 控制类 -// * @Date 2022-06-23 -// * @Author rch -// */ -//@Validated -//@RequestMapping("/api/ctPlatform") -//@RestController -//public class CtPlatformController { -// -// @Resource -// private CtPlatformService ctPlatformService; -// @Resource -// private CtCompanyService ctCompanyService; -// -// /** -// * 分页查询平台信息 -// */ -// @Log("分页查询平台信息") -// @PostMapping("/list") -// public Dto getPlatformList(@Valid @RequestBody CtPlatformListDTO dto) { -// IPage page = ctPlatformService.page(dto.getiPage(), dto.getWrapper()); -// List list = new ArrayList<>(); -// for (CtPlatform record : page.getRecords()) { -// CtPlatformVO ctPlatformVO = new CtPlatformVO(); -// BeanUtil.copyProperties(record, ctPlatformVO); -// list.add(ctPlatformVO); -// } -// PageUtils pageUtils = new PageUtils(page.getTotal(),list); -// return Dto.returnResult(pageUtils); -// } -// -// /** -// * 新增平台信息 -// */ -// @Log(value = "新增平台信息",type = LogActionType.ADD) -// @PostMapping("/add") -// public Dto addPlatform(@Valid @RequestBody CtPlatformAddDTO dto) { -// CtPlatform ctPlatform = new CtPlatform(); -// BeanUtil.copyProperties(dto, ctPlatform); -// return Dto.returnResult(ctPlatformService.save(ctPlatform)); -// } -// -// /** -// * 根据id平台信息详情详情 -// */ -// @Log("根据id平台信息详情详情") -// @PostMapping("/getById") -// public Dto getPlatformById(@Valid @RequestBody IdDTO idDTO) { -// return Dto.returnResult(ctPlatformService.getById(idDTO.getId())); -// } -// -// /** -// * 编辑平台信息 -// */ -// @Log(value = "编辑平台信息",type = LogActionType.UPDATE) -// @PostMapping("/edit") -// public Dto editPlatform(@Valid @RequestBody CtBuyerUpdateDTO dto) { -// // 根据id 判断是否存在 -// CtPlatform ctPlatform = ctPlatformService.getById(dto.getId()); -// if (ObjectUtil.isEmpty(ctPlatform)) { -// Dto.getInstance(ErrorCodeEnum.ERROR_NOT_FIND_BUYER_USER); -// } -// -// CtPlatform updateCtPlatform = new CtPlatform(); -// BeanUtil.copyProperties(dto, updateCtPlatform); -// return Dto.returnResult(ctPlatformService.updateById(updateCtPlatform)); -// } -// -// /** -// * 根据id删除平台信息 -// * @author: rch -// */ -// @Log(value = "根据id删除平台信息",type = LogActionType.DELETE) -// @PostMapping("/delete") -// public Dto delPlatform(@Valid @RequestBody IdDTO idDTO) { -// // 判断平台下有公司则不允许删除 -// QueryWrapper ctCompanyQueryWrapper = new QueryWrapper<>(); -// ctCompanyQueryWrapper.eq("platform_id", idDTO.getId()); -// Integer count = ctCompanyService.count(ctCompanyQueryWrapper); -// if (ObjectUtil.isNotEmpty(count) && count > 0) { -// Dto.getInstance(ErrorCodeEnum.ERROR_EXITS_COMPANY_INFO); -// } -// return Dto.returnResult(ctPlatformService.removeById(idDTO.getId())); -// } -// -// /** -// * 获取所有平台信息 (平台id 平台名称) -// * 为新增 公司提供公司所属平台服务 -// * @return -// */ -// @Log(value = "获取所有平台信息") -// @GetMapping("/getAll") -// public Dto allPlatform() { -// List ctPlatformList = ctPlatformService.list(); -// List ctPlatformInfoVOList = new ArrayList<>(); -// if (ObjectUtil.isNotEmpty(ctPlatformList)) { -// CtPlatformInfoVO ctPlatformInfoVO = new CtPlatformInfoVO(); -// for (CtPlatform ctPlatform:ctPlatformList) { -// BeanUtil.copyProperties(ctPlatform, ctPlatformInfoVO); -// ctPlatformInfoVOList.add(ctPlatformInfoVO); -// } -// } -// return Dto.returnResult(ctPlatformInfoVOList); -// } -//} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/group/controller/base/CtRebotController.java b/wjcy-system/src/main/java/me/zhengjie/modules/group/controller/base/CtRebotController.java deleted file mode 100644 index 412e5b5..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/group/controller/base/CtRebotController.java +++ /dev/null @@ -1,215 +0,0 @@ -package me.zhengjie.modules.group.controller.base; - -import cn.hutool.core.bean.BeanUtil; -import io.swagger.annotations.*; -import me.zhengjie.annotation.AnonymousAccess; -import me.zhengjie.annotation.FormSubmission; -import me.zhengjie.annotation.Log; -import me.zhengjie.dto.Dto; -import me.zhengjie.entity.CtRebot; -import me.zhengjie.entity.CtRebotExportTemple; -import me.zhengjie.error.ErrorCodeEnum; -import me.zhengjie.modules.group.dto.*; -import me.zhengjie.service.CtRebotService; -import me.zhengjie.service.vo.CtRebotListVO; -import me.zhengjie.utils.PageUtils; -import me.zhengjie.utils.excel.ExcelUtils; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; -import javax.validation.Valid; -import java.util.ArrayList; -import java.util.List; - -/** - * 影刀机器人(ct_rebot) 控制层 - * - * @Author zhw - * @Date 2022-07-23 - */ -@Validated -@RequestMapping("/api/ctRebot") -@RestController -@Api(tags = "业务:机器人管理") -public class CtRebotController { - - @Resource - private CtRebotService ctRebotService; - - - /** - * 分页查询 影刀机器人信息 - * @param dto - * @return Dto - */ - @ApiOperation("分页查询影刀机器人信息") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!") - }) - @Log("分页查询影刀机器人信息") - @PostMapping("/list") - public Dto getRebotList(@Valid @RequestBody CtRebotListDTO dto){ - PageUtils pageUtils = ctRebotService.searchPageList(dto.getiPage(),dto.getWrapper()); - return Dto.returnResult(pageUtils); - } - - /** - * 分页查询未占有状态机器人信息 - */ - @ApiOperation("分页查询未占有状态机器人信息") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!") - }) - @Log("分页查询未占有状态机器人信息") - @PostMapping("freeList") - public Dto getFreeRebotList(@Valid @RequestBody CtRebotListDTO dto){ - PageUtils pageUtils = ctRebotService.searchPageList(dto.getiPage(),dto.getWrapper()); - List allRebotList = pageUtils.getList(); - List freeRebotList = new ArrayList<>(); - long freeTotal = 0L; - for(CtRebotListVO record : allRebotList){ - if(record.getStatus()==0){ - freeTotal++; - freeRebotList.add(record); - } - } - PageUtils freePageUtils = new PageUtils<>(freeTotal, freeRebotList); - return Dto.returnResult(freePageUtils); - } - - /** - * 新增影刀机器人信息 - * @param dto - * @return Dto - */ - @ApiOperation("新增影刀机器人信息") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!") - }) - @Log("新增影刀机器人信息") - @PostMapping("/add") - @FormSubmission - public Dto addCtRebot(@Valid @RequestBody CtRebotAddDTO dto){ - CtRebot ctRebot = new CtRebot(); - BeanUtil.copyProperties(dto,ctRebot); - return Dto.returnResult(ctRebotService.save(ctRebot)); - } - - /** - * 根据ID删除影刀机器人信息 - * @param idDTO - * @return Dto - */ - @ApiOperation("根据ID删除影刀机器人信息") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!") - }) - @Log("根据ID删除影刀机器人信息") - @PostMapping("/delete") - public Dto delCtRebotById(@Valid @RequestBody IdDTO idDTO){ - return Dto.returnResult(ctRebotService.removeById(idDTO.getId())); - } - - /** - * 根据ID修改影刀机器人信息 - * @param dto - * @return Dto - */ - @ApiOperation("据ID修改影刀机器人信息") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!") - }) - @Log("根据ID修改影刀机器人信息") - @PostMapping("/edit") - @FormSubmission - public Dto editCtRebotById(@Valid @RequestBody CtRebotUpdateDTO dto){ - CtRebot ctRebotIsExist = ctRebotService.getById(dto.getId()); - if(ctRebotIsExist == null){ - return Dto.getInstance(ErrorCodeEnum.ERROR_NOT_FIND_REBOT); - } - CtRebot updateCtRebot = new CtRebot(); - BeanUtil.copyProperties(dto,updateCtRebot); - return Dto.returnResult(ctRebotService.updateById(updateCtRebot)); - } - - /** - * 根据Id查找影刀机器人信息 - * @param iddto - * @return Dto - */ - @ApiOperation("根据Id查找影刀机器人信息") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!") - }) - @Log("根据ID查找影刀机器人信息") - @PostMapping("getById") - public Dto getById(@Valid @RequestBody IdDTO iddto){ - return Dto.returnResult(ctRebotService.getById(iddto.getId())); - } - - - /** - * TODO 这里只是测试方便使用 - * @param dto - * @return Dto - */ - @ApiOperation("重置机器人状态") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!") - }) - @Log("重置机器人状态") - @PostMapping("updateStatus") - public Dto updateStatus(@Valid @RequestBody CtRebotUpdateStatusDTO dto){ - CtRebot ctRebot = new CtRebot(); - ctRebot.setId(dto.getId()); - ctRebot.setStatus(0); - return Dto.returnResult(ctRebotService.updateById(ctRebot)); - } - - /** - * EXCEL导入机器人信息 - * @param file - * @param response - * @return Dto - * @throws Exception - */ - @ApiOperation("EXCEL导入机器人信息") - @ApiImplicitParams({ - @ApiImplicitParam(value = "上传文件", name = "file", dataType = "__file", required = true) - }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!") - }) - @Log("EXCEL导入机器人信息") - @PostMapping("/import") - public Dto importRebot(@RequestPart("file") MultipartFile file, HttpServletResponse response)throws Exception{ - return ctRebotService.importRebot(file, response); - } - - /** - * EXCEL导出机器人导入模板 - */ - @ApiOperation("EXCEL导出机器人导入模板") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!") - }) - @Log("EXCEL导出机器人导入模板") - @GetMapping("/exportTemp") - @AnonymousAccess - public void exportRebot(HttpServletResponse response){ - ExcelUtils.exportTemplate(response, "机器人导入模板", CtRebotExportTemple.class); - } - -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/group/controller/base/CtVpnController.java b/wjcy-system/src/main/java/me/zhengjie/modules/group/controller/base/CtVpnController.java deleted file mode 100644 index 9d9eab7..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/group/controller/base/CtVpnController.java +++ /dev/null @@ -1,261 +0,0 @@ -package me.zhengjie.modules.group.controller.base; - -import cn.hutool.core.bean.BeanUtil; -import cn.hutool.core.lang.Snowflake; -import cn.hutool.core.util.ObjectUtil; -import com.baomidou.mybatisplus.core.metadata.IPage; -import io.swagger.annotations.*; -import me.zhengjie.annotation.AnonymousAccess; -import me.zhengjie.annotation.FormSubmission; -import me.zhengjie.annotation.Log; -import me.zhengjie.annotation.type.LogActionType; -import me.zhengjie.config.PropertiesConfig; -import me.zhengjie.config.SystemConfig; -import me.zhengjie.constant.PublicConstant; -import me.zhengjie.dto.Dto; -import me.zhengjie.entity.CtVpn; -import me.zhengjie.entity.CtVpnExport; -import me.zhengjie.entity.CtVpnExportTemple; -import me.zhengjie.entity.CtVpnImport; -import me.zhengjie.enums.VpnStatusEnum; -import me.zhengjie.error.ErrorCodeEnum; -import me.zhengjie.modules.group.dto.CtVpnAddDTO; -import me.zhengjie.modules.group.dto.CtVpnListDTO; -import me.zhengjie.modules.group.dto.CtVpnUpdateDTO; -import me.zhengjie.modules.group.dto.IdDTO; -import me.zhengjie.service.CtVpnService; -import me.zhengjie.service.vo.CtVpnInfoVO; -import me.zhengjie.service.vo.CtVpnVO; -import me.zhengjie.utils.PageUtils; -import me.zhengjie.utils.excel.ExcelUtils; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; -import javax.validation.Valid; -import java.util.ArrayList; -import java.util.List; - -/** - * @Description - * @Date 2022/7/7 - * @Author zhw - */ -@Validated -@RequestMapping("/api/ctVpn") -@RestController -@Api(tags = "业务:Vpn管理") -public class CtVpnController { - - @Resource - private CtVpnService ctVpnService; - @Resource - private PropertiesConfig propertiesConfig; - @Resource - private Snowflake snowflake; - - /** - * 分页查询VPN信息 - */ - @ApiOperation("分页查询VPN信息") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!") - }) - @Log("分页查询VPN信息") - @PostMapping("/list") - public Dto getVpnList(@Valid @RequestBody CtVpnListDTO dto){ - IPage page = ctVpnService.page(dto.getiPage(),dto.getWrapper()); - List list = new ArrayList<>(); - for(CtVpn record : page.getRecords()){ - CtVpnVO ctVpnVO = new CtVpnVO(); - BeanUtil.copyProperties(record, ctVpnVO); - list.add(ctVpnVO); - } - PageUtils pageUtils = new PageUtils(page.getTotal(),list); - return Dto.returnResult(pageUtils); - } - - /** - * 新增VPN信息 - */ - @ApiOperation("新增VPN信息") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!") - }) - @Log(value = "新增VPN信息",type = LogActionType.ADD) - @PostMapping("/add") - @FormSubmission - public Dto addVpn(@Valid @RequestBody CtVpnAddDTO dto){ - CtVpn ctVpn = new CtVpn(); - BeanUtil.copyProperties(dto,ctVpn); - ctVpn.setStatus(VpnStatusEnum.AVAILABLE.value()); - //新增规则 - return Dto.returnResult(ctVpnService.save(ctVpn)); - } - - /** - * 根据ID查VPN详情 - */ - @ApiOperation("根据ID查VPN详情") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!") - }) - @Log("根据ID查询VPN详情") - @PostMapping("/getById") - public Dto getVpnById(@Valid @RequestBody IdDTO idDTO){ - return Dto.returnResult(ctVpnService.getById(idDTO.getId())); - } - - /** - * 编辑VPN信息 - */ - @ApiOperation("编辑VPN信息") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!"), - @ApiResponse(code = 2000, message = "VPN信息不存在,或者已删除!") - }) - @Log(value = "编辑VPN信息",type = LogActionType.UPDATE) - @PostMapping("/edit") - @FormSubmission - public Dto editVpn(@Valid @RequestBody CtVpnUpdateDTO dto){ - //编辑规则 - //根据ID判断是否存在 - CtVpn ctVpn = ctVpnService.getById(dto.getId()); - if(ObjectUtil.isEmpty(ctVpn)){ - return Dto.getInstance(ErrorCodeEnum.ERROR_NOT_FIND_VPN); - } - - CtVpn updataCtVpn = new CtVpn(); - BeanUtil.copyProperties(dto,updataCtVpn); - return Dto.returnResult(ctVpnService.updateById(updataCtVpn)); - } - - /** - * 根据ID删除VPN信息 - */ - @ApiOperation("根据ID删除VPN信息") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!"), - @ApiResponse(code = 2000, message = "VPN信息不存在,或者已删除!") - }) - @Log(value = "根据ID删除VPN信息",type = LogActionType.DELETE) - @PostMapping("/delete") - public Dto delVpn(@Valid @RequestBody IdDTO idDTO){ - //判断删除规则 - //根据ID判断是否存在 - CtVpn ctVpn = ctVpnService.getById(idDTO.getId()); - if(ObjectUtil.isEmpty(ctVpn)){ - return Dto.getInstance(ErrorCodeEnum.ERROR_NOT_FIND_VPN); - } - return Dto.returnResult(ctVpnService.removeById(idDTO.getId())); - } - - /** - * 获取所有VPN信息 (VPNid VPN名称) - */ - @ApiOperation("获取所有VPN信息") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!") - }) - @Log(value = "获取所有VPN信息") - @GetMapping("/getAll") - public Dto allVpn() { - List ctVpnList = ctVpnService.list(); - List ctVpnInfoVOList = new ArrayList<>(); - if (ObjectUtil.isNotEmpty(ctVpnList)) { - for (CtVpn ctvpn:ctVpnList) { - CtVpnInfoVO ctVpnInfoVO = new CtVpnInfoVO(); - BeanUtil.copyProperties(ctvpn, ctVpnInfoVO); - ctVpnInfoVOList.add(ctVpnInfoVO); - } - } - return Dto.returnResult(ctVpnInfoVOList); - } - - /** - * EXCEL导入VPN信息 - */ - @ApiOperation("EXCEL导入VPN信息") - @ApiImplicitParams({ - @ApiImplicitParam(value = "上传文件", name = "file", dataType = "__file", required = true) - }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!") - }) - @Log(value = "EXCEL导入VPN信息",type = LogActionType.ADD) - @PostMapping("import") - public Dto importVpn(@RequestPart("file") MultipartFile file, HttpServletResponse response)throws Exception{ - - //TODO 对Excel 信息进行检测 如果不符合要求的 最终要导出错误Excel提示 - List ctVpnImportList = ExcelUtils.readMultipartFile(file,CtVpnImport.class); - if(ObjectUtil.isEmpty(ctVpnImportList)){ - return Dto.returnResult(true); - } - - List addCtVpnList = new ArrayList<>(); - List ipValueList = ctVpnService.getIpList(); - List ctVpnExportList = new ArrayList<>(); - for(CtVpnImport ctVpnImport : ctVpnImportList) { - CtVpnExport ctVpnExport = new CtVpnExport(); - BeanUtil.copyProperties(ctVpnImport, ctVpnExport); - - StringBuffer errorStrBuf = new StringBuffer(); - String rowTips = ctVpnImport.getRowTips(); - if (ObjectUtil.isNotEmpty((rowTips))) { - errorStrBuf.append(rowTips); - errorStrBuf.append(";"); - } - if (ipValueList.contains(ctVpnImport.getIpAddress())) { - errorStrBuf.append("平台已经存在该IP地址对应的VPN信息"); - } - if (ObjectUtil.isNotEmpty(errorStrBuf)) { - ctVpnExport.setError(errorStrBuf.toString()); - ctVpnExportList.add(ctVpnExport); - } else { - CtVpn ctVpn = new CtVpn(); - ctVpn.setStatus(VpnStatusEnum.AVAILABLE.value()); - BeanUtil.copyProperties(ctVpnImport, ctVpn); - addCtVpnList.add(ctVpn); - } - } - - String returnDataStr = null; - String filePath = propertiesConfig.getUploadImgPath().get(PublicConstant.EXPORT_EXCEL_FILE_TYPE); - String fileName = "VPN导入异常信息表-" + snowflake.nextIdStr(); - if(ObjectUtil.isNotEmpty(ctVpnExportList)){ - ExcelUtils.exportFile(SystemConfig.IMG_PATH + filePath, fileName, ctVpnExportList); - returnDataStr = SystemConfig.FILE_VISIT_ADDR + filePath + fileName + ".xlsx"; -// returnDataStr = "http://localhost:8008/file" + filePath + fileName + ".xlsx"; - } - - if(ObjectUtil.isNotEmpty(addCtVpnList)){ - ctVpnService.saveBatch(addCtVpnList); - } - - return Dto.returnResult(returnDataStr); - } - - /** - * Excel导出VPN导入模板 - */ - @ApiOperation("Excel导出VPN导入模板") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!") - }) - @Log(value = "Excel导出VPN导入模板") - @GetMapping("/exportTemp") - @AnonymousAccess - public void exportVpn(HttpServletResponse response) { - ExcelUtils.exportTemplate(response, "VPN导入模板", CtVpnExportTemple.class, true); - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/group/controller/base/DhAddCarCatchController.java b/wjcy-system/src/main/java/me/zhengjie/modules/group/controller/base/DhAddCarCatchController.java deleted file mode 100644 index 224eb9b..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/group/controller/base/DhAddCarCatchController.java +++ /dev/null @@ -1,409 +0,0 @@ -package me.zhengjie.modules.group.controller.base; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import lombok.RequiredArgsConstructor; -import me.zhengjie.annotation.Log; -import me.zhengjie.dto.Dto; -import me.zhengjie.entity.DhAddCarOrder; -import me.zhengjie.modules.group.dto.IdDTO; -import me.zhengjie.service.DhAddCarOrderService; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import javax.annotation.Resource; -import javax.validation.Valid; - -/** - * - * @Description 群控管理-敦煌加购-抓单 控制类 - * @Date 2022-06-22 - * @Author rch - */ -@Validated -@RequestMapping("/api/dhAddCarCatch") -@RestController -@RequiredArgsConstructor -@Api(tags = "业务:敦煌加购-抓单管理") -public class DhAddCarCatchController { - - @Resource - private DhAddCarOrderService dhAddCarOrderService; - -// /** -// * 分页查询敦煌加购-抓单 -// */ -// @ApiOperation("分页查询敦煌加购-抓单") -// @ApiResponses(value = { -// @ApiResponse(code = 200, message = "响应成功"), -// @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!") -// }) -// @Log("分页查询敦煌加购-抓单") -// @PostMapping("/list") -// public Dto getDhAddCardList(@Valid @RequestBody DhAddCarListDTO dto) { -// PageUtils pageUtilsResult = dhAddCarService.searchPageList(dto.getiPage(), dto.getWrapper()); -// return Dto.returnResult(pageUtilsResult); -// } - -// /** -// * 新增敦煌加购-抓单 -// */ -// @ApiOperation("新增敦煌加购-抓单") -// @ApiResponses(value = { -// @ApiResponse(code = 200, message = "响应成功"), -// @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!") -// }) -// @Log(value = "新增敦煌加购-抓单",type = LogActionType.ADD) -// @PostMapping("/add") -// @FormSubmission -// public Dto addDhCar(@Valid @RequestBody DhAddCarAddDTO dto) { -// -// Integer paramsType = dto.getParamsType(); -// List dhCarGoodList = new ArrayList<>(); -// if (ParamsTypeEnum.KEY_WORD.eqValue(paramsType)) { -// List DhCarGoodKeyList = dto.getCarGoodKeys(); -// if (ObjectUtil.isEmpty(DhCarGoodKeyList)) { -// return Dto.getInstance(ErrorCodeEnum.ERROR_ADD_CAR_KEY_NULL); -// } else { -// for (DhCarGoodKeyAddDTO dhCarGoodKeyDTO:DhCarGoodKeyList) { -// DhCarGoods dhCarGoods = new DhCarGoods(); -// BeanUtil.copyProperties(dhCarGoodKeyDTO, dhCarGoods); -// dhCarGoodList.add(dhCarGoods); -// } -// } -// } else if (ParamsTypeEnum.LINK.eqValue(paramsType)) { -// List DhCarGoodLinkList = dto.getCarGoodLinks(); -// if (ObjectUtil.isEmpty(DhCarGoodLinkList)) { -// return Dto.getInstance(ErrorCodeEnum.ERROR_ADD_CAR_LINK_NULL); -// } else { -// for (DhCarGoodLinkAddDTO dhCarGoodLinkDTO:DhCarGoodLinkList) { -// DhCarGoods dhCarGoods = new DhCarGoods(); -// BeanUtil.copyProperties(dhCarGoodLinkDTO, dhCarGoods); -// dhCarGoodList.add(dhCarGoods); -// } -// } -// } else { -// return Dto.getInstance(ErrorCodeEnum.ERROR_ADD_CAR_GOODS_NULL); -// } -// -// // service 层 分别存储两个表信息 -// Boolean resultBoolean = dhCarGoodsService.saveBatch(dhCarGoodList); -// if (resultBoolean) { -// List goodsIdList = dhCarGoodList.stream().map(DhCarGoods::getId).collect(Collectors.toList()); -// -// DhAddCar dhAddCar = new DhAddCar(); -// BeanUtil.copyProperties(dto, dhAddCar); -// dhAddCar.setCarGoodIds(Joiner.on(",").join(goodsIdList)); -// resultBoolean = dhAddCarService.save(dhAddCar); -// } -// -// return Dto.returnResult(resultBoolean); -// } - - /** - * 根据id获取刷单信息 - */ - @ApiOperation("根据id获取刷单信息") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!") - }) - @Log("根据id获取刷单信息") - @PostMapping("/getById") - public Dto getById(@Valid @RequestBody IdDTO idDTO) { - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("add_car_id", idDTO.getId()); - return Dto.returnResult(dhAddCarOrderService.getOne(queryWrapper)); - } - -// /** -// * 根据id获取修改回显信息 -// */ -// @ApiOperation("根据id获取修改回显信息") -// @ApiResponses(value = { -// @ApiResponse(code = 200, message = "响应成功"), -// @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!") -// }) -// @Log("根据id获取修改回显信息") -// @PostMapping("/getEditDetailById") -// public Dto getEditDetailById(@Valid @RequestBody IdDTO idDTO) { -// return Dto.returnResult(dhAddCarService.getDetailById(idDTO.getId())); -// } -// -// /** -// * 根据id删除刷单信息 -// * @author: rch -// */ -// @ApiOperation("根据id删除敦煌加购-抓单") -// @ApiResponses(value = { -// @ApiResponse(code = 200, message = "响应成功"), -// @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!"), -// @ApiResponse(code = 4404, message = "敦煌加购-抓单信息不存在,或者已删除或异常!"), -// @ApiResponse(code = 3901, message = "只有待执行的刷单信息才允许删除!") -// }) -// @Log(value = "根据id删除刷单信息",type = LogActionType.DELETE) -// @PostMapping("/delete") -// public Dto delClickFarming(@Valid @RequestBody IdDTO idDTO) { -// -// // 先查询 -// DhAddCar dhAddCar = dhAddCarService.getById(idDTO.getId()); -// if (ObjectUtil.isEmpty(dhAddCar)) { -// return Dto.getInstance(ErrorCodeEnum.ERROR_NOT_FIND_ADD_CAR_INFO); -// } -// -// if (!DhAddCarStatusEnum.TOBE_EXECUTION.eqValue(dhAddCar.getStatus())) { -// return Dto.getInstance(ErrorCodeEnum.ERROR_DEL_ADD_CAR_INFO); -// } -// -// Boolean resultBoolean = false; -// if (dhAddCarService.removeById(idDTO.getId())) { -// String goodIds = dhAddCar.getCarGoodIds(); -// List goodIdList = new ArrayList<>(); -// if (goodIds.contains(",")){ -// goodIdList = Arrays.asList(goodIds.split(",")).stream().map(s -> Long.parseLong(s.trim())).collect(Collectors.toList()); -// }else { -// goodIdList.add(Long.valueOf(goodIds)); -// } -// resultBoolean = dhCarGoodsService.removeByIds(goodIdList); -// } -// -// return Dto.returnResult(resultBoolean); -// } -// -// /** -// * 编辑刷单信息 -// */ -// @ApiOperation("编辑敦煌加购-抓单") -// @ApiResponses(value = { -// @ApiResponse(code = 200, message = "响应成功"), -// @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!"), -// @ApiResponse(code = 4404, message ="敦煌加购-抓单信息不存在!") -// }) -// @Log(value = "编辑敦煌加购-抓单",type = LogActionType.UPDATE) -// @PostMapping("/edit") -// @FormSubmission -// public Dto editDhAddCar(@Valid @RequestBody DhAddCarEditDTO dto) { -// -// DhAddCar dhAddCar = dhAddCarService.getById(dto.getId()); -// if (ObjectUtil.isEmpty(dhAddCar)) { -// return Dto.getInstance(ErrorCodeEnum.ERROR_NOT_FIND_ADD_CAR_INFO); -// } -// -// if (!DhAddCarStatusEnum.TOBE_EXECUTION.eqValue(dhAddCar.getStatus())) { -// return Dto.getInstance(ErrorCodeEnum.ERROR_NOT_EDIT_ADD_CAR_INFO); -// } -// -// // 关键词 -// BeanUtil.copyProperties(dto, dhAddCar); -// List dhCarGoodList = new ArrayList<>(); -// Boolean result = false; -// if (ParamsTypeEnum.KEY_WORD.value().equals(dto.getParamsType())) { -// List carGoodKeys = dto.getCarGoodKeys(); -// for (DhCarGoodKeyEditDTO dhCarGoodKeyEditDTO:carGoodKeys) { -// DhCarGoods dhCarGoods = new DhCarGoods(); -// BeanUtil.copyProperties(dhCarGoodKeyEditDTO, dhCarGoods); -// dhCarGoodList.add(dhCarGoods); -// } -// } -// // 链接 -// if (ParamsTypeEnum.LINK.value().equals(dto.getParamsType())) { -// List carGoodLinks = dto.getCarGoodLinks(); -// for (DhCarGoodLinkEditDTO dhCarGoodLinkEditDTO:carGoodLinks) { -// DhCarGoods dhCarGoods = new DhCarGoods(); -// BeanUtil.copyProperties(dhCarGoodLinkEditDTO, dhCarGoods); -// dhCarGoodList.add(dhCarGoods); -// } -// } -// if (ObjectUtil.isNotEmpty(dhCarGoodList)) { -// if (dhCarGoodsService.saveOrUpdateBatch(dhCarGoodList)) { -// String dhCarGoodIdStr = Joiner.on(",").join(dhCarGoodList.stream().map(DhCarGoods::getId).collect(Collectors.toList())); -// dhAddCar.setCarGoodIds(dhCarGoodIdStr); -// result = dhAddCarService.updateById(dhAddCar); -// } -// } -// -// return Dto.returnResult(result); -// } -// -// -// /** -// * 下单成功(加购-抓单成功状态 手动转下单成功) -// * @param idDTO -// * @return -// */ -// @ApiOperation("下单成功") -// @ApiResponses(value = { -// @ApiResponse(code = 200, message = "响应成功"), -// @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!"), -// @ApiResponse(code = 4404, message ="敦煌加购-抓单信息不存在!") -// }) -// @Log(value = "下单成功",type = LogActionType.UPDATE) -// @PostMapping("/orderSuccess") -// @FormSubmission -// public Dto orderSuccess(@Valid @RequestBody IdDTO idDTO) { -// DhAddCar dhAddCar = dhAddCarService.getByIdLock(idDTO.getId()); -// if (ObjectUtil.isEmpty(dhAddCar)) { -// return Dto.getInstance(ErrorCodeEnum.ERROR_NOT_FIND_ADD_CAR_INFO); -// } -// -// DhAddCar updateDhAddCar = new DhAddCar(); -// updateDhAddCar.setId(dhAddCar.getId()); -// updateDhAddCar.setStatus(DhAddCarStatusEnum.ORDER_SUCCESS.value()); -// return Dto.returnResult(dhAddCarService.updateById(updateDhAddCar)); -// } -// -// /** -// * 支付成功(下单成功状态 手动转支付成功) -// * @param idDTO -// * @return -// */ -// @ApiOperation("支付成功") -// @ApiResponses(value = { -// @ApiResponse(code = 200, message = "响应成功"), -// @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!"), -// @ApiResponse(code = 4404, message ="敦煌加购-抓单信息不存在!") -// }) -// @Log(value = "支付成功",type = LogActionType.UPDATE) -// @PostMapping("/toBeCatch") -// @FormSubmission -// public Dto toBeCatch(@Valid @RequestBody IdDTO idDTO) { -// DhAddCar dhAddCar = dhAddCarService.getByIdLock(idDTO.getId()); -// if (ObjectUtil.isEmpty(dhAddCar)) { -// return Dto.getInstance(ErrorCodeEnum.ERROR_NOT_FIND_ADD_CAR_INFO); -// } -// -// DhAddCar updateDhAddCar = new DhAddCar(); -// updateDhAddCar.setId(dhAddCar.getId()); -// updateDhAddCar.setStatus(DhAddCarStatusEnum.TO_BE_CATCH_ORDER.value()); -// return Dto.returnResult(dhAddCarService.updateById(updateDhAddCar)); -// } - -// -// /** -// * -// * @param file -// * @param response -// * @return -// * @throws Exception -// */ -// @ApiOperation("Excel刷单信息导入") -// @ApiImplicitParams({ -// @ApiImplicitParam(value = "上传文件", name = "file", dataType = "__file", required = true) -// }) -// @ApiResponses(value = { -// @ApiResponse(code = 200, message = "响应成功"), -// @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!") -// }) -// @Log(value = "Excel刷单信息导入",type = LogActionType.ADD) -// @PostMapping("/import") -// public Dto importClickFarming(@RequestPart("file")MultipartFile file, HttpServletResponse response) throws Exception { -// -// // TODO 对Excel 信息进行检测 如果不符合要求的 最终要导出错误Excel提示 -// List ctClickFarmingImportList = ExcelUtils.readMultipartFile(file, CtClickFarmingImport.class); -// if (ObjectUtil.isEmpty(ctClickFarmingImportList)) { -// return Dto.returnResult(true); -// } -// -// List addCtClickFarmingList = new ArrayList<>(); -// List ctClickFarmingExportList = new ArrayList<>(); -// -// // 买家id -// List buyerAccountList = ctClickFarmingImportList.stream().map(c->c.getAccount()).collect(Collectors.toList()); -// Map buyerMap = ctBuyerService.getBuyerList(buyerAccountList); -// -// for (CtClickFarmingImport ctClickFarmingImport:ctClickFarmingImportList) { -// CtClickFarmingExport ctClickFarmingExport = new CtClickFarmingExport(); -// BeanUtil.copyProperties(ctClickFarmingImport, ctClickFarmingExport); -// -// StringBuffer errorStrBuf = new StringBuffer(); -// String rowTips = ctClickFarmingImport.getRowTips(); -// if (ObjectUtil.isNotEmpty(rowTips)) { -// errorStrBuf.append(rowTips); -// errorStrBuf.append(";"); -// } -// -// if (ObjectUtil.isEmpty(ctClickFarmingImport.getSpecification())) { -// errorStrBuf.append("规格-必填!"); -// errorStrBuf.append(";"); -// } -// if (ObjectUtil.isEmpty(ctClickFarmingImport.getColor())) { -// errorStrBuf.append("颜色-必填!"); -// errorStrBuf.append(";"); -// } -// if (ObjectUtil.isEmpty(ctClickFarmingImport.getExchange())) { -// errorStrBuf.append("优惠劵-必填!"); -// errorStrBuf.append(";"); -// } -// -// // 判断类型 -// if (ParamsTypeEnum.KEY_WORD.eqValue(ctClickFarmingImport.getParamsType())) { -// if (ObjectUtil.isEmpty(ctClickFarmingImport.getKeyWord())) { -// errorStrBuf.append("关键词-必填!"); -// errorStrBuf.append(";"); -// } -// if (ObjectUtil.isEmpty(ctClickFarmingImport.getTitle())) { -// errorStrBuf.append("标题-必填!"); -// errorStrBuf.append(";"); -// } -// if (ObjectUtil.isEmpty(ctClickFarmingImport.getItem())) { -// errorStrBuf.append("item-必填!"); -// errorStrBuf.append(";"); -// } -// } else { -// if (ObjectUtil.isEmpty(ctClickFarmingImport.getLink())) { -// errorStrBuf.append("链接-必填!"); -// errorStrBuf.append(";"); -// } -// } -// -// if (ObjectUtil.isEmpty(buyerMap) || !buyerMap.containsKey(ctClickFarmingImport.getAccount())) { -// errorStrBuf.append("买家信息不存在!"); -// errorStrBuf.append(";"); -// } else { -// Long buyerId = buyerMap.entrySet().stream().collect(Collectors.toMap(entity -> entity.getKey(), entity -> entity.getValue())).get(ctClickFarmingImport.getAccount()).getId(); -// ctClickFarmingImport.setBuyerId(buyerId); -// } -// if (ObjectUtil.isNotEmpty(errorStrBuf)) { -// ctClickFarmingExport.setError(errorStrBuf.toString()); -// ctClickFarmingExportList.add(ctClickFarmingExport); -// } else { -// CtClickFarming ctClickFarming = new CtClickFarming(); -// BeanUtils.copyProperties(ctClickFarmingImport, ctClickFarming); -// addCtClickFarmingList.add(ctClickFarming); -// } -// } -// -// String returnDataStr = null; -// String filePath = propertiesConfig.getUploadImgPath().get(PublicConstant.EXPORT_EXCEL_FILE_TYPE); -// String fileName = "刷单信息导入异常信息表-" + snowflake.nextIdStr(); -// if (ObjectUtil.isNotEmpty(ctClickFarmingExportList)) { -// ExcelUtils.exportFile(SystemConfig.IMG_PATH + filePath, fileName, ctClickFarmingExportList); -// returnDataStr = SystemConfig.FILE_VISIT_ADDR + filePath + fileName + ".xlsx"; -//// returnDataStr = "http://localhost:8008/file" + filePath + fileName + ".xlsx"; -// } -// -// if (ObjectUtil.isNotEmpty(addCtClickFarmingList)) { -// ctClickFarmingService.saveBatch(addCtClickFarmingList); -// } -// -// return Dto.returnResult(returnDataStr); -// } -// -// @ApiOperation("Excel刷单信息模版导出") -// @ApiResponses(value = { -// @ApiResponse(code = 200, message = "响应成功"), -// @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!") -// }) -// @Log(value = "Excel刷单信息模版导出") -// @GetMapping("/exportTemp") -// @AnonymousAccess -// public void importClickFarming(HttpServletResponse response) { -// ExcelUtils.exportTemplate(response, "刷单信息模版", CtClickFarmingExportTemp.class); -// } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/group/controller/base/DhAddCarController.java b/wjcy-system/src/main/java/me/zhengjie/modules/group/controller/base/DhAddCarController.java deleted file mode 100644 index dfc9a72..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/group/controller/base/DhAddCarController.java +++ /dev/null @@ -1,466 +0,0 @@ -package me.zhengjie.modules.group.controller.base; - -import cn.hutool.core.bean.BeanUtil; -import cn.hutool.core.util.ObjectUtil; -import com.google.common.base.Joiner; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import lombok.RequiredArgsConstructor; -import me.zhengjie.annotation.FormSubmission; -import me.zhengjie.annotation.Log; -import me.zhengjie.annotation.type.LogActionType; -import me.zhengjie.dto.Dto; -import me.zhengjie.entity.DhAddCar; -import me.zhengjie.entity.DhCarGoods; -import me.zhengjie.enums.DhAddCarStatusEnum; -import me.zhengjie.enums.ParamsTypeEnum; -import me.zhengjie.error.ErrorCodeEnum; -import me.zhengjie.modules.group.dto.DhCarWellReceivedDTO; -import me.zhengjie.modules.group.dto.IdDTO; -import me.zhengjie.modules.group.dto.DhCarGoodWellReceivedDTO; -import me.zhengjie.modules.group.dto.dhaddcar.DhAddCarAddDTO; -import me.zhengjie.modules.group.dto.dhaddcar.DhAddCarEditDTO; -import me.zhengjie.modules.group.dto.dhaddcar.DhAddCarListDTO; -import me.zhengjie.modules.group.dto.dhcargood.*; -import me.zhengjie.service.DhAddCarService; -import me.zhengjie.service.DhCarGoodsService; -import me.zhengjie.service.vo.dhaddcar.DhAddCarListVO; -import me.zhengjie.service.vo.dhaddcar.DhAddCarVO; -import me.zhengjie.utils.PageUtils; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import javax.annotation.Resource; -import javax.validation.Valid; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.stream.Collectors; - -/** - * - * @Description 群控管理-敦煌加购 控制类 - * @Date 2022-06-22 - * @Author rch - */ -@Validated -@RequestMapping("/api/dhAddCar") -@RestController -@RequiredArgsConstructor -@Api(tags = "业务:敦煌加购管理") -public class DhAddCarController { - - @Resource - private DhCarGoodsService dhCarGoodsService; - @Resource - private DhAddCarService dhAddCarService; - - /** - * 分页查询敦煌加购 - */ - @ApiOperation("分页查询敦煌加购") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!") - }) - @Log("分页查询敦煌加购") - @PostMapping("/list") - public Dto getDhAddCardList(@Valid @RequestBody DhAddCarListDTO dto) { - PageUtils pageUtilsResult = dhAddCarService.searchPageList(dto.getiPage(), dto.getWrapper()); - return Dto.returnResult(pageUtilsResult); - } - - /** - * 新增敦煌加购 - */ - @ApiOperation("新增敦煌加购") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!") - }) - @Log(value = "新增敦煌加购",type = LogActionType.ADD) - @PostMapping("/add") - @FormSubmission - public Dto addDhCar(@Valid @RequestBody DhAddCarAddDTO dto) { - - Integer paramsType = dto.getParamsType(); - List dhCarGoodList = new ArrayList<>(); - if (ParamsTypeEnum.KEY_WORD.eqValue(paramsType)) { - List DhCarGoodKeyList = dto.getCarGoodKeys(); - if (ObjectUtil.isEmpty(DhCarGoodKeyList)) { - return Dto.getInstance(ErrorCodeEnum.ERROR_ADD_CAR_KEY_NULL); - } else { - for (DhCarGoodKeyAddDTO dhCarGoodKeyDTO:DhCarGoodKeyList) { - DhCarGoods dhCarGoods = new DhCarGoods(); - BeanUtil.copyProperties(dhCarGoodKeyDTO, dhCarGoods); - dhCarGoodList.add(dhCarGoods); - } - } - } else if (ParamsTypeEnum.LINK.eqValue(paramsType)) { - List DhCarGoodLinkList = dto.getCarGoodLinks(); - if (ObjectUtil.isEmpty(DhCarGoodLinkList)) { - return Dto.getInstance(ErrorCodeEnum.ERROR_ADD_CAR_LINK_NULL); - } else { - for (DhCarGoodLinkAddDTO dhCarGoodLinkDTO:DhCarGoodLinkList) { - DhCarGoods dhCarGoods = new DhCarGoods(); - BeanUtil.copyProperties(dhCarGoodLinkDTO, dhCarGoods); - dhCarGoodList.add(dhCarGoods); - } - } - } else { - return Dto.getInstance(ErrorCodeEnum.ERROR_ADD_CAR_GOODS_NULL); - } - - // service 层 分别存储两个表信息 - Boolean resultBoolean = dhCarGoodsService.saveBatch(dhCarGoodList); - if (resultBoolean) { - List goodsIdList = dhCarGoodList.stream().map(DhCarGoods::getId).collect(Collectors.toList()); - - DhAddCar dhAddCar = new DhAddCar(); - BeanUtil.copyProperties(dto, dhAddCar); - dhAddCar.setCarGoodIds(Joiner.on(",").join(goodsIdList)); - resultBoolean = dhAddCarService.save(dhAddCar); - } - - return Dto.returnResult(resultBoolean); - } - -// /** -// * 根据id获取刷单信息 -// */ -// @ApiOperation("根据id获取刷单信息") -// @ApiResponses(value = { -// @ApiResponse(code = 200, message = "响应成功"), -// @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!") -// }) -// @Log("根据id获取刷单信息") -// @PostMapping("/getById") -// public Dto getById(@Valid @RequestBody IdDTO idDTO) { -// return Dto.returnResult(ctClickFarmingService.getDetailById(idDTO.getId())); -// } -// - /** - * 根据id获取修改回显信息 - */ - @ApiOperation("根据id获取修改回显信息") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!") - }) - @Log("根据id获取修改回显信息") - @PostMapping("/getEditDetailById") - public Dto getEditDetailById(@Valid @RequestBody IdDTO idDTO) { - return Dto.returnResult(dhAddCarService.getDetailById(idDTO.getId())); - } - - /** - * 根据id删除刷单信息 - * @author: rch - */ - @ApiOperation("根据id删除敦煌加购") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!"), - @ApiResponse(code = 4404, message = "敦煌加购信息不存在,或者已删除或异常!"), - @ApiResponse(code = 3901, message = "只有待执行的刷单信息才允许删除!") - }) - @Log(value = "根据id删除刷单信息",type = LogActionType.DELETE) - @PostMapping("/delete") - public Dto delClickFarming(@Valid @RequestBody IdDTO idDTO) { - - // 先查询 - DhAddCar dhAddCar = dhAddCarService.getById(idDTO.getId()); - if (ObjectUtil.isEmpty(dhAddCar)) { - return Dto.getInstance(ErrorCodeEnum.ERROR_NOT_FIND_ADD_CAR_INFO); - } - - if (!DhAddCarStatusEnum.TOBE_EXECUTION.eqValue(dhAddCar.getStatus())) { - return Dto.getInstance(ErrorCodeEnum.ERROR_DEL_ADD_CAR_INFO); - } - - Boolean resultBoolean = false; - if (dhAddCarService.removeById(idDTO.getId())) { - String goodIds = dhAddCar.getCarGoodIds(); - List goodIdList = new ArrayList<>(); - if (goodIds.contains(",")){ - goodIdList = Arrays.asList(goodIds.split(",")).stream().map(s -> Long.parseLong(s.trim())).collect(Collectors.toList()); - }else { - goodIdList.add(Long.valueOf(goodIds)); - } - resultBoolean = dhCarGoodsService.removeByIds(goodIdList); - } - - return Dto.returnResult(resultBoolean); - } - - /** - * 编辑刷单信息 - */ - @ApiOperation("编辑敦煌加购") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!"), - @ApiResponse(code = 4404, message ="敦煌加购信息不存在!") - }) - @Log(value = "编辑敦煌加购",type = LogActionType.UPDATE) - @PostMapping("/edit") - @FormSubmission - public Dto editDhAddCar(@Valid @RequestBody DhAddCarEditDTO dto) { - - DhAddCar dhAddCar = dhAddCarService.getById(dto.getId()); - if (ObjectUtil.isEmpty(dhAddCar)) { - return Dto.getInstance(ErrorCodeEnum.ERROR_NOT_FIND_ADD_CAR_INFO); - } - - if (!DhAddCarStatusEnum.TOBE_EXECUTION.eqValue(dhAddCar.getStatus())) { - return Dto.getInstance(ErrorCodeEnum.ERROR_NOT_EDIT_ADD_CAR_INFO); - } - - // 关键词 - BeanUtil.copyProperties(dto, dhAddCar); - List dhCarGoodList = new ArrayList<>(); - Boolean result = false; - if (ParamsTypeEnum.KEY_WORD.value().equals(dto.getParamsType())) { - List carGoodKeys = dto.getCarGoodKeys(); - for (DhCarGoodKeyEditDTO dhCarGoodKeyEditDTO:carGoodKeys) { - DhCarGoods dhCarGoods = new DhCarGoods(); - BeanUtil.copyProperties(dhCarGoodKeyEditDTO, dhCarGoods); - dhCarGoodList.add(dhCarGoods); - } - } - // 链接 - if (ParamsTypeEnum.LINK.value().equals(dto.getParamsType())) { - List carGoodLinks = dto.getCarGoodLinks(); - for (DhCarGoodLinkEditDTO dhCarGoodLinkEditDTO:carGoodLinks) { - DhCarGoods dhCarGoods = new DhCarGoods(); - BeanUtil.copyProperties(dhCarGoodLinkEditDTO, dhCarGoods); - dhCarGoodList.add(dhCarGoods); - } - } - if (ObjectUtil.isNotEmpty(dhCarGoodList)) { - if (dhCarGoodsService.saveOrUpdateBatch(dhCarGoodList)) { - String dhCarGoodIdStr = Joiner.on(",").join(dhCarGoodList.stream().map(DhCarGoods::getId).collect(Collectors.toList())); - dhAddCar.setCarGoodIds(dhCarGoodIdStr); - result = dhAddCarService.updateById(dhAddCar); - } - } - - return Dto.returnResult(result); - } - - - /** - * 下单成功(加购成功状态 手动转下单成功) - * @param idDTO - * @return - */ - @ApiOperation("下单成功") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!"), - @ApiResponse(code = 4404, message ="敦煌加购信息不存在!") - }) - @Log(value = "下单成功",type = LogActionType.UPDATE) - @PostMapping("/orderSuccess") - @FormSubmission - public Dto orderSuccess(@Valid @RequestBody IdDTO idDTO) { - DhAddCar dhAddCar = dhAddCarService.getByIdLock(idDTO.getId()); - if (ObjectUtil.isEmpty(dhAddCar)) { - return Dto.getInstance(ErrorCodeEnum.ERROR_NOT_FIND_ADD_CAR_INFO); - } - - DhAddCar updateDhAddCar = new DhAddCar(); - updateDhAddCar.setId(dhAddCar.getId()); - updateDhAddCar.setStatus(DhAddCarStatusEnum.ORDER_SUCCESS.value()); - return Dto.returnResult(dhAddCarService.updateById(updateDhAddCar)); - } - - /** - * 支付成功(下单成功状态 手动转支付成功) - * @param idDTO - * @return - */ - @ApiOperation("支付成功") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!"), - @ApiResponse(code = 4404, message ="敦煌加购信息不存在!") - }) - @Log(value = "支付成功",type = LogActionType.UPDATE) - @PostMapping("/toBeCatch") - @FormSubmission - public Dto toBeCatch(@Valid @RequestBody IdDTO idDTO) { - DhAddCar dhAddCar = dhAddCarService.getByIdLock(idDTO.getId()); - if (ObjectUtil.isEmpty(dhAddCar)) { - return Dto.getInstance(ErrorCodeEnum.ERROR_NOT_FIND_ADD_CAR_INFO); - } - - DhAddCar updateDhAddCar = new DhAddCar(); - updateDhAddCar.setId(dhAddCar.getId()); - updateDhAddCar.setStatus(DhAddCarStatusEnum.TO_BE_CATCH_ORDER.value()); - return Dto.returnResult(dhAddCarService.updateById(updateDhAddCar)); - } - - /** - * 好评 - * @param dto - * @return - */ - @ApiOperation("好评") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!"), - @ApiResponse(code = 4404, message ="敦煌加购信息不存在!") - }) - @Log(value = "好评",type = LogActionType.UPDATE) - @PostMapping("/wellReceive") - @FormSubmission - public Dto wellReceived(@Valid @RequestBody DhCarWellReceivedDTO dto) { - - - DhAddCar dhAddCar = dhAddCarService.getByIdLock(dto.getId()); - if (ObjectUtil.isEmpty(dhAddCar)) { - return Dto.getInstance(ErrorCodeEnum.ERROR_NOT_FIND_ADD_CAR_INFO); - } - - if (!DhAddCarStatusEnum.CATCH_ORDER_SUCCESS.eqValue(dhAddCar.getStatus())) { - return Dto.getInstance(ErrorCodeEnum.ERROR_NOT_WELL_RECEIVED_ADD_CAR_INFO); - } - - List goods = dto.getDialogWellReceivedGoods(); - List dhCarGoodsList = new ArrayList<>(); - for (DhCarGoodWellReceivedDTO good :goods) { - DhCarGoods dhCarGoods = new DhCarGoods(); - BeanUtil.copyProperties(good, dhCarGoods); - dhCarGoodsList.add(dhCarGoods); - } - return Dto.returnResult(dhCarGoodsService.updateBatchById(dhCarGoodsList)); - } -// -// /** -// * -// * @param file -// * @param response -// * @return -// * @throws Exception -// */ -// @ApiOperation("Excel刷单信息导入") -// @ApiImplicitParams({ -// @ApiImplicitParam(value = "上传文件", name = "file", dataType = "__file", required = true) -// }) -// @ApiResponses(value = { -// @ApiResponse(code = 200, message = "响应成功"), -// @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!") -// }) -// @Log(value = "Excel刷单信息导入",type = LogActionType.ADD) -// @PostMapping("/import") -// public Dto importClickFarming(@RequestPart("file")MultipartFile file, HttpServletResponse response) throws Exception { -// -// // TODO 对Excel 信息进行检测 如果不符合要求的 最终要导出错误Excel提示 -// List ctClickFarmingImportList = ExcelUtils.readMultipartFile(file, CtClickFarmingImport.class); -// if (ObjectUtil.isEmpty(ctClickFarmingImportList)) { -// return Dto.returnResult(true); -// } -// -// List addCtClickFarmingList = new ArrayList<>(); -// List ctClickFarmingExportList = new ArrayList<>(); -// -// // 买家id -// List buyerAccountList = ctClickFarmingImportList.stream().map(c->c.getAccount()).collect(Collectors.toList()); -// Map buyerMap = ctBuyerService.getBuyerList(buyerAccountList); -// -// for (CtClickFarmingImport ctClickFarmingImport:ctClickFarmingImportList) { -// CtClickFarmingExport ctClickFarmingExport = new CtClickFarmingExport(); -// BeanUtil.copyProperties(ctClickFarmingImport, ctClickFarmingExport); -// -// StringBuffer errorStrBuf = new StringBuffer(); -// String rowTips = ctClickFarmingImport.getRowTips(); -// if (ObjectUtil.isNotEmpty(rowTips)) { -// errorStrBuf.append(rowTips); -// errorStrBuf.append(";"); -// } -// -// if (ObjectUtil.isEmpty(ctClickFarmingImport.getSpecification())) { -// errorStrBuf.append("规格-必填!"); -// errorStrBuf.append(";"); -// } -// if (ObjectUtil.isEmpty(ctClickFarmingImport.getColor())) { -// errorStrBuf.append("颜色-必填!"); -// errorStrBuf.append(";"); -// } -// if (ObjectUtil.isEmpty(ctClickFarmingImport.getExchange())) { -// errorStrBuf.append("优惠劵-必填!"); -// errorStrBuf.append(";"); -// } -// -// // 判断类型 -// if (ParamsTypeEnum.KEY_WORD.eqValue(ctClickFarmingImport.getParamsType())) { -// if (ObjectUtil.isEmpty(ctClickFarmingImport.getKeyWord())) { -// errorStrBuf.append("关键词-必填!"); -// errorStrBuf.append(";"); -// } -// if (ObjectUtil.isEmpty(ctClickFarmingImport.getTitle())) { -// errorStrBuf.append("标题-必填!"); -// errorStrBuf.append(";"); -// } -// if (ObjectUtil.isEmpty(ctClickFarmingImport.getItem())) { -// errorStrBuf.append("item-必填!"); -// errorStrBuf.append(";"); -// } -// } else { -// if (ObjectUtil.isEmpty(ctClickFarmingImport.getLink())) { -// errorStrBuf.append("链接-必填!"); -// errorStrBuf.append(";"); -// } -// } -// -// if (ObjectUtil.isEmpty(buyerMap) || !buyerMap.containsKey(ctClickFarmingImport.getAccount())) { -// errorStrBuf.append("买家信息不存在!"); -// errorStrBuf.append(";"); -// } else { -// Long buyerId = buyerMap.entrySet().stream().collect(Collectors.toMap(entity -> entity.getKey(), entity -> entity.getValue())).get(ctClickFarmingImport.getAccount()).getId(); -// ctClickFarmingImport.setBuyerId(buyerId); -// } -// if (ObjectUtil.isNotEmpty(errorStrBuf)) { -// ctClickFarmingExport.setError(errorStrBuf.toString()); -// ctClickFarmingExportList.add(ctClickFarmingExport); -// } else { -// CtClickFarming ctClickFarming = new CtClickFarming(); -// BeanUtils.copyProperties(ctClickFarmingImport, ctClickFarming); -// addCtClickFarmingList.add(ctClickFarming); -// } -// } -// -// String returnDataStr = null; -// String filePath = propertiesConfig.getUploadImgPath().get(PublicConstant.EXPORT_EXCEL_FILE_TYPE); -// String fileName = "刷单信息导入异常信息表-" + snowflake.nextIdStr(); -// if (ObjectUtil.isNotEmpty(ctClickFarmingExportList)) { -// ExcelUtils.exportFile(SystemConfig.IMG_PATH + filePath, fileName, ctClickFarmingExportList); -// returnDataStr = SystemConfig.FILE_VISIT_ADDR + filePath + fileName + ".xlsx"; -//// returnDataStr = "http://localhost:8008/file" + filePath + fileName + ".xlsx"; -// } -// -// if (ObjectUtil.isNotEmpty(addCtClickFarmingList)) { -// ctClickFarmingService.saveBatch(addCtClickFarmingList); -// } -// -// return Dto.returnResult(returnDataStr); -// } -// -// @ApiOperation("Excel刷单信息模版导出") -// @ApiResponses(value = { -// @ApiResponse(code = 200, message = "响应成功"), -// @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!") -// }) -// @Log(value = "Excel刷单信息模版导出") -// @GetMapping("/exportTemp") -// @AnonymousAccess -// public void importClickFarming(HttpServletResponse response) { -// ExcelUtils.exportTemplate(response, "刷单信息模版", CtClickFarmingExportTemp.class); -// } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/group/controller/base/DhAddCarOrderController.java b/wjcy-system/src/main/java/me/zhengjie/modules/group/controller/base/DhAddCarOrderController.java deleted file mode 100644 index 0617e82..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/group/controller/base/DhAddCarOrderController.java +++ /dev/null @@ -1,57 +0,0 @@ -package me.zhengjie.modules.group.controller.base; - -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import lombok.RequiredArgsConstructor; -import me.zhengjie.annotation.Log; -import me.zhengjie.dto.Dto; -import me.zhengjie.modules.group.dto.dhaddcar.DhAddCarListDTO; -import me.zhengjie.modules.group.dto.dhcarorder.DhAddCarOrderListDTO; -import me.zhengjie.service.DhAddCarOrderService; -import me.zhengjie.service.DhAddCarService; -import me.zhengjie.service.DhCarGoodsService; -import me.zhengjie.service.vo.dhaddcar.DhAddCarListVO; -import me.zhengjie.service.vo.dhcarorder.DhAddCarOrderListVO; -import me.zhengjie.utils.PageUtils; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import javax.annotation.Resource; -import javax.validation.Valid; - -/** - * - * @Description 群控管理-敦煌加购-订单 控制类 - * @Date 2022-06-22 - * @Author rch - */ -@Validated -@RequestMapping("/api/dhAddCarOrder") -@RestController -@RequiredArgsConstructor -@Api(tags = "业务:敦煌加购订单管理") -public class DhAddCarOrderController { - - @Resource - private DhAddCarOrderService dhAddCarOrderService; - - /** - * 分页查询敦煌加购 - */ - @ApiOperation("分页查询敦煌加购") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!") - }) - @Log("分页查询敦煌加购") - @PostMapping("/list") - public Dto getDhAddCardList(@Valid @RequestBody DhAddCarOrderListDTO dto) { - PageUtils pageUtilsResult = dhAddCarOrderService.searchPageList(dto.getiPage(), dto.getWrapper()); - return Dto.returnResult(pageUtilsResult); - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/group/controller/base/QuartzLogController.java b/wjcy-system/src/main/java/me/zhengjie/modules/group/controller/base/QuartzLogController.java deleted file mode 100644 index 5f3ed6c..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/group/controller/base/QuartzLogController.java +++ /dev/null @@ -1,55 +0,0 @@ -package me.zhengjie.modules.group.controller.base; - -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import lombok.RequiredArgsConstructor; -import me.zhengjie.annotation.AnonymousAccess; -import me.zhengjie.annotation.Log; -import me.zhengjie.dto.Dto; -import me.zhengjie.modules.group.dto.SysQuartzLogListDTO; -import me.zhengjie.service.SysQuartzLogService; -import me.zhengjie.service.vo.SysQuartzLogListVO; -import me.zhengjie.utils.PageUtils; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import javax.annotation.Resource; -import javax.validation.Valid; - - -/** - * - * @Description 群控管理-影刀定时器-日志模块 - * @Date 2022-07-20 - * @Author rch - */ -@Validated -@RequestMapping("/api/quartzLog") -@RestController -@RequiredArgsConstructor -@Api(tags = "业务:影刀定时任务日志管理") -public class QuartzLogController { - - @Resource - private SysQuartzLogService sysQuartzLogService; - /** - * 分页查询影刀日志信息 - */ - @ApiOperation("分页查询影刀日志信息") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!") - }) - @Log("分页查询影刀任务信息") - @AnonymousAccess - @PostMapping("/list") - public Dto getLogsList(@Valid @RequestBody SysQuartzLogListDTO dto) { - PageUtils pageUtilsResult= sysQuartzLogService.searchPageList(dto.getiPage(), dto.getWrapper()); - return Dto.returnResult(pageUtilsResult); - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/group/controller/base/SdsController.java b/wjcy-system/src/main/java/me/zhengjie/modules/group/controller/base/SdsController.java deleted file mode 100644 index 83943bf..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/group/controller/base/SdsController.java +++ /dev/null @@ -1,320 +0,0 @@ -package me.zhengjie.modules.group.controller.base; - - -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import me.zhengjie.annotation.AnonymousAccess; -import me.zhengjie.annotation.Log; -import me.zhengjie.dto.Dto; -import me.zhengjie.service.vo.CtApplyListVO; -import me.zhengjie.utils.HttpClientUtil; -import me.zhengjie.utils.MD5Util; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; - -import javax.validation.Valid; -import java.util.HashMap; -import java.util.Map; -import java.util.TreeMap; - -/** - * Author: rch - * Data: 2022-11-21 - * Description SDS验签 - */ -@Validated -@RequestMapping("/api/sds") -@RestController -@Api(tags = "业务:SDS验签") -public class SdsController { - - String sdsUrlPro = "https://merchantapi.sdspod.com"; - String sdsUrlTest = "https://merchantapitest.sdspod.com"; - String appId = "LPE3NKxile1dr0TGW5hOyFzfc8S4tBUR"; - String appsecret = "DNZlt9UYOAcwCx3evHEM7nr8kuz1XRGsWjJyQpKFq5SdPf0oabBm46hVgiT2LIHViRkIFojPUV7O4FM5SQZsivJ734X7YgPBuYgyH85OUoGzbzj9Wa1Smd1AYC4GyUHA"; - - // 上传图片接口 -// @ApiOperation("上传图片接口") -// @Log("上传图片接口") -// @PostMapping("/url") -// @AnonymousAccess -// public Dto url(@Valid @RequestBody ImageUrlDTO dto){ -// -// return Dto.returnErrorResult("true"); -// } - - @ApiOperation("获取可设计产品的信息") - @Log("获取可设计产品的信息") - @GetMapping("/products") - @AnonymousAccess - public Dto products(@RequestParam(value = "page") Integer page, - @RequestParam(value = "size") Integer size){ - - // sdsUrlTest - Long millisTime = System.currentTimeMillis(); - String url = "/gateway/products/design_infos"; - Map map = new HashMap<>(); - map.put("page", page); - map.put("size", size); - map.put("_timestamp", millisTime); - - String sign = getSign(map); - System.out.println("生成sign的url:" + sign); - String md5Sign = MD5Util.md5(sign); - System.out.println("生成的sign:" + md5Sign); - map.clear(); - map.put("_appid", appId); - map.put("_timestamp", millisTime); - map.put("_sign", md5Sign); - map.put("page", page); - map.put("size", size); - - String realStrUrl = sdsUrlPro + url; - String returnStr = HttpClientUtil.getHttp(realStrUrl, map); - System.out.println("获取可设计产品的信息:" + returnStr); - return Dto.returnErrorResult(returnStr); - } - - @ApiOperation("获取产品详情") - @Log("获取产品详情") - @GetMapping("/productsDetail") - @AnonymousAccess - public Dto products(@RequestParam Integer id){ - - // sdsUrlTest - Long millisTime = System.currentTimeMillis(); - String url = "/gateway/products/" + id; - Map map = new HashMap<>(); - map.put("_timestamp", millisTime); - - String sign = getSign(map); - System.out.println("生成sign的url:" + sign); - String md5Sign = MD5Util.md5(sign); - System.out.println("生成的sign:" + md5Sign); - map.clear(); - map.put("_sign", md5Sign); - map.put("_timestamp", millisTime); - map.put("_appid", appId); - - String realStrUrl = sdsUrlPro + url; - String returnStr = HttpClientUtil.getHttp(realStrUrl, map); - System.out.println("获取产品详情:" + returnStr); - return Dto.returnErrorResult(returnStr); - } - - - @ApiOperation("获取成品列表") - @Log("获取成品列表") - @GetMapping("/endproducts") - @AnonymousAccess - public Dto endproducts(@RequestParam(value = "page") Integer page, - @RequestParam(value = "size") Integer size, - @RequestParam(value = "userId", required = false) Long userId, - @RequestParam(value = "designProductType", required = false) String designProductType){ - - // sdsUrlTest - Long millisTime = System.currentTimeMillis(); - String url = "/gateway/endproducts"; - Map map = new HashMap<>(); - map.put("page", page); - map.put("size", size); - map.put("_timestamp", millisTime); -// map.put("userId", page); -// map.put("designProductType", "SINGLE"); - - String sign = getSign(map); - System.out.println("生成sign的url:" + sign); - String md5Sign = MD5Util.md5(sign); - System.out.println("生成的sign:" + md5Sign); - map.clear(); - map.put("_appid", appId); - map.put("_timestamp", millisTime); - map.put("_sign", md5Sign); - map.put("page", page); - map.put("size", size); -// map.put("designProductType", "SINGLE"); - - String realStrUrl = sdsUrlPro + url; - String returnStr = HttpClientUtil.getHttp(realStrUrl, map); - System.out.println("获取成品列表响应:" + returnStr); - return Dto.returnErrorResult(returnStr); - } - - - // url getUrlHttp - @ApiOperation("获取成品列表Url") - @Log("获取成品列表Url") - @GetMapping("/endproductsUrl") - @AnonymousAccess - public Dto endproductsUrl(@RequestParam(value = "page") Integer page, - @RequestParam(value = "size") Integer size, - @RequestParam(value = "userId", required = false) Long userId, - @RequestParam(value = "designProductType", required = false) String designProductType){ - - // sdsUrlTest - Long millisTime = System.currentTimeMillis(); - String url = "/gateway/endproducts"; - Map map = new HashMap<>(); - map.put("page", page); - map.put("size", size); - map.put("_timestamp", millisTime); -// map.put("userId", page); -// map.put("designProductType", "SINGLE"); - - String sign = getSign(map); - System.out.println("生成sign的url:" + sign); - String md5Sign = MD5Util.md5(sign); - System.out.println("生成的sign:" + md5Sign); - map.clear(); - - map.put("_appid", appId); - map.put("_timestamp", millisTime); - map.put("_sign", md5Sign); - map.put("page", page); - map.put("size", size); -// map.put("designProductType", "SINGLE"); - - String realStrUrl = sdsUrlPro + url + "?page=" + page + "&size=" + size + "&_appid=" + appId + "&_sign=" + md5Sign + "&_timestamp=" + millisTime; - System.out.println("realStrUrl:" + realStrUrl); - String returnStr = HttpClientUtil.getUrlHttp(realStrUrl); - System.out.println("获取成品列表响应:" + returnStr); - return Dto.returnErrorResult(returnStr); - } - - @ApiOperation("根据成品ID获取成品信息") - @Log("根据成品ID获取成品信息") - @GetMapping("/endproductsById") - @AnonymousAccess - public Dto endproductsById(@RequestParam(value = "id") String id){ - // sdsUrlTest - Long millisTime = System.currentTimeMillis(); - String url = "/gateway/endproducts/" + id; - Map map = new HashMap<>(); - map.put("_timestamp", millisTime); - - String sign = getSign(map); - System.out.println("生成sign的url:" + sign); - String md5Sign = MD5Util.md5(sign); - System.out.println("生成的sign:" + md5Sign); - map.clear(); - map.put("_sign", md5Sign); - map.put("_timestamp", millisTime); - map.put("_appid", appId); - - String realStrUrl = sdsUrlPro + url; - String returnStr = HttpClientUtil.getHttp(realStrUrl, map); - System.out.println("根据成品ID获取成品信息:" + returnStr); - return Dto.returnErrorResult(returnStr); - } - - - @ApiOperation("根据成品ID获取成品详细信息包含产品详细信息") - @Log("根据成品ID获取成品详细信息包含产品详细信息") - @GetMapping("/endproductsDetailById") - @AnonymousAccess - public Dto endproductsDetailById(@RequestParam(value = "id") String id){ - // sdsUrlTest - Long millisTime = System.currentTimeMillis(); - String url = "/gateway/endproducts/" + id + "/huajuDetail"; - Map map = new HashMap<>(); - map.put("_timestamp", millisTime); - - String sign = getSign(map); - System.out.println("生成sign的url:" + sign); - String md5Sign = MD5Util.md5(sign); - System.out.println("生成的sign:" + md5Sign); - map.clear(); - map.put("_sign", md5Sign); - map.put("_timestamp", millisTime); - map.put("_appid", appId); - - String realStrUrl = sdsUrlPro + url; - String returnStr = HttpClientUtil.getHttp(realStrUrl, map); - System.out.println("根据成品ID获取成品详细信息包含产品详细信息:" + returnStr); - return Dto.returnErrorResult(returnStr); - } - - - @ApiOperation("地址") - @Log("地址") - @GetMapping("/areas") - @AnonymousAccess - public Dto areas(@RequestParam(value = "area_code", required = false) Long areaCode){ - - // sdsUrlTest - Long millisTime = System.currentTimeMillis(); - String url = "/gateway/areas/" + areaCode + "/items"; - Map map = new HashMap<>(); -// map.put("area_code", areaCode); - map.put("_timestamp", millisTime); - String sign = getSign(map); - String md5Sign = MD5Util.md5(sign); - map.clear(); - map.put("_sign", md5Sign); - map.put("_timestamp", millisTime); - map.put("_appid", appId); - - String realStrUrl = sdsUrlPro + url; - String returnStr = HttpClientUtil.getHttp(realStrUrl, map); - System.out.println("地址:" + returnStr); - return Dto.returnErrorResult(returnStr); - } - - - @ApiOperation("素材") - @Log("素材") - @GetMapping("/gateway/materials") - @AnonymousAccess - public Dto materials(@RequestParam(value = "page") Integer page, - @RequestParam(value = "size") Integer size, - @RequestParam(value = "userId", required = false) Long userId){ - - // sdsUrlTest - Long millisTime = System.currentTimeMillis(); - String url = "/gateway/materials"; - Map map = new HashMap<>(); - map.put("page", page); - map.put("size", size); - map.put("_timestamp", millisTime); -// map.put("userId", page); -// map.put("designProductType", "SINGLE"); - - String sign = getSign(map); - System.out.println("生成sign的url:" + sign); - String md5Sign = MD5Util.md5(sign); - System.out.println("生成的sign:" + md5Sign); - map.clear(); - - map.put("_appid", appId); - map.put("_timestamp", millisTime); - map.put("_sign", md5Sign); - map.put("page", page); - map.put("size", size); -// map.put("designProductType", "SINGLE"); - - String realStrUrl = sdsUrlPro + url + "?page=" + page + "&size=" + size + "&_appid=" + appId + "&_sign=" + md5Sign + "&_timestamp=" + millisTime; - System.out.println("realStrUrl:" + realStrUrl); - String returnStr = HttpClientUtil.getUrlHttp(realStrUrl); - System.out.println("获取成品列表响应:" + returnStr); - return Dto.returnErrorResult(returnStr); - } - - // Get验签 - public String getSign(Map map) { - - map.put("_appid", appId); - map.put("_appsecret", appsecret); - - - TreeMap params = new TreeMap(); - params.putAll(map); - - StringBuilder strBuilder = new StringBuilder(); - for (String key : params.keySet()) { - strBuilder.append(key).append("=").append(params.get(key)).append("&"); - } - strBuilder.deleteCharAt(strBuilder.length() - 1); - System.out.println(strBuilder); - return strBuilder.toString(); - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/group/controller/base/SysQuartzJobController.java b/wjcy-system/src/main/java/me/zhengjie/modules/group/controller/base/SysQuartzJobController.java deleted file mode 100644 index 7e5a4d3..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/group/controller/base/SysQuartzJobController.java +++ /dev/null @@ -1,206 +0,0 @@ -package me.zhengjie.modules.group.controller.base; - - -import cn.hutool.core.lang.Snowflake; -import cn.hutool.core.util.ObjectUtil; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import me.zhengjie.annotation.AnonymousAccess; -import me.zhengjie.annotation.FormSubmission; -import me.zhengjie.annotation.Log; -import me.zhengjie.dto.Dto; -import me.zhengjie.entity.CtApply; -import me.zhengjie.entity.SysQuartzJob; -import me.zhengjie.error.ErrorCodeEnum; -import me.zhengjie.modules.group.dto.IdDTO; -import me.zhengjie.modules.group.dto.SysQuartzJobAddDTO; -import me.zhengjie.modules.group.dto.SysQuartzJobListDTO; -import me.zhengjie.modules.group.dto.SysQuartzJobUpdateDTO; -import me.zhengjie.modules.quartz.service.SysQuartzJobService; -import me.zhengjie.service.CtApplyService; -import me.zhengjie.utils.StringUtils; -import me.zhengjie.utils.YdParamsCheck; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import javax.annotation.Resource; -import javax.validation.Valid; - -/** - * @Description 群控管理-影刀定时任务 - * @Date 2022/7/21 - * @Author zhw - */ -@Validated -@RequestMapping("/api/quartzJob") -@RestController -@Api(tags = "业务:影刀定时任务管理") -public class SysQuartzJobController { - @Resource - private SysQuartzJobService sysQuartzJobService; - @Resource - private CtApplyService ctApplyService; - @Resource - private Snowflake snowflake; - - - /** - * 分页查询影刀任务信息 - */ - @ApiOperation("分页查询影刀任务信息") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!") - }) - @Log("分页查询影刀任务信息") - @AnonymousAccess - @PostMapping("/list") - public Dto getQuartzJobList(@Valid @RequestBody SysQuartzJobListDTO dto) { - return Dto.returnResult(sysQuartzJobService.searchPageList(dto.getiPage(), dto.getWrapper())); - } - - /** - * 新增影刀任务信息 - */ - @ApiOperation("新增影刀任务信息") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!"), - @ApiResponse(code = 3401, message = "影刀应用信息异常, 请检查后重试!") - }) - @Log("新增影刀任务信息") - @AnonymousAccess - @PostMapping("/add") - @FormSubmission - @Transactional(rollbackFor = Exception.class) - public Dto addQuartzJob(@Valid @RequestBody SysQuartzJobAddDTO dto) { - - // TODO 应用已后台添加的枚举 TaskInfoEnum 为准 根据 taskName 区分应用 逻辑 匹配params - CtApply ctApply = ctApplyService.getById(dto.getApplyId()); - if (ObjectUtil.isEmpty(ctApply)) { - return Dto.getInstance(ErrorCodeEnum.ERROR_NOT_FIND_TASK); - } - - String taskName = ctApply.getTaskName(); - String params = dto.getParams(); - Long taskNum = snowflake.nextId(); - dto.setTaskNum(taskNum); - // TODO 客户端处理 走 param模式还是 回显模式 这里先设置未null - if (!YdParamsCheck.paramIsJson(params)) { - // 测试的第一个应用 刷单 拼装params - String assemblyParams = sysQuartzJobService.assemblyParamAccordingToItem(params, taskName, taskNum); - if (StringUtils.isEmpty(assemblyParams)) { - return Dto.getInstance(ErrorCodeEnum.ERROR_NOT_FIND_TASK); - } else { - dto.setParams(assemblyParams); - } - } - - return sysQuartzJobService.addQuartzJob(dto); - } - - /** - * 根据ID删除影刀任务信息 - */ - @ApiOperation("根据ID删除影刀任务信息") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!") - }) - @Log("根据ID删除影刀任务信息") - @PostMapping("/delete") - public Dto deleteQuartzJob(@Valid @RequestBody IdDTO idDTO) { - return Dto.returnResult(sysQuartzJobService.deleteQuartzJobById(idDTO.getId())); - } - - /** - * 编辑影刀任务信息 - */ - @ApiOperation("编辑影刀任务信息") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!"), - @ApiResponse(code = 3401, message = "影刀应用信息异常, 请检查后重试!") - }) - @Log("编辑影刀任务信息") - @PostMapping("/edit") - @FormSubmission - public Dto updateQuartzJob(@Valid @RequestBody SysQuartzJobUpdateDTO dto) { - CtApply ctApply = ctApplyService.getById(dto.getApplyId()); - if (ObjectUtil.isEmpty(ctApply)) { - return Dto.getInstance(ErrorCodeEnum.ERROR_NOT_FIND_TASK); - } - String taskName = ctApply.getTaskName(); - String params = dto.getParams(); - // TODO 客户端处理 走 param模式还是 回显模式 这里先设置未null - if (!YdParamsCheck.paramIsJson(params)) { - // TODO 先这样吧,先不回头去调整了。先能弄不考虑其他 - SysQuartzJob sysQuartzJob = sysQuartzJobService.getById(dto.getJobId()); - // 测试的第一个应用 刷单 拼装params - String assemblyParams = sysQuartzJobService.assemblyParamAccordingToItem(params, taskName, sysQuartzJob.getTaskNum()); - if (StringUtils.isEmpty(assemblyParams)) { - return Dto.getInstance(ErrorCodeEnum.ERROR_NOT_FIND_TASK); - } else { - dto.setParams(assemblyParams); - } - } - return sysQuartzJobService.updateQuartzJobById(dto); - } - - /** - * 根据ID查询影刀任务信息 - */ - @ApiOperation("根据ID查询影刀任务信息") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!") - }) - @Log("根据ID查询影刀任务信息") - @PostMapping("/getById") - public Dto getQuartzJobById(@Valid @RequestBody IdDTO idDTO) { - return Dto.returnResult(sysQuartzJobService.getById(idDTO.getId())); - } - - /** - * 根据ID修改任务状态 - * @param idDTO - * @return - */ - @ApiOperation("根据ID修改任务状态") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!") - }) - @Log("根据ID修改任务状态") - @PostMapping("/modifyStatus") - public Dto modifyJobStatus(@Valid @RequestBody IdDTO idDTO) { - return Dto.returnResult(sysQuartzJobService.modifyJobStatus(idDTO.getId())); - } - - /** - * 执行影刀任务 - * - * - * @param idDTO - * @return Dto - */ - @ApiOperation("执行影刀任务") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!") - }) - @Log("执行定时任务") - @PostMapping("/exec") - public Dto execution(@Valid @RequestBody IdDTO idDTO) { - Boolean one = true; - one = !one; - return Dto.returnResult(sysQuartzJobService.executionById(idDTO.getId())); - } - -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/group/controller/base/YdCallBackController.java b/wjcy-system/src/main/java/me/zhengjie/modules/group/controller/base/YdCallBackController.java deleted file mode 100644 index d3c4589..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/group/controller/base/YdCallBackController.java +++ /dev/null @@ -1,122 +0,0 @@ -package me.zhengjie.modules.group.controller.base; - -import cn.hutool.core.util.ObjectUtil; -import cn.hutool.json.JSONObject; -import cn.hutool.json.JSONUtil; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import lombok.extern.slf4j.Slf4j; -import me.zhengjie.annotation.AnonymousAccess; -import me.zhengjie.annotation.Log; -import me.zhengjie.config.YdApiProperties; -import me.zhengjie.dto.Dto; -import me.zhengjie.entity.CtRebot; -import me.zhengjie.entity.ReturnObje; -import me.zhengjie.entity.YdSign; -import me.zhengjie.enums.YesOrNoEnum; -import me.zhengjie.error.ErrorCodeEnum; -import me.zhengjie.service.CtRebotService; -import me.zhengjie.utils.YdSignUtil; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.validation.Valid; -import java.util.Map; - -/** - * @Description - * @Date 2022/7/23 - * @Author rch - */ -@Slf4j -@Validated -@RequestMapping("/api/yd") -@RestController -@Api(tags = "业务:影刀回调管理Demo") -public class YdCallBackController { - - @Resource - private CtRebotService ctRebotService; - /** - * 影刀回调Demo - */ - @ApiOperation("影刀回调Demo") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!"), - @ApiResponse(code = 3700, message = "影刀回调参数空值异常!"), - @ApiResponse(code = 3701, message = "影刀回调鉴权异常!") - }) - @Log(value = "影刀回调") - @PostMapping("/callback") - @AnonymousAccess - public Dto callback(@Valid @RequestBody String data, HttpServletRequest httpServletRequest){ - log.info("=======影刀回调=======callback"); - String requestUrl = httpServletRequest.getRequestURI(); - Map map = httpServletRequest.getParameterMap(); - if (ObjectUtil.isEmpty(map.get("sign"))) { - return Dto.getInstance(ErrorCodeEnum.ERROR_PARAM_NULL); - } - - String getSign = map.get("sign")[0]; - JSONObject jsonObject = JSONUtil.parseObj(data); - String accessKeyId = YdApiProperties.ACCESS_KEY_ID; - String accessKeySecret = YdApiProperties.ACCESS_KEY_SECRET; - if (ObjectUtil.isEmpty(getSign) - || ObjectUtil.isEmpty(jsonObject) - || ObjectUtil.isEmpty(accessKeyId) - || ObjectUtil.isEmpty(accessKeySecret)) { - return Dto.getInstance(ErrorCodeEnum.ERROR_PARAM_NULL); - } - - // 根据task枚举获取 应用信息 取出 accessKey 和 accessKeySecret 用于鉴权 - - - // 鉴权 - YdSign ydSign = new YdSign(); - ydSign.setTimestamp(Long.valueOf(map.get("timestamp")[0])); - ydSign.setAccessKeyId(accessKeyId); - ydSign.setAccessKeySecret(accessKeySecret); - ydSign.setBodyMd5(map.get("bodyMd5")[0]); - - log.info("-------map:{}" , JSONUtil.toJsonStr(map)); - log.info("====ydSign====={}", JSONUtil.toJsonStr(ydSign)); - String sign = YdSignUtil.getSign(ydSign); - log.info("====sign:{} ---getSign:{}", sign, getSign); - if (ObjectUtil.isEmpty(sign) || !getSign.equals(sign)) { - return Dto.getInstance(ErrorCodeEnum.ERROR_CALLBACK_SIGN_NULL); - } - - System.out.println("===================data:" + data); - - - // TODO 拿到返回信息 根据回调知道是那个应用的业务场景 这里算是刷单系统的 - // 1.得到结果 根据结果修改 刷单信息状态 以及响应信息 - - - // TODO 获取设备id 然后修改设备状态是未占用 - ReturnObje returnObje = JSONUtil.toBean(data, ReturnObje.class); - String rebotClientName = returnObje.getRobotClientName(); - CtRebot ctRebot = ctRebotService.getByAccountNameLock(rebotClientName); - if (ObjectUtil.isEmpty(ctRebot) || !YesOrNoEnum.YES.eqValue(ctRebot.getStatus())) { - // 有问题 不执行 - System.out.println("===========设备有问题==========="); - return Dto.returnResult(true); - } else { - // 修改机器人状态 不管是什么状态,执行完成之后在我们平台就是修改为 待占用即可 - CtRebot updateCtRebot = new CtRebot(); - updateCtRebot.setId(ctRebot.getId()); - updateCtRebot.setStatus(YesOrNoEnum.NO.value()); - Boolean resultBoolean = ctRebotService.updateById(updateCtRebot); - return Dto.returnResult(resultBoolean); - } - } - -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/group/controller/callbcak/BossTaskCallBackController.java b/wjcy-system/src/main/java/me/zhengjie/modules/group/controller/callbcak/BossTaskCallBackController.java deleted file mode 100644 index ce0894e..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/group/controller/callbcak/BossTaskCallBackController.java +++ /dev/null @@ -1,84 +0,0 @@ -package me.zhengjie.modules.group.controller.callbcak; - -import cn.hutool.json.JSONUtil; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import lombok.extern.slf4j.Slf4j; -import me.zhengjie.annotation.AnonymousAccess; -import me.zhengjie.annotation.Log; -import me.zhengjie.dto.Dto; -import me.zhengjie.entity.CtApply; -import me.zhengjie.entity.ReturnObje; -import me.zhengjie.entity.quartz.JobQueryByUuidReturn; -import me.zhengjie.enums.TaskInfoEnum; -import me.zhengjie.service.CtApplyService; -import me.zhengjie.service.YdQuartzService; -import me.zhengjie.utils.YdCallBackUtil; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.validation.Valid; - -/** - * @Description - * @Date 2022/7/23 - * @Author rch - */ -@Slf4j -@Validated -@RequestMapping("/api/bossTask") -@RestController -@Api(tags = "回调:Boss-职位查询采集-影刀回调") -public class BossTaskCallBackController { - - @Resource - private CtApplyService ctApplyService; - @Resource - private YdQuartzService ydQuartzService; - /** - * Boss-职位查询采集-影刀回调 - */ - @ApiOperation("Boss-职位查询采集-影刀回调") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!"), - @ApiResponse(code = 3700, message = "影刀回调参数空值异常!"), - @ApiResponse(code = 3701, message = "影刀回调鉴权异常!") - }) - @Log(value = "Boss-职位查询采集-影刀回调") - @PostMapping("/callback") - @AnonymousAccess - public Dto callback(@Valid @RequestBody String data, HttpServletRequest httpServletRequest){ - // 根据task枚举获取 应用信息 取出 accessKey 和 accessKeySecret 用于鉴权 - YdCallBackUtil ydCallBackUtil = new YdCallBackUtil(); - CtApply ctApply = ctApplyService.getApplyByTaskAndMethod(TaskInfoEnum.BOSS_TASK.getTaskName(), TaskInfoEnum.BOSS_TASK.getMethodName()); - Dto dto = ydCallBackUtil.callback(httpServletRequest, ctApply, data); - if (!dto.success(dto)) { - return dto; - } - - // 执行自己的业务逻辑 - log.info("============bossTask 回调鉴权完成 开始执行对应的定时业务逻辑================begin="); - // 获取自己想要的数据 - ReturnObje returnObje = JSONUtil.toBean(data, ReturnObje.class); - log.info("====returnObje====:{}", JSONUtil.toJsonStr(returnObje)); - // 获取应用名称 获取机器人名称 - // 执行自己的业务逻辑 - log.info("============刷单回调鉴权完成 开始执行对应的定时业务逻辑================begin="); - log.info("回调======data:" + data); - // 获取自己想要的数据 - JobQueryByUuidReturn jobQueryByUuidReturn = ydQuartzService.queryJobUuid(returnObje.getJobUuid(), ctApply.getAccessKeyId(), ctApply.getAccessKeySecret()); - log.info("====jobQueryByUuidReturn====:{}", JSONUtil.toJsonStr(jobQueryByUuidReturn)); - - log.info("============bossTask 回调鉴权完成 开始执行对应的定时业务逻辑================end==="); - return dto; - } - -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/group/controller/callbcak/ClickFarmingCallBackController.java b/wjcy-system/src/main/java/me/zhengjie/modules/group/controller/callbcak/ClickFarmingCallBackController.java deleted file mode 100644 index 3887c5d..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/group/controller/callbcak/ClickFarmingCallBackController.java +++ /dev/null @@ -1,432 +0,0 @@ -package me.zhengjie.modules.group.controller.callbcak; - -import cn.hutool.core.bean.BeanUtil; -import cn.hutool.core.date.DateUtil; -import cn.hutool.core.lang.Snowflake; -import cn.hutool.core.util.ObjectUtil; -import cn.hutool.json.JSONUtil; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import lombok.extern.slf4j.Slf4j; -import me.zhengjie.annotation.AnonymousAccess; -import me.zhengjie.annotation.Log; -import me.zhengjie.constant.PublicConstant; -import me.zhengjie.dto.Dto; -import me.zhengjie.entity.*; -import me.zhengjie.entity.quartz.Boss; -import me.zhengjie.entity.quartz.JobQueryByUuidReturn; -import me.zhengjie.entity.quartz.Param; -import me.zhengjie.enums.*; -import me.zhengjie.modules.quartz.service.SysQuartzJobService; -import me.zhengjie.service.*; -import me.zhengjie.service.vo.CtBuyerDetailVO; -import me.zhengjie.utils.CronUtils; -import me.zhengjie.utils.RedisUtils; -import me.zhengjie.utils.YdCallBackUtil; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.validation.Valid; -import java.util.List; -import java.util.Map; -import java.util.Random; -import java.util.stream.Collectors; - -/** - * @Description - * 刷单定时任务回调逻辑 - * 回调需要鉴权,鉴权是根据 accesskey accessKeySrect - * 我们应用确认之后 accesskey 和 Srect是确定的 - * - * @Date 2022-8-23 - * @Author rch - */ -@Slf4j -@Validated -@RequestMapping("/api/clickFarming") -@RestController -@Api(tags = "回调:速卖通刷单-影刀回调") -public class ClickFarmingCallBackController { - - @Resource - private CtApplyService ctApplyService; - @Resource - private YdQuartzService ydQuartzService; - @Resource - private CtClickFarmingService ctClickFarmingService; - @Resource - private CtClickOrderService ctClickOrderService; - @Resource - private RedisUtils redisUtils; - @Resource - private CtBuyerService ctBuyerService; - @Resource - private SysQuartzJobService sysQuartzJobService; - @Resource - private Snowflake snowflake; - @Resource - private SettingSiteService settingSiteService; - - private final String STAET_MODULAR = "】任务失败,在【"; - private final String END_MODULAR = "】中第"; - private final String END_LINE_NUMBER = "行:出错"; - private final Integer START_TASK_TIME = 20; - private final String RE_EXECTE_KEY = "reExecuteKey"; - /** - * 速卖通刷单-影刀回调 - */ - @ApiOperation("速卖通刷单-影刀回调") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!"), - @ApiResponse(code = 3700, message = "影刀回调参数空值异常!"), - @ApiResponse(code = 3701, message = "影刀回调鉴权异常!") - }) - @Log(value = "速卖通刷单-影刀回调") - @PostMapping("/callback") - @AnonymousAccess - @Transactional(rollbackFor = Exception.class) - public Dto callback(@Valid @RequestBody String data, HttpServletRequest httpServletRequest){ - - // 根据task枚举获取 应用信息 取出 accessKey 和 accessKeySecret 用于鉴权 - YdCallBackUtil ydCallBackUtil = new YdCallBackUtil(); - CtApply ctApply = ctApplyService.getApplyByTaskAndMethod(TaskInfoEnum.CLICK_FARMING.getTaskName(), TaskInfoEnum.CLICK_FARMING.getMethodName()); - Dto dto = ydCallBackUtil.callback(httpServletRequest, ctApply, data); - if (!dto.success(dto)) { - return dto; - } - - // 执行自己的业务逻辑 - log.info("============刷单回调鉴权完成 开始执行对应的定时业务逻辑================begin="); - log.info("回调======data:" + data); - // 获取自己想要的数据 - ReturnObje returnObje = JSONUtil.toBean(data, ReturnObje.class); - // job ID - String jobUuid = returnObje.getJobUuid(); - - // TODO 回调会重试 这里注意保证幂等 - // TODO 所以需要对接方在业务层面保障幂等(可以根据jobUuid或者taskUuid进行幂等保障,视startJob时是指定应用和机器人模式还是指定任务模式) - String keyJobUuid = PublicConstant.getJobUuidKeyPrefix(jobUuid); - if (!redisUtils.setIfAbsent(keyJobUuid, DateUtil.now())) { - log.info("-刷单回调接口-幂等性:keyJobUuid:" + keyJobUuid); - return Dto.returnResult(true); - } - - log.info("====returnObje====:{}", JSONUtil.toJsonStr(returnObje)); - JobQueryByUuidReturn jobQueryByUuidReturn = ydQuartzService.queryJobUuid(returnObje.getJobUuid(), ctApply.getAccessKeyId(), ctApply.getAccessKeySecret()); - log.info("====jobQueryByUuidReturn====:{}", JSONUtil.toJsonStr(jobQueryByUuidReturn)); - List inputsList = jobQueryByUuidReturn.getData().getRobotParams().getInputs(); - // 获取id - String id = null; - String buyerName = null; - String taskNum = null; - for (ResultObj resultObj:inputsList) { - if ("id".equals(resultObj.getName())) { - id = resultObj.getValue(); - } - - if ("account".equals(resultObj.getName())) { - buyerName = resultObj.getValue(); - } - - if ("taskNum".equals(resultObj.getName())) { - taskNum = resultObj.getValue(); - } - } - - Integer status = ClickFarmingStatusEnum.EXECUTION_FAILE.value(); - if ("finish".equals(jobQueryByUuidReturn.getData().getStatus())) { - status = ClickFarmingStatusEnum.EXECUTION_SUCCESS.value(); - } - - // 执行失败 - Boolean resultBoolean = false; - if (ObjectUtil.isNotEmpty(id)) { - CtClickFarming ctClickFarming = new CtClickFarming(); - ctClickFarming.setId(Long.valueOf(id)); - - // 获取买家信息并修改买家信息 - CtBuyer ctBuyer = ctBuyerService.getBuyerOccupyStatusLock(buyerName); - if (ObjectUtil.isNotEmpty(ctBuyer) && BuyerOccupyStatusEnum.OCCUPIED.value().equals(ctBuyer.getOccupyStatus())) { - ctBuyer.setOccupyStatus(BuyerOccupyStatusEnum.UN_OCCUPIED.value()); - resultBoolean = ctBuyerService.updateById(ctBuyer); - } - - // TODO 需要更新的字段 从这里获取影刀返回的 然后接着设置到 对应的 基础信息里 - List outputsList = jobQueryByUuidReturn.getData().getRobotParams().getOutputs(); - if (resultBoolean && ObjectUtil.isNotEmpty(outputsList)) { - Map resultObjMap = outputsList.stream().collect(Collectors.toMap(ResultObj::getName, ResultObj::getValue)); - CtClickOrder ctClickOrder = BeanUtil.mapToBean(resultObjMap, CtClickOrder.class, false); - if (ObjectUtil.isNotEmpty(ctClickOrder)) { - if (ObjectUtil.isNotEmpty(ctClickOrder.getPaymentResults()) && "Awaiting payment".equals(ctClickOrder.getPaymentResults())) { - status = ClickFarmingStatusEnum.AWAITING_PAYMENT.value(); - } - // 设置订单 公司 平台信息 - ctClickOrder.setCompanyId(ctBuyer.getCompanyId()); - ctClickOrder.setType(OrderTypeEnum.CLICK_FARMING.value()); - if (ctClickOrderService.save(ctClickOrder)) { - ctClickFarming.setCtClickOrderId(ctClickOrder.getId()); - } - } - } else { - // 解析json 返回错误类型 - status = analysisReturnJson(jobQueryByUuidReturn.getData().getRemark()); - } - - ctClickFarming.setStatus(status); - if (ClickFarmingStatusEnum.EXECUTION_FAILE.value().equals(status) || ClickFarmingStatusEnum.PAY_OK_ERROR.value().equals(status) || ClickFarmingStatusEnum.AWAITING_PAYMENT.value().equals(status)) { - ctClickFarming.setResponse(jobQueryByUuidReturn.getData().getRemark()); - }else { - ctClickFarming.setResponse(jobQueryByUuidReturn.getData().getStatusName()); - } - resultBoolean = ctClickFarmingService.updateById(ctClickFarming); - // TODO 判断状态 如果是执行失败 (未下单成功 未支付的则直接重新创建任务重新执行-(换个买家)) - /** - * 1.根据买家规则返回买家信息 - * 2.用新买家信息 创建新的定时任务 - */ - // 查询刷单信息 默认不执行 只有设置1才执行 - String reExecuteValue = settingSiteService.getValue(RE_EXECTE_KEY); - if (ObjectUtil.isNotEmpty(reExecuteValue) && "1".equals(reExecuteValue)) { - CtClickFarming ctClickFarmingOld = ctClickFarmingService.getById(id); - if (ClickFarmingStatusEnum.EXECUTION_FAILE.value().equals(status)) { - SysQuartzJob sysQuartzJob = sysQuartzJobService.getByTaskNum(taskNum); - if (ObjectUtil.isEmpty(sysQuartzJob)) { - return Dto.returnResult(false); - } - resultBoolean = reExecuteTask(sysQuartzJob, ctClickFarmingOld); - } - } - } - - log.info("============刷单回调鉴权完成 开始执行对应的定时业务逻辑================end==="); - return Dto.returnResult(resultBoolean); - } - - /** - * 执行失败-重新创建定时任务 - * @param sysQuartzJob - * @return - */ - private Boolean reExecuteTask(SysQuartzJob sysQuartzJob, CtClickFarming ctClickFarming) { - // TODO 根据规则 修改 param 参数信息 以及 - log.info("刷单任务-执行失败-重新创建定时任务--sysQuartzJob:{} --ctClickFarming:{}", JSONUtil.toJsonStr(sysQuartzJob), JSONUtil.toJsonStr(ctClickFarming)); - // 创建后启用状态 并且 失败不暂停(失败后要暂停的) - sysQuartzJob.setIsPause(TaskIsPauseEnum.NOT_PAUSE.value()); - sysQuartzJob.setPauseAfterFailure(TaskIsPauseEnum.IS_PAUSE.value()); - // 设置执行时间 - String cronStr = CronUtils.onlyOnce(DateUtil.formatDateTime(DateUtil.offsetSecond(DateUtil.date(), START_TASK_TIME))); - sysQuartzJob.setCronExpression(cronStr); - // 新的定时任务taskNum - Long taskNum = snowflake.nextId(); - sysQuartzJob.setJobName(jobNameNew(sysQuartzJob.getJobName(), sysQuartzJob.getTaskNum().toString())); - // 买家信息 - String paramsStr = sysQuartzJob.getParams(); - Boss bossObj = JSONUtil.toBean(paramsStr, Boss.class); - log.info("bossObj--before:" + JSONUtil.toJsonStr(bossObj)); - List paramList = bossObj.getParams(); - Param paramAccount = paramList.stream().filter(r->"account".equals(r.getName())).findFirst().get(); - Param paramCountry = paramList.stream().filter(r->"country".equals(r.getName())).findFirst().get(); - // 替换新的买家信息 - CtBuyerDetailVO ctBuyerDetailVO = getRuleCtBuyer(paramAccount.getValue(), paramCountry.getValue(), ctClickFarming); - if (ObjectUtil.isEmpty(ctBuyerDetailVO)) { - log.info("买家信息全部执行完成,没有可选择的买家信息!-任务不在重试"); - return false; - } - for (Param paramObj:paramList) { - if (("country").equals(paramObj.getName())) { - paramObj.setValue(ctBuyerDetailVO.getCountry()); - } - if (("account").equals(paramObj.getName())) { - paramObj.setValue(ctBuyerDetailVO.getAccount()); - } - if (("pwd").equals(paramObj.getName())) { - paramObj.setValue(ctBuyerDetailVO.getPwd()); - } - if (("vpnShare").equals(paramObj.getName())) { - paramObj.setValue(ctBuyerDetailVO.getVpn()); - } - // 信用卡 - if (("cardName").equals(paramObj.getName())) { - paramObj.setValue(ctBuyerDetailVO.getHolderSurname() + " " + ctBuyerDetailVO.getHolderName()); - } - if (("cardNumber").equals(paramObj.getName())) { - paramObj.setValue(ctBuyerDetailVO.getNumber()); - } - if (("cardPwd").equals(paramObj.getName())) { - paramObj.setValue(ctBuyerDetailVO.getCardPwd()); - } - if (("taskNum").equals(paramObj.getName())) { - paramObj.setValue(taskNum.toString()); - } - } - - log.info("bossObj--after:" + JSONUtil.toJsonStr(bossObj)); - sysQuartzJob.setParams(JSONUtil.toJsonStr(bossObj)); - sysQuartzJob.setTaskNum(taskNum); - - sysQuartzJobService.reAddQuartzJob(sysQuartzJob); - - return true; - } - - /** - * 返回新的jobName名字 - * 原则上传入的 jobName 和 taskNum 是同一个QuartzJob的。 - * 这个返回的 作为子集的 job_name = 父级原本的jobName + 父级的taskNum - * 为后续 排查使用 (最好是新设置一个字段,这里先这样) - * 说明: 父级的意思说的是 上级, 比如A任务 回调失败,换个买家 新创建任务B A就说是B的父级 - * @param jobName - * @param taskNum - * @return - */ - public String jobNameNew(String jobName, String taskNum) { - if (jobName.contains("-")) { - jobName = jobName.substring(0,jobName.lastIndexOf("-")); - } - - return jobName + "-" + taskNum; - } - - - /** - * 根据规则获取新的买家信息 - * @param buyerAccount - * @return - */ - public CtBuyerDetailVO getRuleCtBuyer(String buyerAccount, String country, CtClickFarming ctClickFarming) { - if (ObjectUtil.isEmpty(buyerAccount) - || ObjectUtil.isEmpty(country) - || ObjectUtil.isEmpty(ctClickFarming) - || ObjectUtil.isEmpty(ctClickFarming.getShopName()) - || ObjectUtil.isEmpty(ctClickFarming.getId())) { - return null; - } - // 获取所有成功的刷单信息买家 然后统计每个成功的个数并返回 同时剔除传过来的参数信息 - // TODO 这里不能无限制的取, 通过redis 根据 刷单id 设置取过的买家信息,取过的不再取了 - List ctBuyerClickSuccessList = ctClickFarmingService.ruleGetCtBuyer(buyerAccount, country, ctClickFarming.getShopName()); - String clickFarmingExecBuyerIdPrefix = PublicConstant.getClickFarmingExecBuyerIdPrefix(ctClickFarming.getId()); - Long setSize = redisUtils.sGetSetSize(clickFarmingExecBuyerIdPrefix); - Long buyerId = null; - if (setSize == 0) { - buyerId = ctBuyerClickSuccessList.get(new Random().nextInt(ctBuyerClickSuccessList.size())).getBuyerId(); - } else { - for (CtBuyerClickSuccess ctBuyerClickSuccess : ctBuyerClickSuccessList) { - buyerId = ctBuyerClickSuccess.getBuyerId(); - if (redisUtils.sHasKey(clickFarmingExecBuyerIdPrefix, buyerId.toString())) { - continue; - } - break; - } - System.out.println("没有取到合适的========================================"); - } - - if (ObjectUtil.isNotEmpty(buyerId)) { - redisUtils.sSet(clickFarmingExecBuyerIdPrefix, buyerId.toString()); - return ctBuyerService.getDetailById(buyerId); - } - return null; - } - - - - /** - * 解析json 区分错误类型 4.有订单id之前的异常 5.有订单未支付 6.支付成功异常 - * @param remark - * @return Integer - */ - private Integer analysisReturnJson(String remark) { - // 根据规则解析 - // "remark": "【0757f764-07b4-4d4d-a48d-e1e13b598a1f】任务失败,在【5-1清空银行卡】中第17行:出错:未找到元素, 元素名: 按钮_OK", - // "remark": "【9a92a414-e957-47f8-ada1-7296723769a9】任务失败,在【9-1优惠劵】中第7行:出错:未找到元素", - // "remark": "【60a92f00-f7cb-4321-aa0b-6f18814fb462】任务失败,在【3.切换国家】中第8行:出错:未找到元素", - // "remark": "【81f6c1ac-6493-40cf-83fd-867b1a39e3ca】任务失败,在【9-3添加银行卡】中第5行:出错:未找到元素, 元素名: SAVE CARD", - // "remark": "【e201a1b3-f0a1-42b9-8315-d6736eead5a4】任务失败,在【1-2清空浏览器数据】中第1行:出错:操作无法执行!请重启当前浏览器 或 重装当前浏览器插件后再次尝试。", -// 【923eea47-c056-47ef-bccf-930d8ef700da】任务失败,在【9-1.留言】中第2行:出错:未找到元素, 元素名: 留言板 -// private final String STAET_MODULAR = "】任务失败,在【"; -// private final String END_MODULAR = "】中第"; -// private final String END_LINE_NUMBER = "行:出错"; -// private final Integer START_TASK_TIME = 10; - /** - * 1.切换VPN - * 2.关闭弹窗 - * 3.清空浏览器 - * 4.切换国家 - * 5.登录 - * 6.清空购物车 - * 6-1.清空银行卡 - * 7.搜索商品 - * 7-1.随意浏览界面 - * 7-2.滚动鼠标浏览界面 - * 7-3.随机点击商品 - * 7-4.浏览随机商品 - * 7-5匹配商品信息 - * 8.商品下单 - * 8-1.滚动鼠标浏览商品 - * 8-2.查找规格 - * 8-3.查找颜色 - * 8-4.商品个数 - * 9.购物车-------------------------------有订单未支付:流程第19行点击Pay_now - * 9-1.留言 - * 9-2.添加银行卡 - * 9-3.选择银行卡有效时间 - * 9-4.选择优惠券 - * 10.回到首页----------------------回到首页:流程第11行点击首页 - * 11.获取订单信息 - * 12.退出账号 - */ - log.info(remark); - if (ObjectUtil.isEmpty(remark) - || !remark.contains("任务失败") - || !remark.contains("中第") - || !remark.contains("行:出错") - || remark.length() <= 12) { - return ClickFarmingStatusEnum.EXECUTION_FAILE.value(); - } - - String modular = remark.substring(remark.indexOf(STAET_MODULAR) + 8, remark.indexOf(END_MODULAR)); - String lineNumber = remark.substring(remark.indexOf(END_MODULAR) + 3, remark.indexOf(END_LINE_NUMBER)); - - // 子模块可以忽略 - Integer modularInteger = 0; - Integer lineNumberInteger = 0; - if (ObjectUtil.isNotEmpty(modular)) { - if (modular.contains(".") && !modular.contains("-") ) { - modularInteger = Integer.valueOf(modular.substring(0, modular.indexOf("."))); - } else if (modular.contains("-")) { - modularInteger = Integer.valueOf(modular.split("-")[0]); - } - } - if (ObjectUtil.isNotEmpty(lineNumber)) { - lineNumberInteger = Integer.valueOf(lineNumber); - } - - if (modularInteger < 9) { - return ClickFarmingStatusEnum.EXECUTION_FAILE.value(); - } else if(modularInteger == 9) { - if (lineNumberInteger <= 19) { - return ClickFarmingStatusEnum.EXECUTION_FAILE.value(); - } else { - return ClickFarmingStatusEnum.AWAITING_PAYMENT.value(); - } - } else if (modularInteger < 10){ - return ClickFarmingStatusEnum.AWAITING_PAYMENT.value(); - } else if(modularInteger == 10) { - if (lineNumberInteger <= 11) { - return ClickFarmingStatusEnum.AWAITING_PAYMENT.value(); - } else { - return ClickFarmingStatusEnum.PAY_OK_ERROR.value(); - } - } else { - return ClickFarmingStatusEnum.PAY_OK_ERROR.value(); - } - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/group/controller/callbcak/ClickFarmingSuppleMentCallBackController.java b/wjcy-system/src/main/java/me/zhengjie/modules/group/controller/callbcak/ClickFarmingSuppleMentCallBackController.java deleted file mode 100644 index 1250309..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/group/controller/callbcak/ClickFarmingSuppleMentCallBackController.java +++ /dev/null @@ -1,234 +0,0 @@ -package me.zhengjie.modules.group.controller.callbcak; - -import cn.hutool.core.bean.BeanUtil; -import cn.hutool.core.date.DateUtil; -import cn.hutool.core.util.ObjectUtil; -import cn.hutool.json.JSONUtil; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import lombok.extern.slf4j.Slf4j; -import me.zhengjie.annotation.AnonymousAccess; -import me.zhengjie.annotation.Log; -import me.zhengjie.constant.PublicConstant; -import me.zhengjie.dto.Dto; -import me.zhengjie.entity.*; -import me.zhengjie.entity.quartz.JobQueryByUuidReturn; -import me.zhengjie.enums.BuyerOccupyStatusEnum; -import me.zhengjie.enums.ClickFarmingStatusEnum; -import me.zhengjie.enums.TaskInfoEnum; -import me.zhengjie.service.*; -import me.zhengjie.utils.RedisUtils; -import me.zhengjie.utils.YdCallBackUtil; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.validation.Valid; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - -/** - * @Description - * 刷单补录定时任务回调逻辑 - * 回调需要鉴权,鉴权是根据 accesskey accessKeySrect - * 我们应用确认之后 accesskey 和 Srect是确定的 - * - * @Date 2022-8-23 - * @Author rch - */ -@Slf4j -@Validated -@RequestMapping("/api/clickFarmSupplyMent") -@RestController -@Api(tags = "回调:速卖通刷单补录-影刀回调") -public class ClickFarmingSuppleMentCallBackController { - - @Resource - private CtApplyService ctApplyService; - @Resource - private YdQuartzService ydQuartzService; - @Resource - private CtClickFarmingService ctClickFarmingService; - @Resource - private CtClickOrderService ctClickOrderService; - @Resource - private RedisUtils redisUtils; - @Resource - private CtBuyerService ctBuyerService; - - private final String STAET_MODULAR = "】任务失败,在【"; - private final String END_MODULAR = "】中第"; - private final String END_LINE_NUMBER = "行:出错"; - private final Integer START_TASK_TIME = 20; - - /** - * 速卖通刷单补录-回调 - */ - @ApiOperation("速卖通刷单补录-回调") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!"), - @ApiResponse(code = 3700, message = "影刀回调参数空值异常!"), - @ApiResponse(code = 3701, message = "影刀回调鉴权异常!") - }) - @Log(value = "速卖通刷单补录-回调") - @PostMapping("/callback") - @AnonymousAccess - @Transactional(rollbackFor = Exception.class) - public Dto callback(@Valid @RequestBody String data, HttpServletRequest httpServletRequest){ - - // 根据task枚举获取 应用信息 取出 accessKey 和 accessKeySecret 用于鉴权 - YdCallBackUtil ydCallBackUtil = new YdCallBackUtil(); - CtApply ctApply = ctApplyService.getApplyByTaskAndMethod(TaskInfoEnum.CLICK_FARMING_SUPPLE_MENY.getTaskName(), TaskInfoEnum.CLICK_FARMING_SUPPLE_MENY.getMethodName()); - Dto dto = ydCallBackUtil.callback(httpServletRequest, ctApply, data); - if (!dto.success(dto)) { - return dto; - } - - // 执行自己的业务逻辑 - log.info("============刷单回调鉴权完成 开始执行对应的定时业务逻辑================begin="); - log.info("回调======data:" + data); - // 获取自己想要的数据 - ReturnObje returnObje = JSONUtil.toBean(data, ReturnObje.class); - // job ID - String jobUuid = returnObje.getJobUuid(); - - // TODO 回调会重试 这里注意保证幂等 - // TODO 所以需要对接方在业务层面保障幂等(可以根据jobUuid或者taskUuid进行幂等保障,视startJob时是指定应用和机器人模式还是指定任务模式) - String keyJobUuid = PublicConstant.getJobUuidKeyPrefix(jobUuid); - if (!redisUtils.setIfAbsent(keyJobUuid, DateUtil.now())) { - log.info("-刷单回调接口-幂等性:keyJobUuid:" + keyJobUuid); - return Dto.returnResult(true); - } - - log.info("====returnObje====:{}", JSONUtil.toJsonStr(returnObje)); - JobQueryByUuidReturn jobQueryByUuidReturn = ydQuartzService.queryJobUuid(returnObje.getJobUuid(), ctApply.getAccessKeyId(), ctApply.getAccessKeySecret()); - log.info("====jobQueryByUuidReturn====:{}", JSONUtil.toJsonStr(jobQueryByUuidReturn)); - List inputsList = jobQueryByUuidReturn.getData().getRobotParams().getInputs(); - // 获取id - String id = null; - String buyerName = null; - for (ResultObj resultObj:inputsList) { - if ("id".equals(resultObj.getName())) { - id = resultObj.getValue(); - } - - if ("account".equals(resultObj.getName())) { - buyerName = resultObj.getValue(); - } - } - -// Integer status = ClickFarmingStatusEnum.EXECUTION_FAILE.value(); - Integer status = ClickFarmingStatusEnum.AWAITING_PAYMENT.value(); - if ("finish".equals(jobQueryByUuidReturn.getData().getStatus())) { - status = ClickFarmingStatusEnum.EXECUTION_SUCCESS.value(); - } - - // 执行失败 - Boolean resultBoolean = false; - if (ObjectUtil.isNotEmpty(id)) { - CtClickFarming ctClickFarming = new CtClickFarming(); - ctClickFarming.setId(Long.valueOf(id)); - - // 获取买家信息并修改买家信息 - CtBuyer ctBuyer = ctBuyerService.getBuyerOccupyStatusLock(buyerName); - if (ObjectUtil.isNotEmpty(ctBuyer) && BuyerOccupyStatusEnum.OCCUPIED.value().equals(ctBuyer.getOccupyStatus())) { - ctBuyer.setOccupyStatus(BuyerOccupyStatusEnum.UN_OCCUPIED.value()); - resultBoolean = ctBuyerService.updateById(ctBuyer); - } - - // TODO 需要更新的字段 从这里获取影刀返回的 然后接着设置到 对应的 基础信息里 - List outputsList = jobQueryByUuidReturn.getData().getRobotParams().getOutputs(); - if (resultBoolean && ObjectUtil.isNotEmpty(outputsList)) { - Map resultObjMap = outputsList.stream().collect(Collectors.toMap(ResultObj::getName, ResultObj::getValue)); - CtClickOrder ctClickOrder = BeanUtil.mapToBean(resultObjMap, CtClickOrder.class, false); - if (ObjectUtil.isNotEmpty(ctClickOrder)) { - if (ObjectUtil.isNotEmpty(ctClickOrder.getPaymentResults()) && "Awaiting payment".equals(ctClickOrder.getPaymentResults())) { - status = ClickFarmingStatusEnum.AWAITING_PAYMENT.value(); - } - // 设置订单 公司 平台信息 - ctClickOrder.setCompanyId(ctBuyer.getCompanyId()); - if (ctClickOrderService.save(ctClickOrder)) { - ctClickFarming.setCtClickOrderId(ctClickOrder.getId()); - } - } - }else { - // 解析json 返回错误类型 - status = analysisReturnJson(jobQueryByUuidReturn.getData().getRemark()); - } - - ctClickFarming.setStatus(status); - if (ClickFarmingStatusEnum.EXECUTION_FAILE.value().equals(status) || ClickFarmingStatusEnum.PAY_OK_ERROR.value().equals(status)) { - ctClickFarming.setResponse(jobQueryByUuidReturn.getData().getRemark()); - }else { - ctClickFarming.setResponse(jobQueryByUuidReturn.getData().getStatusName()); - } - resultBoolean = ctClickFarmingService.updateById(ctClickFarming); - } - - log.info("============刷单补录回调鉴权完成 开始执行对应的定时业务逻辑================end==="); - return Dto.returnResult(resultBoolean); - } - - - /** - * 解析json 区分错误类型 - * @param remark - * @return Integer - */ - private Integer analysisReturnJson(String remark) { - // 根据规则解析 - /** - 1.切换VPN - 2.关闭弹窗 - 3.清空浏览器 - 4.切换国家 - 5.登录 - 6.订单首页 - 6-1.添加银行卡 - 6-2.选择银行卡有效时间 - 7.获取订单信息-------------------支付成功:流程7行(包含) - 8.退出账号 - */ - if (ObjectUtil.isEmpty(remark) || !remark.contains("任务失败")) { - return ClickFarmingStatusEnum.EXECUTION_FAILE.value(); - } - - String modular = remark.substring(remark.indexOf(STAET_MODULAR) + 8, remark.indexOf(END_MODULAR)); - String lineNumber = remark.substring(remark.indexOf(END_MODULAR) + 3, remark.indexOf(END_LINE_NUMBER)); - - // 子模块可以忽略 - Integer modularInteger = 0; - Integer lineNumberInteger = 0; - if (ObjectUtil.isNotEmpty(modular)) { - if (modular.contains(".") && !modular.contains("-") ) { - modularInteger = Integer.valueOf(modular.substring(0, modular.indexOf("."))); - } else if (modular.contains("-")) { - modularInteger = Integer.valueOf(modular.split("-")[0]); - } - } - if (ObjectUtil.isNotEmpty(lineNumber)) { - lineNumberInteger = Integer.valueOf(lineNumber); - } - - if (modularInteger < 7) { - return ClickFarmingStatusEnum.AWAITING_PAYMENT.value(); - } else if(modularInteger == 7) { - if (lineNumberInteger < 7) { - return ClickFarmingStatusEnum.AWAITING_PAYMENT.value(); - } else { - return ClickFarmingStatusEnum.PAY_OK_ERROR.value(); - } - } else { - return ClickFarmingStatusEnum.PAY_OK_ERROR.value(); - } - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/group/controller/callbcak/ClickOrderCallBackController.java b/wjcy-system/src/main/java/me/zhengjie/modules/group/controller/callbcak/ClickOrderCallBackController.java deleted file mode 100644 index d903379..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/group/controller/callbcak/ClickOrderCallBackController.java +++ /dev/null @@ -1,151 +0,0 @@ -package me.zhengjie.modules.group.controller.callbcak; - -import cn.hutool.core.date.DateUtil; -import cn.hutool.core.util.ObjectUtil; -import cn.hutool.json.JSONUtil; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import lombok.extern.slf4j.Slf4j; -import me.zhengjie.annotation.AnonymousAccess; -import me.zhengjie.annotation.Log; -import me.zhengjie.constant.PublicConstant; -import me.zhengjie.dto.Dto; -import me.zhengjie.entity.*; -import me.zhengjie.entity.quartz.JobQueryByUuidReturn; -import me.zhengjie.enums.BuyerOccupyStatusEnum; -import me.zhengjie.enums.ClickOrderStatusEnum; -import me.zhengjie.enums.TaskInfoEnum; -import me.zhengjie.service.CtApplyService; -import me.zhengjie.service.CtBuyerService; -import me.zhengjie.service.CtClickOrderService; -import me.zhengjie.service.YdQuartzService; -import me.zhengjie.utils.RedisUtils; -import me.zhengjie.utils.YdCallBackUtil; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.validation.Valid; -import java.util.List; - -/** - * @Description - * 好评定时任务回调逻辑 - * 回调需要鉴权,鉴权是根据 accesskey accessKeySrect - * 我们应用确认之后 accesskey 和 Srect是确定的 - * - * @Date 2022-8-23 - * @Author rch - */ -@Slf4j -@Validated -@RequestMapping("/api/clickOrder") -@RestController -@Api(tags = "回调:速卖通刷单好评-影刀回调") -public class ClickOrderCallBackController { - - @Resource - private CtApplyService ctApplyService; - @Resource - private YdQuartzService ydQuartzService; - @Resource - private CtClickOrderService ctClickOrderService; - @Resource - private RedisUtils redisUtils; - @Resource - private CtBuyerService ctBuyerService; - - /** - * 速卖通刷单好评-好评回调 - */ - @ApiOperation("速卖通刷单好评-好评回调") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!"), - @ApiResponse(code = 3700, message = "影刀回调参数空值异常!"), - @ApiResponse(code = 3701, message = "影刀回调鉴权异常!") - }) - @Log(value = "速卖通刷单好评-好评回调") - @PostMapping("/callback") - @AnonymousAccess - @Transactional(rollbackFor = Exception.class) - public Dto callback(@Valid @RequestBody String data, HttpServletRequest httpServletRequest){ - - // 根据task枚举获取 应用信息 取出 accessKey 和 accessKeySecret 用于鉴权 - YdCallBackUtil ydCallBackUtil = new YdCallBackUtil(); - CtApply ctApply = ctApplyService.getApplyByTaskAndMethod(TaskInfoEnum.WELL_RECEIVED.getTaskName(), TaskInfoEnum.WELL_RECEIVED.getMethodName()); - Dto dto = ydCallBackUtil.callback(httpServletRequest, ctApply, data); - if (!dto.success(dto)) { - return dto; - } - - // 执行自己的业务逻辑 - log.info("============刷单回调鉴权完成 开始执行对应的定时业务逻辑================begin="); - log.info("回调======data:" + data); - // 获取自己想要的数据 - ReturnObje returnObje = JSONUtil.toBean(data, ReturnObje.class); - // job ID - String jobUuid = returnObje.getJobUuid(); - - // TODO 回调会重试 这里注意保证幂等 - // TODO 所以需要对接方在业务层面保障幂等(可以根据jobUuid或者taskUuid进行幂等保障,视startJob时是指定应用和机器人模式还是指定任务模式) - String keyJobUuid = PublicConstant.getJobUuidKeyPrefix(jobUuid); - if (!redisUtils.setIfAbsent(keyJobUuid, DateUtil.now())) { - log.info("-刷单回调接口-幂等性:keyJobUuid:" + keyJobUuid); - return Dto.returnResult(true); - } - - log.info("====returnObje====:{}", JSONUtil.toJsonStr(returnObje)); - JobQueryByUuidReturn jobQueryByUuidReturn = ydQuartzService.queryJobUuid(returnObje.getJobUuid(), ctApply.getAccessKeyId(), ctApply.getAccessKeySecret()); - log.info("====jobQueryByUuidReturn====:{}", JSONUtil.toJsonStr(jobQueryByUuidReturn)); - List inputsList = jobQueryByUuidReturn.getData().getRobotParams().getInputs(); - // 获取id - String id = null; - String buyerName = null; - for (ResultObj resultObj:inputsList) { - if ("id".equals(resultObj.getName())) { - id = resultObj.getValue(); - } - - if ("account".equals(resultObj.getName())) { - buyerName = resultObj.getValue(); - } - } - - Integer status = ClickOrderStatusEnum.EXECUTION_FAILE.value(); - if ("finish".equals(jobQueryByUuidReturn.getData().getStatus())) { - status = ClickOrderStatusEnum.EXECUTION_SUCCESS.value(); - } - - // 执行失败 - Boolean resultBoolean = false; - if (ObjectUtil.isNotEmpty(id)) { - CtClickOrder ctClickOrder = new CtClickOrder(); - ctClickOrder.setId(Long.valueOf(id)); - ctClickOrder.setStatus(status); - ctClickOrder.setPaymentResults(jobQueryByUuidReturn.getData().getRemark()); - - // 获取买家信息并修改买家信息 - CtBuyer ctBuyer = ctBuyerService.getBuyerOccupyStatusLock(buyerName); - if (ObjectUtil.isNotEmpty(ctBuyer) && BuyerOccupyStatusEnum.OCCUPIED.value().equals(ctBuyer.getOccupyStatus())) { - ctBuyer.setOccupyStatus(BuyerOccupyStatusEnum.UN_OCCUPIED.value()); - resultBoolean = ctBuyerService.updateById(ctBuyer); - } - - // TODO 需要更新的字段 从这里获取影刀返回的 然后接着设置到 对应的 基础信息里 - if (resultBoolean) { - resultBoolean = ctClickOrderService.updateById(ctClickOrder); - } - } - - log.info("============刷单回调鉴权完成 开始执行对应的定时业务逻辑================end==="); - return Dto.returnResult(resultBoolean); - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/group/controller/callbcak/CtbrowseCallBackController.java b/wjcy-system/src/main/java/me/zhengjie/modules/group/controller/callbcak/CtbrowseCallBackController.java deleted file mode 100644 index f575b42..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/group/controller/callbcak/CtbrowseCallBackController.java +++ /dev/null @@ -1,148 +0,0 @@ -package me.zhengjie.modules.group.controller.callbcak; - -import cn.hutool.core.date.DateUtil; -import cn.hutool.core.util.ObjectUtil; -import cn.hutool.json.JSONUtil; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import lombok.extern.slf4j.Slf4j; -import me.zhengjie.annotation.AnonymousAccess; -import me.zhengjie.annotation.Log; -import me.zhengjie.constant.PublicConstant; -import me.zhengjie.dto.Dto; -import me.zhengjie.entity.*; -import me.zhengjie.entity.quartz.JobQueryByUuidReturn; -import me.zhengjie.enums.BuyerOccupyStatusEnum; -import me.zhengjie.enums.ClickOrderStatusEnum; -import me.zhengjie.enums.TaskInfoEnum; -import me.zhengjie.service.*; -import me.zhengjie.utils.RedisUtils; -import me.zhengjie.utils.YdCallBackUtil; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.validation.Valid; -import java.util.List; - -/** - * @Description - * 浏览收藏定时任务回调逻辑 - * 回调需要鉴权,鉴权是根据 accesskey accessKeySrect - * 我们应用确认之后 accesskey 和 Srect是确定的 - * - * @Date 2022-8-23 - * @Author rch - */ -@Slf4j -@Validated -@RequestMapping("/api/ctBrowse") -@RestController -@Api(tags = "回调:速卖通浏览收藏-影刀回调") -public class CtbrowseCallBackController { - - @Resource - private CtApplyService ctApplyService; - @Resource - private YdQuartzService ydQuartzService; - @Resource - private CtBrowseService ctBrowseService; - @Resource - private RedisUtils redisUtils; - @Resource - private CtBuyerService ctBuyerService; - - /** - * 速卖通刷单好评-好评回调 - */ - @ApiOperation("速卖通浏览收藏-回调") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!"), - @ApiResponse(code = 3700, message = "影刀回调参数空值异常!"), - @ApiResponse(code = 3701, message = "影刀回调鉴权异常!") - }) - @Log(value = "速卖通浏览收藏-回调") - @PostMapping("/callback") - @AnonymousAccess - @Transactional(rollbackFor = Exception.class) - public Dto callback(@Valid @RequestBody String data, HttpServletRequest httpServletRequest){ - - // 根据task枚举获取 应用信息 取出 accessKey 和 accessKeySecret 用于鉴权 - YdCallBackUtil ydCallBackUtil = new YdCallBackUtil(); - CtApply ctApply = ctApplyService.getApplyByTaskAndMethod(TaskInfoEnum.BROWSE.getTaskName(), TaskInfoEnum.BROWSE.getMethodName()); - Dto dto = ydCallBackUtil.callback(httpServletRequest, ctApply, data); - if (!dto.success(dto)) { - return dto; - } - - // 执行自己的业务逻辑 - log.info("============刷单回调鉴权完成 开始执行对应的定时业务逻辑================begin="); - log.info("回调======data:" + data); - // 获取自己想要的数据 - ReturnObje returnObje = JSONUtil.toBean(data, ReturnObje.class); - // job ID - String jobUuid = returnObje.getJobUuid(); - - // TODO 回调会重试 这里注意保证幂等 - // TODO 所以需要对接方在业务层面保障幂等(可以根据jobUuid或者taskUuid进行幂等保障,视startJob时是指定应用和机器人模式还是指定任务模式) - String keyJobUuid = PublicConstant.getJobUuidKeyPrefix(jobUuid); - if (!redisUtils.setIfAbsent(keyJobUuid, DateUtil.now())) { - log.info("-刷单回调接口-幂等性:keyJobUuid:" + keyJobUuid); - return Dto.returnResult(true); - } - - log.info("====returnObje====:{}", JSONUtil.toJsonStr(returnObje)); - JobQueryByUuidReturn jobQueryByUuidReturn = ydQuartzService.queryJobUuid(returnObje.getJobUuid(), ctApply.getAccessKeyId(), ctApply.getAccessKeySecret()); - log.info("====jobQueryByUuidReturn====:{}", JSONUtil.toJsonStr(jobQueryByUuidReturn)); - List inputsList = jobQueryByUuidReturn.getData().getRobotParams().getInputs(); - // 获取id - String id = null; - String buyerName = null; - for (ResultObj resultObj:inputsList) { - if ("id".equals(resultObj.getName())) { - id = resultObj.getValue(); - } - - if ("account".equals(resultObj.getName())) { - buyerName = resultObj.getValue(); - } - } - - Integer status = ClickOrderStatusEnum.EXECUTION_FAILE.value(); - if ("finish".equals(jobQueryByUuidReturn.getData().getStatus())) { - status = ClickOrderStatusEnum.EXECUTION_SUCCESS.value(); - } - - // 执行失败 - Boolean resultBoolean = false; - if (ObjectUtil.isNotEmpty(id)) { - CtBrowse ctBrowse = new CtBrowse(); - ctBrowse.setId(Long.valueOf(id)); - ctBrowse.setStatus(status); - ctBrowse.setPaymentResults(jobQueryByUuidReturn.getData().getRemark()); - - // 获取买家信息并修改买家信息 - CtBuyer ctBuyer = ctBuyerService.getBuyerOccupyStatusLock(buyerName); - if (ObjectUtil.isNotEmpty(ctBuyer) && BuyerOccupyStatusEnum.OCCUPIED.value().equals(ctBuyer.getOccupyStatus())) { - ctBuyer.setOccupyStatus(BuyerOccupyStatusEnum.UN_OCCUPIED.value()); - resultBoolean = ctBuyerService.updateById(ctBuyer); - } - - // TODO 需要更新的字段 从这里获取影刀返回的 然后接着设置到 对应的 基础信息里 - if (resultBoolean) { - resultBoolean = ctBrowseService.updateById(ctBrowse); - } - } - - log.info("============刷单回调鉴权完成 开始执行对应的定时业务逻辑================end==="); - return Dto.returnResult(resultBoolean); - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/group/controller/callbcak/DhAddCarCallBackController.java b/wjcy-system/src/main/java/me/zhengjie/modules/group/controller/callbcak/DhAddCarCallBackController.java deleted file mode 100644 index e133d6a..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/group/controller/callbcak/DhAddCarCallBackController.java +++ /dev/null @@ -1,152 +0,0 @@ -package me.zhengjie.modules.group.controller.callbcak; - -import cn.hutool.core.date.DateUtil; -import cn.hutool.core.util.ObjectUtil; -import cn.hutool.json.JSONUtil; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import lombok.extern.slf4j.Slf4j; -import me.zhengjie.annotation.AnonymousAccess; -import me.zhengjie.annotation.Log; -import me.zhengjie.constant.PublicConstant; -import me.zhengjie.dto.Dto; -import me.zhengjie.entity.*; -import me.zhengjie.entity.quartz.JobQueryByUuidReturn; -import me.zhengjie.enums.BuyerOccupyStatusEnum; -import me.zhengjie.enums.ClickFarmingStatusEnum; -import me.zhengjie.enums.DhAddCarStatusEnum; -import me.zhengjie.enums.TaskInfoEnum; -import me.zhengjie.service.*; -import me.zhengjie.utils.RedisUtils; -import me.zhengjie.utils.YdCallBackUtil; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.validation.Valid; -import java.util.List; - -/** - * @Description - * 敦煌加购定时任务回调逻辑 - * 回调需要鉴权,鉴权是根据 accesskey accessKeySrect - * 我们应用确认之后 accesskey 和 Srect是确定的 - * - * @Date 2022-8-23 - * @Author rch - */ -@Slf4j -@Validated -@RequestMapping("/api/dhAddCar") -@RestController -@Api(tags = "回调:敦煌加购-影刀回调") -public class DhAddCarCallBackController { - - @Resource - private CtApplyService ctApplyService; - @Resource - private YdQuartzService ydQuartzService; - @Resource - private DhAddCarService dhAddCarService; - @Resource - private DhAddCarOrderService dhAddCarOrderService; - @Resource - private RedisUtils redisUtils; - @Resource - private CtBuyerService ctBuyerService; - /** - * 敦煌加购-影刀回调 - */ - @ApiOperation("敦煌加购-影刀回调") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!"), - @ApiResponse(code = 3700, message = "影刀回调参数空值异常!"), - @ApiResponse(code = 3701, message = "影刀回调鉴权异常!") - }) - @Log(value = "敦煌加购-影刀回调") - @PostMapping("/callback") - @AnonymousAccess - @Transactional(rollbackFor = Exception.class) - public Dto callback(@Valid @RequestBody String data, HttpServletRequest httpServletRequest){ - - // 根据task枚举获取 应用信息 取出 accessKey 和 accessKeySecret 用于鉴权 - YdCallBackUtil ydCallBackUtil = new YdCallBackUtil(); - CtApply ctApply = ctApplyService.getApplyByTaskAndMethod(TaskInfoEnum.DH_ADD_CAR_FARMING.getTaskName(), TaskInfoEnum.DH_ADD_CAR_FARMING.getMethodName()); - Dto dto = ydCallBackUtil.callback(httpServletRequest, ctApply, data); - if (!dto.success(dto)) { - return dto; - } - - // 执行自己的业务逻辑 - log.info("============敦煌加购回调鉴权完成 开始执行对应的定时业务逻辑================begin="); - log.info("回调======data:" + data); - // 获取自己想要的数据 - ReturnObje returnObje = JSONUtil.toBean(data, ReturnObje.class); - // job ID - String jobUuid = returnObje.getJobUuid(); - - // TODO 回调会重试 这里注意保证幂等 - // TODO 所以需要对接方在业务层面保障幂等(可以根据jobUuid或者taskUuid进行幂等保障,视startJob时是指定应用和机器人模式还是指定任务模式) - String keyJobUuid = PublicConstant.getJobUuidKeyPrefix(jobUuid); - if (!redisUtils.setIfAbsent(keyJobUuid, DateUtil.now())) { - log.info("-敦煌加购回调接口-幂等性:keyJobUuid:" + keyJobUuid); - return Dto.returnResult(true); - } - - log.info("====returnObje====:{}", JSONUtil.toJsonStr(returnObje)); - JobQueryByUuidReturn jobQueryByUuidReturn = ydQuartzService.queryJobUuid(returnObje.getJobUuid(), ctApply.getAccessKeyId(), ctApply.getAccessKeySecret()); - log.info("====jobQueryByUuidReturn====:{}", JSONUtil.toJsonStr(jobQueryByUuidReturn)); - List inputsList = jobQueryByUuidReturn.getData().getRobotParams().getInputs(); - // 获取id - String id = null; - String buyerName = null; - for (ResultObj resultObj:inputsList) { - if ("id".equals(resultObj.getName())) { - id = resultObj.getValue(); - } - if ("account".equals(resultObj.getName())) { - buyerName = resultObj.getValue(); - } - } - - Integer status = DhAddCarStatusEnum.ADD_CARD_FAILE.value(); - if ("finish".equals(jobQueryByUuidReturn.getData().getStatus())) { - status = DhAddCarStatusEnum.Add_CARD_SUCCESS.value(); - } - - // 执行失败 - Boolean resultBoolean = false; - if (ObjectUtil.isNotEmpty(id)) { - DhAddCar dhAddCar = new DhAddCar(); - dhAddCar.setId(Long.valueOf(id)); - - // 获取买家信息并修改买家信息 - CtBuyer ctBuyer = ctBuyerService.getBuyerOccupyStatusLock(buyerName); - if (ObjectUtil.isNotEmpty(ctBuyer) && BuyerOccupyStatusEnum.OCCUPIED.value().equals(ctBuyer.getOccupyStatus())) { - ctBuyer.setOccupyStatus(BuyerOccupyStatusEnum.UN_OCCUPIED.value()); - resultBoolean = ctBuyerService.updateById(ctBuyer); - } - - if (resultBoolean) { - dhAddCar.setStatus(status); - if (ClickFarmingStatusEnum.EXECUTION_FAILE.value().equals(status)) { - dhAddCar.setResponse(jobQueryByUuidReturn.getData().getRemark()); - }else { - dhAddCar.setResponse(jobQueryByUuidReturn.getData().getStatusName()); - } - resultBoolean = dhAddCarService.updateById(dhAddCar); - } - } - - log.info("============敦煌加购回调鉴权完成 开始执行对应的定时业务逻辑================end==="); - return Dto.returnResult(resultBoolean); - } -} \ No newline at end of file diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/group/controller/callbcak/DhCarOrderCallBackController.java b/wjcy-system/src/main/java/me/zhengjie/modules/group/controller/callbcak/DhCarOrderCallBackController.java deleted file mode 100644 index 3cc8364..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/group/controller/callbcak/DhCarOrderCallBackController.java +++ /dev/null @@ -1,170 +0,0 @@ -package me.zhengjie.modules.group.controller.callbcak; - -import cn.hutool.core.date.DateUtil; -import cn.hutool.core.util.ObjectUtil; -import cn.hutool.json.JSONUtil; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import lombok.extern.slf4j.Slf4j; -import me.zhengjie.annotation.AnonymousAccess; -import me.zhengjie.annotation.Log; -import me.zhengjie.constant.PublicConstant; -import me.zhengjie.dto.Dto; -import me.zhengjie.entity.*; -import me.zhengjie.entity.quartz.JobQueryByUuidReturn; -import me.zhengjie.enums.BuyerOccupyStatusEnum; -import me.zhengjie.enums.ClickOrderStatusEnum; -import me.zhengjie.enums.DhAddCarStatusEnum; -import me.zhengjie.enums.TaskInfoEnum; -import me.zhengjie.service.CtApplyService; -import me.zhengjie.service.CtBuyerService; -import me.zhengjie.service.DhAddCarOrderService; -import me.zhengjie.service.YdQuartzService; -import me.zhengjie.utils.RedisUtils; -import me.zhengjie.utils.YdCallBackUtil; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.validation.Valid; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - -/** - * @Description - * 敦煌加购好评定时任务回调逻辑 - * 回调需要鉴权,鉴权是根据 accesskey accessKeySrect - * 我们应用确认之后 accesskey 和 Srect是确定的 - * - * @Date 2022-8-23 - * @Author rch - */ -@Slf4j -@Validated -@RequestMapping("/api/dhCarOrder") -@RestController -@Api(tags = "回调:敦煌加购好评-影刀回调") -public class DhCarOrderCallBackController { - - @Resource - private CtApplyService ctApplyService; - @Resource - private YdQuartzService ydQuartzService; - @Resource - private DhAddCarOrderService dhAddCarOrderService; - @Resource - private RedisUtils redisUtils; - @Resource - private CtBuyerService ctBuyerService; - - /** - * 速卖通刷单好评-好评回调 - */ - @ApiOperation("速卖通刷单好评-好评回调") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!"), - @ApiResponse(code = 3700, message = "影刀回调参数空值异常!"), - @ApiResponse(code = 3701, message = "影刀回调鉴权异常!") - }) - @Log(value = "敦煌加购好评-好评回调") - @PostMapping("/callback") - @AnonymousAccess - @Transactional(rollbackFor = Exception.class) - public Dto callback(@Valid @RequestBody String data, HttpServletRequest httpServletRequest){ - - // 根据task枚举获取 应用信息 取出 accessKey 和 accessKeySecret 用于鉴权 - YdCallBackUtil ydCallBackUtil = new YdCallBackUtil(); - CtApply ctApply = ctApplyService.getApplyByTaskAndMethod(TaskInfoEnum.DH_WELL_RECEIVED.getTaskName(), TaskInfoEnum.DH_WELL_RECEIVED.getMethodName()); - Dto dto = ydCallBackUtil.callback(httpServletRequest, ctApply, data); - if (!dto.success(dto)) { - return dto; - } - - // 执行自己的业务逻辑 - log.info("============刷单回调鉴权完成 开始执行对应的定时业务逻辑================begin="); - log.info("回调======data:" + data); - // 获取自己想要的数据 - ReturnObje returnObje = JSONUtil.toBean(data, ReturnObje.class); - // job ID - String jobUuid = returnObje.getJobUuid(); - - // TODO 回调会重试 这里注意保证幂等 - // TODO 所以需要对接方在业务层面保障幂等(可以根据jobUuid或者taskUuid进行幂等保障,视startJob时是指定应用和机器人模式还是指定任务模式) - String keyJobUuid = PublicConstant.getJobUuidKeyPrefix(jobUuid); - if (!redisUtils.setIfAbsent(keyJobUuid, DateUtil.now())) { - log.info("-刷单回调接口-幂等性:keyJobUuid:" + keyJobUuid); - return Dto.returnResult(true); - } - - log.info("====returnObje====:{}", JSONUtil.toJsonStr(returnObje)); - JobQueryByUuidReturn jobQueryByUuidReturn = ydQuartzService.queryJobUuid(returnObje.getJobUuid(), ctApply.getAccessKeyId(), ctApply.getAccessKeySecret()); - log.info("====jobQueryByUuidReturn====:{}", JSONUtil.toJsonStr(jobQueryByUuidReturn)); - List inputsList = jobQueryByUuidReturn.getData().getRobotParams().getInputs(); - // 获取id - String id = null; - String buyerName = null; - for (ResultObj resultObj:inputsList) { - if ("id".equals(resultObj.getName())) { - id = resultObj.getValue(); - } - - if ("account".equals(resultObj.getName())) { - buyerName = resultObj.getValue(); - } - } - - Integer status = ClickOrderStatusEnum.EXECUTION_FAILE.value(); - if ("finish".equals(jobQueryByUuidReturn.getData().getStatus())) { - status = ClickOrderStatusEnum.EXECUTION_SUCCESS.value(); - } - - // 执行失败 - Boolean resultBoolean = false; - if (ObjectUtil.isNotEmpty(id)) { - DhAddCarOrder dhAddCarOrder = new DhAddCarOrder(); - dhAddCarOrder.setId(Long.valueOf(id)); - dhAddCarOrder.setStatus(status); - - // 获取买家信息并修改买家信息 - CtBuyer ctBuyer = ctBuyerService.getBuyerOccupyStatusLock(buyerName); - if (ObjectUtil.isNotEmpty(ctBuyer) && BuyerOccupyStatusEnum.OCCUPIED.value().equals(ctBuyer.getOccupyStatus())) { - ctBuyer.setOccupyStatus(BuyerOccupyStatusEnum.UN_OCCUPIED.value()); - resultBoolean = ctBuyerService.updateById(ctBuyer); - } - - // TODO 需要更新的字段 从这里获取影刀返回的 然后接着设置到 对应的 基础信息里 - List outputsList = jobQueryByUuidReturn.getData().getRobotParams().getOutputs(); - if (ObjectUtil.isNotEmpty(outputsList)) { - Map resultObjMap = outputsList.stream().collect(Collectors.toMap(ResultObj::getName, ResultObj::getValue)); - if (ObjectUtil.isNotEmpty(resultObjMap.containsKey("receipt"))) { - dhAddCarOrder.setPaymentResults(resultObjMap.get("receipt")); - if ("success".equals(resultObjMap.get("receipt"))) { - status = ClickOrderStatusEnum.EXECUTION_SUCCESS.value(); - } - } else { - status = ClickOrderStatusEnum.EXECUTION_FAILE.value(); - } - } else { - status = DhAddCarStatusEnum.CATCH_ORDER_FAILE.value(); - } - - // TODO 需要更新的字段 从这里获取影刀返回的 然后接着设置到 对应的 基础信息里 - if (resultBoolean) { - dhAddCarOrder.setStatus(status); - resultBoolean = dhAddCarOrderService.updateById(dhAddCarOrder); - } - } - - log.info("============刷单回调鉴权完成 开始执行对应的定时业务逻辑================end==="); - return Dto.returnResult(resultBoolean); - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/group/controller/callbcak/DhCatchOrderCallBackController.java b/wjcy-system/src/main/java/me/zhengjie/modules/group/controller/callbcak/DhCatchOrderCallBackController.java deleted file mode 100644 index bc9fc22..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/group/controller/callbcak/DhCatchOrderCallBackController.java +++ /dev/null @@ -1,166 +0,0 @@ -package me.zhengjie.modules.group.controller.callbcak; - -import cn.hutool.core.bean.BeanUtil; -import cn.hutool.core.date.DateUtil; -import cn.hutool.core.util.ObjectUtil; -import cn.hutool.json.JSONUtil; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import lombok.extern.slf4j.Slf4j; -import me.zhengjie.annotation.AnonymousAccess; -import me.zhengjie.annotation.Log; -import me.zhengjie.constant.PublicConstant; -import me.zhengjie.dto.Dto; -import me.zhengjie.entity.*; -import me.zhengjie.entity.quartz.JobQueryByUuidReturn; -import me.zhengjie.enums.BuyerOccupyStatusEnum; -import me.zhengjie.enums.DhAddCarStatusEnum; -import me.zhengjie.enums.OrderTypeEnum; -import me.zhengjie.enums.TaskInfoEnum; -import me.zhengjie.service.*; -import me.zhengjie.utils.RedisUtils; -import me.zhengjie.utils.YdCallBackUtil; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.validation.Valid; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - -/** - * @Description - * 敦煌-加购-抓单定时任务回调逻辑 - * 回调需要鉴权,鉴权是根据 accesskey accessKeySrect - * 我们应用确认之后 accesskey 和 Srect是确定的 - * - * @Date 2022-8-23 - * @Author rch - */ -@Slf4j -@Validated -@RequestMapping("/api/catchOrder") -@RestController -@Api(tags = "回调:敦煌抓单-影刀回调") -public class DhCatchOrderCallBackController { - - @Resource - private CtApplyService ctApplyService; - @Resource - private YdQuartzService ydQuartzService; - @Resource - private DhAddCarService dhAddCarService; - @Resource - private DhAddCarOrderService dhAddCarOrderService; - @Resource - private RedisUtils redisUtils; - @Resource - private CtBuyerService ctBuyerService; - - /** - * 敦煌-加购抓单-影刀回调 - */ - @ApiOperation("敦煌-加购抓单-影刀回调") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "响应成功"), - @ApiResponse(code = 2000, message = "服务器开小差了....,请稍后再试!"), - @ApiResponse(code = 3700, message = "影刀回调参数空值异常!"), - @ApiResponse(code = 3701, message = "影刀回调鉴权异常!") - }) - @Log(value = "敦煌-加购抓单-影刀回调") - @PostMapping("/callback") - @AnonymousAccess - @Transactional(rollbackFor = Exception.class) - public Dto callback(@Valid @RequestBody String data, HttpServletRequest httpServletRequest){ - - // 根据task枚举获取 应用信息 取出 accessKey 和 accessKeySecret 用于鉴权 - YdCallBackUtil ydCallBackUtil = new YdCallBackUtil(); - CtApply ctApply = ctApplyService.getApplyByTaskAndMethod(TaskInfoEnum.DH_ADD_CAR_CATCH_ORDER.getTaskName(), TaskInfoEnum.DH_ADD_CAR_CATCH_ORDER.getMethodName()); - Dto dto = ydCallBackUtil.callback(httpServletRequest, ctApply, data); - if (!dto.success(dto)) { - return dto; - } - - // 执行自己的业务逻辑 - log.info("============刷单回调鉴权完成 开始执行对应的定时业务逻辑================begin="); - log.info("回调======data:" + data); - // 获取自己想要的数据 - ReturnObje returnObje = JSONUtil.toBean(data, ReturnObje.class); - // job ID - String jobUuid = returnObje.getJobUuid(); - - // TODO 回调会重试 这里注意保证幂等 - // TODO 所以需要对接方在业务层面保障幂等(可以根据jobUuid或者taskUuid进行幂等保障,视startJob时是指定应用和机器人模式还是指定任务模式) - String keyJobUuid = PublicConstant.getJobUuidKeyPrefix(jobUuid); - if (!redisUtils.setIfAbsent(keyJobUuid, DateUtil.now())) { - log.info("-刷单回调接口-幂等性:keyJobUuid:" + keyJobUuid); - return Dto.returnResult(true); - } - - log.info("====returnObje====:{}", JSONUtil.toJsonStr(returnObje)); - JobQueryByUuidReturn jobQueryByUuidReturn = ydQuartzService.queryJobUuid(returnObje.getJobUuid(), ctApply.getAccessKeyId(), ctApply.getAccessKeySecret()); - log.info("====jobQueryByUuidReturn====:{}", JSONUtil.toJsonStr(jobQueryByUuidReturn)); - List inputsList = jobQueryByUuidReturn.getData().getRobotParams().getInputs(); - // 获取id - String id = null; - String buyerName = null; - for (ResultObj resultObj:inputsList) { - if ("id".equals(resultObj.getName())) { - id = resultObj.getValue(); - } - - if ("account".equals(resultObj.getName())) { - buyerName = resultObj.getValue(); - } - } - - Integer status = DhAddCarStatusEnum.CATCH_ORDER_FAILE.value(); - if ("finish".equals(jobQueryByUuidReturn.getData().getStatus())) { - status = DhAddCarStatusEnum.CATCH_ORDER_SUCCESS.value(); - } - - Boolean resultBoolean = false; - if (ObjectUtil.isNotEmpty(id)) { - DhAddCar dhAddCar = new DhAddCar(); - dhAddCar.setId(Long.valueOf(id)); - - // 获取买家信息并修改买家信息 - CtBuyer ctBuyer = ctBuyerService.getBuyerOccupyStatusLock(buyerName); - if (ObjectUtil.isNotEmpty(ctBuyer) && BuyerOccupyStatusEnum.OCCUPIED.value().equals(ctBuyer.getOccupyStatus())) { - ctBuyer.setOccupyStatus(BuyerOccupyStatusEnum.UN_OCCUPIED.value()); - resultBoolean = ctBuyerService.updateById(ctBuyer); - } - - // TODO 需要更新的字段 从这里获取影刀返回的 然后接着设置到 对应的 基础信息里 - List outputsList = jobQueryByUuidReturn.getData().getRobotParams().getOutputs(); - if (ObjectUtil.isNotEmpty(outputsList)) { - Map resultObjMap = outputsList.stream().collect(Collectors.toMap(ResultObj::getName, ResultObj::getValue)); - DhAddCarOrder dhAddCarOrder = BeanUtil.mapToBean(resultObjMap, DhAddCarOrder.class, false); - if (ObjectUtil.isNotEmpty(dhAddCarOrder)) { - // 设置订单 公司 平台信息 - dhAddCarOrder.setType(OrderTypeEnum.CLICK_FARMING.value()); - if (dhAddCarOrderService.save(dhAddCarOrder)) { - dhAddCarOrder.setAddCarId(Long.valueOf(id)); - } - } - } else { - status = DhAddCarStatusEnum.CATCH_ORDER_FAILE.value(); - } - - dhAddCar.setResponse(jobQueryByUuidReturn.getData().getStatusName()); - dhAddCar.setStatus(status); - resultBoolean = dhAddCarService.updateById(dhAddCar); - } - - log.info("============敦煌-加购抓单-回调鉴权完成 开始执行对应的定时业务逻辑================end==="); - return Dto.returnResult(resultBoolean); - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtApplyAddDTO.java b/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtApplyAddDTO.java deleted file mode 100644 index 5f665af..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtApplyAddDTO.java +++ /dev/null @@ -1,57 +0,0 @@ -package me.zhengjie.modules.group.dto; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import javax.validation.constraints.NotNull; - -/** - * 应用信息(ct_apply)新增 DTO - * - * Author zhw - * Data 2022-07-23 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -@ApiModel(description="添加应用信息") -public class CtApplyAddDTO { - - /** 应用名称 */ - @NotNull - @ApiModelProperty(value = "应用名称", required = true) - private String name; - - /** 任务名称 */ - @NotNull - @ApiModelProperty(value = "任务名称", required = true) - private String taskName; - - /** 方法名称 */ - @ApiModelProperty(value = "方法名称") - private String methodName; - - /** accessKeyId */ - @NotNull - @ApiModelProperty(value = "accessKeyId", required = true) - private String accessKeyId; - - /** accessKeySecret */ - @NotNull - @ApiModelProperty(value = "accessKeySecret", required = true) - private String accessKeySecret; - - /** 应用id */ - @NotNull - @ApiModelProperty(value = "应用id", required = true) - private String robotUuid; - - /** 备注 */ - @NotNull - @ApiModelProperty(value = "备注", required = true) - private String remark; - -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtApplyListDTO.java b/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtApplyListDTO.java deleted file mode 100644 index 4347328..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtApplyListDTO.java +++ /dev/null @@ -1,43 +0,0 @@ -package me.zhengjie.modules.group.dto; - -import cn.hutool.core.util.ObjectUtil; -import com.baomidou.mybatisplus.core.conditions.Wrapper; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; -import me.zhengjie.dto.PageDTO; -import me.zhengjie.entity.CtApply; - - -/** - * @Description 分页查询 应用信息 - * @Date 2022/7/23 - * @Author zhw - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -@ApiModel("查询用户") -public class CtApplyListDTO extends PageDTO { - - /** 应用名称 */ - @ApiModelProperty(value = "应用名称") - private String name; - /** 应用id */ - @ApiModelProperty(value = "应用id") - private String robotUuid; - - public Wrapper getWrapper(){ - QueryWrapper qw = new QueryWrapper<>(); - qw - .like(ObjectUtil.isNotEmpty(name),"name",name) - .like(ObjectUtil.isNotEmpty(robotUuid),"robot_uuid", robotUuid) - .orderBy(ObjectUtil.isNotEmpty(getSort()),isAsc(),getSort()) - .orderByDesc("id") - ; - return qw; - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtApplyUpdateDTO.java b/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtApplyUpdateDTO.java deleted file mode 100644 index f5476ce..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtApplyUpdateDTO.java +++ /dev/null @@ -1,54 +0,0 @@ -package me.zhengjie.modules.group.dto; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import javax.validation.constraints.NotNull; - -/** - * 应用信息(ct_apply)修改 DTO - * - * Author zhw - * Data 2022-07-23 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -@ApiModel("修改应用") -public class CtApplyUpdateDTO { - - @NotNull - @ApiModelProperty(value = "id", required = true) - private Long id; - - /** 应用名称 */ - @ApiModelProperty(value = "应用名称") - private String name; - - /** 任务名称 */ - @ApiModelProperty(value = "任务名称") - private String taskName; - - /** 方法名称 */ - @ApiModelProperty(value = "方法名称") - private String methodName; - - /** accessKeyId */ - @ApiModelProperty(value = "accessKeyId") - private String accessKeyId; - - /** accessKeySecret */ - @ApiModelProperty(value = "accessKeySecret") - private String accessKeySecret; - - /** 应用id */ - @ApiModelProperty(value = "应用id") - private String robotUuid; - - /** 备注 */ - @ApiModelProperty(value = "备注") - private String remark; -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtBrowseAddDTO.java b/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtBrowseAddDTO.java deleted file mode 100644 index f99b236..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtBrowseAddDTO.java +++ /dev/null @@ -1,33 +0,0 @@ -package me.zhengjie.modules.group.dto; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import javax.validation.constraints.NotNull; - -/** - * 浏览收藏信息 DTO - * - * @author rch - * @create 2022-11-04 - */ - -@Data -@AllArgsConstructor -@NoArgsConstructor -@ApiModel("新增浏览收藏") -public class CtBrowseAddDTO { - - /** 买家ID */ - @NotNull - @ApiModelProperty(value = "买家ID", required = true) - private Long buyerId; - - /** 收藏链接 */ - @NotNull - @ApiModelProperty(value = "收藏链接", required = true) - private String linkUrl; -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtBrowseListDTO.java b/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtBrowseListDTO.java deleted file mode 100644 index 7b8a80e..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtBrowseListDTO.java +++ /dev/null @@ -1,57 +0,0 @@ -package me.zhengjie.modules.group.dto; - -import cn.hutool.core.util.ObjectUtil; -import com.baomidou.mybatisplus.core.conditions.Wrapper; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import me.zhengjie.dto.PageDTO; -import me.zhengjie.entity.CtBuyer; -import me.zhengjie.enums.ClickBrowseStatusEnum; -import me.zhengjie.enums.ClickFarmingStatusEnum; -import me.zhengjie.enums.ClickOrderStatusEnum; - -import java.util.Arrays; -import java.util.Date; - - -/** - * @Description 分页查询 浏览刷单 - * @Date 2022-11-04 - * @Author rch - */ -@Data -@ApiModel("分页查询浏览刷单") -public class CtBrowseListDTO extends PageDTO { - - /** 账号 */ - @ApiModelProperty(value = "账号") - private String account; - - /** 收藏链接 */ - @ApiModelProperty(value = "收藏链接") - private String linkUrl; - - /** 状态 1.待执行 2.执行中 3.执行成功 4.执行失败 */ - @ApiModelProperty(value = "状态 1.待执行 2.执行中 3.执行成功 4.执行失败", allowableValues = "1,2,3,4") - private Integer status; - - @ApiModelProperty(value = "是否是仅查询可以执行的浏览收藏") - private Integer inStatusList; - - public Wrapper getWrapper() { - QueryWrapper qw = new QueryWrapper(); - qw - .eq(ObjectUtil.isNotEmpty(account), "ctBuyer.account", account) - .eq(ObjectUtil.isNotEmpty(linkUrl), "ctBrowse.link_url", linkUrl) - .eq(ObjectUtil.isNotEmpty(status), "ctBrowse.status", status) - .in(ObjectUtil.isNotEmpty(inStatusList), "ctBrowse.status", Arrays.asList(ClickBrowseStatusEnum.TOBE_EXECUTION.value(), ClickBrowseStatusEnum.EXECUTION_FAILE.value())) - .orderBy(ObjectUtil.isNotEmpty(getSort()), isAsc(), getSort()) - .orderByDesc("ctBrowse.updated_at") - ; - - return qw; - } - -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtBrowseUpdateDTO.java b/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtBrowseUpdateDTO.java deleted file mode 100644 index 3859d1a..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtBrowseUpdateDTO.java +++ /dev/null @@ -1,46 +0,0 @@ -package me.zhengjie.modules.group.dto; - -import com.baomidou.mybatisplus.annotation.FieldFill; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import javax.validation.constraints.Max; -import javax.validation.constraints.Min; -import javax.validation.constraints.NotNull; - - -/** - * 修改浏览收藏 - * - * @author rch - * @create 2022-11-04 - */ - -@Data -@AllArgsConstructor -@NoArgsConstructor -@ApiModel("修改浏览收藏") -public class CtBrowseUpdateDTO { - - @NotNull - @ApiModelProperty(value = "id") - private Long id; - - /** 买家ID */ - @ApiModelProperty(value = "买家ID") - private Long buyerId; - - /** 收藏链接 */ - @ApiModelProperty(value = "收藏链接") - private String linkUrl; - - /** 状态描述 */ - @ApiModelProperty(value = "状态描述") - private String paymentResults; -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtBuyerAddDTO.java b/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtBuyerAddDTO.java deleted file mode 100644 index 97ed46d..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtBuyerAddDTO.java +++ /dev/null @@ -1,135 +0,0 @@ -package me.zhengjie.modules.group.dto; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import javax.validation.constraints.Max; -import javax.validation.constraints.Min; -import javax.validation.constraints.NotNull; - -/** - * 买家信息 DTO - * - * @author rch - * @create 2022-06-22 - */ - -@Data -@AllArgsConstructor -@NoArgsConstructor -@ApiModel("新增买家") -public class CtBuyerAddDTO { - - /** 昵称*/ - @NotNull - @ApiModelProperty(value = "昵称", required = true) - private String nickName; - - /** 账号*/ - @NotNull - @ApiModelProperty(value = "账号", required = true) - private String account; - - /** 密码*/ - @NotNull - @ApiModelProperty(value = "密码", required = true) - private String pwd; - - /** 公司id */ - @NotNull - @ApiModelProperty(value = "公司id", required = true) - private Long companyId; - - /** 平台id */ - @NotNull - @ApiModelProperty(value = "平台id", required = true) - private Integer platformId; - - ////////////////////////////////////// 新增字段 - /** 国家 */ - @NotNull - @ApiModelProperty(value = "国家", required = true) - private String contntryShort; - - /** VPN_ID(导入excel里包含) */ - @NotNull - @ApiModelProperty(value = "VPN_ID", required = true) - private Long vpnId; - - /** 信用卡ID */ - @ApiModelProperty(value = "信用卡ID", required = true) - private Long cardId; - - /** 用户等级(导入默认内部账号) 1.普通 2.精品 3.压力 4.内部账号 */ - @NotNull - @Min(1) - @Max(4) - @ApiModelProperty(value = "用户等级(导入默认内部账号) 1.普通 2.精品 3.压力 4.内部账号", required = true, allowableValues = "1,2,3,4") - private Integer level; - - /** 占用状态 1.已占用 2.未占用 */ - @NotNull - @Min(1) - @Max(2) - @ApiModelProperty(value = "占用状态 1.已占用 2.未占用", required = true, allowableValues = "1,2") - private Integer occupyStatus; - - /** 状态(导入默认正常) 1.待注册 2待验证 3.待完善 4.正常 5.异常 6.可用但已用 7.删除 */ - @NotNull - @Min(1) - @Max(7) - @ApiModelProperty(value = "状态(导入默认正常) 1.待注册 2待验证 3.待完善 4.正常 5.异常 6.可用但已用 7.删除", required = true, allowableValues = "1,2,3,4,5,6,7") - private Integer status; - - // ==================地址信息相关========================================begin - /** 地址1 */ - @NotNull - @ApiModelProperty(value = "地址1", required = true) - private String addressline1; - - /** 国家 */ - @NotNull - @ApiModelProperty(value = "国家", required = true) - private String country; - - /** 州 */ - @NotNull - @ApiModelProperty(value = "州", required = true) - private String state; - - /** 电话 */ - @NotNull - @ApiModelProperty(value = "电话", required = true) - private String tel; - - /** lastname */ - @NotNull - @ApiModelProperty(value = "lastname", required = true) - private String lastname; - - /** 税号 */ - @ApiModelProperty(value = "税号") - private String vatNumber; - - /** 城市 */ - @NotNull - @ApiModelProperty(value = "城市", required = true) - private String city; - - /** 地址2 */ - @ApiModelProperty(value = "地址2") - private String addressline2; - - /** firstname */ - @NotNull - @ApiModelProperty(value = "firstname", required = true) - private String firstname; - - /** 邮政编码 */ - @NotNull - @ApiModelProperty(value = "邮政编码", required = true) - private String postalcode; -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtBuyerListDTO.java b/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtBuyerListDTO.java deleted file mode 100644 index 9c6dc08..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtBuyerListDTO.java +++ /dev/null @@ -1,57 +0,0 @@ -package me.zhengjie.modules.group.dto; - -import cn.hutool.core.util.ObjectUtil; -import com.baomidou.mybatisplus.core.conditions.Wrapper; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import me.zhengjie.dto.PageDTO; -import me.zhengjie.entity.CtBuyer; - - -/** - * @Description 分页查询 买家信息 - * @Date 2022-06-22 - * @Author rch - */ -@Data -@ApiModel("查询买家") -public class CtBuyerListDTO extends PageDTO { - - /** 昵称*/ - @ApiModelProperty(value = "昵称") - private String nickName; - - /** 账号*/ - @ApiModelProperty(value = "账号") - private String account; - - /** 姓名 */ - @ApiModelProperty(value = "姓名") - private String pwd; - - /** 平台id */ - @ApiModelProperty(value = "平台id") - private Integer platformId; - - /** 公司id */ - @ApiModelProperty(value = "公司id") - private Long companyId; - - public Wrapper getWrapper() { - QueryWrapper qw = new QueryWrapper(); - qw - .eq(ObjectUtil.isNotEmpty(platformId), "t1.platform_id", platformId) - .eq(ObjectUtil.isNotEmpty(companyId), "t1.company_id", companyId) - .like(ObjectUtil.isNotEmpty(nickName), "t1.nick_name", nickName) - .like(ObjectUtil.isNotEmpty(account), "t1.account", account) - .like(ObjectUtil.isNotEmpty(pwd), "t1.pwd", pwd) - .orderBy(ObjectUtil.isNotEmpty(getSort()), isAsc(), getSort()) - .orderByDesc("updated_at") - ; - - return qw; - } - -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtBuyerUpdateDTO.java b/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtBuyerUpdateDTO.java deleted file mode 100644 index 9bd28c2..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtBuyerUpdateDTO.java +++ /dev/null @@ -1,122 +0,0 @@ -package me.zhengjie.modules.group.dto; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import javax.validation.constraints.Max; -import javax.validation.constraints.Min; -import javax.validation.constraints.NotNull; - - -/** - * 修改 买家 - * - * @author rch - * @create 2022-06-22 - */ - -@Data -@AllArgsConstructor -@NoArgsConstructor -@ApiModel("编辑买家") -public class CtBuyerUpdateDTO { - - @NotNull - @ApiModelProperty(value = "Id", required = true) - private Integer id; - - /** 公司id */ - @ApiModelProperty(value = "公司id") - private Long companyId; - - /** 平台id */ - @ApiModelProperty(value = "平台id") - private Integer platformId; - - /** 昵称 */ - @ApiModelProperty(value = "昵称") - private String nickName; - - /** 账号 */ - @ApiModelProperty(value = "账号") - private String account; - - /** 密码 */ - @ApiModelProperty(value = "密码") - private String pwd; - - ////////////////////////////////////// 新增字段 - /** 国家 */ - @ApiModelProperty(value = "国家") - private String contntryShort; - - /** VPN_ID(导入excel里包含) */ - @ApiModelProperty(value = "VPN_ID") - private Long vpnId; - - /** 信用卡ID */ - @ApiModelProperty(value = "信用卡ID") - private Long cardId; - - /** 用户等级(导入默认内部账号) 1.普通 2.精品 3.压力 4.内部账号 */ - @Min(1) - @Max(4) - @ApiModelProperty(value = "用户等级(导入默认内部账号) 1.普通 2.精品 3.压力 4.内部账号", allowableValues = "1,2,3,4") - private Integer level; - - /** 占用状态 1.已占用 2.未占用 */ - @Min(1) - @Max(2) - @ApiModelProperty(value = "占用状态 1.已占用 2.未占用", allowableValues = "1,2") - private Integer occupyStatus; - - /** 状态(导入默认正常) 1.待注册 2待验证 3.待完善 4.正常 5.异常 6.可用但已用 7.删除 */ - @Min(1) - @Max(7) - @ApiModelProperty(value = "状态(导入默认正常) 1.待注册 2待验证 3.待完善 4.正常 5.异常 6.可用但已用 7.删除", allowableValues = "1,2,3,4,5,6,7") - private Integer status; - - // ==================地址信息相关========================================begin - /** 地址1 */ - @ApiModelProperty(value = "地址1") - private String addressline1; - - /** 国家 */ - @ApiModelProperty(value = "国家") - private String country; - - /** 州 */ - @ApiModelProperty(value = "州") - private String state; - - /** 电话 */ - @ApiModelProperty(value = "电话") - private String tel; - - /** lastname */ - @ApiModelProperty(value = "lastname") - private String lastname; - - /** 税号 */ - @ApiModelProperty(value = "税号") - private String vatNumber; - - /** 城市 */ - @ApiModelProperty(value = "城市") - private String city; - - /** 地址2 */ - @ApiModelProperty(value = "地址2") - private String addressline2; - - /** firstname */ - @ApiModelProperty(value = "firstname") - private String firstname; - - /** 邮政编码 */ - @ApiModelProperty(value = "邮政编码") - private String postalcode; -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtCardAddDTO.java b/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtCardAddDTO.java deleted file mode 100644 index 8cba632..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtCardAddDTO.java +++ /dev/null @@ -1,105 +0,0 @@ -package me.zhengjie.modules.group.dto; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import javax.validation.constraints.Max; -import javax.validation.constraints.Min; -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; -import java.util.Date; - -/** - * 信用卡信息 DTO - * - * @author rch - * @create 2022-07-09 - */ - -@Data -@AllArgsConstructor -@NoArgsConstructor -@ApiModel("新增信用卡") -public class CtCardAddDTO { - - /** 父ID */ - // private Long parentId; - - /** 卡号 */ - @NotBlank - @ApiModelProperty(value = "卡号", required = true) - private String number; - -// /** PIN码 */ -// @NotBlank -// @ApiModelProperty(value = "PIN码", required = true) -// private String pinNumber; - - /** 持卡人姓氏 */ - @NotBlank - @ApiModelProperty(value = "持卡人姓氏", required = true) - private String holderSurname; - - /** 持卡人名称 */ - @NotBlank - @ApiModelProperty(value = "持卡人名称", required = true) - private String holderName; - - /** 有效期 */ - @NotBlank - private String termOfValidity; - - /** 开卡日期 */ - // private Date openDate; - - /** 所属国家 */ - @ApiModelProperty(value = "所属国家", required = true) - private String contntryShort; - - /** 信用卡类型 1.Payoneer 2.万事达虚拟卡 3.Visa信用卡 */ - @NotNull - @Min(1) - @Max(3) - @ApiModelProperty(value = "信用卡类型 1.Payoneer 2.万事达虚拟卡 3.Visa信用卡", required = true, allowableValues = "1,2,3") - private Integer type; - - /** 所属厂商:1.AmzKeys 2.Airwallex */ - @NotNull - @Min(1) - @Max(2) - @ApiModelProperty(value = "所属厂商:1.AmzKeys 2.Airwallex", required = true, allowableValues = "1,2") - private Integer cardDealer; - - /** 身份证号 */ - // private String idNumber; - - /** 省份 */ - // private String province; - - /** 城市 */ - // private String country; - - /** 地址 */ - // private String address; - - /** 手机号 */ - // private String phone; - - /** 邮箱 */ - // private String email; - - /** 登陆账号 */ - // private String account; - - /** 密码 */ - @ApiModelProperty(value = "密码", required = true) - @NotNull - private String pwd; - - /** 备注 */ - @ApiModelProperty(value = "备注") - private String remarks; -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtCardListDTO.java b/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtCardListDTO.java deleted file mode 100644 index bcb8320..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtCardListDTO.java +++ /dev/null @@ -1,62 +0,0 @@ -package me.zhengjie.modules.group.dto; - -import cn.hutool.core.util.ObjectUtil; -import com.baomidou.mybatisplus.core.conditions.Wrapper; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import me.zhengjie.dto.PageDTO; -import me.zhengjie.entity.CtBuyer; - - -/** - * @Description 分页查询 信用卡 - * @Date 2022-07-9 - * @Author rch - */ -@Data -@ApiModel("分页查询信用卡") -public class CtCardListDTO extends PageDTO { - - /** 卡号 */ - @ApiModelProperty(value = "卡号") - private String number; - - /** PIN码 */ - @ApiModelProperty(value = "PIN码") - private String pinNumber; - - /** 持卡人名称 */ - @ApiModelProperty(value = "持卡人名称") - private String holderName; - - /** 信用卡类型 1.Payoneer 2.万事达虚拟卡 3.Visa信用卡 */ - @ApiModelProperty(value = "信用卡类型 1.Payoneer 2.万事达虚拟卡 3.Visa信用卡", allowableValues = "1,2,3") - private Integer type; - - /** 所属厂商:1.AmzKeys 2.Airwallex */ - @ApiModelProperty(value = "所属厂商:1.AmzKeys 2.Airwallex", allowableValues = "1,2") - private Integer cardDealer; - - /** 状态:1.正常、2.异常、3.已删除 */ - @ApiModelProperty(value = "状态:1.正常、2.异常、3.已删除", allowableValues = "1,2,3") - private Integer status; - - public Wrapper getWrapper() { - QueryWrapper qw = new QueryWrapper(); - qw - .eq(ObjectUtil.isNotEmpty(type), "type", type) - .eq(ObjectUtil.isNotEmpty(cardDealer), "card_dealer", cardDealer) - .eq(ObjectUtil.isNotEmpty(status), "status", status) - .like(ObjectUtil.isNotEmpty(number), "number", number) - .like(ObjectUtil.isNotEmpty(pinNumber), "pin_number", pinNumber) - .like(ObjectUtil.isNotEmpty(holderName), "holder_name", holderName) - .orderBy(ObjectUtil.isNotEmpty(getSort()), isAsc(), getSort()) - .orderByDesc("updated_at") - ; - - return qw; - } - -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtCardUpdateDTO.java b/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtCardUpdateDTO.java deleted file mode 100644 index c63831c..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtCardUpdateDTO.java +++ /dev/null @@ -1,75 +0,0 @@ -package me.zhengjie.modules.group.dto; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import javax.validation.constraints.Max; -import javax.validation.constraints.Min; -import javax.validation.constraints.NotNull; - - -/** - * 修改信用卡 - * - * @author rch - * @create 2022-06-22 - */ - -@Data -@AllArgsConstructor -@NoArgsConstructor -@ApiModel("修改信用卡") -public class CtCardUpdateDTO { - - @NotNull - @ApiModelProperty(value = "Id", required = true) - private Integer id; - - /** 卡号 */ - @ApiModelProperty(value = "卡号") - private String number; - -// /** PIN码 */ -// @ApiModelProperty(value = "PIN码") -// private String pinNumber; - - /** 持卡人姓氏 */ - @ApiModelProperty(value = "持卡人姓氏") - private String holderSurname; - - /** 持卡人名称 */ - @ApiModelProperty(value = "持卡人名称") - private String holderName; - - /** 有效期 */ - @ApiModelProperty(value = "有效期") - private String termOfValidity; - - /** 所属国家 */ - @ApiModelProperty(value = "所属国家") - private String contntryShort; - - /** 信用卡类型 1.Payoneer 2.万事达虚拟卡 3.Visa信用卡 */ - @Min(1) - @Max(3) - @ApiModelProperty(value = "信用卡类型 1.Payoneer 2.万事达虚拟卡 3.Visa信用卡", required = true, allowableValues = "1,2,3") - private Integer type; - - /** 所属厂商:1.AmzKeys 2.Airwallex */ - @Min(1) - @Max(2) - @ApiModelProperty(value = "所属厂商:1.AmzKeys 2.Airwallex", required = true, allowableValues = "1,2") - private Integer cardDealer; - - /** 密码 */ - @NotNull - @ApiModelProperty(value = "密码", required = true) - private String pwd; - - /** 备注 */ - @ApiModelProperty(value = "备注") - private String remarks; -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtClickFarmingAddDTO.java b/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtClickFarmingAddDTO.java deleted file mode 100644 index 3ec971a..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtClickFarmingAddDTO.java +++ /dev/null @@ -1,83 +0,0 @@ -package me.zhengjie.modules.group.dto; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import io.swagger.models.auth.In; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; - -/** - * 刷单信息 DTO - * - * @author rch - * @create 2022-07-09 - */ - -@Data -@AllArgsConstructor -@NoArgsConstructor -@ApiModel("新增刷单信息") -public class CtClickFarmingAddDTO { - - @NotNull - /** 买家id */ - @ApiModelProperty(value = "买家id", required = true) - private Long buyerId; - - /** 店铺名称 */ - @ApiModelProperty(value = "店铺名称", required = true) - private String shopName; - - /** 刷单类型 */ - @NotNull - @ApiModelProperty(value = "商品属性类型:1.关键词 2.链接", required = true, allowableValues = "1,2") - private Integer paramsType; - - /** 关键词 */ - @ApiModelProperty(value = "关键词", required = true) - private String keyWord; - - /** 标题 */ - @ApiModelProperty(value = "标题", required = true) - private String title; - - /** 链接 */ - @ApiModelProperty(value = "链接", required = true) - private String link; - - /** 数量 */ - @ApiModelProperty(value = "数量", required = true) - private Integer number; - - /** 规格 */ - @ApiModelProperty(value = "规格") - private String specification; - - /** 颜色 */ - @ApiModelProperty(value = "颜色") - private String color; - - /** item */ - @ApiModelProperty(value = "item", required = true) - private String item; - - @ApiModelProperty(value = "exchange") - private String exchange; - - /** 最小价格区间 */ - @ApiModelProperty(value = "最小价格区间") - private String sectionMin; - - /** 最大价格区间 */ - @ApiModelProperty(value = "最大价格区间") - private String sectionMax; - - /** 留言 */ - @NotBlank - @ApiModelProperty(value = "留言", required = true) - private String amessage; -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtClickFarmingDTO.java b/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtClickFarmingDTO.java deleted file mode 100644 index 5827d9b..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtClickFarmingDTO.java +++ /dev/null @@ -1,87 +0,0 @@ -package me.zhengjie.modules.group.dto; - -import cn.hutool.core.util.ObjectUtil; -import com.baomidou.mybatisplus.core.conditions.Wrapper; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import me.zhengjie.dto.PageDTO; -import me.zhengjie.entity.CtBuyer; -import me.zhengjie.enums.ClickFarmingStatusEnum; - -import java.util.Arrays; -import java.util.List; - - -/** - * @Description 分页查询 刷单信息 - * @Date 2022-07-9 - * @Author rch - */ -@Data -@ApiModel("分页查询刷单信息") -public class CtClickFarmingDTO extends PageDTO { - - /** 关键词 */ - @ApiModelProperty(value = "关键词") - private String keyWord; - - /** Item */ - @ApiModelProperty(value = "Item") - private String item; - - /** 店铺名称 */ - @ApiModelProperty(value = "店铺名称") - private String shopName; - -// /** 刷单类型 */ -// private Integer type; - /** 刷单类型 */ - private Integer paramsType; - /** 国家 */ - private String country; - /** 账号 */ - private String account; - -// /** 平台类型 2.速卖通 1.敦煌*/ -// private Integer platformId; - - /** 状态 1.待执行 2.执行中 3.执行成功 4.执行失败 5.代付款 */ - @ApiModelProperty(value = "状态 1.待执行 2.执行中 3.执行成功 4.执行失败 5.代付款", allowableValues = "1,2,3,4,5") - private Integer status; - - @ApiModelProperty(value = "") - private List inStatusList; - - /** 支付订单ID */ - @ApiModelProperty(value = "支付订单ID") - private String payOrderId; - -// @ApiModelProperty(value = "是否是抓单 1.是 0.否") // ct_click_order_id -// private Integer inCatchorder; - - public Wrapper getWrapper() { - QueryWrapper qw = new QueryWrapper(); - qw -// .eq(ObjectUtil.isNotEmpty(type), "farming.type", type) - .eq(ObjectUtil.isNotEmpty(paramsType), "farming.params_type", paramsType) - .eq(ObjectUtil.isNotEmpty(country), "buyer.contntry_short", country) - .eq(ObjectUtil.isNotEmpty(account), "buyer.account", account) -// .eq(ObjectUtil.isNotEmpty(platformId), "buyer.platform_id", platformId) - .eq(ObjectUtil.isNotEmpty(status), "farming.status", status) -// .isNull(ObjectUtil.isNotEmpty(inCatchorder), "farming.ct_click_order_id") - .in(ObjectUtil.isNotEmpty(inStatusList), "farming.status", Arrays.asList(ClickFarmingStatusEnum.TOBE_EXECUTION.value(), ClickFarmingStatusEnum.EXECUTION_FAILE.value())) -// .in(ObjectUtil.isNotEmpty(inCatchorder), "farming.status", Arrays.asList(ClickFarmingStatusEnum.EXECUTION_SUCCESS.value(), ClickFarmingStatusEnum.EXECUTION_FAILE.value())) - .like(ObjectUtil.isNotEmpty(keyWord), "farming.key_word", keyWord) - .like(ObjectUtil.isNotEmpty(item), "farming.item", item) - .like(ObjectUtil.isNotEmpty(shopName), "farming.shop_name", shopName) - .like(ObjectUtil.isNotEmpty(payOrderId), "clickOrder.order_id", payOrderId) - .orderBy(ObjectUtil.isNotEmpty(getSort()), isAsc(), getSort()) - .orderByDesc("updated_at") - ; - - return qw; - } - -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtClickFarmingEditDTO.java b/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtClickFarmingEditDTO.java deleted file mode 100644 index a10d747..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtClickFarmingEditDTO.java +++ /dev/null @@ -1,84 +0,0 @@ -package me.zhengjie.modules.group.dto; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; - -/** - * 刷单信息 DTO - * - * @author rch - * @create 2022-07-09 - */ - -@Data -@AllArgsConstructor -@NoArgsConstructor -@ApiModel("刷单信息") -public class CtClickFarmingEditDTO { - - @NotNull - @ApiModelProperty(value = "Id", required = true) - private Long id; - - @ApiModelProperty(value = "buyerId") - @NotNull - private Long buyerId; - - /** 刷单类型 */ - @NotNull - @ApiModelProperty(value = "商品属性类型:1.关键词 2.链接", required = true, allowableValues = "1,2") - private Integer paramsType; - - /** 店铺名称 */ - @ApiModelProperty(value = "店铺名称") - private String shopName; - - /** 关键词 */ - @ApiModelProperty(value = "关键词") - private String keyWord; - - /** 标题 */ - @ApiModelProperty(value = "标题") - private String title; - - /** 链接 */ - @ApiModelProperty(value = "链接") - private String link; - - /** 数量 */ - @ApiModelProperty(value = "数量") - private Integer number; - - /** 规格 */ - @ApiModelProperty(value = "规格") - private String specification; - - /** 颜色 */ - @ApiModelProperty(value = "颜色") - private String color; - - /** item */ - @ApiModelProperty(value = "item") - private String item; - - @ApiModelProperty(value = "exchange") - private String exchange; - - /** 最小价格区间 */ - @ApiModelProperty(value = "最小价格区间") - private String sectionMin; - - /** 最大价格区间 */ - @ApiModelProperty(value = "最大价格区间") - private String sectionMax; - - /** 留言 */ - @ApiModelProperty(value = "留言") - private String amessage; -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtClickOrderAddDto.java b/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtClickOrderAddDto.java deleted file mode 100644 index 1e35345..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtClickOrderAddDto.java +++ /dev/null @@ -1,71 +0,0 @@ -package me.zhengjie.modules.group.dto; - -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import javax.validation.constraints.NotNull; - -/** - * 刷单-订单评论信息 - * - * @author rch - * @since 2022-10-20 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -@ApiModel("新增刷单订单评论") -public class CtClickOrderAddDto { - - /** 公司ID */ - @NotNull - @ApiModelProperty(value = "公司ID", required = true) - private Long companyId; - - /** 总金额 */ - @NotNull - @ApiModelProperty(value = "总金额", required = true) - private String amount; - - /** 状态描述 */ - @NotNull - @ApiModelProperty(value = "状态描述", required = true) - private String paymentResults; - - /** 店铺名称 */ - @NotNull - @ApiModelProperty(value = "店铺名称", required = true) - private String shop; - - /** 购买数量 */ - @NotNull - @ApiModelProperty(value = "购买数量", required = true) - private String pricesNumber; - - /** 订单id */ - @NotNull - @ApiModelProperty(value = "订单id", required = true) - private String orderId; - - /** 商品名称 */ - @NotNull - @ApiModelProperty(value = "商品名称", required = true) - private String shopName; - - /** 时间 */ - @NotNull - @ApiModelProperty(value = "时间", required = true) - private String orderDate; - - /** 评论 */ - @ApiModelProperty(value = "评论") - private String comment; - - /** 图片地址 */ - @ApiModelProperty(value = "图片地址") - private String paths; -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtClickOrderCommentDto.java b/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtClickOrderCommentDto.java deleted file mode 100644 index 19fb974..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtClickOrderCommentDto.java +++ /dev/null @@ -1,34 +0,0 @@ -package me.zhengjie.modules.group.dto; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import javax.validation.constraints.NotNull; - -/** - * 刷单-订单评论信息 - * - * @author rch - * @since 2022-10-20 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -@ApiModel("新增评论") -public class CtClickOrderCommentDto { - /** 刷单订单id */ - @NotNull - @ApiModelProperty(value = "Id", required = true) - private Long id; - - /** 评论信息 */ - @ApiModelProperty(value = "评论信息") - private String comment; - - /** 图片地址 */ - @ApiModelProperty(value = "图片地址") - private String paths; -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtClickOrderListDTO.java b/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtClickOrderListDTO.java deleted file mode 100644 index 6751a07..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtClickOrderListDTO.java +++ /dev/null @@ -1,69 +0,0 @@ -package me.zhengjie.modules.group.dto; - -import cn.hutool.core.util.ObjectUtil; -import com.baomidou.mybatisplus.core.conditions.Wrapper; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import me.zhengjie.dto.PageDTO; -import me.zhengjie.entity.CtClickOrder; - - -/** - * @Description 分页查询 刷单订单信息 - * @Date 2022-06-22 - * @Author rch - */ -@Data -@ApiModel("分页查询刷单订单") -public class CtClickOrderListDTO extends PageDTO { - - /** 店铺 */ - @ApiModelProperty(value = "店铺") - private String shop; - - /** 订单id */ - @ApiModelProperty(value = "订单id") - private String orderId; - - /** 公司id */ - @ApiModelProperty(value = "公司id") - private Long companyId; - - /** 类型 */ - @ApiModelProperty(value = "类型") - private Integer type; - - /** 状态 1.待执行 2.执行中 3.执行成功 4.执行失败 */ - @ApiModelProperty(value = "状态 1.待执行 2.执行中 3.执行成功 4.执行失败", allowableValues = "1,2,3,4") - private Integer status; - - /** 开始时间 */ - @ApiModelProperty(value = "开始时间") - private String sTime; - - /** 结束时间 */ - @ApiModelProperty(value = "结束时间") - private String eTime; - - @ApiModelProperty(value = "是否评论") - private Boolean commentBoolean; - - public Wrapper getWrapper() { - QueryWrapper qw = new QueryWrapper(); - qw - .eq(ObjectUtil.isNotEmpty(companyId), "company.id", companyId) - .eq(ObjectUtil.isNotEmpty(status), "clickOrder.status", status) - .eq(ObjectUtil.isNotEmpty(type), "clickOrder.type", type) - .isNotNull((ObjectUtil.isNotEmpty(commentBoolean) && commentBoolean), "comment") - .like(ObjectUtil.isNotEmpty(shop), "clickOrder.shop", shop) - .like(ObjectUtil.isNotEmpty(orderId), "clickOrder.order_id", orderId) - .between(ObjectUtil.isNotEmpty(sTime) && ObjectUtil.isNotEmpty(eTime), "clickOrder.created_at", sTime, eTime) - .orderByDesc("created_at") - ; - - return qw; - } - -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtClickOrderSupplementDto.java b/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtClickOrderSupplementDto.java deleted file mode 100644 index 16043a3..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtClickOrderSupplementDto.java +++ /dev/null @@ -1,58 +0,0 @@ -package me.zhengjie.modules.group.dto; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import javax.validation.constraints.NotNull; - -/** - * 刷单-订单信息手动补录 - * - * @author rch - * @since 2022-10-15 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -@ApiModel("补录订单信息") -public class CtClickOrderSupplementDto { - /** 刷单id */ - @NotNull - @ApiModelProperty(value = "刷单id", required = true) - private Long clickFarmingId; - - /** 总金额 */ - @NotNull - @ApiModelProperty(value = "总金额", required = true) - private String amount; - - /** 状态描述 */ - @NotNull - @ApiModelProperty(value = "状态描述", required = true) - private String paymentResults; - - /** 店铺名称 */ - @NotNull - @ApiModelProperty(value = "店铺名称", required = true) - private String shop; - - /** 购买数量 */ - @NotNull - @ApiModelProperty(value = "购买数量", required = true) - private String pricesNumber; - - /** 订单id */ - @ApiModelProperty(value = "订单id") - private String orderId; - - /** 商品名称 */ - @ApiModelProperty(value = "商品名称") - private String shopName; - - /** 时间 */ - @ApiModelProperty(value = "时间") - private String orderDate; -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtCompanyAddDTO.java b/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtCompanyAddDTO.java deleted file mode 100644 index dfad073..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtCompanyAddDTO.java +++ /dev/null @@ -1,29 +0,0 @@ -package me.zhengjie.modules.group.dto; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * 公司信息 DTO - * - * @author rch - * @create 2022-06-28 - */ - -@Data -@AllArgsConstructor -@NoArgsConstructor -public class CtCompanyAddDTO { - - /** 名称 */ - private String name; - /** 地址 */ - private String address; - /** 电话 */ - private String phone; - - // 下面这两个需要新增的时候生成 - /** 商户码(公司调用api公司唯一标识) */ - /** 商户token(公司调用api公司token身份标识) */ -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtCompanyListDTO.java b/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtCompanyListDTO.java deleted file mode 100644 index 72aa00a..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtCompanyListDTO.java +++ /dev/null @@ -1,47 +0,0 @@ -package me.zhengjie.modules.group.dto; - -import cn.hutool.core.util.ObjectUtil; -import com.baomidou.mybatisplus.core.conditions.Wrapper; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import lombok.Data; -import me.zhengjie.dto.PageDTO; -import me.zhengjie.entity.CtBuyer; - - -/** - * @Description 分页查询 公司信息 - * @Date 2022-06-28 - * @Author rch - */ -@Data -public class CtCompanyListDTO extends PageDTO { - /** 名称 */ - private String name; - /** 电话 */ - private String phone; - /** 地址 */ - private String address; - /** 商户码(公司调用api公司唯一标识) */ - private String number; - /** 商户token(公司调用api公司token身份标识) */ - private String token; - - /** 操作人账号*/ - private String gmName; - - public Wrapper getWrapper() { - QueryWrapper qw = new QueryWrapper(); - qw - .like(ObjectUtil.isNotEmpty(name), "name", name) - .like(ObjectUtil.isNotEmpty(phone), "phone", phone) - .like(ObjectUtil.isNotEmpty(address), "address", address) - .like(ObjectUtil.isNotEmpty(number), "number", number) - .like(ObjectUtil.isNotEmpty(token), "token", token) - .orderBy(ObjectUtil.isNotEmpty(getSort()), isAsc(), getSort()) - .orderByDesc("updated_at") - ; - - return qw; - } - -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtCompanyUpdateDTO.java b/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtCompanyUpdateDTO.java deleted file mode 100644 index 0309484..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtCompanyUpdateDTO.java +++ /dev/null @@ -1,30 +0,0 @@ -package me.zhengjie.modules.group.dto; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import javax.validation.constraints.NotNull; - - -/** - * 修改 买家 - * - * @author rch - * @create 2022-06-22 - */ - -@Data -@AllArgsConstructor -@NoArgsConstructor -public class CtCompanyUpdateDTO { - - @NotNull - private Integer id; - /** 名称 */ - private String name; - /** 地址 */ - private String address; - /** 电话 */ - private String phone; -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtDhPayAddDTO.java b/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtDhPayAddDTO.java deleted file mode 100644 index 22d3499..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtDhPayAddDTO.java +++ /dev/null @@ -1,30 +0,0 @@ -package me.zhengjie.modules.group.dto; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.Pattern; - -/** - * 敦煌支付信息 DTO - * - * @author rch - * @create 2022-07-09 - */ - -@Data -@AllArgsConstructor -@NoArgsConstructor -public class CtDhPayAddDTO { - - /** 买家名称 */ - @NotBlank - private String buyerName; - - /** 支付订单ID(敦煌的) */ - @NotBlank - @Pattern(regexp = "^[0-9]+(,[0-9]+)*$", message = "订单编号不符合要求") - private String orderId; -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtDhPayListDTO.java b/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtDhPayListDTO.java deleted file mode 100644 index 3f3fa01..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtDhPayListDTO.java +++ /dev/null @@ -1,39 +0,0 @@ -package me.zhengjie.modules.group.dto; - -import cn.hutool.core.util.ObjectUtil; -import com.baomidou.mybatisplus.core.conditions.Wrapper; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import lombok.Data; -import me.zhengjie.dto.PageDTO; -import me.zhengjie.entity.CtBuyer; - - -/** - * @Description 分页查询 敦煌支付信息 - * @Date 2022-07-28 - * @Author rch - */ -@Data -public class CtDhPayListDTO extends PageDTO { - - /** 买家名称 */ - private String buyerName; - /** 支付订单ID(敦煌的) */ - private String orderId; - /** 状态 0.待处理 1.支付成功 2.支付失败 3.删除*/ - private Integer status; - - public Wrapper getWrapper() { - QueryWrapper qw = new QueryWrapper(); - qw - .eq(ObjectUtil.isNotEmpty(status), "status", status) - .like(ObjectUtil.isNotEmpty(buyerName), "buyer_name", buyerName) - .like(ObjectUtil.isNotEmpty(orderId), "order_id", orderId) - .orderBy(ObjectUtil.isNotEmpty(getSort()), isAsc(), getSort()) - .orderByDesc("updated_at") - ; - - return qw; - } - -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtExcelAddDTO.java b/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtExcelAddDTO.java deleted file mode 100644 index 891b5f4..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtExcelAddDTO.java +++ /dev/null @@ -1,27 +0,0 @@ -package me.zhengjie.modules.group.dto; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import javax.validation.constraints.NotNull; - -/** - * Excel 导入信息(CtExcel)表实体类 DTO - * - * @author rch - * @since 2022-06-23 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class CtExcelAddDTO{ - - /** 备注 */ - @NotNull - private String remarks; - - /** excel路径 */ - @NotNull - private String path; -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtExcelImportInfoListDTO.java b/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtExcelImportInfoListDTO.java deleted file mode 100644 index 582100c..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtExcelImportInfoListDTO.java +++ /dev/null @@ -1,41 +0,0 @@ -package me.zhengjie.modules.group.dto; - -import cn.hutool.core.util.ObjectUtil; -import com.baomidou.mybatisplus.core.conditions.Wrapper; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import lombok.Data; -import me.zhengjie.dto.PageDTO; -import me.zhengjie.entity.CtBuyer; - - -/** - * @Description 分页查询 买家信息 - * @Date 2022-06-22 - * @Author rch - */ -@Data -public class CtExcelImportInfoListDTO extends PageDTO { - - /** 公司主键 */ - private Long companyId; - - /** 鉴权枚举 */ - private Integer tokenEnum; - - /** 状态 1.待处理 2.处理成功 3.处理失败 */ - private Integer status; - - public Wrapper getWrapper() { - QueryWrapper qw = new QueryWrapper(); - qw - .eq(ObjectUtil.isNotEmpty(companyId), "company_id", companyId) - .eq(ObjectUtil.isNotEmpty(tokenEnum), "token_enum", tokenEnum) - .eq(ObjectUtil.isNotEmpty(status), "status", status) - .orderBy(ObjectUtil.isNotEmpty(getSort()), isAsc(), getSort()) - .orderByDesc("updated_at") - ; - - return qw; - } - -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtExcelListDTO.java b/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtExcelListDTO.java deleted file mode 100644 index e51b0f5..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtExcelListDTO.java +++ /dev/null @@ -1,40 +0,0 @@ -package me.zhengjie.modules.group.dto; - -import cn.hutool.core.util.ObjectUtil; -import com.baomidou.mybatisplus.core.conditions.Wrapper; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; -import me.zhengjie.dto.PageDTO; -import me.zhengjie.entity.CtExcel; - -/** - * Excel 导入信息(CtExcel)表实体类 DTO - * - * @author rch - * @since 2022-06-23 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class CtExcelListDTO extends PageDTO { - - /** 备注 */ - private String remarks; - - /** 状态1.待处理 2.已处理 */ - private Integer status; - - public Wrapper getWrapper() { - QueryWrapper qw = new QueryWrapper(); - qw - .like(ObjectUtil.isNotEmpty(remarks), "remarks", remarks) - .eq(ObjectUtil.isNotEmpty(status), "status", status) - .orderBy(ObjectUtil.isNotEmpty(getSort()), isAsc(), getSort()) - .orderByDesc("updated_at") - ; - - return qw; - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtExcelUpdateDTO.java b/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtExcelUpdateDTO.java deleted file mode 100644 index 0dbd06b..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtExcelUpdateDTO.java +++ /dev/null @@ -1,27 +0,0 @@ -package me.zhengjie.modules.group.dto; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import javax.validation.constraints.NotNull; - - -/** - * 修改 Excel - * - * @author rch - * @create 2022-06-22 - */ - -@Data -@AllArgsConstructor -@NoArgsConstructor -public class CtExcelUpdateDTO { - - @NotNull - private Integer id; - - /** 备注 */ - private String remarks; -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtOrderListDTO.java b/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtOrderListDTO.java deleted file mode 100644 index 75ce756..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtOrderListDTO.java +++ /dev/null @@ -1,42 +0,0 @@ -package me.zhengjie.modules.group.dto; - -import cn.hutool.core.util.ObjectUtil; -import com.baomidou.mybatisplus.core.conditions.Wrapper; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import lombok.Data; -import me.zhengjie.dto.PageDTO; -import me.zhengjie.entity.CtBuyer; - - -/** - * @Description 分页查询 订单信息 - * @Date 2022-07-01 - * @Author rch - */ -@Data -public class CtOrderListDTO extends PageDTO { - - /** 公司Id */ - private Long companyId; - /** ExcelId 信息 */ - private Long excelInfoId; - /** 我们平台订单编号 */ - private String ctOrderNo; - /** 订单号,下单成功响应的订单号(冗余字段 下单成功响应订单信息里有) */ - private Long orderNo; - - public Wrapper getWrapper() { - QueryWrapper qw = new QueryWrapper(); - qw - .eq(ObjectUtil.isNotEmpty(companyId), "company_id", companyId) - .eq(ObjectUtil.isNotEmpty(excelInfoId), "excel_info_id", excelInfoId) - .eq(ObjectUtil.isNotEmpty(ctOrderNo), "ct_order_no", ctOrderNo) - .eq(ObjectUtil.isNotEmpty(orderNo), "order_no", orderNo) - .orderBy(ObjectUtil.isNotEmpty(getSort()), isAsc(), getSort()) - .orderByDesc("updated_at") - ; - - return qw; - } - -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtPlatformAddDTO.java b/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtPlatformAddDTO.java deleted file mode 100644 index 88a1c82..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtPlatformAddDTO.java +++ /dev/null @@ -1,25 +0,0 @@ -package me.zhengjie.modules.group.dto; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * 平台信息 DTO - * - * @author rch - * @create 2022-06-23 - */ - -@Data -@AllArgsConstructor -@NoArgsConstructor -public class CtPlatformAddDTO { - - /** 名称 */ - private String name; - /** 地址 */ - private String address; - /** 电话 */ - private String phone; -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtPlatformListDTO.java b/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtPlatformListDTO.java deleted file mode 100644 index a7d71a9..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtPlatformListDTO.java +++ /dev/null @@ -1,39 +0,0 @@ -package me.zhengjie.modules.group.dto; - -import cn.hutool.core.util.ObjectUtil; -import com.baomidou.mybatisplus.core.conditions.Wrapper; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import lombok.Data; -import me.zhengjie.dto.PageDTO; -import me.zhengjie.entity.CtPlatform; - - -/** - * @Description 分页查询 平台信息 - * @Date 2022-06-23 - * @Author rch - */ -@Data -public class CtPlatformListDTO extends PageDTO { - - /** 名称 */ - private String name; - /** 地址 */ - private String address; - /** 电话 */ - private String phone; - - public Wrapper getWrapper() { - QueryWrapper qw = new QueryWrapper(); - qw - .like(ObjectUtil.isNotEmpty(name), "name", name) - .like(ObjectUtil.isNotEmpty(address), "address", address) - .like(ObjectUtil.isNotEmpty(phone), "phone", phone) - .orderBy(ObjectUtil.isNotEmpty(getSort()), isAsc(), getSort()) - .orderByDesc("updated_at") - ; - - return qw; - } - -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtPlatformUpdateDTO.java b/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtPlatformUpdateDTO.java deleted file mode 100644 index e04fcd9..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtPlatformUpdateDTO.java +++ /dev/null @@ -1,31 +0,0 @@ -package me.zhengjie.modules.group.dto; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import javax.validation.constraints.NotNull; - - -/** - * 修改 平台信息 - * - * @author rch - * @create 2022-06-22 - */ - -@Data -@AllArgsConstructor -@NoArgsConstructor -public class CtPlatformUpdateDTO { - - @NotNull - private Integer id; - - /** 名称 */ - private String name; - /** 地址 */ - private String address; - /** 电话 */ - private String phone; -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtRebotAddDTO.java b/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtRebotAddDTO.java deleted file mode 100644 index 0e58d38..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtRebotAddDTO.java +++ /dev/null @@ -1,26 +0,0 @@ -package me.zhengjie.modules.group.dto; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import javax.validation.constraints.NotNull; - -/** - * 影刀机器人(ct_rebot) 新增DTO - * - * @Author zhw - * @Date 2022-07-23 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class CtRebotAddDTO { - - /** 机器人账号 */ - @NotNull - private String accountName; - /** 机器人Uuid信息 */ - @NotNull - private String robotClientUuid; -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtRebotListDTO.java b/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtRebotListDTO.java deleted file mode 100644 index 3393a56..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtRebotListDTO.java +++ /dev/null @@ -1,42 +0,0 @@ -package me.zhengjie.modules.group.dto; - -import cn.hutool.core.util.ObjectUtil; -import com.baomidou.mybatisplus.annotation.FieldFill; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.core.conditions.Wrapper; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; -import me.zhengjie.dto.PageDTO; -import me.zhengjie.entity.CtRebot; - -/** - * 影刀机器人 分页查询DTO - * - * @Author zhw - * @Date 2022-07-23 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class CtRebotListDTO extends PageDTO { - - /** 机器人账号 */ - private String accountName; - /** 机器人Uuid信息 */ - private String robotClientUuid; - - public Wrapper getWrapper(){ - QueryWrapper qw = new QueryWrapper<>(); - qw - .like(ObjectUtil.isNotEmpty(accountName),"account_name",accountName) - .like(ObjectUtil.isNotEmpty(robotClientUuid),"robot_client_uuid",robotClientUuid) - .orderBy(ObjectUtil.isNotEmpty(getSort()),isAsc(),getSort()) - .orderByDesc("id") - ; - return qw; - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtRebotUpdateDTO.java b/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtRebotUpdateDTO.java deleted file mode 100644 index f5b9a4e..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtRebotUpdateDTO.java +++ /dev/null @@ -1,33 +0,0 @@ -package me.zhengjie.modules.group.dto; - -import com.baomidou.mybatisplus.annotation.FieldFill; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import javax.validation.constraints.NotNull; - -/** - * 根据ID修改影刀机器人(ct_rebot) 信息 - * - * @Author zhw - * @Date 2022-07-23 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class CtRebotUpdateDTO { - - @NotNull - private Long id; - - /** 机器人账号 */ - private String accountName; - /** 机器人Uuid信息 */ - private String robotClientUuid; - /** 任务id(任务id 不为0说明机器被占用) */ - private Integer jobId; -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtRebotUpdateStatusDTO.java b/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtRebotUpdateStatusDTO.java deleted file mode 100644 index fba3f4b..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtRebotUpdateStatusDTO.java +++ /dev/null @@ -1,24 +0,0 @@ -package me.zhengjie.modules.group.dto; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import javax.validation.constraints.NotNull; - -/** - * 根据ID修改影刀机器人(ct_rebot) 状态测试使用 - * - * @Author zhw - * @Date 2022-07-23 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class CtRebotUpdateStatusDTO { - - @NotNull - private Long id; - - private Integer status; -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtVpnAddDTO.java b/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtVpnAddDTO.java deleted file mode 100644 index 4c92a85..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtVpnAddDTO.java +++ /dev/null @@ -1,50 +0,0 @@ -package me.zhengjie.modules.group.dto; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import javax.validation.constraints.NotNull; - -/** - * @Author zhw - * @Date 2022-07-07 - * @Description Vpn新增DTO - */ - -@Data -@AllArgsConstructor -@NoArgsConstructor -public class CtVpnAddDTO { - /** 所属国家简称 */ - @NotNull - private String contntryShort; - /** IP地址 */ - @NotNull - private String ipAddress; - /** 父ip地址 */ - @NotNull - private String parentIpAddress; - /** 端口 */ - @NotNull - private Integer port; - /** 名称 */ - @NotNull - private String name; - /** 密码 */ - @NotNull - private String pwd; - /** VPS类型 1.传统 */ - @NotNull - private Integer vpsType; - /** 经销商 1.V2 */ - @NotNull - private Integer dealer; - /** mac地址 */ - @NotNull - public String mac; - /** 链接 */ - private String link; - /** 状态 1.可用 2.禁用 */ - public Integer status;; -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtVpnListDTO.java b/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtVpnListDTO.java deleted file mode 100644 index 06348ea..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtVpnListDTO.java +++ /dev/null @@ -1,59 +0,0 @@ -package me.zhengjie.modules.group.dto; - -import cn.hutool.core.util.ObjectUtil; -import com.baomidou.mybatisplus.core.conditions.Wrapper; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import lombok.Data; -import me.zhengjie.dto.PageDTO; -import me.zhengjie.entity.CtVpn; - -/** - * @Description 分页查询 VPN信息 - * @Date 2022/7/7 - * @Author zhw - */ -@Data -public class CtVpnListDTO extends PageDTO { - - /** 所属国家简称 */ - private String contntryShort; - /** IP地址 */ - private String ipAddress; - /** 父ip地址 */ - private String parentIpAddress; - /** 端口 */ - private Integer port; - /** 名称 */ - private String name; - /** 密码 */ - private String pwd; - /** VPS类型 1.传统 */ - private Integer vpsType; - /** 经销商 1.V2 */ - private Integer dealer; - /** mac地址 */ - public String mac; - /** 状态 1.可用 2.禁用 */ - public Integer status; - - public Wrapper getWrapper() { - QueryWrapper qw = new QueryWrapper(); - qw - .like(ObjectUtil.isNotEmpty(contntryShort), "contntry_short", contntryShort) - .like(ObjectUtil.isNotEmpty(ipAddress), "ip_address", ipAddress) - .like(ObjectUtil.isNotEmpty(parentIpAddress), "parent_ip_address", parentIpAddress) - .like(ObjectUtil.isNotEmpty(port), "port", port) - .like(ObjectUtil.isNotEmpty(name), "name", name) - .like(ObjectUtil.isNotEmpty(pwd), "pwd", pwd) - .like(ObjectUtil.isNotEmpty(vpsType), "vps_type", vpsType) - .like(ObjectUtil.isNotEmpty(dealer), "dealer", dealer) - .like(ObjectUtil.isNotEmpty(mac), "mac", mac) - .like(ObjectUtil.isNotEmpty(status), "status", status) - .orderBy(ObjectUtil.isNotEmpty(getSort()), isAsc(), getSort()) - .orderByDesc("updated_at") - ; - return qw; - } - - -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtVpnUpdateDTO.java b/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtVpnUpdateDTO.java deleted file mode 100644 index cfc9a4e..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/CtVpnUpdateDTO.java +++ /dev/null @@ -1,43 +0,0 @@ -package me.zhengjie.modules.group.dto; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import javax.validation.constraints.NotNull; - -/** - * @Author zhw - * @Date 2022-07-08 - * @Description VPN信息更新 dto - */ - -@Data -@AllArgsConstructor -@NoArgsConstructor -public class CtVpnUpdateDTO { - @NotNull - private Integer id; - /** 所属国家简称 */ - private String contntryShort; - /** IP地址 */ - private String ipAddress; - /** 父ip地址 */ - private String parentIpAddress; - /** 端口 */ - private Integer port; - /** 名称 */ - private String name; - /** 密码 */ - private String pwd; - /** VPS类型 1.传统 */ - private Integer vpsType; - /** 经销商 1.V2 */ - private Integer dealer; - /** mac地址 */ - public String mac; - /** 链接 */ - private String link; - /** 经销商 1.可用 2.禁用 */ - public Integer status; -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/DhCarGoodWellReceivedDTO.java b/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/DhCarGoodWellReceivedDTO.java deleted file mode 100644 index 0a7a804..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/DhCarGoodWellReceivedDTO.java +++ /dev/null @@ -1,30 +0,0 @@ -package me.zhengjie.modules.group.dto; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import javax.validation.constraints.NotNull; - -/** - * - * @Description IdDTO - * @Date 2022-06-22 - * @Author rch - */ -@Data -@ApiModel("敦煌加购好评商品细腻洗") -public class DhCarGoodWellReceivedDTO { - - @NotNull - @ApiModelProperty(value = "id", required = true) - private Long id; - - @NotNull - @ApiModelProperty(value = "评论内容", required = true) - private String comment; - - @NotNull - @ApiModelProperty(value = "图片路径", required = true) - private String paths; -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/DhCarWellReceivedDTO.java b/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/DhCarWellReceivedDTO.java deleted file mode 100644 index be59ac0..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/DhCarWellReceivedDTO.java +++ /dev/null @@ -1,29 +0,0 @@ -package me.zhengjie.modules.group.dto; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import org.springframework.validation.annotation.Validated; - -import javax.validation.Valid; -import javax.validation.constraints.NotNull; -import java.util.List; - -/** - * - * @Description IdDTO - * @Date 2022-06-22 - * @Author rch - */ -@Data -@ApiModel("敦煌加购好评") -public class DhCarWellReceivedDTO { - - @NotNull - @ApiModelProperty(value = "id", required = true) - private Long id; - - @Valid - @ApiModelProperty(value = "评论内容", required = true) - private List dialogWellReceivedGoods; -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/IdDTO.java b/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/IdDTO.java deleted file mode 100644 index 8304628..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/IdDTO.java +++ /dev/null @@ -1,22 +0,0 @@ -package me.zhengjie.modules.group.dto; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import javax.validation.constraints.NotNull; - -/** - * - * @Description IdDTO - * @Date 2022-06-22 - * @Author rch - */ -@Data -@ApiModel("IdDto") -public class IdDTO { - - @NotNull - @ApiModelProperty(value = "id", required = true) - private Long id; -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/SearchOrderListDTO.java b/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/SearchOrderListDTO.java deleted file mode 100644 index fab304d..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/SearchOrderListDTO.java +++ /dev/null @@ -1,69 +0,0 @@ -package me.zhengjie.modules.group.dto; - -import cn.hutool.core.util.ObjectUtil; -import com.baomidou.mybatisplus.core.conditions.Wrapper; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import me.zhengjie.dto.PageDTO; -import me.zhengjie.entity.CtClickOrder; - - -/** - * @Description 分页查询 开放刷单订单接口给到ERP - * @Date 2022-11-10 - * @Author rch - */ -@Data -@ApiModel("分页查询刷单订单") -public class SearchOrderListDTO extends PageDTO { - - /** 店铺 */ - @ApiModelProperty(value = "店铺") - private String shop; - - /** 订单id */ - @ApiModelProperty(value = "订单id") - private String orderId; - - /** 公司id */ - @ApiModelProperty(value = "公司id") - private Long companyId; - - /** 类型 */ - @ApiModelProperty(value = "类型") - private Integer type; - - /** 状态 1.待执行 2.执行中 3.执行成功 4.执行失败 */ - @ApiModelProperty(value = "状态 1.待执行 2.执行中 3.执行成功 4.执行失败", allowableValues = "1,2,3,4") - private Integer status; - - /** 开始时间 */ - @ApiModelProperty(value = "开始时间") - private String sTime; - - /** 结束时间 */ - @ApiModelProperty(value = "结束时间") - private String eTime; - - @ApiModelProperty(value = "是否评论") - private Boolean commentBoolean; - - public Wrapper getWrapper() { - QueryWrapper qw = new QueryWrapper(); - qw - .eq(ObjectUtil.isNotEmpty(companyId), "company.id", companyId) - .eq(ObjectUtil.isNotEmpty(status), "clickOrder.status", status) - .eq(ObjectUtil.isNotEmpty(type), "clickOrder.type", type) - .isNotNull((ObjectUtil.isNotEmpty(commentBoolean) && commentBoolean), "comment") - .like(ObjectUtil.isNotEmpty(shop), "clickOrder.shop", shop) - .like(ObjectUtil.isNotEmpty(orderId), "clickOrder.order_id", orderId) - .between(ObjectUtil.isNotEmpty(sTime) && ObjectUtil.isNotEmpty(eTime), "clickOrder.created_at", sTime, eTime) - .orderByDesc("created_at") - ; - - return qw; - } - -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/SysQuartzJobAddDTO.java b/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/SysQuartzJobAddDTO.java deleted file mode 100644 index 4c86419..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/SysQuartzJobAddDTO.java +++ /dev/null @@ -1,54 +0,0 @@ -package me.zhengjie.modules.group.dto; - - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import javax.validation.constraints.NotNull; - -/** - * @Description 影刀定时任务新增 DTO - * @Date 2022-07-21 - * @Author zhw - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class SysQuartzJobAddDTO { - - private Long taskNum; - /** 任务名称 */ - @NotNull - private String jobName; - /** 备注 */ - @NotNull - private String description; - /** 应用id:根据应用查找bean名称和方法名称 */ - @NotNull - private Long applyId; - /** cron 表达式 */ - @NotNull - private String cronExpression; - /** 子任务ID */ - private String subTask; - /** 负责人 */ - @NotNull - private String personInCharge; - /** 报警邮箱 */ - private String email; - /** 失败后暂停:1暂停、0启用 */ - @NotNull - private Integer pauseAfterFailure; - /** 状态:1暂停、0启用 */ - @NotNull - private Integer isPause; - /** 参数 */ - @NotNull - private String params; - /** 参数类型 */ - @NotNull - private Integer paramsType; - - private String paramId; -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/SysQuartzJobListDTO.java b/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/SysQuartzJobListDTO.java deleted file mode 100644 index fcb02fe..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/SysQuartzJobListDTO.java +++ /dev/null @@ -1,43 +0,0 @@ -package me.zhengjie.modules.group.dto; - -import cn.hutool.core.util.ObjectUtil; -import com.baomidou.mybatisplus.core.conditions.Wrapper; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import lombok.Data; -import me.zhengjie.dto.PageDTO; -import me.zhengjie.entity.SysQuartzJob; -import me.zhengjie.enums.TaskTypeEnum; - -/** - * @Description 分页查询 影刀定时任务 - * @Date 2022-07-21 - * @Author zhw - */ -@Data -public class SysQuartzJobListDTO extends PageDTO { - - /** 任务名称 */ - private String jobName; - - /** 是否暂停 */ - private Integer isPause; - - /** 开始时间 */ - private String sTime; - - /** 结束时间 */ - private String eTime; - - public Wrapper getWrapper() { - QueryWrapper qw = new QueryWrapper<>(); - qw - .eq("type", TaskTypeEnum.SHADOW_KNIFE.value()) - .like(ObjectUtil.isNotEmpty(jobName), "job_name", jobName) - .eq(ObjectUtil.isNotEmpty(isPause), "is_pause", isPause) - .between(ObjectUtil.isNotEmpty(sTime) && ObjectUtil.isNotNull(eTime), "create_time", sTime, eTime) - .orderBy(ObjectUtil.isNotEmpty(getSort()), isAsc(), getSort()) - ; - return qw; - } - -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/SysQuartzJobUpdateDTO.java b/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/SysQuartzJobUpdateDTO.java deleted file mode 100644 index 2c40feb..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/SysQuartzJobUpdateDTO.java +++ /dev/null @@ -1,49 +0,0 @@ -package me.zhengjie.modules.group.dto; - - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import javax.validation.constraints.NotNull; - - -/** - * @Author zhw - * @Date 2022-07-21 - * @Description 影刀信息更新 dto - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class SysQuartzJobUpdateDTO { - - @NotNull - private Long jobId; - /** 任务名称 */ - private String jobName; - /** 备注 */ - private String description; - /** Spring Bean名称 */ - private String beanName; - /** 方法名称 */ - private String methodName; - /** 应用ID 通过ID查找Bean名称、方法名称 */ - private Long applyId; - /** cron 表达式 */ - private String cronExpression; - /** 子任务ID */ - private String subTask; - /** 负责人 */ - private String personInCharge; - /** 报警邮箱 */ - private String email; - /** 失败后暂停:1暂停、0启用 */ - private Integer pauseAfterFailure; - /** 状态:1暂停、0启用 */ - private Integer isPause; - /** 参数 */ - private String params; - /** 参数类型 */ - private Integer paramsType; -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/SysQuartzLogListDTO.java b/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/SysQuartzLogListDTO.java deleted file mode 100644 index 7bb972d..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/SysQuartzLogListDTO.java +++ /dev/null @@ -1,42 +0,0 @@ -package me.zhengjie.modules.group.dto; - -import cn.hutool.core.util.ObjectUtil; -import com.baomidou.mybatisplus.core.conditions.Wrapper; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import lombok.Data; -import me.zhengjie.dto.PageDTO; -import me.zhengjie.entity.SysQuartzLog; -import me.zhengjie.enums.TaskTypeEnum; - - -/** - * @Description 分页查询 影刀定时任务日志 - * @Date 2022-07-9 - * @Author rch - */ -@Data -public class SysQuartzLogListDTO extends PageDTO { - - /** 卡号 */ - private String jobName; - - private Integer isSuccess; - - private String sTime; - - private String eTime; - - public Wrapper getWrapper() { - QueryWrapper qw = new QueryWrapper(); - qw - .eq("type", TaskTypeEnum.SHADOW_KNIFE.value()) - .eq(ObjectUtil.isNotEmpty(isSuccess), "is_success", isSuccess) - .like(ObjectUtil.isNotEmpty(jobName), "job_name", jobName) - .between(ObjectUtil.isNotEmpty(sTime) && ObjectUtil.isNotEmpty(eTime), "create_time", sTime, eTime) - .orderBy(ObjectUtil.isNotEmpty(getSort()), isAsc(), getSort()) - ; - - return qw; - } - -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/dhaddcar/DhAddCarAddDTO.java b/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/dhaddcar/DhAddCarAddDTO.java deleted file mode 100644 index 098ca04..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/dhaddcar/DhAddCarAddDTO.java +++ /dev/null @@ -1,46 +0,0 @@ -package me.zhengjie.modules.group.dto.dhaddcar; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; -import me.zhengjie.modules.group.dto.dhcargood.DhCarGoodKeyAddDTO; -import me.zhengjie.modules.group.dto.dhcargood.DhCarGoodKeyEditDTO; -import me.zhengjie.modules.group.dto.dhcargood.DhCarGoodLinkAddDTO; -import me.zhengjie.modules.group.dto.dhcargood.DhCarGoodLinkEditDTO; - -import javax.validation.constraints.NotNull; -import java.util.List; - -/** - * 新增敦煌加购 DTO - * - * @author rch - * @create 2022-07-09 - */ - -@Data -@AllArgsConstructor -@NoArgsConstructor -@ApiModel("新增敦煌加购") -public class DhAddCarAddDTO { - - /** 商品属性类型:1.关键词 2.链接 */ - @NotNull - @ApiModelProperty(value = "商品属性类型:1.关键词 2.链接", required = true, allowableValues = "1,2") - private Integer paramsType; - - /** 买家ID */ - @NotNull - @ApiModelProperty(value = "买家ID", required = true) - private Integer buyerId; - - /** 加购物车商品ids */ - @ApiModelProperty(value = "加购物车商品ids") - private List carGoodKeys; - - /** 加购物车商品ids */ - @ApiModelProperty(value = "加购物车商品ids") - private List carGoodLinks; -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/dhaddcar/DhAddCarEditDTO.java b/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/dhaddcar/DhAddCarEditDTO.java deleted file mode 100644 index b26d485..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/dhaddcar/DhAddCarEditDTO.java +++ /dev/null @@ -1,48 +0,0 @@ -package me.zhengjie.modules.group.dto.dhaddcar; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; -import me.zhengjie.modules.group.dto.dhcargood.DhCarGoodKeyEditDTO; -import me.zhengjie.modules.group.dto.dhcargood.DhCarGoodLinkEditDTO; - -import javax.validation.constraints.NotNull; -import java.util.List; - -/** - * 修改敦煌加购信息 DTO - * - * @author rch - * @create 2022-07-09 - */ - -@Data -@AllArgsConstructor -@NoArgsConstructor -@ApiModel("修改敦煌加购信息") -public class DhAddCarEditDTO { - - /** ID */ - @ApiModelProperty(value = "ID", required = true) - private Long id; - - /** 商品属性类型:1.关键词 2.链接 */ - @NotNull - @ApiModelProperty(value = "商品属性类型:1.关键词 2.链接", required = true, allowableValues = "1,2") - private Integer paramsType; - - /** 买家ID */ - @NotNull - @ApiModelProperty(value = "买家ID", required = true) - private Integer buyerId; - - /** 加购物车商品ids */ - @ApiModelProperty(value = "加购物车商品ids") - private List carGoodKeys; - - /** 加购物车商品ids */ - @ApiModelProperty(value = "加购物车商品ids") - private List carGoodLinks; -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/dhaddcar/DhAddCarListDTO.java b/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/dhaddcar/DhAddCarListDTO.java deleted file mode 100644 index e6a63c1..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/dhaddcar/DhAddCarListDTO.java +++ /dev/null @@ -1,73 +0,0 @@ -package me.zhengjie.modules.group.dto.dhaddcar; - -import cn.hutool.core.util.ObjectUtil; -import com.baomidou.mybatisplus.core.conditions.Wrapper; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; -import me.zhengjie.dto.PageDTO; -import me.zhengjie.entity.CtBuyer; -import me.zhengjie.enums.DhAddCarStatusEnum; - -import java.util.Arrays; - -/** - * 分页查询-敦煌加购-信息 DTO - * - * @author rch - * @create 2022-07-09 - */ - -@Data -@AllArgsConstructor -@NoArgsConstructor -@ApiModel("新增刷单信息") -public class DhAddCarListDTO extends PageDTO { - - /** 商品属性类型:1.关键词 2.链接 */ - @ApiModelProperty(value = "商品属性类型:1.关键词 2.链接", allowableValues = "1,2") - private Integer paramsType; - - /** 账号 */ - @ApiModelProperty(value = "账号") - private String account; - - /** 账号 */ - @ApiModelProperty(value = "国家") - private String country; - - /** 账号 */ - @ApiModelProperty(value = "1.获取敦煌加购列表(状态:1.待执行 4.加购失败); 2.获取敦煌抓单列表(状态:6.待抓单 9.抓单失败)") - private Integer inStatusList; - - /** 状态 1.待执行 2.执行中 3.加购成功 4.加购失败 5.下单成功 6.支付成功 7.抓单成功 8.抓单失败 */ - @ApiModelProperty(value = "状态 1.待执行 2.执行中 3.加购成功 4.加购失败 5.下单成功 6.支付成功 7.抓单成功 8.抓单失败", allowableValues = "1,2,3,4,5,6,7,8") - private Integer status; - -// /** 加购物车商品ids */ -// @ApiModelProperty(value = "加购物车商品ids") -// private List carGoodKeys; -// -// /** 加购物车商品ids */ -// @ApiModelProperty(value = "加购物车商品ids") -// private List carGoodLinks; - - public Wrapper getWrapper() { - QueryWrapper qw = new QueryWrapper(); - qw - .eq(ObjectUtil.isNotEmpty(paramsType), "dhAddCar.params_type", paramsType) - .eq(ObjectUtil.isNotEmpty(account), "buyer.account", account) - .in(ObjectUtil.isNotEmpty(inStatusList) && inStatusList == 1, "dhAddCar.status", Arrays.asList(DhAddCarStatusEnum.TOBE_EXECUTION.value(), DhAddCarStatusEnum.ADD_CARD_FAILE.value())) - .in(ObjectUtil.isNotEmpty(inStatusList) && inStatusList == 2, "dhAddCar.status", Arrays.asList(DhAddCarStatusEnum.TO_BE_CATCH_ORDER.value(), DhAddCarStatusEnum.CATCH_ORDER_FAILE.value())) - .eq(ObjectUtil.isNotEmpty(status), "dhAddCar.status", status) - .eq(ObjectUtil.isNotEmpty(country), "company.name", country) - .orderBy(ObjectUtil.isNotEmpty(getSort()), isAsc(), getSort()) - .orderByDesc("updated_at") - ; - - return qw; - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/dhcargood/DhCarGoodKeyAddDTO.java b/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/dhcargood/DhCarGoodKeyAddDTO.java deleted file mode 100644 index a4d8fb9..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/dhcargood/DhCarGoodKeyAddDTO.java +++ /dev/null @@ -1,70 +0,0 @@ -package me.zhengjie.modules.group.dto.dhcargood; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.Null; - -/** - * 敦煌-加购商品(根据关键词) DTO - * - * @author rch - * @create 2022-07-09 - */ - -@Data -@AllArgsConstructor -@NoArgsConstructor -@ApiModel("敦煌-加购商品(根据关键词)") -public class DhCarGoodKeyAddDTO { - - /** 商品属性类型:1.关键词 2.链接 */ - @Null - @ApiModelProperty(value = "商品属性类型:1.关键词 2.链接", required = true, allowableValues = "1,2") - private Integer paramsType; - - /** 店铺名称 */ - @NotBlank - @ApiModelProperty(value = "NotBlank", required = true) - private String shopName; - - /** 关键词 */ - @NotBlank - @ApiModelProperty(value = "关键词", required = true) - private String keyWord; - - /** 标题 */ - @NotBlank - @ApiModelProperty(value = "标题", required = true) - private String title; - - /** 数量 */ - @NotBlank - @ApiModelProperty(value = "数量", required = true) - private Integer number; - - /** 规格 */ - @ApiModelProperty(value = "规格") - private String specification; - - /** 颜色 */ - @ApiModelProperty(value = "颜色") - private String color; - - /** item */ - @NotBlank - @ApiModelProperty(value = "item", required = true) - private String item; - - /** 最小价格区间 */ - @ApiModelProperty(value = "最小价格区间") - private String sectionMin; - - /** 最大价格区间 */ - @ApiModelProperty(value = "最大价格区间") - private String sectionMax; -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/dhcargood/DhCarGoodKeyEditDTO.java b/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/dhcargood/DhCarGoodKeyEditDTO.java deleted file mode 100644 index 3bdadc0..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/dhcargood/DhCarGoodKeyEditDTO.java +++ /dev/null @@ -1,74 +0,0 @@ -package me.zhengjie.modules.group.dto.dhcargood; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.Null; - -/** - * 敦煌-加购商品(根据关键词) DTO - * - * @author rch - * @create 2022-07-09 - */ - -@Data -@AllArgsConstructor -@NoArgsConstructor -@ApiModel("敦煌-加购商品(根据关键词)") -public class DhCarGoodKeyEditDTO { - - /** ID */ - @ApiModelProperty(value = "ID", required = true) - private Long id; - - /** 商品属性类型:1.关键词 2.链接 */ - @Null - @ApiModelProperty(value = "商品属性类型:1.关键词 2.链接", required = true, allowableValues = "1,2") - private Integer paramsType; - - /** 店铺名称 */ - @NotBlank - @ApiModelProperty(value = "NotBlank", required = true) - private String shopName; - - /** 关键词 */ - @NotBlank - @ApiModelProperty(value = "关键词", required = true) - private String keyWord; - - /** 标题 */ - @NotBlank - @ApiModelProperty(value = "标题", required = true) - private String title; - - /** 数量 */ - @NotBlank - @ApiModelProperty(value = "数量", required = true) - private Integer number; - - /** 规格 */ - @ApiModelProperty(value = "规格") - private String specification; - - /** 颜色 */ - @ApiModelProperty(value = "颜色") - private String color; - - /** item */ - @NotBlank - @ApiModelProperty(value = "item", required = true) - private String item; - - /** 最小价格区间 */ - @ApiModelProperty(value = "最小价格区间") - private String sectionMin; - - /** 最大价格区间 */ - @ApiModelProperty(value = "最大价格区间") - private String sectionMax; -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/dhcargood/DhCarGoodLinkAddDTO.java b/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/dhcargood/DhCarGoodLinkAddDTO.java deleted file mode 100644 index 5911106..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/dhcargood/DhCarGoodLinkAddDTO.java +++ /dev/null @@ -1,49 +0,0 @@ -package me.zhengjie.modules.group.dto.dhcargood; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.Null; - -/** - * 敦煌-加购商品(根据链接) DTO - * - * @author rch - * @create 2022-07-09 - */ - -@Data -@AllArgsConstructor -@NoArgsConstructor -@ApiModel("敦煌-加购商品(根据链接)") -public class DhCarGoodLinkAddDTO { - - /** 商品属性类型:1.关键词 2.链接 */ - @Null - @ApiModelProperty(value = "商品属性类型:1.关键词 2.链接", required = true, allowableValues = "1,2") - private Integer paramsType; - - /** 链接 */ - @NotBlank - @ApiModelProperty(value = "链接", required = true) - private String link; - - /** 数量 */ - @NotBlank - @ApiModelProperty(value = "数量", required = true) - private Integer number; - - /** 规格 */ - @NotBlank - @ApiModelProperty(value = "规格", required = true) - private String specification; - - /** 颜色 */ - @NotBlank - @ApiModelProperty(value = "颜色", required = true) - private String color; -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/dhcargood/DhCarGoodLinkEditDTO.java b/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/dhcargood/DhCarGoodLinkEditDTO.java deleted file mode 100644 index e9c4a4a..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/dhcargood/DhCarGoodLinkEditDTO.java +++ /dev/null @@ -1,53 +0,0 @@ -package me.zhengjie.modules.group.dto.dhcargood; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.Null; - -/** - * 敦煌-加购商品(根据链接) DTO - * - * @author rch - * @create 2022-07-09 - */ - -@Data -@AllArgsConstructor -@NoArgsConstructor -@ApiModel("敦煌-加购商品(根据链接)") -public class DhCarGoodLinkEditDTO { - - /** ID */ - @ApiModelProperty(value = "ID", required = true) - private Long id; - - /** 商品属性类型:1.关键词 2.链接 */ - @Null - @ApiModelProperty(value = "商品属性类型:1.关键词 2.链接", required = true, allowableValues = "1,2") - private Integer paramsType; - - /** 链接 */ - @NotBlank - @ApiModelProperty(value = "链接", required = true) - private String link; - - /** 数量 */ - @NotBlank - @ApiModelProperty(value = "数量", required = true) - private Integer number; - - /** 规格 */ - @NotBlank - @ApiModelProperty(value = "规格", required = true) - private String specification; - - /** 颜色 */ - @NotBlank - @ApiModelProperty(value = "颜色", required = true) - private String color; -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/dhcarorder/DhAddCarOrderListDTO.java b/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/dhcarorder/DhAddCarOrderListDTO.java deleted file mode 100644 index e3ad0f3..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/group/dto/dhcarorder/DhAddCarOrderListDTO.java +++ /dev/null @@ -1,66 +0,0 @@ -package me.zhengjie.modules.group.dto.dhcarorder; - -import cn.hutool.core.util.ObjectUtil; -import com.baomidou.mybatisplus.core.conditions.Wrapper; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; -import me.zhengjie.dto.PageDTO; -import me.zhengjie.entity.CtBuyer; -import me.zhengjie.enums.ClickOrderStatusEnum; -import me.zhengjie.enums.DhAddCarStatusEnum; - -import java.util.Arrays; - -/** - * 分页查询-敦煌加购-订单-信息 DTO - * - * @author rch - * @create 2022-07-09 - */ - -@Data -@AllArgsConstructor -@NoArgsConstructor -@ApiModel("敦煌加购订单信息") -public class DhAddCarOrderListDTO extends PageDTO { - - /** 类型: 1.导入 2.刷单 */ - @ApiModelProperty(value = "类型: 1.导入 2.刷单", allowableValues = "1,2") - private Integer type; - - /** 关联敦煌加购的id */ - @ApiModelProperty(value = "关联敦煌加购的id") - private Long addCarId; - - /** 订单id */ - @ApiModelProperty(value = "订单id") - private String orderId; - - /** 好评 */ - @ApiModelProperty(value = "1.获取敦煌好评列表(状态:1.待执行 4.加购失败)") - private Integer inStatusList; - - - /** 状态 1.待执行 2.执行中 3.执行成功 4.执行失败 */ - @ApiModelProperty(value = "状态 1.待执行 2.执行中 3.执行成功 4.执行失败", allowableValues = "1,2,3,4") - private Integer status; - - public Wrapper getWrapper() { - QueryWrapper qw = new QueryWrapper(); - qw - .eq(ObjectUtil.isNotEmpty(type), "type", type) - .eq(ObjectUtil.isNotEmpty(addCarId), "add_car_id", addCarId) - .eq(ObjectUtil.isNotEmpty(orderId), "order_id", orderId) - .eq(ObjectUtil.isNotEmpty(status), "status", status) - .in(ObjectUtil.isNotEmpty(inStatusList) && inStatusList == 1, "status", Arrays.asList(ClickOrderStatusEnum.TOBE_EXECUTION.value(), ClickOrderStatusEnum.EXECUTION_FAILE.value())) - .orderBy(ObjectUtil.isNotEmpty(getSort()), isAsc(), getSort()) - .orderByDesc("updated_at") - ; - - return qw; - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/mnt/domain/App.java b/wjcy-system/src/main/java/me/zhengjie/modules/mnt/domain/App.java deleted file mode 100644 index cf5789c..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/mnt/domain/App.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.mnt.domain; - -import io.swagger.annotations.ApiModelProperty; -import cn.hutool.core.bean.BeanUtil; -import cn.hutool.core.bean.copier.CopyOptions; -import lombok.Getter; -import lombok.Setter; -import me.zhengjie.base.BaseEntity; -import javax.persistence.*; -import java.io.Serializable; - -/** -* @author zhanghouying -* @date 2019-08-24 -*/ -@Entity -@Getter -@Setter -@Table(name="mnt_app") -public class App extends BaseEntity implements Serializable { - - @Id - @Column(name = "app_id") - @ApiModelProperty(value = "ID", hidden = true) - @GeneratedValue(strategy = GenerationType.IDENTITY) - private Long id; - - @ApiModelProperty(value = "名称") - private String name; - - @ApiModelProperty(value = "端口") - private int port; - - @ApiModelProperty(value = "上传路径") - private String uploadPath; - - @ApiModelProperty(value = "部署路径") - private String deployPath; - - @ApiModelProperty(value = "备份路径") - private String backupPath; - - @ApiModelProperty(value = "启动脚本") - private String startScript; - - @ApiModelProperty(value = "部署脚本") - private String deployScript; - - public void copy(App source){ - BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true)); - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/mnt/domain/Database.java b/wjcy-system/src/main/java/me/zhengjie/modules/mnt/domain/Database.java deleted file mode 100644 index 6b3a68a..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/mnt/domain/Database.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.mnt.domain; - -import io.swagger.annotations.ApiModelProperty; -import cn.hutool.core.bean.BeanUtil; -import cn.hutool.core.bean.copier.CopyOptions; -import lombok.Getter; -import lombok.Setter; -import me.zhengjie.base.BaseEntity; -import javax.persistence.*; -import java.io.Serializable; - -/** -* @author zhanghouying -* @date 2019-08-24 -*/ -@Entity -@Getter -@Setter -@Table(name="mnt_database") -public class Database extends BaseEntity implements Serializable { - - @Id - @Column(name = "db_id") - @ApiModelProperty(value = "ID", hidden = true) - private String id; - - @ApiModelProperty(value = "数据库名称") - private String name; - - @ApiModelProperty(value = "数据库连接地址") - private String jdbcUrl; - - @ApiModelProperty(value = "数据库密码") - private String pwd; - - @ApiModelProperty(value = "用户名") - private String userName; - - public void copy(Database source){ - BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true)); - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/mnt/domain/Deploy.java b/wjcy-system/src/main/java/me/zhengjie/modules/mnt/domain/Deploy.java deleted file mode 100644 index bcf61e5..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/mnt/domain/Deploy.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.mnt.domain; - -import io.swagger.annotations.ApiModelProperty; -import cn.hutool.core.bean.BeanUtil; -import cn.hutool.core.bean.copier.CopyOptions; -import lombok.Getter; -import lombok.Setter; -import me.zhengjie.base.BaseEntity; -import javax.persistence.*; -import java.io.Serializable; -import java.util.Set; - -/** -* @author zhanghouying -* @date 2019-08-24 -*/ -@Entity -@Getter -@Setter -@Table(name="mnt_deploy") -public class Deploy extends BaseEntity implements Serializable { - - @Id - @Column(name = "deploy_id") - @ApiModelProperty(value = "ID", hidden = true) - @GeneratedValue(strategy = GenerationType.IDENTITY) - private Long id; - - @ManyToMany - @ApiModelProperty(name = "服务器", hidden = true) - @JoinTable(name = "mnt_deploy_server", - joinColumns = {@JoinColumn(name = "deploy_id",referencedColumnName = "deploy_id")}, - inverseJoinColumns = {@JoinColumn(name = "server_id",referencedColumnName = "server_id")}) - private Set deploys; - - @ManyToOne - @JoinColumn(name = "app_id") - @ApiModelProperty(value = "应用编号") - private App app; - - public void copy(Deploy source){ - BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true)); - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/mnt/domain/DeployHistory.java b/wjcy-system/src/main/java/me/zhengjie/modules/mnt/domain/DeployHistory.java deleted file mode 100644 index 6e07e13..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/mnt/domain/DeployHistory.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.mnt.domain; - -import io.swagger.annotations.ApiModelProperty; -import cn.hutool.core.bean.BeanUtil; -import cn.hutool.core.bean.copier.CopyOptions; -import lombok.Getter; -import lombok.Setter; -import org.hibernate.annotations.CreationTimestamp; -import javax.persistence.*; -import java.io.Serializable; -import java.sql.Timestamp; - -/** -* @author zhanghouying -* @date 2019-08-24 -*/ -@Entity -@Getter -@Setter -@Table(name="mnt_deploy_history") -public class DeployHistory implements Serializable { - - @Id - @Column(name = "history_id") - @ApiModelProperty(value = "ID", hidden = true) - private String id; - - @ApiModelProperty(value = "应用名称") - private String appName; - - @ApiModelProperty(value = "IP") - private String ip; - - @CreationTimestamp - @ApiModelProperty(value = "部署时间") - private Timestamp deployDate; - - @ApiModelProperty(value = "部署者") - private String deployUser; - - @ApiModelProperty(value = "部署ID") - private Long deployId; - - public void copy(DeployHistory source){ - BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true)); - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/mnt/domain/ServerDeploy.java b/wjcy-system/src/main/java/me/zhengjie/modules/mnt/domain/ServerDeploy.java deleted file mode 100644 index f523562..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/mnt/domain/ServerDeploy.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.mnt.domain; - -import io.swagger.annotations.ApiModelProperty; -import cn.hutool.core.bean.BeanUtil; -import cn.hutool.core.bean.copier.CopyOptions; -import lombok.Getter; -import lombok.Setter; -import me.zhengjie.base.BaseEntity; -import javax.persistence.*; -import java.io.Serializable; -import java.util.Objects; - -/** -* @author zhanghouying -* @date 2019-08-24 -*/ -@Entity -@Getter -@Setter -@Table(name="mnt_server") -public class ServerDeploy extends BaseEntity implements Serializable { - - @Id - @Column(name = "server_id") - @ApiModelProperty(value = "ID", hidden = true) - @GeneratedValue(strategy = GenerationType.IDENTITY) - private Long id; - - @ApiModelProperty(value = "服务器名称") - private String name; - - @ApiModelProperty(value = "IP") - private String ip; - - @ApiModelProperty(value = "端口") - private Integer port; - - @ApiModelProperty(value = "账号") - private String account; - - @ApiModelProperty(value = "密码") - private String password; - - public void copy(ServerDeploy source){ - BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true)); - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ServerDeploy that = (ServerDeploy) o; - return Objects.equals(id, that.id) && - Objects.equals(name, that.name); - } - - @Override - public int hashCode() { - return Objects.hash(id, name); - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/mnt/repository/AppRepository.java b/wjcy-system/src/main/java/me/zhengjie/modules/mnt/repository/AppRepository.java deleted file mode 100644 index 41e5f5c..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/mnt/repository/AppRepository.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.mnt.repository; - -import me.zhengjie.modules.mnt.domain.App; -import org.springframework.data.jpa.repository.JpaRepository; -import org.springframework.data.jpa.repository.JpaSpecificationExecutor; - -/** -* @author zhanghouying -* @date 2019-08-24 -*/ -public interface AppRepository extends JpaRepository, JpaSpecificationExecutor { -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/mnt/repository/DatabaseRepository.java b/wjcy-system/src/main/java/me/zhengjie/modules/mnt/repository/DatabaseRepository.java deleted file mode 100644 index 695e0ad..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/mnt/repository/DatabaseRepository.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.mnt.repository; - -import me.zhengjie.modules.mnt.domain.Database; -import org.springframework.data.jpa.repository.JpaRepository; -import org.springframework.data.jpa.repository.JpaSpecificationExecutor; - -/** -* @author zhanghouying -* @date 2019-08-24 -*/ -public interface DatabaseRepository extends JpaRepository, JpaSpecificationExecutor { -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/mnt/repository/DeployHistoryRepository.java b/wjcy-system/src/main/java/me/zhengjie/modules/mnt/repository/DeployHistoryRepository.java deleted file mode 100644 index 3c8980e..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/mnt/repository/DeployHistoryRepository.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.mnt.repository; - -import me.zhengjie.modules.mnt.domain.DeployHistory; -import org.springframework.data.jpa.repository.JpaRepository; -import org.springframework.data.jpa.repository.JpaSpecificationExecutor; - -/** -* @author zhanghouying -* @date 2019-08-24 -*/ -public interface DeployHistoryRepository extends JpaRepository, JpaSpecificationExecutor { -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/mnt/repository/DeployRepository.java b/wjcy-system/src/main/java/me/zhengjie/modules/mnt/repository/DeployRepository.java deleted file mode 100644 index 2ea4498..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/mnt/repository/DeployRepository.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.mnt.repository; - -import me.zhengjie.modules.mnt.domain.Deploy; -import org.springframework.data.jpa.repository.JpaRepository; -import org.springframework.data.jpa.repository.JpaSpecificationExecutor; - -/** -* @author zhanghouying -* @date 2019-08-24 -*/ -public interface DeployRepository extends JpaRepository, JpaSpecificationExecutor { -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/mnt/repository/ServerDeployRepository.java b/wjcy-system/src/main/java/me/zhengjie/modules/mnt/repository/ServerDeployRepository.java deleted file mode 100644 index 4ca336c..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/mnt/repository/ServerDeployRepository.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.mnt.repository; - -import me.zhengjie.modules.mnt.domain.ServerDeploy; -import org.springframework.data.jpa.repository.JpaRepository; -import org.springframework.data.jpa.repository.JpaSpecificationExecutor; - -/** -* @author zhanghouying -* @date 2019-08-24 -*/ -public interface ServerDeployRepository extends JpaRepository, JpaSpecificationExecutor { - - /** - * 根据IP查询 - * @param ip / - * @return / - */ - ServerDeploy findByIp(String ip); -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/mnt/rest/AppController.java b/wjcy-system/src/main/java/me/zhengjie/modules/mnt/rest/AppController.java deleted file mode 100644 index 9b5b08f..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/mnt/rest/AppController.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.mnt.rest; - -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import lombok.RequiredArgsConstructor; -import me.zhengjie.annotation.Log; -import me.zhengjie.modules.mnt.domain.App; -import me.zhengjie.modules.mnt.service.AppService; -import me.zhengjie.modules.mnt.service.dto.AppQueryCriteria; -import org.springframework.data.domain.Pageable; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.Set; - -/** -* @author zhanghouying -* @date 2019-08-24 -*/ -@RestController -@RequiredArgsConstructor -@Api(tags = "运维:应用管理") -@RequestMapping("/api/app") -public class AppController { - - private final AppService appService; - - @ApiOperation("导出应用数据") - @GetMapping(value = "/download") - @PreAuthorize("@el.check('app:list')") - public void download(HttpServletResponse response, AppQueryCriteria criteria) throws IOException { - appService.download(appService.queryAll(criteria), response); - } - - @ApiOperation(value = "查询应用") - @GetMapping - @PreAuthorize("@el.check('app:list')") - public ResponseEntity query(AppQueryCriteria criteria, Pageable pageable){ - return new ResponseEntity<>(appService.queryAll(criteria,pageable),HttpStatus.OK); - } - - @Log("新增应用") - @ApiOperation(value = "新增应用") - @PostMapping - @PreAuthorize("@el.check('app:add')") - public ResponseEntity create(@Validated @RequestBody App resources){ - appService.create(resources); - return new ResponseEntity<>(HttpStatus.CREATED); - } - - @Log("修改应用") - @ApiOperation(value = "修改应用") - @PutMapping - @PreAuthorize("@el.check('app:edit')") - public ResponseEntity update(@Validated @RequestBody App resources){ - appService.update(resources); - return new ResponseEntity<>(HttpStatus.NO_CONTENT); - } - - @Log("删除应用") - @ApiOperation(value = "删除应用") - @DeleteMapping - @PreAuthorize("@el.check('app:del')") - public ResponseEntity delete(@RequestBody Set ids){ - appService.delete(ids); - return new ResponseEntity<>(HttpStatus.OK); - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/mnt/rest/DatabaseController.java b/wjcy-system/src/main/java/me/zhengjie/modules/mnt/rest/DatabaseController.java deleted file mode 100644 index 9dfb43c..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/mnt/rest/DatabaseController.java +++ /dev/null @@ -1,123 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.mnt.rest; - -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import lombok.RequiredArgsConstructor; -import me.zhengjie.annotation.Log; -import me.zhengjie.exception.BadRequestException; -import me.zhengjie.modules.mnt.domain.Database; -import me.zhengjie.modules.mnt.service.DatabaseService; -import me.zhengjie.modules.mnt.service.dto.DatabaseDto; -import me.zhengjie.modules.mnt.service.dto.DatabaseQueryCriteria; -import me.zhengjie.modules.mnt.util.SqlUtils; -import me.zhengjie.utils.FileUtil; -import org.springframework.data.domain.Pageable; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.File; -import java.io.IOException; -import java.util.Set; - -/** -* @author zhanghouying -* @date 2019-08-24 -*/ -@Api(tags = "运维:数据库管理") -@RestController -@RequiredArgsConstructor -@RequestMapping("/api/database") -public class DatabaseController { - - private final String fileSavePath = FileUtil.getTmpDirPath()+"/"; - private final DatabaseService databaseService; - - @ApiOperation("导出数据库数据") - @GetMapping(value = "/download") - @PreAuthorize("@el.check('database:list')") - public void download(HttpServletResponse response, DatabaseQueryCriteria criteria) throws IOException { - databaseService.download(databaseService.queryAll(criteria), response); - } - - @ApiOperation(value = "查询数据库") - @GetMapping - @PreAuthorize("@el.check('database:list')") - public ResponseEntity query(DatabaseQueryCriteria criteria, Pageable pageable){ - return new ResponseEntity<>(databaseService.queryAll(criteria,pageable),HttpStatus.OK); - } - - @Log("新增数据库") - @ApiOperation(value = "新增数据库") - @PostMapping - @PreAuthorize("@el.check('database:add')") - public ResponseEntity create(@Validated @RequestBody Database resources){ - databaseService.create(resources); - return new ResponseEntity<>(HttpStatus.CREATED); - } - - @Log("修改数据库") - @ApiOperation(value = "修改数据库") - @PutMapping - @PreAuthorize("@el.check('database:edit')") - public ResponseEntity update(@Validated @RequestBody Database resources){ - databaseService.update(resources); - return new ResponseEntity<>(HttpStatus.NO_CONTENT); - } - - @Log("删除数据库") - @ApiOperation(value = "删除数据库") - @DeleteMapping - @PreAuthorize("@el.check('database:del')") - public ResponseEntity delete(@RequestBody Set ids){ - databaseService.delete(ids); - return new ResponseEntity<>(HttpStatus.OK); - } - - @Log("测试数据库链接") - @ApiOperation(value = "测试数据库链接") - @PostMapping("/testConnect") - @PreAuthorize("@el.check('database:testConnect')") - public ResponseEntity testConnect(@Validated @RequestBody Database resources){ - return new ResponseEntity<>(databaseService.testConnection(resources),HttpStatus.CREATED); - } - - @Log("执行SQL脚本") - @ApiOperation(value = "执行SQL脚本") - @PostMapping(value = "/upload") - @PreAuthorize("@el.check('database:add')") - public ResponseEntity upload(@RequestBody MultipartFile file, HttpServletRequest request)throws Exception{ - String id = request.getParameter("id"); - DatabaseDto database = databaseService.findById(id); - String fileName; - if(database != null){ - fileName = file.getOriginalFilename(); - File executeFile = new File(fileSavePath+fileName); - FileUtil.del(executeFile); - file.transferTo(executeFile); - String result = SqlUtils.executeFile(database.getJdbcUrl(), database.getUserName(), database.getPwd(), executeFile); - return new ResponseEntity<>(result,HttpStatus.OK); - }else{ - throw new BadRequestException("Database not exist"); - } - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/mnt/rest/DeployController.java b/wjcy-system/src/main/java/me/zhengjie/modules/mnt/rest/DeployController.java deleted file mode 100644 index 72b7b3e..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/mnt/rest/DeployController.java +++ /dev/null @@ -1,153 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.mnt.rest; - -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import lombok.RequiredArgsConstructor; -import me.zhengjie.annotation.Log; -import me.zhengjie.modules.mnt.domain.Deploy; -import me.zhengjie.modules.mnt.domain.DeployHistory; -import me.zhengjie.modules.mnt.service.DeployService; -import me.zhengjie.modules.mnt.service.dto.DeployQueryCriteria; -import me.zhengjie.utils.FileUtil; -import org.springframework.data.domain.Pageable; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.File; -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** -* @author zhanghouying -* @date 2019-08-24 -*/ -@RestController -@Api(tags = "运维:部署管理") -@RequiredArgsConstructor -@RequestMapping("/api/deploy") -public class DeployController { - - private final String fileSavePath = FileUtil.getTmpDirPath()+"/"; - private final DeployService deployService; - - - @ApiOperation("导出部署数据") - @GetMapping(value = "/download") - @PreAuthorize("@el.check('database:list')") - public void download(HttpServletResponse response, DeployQueryCriteria criteria) throws IOException { - deployService.download(deployService.queryAll(criteria), response); - } - - @ApiOperation(value = "查询部署") - @GetMapping - @PreAuthorize("@el.check('deploy:list')") - public ResponseEntity query(DeployQueryCriteria criteria, Pageable pageable){ - return new ResponseEntity<>(deployService.queryAll(criteria,pageable),HttpStatus.OK); - } - - @Log("新增部署") - @ApiOperation(value = "新增部署") - @PostMapping - @PreAuthorize("@el.check('deploy:add')") - public ResponseEntity create(@Validated @RequestBody Deploy resources){ - deployService.create(resources); - return new ResponseEntity<>(HttpStatus.CREATED); - } - - @Log("修改部署") - @ApiOperation(value = "修改部署") - @PutMapping - @PreAuthorize("@el.check('deploy:edit')") - public ResponseEntity update(@Validated @RequestBody Deploy resources){ - deployService.update(resources); - return new ResponseEntity<>(HttpStatus.NO_CONTENT); - } - - @Log("删除部署") - @ApiOperation(value = "删除部署") - @DeleteMapping - @PreAuthorize("@el.check('deploy:del')") - public ResponseEntity delete(@RequestBody Set ids){ - deployService.delete(ids); - return new ResponseEntity<>(HttpStatus.OK); - } - - @Log("上传文件部署") - @ApiOperation(value = "上传文件部署") - @PostMapping(value = "/upload") - @PreAuthorize("@el.check('deploy:edit')") - public ResponseEntity upload(@RequestBody MultipartFile file, HttpServletRequest request)throws Exception{ - Long id = Long.valueOf(request.getParameter("id")); - String fileName = ""; - if(file != null){ - fileName = file.getOriginalFilename(); - File deployFile = new File(fileSavePath+fileName); - FileUtil.del(deployFile); - file.transferTo(deployFile); - //文件下一步要根据文件名字来 - deployService.deploy(fileSavePath+fileName ,id); - }else{ - System.out.println("没有找到相对应的文件"); - } - System.out.println("文件上传的原名称为:"+ Objects.requireNonNull(file).getOriginalFilename()); - Map map = new HashMap<>(2); - map.put("errno",0); - map.put("id",fileName); - return new ResponseEntity<>(map,HttpStatus.OK); - } - @Log("系统还原") - @ApiOperation(value = "系统还原") - @PostMapping(value = "/serverReduction") - @PreAuthorize("@el.check('deploy:edit')") - public ResponseEntity serverReduction(@Validated @RequestBody DeployHistory resources){ - String result = deployService.serverReduction(resources); - return new ResponseEntity<>(result,HttpStatus.OK); - } - @Log("服务运行状态") - @ApiOperation(value = "服务运行状态") - @PostMapping(value = "/serverStatus") - @PreAuthorize("@el.check('deploy:edit')") - public ResponseEntity serverStatus(@Validated @RequestBody Deploy resources){ - String result = deployService.serverStatus(resources); - return new ResponseEntity<>(result,HttpStatus.OK); - } - @Log("启动服务") - @ApiOperation(value = "启动服务") - @PostMapping(value = "/startServer") - @PreAuthorize("@el.check('deploy:edit')") - public ResponseEntity startServer(@Validated @RequestBody Deploy resources){ - String result = deployService.startServer(resources); - return new ResponseEntity<>(result,HttpStatus.OK); - } - @Log("停止服务") - @ApiOperation(value = "停止服务") - @PostMapping(value = "/stopServer") - @PreAuthorize("@el.check('deploy:edit')") - public ResponseEntity stopServer(@Validated @RequestBody Deploy resources){ - String result = deployService.stopServer(resources); - return new ResponseEntity<>(result,HttpStatus.OK); - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/mnt/rest/DeployHistoryController.java b/wjcy-system/src/main/java/me/zhengjie/modules/mnt/rest/DeployHistoryController.java deleted file mode 100644 index 49fb694..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/mnt/rest/DeployHistoryController.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.mnt.rest; - -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import lombok.RequiredArgsConstructor; -import me.zhengjie.annotation.Log; -import me.zhengjie.modules.mnt.service.DeployHistoryService; -import me.zhengjie.modules.mnt.service.dto.DeployHistoryQueryCriteria; -import org.springframework.data.domain.Pageable; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.*; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.Set; - -/** -* @author zhanghouying -* @date 2019-08-24 -*/ -@RestController -@RequiredArgsConstructor -@Api(tags = "运维:部署历史管理") -@RequestMapping("/api/deployHistory") -public class DeployHistoryController { - - private final DeployHistoryService deployhistoryService; - - @ApiOperation("导出部署历史数据") - @GetMapping(value = "/download") - @PreAuthorize("@el.check('deployHistory:list')") - public void download(HttpServletResponse response, DeployHistoryQueryCriteria criteria) throws IOException { - deployhistoryService.download(deployhistoryService.queryAll(criteria), response); - } - - @ApiOperation(value = "查询部署历史") - @GetMapping - @PreAuthorize("@el.check('deployHistory:list')") - public ResponseEntity query(DeployHistoryQueryCriteria criteria, Pageable pageable){ - return new ResponseEntity<>(deployhistoryService.queryAll(criteria,pageable),HttpStatus.OK); - } - - @Log("删除DeployHistory") - @ApiOperation(value = "删除部署历史") - @DeleteMapping - @PreAuthorize("@el.check('deployHistory:del')") - public ResponseEntity delete(@RequestBody Set ids){ - deployhistoryService.delete(ids); - return new ResponseEntity<>(HttpStatus.OK); - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/mnt/rest/ServerDeployController.java b/wjcy-system/src/main/java/me/zhengjie/modules/mnt/rest/ServerDeployController.java deleted file mode 100644 index d4a135b..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/mnt/rest/ServerDeployController.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.mnt.rest; - -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import lombok.RequiredArgsConstructor; -import me.zhengjie.annotation.Log; -import me.zhengjie.modules.mnt.domain.ServerDeploy; -import me.zhengjie.modules.mnt.service.ServerDeployService; -import me.zhengjie.modules.mnt.service.dto.ServerDeployQueryCriteria; -import org.springframework.data.domain.Pageable; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.Set; - -/** -* @author zhanghouying -* @date 2019-08-24 -*/ -@RestController -@Api(tags = "运维:服务器管理") -@RequiredArgsConstructor -@RequestMapping("/api/serverDeploy") -public class ServerDeployController { - - private final ServerDeployService serverDeployService; - - @ApiOperation("导出服务器数据") - @GetMapping(value = "/download") - @PreAuthorize("@el.check('serverDeploy:list')") - public void download(HttpServletResponse response, ServerDeployQueryCriteria criteria) throws IOException { - serverDeployService.download(serverDeployService.queryAll(criteria), response); - } - - @ApiOperation(value = "查询服务器") - @GetMapping - @PreAuthorize("@el.check('serverDeploy:list')") - public ResponseEntity query(ServerDeployQueryCriteria criteria, Pageable pageable){ - return new ResponseEntity<>(serverDeployService.queryAll(criteria,pageable),HttpStatus.OK); - } - - @Log("新增服务器") - @ApiOperation(value = "新增服务器") - @PostMapping - @PreAuthorize("@el.check('serverDeploy:add')") - public ResponseEntity create(@Validated @RequestBody ServerDeploy resources){ - serverDeployService.create(resources); - return new ResponseEntity<>(HttpStatus.CREATED); - } - - @Log("修改服务器") - @ApiOperation(value = "修改服务器") - @PutMapping - @PreAuthorize("@el.check('serverDeploy:edit')") - public ResponseEntity update(@Validated @RequestBody ServerDeploy resources){ - serverDeployService.update(resources); - return new ResponseEntity<>(HttpStatus.NO_CONTENT); - } - - @Log("删除服务器") - @ApiOperation(value = "删除Server") - @DeleteMapping - @PreAuthorize("@el.check('serverDeploy:del')") - public ResponseEntity delete(@RequestBody Set ids){ - serverDeployService.delete(ids); - return new ResponseEntity<>(HttpStatus.OK); - } - - @Log("测试连接服务器") - @ApiOperation(value = "测试连接服务器") - @PostMapping("/testConnect") - @PreAuthorize("@el.check('serverDeploy:add')") - public ResponseEntity testConnect(@Validated @RequestBody ServerDeploy resources){ - return new ResponseEntity<>(serverDeployService.testConnect(resources),HttpStatus.CREATED); - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/mnt/service/AppService.java b/wjcy-system/src/main/java/me/zhengjie/modules/mnt/service/AppService.java deleted file mode 100644 index c822778..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/mnt/service/AppService.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.mnt.service; - -import me.zhengjie.modules.mnt.domain.App; -import me.zhengjie.modules.mnt.service.dto.AppDto; -import me.zhengjie.modules.mnt.service.dto.AppQueryCriteria; -import org.springframework.data.domain.Pageable; - -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.List; -import java.util.Set; - -/** -* @author zhanghouying -* @date 2019-08-24 -*/ -public interface AppService { - - /** - * 分页查询 - * @param criteria 条件 - * @param pageable 分页参数 - * @return / - */ - Object queryAll(AppQueryCriteria criteria, Pageable pageable); - - /** - * 查询全部数据 - * @param criteria 条件 - * @return / - */ - List queryAll(AppQueryCriteria criteria); - - /** - * 根据ID查询 - * @param id / - * @return / - */ - AppDto findById(Long id); - - /** - * 创建 - * @param resources / - */ - void create(App resources); - - /** - * 编辑 - * @param resources / - */ - void update(App resources); - - /** - * 删除 - * @param ids / - */ - void delete(Set ids); - - /** - * 导出数据 - * @param queryAll / - * @param response / - * @throws IOException / - */ - void download(List queryAll, HttpServletResponse response) throws IOException; -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/mnt/service/DatabaseService.java b/wjcy-system/src/main/java/me/zhengjie/modules/mnt/service/DatabaseService.java deleted file mode 100644 index e8a3acb..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/mnt/service/DatabaseService.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.mnt.service; - -import me.zhengjie.modules.mnt.domain.Database; -import me.zhengjie.modules.mnt.service.dto.DatabaseDto; -import me.zhengjie.modules.mnt.service.dto.DatabaseQueryCriteria; -import org.springframework.data.domain.Pageable; - -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.List; -import java.util.Set; - -/** - * @author ZhangHouYing - * @date 2019-08-24 - */ -public interface DatabaseService { - - /** - * 分页查询 - * @param criteria 条件 - * @param pageable 分页参数 - * @return / - */ - Object queryAll(DatabaseQueryCriteria criteria, Pageable pageable); - - /** - * 查询全部 - * @param criteria 条件 - * @return / - */ - List queryAll(DatabaseQueryCriteria criteria); - - /** - * 根据ID查询 - * @param id / - * @return / - */ - DatabaseDto findById(String id); - - /** - * 创建 - * @param resources / - */ - void create(Database resources); - - /** - * 编辑 - * @param resources / - */ - void update(Database resources); - - /** - * 删除 - * @param ids / - */ - void delete(Set ids); - - /** - * 测试连接数据库 - * @param resources / - * @return / - */ - boolean testConnection(Database resources); - - /** - * 导出数据 - * @param queryAll / - * @param response / - * @throws IOException e - */ - void download(List queryAll, HttpServletResponse response) throws IOException; -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/mnt/service/DeployHistoryService.java b/wjcy-system/src/main/java/me/zhengjie/modules/mnt/service/DeployHistoryService.java deleted file mode 100644 index 5eb1b3d..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/mnt/service/DeployHistoryService.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.mnt.service; - -import me.zhengjie.modules.mnt.domain.DeployHistory; -import me.zhengjie.modules.mnt.service.dto.DeployHistoryDto; -import me.zhengjie.modules.mnt.service.dto.DeployHistoryQueryCriteria; -import org.springframework.data.domain.Pageable; - -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.List; -import java.util.Set; - -/** - * @author zhanghouying - */ -public interface DeployHistoryService { - - /** - * 分页查询 - * @param criteria 条件 - * @param pageable 分页参数 - * @return / - */ - Object queryAll(DeployHistoryQueryCriteria criteria, Pageable pageable); - - /** - * 查询全部 - * @param criteria 条件 - * @return / - */ - List queryAll(DeployHistoryQueryCriteria criteria); - - /** - * 根据ID查询 - * @param id / - * @return / - */ - DeployHistoryDto findById(String id); - - /** - * 创建 - * @param resources / - */ - void create(DeployHistory resources); - - /** - * 删除 - * @param ids / - */ - void delete(Set ids); - - /** - * 导出数据 - * @param queryAll / - * @param response / - * @throws IOException / - */ - void download(List queryAll, HttpServletResponse response) throws IOException; -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/mnt/service/DeployService.java b/wjcy-system/src/main/java/me/zhengjie/modules/mnt/service/DeployService.java deleted file mode 100644 index 583474d..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/mnt/service/DeployService.java +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.mnt.service; - -import me.zhengjie.modules.mnt.domain.Deploy; -import me.zhengjie.modules.mnt.domain.DeployHistory; -import me.zhengjie.modules.mnt.service.dto.DeployDto; -import me.zhengjie.modules.mnt.service.dto.DeployQueryCriteria; -import org.springframework.data.domain.Pageable; - -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.List; -import java.util.Set; - -/** -* @author zhanghouying -* @date 2019-08-24 -*/ -public interface DeployService { - - /** - * 分页查询 - * @param criteria 条件 - * @param pageable 分页参数 - * @return / - */ - Object queryAll(DeployQueryCriteria criteria, Pageable pageable); - - /** - * 查询全部数据 - * @param criteria 条件 - * @return / - */ - List queryAll(DeployQueryCriteria criteria); - - /** - * 根据ID查询 - * @param id / - * @return / - */ - DeployDto findById(Long id); - - /** - * 创建 - * @param resources / - */ - void create(Deploy resources); - - - /** - * 编辑 - * @param resources / - */ - void update(Deploy resources); - - /** - * 删除 - * @param ids / - */ - void delete(Set ids); - - /** - * 部署文件到服务器 - * @param fileSavePath 文件路径 - * @param appId 应用ID - */ - void deploy(String fileSavePath, Long appId); - - /** - * 查询部署状态 - * @param resources / - * @return / - */ - String serverStatus(Deploy resources); - /** - * 启动服务 - * @param resources / - * @return / - */ - String startServer(Deploy resources); - /** - * 停止服务 - * @param resources / - * @return / - */ - String stopServer(Deploy resources); - - /** - * 停止服务 - * @param resources / - * @return / - */ - String serverReduction(DeployHistory resources); - - /** - * 导出数据 - * @param queryAll / - * @param response / - * @throws IOException / - */ - void download(List queryAll, HttpServletResponse response) throws IOException; -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/mnt/service/ServerDeployService.java b/wjcy-system/src/main/java/me/zhengjie/modules/mnt/service/ServerDeployService.java deleted file mode 100644 index be8bb57..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/mnt/service/ServerDeployService.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.mnt.service; - -import me.zhengjie.modules.mnt.domain.ServerDeploy; -import me.zhengjie.modules.mnt.service.dto.ServerDeployDto; -import me.zhengjie.modules.mnt.service.dto.ServerDeployQueryCriteria; -import org.springframework.data.domain.Pageable; - -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.List; -import java.util.Set; - -/** -* @author zhanghouying -* @date 2019-08-24 -*/ -public interface ServerDeployService { - - /** - * 分页查询 - * @param criteria 条件 - * @param pageable 分页参数 - * @return / - */ - Object queryAll(ServerDeployQueryCriteria criteria, Pageable pageable); - - /** - * 查询全部数据 - * @param criteria 条件 - * @return / - */ - List queryAll(ServerDeployQueryCriteria criteria); - - /** - * 根据ID查询 - * @param id / - * @return / - */ - ServerDeployDto findById(Long id); - - /** - * 创建 - * @param resources / - */ - void create(ServerDeploy resources); - - /** - * 编辑 - * @param resources / - */ - void update(ServerDeploy resources); - - /** - * 删除 - * @param ids / - */ - void delete(Set ids); - - /** - * 根据IP查询 - * @param ip / - * @return / - */ - ServerDeployDto findByIp(String ip); - - /** - * 测试登录服务器 - * @param resources / - * @return / - */ - Boolean testConnect(ServerDeploy resources); - - /** - * 导出数据 - * @param queryAll / - * @param response / - * @throws IOException / - */ - void download(List queryAll, HttpServletResponse response) throws IOException; -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/mnt/service/dto/AppDto.java b/wjcy-system/src/main/java/me/zhengjie/modules/mnt/service/dto/AppDto.java deleted file mode 100644 index c6fd6f7..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/mnt/service/dto/AppDto.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.mnt.service.dto; - -import lombok.Getter; -import lombok.Setter; -import me.zhengjie.base.BaseDTO; -import java.io.Serializable; - -/** -* @author zhanghouying -* @date 2019-08-24 -*/ -@Getter -@Setter -public class AppDto extends BaseDTO implements Serializable { - - /** - * 应用编号 - */ - private Long id; - - /** - * 应用名称 - */ - private String name; - - /** - * 端口 - */ - private Integer port; - - /** - * 上传目录 - */ - private String uploadPath; - - /** - * 部署目录 - */ - private String deployPath; - - /** - * 备份目录 - */ - private String backupPath; - - /** - * 启动脚本 - */ - private String startScript; - - /** - * 部署脚本 - */ - private String deployScript; - -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/mnt/service/dto/AppQueryCriteria.java b/wjcy-system/src/main/java/me/zhengjie/modules/mnt/service/dto/AppQueryCriteria.java deleted file mode 100644 index 17f358f..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/mnt/service/dto/AppQueryCriteria.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.mnt.service.dto; - -import lombok.Data; -import me.zhengjie.annotation.Query; -import java.sql.Timestamp; -import java.util.List; - -/** -* @author zhanghouying -* @date 2019-08-24 -*/ -@Data -public class AppQueryCriteria{ - - /** - * 模糊 - */ - @Query(type = Query.Type.INNER_LIKE) - private String name; - - @Query(type = Query.Type.BETWEEN) - private List createTime; -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/mnt/service/dto/DatabaseDto.java b/wjcy-system/src/main/java/me/zhengjie/modules/mnt/service/dto/DatabaseDto.java deleted file mode 100644 index 689b06b..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/mnt/service/dto/DatabaseDto.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.mnt.service.dto; - -import lombok.Getter; -import lombok.Setter; -import me.zhengjie.base.BaseDTO; -import java.io.Serializable; - -/** -* @author zhanghouying -* @date 2019-08-24 -*/ -@Getter -@Setter -public class DatabaseDto extends BaseDTO implements Serializable { - - /** - * id - */ - private String id; - - /** - * 数据库名称 - */ - private String name; - - /** - * 数据库连接地址 - */ - private String jdbcUrl; - - /** - * 数据库密码 - */ - private String pwd; - - /** - * 用户名 - */ - private String userName; -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/mnt/service/dto/DatabaseQueryCriteria.java b/wjcy-system/src/main/java/me/zhengjie/modules/mnt/service/dto/DatabaseQueryCriteria.java deleted file mode 100644 index 53d619d..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/mnt/service/dto/DatabaseQueryCriteria.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.mnt.service.dto; - -import lombok.Data; -import me.zhengjie.annotation.Query; -import java.sql.Timestamp; -import java.util.List; - -/** -* @author zhanghouying -* @date 2019-08-24 -*/ -@Data -public class DatabaseQueryCriteria{ - - /** - * 模糊 - */ - @Query(type = Query.Type.INNER_LIKE) - private String name; - - /** - * 精确 - */ - @Query - private String jdbcUrl; - - @Query(type = Query.Type.BETWEEN) - private List createTime; -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/mnt/service/dto/DeployDto.java b/wjcy-system/src/main/java/me/zhengjie/modules/mnt/service/dto/DeployDto.java deleted file mode 100644 index f3d77b8..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/mnt/service/dto/DeployDto.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.mnt.service.dto; - -import cn.hutool.core.collection.CollectionUtil; -import lombok.Getter; -import lombok.Setter; -import me.zhengjie.base.BaseDTO; -import java.io.Serializable; -import java.util.Objects; -import java.util.Set; -import java.util.stream.Collectors; - - -/** -* @author zhanghouying -* @date 2019-08-24 -*/ -@Getter -@Setter -public class DeployDto extends BaseDTO implements Serializable { - - /** - * 部署编号 - */ - private String id; - - private AppDto app; - - /** - * 服务器 - */ - private Set deploys; - - private String servers; - - /** - * 服务状态 - */ - private String status; - - public String getServers() { - if(CollectionUtil.isNotEmpty(deploys)){ - return deploys.stream().map(ServerDeployDto::getName).collect(Collectors.joining(",")); - } - return servers; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - DeployDto deployDto = (DeployDto) o; - return Objects.equals(id, deployDto.id); - } - - @Override - public int hashCode() { - return Objects.hash(id); - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/mnt/service/dto/DeployHistoryDto.java b/wjcy-system/src/main/java/me/zhengjie/modules/mnt/service/dto/DeployHistoryDto.java deleted file mode 100644 index a9f480c..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/mnt/service/dto/DeployHistoryDto.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.mnt.service.dto; - -import lombok.Data; -import java.io.Serializable; -import java.sql.Timestamp; - -/** -* @author zhanghouying -* @date 2019-08-24 -*/ -@Data -public class DeployHistoryDto implements Serializable { - - /** - * 编号 - */ - private String id; - - /** - * 应用名称 - */ - private String appName; - - /** - * 部署IP - */ - private String ip; - - /** - * 部署时间 - */ - private Timestamp deployDate; - - /** - * 部署人员 - */ - private String deployUser; - - /** - * 部署编号 - */ - private Long deployId; -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/mnt/service/dto/DeployHistoryQueryCriteria.java b/wjcy-system/src/main/java/me/zhengjie/modules/mnt/service/dto/DeployHistoryQueryCriteria.java deleted file mode 100644 index c34f124..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/mnt/service/dto/DeployHistoryQueryCriteria.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.mnt.service.dto; - -import lombok.Data; -import me.zhengjie.annotation.Query; -import java.sql.Timestamp; -import java.util.List; - -/** -* @author zhanghouying -* @date 2019-08-24 -*/ -@Data -public class DeployHistoryQueryCriteria{ - - /** - * 精确 - */ - @Query(blurry = "appName,ip,deployUser") - private String blurry; - - @Query - private Long deployId; - - @Query(type = Query.Type.BETWEEN) - private List deployDate; -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/mnt/service/dto/DeployQueryCriteria.java b/wjcy-system/src/main/java/me/zhengjie/modules/mnt/service/dto/DeployQueryCriteria.java deleted file mode 100644 index c404620..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/mnt/service/dto/DeployQueryCriteria.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.mnt.service.dto; - -import lombok.Data; -import me.zhengjie.annotation.Query; -import java.sql.Timestamp; -import java.util.List; - -/** -* @author zhanghouying -* @date 2019-08-24 -*/ -@Data -public class DeployQueryCriteria{ - - /** - * 模糊 - */ - @Query(type = Query.Type.INNER_LIKE, propName = "name", joinName = "app") - private String appName; - - @Query(type = Query.Type.BETWEEN) - private List createTime; - -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/mnt/service/dto/ServerDeployDto.java b/wjcy-system/src/main/java/me/zhengjie/modules/mnt/service/dto/ServerDeployDto.java deleted file mode 100644 index a49c795..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/mnt/service/dto/ServerDeployDto.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.mnt.service.dto; - -import lombok.Getter; -import lombok.Setter; -import me.zhengjie.base.BaseDTO; -import java.io.Serializable; -import java.util.Objects; - -/** -* @author zhanghouying -* @date 2019-08-24 -*/ -@Getter -@Setter -public class ServerDeployDto extends BaseDTO implements Serializable { - - private Long id; - - private String name; - - private String ip; - - private Integer port; - - private String account; - - private String password; - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ServerDeployDto that = (ServerDeployDto) o; - return Objects.equals(id, that.id) && - Objects.equals(name, that.name); - } - - @Override - public int hashCode() { - return Objects.hash(id, name); - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/mnt/service/dto/ServerDeployQueryCriteria.java b/wjcy-system/src/main/java/me/zhengjie/modules/mnt/service/dto/ServerDeployQueryCriteria.java deleted file mode 100644 index bb8bd41..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/mnt/service/dto/ServerDeployQueryCriteria.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.mnt.service.dto; - -import lombok.Data; -import me.zhengjie.annotation.Query; -import java.sql.Timestamp; -import java.util.List; - -/** -* @author zhanghouying -* @date 2019-08-24 -*/ -@Data -public class ServerDeployQueryCriteria{ - - /** - * 模糊 - */ - @Query(blurry = "name,ip,account") - private String blurry; - - @Query(type = Query.Type.BETWEEN) - private List createTime; -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/mnt/service/impl/AppServiceImpl.java b/wjcy-system/src/main/java/me/zhengjie/modules/mnt/service/impl/AppServiceImpl.java deleted file mode 100644 index 42b088f..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/mnt/service/impl/AppServiceImpl.java +++ /dev/null @@ -1,123 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.mnt.service.impl; - -import lombok.RequiredArgsConstructor; -import me.zhengjie.exception.BadRequestException; -import me.zhengjie.modules.mnt.domain.App; -import me.zhengjie.modules.mnt.repository.AppRepository; -import me.zhengjie.modules.mnt.service.AppService; -import me.zhengjie.modules.mnt.service.dto.AppDto; -import me.zhengjie.modules.mnt.service.dto.AppQueryCriteria; -import me.zhengjie.modules.mnt.service.mapstruct.AppMapper; -import me.zhengjie.utils.FileUtil; -import me.zhengjie.utils.PageUtil; -import me.zhengjie.utils.QueryHelp; -import me.zhengjie.utils.ValidationUtil; -import org.springframework.data.domain.Page; -import org.springframework.data.domain.Pageable; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.*; - -/** -* @author zhanghouying -* @date 2019-08-24 -*/ -@Service -@RequiredArgsConstructor -public class AppServiceImpl implements AppService { - - private final AppRepository appRepository; - private final AppMapper appMapper; - - @Override - public Object queryAll(AppQueryCriteria criteria, Pageable pageable){ - Page page = appRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable); - return PageUtil.toPage(page.map(appMapper::toDto)); - } - - @Override - public List queryAll(AppQueryCriteria criteria){ - return appMapper.toDto(appRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder))); - } - - @Override - public AppDto findById(Long id) { - App app = appRepository.findById(id).orElseGet(App::new); - ValidationUtil.isNull(app.getId(),"App","id",id); - return appMapper.toDto(app); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void create(App resources) { - verification(resources); - appRepository.save(resources); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void update(App resources) { - verification(resources); - App app = appRepository.findById(resources.getId()).orElseGet(App::new); - ValidationUtil.isNull(app.getId(),"App","id",resources.getId()); - app.copy(resources); - appRepository.save(app); - } - - private void verification(App resources){ - String opt = "/opt"; - String home = "/home"; - if (!(resources.getUploadPath().startsWith(opt) || resources.getUploadPath().startsWith(home))) { - throw new BadRequestException("文件只能上传在opt目录或者home目录 "); - } - if (!(resources.getDeployPath().startsWith(opt) || resources.getDeployPath().startsWith(home))) { - throw new BadRequestException("文件只能部署在opt目录或者home目录 "); - } - if (!(resources.getBackupPath().startsWith(opt) || resources.getBackupPath().startsWith(home))) { - throw new BadRequestException("文件只能备份在opt目录或者home目录 "); - } - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void delete(Set ids) { - for (Long id : ids) { - appRepository.deleteById(id); - } - } - - @Override - public void download(List queryAll, HttpServletResponse response) throws IOException { - List> list = new ArrayList<>(); - for (AppDto appDto : queryAll) { - Map map = new LinkedHashMap<>(); - map.put("应用名称", appDto.getName()); - map.put("端口", appDto.getPort()); - map.put("上传目录", appDto.getUploadPath()); - map.put("部署目录", appDto.getDeployPath()); - map.put("备份目录", appDto.getBackupPath()); - map.put("启动脚本", appDto.getStartScript()); - map.put("部署脚本", appDto.getDeployScript()); - map.put("创建日期", appDto.getCreateTime()); - list.add(map); - } - FileUtil.downloadExcel(list, response); - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/mnt/service/impl/DatabaseServiceImpl.java b/wjcy-system/src/main/java/me/zhengjie/modules/mnt/service/impl/DatabaseServiceImpl.java deleted file mode 100644 index c774028..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/mnt/service/impl/DatabaseServiceImpl.java +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.mnt.service.impl; - -import cn.hutool.core.util.IdUtil; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import me.zhengjie.modules.mnt.domain.Database; -import me.zhengjie.modules.mnt.repository.DatabaseRepository; -import me.zhengjie.modules.mnt.service.DatabaseService; -import me.zhengjie.modules.mnt.service.dto.DatabaseDto; -import me.zhengjie.modules.mnt.service.dto.DatabaseQueryCriteria; -import me.zhengjie.modules.mnt.service.mapstruct.DatabaseMapper; -import me.zhengjie.modules.mnt.util.SqlUtils; -import me.zhengjie.utils.FileUtil; -import me.zhengjie.utils.PageUtil; -import me.zhengjie.utils.QueryHelp; -import me.zhengjie.utils.ValidationUtil; -import org.springframework.data.domain.Page; -import org.springframework.data.domain.Pageable; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.*; - -/** -* @author zhanghouying -* @date 2019-08-24 -*/ -@Slf4j -@Service -@RequiredArgsConstructor -public class DatabaseServiceImpl implements DatabaseService { - - private final DatabaseRepository databaseRepository; - private final DatabaseMapper databaseMapper; - - @Override - public Object queryAll(DatabaseQueryCriteria criteria, Pageable pageable){ - Page page = databaseRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable); - return PageUtil.toPage(page.map(databaseMapper::toDto)); - } - - @Override - public List queryAll(DatabaseQueryCriteria criteria){ - return databaseMapper.toDto(databaseRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder))); - } - - @Override - public DatabaseDto findById(String id) { - Database database = databaseRepository.findById(id).orElseGet(Database::new); - ValidationUtil.isNull(database.getId(),"Database","id",id); - return databaseMapper.toDto(database); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void create(Database resources) { - resources.setId(IdUtil.simpleUUID()); - databaseRepository.save(resources); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void update(Database resources) { - Database database = databaseRepository.findById(resources.getId()).orElseGet(Database::new); - ValidationUtil.isNull(database.getId(),"Database","id",resources.getId()); - database.copy(resources); - databaseRepository.save(database); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void delete(Set ids) { - for (String id : ids) { - databaseRepository.deleteById(id); - } - } - - @Override - public boolean testConnection(Database resources) { - try { - return SqlUtils.testConnection(resources.getJdbcUrl(), resources.getUserName(), resources.getPwd()); - } catch (Exception e) { - log.error(e.getMessage()); - return false; - } - } - - @Override - public void download(List queryAll, HttpServletResponse response) throws IOException { - List> list = new ArrayList<>(); - for (DatabaseDto databaseDto : queryAll) { - Map map = new LinkedHashMap<>(); - map.put("数据库名称", databaseDto.getName()); - map.put("数据库连接地址", databaseDto.getJdbcUrl()); - map.put("用户名", databaseDto.getUserName()); - map.put("创建日期", databaseDto.getCreateTime()); - list.add(map); - } - FileUtil.downloadExcel(list, response); - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/mnt/service/impl/DeployHistoryServiceImpl.java b/wjcy-system/src/main/java/me/zhengjie/modules/mnt/service/impl/DeployHistoryServiceImpl.java deleted file mode 100644 index 7431113..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/mnt/service/impl/DeployHistoryServiceImpl.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.mnt.service.impl; - -import cn.hutool.core.util.IdUtil; -import lombok.RequiredArgsConstructor; -import me.zhengjie.modules.mnt.domain.DeployHistory; -import me.zhengjie.modules.mnt.repository.DeployHistoryRepository; -import me.zhengjie.modules.mnt.service.DeployHistoryService; -import me.zhengjie.modules.mnt.service.dto.DeployHistoryDto; -import me.zhengjie.modules.mnt.service.dto.DeployHistoryQueryCriteria; -import me.zhengjie.modules.mnt.service.mapstruct.DeployHistoryMapper; -import me.zhengjie.utils.FileUtil; -import me.zhengjie.utils.PageUtil; -import me.zhengjie.utils.QueryHelp; -import me.zhengjie.utils.ValidationUtil; -import org.springframework.data.domain.Page; -import org.springframework.data.domain.Pageable; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.*; - -/** -* @author zhanghouying -* @date 2019-08-24 -*/ -@Service -@RequiredArgsConstructor -public class DeployHistoryServiceImpl implements DeployHistoryService { - - private final DeployHistoryRepository deployhistoryRepository; - private final DeployHistoryMapper deployhistoryMapper; - - @Override - public Object queryAll(DeployHistoryQueryCriteria criteria, Pageable pageable){ - Page page = deployhistoryRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable); - return PageUtil.toPage(page.map(deployhistoryMapper::toDto)); - } - - @Override - public List queryAll(DeployHistoryQueryCriteria criteria){ - return deployhistoryMapper.toDto(deployhistoryRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder))); - } - - @Override - public DeployHistoryDto findById(String id) { - DeployHistory deployhistory = deployhistoryRepository.findById(id).orElseGet(DeployHistory::new); - ValidationUtil.isNull(deployhistory.getId(),"DeployHistory","id",id); - return deployhistoryMapper.toDto(deployhistory); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void create(DeployHistory resources) { - resources.setId(IdUtil.simpleUUID()); - deployhistoryRepository.save(resources); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void delete(Set ids) { - for (String id : ids) { - deployhistoryRepository.deleteById(id); - } - } - - @Override - public void download(List queryAll, HttpServletResponse response) throws IOException { - List> list = new ArrayList<>(); - for (DeployHistoryDto deployHistoryDto : queryAll) { - Map map = new LinkedHashMap<>(); - map.put("部署编号", deployHistoryDto.getDeployId()); - map.put("应用名称", deployHistoryDto.getAppName()); - map.put("部署IP", deployHistoryDto.getIp()); - map.put("部署时间", deployHistoryDto.getDeployDate()); - map.put("部署人员", deployHistoryDto.getDeployUser()); - list.add(map); - } - FileUtil.downloadExcel(list, response); - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/mnt/service/impl/DeployServiceImpl.java b/wjcy-system/src/main/java/me/zhengjie/modules/mnt/service/impl/DeployServiceImpl.java deleted file mode 100644 index f2491cd..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/mnt/service/impl/DeployServiceImpl.java +++ /dev/null @@ -1,430 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.mnt.service.impl; - -import cn.hutool.core.date.DatePattern; -import cn.hutool.core.date.DateUtil; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import me.zhengjie.exception.BadRequestException; -import me.zhengjie.modules.mnt.domain.App; -import me.zhengjie.modules.mnt.domain.Deploy; -import me.zhengjie.modules.mnt.domain.DeployHistory; -import me.zhengjie.modules.mnt.domain.ServerDeploy; -import me.zhengjie.modules.mnt.repository.DeployRepository; -import me.zhengjie.modules.mnt.service.DeployHistoryService; -import me.zhengjie.modules.mnt.service.DeployService; -import me.zhengjie.modules.mnt.service.ServerDeployService; -import me.zhengjie.modules.mnt.service.dto.AppDto; -import me.zhengjie.modules.mnt.service.dto.DeployDto; -import me.zhengjie.modules.mnt.service.dto.DeployQueryCriteria; -import me.zhengjie.modules.mnt.service.dto.ServerDeployDto; -import me.zhengjie.modules.mnt.service.mapstruct.DeployMapper; -import me.zhengjie.modules.mnt.util.ExecuteShellUtil; -import me.zhengjie.modules.mnt.util.ScpClientUtil; -import me.zhengjie.modules.mnt.websocket.MsgType; -import me.zhengjie.modules.mnt.websocket.SocketMsg; -import me.zhengjie.modules.mnt.websocket.WebSocketServer; -import me.zhengjie.utils.*; -import org.springframework.data.domain.Page; -import org.springframework.data.domain.Pageable; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.*; - -/** - * @author zhanghouying - * @date 2019-08-24 - */ -@Slf4j -@Service -@RequiredArgsConstructor -public class DeployServiceImpl implements DeployService { - - private final String FILE_SEPARATOR = "/"; - private final DeployRepository deployRepository; - private final DeployMapper deployMapper; - private final ServerDeployService serverDeployService; - private final DeployHistoryService deployHistoryService; - /** - * 循环次数 - */ - private final Integer count = 30; - - - @Override - public Object queryAll(DeployQueryCriteria criteria, Pageable pageable) { - Page page = deployRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root, criteria, criteriaBuilder), pageable); - return PageUtil.toPage(page.map(deployMapper::toDto)); - } - - @Override - public List queryAll(DeployQueryCriteria criteria) { - return deployMapper.toDto(deployRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root, criteria, criteriaBuilder))); - } - - @Override - public DeployDto findById(Long id) { - Deploy deploy = deployRepository.findById(id).orElseGet(Deploy::new); - ValidationUtil.isNull(deploy.getId(), "Deploy", "id", id); - return deployMapper.toDto(deploy); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void create(Deploy resources) { - deployRepository.save(resources); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void update(Deploy resources) { - Deploy deploy = deployRepository.findById(resources.getId()).orElseGet(Deploy::new); - ValidationUtil.isNull(deploy.getId(), "Deploy", "id", resources.getId()); - deploy.copy(resources); - deployRepository.save(deploy); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void delete(Set ids) { - for (Long id : ids) { - deployRepository.deleteById(id); - } - } - - @Override - public void deploy(String fileSavePath, Long id) { - deployApp(fileSavePath, id); - } - - /** - * @param fileSavePath 本机路径 - * @param id ID - */ - private void deployApp(String fileSavePath, Long id) { - - DeployDto deploy = findById(id); - if (deploy == null) { - sendMsg("部署信息不存在", MsgType.ERROR); - throw new BadRequestException("部署信息不存在"); - } - AppDto app = deploy.getApp(); - if (app == null) { - sendMsg("包对应应用信息不存在", MsgType.ERROR); - throw new BadRequestException("包对应应用信息不存在"); - } - int port = app.getPort(); - //这个是服务器部署路径 - String uploadPath = app.getUploadPath(); - StringBuilder sb = new StringBuilder(); - String msg; - Set deploys = deploy.getDeploys(); - for (ServerDeployDto deployDTO : deploys) { - String ip = deployDTO.getIp(); - ExecuteShellUtil executeShellUtil = getExecuteShellUtil(ip); - //判断是否第一次部署 - boolean flag = checkFile(executeShellUtil, app); - //第一步要确认服务器上有这个目录 - executeShellUtil.execute("mkdir -p " + app.getUploadPath()); - executeShellUtil.execute("mkdir -p " + app.getBackupPath()); - executeShellUtil.execute("mkdir -p " + app.getDeployPath()); - //上传文件 - msg = String.format("登陆到服务器:%s", ip); - ScpClientUtil scpClientUtil = getScpClientUtil(ip); - log.info(msg); - sendMsg(msg, MsgType.INFO); - msg = String.format("上传文件到服务器:%s
目录:%s下,请稍等...", ip, uploadPath); - sendMsg(msg, MsgType.INFO); - scpClientUtil.putFile(fileSavePath, uploadPath); - if (flag) { - sendMsg("停止原来应用", MsgType.INFO); - //停止应用 - stopApp(port, executeShellUtil); - sendMsg("备份原来应用", MsgType.INFO); - //备份应用 - backupApp(executeShellUtil, ip, app.getDeployPath()+FILE_SEPARATOR, app.getName(), app.getBackupPath()+FILE_SEPARATOR, id); - } - sendMsg("部署应用", MsgType.INFO); - //部署文件,并启动应用 - String deployScript = app.getDeployScript(); - executeShellUtil.execute(deployScript); - sleep(3); - sendMsg("应用部署中,请耐心等待部署结果,或者稍后手动查看部署状态", MsgType.INFO); - int i = 0; - boolean result = false; - // 由于启动应用需要时间,所以需要循环获取状态,如果超过30次,则认为是启动失败 - while (i++ < count){ - result = checkIsRunningStatus(port, executeShellUtil); - if(result){ - break; - } - // 休眠6秒 - sleep(6); - } - sb.append("服务器:").append(deployDTO.getName()).append("
应用:").append(app.getName()); - sendResultMsg(result, sb); - executeShellUtil.close(); - } - } - - private void sleep(int second) { - try { - Thread.sleep(second * 1000); - } catch (InterruptedException e) { - log.error(e.getMessage(),e); - } - } - - private void backupApp(ExecuteShellUtil executeShellUtil, String ip, String fileSavePath, String appName, String backupPath, Long id) { - String deployDate = DateUtil.format(new Date(), DatePattern.PURE_DATETIME_PATTERN); - StringBuilder sb = new StringBuilder(); - backupPath += appName + FILE_SEPARATOR + deployDate + "\n"; - sb.append("mkdir -p ").append(backupPath); - sb.append("mv -f ").append(fileSavePath); - sb.append(appName).append(" ").append(backupPath); - log.info("备份应用脚本:" + sb.toString()); - executeShellUtil.execute(sb.toString()); - //还原信息入库 - DeployHistory deployHistory = new DeployHistory(); - deployHistory.setAppName(appName); - deployHistory.setDeployUser(SecurityUtils.getCurrentUsername()); - deployHistory.setIp(ip); - deployHistory.setDeployId(id); - deployHistoryService.create(deployHistory); - } - - /** - * 停App - * - * @param port 端口 - * @param executeShellUtil / - */ - private void stopApp(int port, ExecuteShellUtil executeShellUtil) { - //发送停止命令 - executeShellUtil.execute(String.format("lsof -i :%d|grep -v \"PID\"|awk '{print \"kill -9\",$2}'|sh", port)); - - } - - /** - * 指定端口程序是否在运行 - * - * @param port 端口 - * @param executeShellUtil / - * @return true 正在运行 false 已经停止 - */ - private boolean checkIsRunningStatus(int port, ExecuteShellUtil executeShellUtil) { - String result = executeShellUtil.executeForResult(String.format("fuser -n tcp %d", port)); - return result.indexOf("/tcp:")>0; - } - - private void sendMsg(String msg, MsgType msgType) { - try { - WebSocketServer.sendInfo(new SocketMsg(msg, msgType), "deploy"); - } catch (IOException e) { - log.error(e.getMessage(),e); - } - } - - @Override - public String serverStatus(Deploy resources) { - Set serverDeploys = resources.getDeploys(); - App app = resources.getApp(); - for (ServerDeploy serverDeploy : serverDeploys) { - StringBuilder sb = new StringBuilder(); - ExecuteShellUtil executeShellUtil = getExecuteShellUtil(serverDeploy.getIp()); - sb.append("服务器:").append(serverDeploy.getName()).append("
应用:").append(app.getName()); - boolean result = checkIsRunningStatus(app.getPort(), executeShellUtil); - if (result) { - sb.append("
正在运行"); - sendMsg(sb.toString(), MsgType.INFO); - } else { - sb.append("
已停止!"); - sendMsg(sb.toString(), MsgType.ERROR); - } - log.info(sb.toString()); - executeShellUtil.close(); - } - return "执行完毕"; - } - - private boolean checkFile(ExecuteShellUtil executeShellUtil, AppDto appDTO) { - String result = executeShellUtil.executeForResult("find " + appDTO.getDeployPath() + " -name " + appDTO.getName()); - return result.indexOf(appDTO.getName())>0; - } - - /** - * 启动服务 - * @param resources / - * @return / - */ - @Override - public String startServer(Deploy resources) { - Set deploys = resources.getDeploys(); - App app = resources.getApp(); - for (ServerDeploy deploy : deploys) { - StringBuilder sb = new StringBuilder(); - ExecuteShellUtil executeShellUtil = getExecuteShellUtil(deploy.getIp()); - //为了防止重复启动,这里先停止应用 - stopApp(app.getPort(), executeShellUtil); - sb.append("服务器:").append(deploy.getName()).append("
应用:").append(app.getName()); - sendMsg("下发启动命令", MsgType.INFO); - executeShellUtil.execute(app.getStartScript()); - sleep(3); - sendMsg("应用启动中,请耐心等待启动结果,或者稍后手动查看运行状态", MsgType.INFO); - int i = 0; - boolean result = false; - // 由于启动应用需要时间,所以需要循环获取状态,如果超过30次,则认为是启动失败 - while (i++ < count){ - result = checkIsRunningStatus(app.getPort(), executeShellUtil); - if(result){ - break; - } - // 休眠6秒 - sleep(6); - } - sendResultMsg(result, sb); - log.info(sb.toString()); - executeShellUtil.close(); - } - return "执行完毕"; - } - - /** - * 停止服务 - * @param resources / - * @return / - */ - @Override - public String stopServer(Deploy resources) { - Set deploys = resources.getDeploys(); - App app = resources.getApp(); - for (ServerDeploy deploy : deploys) { - StringBuilder sb = new StringBuilder(); - ExecuteShellUtil executeShellUtil = getExecuteShellUtil(deploy.getIp()); - sb.append("服务器:").append(deploy.getName()).append("
应用:").append(app.getName()); - sendMsg("下发停止命令", MsgType.INFO); - //停止应用 - stopApp(app.getPort(), executeShellUtil); - sleep(1); - boolean result = checkIsRunningStatus(app.getPort(), executeShellUtil); - if (result) { - sb.append("
关闭失败!"); - sendMsg(sb.toString(), MsgType.ERROR); - } else { - sb.append("
关闭成功!"); - sendMsg(sb.toString(), MsgType.INFO); - } - log.info(sb.toString()); - executeShellUtil.close(); - } - return "执行完毕"; - } - - @Override - public String serverReduction(DeployHistory resources) { - Long deployId = resources.getDeployId(); - Deploy deployInfo = deployRepository.findById(deployId).orElseGet(Deploy::new); - String deployDate = DateUtil.format(resources.getDeployDate(), DatePattern.PURE_DATETIME_PATTERN); - App app = deployInfo.getApp(); - if (app == null) { - sendMsg("应用信息不存在:" + resources.getAppName(), MsgType.ERROR); - throw new BadRequestException("应用信息不存在:" + resources.getAppName()); - } - String backupPath = app.getBackupPath()+FILE_SEPARATOR; - backupPath += resources.getAppName() + FILE_SEPARATOR + deployDate; - //这个是服务器部署路径 - String deployPath = app.getDeployPath(); - String ip = resources.getIp(); - ExecuteShellUtil executeShellUtil = getExecuteShellUtil(ip); - String msg; - - msg = String.format("登陆到服务器:%s", ip); - log.info(msg); - sendMsg(msg, MsgType.INFO); - sendMsg("停止原来应用", MsgType.INFO); - //停止应用 - stopApp(app.getPort(), executeShellUtil); - //删除原来应用 - sendMsg("删除应用", MsgType.INFO); - executeShellUtil.execute("rm -rf " + deployPath + FILE_SEPARATOR + resources.getAppName()); - //还原应用 - sendMsg("还原应用", MsgType.INFO); - executeShellUtil.execute("cp -r " + backupPath + "/. " + deployPath); - sendMsg("启动应用", MsgType.INFO); - executeShellUtil.execute(app.getStartScript()); - sendMsg("应用启动中,请耐心等待启动结果,或者稍后手动查看启动状态", MsgType.INFO); - int i = 0; - boolean result = false; - // 由于启动应用需要时间,所以需要循环获取状态,如果超过30次,则认为是启动失败 - while (i++ < count){ - result = checkIsRunningStatus(app.getPort(), executeShellUtil); - if(result){ - break; - } - // 休眠6秒 - sleep(6); - } - StringBuilder sb = new StringBuilder(); - sb.append("服务器:").append(ip).append("
应用:").append(resources.getAppName()); - sendResultMsg(result, sb); - executeShellUtil.close(); - return ""; - } - - private ExecuteShellUtil getExecuteShellUtil(String ip) { - ServerDeployDto serverDeployDTO = serverDeployService.findByIp(ip); - if (serverDeployDTO == null) { - sendMsg("IP对应服务器信息不存在:" + ip, MsgType.ERROR); - throw new BadRequestException("IP对应服务器信息不存在:" + ip); - } - return new ExecuteShellUtil(ip, serverDeployDTO.getAccount(), serverDeployDTO.getPassword(),serverDeployDTO.getPort()); - } - - private ScpClientUtil getScpClientUtil(String ip) { - ServerDeployDto serverDeployDTO = serverDeployService.findByIp(ip); - if (serverDeployDTO == null) { - sendMsg("IP对应服务器信息不存在:" + ip, MsgType.ERROR); - throw new BadRequestException("IP对应服务器信息不存在:" + ip); - } - return ScpClientUtil.getInstance(ip, serverDeployDTO.getPort(), serverDeployDTO.getAccount(), serverDeployDTO.getPassword()); - } - - private void sendResultMsg(boolean result, StringBuilder sb) { - if (result) { - sb.append("
启动成功!"); - sendMsg(sb.toString(), MsgType.INFO); - } else { - sb.append("
启动失败!"); - sendMsg(sb.toString(), MsgType.ERROR); - } - } - - @Override - public void download(List queryAll, HttpServletResponse response) throws IOException { - List> list = new ArrayList<>(); - for (DeployDto deployDto : queryAll) { - Map map = new LinkedHashMap<>(); - map.put("应用名称", deployDto.getApp().getName()); - map.put("服务器", deployDto.getServers()); - map.put("部署日期", deployDto.getCreateTime()); - list.add(map); - } - FileUtil.downloadExcel(list, response); - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/mnt/service/impl/ServerDeployServiceImpl.java b/wjcy-system/src/main/java/me/zhengjie/modules/mnt/service/impl/ServerDeployServiceImpl.java deleted file mode 100644 index 63272da..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/mnt/service/impl/ServerDeployServiceImpl.java +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.mnt.service.impl; - -import lombok.RequiredArgsConstructor; -import me.zhengjie.modules.mnt.domain.ServerDeploy; -import me.zhengjie.modules.mnt.repository.ServerDeployRepository; -import me.zhengjie.modules.mnt.service.ServerDeployService; -import me.zhengjie.modules.mnt.service.dto.ServerDeployDto; -import me.zhengjie.modules.mnt.service.dto.ServerDeployQueryCriteria; -import me.zhengjie.modules.mnt.service.mapstruct.ServerDeployMapper; -import me.zhengjie.modules.mnt.util.ExecuteShellUtil; -import me.zhengjie.utils.FileUtil; -import me.zhengjie.utils.PageUtil; -import me.zhengjie.utils.QueryHelp; -import me.zhengjie.utils.ValidationUtil; -import org.springframework.data.domain.Page; -import org.springframework.data.domain.Pageable; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.*; - -/** -* @author zhanghouying -* @date 2019-08-24 -*/ -@Service -@RequiredArgsConstructor -public class ServerDeployServiceImpl implements ServerDeployService { - - private final ServerDeployRepository serverDeployRepository; - private final ServerDeployMapper serverDeployMapper; - - @Override - public Object queryAll(ServerDeployQueryCriteria criteria, Pageable pageable){ - Page page = serverDeployRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable); - return PageUtil.toPage(page.map(serverDeployMapper::toDto)); - } - - @Override - public List queryAll(ServerDeployQueryCriteria criteria){ - return serverDeployMapper.toDto(serverDeployRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder))); - } - - @Override - public ServerDeployDto findById(Long id) { - ServerDeploy server = serverDeployRepository.findById(id).orElseGet(ServerDeploy::new); - ValidationUtil.isNull(server.getId(),"ServerDeploy","id",id); - return serverDeployMapper.toDto(server); - } - - @Override - public ServerDeployDto findByIp(String ip) { - ServerDeploy deploy = serverDeployRepository.findByIp(ip); - return serverDeployMapper.toDto(deploy); - } - - @Override - public Boolean testConnect(ServerDeploy resources) { - ExecuteShellUtil executeShellUtil = null; - try { - executeShellUtil = new ExecuteShellUtil(resources.getIp(), resources.getAccount(), resources.getPassword(),resources.getPort()); - return executeShellUtil.execute("ls")==0; - } catch (Exception e) { - return false; - }finally { - if (executeShellUtil != null) { - executeShellUtil.close(); - } - } - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void create(ServerDeploy resources) { - serverDeployRepository.save(resources); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void update(ServerDeploy resources) { - ServerDeploy serverDeploy = serverDeployRepository.findById(resources.getId()).orElseGet(ServerDeploy::new); - ValidationUtil.isNull( serverDeploy.getId(),"ServerDeploy","id",resources.getId()); - serverDeploy.copy(resources); - serverDeployRepository.save(serverDeploy); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void delete(Set ids) { - for (Long id : ids) { - serverDeployRepository.deleteById(id); - } - } - - @Override - public void download(List queryAll, HttpServletResponse response) throws IOException { - List> list = new ArrayList<>(); - for (ServerDeployDto deployDto : queryAll) { - Map map = new LinkedHashMap<>(); - map.put("服务器名称", deployDto.getName()); - map.put("服务器IP", deployDto.getIp()); - map.put("端口", deployDto.getPort()); - map.put("账号", deployDto.getAccount()); - map.put("创建日期", deployDto.getCreateTime()); - list.add(map); - } - FileUtil.downloadExcel(list, response); - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/mnt/service/mapstruct/AppMapper.java b/wjcy-system/src/main/java/me/zhengjie/modules/mnt/service/mapstruct/AppMapper.java deleted file mode 100644 index fc39eeb..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/mnt/service/mapstruct/AppMapper.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.mnt.service.mapstruct; - -import me.zhengjie.base.BaseMapper; -import me.zhengjie.modules.mnt.domain.App; -import me.zhengjie.modules.mnt.service.dto.AppDto; -import org.mapstruct.Mapper; -import org.mapstruct.ReportingPolicy; - -/** -* @author zhanghouying -* @date 2019-08-24 -*/ -@Mapper(componentModel = "spring",uses = {},unmappedTargetPolicy = ReportingPolicy.IGNORE) -public interface AppMapper extends BaseMapper { - -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/mnt/service/mapstruct/DatabaseMapper.java b/wjcy-system/src/main/java/me/zhengjie/modules/mnt/service/mapstruct/DatabaseMapper.java deleted file mode 100644 index 3cc6e8d..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/mnt/service/mapstruct/DatabaseMapper.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.mnt.service.mapstruct; - -import me.zhengjie.base.BaseMapper; -import me.zhengjie.modules.mnt.domain.Database; -import me.zhengjie.modules.mnt.service.dto.DatabaseDto; -import org.mapstruct.Mapper; -import org.mapstruct.ReportingPolicy; - -/** -* @author zhanghouying -* @date 2019-08-24 -*/ -@Mapper(componentModel = "spring",unmappedTargetPolicy = ReportingPolicy.IGNORE) -public interface DatabaseMapper extends BaseMapper { - -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/mnt/service/mapstruct/DeployHistoryMapper.java b/wjcy-system/src/main/java/me/zhengjie/modules/mnt/service/mapstruct/DeployHistoryMapper.java deleted file mode 100644 index 2522ab0..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/mnt/service/mapstruct/DeployHistoryMapper.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.mnt.service.mapstruct; - -import me.zhengjie.base.BaseMapper; -import me.zhengjie.modules.mnt.domain.DeployHistory; -import me.zhengjie.modules.mnt.service.dto.DeployHistoryDto; -import org.mapstruct.Mapper; -import org.mapstruct.ReportingPolicy; - -/** -* @author zhanghouying -* @date 2019-08-24 -*/ -@Mapper(componentModel = "spring",uses = {},unmappedTargetPolicy = ReportingPolicy.IGNORE) -public interface DeployHistoryMapper extends BaseMapper { - -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/mnt/service/mapstruct/DeployMapper.java b/wjcy-system/src/main/java/me/zhengjie/modules/mnt/service/mapstruct/DeployMapper.java deleted file mode 100644 index cd3edee..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/mnt/service/mapstruct/DeployMapper.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.mnt.service.mapstruct; - -import me.zhengjie.base.BaseMapper; -import me.zhengjie.modules.mnt.domain.Deploy; -import me.zhengjie.modules.mnt.service.dto.DeployDto; -import org.mapstruct.Mapper; -import org.mapstruct.ReportingPolicy; - -/** -* @author zhanghouying -* @date 2019-08-24 -*/ -@Mapper(componentModel = "spring",uses = {AppMapper.class, ServerDeployMapper.class},unmappedTargetPolicy = ReportingPolicy.IGNORE) -public interface DeployMapper extends BaseMapper { - -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/mnt/service/mapstruct/ServerDeployMapper.java b/wjcy-system/src/main/java/me/zhengjie/modules/mnt/service/mapstruct/ServerDeployMapper.java deleted file mode 100644 index 960b25b..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/mnt/service/mapstruct/ServerDeployMapper.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.mnt.service.mapstruct; - -import me.zhengjie.base.BaseMapper; -import me.zhengjie.modules.mnt.domain.ServerDeploy; -import me.zhengjie.modules.mnt.service.dto.ServerDeployDto; -import org.mapstruct.Mapper; -import org.mapstruct.ReportingPolicy; - -/** -* @author zhanghouying -* @date 2019-08-24 -*/ -@Mapper(componentModel = "spring",uses = {},unmappedTargetPolicy = ReportingPolicy.IGNORE) -public interface ServerDeployMapper extends BaseMapper { - -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/mnt/util/DataTypeEnum.java b/wjcy-system/src/main/java/me/zhengjie/modules/mnt/util/DataTypeEnum.java deleted file mode 100644 index e104b9e..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/mnt/util/DataTypeEnum.java +++ /dev/null @@ -1,140 +0,0 @@ -/* - * << - * Davinci - * == - * Copyright (C) 2016 - 2019 EDP - * == - * 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 me.zhengjie.modules.mnt.util; -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 server */ - 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 RuntimeException("Unable to get driver instance for jdbcUrl: " + jdbcUrl); - } - } catch (ClassNotFoundException e) { - throw new RuntimeException("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/wjcy-system/src/main/java/me/zhengjie/modules/mnt/util/ExecuteShellUtil.java b/wjcy-system/src/main/java/me/zhengjie/modules/mnt/util/ExecuteShellUtil.java deleted file mode 100644 index a5d5b59..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/mnt/util/ExecuteShellUtil.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.mnt.util; - -import cn.hutool.core.io.IoUtil; -import com.jcraft.jsch.ChannelShell; -import com.jcraft.jsch.JSch; -import com.jcraft.jsch.Session; -import lombok.extern.slf4j.Slf4j; - -import java.io.*; -import java.util.Vector; - -/** - * 执行shell命令 - * - * @author: ZhangHouYing - * @date: 2019/8/10 - */ -@Slf4j -public class ExecuteShellUtil { - - private Vector stdout; - - Session session; - - public ExecuteShellUtil(final String ipAddress, final String username, final String password,int port) { - try { - JSch jsch = new JSch(); - session = jsch.getSession(username, ipAddress, port); - session.setPassword(password); - session.setConfig("StrictHostKeyChecking", "no"); - session.connect(3000); - } catch (Exception e) { - log.error(e.getMessage(),e); - } - - } - - public int execute(final String command) { - int returnCode = 0; - ChannelShell channel = null; - PrintWriter printWriter = null; - BufferedReader input = null; - stdout = new Vector(); - try { - channel = (ChannelShell) session.openChannel("shell"); - channel.connect(); - input = new BufferedReader(new InputStreamReader(channel.getInputStream())); - printWriter = new PrintWriter(channel.getOutputStream()); - printWriter.println(command); - printWriter.println("exit"); - printWriter.flush(); - log.info("The remote command is: "); - String line; - while ((line = input.readLine()) != null) { - stdout.add(line); - System.out.println(line); - } - } catch (Exception e) { - log.error(e.getMessage(),e); - return -1; - }finally { - IoUtil.close(printWriter); - IoUtil.close(input); - if (channel != null) { - channel.disconnect(); - } - } - return returnCode; - } - - public void close(){ - if (session != null) { - session.disconnect(); - } - } - - public String executeForResult(String command) { - execute(command); - StringBuilder sb = new StringBuilder(); - for (String str : stdout) { - sb.append(str); - } - return sb.toString(); - } - -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/mnt/util/ScpClientUtil.java b/wjcy-system/src/main/java/me/zhengjie/modules/mnt/util/ScpClientUtil.java deleted file mode 100644 index 7cb83aa..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/mnt/util/ScpClientUtil.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.mnt.util; - -import ch.ethz.ssh2.Connection; -import ch.ethz.ssh2.SCPClient; -import com.google.common.collect.Maps; - -import java.io.IOException; -import java.util.Map; -import java.util.logging.Level; -import java.util.logging.Logger; - -/** - * 远程执行linux命令 - * @author: ZhangHouYing - * @date: 2019-08-10 10:06 - */ -public class ScpClientUtil { - - static private Map instance = Maps.newHashMap(); - - static synchronized public ScpClientUtil getInstance(String ip, int port, String username, String password) { - if (instance.get(ip) == null) { - instance.put(ip, new ScpClientUtil(ip, port, username, password)); - } - return instance.get(ip); - } - - public ScpClientUtil(String ip, int port, String username, String password) { - this.ip = ip; - this.port = port; - this.username = username; - this.password = password; - } - - public void getFile(String remoteFile, String localTargetDirectory) { - Connection conn = new Connection(ip, port); - try { - conn.connect(); - boolean isAuthenticated = conn.authenticateWithPassword(username, password); - if (!isAuthenticated) { - System.err.println("authentication failed"); - } - SCPClient client = new SCPClient(conn); - client.get(remoteFile, localTargetDirectory); - } catch (IOException ex) { - Logger.getLogger(SCPClient.class.getName()).log(Level.SEVERE, null, ex); - }finally{ - conn.close(); - } - } - - public void putFile(String localFile, String remoteTargetDirectory) { - putFile(localFile, null, remoteTargetDirectory); - } - - public void putFile(String localFile, String remoteFileName, String remoteTargetDirectory) { - putFile(localFile, remoteFileName, remoteTargetDirectory,null); - } - - public void putFile(String localFile, String remoteFileName, String remoteTargetDirectory, String mode) { - Connection conn = new Connection(ip, port); - try { - conn.connect(); - boolean isAuthenticated = conn.authenticateWithPassword(username, password); - if (!isAuthenticated) { - System.err.println("authentication failed"); - } - SCPClient client = new SCPClient(conn); - if ((mode == null) || (mode.length() == 0)) { - mode = "0600"; - } - if (remoteFileName == null) { - client.put(localFile, remoteTargetDirectory); - } else { - client.put(localFile, remoteFileName, remoteTargetDirectory, mode); - } - } catch (IOException ex) { - Logger.getLogger(ScpClientUtil.class.getName()).log(Level.SEVERE, null, ex); - }finally{ - conn.close(); - } - } - - private String ip; - private int port; - private String username; - private String password; - - -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/mnt/util/SqlUtils.java b/wjcy-system/src/main/java/me/zhengjie/modules/mnt/util/SqlUtils.java deleted file mode 100644 index d7e06b1..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/mnt/util/SqlUtils.java +++ /dev/null @@ -1,201 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.mnt.util; - -import com.alibaba.druid.pool.DruidDataSource; -import com.alibaba.druid.util.StringUtils; -import com.google.common.collect.Lists; -import lombok.extern.slf4j.Slf4j; -import me.zhengjie.utils.CloseUtil; -import javax.sql.DataSource; -import java.io.BufferedReader; -import java.io.File; -import java.io.FileInputStream; -import java.io.InputStreamReader; -import java.nio.charset.StandardCharsets; -import java.sql.*; -import java.util.List; - -/** - * @author / - */ -@Slf4j -public class SqlUtils { - - /** - * 获取数据源 - * - * @param jdbcUrl / - * @param userName / - * @param password / - * @return DataSource - */ - private static DataSource getDataSource(String jdbcUrl, String userName, String password) { - DruidDataSource druidDataSource = new DruidDataSource(); - String className; - try { - className = DriverManager.getDriver(jdbcUrl.trim()).getClass().getName(); - } catch (SQLException e) { - throw new RuntimeException("Get class name error: =" + jdbcUrl); - } - if (StringUtils.isEmpty(className)) { - DataTypeEnum dataTypeEnum = DataTypeEnum.urlOf(jdbcUrl); - if (null == dataTypeEnum) { - throw new RuntimeException("Not supported data type: jdbcUrl=" + jdbcUrl); - } - druidDataSource.setDriverClassName(dataTypeEnum.getDriver()); - } else { - druidDataSource.setDriverClassName(className); - } - - - druidDataSource.setUrl(jdbcUrl); - druidDataSource.setUsername(userName); - druidDataSource.setPassword(password); - // 配置获取连接等待超时的时间 - druidDataSource.setMaxWait(3000); - // 配置初始化大小、最小、最大 - druidDataSource.setInitialSize(1); - druidDataSource.setMinIdle(1); - druidDataSource.setMaxActive(1); - - // 如果链接出现异常则直接判定为失败而不是一直重试 - druidDataSource.setBreakAfterAcquireFailure(true); - try { - druidDataSource.init(); - } catch (SQLException e) { - log.error("Exception during pool initialization", e); - throw new RuntimeException(e.getMessage()); - } - - return druidDataSource; - } - - private static Connection getConnection(String jdbcUrl, String userName, String password) { - DataSource dataSource = getDataSource(jdbcUrl, userName, password); - Connection connection = null; - try { - connection = dataSource.getConnection(); - } catch (Exception ignored) {} - try { - int timeOut = 5; - if (null == connection || connection.isClosed() || !connection.isValid(timeOut)) { - log.info("connection is closed or invalid, retry get connection!"); - connection = dataSource.getConnection(); - } - } catch (Exception e) { - log.error("create connection error, jdbcUrl: {}", jdbcUrl); - throw new RuntimeException("create connection error, jdbcUrl: " + jdbcUrl); - } finally { - CloseUtil.close(connection); - } - return connection; - } - - private static void releaseConnection(Connection connection) { - if (null != connection) { - try { - connection.close(); - } catch (Exception e) { - log.error(e.getMessage(),e); - log.error("connection close error:" + e.getMessage()); - } - } - } - - public static boolean testConnection(String jdbcUrl, String userName, String password) { - Connection connection = null; - try { - connection = getConnection(jdbcUrl, userName, password); - if (null != connection) { - return true; - } - } catch (Exception e) { - log.info("Get connection failed:" + e.getMessage()); - } finally { - releaseConnection(connection); - } - return false; - } - - public static String executeFile(String jdbcUrl, String userName, String password, File sqlFile) { - Connection connection = getConnection(jdbcUrl, userName, password); - try { - batchExecute(connection, readSqlList(sqlFile)); - } catch (Exception e) { - log.error("sql脚本执行发生异常:{}",e.getMessage()); - return e.getMessage(); - }finally { - releaseConnection(connection); - } - return "success"; - } - - - /** - * 批量执行sql - * @param connection / - * @param sqlList / - */ - public static void batchExecute(Connection connection, List sqlList) { - Statement st = null; - try { - st = connection.createStatement(); - for (String sql : sqlList) { - if (sql.endsWith(";")) { - sql = sql.substring(0, sql.length() - 1); - } - st.addBatch(sql); - } - st.executeBatch(); - } catch (SQLException throwables) { - throwables.printStackTrace(); - } finally { - CloseUtil.close(st); - } - } - - /** - * 将文件中的sql语句以;为单位读取到列表中 - * @param sqlFile / - * @return / - * @throws Exception e - */ - private static List readSqlList(File sqlFile) throws Exception { - List sqlList = Lists.newArrayList(); - StringBuilder sb = new StringBuilder(); - try (BufferedReader reader = new BufferedReader(new InputStreamReader( - new FileInputStream(sqlFile), StandardCharsets.UTF_8))) { - String tmp; - while ((tmp = reader.readLine()) != null) { - log.info("line:{}", tmp); - if (tmp.endsWith(";")) { - sb.append(tmp); - sqlList.add(sb.toString()); - sb.delete(0, sb.length()); - } else { - sb.append(tmp); - } - } - if (!"".endsWith(sb.toString().trim())) { - sqlList.add(sb.toString()); - } - } - - return sqlList; - } - -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/mnt/websocket/MsgType.java b/wjcy-system/src/main/java/me/zhengjie/modules/mnt/websocket/MsgType.java deleted file mode 100644 index 2fc473d..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/mnt/websocket/MsgType.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.mnt.websocket; - -/** - * @author ZhangHouYing - * @date 2019-08-10 9:56 - */ -public enum MsgType { - /** 连接 */ - CONNECT, - /** 关闭 */ - CLOSE, - /** 信息 */ - INFO, - /** 错误 */ - ERROR -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/mnt/websocket/SocketMsg.java b/wjcy-system/src/main/java/me/zhengjie/modules/mnt/websocket/SocketMsg.java deleted file mode 100644 index ade33a2..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/mnt/websocket/SocketMsg.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.mnt.websocket; - -import lombok.Data; - -/** - * @author ZhangHouYing - * @date 2019-08-10 9:55 - */ -@Data -public class SocketMsg { - private String msg; - private MsgType msgType; - - public SocketMsg(String msg, MsgType msgType) { - this.msg = msg; - this.msgType = msgType; - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/mnt/websocket/WebSocketServer.java b/wjcy-system/src/main/java/me/zhengjie/modules/mnt/websocket/WebSocketServer.java deleted file mode 100644 index 9c92165..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/mnt/websocket/WebSocketServer.java +++ /dev/null @@ -1,139 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.mnt.websocket; - -import com.alibaba.fastjson.JSONObject; -import lombok.extern.slf4j.Slf4j; -import org.springframework.stereotype.Component; - -import javax.websocket.*; -import javax.websocket.server.PathParam; -import javax.websocket.server.ServerEndpoint; -import java.io.IOException; -import java.util.Objects; -import java.util.concurrent.CopyOnWriteArraySet; -/** - * @author ZhangHouYing - * @date 2019-08-10 15:46 - */ -@ServerEndpoint("/webSocket/{sid}") -@Slf4j -@Component -public class WebSocketServer { - - /** - * concurrent包的线程安全Set,用来存放每个客户端对应的MyWebSocket对象。 - */ - private static CopyOnWriteArraySet webSocketSet = new CopyOnWriteArraySet(); - - /** - * 与某个客户端的连接会话,需要通过它来给客户端发送数据 - */ - private Session session; - - /** - * 接收sid - */ - private String sid=""; - /** - * 连接建立成功调用的方法 - * */ - @OnOpen - public void onOpen(Session session,@PathParam("sid") String sid) { - this.session = session; - //如果存在就先删除一个,防止重复推送消息 - for (WebSocketServer webSocket:webSocketSet) { - if (webSocket.sid.equals(sid)) { - webSocketSet.remove(webSocket); - } - } - webSocketSet.add(this); - this.sid=sid; - } - - /** - * 连接关闭调用的方法 - */ - @OnClose - public void onClose() { - webSocketSet.remove(this); - } - - /** - * 收到客户端消息后调用的方法 - * @param message 客户端发送过来的消息*/ - @OnMessage - public void onMessage(String message, Session session) { - log.info("收到来"+sid+"的信息:"+message); - //群发消息 - for (WebSocketServer item : webSocketSet) { - try { - item.sendMessage(message); - } catch (IOException e) { - log.error(e.getMessage(),e); - } - } - } - - @OnError - public void onError(Session session, Throwable error) { - log.error("发生错误"); - error.printStackTrace(); - } - /** - * 实现服务器主动推送 - */ - private void sendMessage(String message) throws IOException { - this.session.getBasicRemote().sendText(message); - } - - - /** - * 群发自定义消息 - * */ - public static void sendInfo(SocketMsg socketMsg,@PathParam("sid") String sid) throws IOException { - String message = JSONObject.toJSONString(socketMsg); - log.info("推送消息到"+sid+",推送内容:"+message); - for (WebSocketServer item : webSocketSet) { - try { - //这里可以设定只推送给这个sid的,为null则全部推送 - if(sid==null) { - item.sendMessage(message); - }else if(item.sid.equals(sid)){ - item.sendMessage(message); - } - } catch (IOException ignored) { } - } - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - WebSocketServer that = (WebSocketServer) o; - return Objects.equals(session, that.session) && - Objects.equals(sid, that.sid); - } - - @Override - public int hashCode() { - return Objects.hash(session, sid); - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/quartz/config/JobRunner.java b/wjcy-system/src/main/java/me/zhengjie/modules/quartz/config/JobRunner.java deleted file mode 100644 index 9b903e9..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/quartz/config/JobRunner.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.quartz.config; - -import cn.hutool.json.JSONUtil; -import lombok.RequiredArgsConstructor; -import me.zhengjie.modules.quartz.domain.QuartzJob; -import me.zhengjie.modules.quartz.repository.QuartzJobRepository; -import me.zhengjie.modules.quartz.utils.QuartzManage; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.boot.ApplicationArguments; -import org.springframework.boot.ApplicationRunner; -import org.springframework.stereotype.Component; - -import java.util.List; - -/** - * @author Zheng Jie - * @date 2019-01-07 - */ -@Component -@RequiredArgsConstructor -public class JobRunner implements ApplicationRunner { - private static final Logger log = LoggerFactory.getLogger(JobRunner.class); - private final QuartzJobRepository quartzJobRepository; - private final QuartzManage quartzManage; - - /** - * 项目启动时重新激活启用的定时任务 - * - * @param applicationArguments / - */ - @Override - public void run(ApplicationArguments applicationArguments) { - log.info("--------------------注入定时任务---------------------"); - List quartzJobs = quartzJobRepository.findByIsPauseIsFalse(); - quartzJobs.forEach(quartzManage::addJob); - log.info("--------------------定时任务注入完成---------------------"); - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/quartz/config/QuartzConfig.java b/wjcy-system/src/main/java/me/zhengjie/modules/quartz/config/QuartzConfig.java deleted file mode 100644 index 99f2e50..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/quartz/config/QuartzConfig.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.quartz.config; - -import org.quartz.spi.TriggerFiredBundle; -import org.springframework.beans.factory.config.AutowireCapableBeanFactory; -import org.springframework.context.annotation.Configuration; -import org.springframework.scheduling.quartz.AdaptableJobFactory; -import org.springframework.stereotype.Component; - -/** - * 定时任务配置 - * @author / - * @date 2019-01-07 - */ -@Configuration -public class QuartzConfig { - - /** - * 解决Job中注入Spring Bean为null的问题 - */ - @Component("quartzJobFactory") - public static class QuartzJobFactory extends AdaptableJobFactory { - - private final AutowireCapableBeanFactory capableBeanFactory; - - public QuartzJobFactory(AutowireCapableBeanFactory capableBeanFactory) { - this.capableBeanFactory = capableBeanFactory; - } - - @Override - protected Object createJobInstance(TriggerFiredBundle bundle) throws Exception { - //调用父类的方法,把Job注入到spring中 - Object jobInstance = super.createJobInstance(bundle); - capableBeanFactory.autowireBean(jobInstance); - return jobInstance; - } - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/quartz/domain/QuartzJob.java b/wjcy-system/src/main/java/me/zhengjie/modules/quartz/domain/QuartzJob.java deleted file mode 100644 index d4048fc..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/quartz/domain/QuartzJob.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.quartz.domain; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Getter; -import lombok.Setter; -import me.zhengjie.annotation.Query; -import me.zhengjie.base.BaseEntity; -import javax.persistence.*; -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; -import java.io.Serializable; - -/** - * @author Zheng Jie - * @date 2019-01-07 - */ -@Getter -@Setter -@Entity -@Table(name = "sys_quartz_job") -public class QuartzJob extends BaseEntity implements Serializable { - - public static final String JOB_KEY = "JOB_KEY"; - - @Id - @Column(name = "job_id") - @NotNull(groups = {Update.class}) - @GeneratedValue(strategy = GenerationType.IDENTITY) - private Long id; - - /** 任务编号 -雪花算法生成 */ - private Long taskNum; - - @ApiModelProperty(value = "类型 1.普通 2.影刀") - private Integer type = 1; - - @Transient - @ApiModelProperty(value = "用于子任务唯一标识", hidden = true) - private String uuid; - - @ApiModelProperty(value = "定时器名称") - private String jobName; - - @NotBlank - @ApiModelProperty(value = "Bean名称") - private String beanName; - - @NotBlank - @ApiModelProperty(value = "方法名称") - private String methodName; - - @ApiModelProperty(value = "参数") - private String params; - - @NotBlank - @ApiModelProperty(value = "cron表达式") - private String cronExpression; - - @ApiModelProperty(value = "状态,暂时或启动") - private Boolean isPause = false; - - @ApiModelProperty(value = "负责人") - private String personInCharge; - - @ApiModelProperty(value = "报警邮箱") - private String email; - - @ApiModelProperty(value = "子任务") - private String subTask; - - @ApiModelProperty(value = "失败后暂停") - private Boolean pauseAfterFailure; - - @NotBlank - @ApiModelProperty(value = "备注") - private String description; -} \ No newline at end of file diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/quartz/domain/QuartzLog.java b/wjcy-system/src/main/java/me/zhengjie/modules/quartz/domain/QuartzLog.java deleted file mode 100644 index 4dc510b..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/quartz/domain/QuartzLog.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.quartz.domain; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import org.hibernate.annotations.CreationTimestamp; -import javax.persistence.*; -import java.io.Serializable; -import java.sql.Timestamp; - -/** - * @author Zheng Jie - * @date 2019-01-07 - */ -@Entity -@Data -@Table(name = "sys_quartz_log") -public class QuartzLog implements Serializable { - - @Id - @Column(name = "log_id") - @ApiModelProperty(value = "ID", hidden = true) - @GeneratedValue(strategy = GenerationType.IDENTITY) - private Long id; - - @ApiModelProperty(value = "任务名称", hidden = true) - private String jobName; - - @ApiModelProperty(value = "类型 1.普通 2.影刀") - private Integer type = 1; - - @ApiModelProperty(value = "bean名称", hidden = true) - private String beanName; - - @ApiModelProperty(value = "方法名称", hidden = true) - private String methodName; - - @ApiModelProperty(value = "参数", hidden = true) - private String params; - - @ApiModelProperty(value = "cron表达式", hidden = true) - private String cronExpression; - - @ApiModelProperty(value = "状态", hidden = true) - private Boolean isSuccess; - - @ApiModelProperty(value = "异常详情", hidden = true) - private String exceptionDetail; - - @ApiModelProperty(value = "执行耗时", hidden = true) - private Long time; - - @CreationTimestamp - @ApiModelProperty(value = "创建时间", hidden = true) - private Timestamp createTime; -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/quartz/repository/QuartzJobRepository.java b/wjcy-system/src/main/java/me/zhengjie/modules/quartz/repository/QuartzJobRepository.java deleted file mode 100644 index 79b222b..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/quartz/repository/QuartzJobRepository.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.quartz.repository; - -import me.zhengjie.modules.quartz.domain.QuartzJob; -import org.springframework.data.jpa.repository.JpaRepository; -import org.springframework.data.jpa.repository.JpaSpecificationExecutor; -import java.util.List; - -/** - * @author Zheng Jie - * @date 2019-01-07 - */ -public interface QuartzJobRepository extends JpaRepository, JpaSpecificationExecutor { - - /** - * 查询启用的任务 - * @return List - */ - List findByIsPauseIsFalse(); -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/quartz/repository/QuartzLogRepository.java b/wjcy-system/src/main/java/me/zhengjie/modules/quartz/repository/QuartzLogRepository.java deleted file mode 100644 index db724aa..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/quartz/repository/QuartzLogRepository.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.quartz.repository; - -import me.zhengjie.modules.quartz.domain.QuartzLog; -import org.springframework.data.jpa.repository.JpaRepository; -import org.springframework.data.jpa.repository.JpaSpecificationExecutor; - -/** - * @author Zheng Jie - * @date 2019-01-07 - */ -public interface QuartzLogRepository extends JpaRepository, JpaSpecificationExecutor { - -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/quartz/rest/QuartzJobController.java b/wjcy-system/src/main/java/me/zhengjie/modules/quartz/rest/QuartzJobController.java deleted file mode 100644 index 7a4a3db..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/quartz/rest/QuartzJobController.java +++ /dev/null @@ -1,127 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.quartz.rest; - -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import me.zhengjie.annotation.AnonymousAccess; -import me.zhengjie.annotation.Log; -import me.zhengjie.exception.BadRequestException; -import me.zhengjie.modules.quartz.domain.QuartzJob; -import me.zhengjie.modules.quartz.service.QuartzJobService; -import me.zhengjie.modules.quartz.service.dto.JobQueryCriteria; -import org.springframework.data.domain.Pageable; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.Set; - -/** - * @author Zheng Jie - * @date 2019-01-07 - */ -@Slf4j -@RestController -@RequiredArgsConstructor -@RequestMapping("/api/jobs") -@Api(tags = "系统:定时任务管理") -public class QuartzJobController { - - private static final String ENTITY_NAME = "quartzJob"; - private final QuartzJobService quartzJobService; - - @ApiOperation("查询定时任务") - @GetMapping - @PreAuthorize("@el.check('timing:list')") - public ResponseEntity query(JobQueryCriteria criteria, Pageable pageable){ - return new ResponseEntity<>(quartzJobService.queryAll(criteria,pageable), HttpStatus.OK); - } - - @ApiOperation("导出任务数据") - @GetMapping(value = "/download") - @PreAuthorize("@el.check('timing:list')") - public void download(HttpServletResponse response, JobQueryCriteria criteria) throws IOException { - quartzJobService.download(quartzJobService.queryAll(criteria), response); - } - - @ApiOperation("导出日志数据") - @GetMapping(value = "/logs/download") - @PreAuthorize("@el.check('timing:list')") - public void downloadLog(HttpServletResponse response, JobQueryCriteria criteria) throws IOException { - quartzJobService.downloadLog(quartzJobService.queryAllLog(criteria), response); - } - - @ApiOperation("查询任务执行日志") - @GetMapping(value = "/logs") - @PreAuthorize("@el.check('timing:list')") - public ResponseEntity queryJobLog(JobQueryCriteria criteria, Pageable pageable){ - return new ResponseEntity<>(quartzJobService.queryAllLog(criteria,pageable), HttpStatus.OK); - } - - @Log("新增定时任务") - @ApiOperation("新增定时任务") - @PostMapping - @PreAuthorize("@el.check('timing:add')") - public ResponseEntity create(@Validated @RequestBody QuartzJob resources){ - if (resources.getId() != null) { - throw new BadRequestException("A new "+ ENTITY_NAME +" cannot already have an ID"); - } - quartzJobService.create(resources); - return new ResponseEntity<>(HttpStatus.CREATED); - } - - @Log("修改定时任务") - @ApiOperation("修改定时任务") - @PutMapping - @PreAuthorize("@el.check('timing:edit')") - public ResponseEntity update(@Validated(QuartzJob.Update.class) @RequestBody QuartzJob resources){ - quartzJobService.update(resources); - return new ResponseEntity<>(HttpStatus.NO_CONTENT); - } - - @Log("更改定时任务状态") - @ApiOperation("更改定时任务状态") - @PutMapping(value = "/{id}") - @PreAuthorize("@el.check('timing:edit')") - public ResponseEntity update(@PathVariable Long id){ - quartzJobService.updateIsPause(quartzJobService.findById(id)); - return new ResponseEntity<>(HttpStatus.NO_CONTENT); - } - - @Log("执行定时任务") - @ApiOperation("执行定时任务") - @PutMapping(value = "/exec/{id}") - @PreAuthorize("@el.check('timing:edit')") - public ResponseEntity execution(@PathVariable Long id){ - quartzJobService.execution(quartzJobService.findById(id)); - return new ResponseEntity<>(HttpStatus.NO_CONTENT); - } - - @Log("删除定时任务") - @ApiOperation("删除定时任务") - @DeleteMapping - @PreAuthorize("@el.check('timing:del')") - public ResponseEntity delete(@RequestBody Set ids){ - quartzJobService.delete(ids); - return new ResponseEntity<>(HttpStatus.OK); - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/quartz/service/QuartzJobService.java b/wjcy-system/src/main/java/me/zhengjie/modules/quartz/service/QuartzJobService.java deleted file mode 100644 index 7be008e..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/quartz/service/QuartzJobService.java +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.quartz.service; - -import me.zhengjie.modules.quartz.domain.QuartzJob; -import me.zhengjie.modules.quartz.domain.QuartzLog; -import me.zhengjie.modules.quartz.service.dto.JobQueryCriteria; -import org.springframework.data.domain.Pageable; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.List; -import java.util.Set; - -/** - * @author Zheng Jie - * @date 2019-01-07 - */ -public interface QuartzJobService { - - /** - * 分页查询 - * @param criteria 条件 - * @param pageable 分页参数 - * @return / - */ - Object queryAll(JobQueryCriteria criteria, Pageable pageable); - - /** - * 查询全部 - * @param criteria 条件 - * @return / - */ - List queryAll(JobQueryCriteria criteria); - - /** - * 查询全部 - * @return / - */ - void delAllLog(); - - /** - * 分页查询日志 - * @param criteria 条件 - * @param pageable 分页参数 - * @return / - */ - Object queryAllLog(JobQueryCriteria criteria, Pageable pageable); - - /** - * 查询全部 - * @param criteria 条件 - * @return / - */ - List queryAllLog(JobQueryCriteria criteria); - - /** - * 创建 - * @param resources / - */ - void create(QuartzJob resources); - - /** - * 编辑 - * @param resources / - */ - void update(QuartzJob resources); - - /** - * 删除任务 - * @param ids / - */ - void delete(Set ids); - - /** - * 根据ID查询 - * @param id ID - * @return / - */ - QuartzJob findById(Long id); - - /** - * 更改定时任务状态 - * @param quartzJob / - */ - void updateIsPause(QuartzJob quartzJob); - - /** - * 立即执行定时任务 - * @param quartzJob / - */ - void execution(QuartzJob quartzJob); - - /** - * 导出定时任务 - * @param queryAll 待导出的数据 - * @param response / - * @throws IOException / - */ - void download(List queryAll, HttpServletResponse response) throws IOException; - - /** - * 导出定时任务日志 - * @param queryAllLog 待导出的数据 - * @param response / - * @throws IOException / - */ - void downloadLog(List queryAllLog, HttpServletResponse response) throws IOException; - - /** - * 执行子任务 - * @param tasks / - * @throws InterruptedException / - */ - void executionSubJob(String[] tasks) throws InterruptedException; -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/quartz/service/SysQuartzJobService.java b/wjcy-system/src/main/java/me/zhengjie/modules/quartz/service/SysQuartzJobService.java deleted file mode 100644 index d2a58f1..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/quartz/service/SysQuartzJobService.java +++ /dev/null @@ -1,77 +0,0 @@ -package me.zhengjie.modules.quartz.service; - -import com.baomidou.mybatisplus.core.conditions.Wrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.service.IService; -import me.zhengjie.dto.Dto; -import me.zhengjie.entity.SysQuartzJob; -import me.zhengjie.modules.group.dto.SysQuartzJobAddDTO; -import me.zhengjie.modules.group.dto.SysQuartzJobUpdateDTO; -import me.zhengjie.service.vo.SysQuartzJobListVO; -import me.zhengjie.utils.PageUtils; - -/** - * 定时任务(SysQuartzJob)表服务接口 - * - * @author zhw - * @since 2022-07-21 - */ -public interface SysQuartzJobService extends IService { - - PageUtils searchPageList(IPage page, Wrapper wrapper); - - /** - * 根据任务id修改任务运行状态 - * @param jobId - * @return boolean - */ - Boolean modifyJobStatus(Long jobId); - - /** - * 根据任务id修改任务信息 - * @param dto - * @return boolean - */ - Dto updateQuartzJobById(SysQuartzJobUpdateDTO dto); - - /** - * 根据任务id删除影刀任务 - * @param id - * @return boolean - */ - Boolean deleteQuartzJobById(Long id); - - /** - * 重新新建任务-为了任务失败做的 - * @param sysQuartzJob - * @return - */ - public Boolean reAddQuartzJob(SysQuartzJob sysQuartzJob); - - /** - * 新增影刀任务信息 - * @param dto - * @return boolean - */ - Dto addQuartzJob(SysQuartzJobAddDTO dto); - - /** - * 执行影刀任务信息 - * @param id - * @return boolean - */ - Boolean executionById(Long id); - - /** - * 根据刷单item拼装参数 - */ - String assemblyParamAccordingToItem(String params, String taskName, Long taskNum); - - /** - * 更加任务编号获取任务信息 - * @param taskNum - * @return - */ - SysQuartzJob getByTaskNum(String taskNum); -} - diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/quartz/service/dto/JobQueryCriteria.java b/wjcy-system/src/main/java/me/zhengjie/modules/quartz/service/dto/JobQueryCriteria.java deleted file mode 100644 index 89d8070..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/quartz/service/dto/JobQueryCriteria.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.quartz.service.dto; - -import lombok.Data; -import me.zhengjie.annotation.Query; -import java.sql.Timestamp; -import java.util.List; - -/** - * @author Zheng Jie - * @date 2019-6-4 10:33:02 - */ -@Data -public class JobQueryCriteria { - - @Query(type = Query.Type.INNER_LIKE) - private String jobName; - - @Query - private Boolean isSuccess; - - @Query - private Integer type = 1; - - @Query(type = Query.Type.BETWEEN) - private List createTime; -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/quartz/service/impl/QuartzJobServiceImpl.java b/wjcy-system/src/main/java/me/zhengjie/modules/quartz/service/impl/QuartzJobServiceImpl.java deleted file mode 100644 index 35c6070..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/quartz/service/impl/QuartzJobServiceImpl.java +++ /dev/null @@ -1,205 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.quartz.service.impl; - -import cn.hutool.core.lang.Snowflake; -import cn.hutool.core.util.IdUtil; -import cn.hutool.core.util.StrUtil; -import lombok.RequiredArgsConstructor; -import me.zhengjie.exception.BadRequestException; -import me.zhengjie.modules.quartz.domain.QuartzJob; -import me.zhengjie.modules.quartz.domain.QuartzLog; -import me.zhengjie.modules.quartz.repository.QuartzJobRepository; -import me.zhengjie.modules.quartz.repository.QuartzLogRepository; -import me.zhengjie.modules.quartz.service.QuartzJobService; -import me.zhengjie.modules.quartz.service.dto.JobQueryCriteria; -import me.zhengjie.modules.quartz.utils.QuartzManage; -import me.zhengjie.utils.*; -import org.quartz.CronExpression; -import org.springframework.data.domain.Pageable; -import org.springframework.scheduling.annotation.Async; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.*; - -/** - * @author Zheng Jie - * @date 2019-01-07 - */ -@RequiredArgsConstructor -@Service(value = "quartzJobService") -public class QuartzJobServiceImpl implements QuartzJobService { - - private final QuartzJobRepository quartzJobRepository; - private final QuartzLogRepository quartzLogRepository; - private final QuartzManage quartzManage; - private final RedisUtils redisUtils; - private final Snowflake snowflake; - - @Override - public Object queryAll(JobQueryCriteria criteria, Pageable pageable){ - return PageUtil.toPage(quartzJobRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable)); - } - - @Override - public Object queryAllLog(JobQueryCriteria criteria, Pageable pageable){ - return PageUtil.toPage(quartzLogRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable)); - } - - @Override - public List queryAll(JobQueryCriteria criteria) { - return quartzJobRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder)); - } - - @Override - public void delAllLog() { - quartzLogRepository.deleteAll(); - } - - @Override - public List queryAllLog(JobQueryCriteria criteria) { - return quartzLogRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder)); - } - - @Override - public QuartzJob findById(Long id) { - QuartzJob quartzJob = quartzJobRepository.findById(id).orElseGet(QuartzJob::new); - ValidationUtil.isNull(quartzJob.getId(),"QuartzJob","id",id); - return quartzJob; - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void create(QuartzJob resources) { - if (!CronExpression.isValidExpression(resources.getCronExpression())){ - throw new BadRequestException("cron表达式格式错误"); - } - resources.setTaskNum(snowflake.nextId()); - resources = quartzJobRepository.save(resources); - quartzManage.addJob(resources); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void update(QuartzJob resources) { - if (!CronExpression.isValidExpression(resources.getCronExpression())){ - throw new BadRequestException("cron表达式格式错误"); - } - if(StringUtils.isNotBlank(resources.getSubTask())){ - List tasks = Arrays.asList(resources.getSubTask().split("[,,]")); - if (tasks.contains(resources.getId().toString())) { - throw new BadRequestException("子任务中不能添加当前任务ID"); - } - } - resources = quartzJobRepository.save(resources); - quartzManage.updateJobCron(resources); - } - - @Override - public void updateIsPause(QuartzJob quartzJob) { - if (quartzJob.getIsPause()) { - quartzManage.resumeJob(quartzJob); - quartzJob.setIsPause(false); - } else { - quartzManage.pauseJob(quartzJob); - quartzJob.setIsPause(true); - } - quartzJobRepository.save(quartzJob); - } - - @Override - public void execution(QuartzJob quartzJob) { - quartzManage.runJobNow(quartzJob); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void delete(Set ids) { - for (Long id : ids) { - QuartzJob quartzJob = findById(id); - quartzManage.deleteJob(quartzJob); - quartzJobRepository.delete(quartzJob); - } - } - - @Async - @Override - @Transactional(rollbackFor = Exception.class) - public void executionSubJob(String[] tasks) throws InterruptedException { - for (String id : tasks) { - if (StrUtil.isBlank(id)) { - // 如果是手动清除子任务id,会出现id为空字符串的问题 - continue; - } - QuartzJob quartzJob = findById(Long.parseLong(id)); - // 执行任务 - String uuid = IdUtil.simpleUUID(); - quartzJob.setUuid(uuid); - // 执行任务 - execution(quartzJob); - // 获取执行状态,如果执行失败则停止后面的子任务执行 - Boolean result = (Boolean) redisUtils.get(uuid); - while (result == null) { - // 休眠5秒,再次获取子任务执行情况 - Thread.sleep(5000); - result = (Boolean) redisUtils.get(uuid); - } - if(!result){ - redisUtils.del(uuid); - break; - } - } - } - - @Override - public void download(List quartzJobs, HttpServletResponse response) throws IOException { - List> list = new ArrayList<>(); - for (QuartzJob quartzJob : quartzJobs) { - Map map = new LinkedHashMap<>(); - map.put("任务名称", quartzJob.getJobName()); - map.put("Bean名称", quartzJob.getBeanName()); - map.put("执行方法", quartzJob.getMethodName()); - map.put("参数", quartzJob.getParams()); - map.put("表达式", quartzJob.getCronExpression()); - map.put("状态", quartzJob.getIsPause() ? "暂停中" : "运行中"); - map.put("描述", quartzJob.getDescription()); - map.put("创建日期", quartzJob.getCreateTime()); - list.add(map); - } - FileUtil.downloadExcel(list, response); - } - - @Override - public void downloadLog(List queryAllLog, HttpServletResponse response) throws IOException { - List> list = new ArrayList<>(); - for (QuartzLog quartzLog : queryAllLog) { - Map map = new LinkedHashMap<>(); - map.put("任务名称", quartzLog.getJobName()); - map.put("Bean名称", quartzLog.getBeanName()); - map.put("执行方法", quartzLog.getMethodName()); - map.put("参数", quartzLog.getParams()); - map.put("表达式", quartzLog.getCronExpression()); - map.put("异常详情", quartzLog.getExceptionDetail()); - map.put("耗时/毫秒", quartzLog.getTime()); - map.put("状态", quartzLog.getIsSuccess() ? "成功" : "失败"); - map.put("创建日期", quartzLog.getCreateTime()); - list.add(map); - } - FileUtil.downloadExcel(list, response); - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/quartz/service/impl/SysQuartzJobServiceImpl.java b/wjcy-system/src/main/java/me/zhengjie/modules/quartz/service/impl/SysQuartzJobServiceImpl.java deleted file mode 100644 index 45b09bd..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/quartz/service/impl/SysQuartzJobServiceImpl.java +++ /dev/null @@ -1,521 +0,0 @@ -package me.zhengjie.modules.quartz.service.impl; - -import cn.hutool.core.bean.BeanUtil; -import cn.hutool.core.date.DateUtil; -import cn.hutool.core.util.ObjectUtil; -import cn.hutool.json.JSONUtil; -import com.baomidou.mybatisplus.core.conditions.Wrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import lombok.RequiredArgsConstructor; -import me.zhengjie.config.SystemConfig; -import me.zhengjie.dao.SysQuartzJobDao; -import me.zhengjie.dto.Dto; -import me.zhengjie.entity.*; -import me.zhengjie.entity.quartz.Boss; -import me.zhengjie.entity.quartz.Param; -import me.zhengjie.entity.quartz.Params; -import me.zhengjie.enums.*; -import me.zhengjie.error.ErrorCodeEnum; -import me.zhengjie.exception.BadRequestException; -import me.zhengjie.modules.group.dto.SysQuartzJobAddDTO; -import me.zhengjie.modules.group.dto.SysQuartzJobUpdateDTO; -import me.zhengjie.modules.quartz.domain.QuartzJob; -import me.zhengjie.modules.quartz.service.QuartzJobService; -import me.zhengjie.modules.quartz.service.SysQuartzJobService; -import me.zhengjie.modules.quartz.utils.QuartzManage; -import me.zhengjie.service.*; -import me.zhengjie.service.vo.CtBrowseDetailVO; -import me.zhengjie.service.vo.SysQuartzJobListVO; -import me.zhengjie.service.vo.dhaddcar.DhAddCarListVO; -import me.zhengjie.service.vo.dhaddcar.DhAddCarYdParamsVO; -import me.zhengjie.service.vo.dhcargood.DhCarGoodKeyVO; -import me.zhengjie.service.vo.dhcargood.DhCarGoodLinkVO; -import me.zhengjie.service.vo.dhcarorder.DhCarOrderParamsVO; -import me.zhengjie.utils.PageUtils; -import me.zhengjie.utils.StringUtils; -import org.quartz.CronExpression; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - -/** - * 定时任务(SysQuartzJob)表服务实现类 - * - * @author rch - * @since 2022-07-20 - */ -@Service -@RequiredArgsConstructor -public class SysQuartzJobServiceImpl extends ServiceImpl implements SysQuartzJobService { - - @Resource - private SysQuartzJobDao sysQuartzJobDao; - @Resource - private QuartzJobService quartzJobService; - @Resource - private CtApplyService ctApplyService; - @Resource - private CtClickFarmingService ctClickFarmingService; - @Resource - private DhAddCarService dhAddCarService; - @Resource - private DhAddCarOrderService dhAddCarOrderService; - @Resource - private CtClickOrderService ctClickOrderService; - @Resource - private CtBrowseService ctBrowseService; - private final QuartzManage quartzManage; - - @Override - public PageUtils searchPageList(IPage page, Wrapper wrapper) { - sysQuartzJobDao.searchPageList(page, wrapper); - return new PageUtils(page.getTotal(), page.getRecords()); - } - - @Override - public Boolean modifyJobStatus(Long jobId) { - SysQuartzJob sysQuartzJobIsExist = getById(jobId); - if (sysQuartzJobIsExist == null) { - return false; - } else { - QuartzJob quartzJob = new QuartzJob(); - BeanUtil.copyProperties(sysQuartzJobIsExist, quartzJob); - quartzJob.setId(sysQuartzJobIsExist.getJobId()); - - quartzJob.setType(TaskTypeEnum.SHADOW_KNIFE.value()); - SysQuartzJob updateSysQuartzJob = new SysQuartzJob(); - updateSysQuartzJob.setJobId(jobId); - - if (sysQuartzJobIsExist.getIsPause() == 1) { - quartzManage.resumeJob(quartzJob); - updateSysQuartzJob.setIsPause(0); - } else { - quartzManage.pauseJob(quartzJob); - updateSysQuartzJob.setIsPause(1); - } - return updateById(updateSysQuartzJob); - } - } - - @Override - public Dto updateQuartzJobById(SysQuartzJobUpdateDTO dto) { - SysQuartzJob sysQuartzJob = getById(dto.getJobId()); - if (sysQuartzJob == null) { - return Dto.getInstance(ErrorCodeEnum.ERROR_NOT_FIND_JOB); - } - if (!CronExpression.isValidExpression(dto.getCronExpression())) { - //hrow new BadRequestException("cron表达式格式错误"); - return Dto.returnErrorResult("cron表达式格式错误"); - } - if (StringUtils.isNotBlank(dto.getSubTask())) { - List tasks = Arrays.asList(dto.getSubTask().split("[,,]")); - if (tasks.contains(dto.getJobId().toString())) { - //throw new BadRequestException("子任务中不能添加当前任务ID"); - return Dto.returnErrorResult("子任务中不能添加当前任务ID"); - } - } - SysQuartzJob updateSysQuartzJob = new SysQuartzJob(); - - updateSysQuartzJob.setJobId(dto.getJobId()); - BeanUtil.copyProperties(dto, updateSysQuartzJob); - CtApply ctApply = ctApplyService.getById(dto.getApplyId()); - updateSysQuartzJob.setBeanName(ctApply.getTaskName()); - updateSysQuartzJob.setMethodName(ctApply.getMethodName()); - updateSysQuartzJob.setUpdateTime(DateUtil.now()); - - - QuartzJob quartzJob = new QuartzJob(); - BeanUtil.copyProperties(updateSysQuartzJob, quartzJob); - quartzJob.setId(dto.getJobId()); - quartzJob.setType(TaskTypeEnum.SHADOW_KNIFE.value()); - - quartzManage.updateJobCron(quartzJob); - return Dto.returnResult(updateById(updateSysQuartzJob)); - } - - - @Override - public Boolean deleteQuartzJobById(Long id) { - QuartzJob quartzJob = quartzJobService.findById(id); - quartzManage.deleteJob(quartzJob); - return removeById(id); - } - - @Override - public Dto addQuartzJob(SysQuartzJobAddDTO dto) { - if (!CronExpression.isValidExpression(dto.getCronExpression())) { - //throw new BadRequestException("cron表达式格式错误"); - return Dto.returnErrorResult("cron表达式格式错误"); - } - SysQuartzJob sysQuartzJob = new SysQuartzJob(); - BeanUtil.copyProperties(dto, sysQuartzJob); - ; - sysQuartzJob.setCreateTime(DateUtil.now()); - sysQuartzJob.setType(TaskTypeEnum.SHADOW_KNIFE.value()); - CtApply ctApply = ctApplyService.getById(dto.getApplyId()); - sysQuartzJob.setBeanName(ctApply.getTaskName()); - sysQuartzJob.setMethodName(ctApply.getMethodName()); - - QuartzJob quartzJob = new QuartzJob(); - quartzJob.setType(TaskTypeEnum.SHADOW_KNIFE.value()); - Boolean returnBoolean = save(sysQuartzJob); - if (returnBoolean) { - BeanUtil.copyProperties(sysQuartzJob, quartzJob); - quartzJob.setId(sysQuartzJob.getJobId()); - quartzManage.addJob(quartzJob); - } - //return returnBoolean; - return Dto.returnResult(returnBoolean); - } - - @Override - public Boolean reAddQuartzJob(SysQuartzJob sysQuartzJob) { - if (!CronExpression.isValidExpression(sysQuartzJob.getCronExpression())) { - throw new BadRequestException("cron表达式格式错误"); - } - sysQuartzJob.setCreateTime(DateUtil.now()); - QuartzJob quartzJob = new QuartzJob(); - quartzJob.setType(TaskTypeEnum.SHADOW_KNIFE.value()); - Boolean returnBoolean = save(sysQuartzJob); - if (returnBoolean) { - BeanUtil.copyProperties(sysQuartzJob, quartzJob); - quartzJob.setId(sysQuartzJob.getJobId()); - quartzManage.addJob(quartzJob); - } - return returnBoolean; - } - - @Override - public Boolean executionById(Long id) { - QuartzJob quartzJob = quartzJobService.findById(id); - quartzManage.runJobNow(quartzJob); - return true; - } - - @Override - public String assemblyParamAccordingToItem(String params, String taskName, Long taskNum) { - if (StringUtils.isEmpty(params) || StringUtils.isEmpty(taskName)) { - return null; - } - // 测试的第一个应用 刷单 拼装params - if (TaskInfoEnum.CLICK_FARMING.getTaskName().equals(taskName)) { - // 刷单 - Params paramsObj = JSONUtil.toBean(params, Params.class); - Boss bossObj = JSONUtil.toBean(params, Boss.class); - CtClickFarming ctClickFarming = ctClickFarmingService.getByIdLock(Long.valueOf(paramsObj.getParams())); - if (ObjectUtil.isEmpty(ctClickFarming)) { - return null; - // 状态 1.待执行 2.执行中 3.执行成功 4.执行失败 5.待支付 - } else if (ClickFarmingStatusEnum.IN_EXECUTION.value().equals(ctClickFarming.getStatus()) || ClickFarmingStatusEnum.EXECUTION_SUCCESS.value().equals(ctClickFarming.getStatus())) { - return null; - } else { - // 关联查询 得到对应传值任务参数 不特殊处理统一返回好了,影刀脚本那边自行判断 - CtClickFarmYdParams ctClickFarmYdParams = ctClickFarmingService.getCtClickFarmYdParams(Long.valueOf(paramsObj.getParams())); - if (ObjectUtil.isEmpty(ctClickFarmYdParams)) { - log.error("根据刷单id关联查询相关信息空值异常!!!"); - return null; - } - List paramList = new ArrayList<>(); - Map maps = BeanUtil.beanToMap(ctClickFarmYdParams); - maps.entrySet().removeIf(entry -> entry.getValue() == null); - - for (Map.Entry map : maps.entrySet()) { - Param ydParam = new Param(); - ydParam.setName(map.getKey()); - ydParam.setValue(map.getValue().toString()); - paramList.add(ydParam); - } - - if (ObjectUtil.isNotEmpty(taskNum)) { - Param ydParam = new Param(); - ydParam.setName("taskNum"); - ydParam.setValue(taskNum.toString()); - paramList.add(ydParam); - } - - // 组装Params - bossObj.setParams(paramList); - return JSONUtil.toJsonStr(bossObj); - } - } else if (TaskInfoEnum.DH_ADD_CAR_FARMING.getTaskName().equals(taskName)) { - // 敦煌 加购 - Params paramsObj = JSONUtil.toBean(params, Params.class); - Boss bossObj = JSONUtil.toBean(params, Boss.class); - DhAddCar dhAddCar = dhAddCarService.getByIdLock(Long.valueOf(paramsObj.getParams())); - if (ObjectUtil.isEmpty(dhAddCar)) { - return null; - } else if (!ClickFarmingStatusEnum.TOBE_EXECUTION.value().equals(dhAddCar.getStatus()) && !ClickFarmingStatusEnum.EXECUTION_FAILE.value().equals(dhAddCar.getStatus())) { - return null; - } else { - // 关联查询 得到对应传值任务参数 不特殊处理统一返回好了,影刀脚本那边自行判断 - DhAddCarYdParamsVO dhAddCarYdParamsVO = dhAddCarService.getAddCarYdParams(Long.valueOf(paramsObj.getParams())); - if (ObjectUtil.isEmpty(dhAddCarYdParamsVO)) { - log.error("根据刷单id关联查询相关信息空值异常!!!"); - return null; - } - List paramList = new ArrayList<>(); - Map maps = BeanUtil.beanToMap(dhAddCarYdParamsVO); - maps.entrySet().removeIf(entry -> entry.getValue() == null); - - for (Map.Entry map : maps.entrySet()) { - Param ydParam = new Param(); - String value = null; - // 特殊处理 - if ("carGoodKeys".equals(map.getKey()) || "carGoodLinks".equals(map.getKey())) { - Object carGoodKeysObj = map.getValue(); - value = JSONUtil.parseArray(carGoodKeysObj).toString(); - } else { - value = map.getValue().toString(); - } - - ydParam.setName(map.getKey()); - ydParam.setValue(value); - paramList.add(ydParam); - } - - if (ObjectUtil.isNotEmpty(taskNum)) { - Param ydParam = new Param(); - ydParam.setName("taskNum"); - ydParam.setValue(taskNum.toString()); - paramList.add(ydParam); - } - - // 组装Params - bossObj.setParams(paramList); - return JSONUtil.toJsonStr(bossObj); - } - } else if (TaskInfoEnum.DH_ADD_CAR_CATCH_ORDER.getTaskName().equals(taskName)) { - // 敦煌 - 抓单 - Params paramsObj = JSONUtil.toBean(params, Params.class); - Boss bossObj = JSONUtil.toBean(params, Boss.class); - DhAddCar dhAddCar = dhAddCarService.getByIdLock(Long.valueOf(paramsObj.getParams())); - if (ObjectUtil.isEmpty(dhAddCar)) { - return null; - } else if (!DhAddCarStatusEnum.TO_BE_CATCH_ORDER.value().equals(dhAddCar.getStatus()) && !DhAddCarStatusEnum.CATCH_ORDER_FAILE.value().equals(dhAddCar.getStatus())) { - return null; - } else { - // 关联查询 得到对应传值任务参数 不特殊处理统一返回好了,影刀脚本那边自行判断 - DhAddCarYdParamsVO dhAddCarYdParamsVO = dhAddCarService.getAddCarYdParams(Long.valueOf(paramsObj.getParams())); - if (ObjectUtil.isEmpty(dhAddCarYdParamsVO)) { - log.error("根据刷单id关联查询相关信息空值异常!!!"); - return null; - } - List paramList = new ArrayList<>(); - Map maps = BeanUtil.beanToMap(dhAddCarYdParamsVO); - maps.entrySet().removeIf(entry -> entry.getValue() == null); - - for (Map.Entry map : maps.entrySet()) { - Param ydParam = new Param(); - String value = null; - // 特殊处理 - if ("carGoodKeys".equals(map.getKey()) || "carGoodLinks".equals(map.getKey())) { - Object carGoodKeysObj = map.getValue(); - value = JSONUtil.parseArray(carGoodKeysObj).toString(); - } else { - value = map.getValue().toString(); - } - - ydParam.setName(map.getKey()); - ydParam.setValue(value); - paramList.add(ydParam); - } - - if (ObjectUtil.isNotEmpty(taskNum)) { - Param ydParam = new Param(); - ydParam.setName("taskNum"); - ydParam.setValue(taskNum.toString()); - paramList.add(ydParam); - } - // 组装Params - bossObj.setParams(paramList); - return JSONUtil.toJsonStr(bossObj); - } - } else if (TaskInfoEnum.CLICK_FARMING_SUPPLE_MENY.getTaskName().equals(taskName)) { - // 补录 - Params paramsObj = JSONUtil.toBean(params, Params.class); - Boss bossObj = JSONUtil.toBean(params, Boss.class); - CtClickFarming ctClickFarming = ctClickFarmingService.getByIdLock(Long.valueOf(paramsObj.getParams())); - if (ObjectUtil.isEmpty(ctClickFarming)) { - return null; - // 状态 1.待执行 2.执行中 3.执行成功 4.执行失败 5.待支付 - } else if (ClickFarmingStatusEnum.IN_EXECUTION.value().equals(ctClickFarming.getStatus()) || ClickFarmingStatusEnum.EXECUTION_SUCCESS.value().equals(ctClickFarming.getStatus())) { - return null; - } else { - CtClickFarmYdParams ctClickFarmYdParams = ctClickFarmingService.getCtClickFarmYdParams(Long.valueOf(paramsObj.getParams())); - if (ObjectUtil.isEmpty(ctClickFarmYdParams)) { - log.error("根据刷单id关联查询相关信息空值异常!!!"); - return null; - } - CtClickFarmSupplyMentYdParams ctClickFarmSupplyMentYdParams = new CtClickFarmSupplyMentYdParams(); - BeanUtil.copyProperties(ctClickFarmYdParams, ctClickFarmSupplyMentYdParams); - - List paramList = new ArrayList<>(); - Map maps = BeanUtil.beanToMap(ctClickFarmSupplyMentYdParams); - maps.entrySet().removeIf(entry -> entry.getValue() == null); - for (Map.Entry map : maps.entrySet()) { - Param ydParam = new Param(); - ydParam.setName(map.getKey()); - ydParam.setValue(map.getValue().toString()); - paramList.add(ydParam); - } - - // 组装Params - bossObj.setParams(paramList); - return JSONUtil.toJsonStr(bossObj); - } - } else if (TaskInfoEnum.WELL_RECEIVED.getTaskName().equals(taskName)) { - // 速卖通好评 - Params paramsObj = JSONUtil.toBean(params, Params.class); - Boss bossObj = JSONUtil.toBean(params, Boss.class); - CtClickOrder ctClickOrder = ctClickOrderService.getByIdLock(Long.valueOf(paramsObj.getParams())); - if (ObjectUtil.isEmpty(ctClickOrder)) { - return null; - // 状态 1.待执行 2.执行中 3.执行成功 4.执行失败 5.待支付 - } else if (ClickOrderStatusEnum.IN_EXECUTION.value().equals(ctClickOrder.getStatus()) || ClickFarmingStatusEnum.EXECUTION_SUCCESS.value().equals(ctClickOrder.getStatus())) { - return null; - } else { - CtClickOrderYdParams ctClickOrderYdParams = new CtClickOrderYdParams(); - CtClickFarmingOrderInfo ctClickFarmingOrderInfo = ctClickOrderService.getClickFarmOrderById(Long.valueOf(paramsObj.getParams())); - if (ObjectUtil.isEmpty(ctClickFarmingOrderInfo)) { - log.error("根据刷单id关联查询相关信息空值异常!!!"); - return null; - } - BeanUtil.copyProperties(ctClickFarmingOrderInfo, ctClickOrderYdParams); - String paths = joinPath(ctClickOrderYdParams.getPaths()); - if (ObjectUtil.isNotEmpty(paths)) { - ctClickOrderYdParams.setPaths(paths); - } - List paramList = new ArrayList<>(); - Map maps = BeanUtil.beanToMap(ctClickOrderYdParams); - maps.entrySet().removeIf(entry -> entry.getValue() == null); - - for (Map.Entry map : maps.entrySet()) { - Param ydParam = new Param(); - ydParam.setName(map.getKey()); - ydParam.setValue(map.getValue().toString()); - paramList.add(ydParam); - } - - // 组装Params - bossObj.setParams(paramList); - return JSONUtil.toJsonStr(bossObj); - } - } else if (TaskInfoEnum.DH_WELL_RECEIVED.getTaskName().equals(taskName)) { - // TODO 敦煌好评 - Params paramsObj = JSONUtil.toBean(params, Params.class); - Boss bossObj = JSONUtil.toBean(params, Boss.class); - DhAddCarOrder dhAddCarOrder = dhAddCarOrderService.getByIdLock(Long.valueOf(paramsObj.getParams())); - if (ObjectUtil.isEmpty(dhAddCarOrder)) { - return null; - // 状态 1.抓单成功才允许 好评 - } else if (!ClickOrderStatusEnum.TOBE_EXECUTION.value().equals(dhAddCarOrder.getStatus()) && !ClickOrderStatusEnum.EXECUTION_FAILE.value().equals(dhAddCarOrder.getStatus())) { - return null; - } else { - - // TODO 拼装好评数据 - DhCarOrderParamsVO dhCarOrderParamsVO = dhAddCarOrderService.getYdParams(Long.valueOf(paramsObj.getParams())); - if (ObjectUtil.isEmpty(dhCarOrderParamsVO)) { - log.error("根据刷单id关联查询相关信息空值异常!!!"); - return null; - } - joinImagePath(dhCarOrderParamsVO); - List paramList = new ArrayList<>(); - Map maps = BeanUtil.beanToMap(dhCarOrderParamsVO); - maps.entrySet().removeIf(entry -> entry.getValue() == null); - - for (Map.Entry map : maps.entrySet()) { - Param ydParam = new Param(); - String value = null; - // 特殊处理 - if ("carGoodKeys".equals(map.getKey()) || "carGoodLinks".equals(map.getKey())) { - Object carGoodKeysObj = map.getValue(); - value = JSONUtil.parseArray(carGoodKeysObj).toString(); - } else { - value = map.getValue().toString(); - } - - ydParam.setName(map.getKey()); - ydParam.setValue(value); - paramList.add(ydParam); - } - - // 组装Params - bossObj.setParams(paramList); - return JSONUtil.toJsonStr(bossObj); - } - } else if (TaskInfoEnum.BROWSE.getTaskName().equals(taskName)) { - // 浏览收藏 - Params paramsObj = JSONUtil.toBean(params, Params.class); - Boss bossObj = JSONUtil.toBean(params, Boss.class); - CtBrowse ctBrowse = ctBrowseService.getByIdLock(Long.valueOf(paramsObj.getParams())); - if (ObjectUtil.isEmpty(ctBrowse)) { - return null; - // 状态 1.待执行 2.执行中 3.执行成功 4.执行失败 5.待支付 - } else if (ClickOrderStatusEnum.IN_EXECUTION.value().equals(ctBrowse.getStatus()) || ClickFarmingStatusEnum.EXECUTION_SUCCESS.value().equals(ctBrowse.getStatus())) { - return null; - } else { - // TODO 好评浏览 待修改 - CtBrowseYdParams ctBrowseYdParams = new CtBrowseYdParams(); - CtBrowseDetailVO ctBrowseDetailVO = ctBrowseService.getBrowseDetailById(Long.valueOf(paramsObj.getParams())); - BeanUtil.copyProperties(ctBrowseDetailVO, ctBrowseYdParams); - List paramList = new ArrayList<>(); - Map maps = BeanUtil.beanToMap(ctBrowseYdParams); - maps.entrySet().removeIf(entry -> entry.getValue() == null); - - for (Map.Entry map : maps.entrySet()) { - Param ydParam = new Param(); - ydParam.setName(map.getKey()); - ydParam.setValue(map.getValue().toString()); - paramList.add(ydParam); - } - - // 组装Params - bossObj.setParams(paramList); - return JSONUtil.toJsonStr(bossObj); - } - } else { - return null; - } - } - - private void joinImagePath(DhCarOrderParamsVO dhCarOrderParamsVO) { - if (ParamsTypeEnum.KEY_WORD.eqValue(dhCarOrderParamsVO.getParamsType()) && ObjectUtil.isNotEmpty(dhCarOrderParamsVO.getCarGoodKeys())) { - for (DhCarGoodKeyVO dhCarGoodKeyVO:dhCarOrderParamsVO.getCarGoodKeys()) { - String paths = dhCarGoodKeyVO.getPaths(); - dhCarGoodKeyVO.setPaths(joinPath(paths)); - } - } else if (ParamsTypeEnum.LINK.eqValue(dhCarOrderParamsVO.getParamsType()) && ObjectUtil.isNotEmpty(dhCarOrderParamsVO.getCarGoodLinks())) { - for (DhCarGoodLinkVO dhCarGoodLinkVO:dhCarOrderParamsVO.getCarGoodLinks()) { - String paths = dhCarGoodLinkVO.getPaths(); - dhCarGoodLinkVO.setPaths(joinPath(paths)); - } - } else { - return ; - } - } - - /** - * 拼接域名 - * @param paths - * @return - */ - private String joinPath(String paths) { - if (ObjectUtil.isEmpty(paths)) { - return null; - } - List pathList = Arrays.asList(paths.split(",")); - return pathList.stream().map(s -> s = SystemConfig.FILE_VISIT_ADDR + s).collect(Collectors.joining(",")); - } - - @Override - public SysQuartzJob getByTaskNum(String taskNum) { - return sysQuartzJobDao.getByTaskNum(taskNum); - } -} - diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/quartz/task/BossTask.java b/wjcy-system/src/main/java/me/zhengjie/modules/quartz/task/BossTask.java deleted file mode 100644 index 85c0202..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/quartz/task/BossTask.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.quartz.task; - -import cn.hutool.json.JSONUtil; -import lombok.extern.slf4j.Slf4j; -import me.zhengjie.constant.PublicConstant; -import me.zhengjie.entity.quartz.Boss; -import me.zhengjie.service.YdQuartzService; -import org.springframework.stereotype.Component; - -import javax.annotation.Resource; - -/** - * 测试用-Boss查询岗位 - * @author rch - * @date 2022-07-23 - */ -@Slf4j -@Component -public class BossTask { - - @Resource - private YdQuartzService ydQuartzService; - - public void run(String str) throws Exception { - Boss boss = JSONUtil.toBean(str, Boss.class); - String REBOT_KEY = PublicConstant.getRebotKeyPrefix(boss.getAccountName()); - ydQuartzService.executeOnLock(REBOT_KEY, 1, 1, callBack -> { - try { - return ydQuartzService.exec(str); - } catch (Exception e) { - throw new RuntimeException(e); - } - }); - } -} - diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/quartz/task/BossTask22.java b/wjcy-system/src/main/java/me/zhengjie/modules/quartz/task/BossTask22.java deleted file mode 100644 index 4adf48b..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/quartz/task/BossTask22.java +++ /dev/null @@ -1,165 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.quartz.task; - -import cn.hutool.core.date.DateUtil; -import cn.hutool.core.util.ObjectUtil; -import cn.hutool.json.JSONUtil; -import lombok.extern.slf4j.Slf4j; -import me.zhengjie.config.YdApiProperties; -import me.zhengjie.constant.PublicConstant; -import me.zhengjie.entity.CtRebot; -import me.zhengjie.entity.quartz.Boss; -import me.zhengjie.entity.quartz.RebotStatu; -import me.zhengjie.entity.quartz.RebotStatuReturn; -import me.zhengjie.entity.quartz.SecreInfo; -import me.zhengjie.enums.YesOrNoEnum; -import me.zhengjie.exception.BadRequestException; -import me.zhengjie.service.CtRebotService; -import me.zhengjie.service.redission.LockCallBack; -import me.zhengjie.utils.HttpClientUtil; -import me.zhengjie.utils.RedissonUtil; -import org.redisson.api.RLock; -import org.springframework.stereotype.Component; - -import javax.annotation.Resource; -import java.util.HashMap; -import java.util.Map; -import java.util.concurrent.TimeUnit; - -/** - * 测试用-Boss查询岗位 - * @author rch - * @date 2022-07-23 - */ -@Slf4j -@Component -public class BossTask22 { - - @Resource - private CtRebotService ctRebotService; - @Resource - private RedissonUtil redissonUtil; - - public final static String REBOT_STATU = "https://api.winrobot360.com/oapi/dispatch/v2/client/query"; - public final static String GET_SECRET = "https://api.winrobot360.com/oapi/token/v2/token/create"; - public final static String STAT_JOB_URL = "https://api.winrobot360.com/oapi/dispatch/v2/job/start"; - - // 测试保证指执行一次 - public static Integer number = 0; - - public void run(){ - try { - Thread.sleep(5000); - log.info("run 执行成功====time:" + DateUtil.now()); - } catch (InterruptedException e) { - e.printStackTrace(); - } - - log.info("run---end!"); - } - - public void run2(String str){ - - number ++; - Boss boss = JSONUtil.toBean(str, Boss.class); - String REBOT_KEY = PublicConstant.getRebotKeyPrefix(boss.getAccountName()); - try { - executeOnLock(REBOT_KEY, 1, 1, callBack -> exec(str)); - } catch (InterruptedException e) { - e.printStackTrace(); - } - } - - public void run1(){ - log.info("run2 执行成功"); - } - - Object executeOnLock(String lockKey, long time, long timeout, LockCallBack callBack) throws BadRequestException,InterruptedException { - RLock lock = redissonUtil.getRLock(lockKey); - String currentTime = me.zhengjie.utils.DateUtil.getCurrentTime(); - try { - log.info(currentTime+" 获取锁============= {}",lockKey); - if (lock.tryLock(time, timeout, TimeUnit.SECONDS)) { - System.out.println(" run2 ====== lock success"); - return callBack.execute(true); - } else { - System.out.println(" run2 ====== lock fail "); - throw new BadRequestException(" run2 ====== lock fail "); - } - } catch (InterruptedException e) { - throw e; - } finally { - lock.unlock(); - log.info(currentTime+" 释放锁============= {}",lockKey); - } - } - - public Boolean exec(String str) { - Boss boss = JSONUtil.toBean(str, Boss.class); - // 1.根据设备id获取设备信息 for update - CtRebot ctRebot = ctRebotService.getByAccountNameLock(boss.getAccountName()); - System.out.println("run2================================"); - System.out.println(JSONUtil.toJsonStr(ctRebot)); - if (ObjectUtil.isEmpty(ctRebot) || !YesOrNoEnum.NO.eqValue(ctRebot.getStatus())) { - // 有问题 不执行 - log.info("run2 执行成功 - 结束了,设备信息问题,参数为: {}" + str); - return false; - } - - // token - Map params = new HashMap<>(16); - params.put("accessKeyId", YdApiProperties.ACCESS_KEY_ID); - params.put("accessKeySecret", YdApiProperties.ACCESS_KEY_SECRET); - String secretStr = HttpClientUtil.getHttp(GET_SECRET, params); - SecreInfo secreInfo = JSONUtil.toBean(secretStr, SecreInfo.class); - if (!secreInfo.getSuccess()) { - log.info("=========鉴权异常=========="); - return false; - } - String token = secreInfo.getData().getAccessToken(); - Map headers = new HashMap<>(16); - headers.put("Accept", "application/json"); - headers.put("Content-Type", "application/json;charset=utf-8"); - headers.put("authorization", "Bearer " + token); - - // 判断是否在线 - RebotStatu rebotStatu = new RebotStatu(); - rebotStatu.setAccountName(ctRebot.getAccountName()); - rebotStatu.setRobotClientUuid(ctRebot.getRobotClientUuid()); - String returnStr = HttpClientUtil.postJson(REBOT_STATU, headers, JSONUtil.toJsonStr(rebotStatu), "utf-8"); - RebotStatuReturn rebotStatuReturn = JSONUtil.toBean(returnStr, RebotStatuReturn.class); - if ("offline".equals(rebotStatuReturn.getData().getStatus())) { - log.info("=======设备不在线====="); - return false; - } - - // 修改机器人状态 - CtRebot updateCtRebot = new CtRebot(); - updateCtRebot.setId(ctRebot.getId()); - updateCtRebot.setStatus(YesOrNoEnum.YES.value()); - Boolean resultBoolean = ctRebotService.updateById(updateCtRebot); - if (resultBoolean) { - String returnJobStr = HttpClientUtil.postJson(STAT_JOB_URL, headers, JSONUtil.toJsonStr(boss), "utf-8"); - log.info("run2 执行成功,返回结果为: {}" + returnJobStr); - } else { - log.info("run2 执行成功。 但是修改设备状态失败----- 此处该预警"); - } - return true; - } -} - - diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/quartz/task/BrowseTask.java b/wjcy-system/src/main/java/me/zhengjie/modules/quartz/task/BrowseTask.java deleted file mode 100644 index 9ca72aa..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/quartz/task/BrowseTask.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.quartz.task; - -import cn.hutool.json.JSONUtil; -import lombok.extern.slf4j.Slf4j; -import me.zhengjie.constant.PublicConstant; -import me.zhengjie.entity.quartz.Boss; -import me.zhengjie.service.YdQuartzService; -import org.springframework.stereotype.Component; - -import javax.annotation.Resource; - -/** - * 浏览收藏任务 - * @author rch - * @date 2022-11-04 - */ -@Slf4j -@Component -public class BrowseTask { - - @Resource - private YdQuartzService ydQuartzService; - - public void run(String str) throws Exception { - System.out.println("================================BrowseTask=========================1"); - Boss boss = JSONUtil.toBean(str, Boss.class); - String REBOT_KEY = PublicConstant.getRebotKeyPrefix(boss.getAccountName()); - System.out.println("================================BrowseTask=========================2"); - ydQuartzService.executeOnLock(REBOT_KEY, 1, 1, callBack -> { - try { - System.out.println("================================BrowseTask=========================3"); - return ydQuartzService.browseTaskExec(str); - } catch (Exception e) { - throw new RuntimeException(e); - } - }); - } -} - diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/quartz/task/ClickFarmSuppleMentTask.java b/wjcy-system/src/main/java/me/zhengjie/modules/quartz/task/ClickFarmSuppleMentTask.java deleted file mode 100644 index 654079b..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/quartz/task/ClickFarmSuppleMentTask.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.quartz.task; - -import cn.hutool.json.JSONUtil; -import lombok.extern.slf4j.Slf4j; -import me.zhengjie.constant.PublicConstant; -import me.zhengjie.entity.quartz.Boss; -import me.zhengjie.service.YdQuartzService; -import org.springframework.stereotype.Component; - -import javax.annotation.Resource; - -/** - * 刷单补录任务 - * @author rch - * @date 2022-10-17 - */ -@Slf4j -@Component -public class ClickFarmSuppleMentTask { - - @Resource - private YdQuartzService ydQuartzService; - - public void run(String str) throws Exception { - System.out.println("================================ClickFarmSuppleMentTask=========================1"); - Boss boss = JSONUtil.toBean(str, Boss.class); - String REBOT_KEY = PublicConstant.getRebotKeyPrefix(boss.getAccountName()); - System.out.println("================================ClickFarmSuppleMentTask=========================2"); - ydQuartzService.executeOnLock(REBOT_KEY, 1, 1, callBack -> { - try { - System.out.println("================================ClickFarmSuppleMentTask=========================3"); - return ydQuartzService.clickFarmSuppleMentExec(str); - } catch (Exception e) { - throw new RuntimeException(e); - } - }); - } -} - diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/quartz/task/ClickFarmTask.java b/wjcy-system/src/main/java/me/zhengjie/modules/quartz/task/ClickFarmTask.java deleted file mode 100644 index 701e025..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/quartz/task/ClickFarmTask.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.quartz.task; - -import cn.hutool.json.JSONUtil; -import lombok.extern.slf4j.Slf4j; -import me.zhengjie.constant.PublicConstant; -import me.zhengjie.entity.quartz.Boss; -import me.zhengjie.service.YdQuartzService; -import org.springframework.stereotype.Component; - -import javax.annotation.Resource; - -/** - * 刷单任务 - * @author rch - * @date 2022-08-16 - */ -@Slf4j -@Component -public class ClickFarmTask { - - @Resource - private YdQuartzService ydQuartzService; - - public void run(String str) throws Exception { - System.out.println("================================ClickFarmTask=========================1"); - Boss boss = JSONUtil.toBean(str, Boss.class); - String REBOT_KEY = PublicConstant.getRebotKeyPrefix(boss.getAccountName()); - System.out.println("================================ClickFarmTask=========================2"); - ydQuartzService.executeOnLock(REBOT_KEY, 1, 1, callBack -> { - try { - System.out.println("================================ClickFarmTask=========================3"); - return ydQuartzService.clickFarmExec(str); - } catch (Exception e) { - throw new RuntimeException(e); - } - }); - } -} - diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/quartz/task/DhAddCarTask.java b/wjcy-system/src/main/java/me/zhengjie/modules/quartz/task/DhAddCarTask.java deleted file mode 100644 index d6f1518..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/quartz/task/DhAddCarTask.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.quartz.task; - -import cn.hutool.json.JSONUtil; -import lombok.extern.slf4j.Slf4j; -import me.zhengjie.constant.PublicConstant; -import me.zhengjie.entity.quartz.Boss; -import me.zhengjie.service.YdQuartzService; -import org.springframework.stereotype.Component; - -import javax.annotation.Resource; - -/** - * 敦煌-加购 - * @author rch - * @date 2022-11-14 - */ -@Slf4j -@Component -public class DhAddCarTask { - - @Resource - private YdQuartzService ydQuartzService; - - public void run(String str) throws Exception { - System.out.println("================================ClickFarmTask=========================1"); - Boss boss = JSONUtil.toBean(str, Boss.class); - String REBOT_KEY = PublicConstant.getRebotKeyPrefix(boss.getAccountName()); - System.out.println("================================ClickFarmTask=========================2"); - ydQuartzService.executeOnLock(REBOT_KEY, 1, 1, callBack -> { - try { - System.out.println("================================ClickFarmTask=========================3"); - return ydQuartzService.addCarExec(str); - } catch (Exception e) { - throw new RuntimeException(e); - } - }); - } -} - diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/quartz/task/DhCatchOrderTask.java b/wjcy-system/src/main/java/me/zhengjie/modules/quartz/task/DhCatchOrderTask.java deleted file mode 100644 index 492a6ac..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/quartz/task/DhCatchOrderTask.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.quartz.task; - -import cn.hutool.json.JSONUtil; -import lombok.extern.slf4j.Slf4j; -import me.zhengjie.constant.PublicConstant; -import me.zhengjie.entity.quartz.Boss; -import me.zhengjie.service.YdQuartzService; -import org.springframework.stereotype.Component; - -import javax.annotation.Resource; - -/** - * 敦煌-加购抓单任务 - * @author rch - * @date 2022-08-16 - */ -@Slf4j -@Component -public class DhCatchOrderTask { - - @Resource - private YdQuartzService ydQuartzService; - - public void run(String str) throws Exception { - System.out.println("================================DhCatchOrderTask=========================1"); - Boss boss = JSONUtil.toBean(str, Boss.class); - String REBOT_KEY = PublicConstant.getRebotKeyPrefix(boss.getAccountName()); - System.out.println("================================DhCatchOrderTask=========================2"); - ydQuartzService.executeOnLock(REBOT_KEY, 1, 1, callBack -> { - try { - System.out.println("================================DhCatchOrderTask=========================3"); - return ydQuartzService.catchOrderExec(str); - } catch (Exception e) { - throw new RuntimeException(e); - } - }); - } -} - diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/quartz/task/DhPayTask.java b/wjcy-system/src/main/java/me/zhengjie/modules/quartz/task/DhPayTask.java deleted file mode 100644 index 6a44236..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/quartz/task/DhPayTask.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.quartz.task; - -import lombok.extern.slf4j.Slf4j; -import me.zhengjie.service.CtDhPayService; -import me.zhengjie.service.CtOrderService; -import org.springframework.stereotype.Component; - -import javax.annotation.Resource; - -/** - * 敦煌 支付 定时器 - * 计划 每10s 执行一次 -串行 - * @author rch - * @date 2022-07-28 - */ -@Slf4j -@Component -public class DhPayTask { - - @Resource - private CtDhPayService ctDhPayService; - - public void dhPayTaskRun(){ - try { - ctDhPayService.toPay(); - log.info("敦煌 支付 定时器---DhPayTask---dhPayTaskRun---执行成功"); - } catch (Exception e) { - e.printStackTrace(); - } - log.info("run---end!"); - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/quartz/task/DhWellReceivedTask.java b/wjcy-system/src/main/java/me/zhengjie/modules/quartz/task/DhWellReceivedTask.java deleted file mode 100644 index 79baee7..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/quartz/task/DhWellReceivedTask.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.quartz.task; - -import cn.hutool.json.JSONUtil; -import lombok.extern.slf4j.Slf4j; -import me.zhengjie.constant.PublicConstant; -import me.zhengjie.entity.quartz.Boss; -import me.zhengjie.service.YdQuartzService; -import org.springframework.stereotype.Component; - -import javax.annotation.Resource; - -/** - * 敦煌-好评 - * @author rch - * @date 2022-11-14 - */ -@Slf4j -@Component -public class DhWellReceivedTask { - - @Resource - private YdQuartzService ydQuartzService; - - public void run(String str) throws Exception { - System.out.println("================================DhWellReceivedTask=========================1"); - Boss boss = JSONUtil.toBean(str, Boss.class); - String REBOT_KEY = PublicConstant.getRebotKeyPrefix(boss.getAccountName()); - System.out.println("================================DhWellReceivedTask=========================2"); - ydQuartzService.executeOnLock(REBOT_KEY, 1, 1, callBack -> { - try { - System.out.println("================================DhWellReceivedTask=========================3"); - return ydQuartzService.dhWellReceivedExec(str); - } catch (Exception e) { - throw new RuntimeException(e); - } - }); - } -} - diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/quartz/task/ExcelToOrderTask.java b/wjcy-system/src/main/java/me/zhengjie/modules/quartz/task/ExcelToOrderTask.java deleted file mode 100644 index 6ce201d..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/quartz/task/ExcelToOrderTask.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.quartz.task; - -import lombok.extern.slf4j.Slf4j; -import me.zhengjie.service.CtOrderService; -import org.springframework.stereotype.Component; - -import javax.annotation.Resource; - -/** - * Excel 数据转换存储到订单表里 Order 一对多 - * 计划 每10s 执行一次 -串行 - * @author rch - * @date 2022-06-23 - */ -@Slf4j -@Component -public class ExcelToOrderTask { - - @Resource - private CtOrderService ctOrderService; - - public void excelToOrderRun(){ - try { - ctOrderService.excelToOrder(); - log.info("Excel 数据转换存储到订单表里 Order---ExcelToOrderTask---excelToOrderRun---执行成功"); - } catch (Exception e) { - e.printStackTrace(); - } - log.info("run---end!"); - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/quartz/task/ExcelmportTask.java b/wjcy-system/src/main/java/me/zhengjie/modules/quartz/task/ExcelmportTask.java deleted file mode 100644 index 79e5068..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/quartz/task/ExcelmportTask.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.quartz.task; - -import lombok.extern.slf4j.Slf4j; -import me.zhengjie.service.CtExcelImportInfoService; -import org.springframework.stereotype.Component; - -import javax.annotation.Resource; - -/** - * Excel 数据导入到Mysql定时器 - * 计划 每10s 执行一次 -串行 - * @author rch - * @date 2022-06-23 - */ -@Slf4j -@Component -public class ExcelmportTask { - - @Resource - private CtExcelImportInfoService ctExcelImportInfoService; - - public void importRun(){ - try { - ctExcelImportInfoService.importExcel(); - log.info("Excel数据导入到Mysql定时器---ExcelmportTask---importRun---执行成功"); - } catch (Exception e) { - e.printStackTrace(); - } - log.info("run---end!"); - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/quartz/task/OrderToPayTask.java b/wjcy-system/src/main/java/me/zhengjie/modules/quartz/task/OrderToPayTask.java deleted file mode 100644 index e62c8bd..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/quartz/task/OrderToPayTask.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.quartz.task; - -import lombok.extern.slf4j.Slf4j; -import me.zhengjie.service.CtOrderService; -import org.springframework.stereotype.Component; - -import javax.annotation.Resource; - -/** - * 订单表里Order支付 定时器 - * 计划 每8s 执行一次 -串行 - * @author rch - * @date 2022-06-23 - */ -@Slf4j -@Component -public class OrderToPayTask { - - @Resource - private CtOrderService ctOrderService; - - public void orderToPayRun(){ - try { - ctOrderService.toPay(); - log.info("订单表里Order支付---OrderToPayTask---orderToPayRun---执行成功"); - } catch (Exception e) { - e.printStackTrace(); - } - log.info("run---end!"); - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/quartz/task/RebotStatusTask.java b/wjcy-system/src/main/java/me/zhengjie/modules/quartz/task/RebotStatusTask.java deleted file mode 100644 index 6266f5e..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/quartz/task/RebotStatusTask.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.quartz.task; - -import cn.hutool.core.date.DateUtil; -import cn.hutool.core.util.ObjectUtil; -import cn.hutool.json.JSONUtil; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import lombok.extern.slf4j.Slf4j; -import me.zhengjie.config.YdApiProperties; -import me.zhengjie.constant.Constants; -import me.zhengjie.entity.CtRebot; -import me.zhengjie.entity.quartz.RebotStatu; -import me.zhengjie.entity.quartz.RebotStatuReturn; -import me.zhengjie.entity.quartz.SecreInfo; -import me.zhengjie.enums.CtReboteStatusEnum; -import me.zhengjie.enums.RobotStatusEnum; -import me.zhengjie.exception.BadRequestException; -import me.zhengjie.service.CtRebotService; -import me.zhengjie.utils.HttpClientUtil; -import org.springframework.stereotype.Component; - -import javax.annotation.Resource; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * 机器人状态定时检测 - * @author rch - * @date 2022-08-06 - */ -@Slf4j -@Component -public class RebotStatusTask { - - @Resource - private CtRebotService ctRebotService; - - /** - * 计划20s执行一次 等到真的脚本写好了,就多点时间根据实际情况 - */ - public void run(){ - try { - // TODO 获取占用状态的机器人信息 然后定时调用接口 根据结果修改机器人状态 - QueryWrapper ctRebotQueryWrapper = new QueryWrapper<>(); - ctRebotQueryWrapper.eq("status", CtReboteStatusEnum.OCCUPY.value()); - - List ctRebotList = ctRebotService.list(ctRebotQueryWrapper); - - // token - Map params = new HashMap<>(16); - params.put("accessKeyId", YdApiProperties.ACCESS_KEY_ID); - params.put("accessKeySecret", YdApiProperties.ACCESS_KEY_SECRET); - SecreInfo secreInfo = JSONUtil.toBean(HttpClientUtil.getHttp(Constants.GET_SECRET, params), SecreInfo.class); - if (!secreInfo.getSuccess()) { - log.info("=========鉴权异常=========="); - throw new BadRequestException("请求影刀鉴权异常!"); - } - String token = secreInfo.getData().getAccessToken(); - Map headers = new HashMap<>(16); - headers.put("Accept", "application/json"); - headers.put("Content-Type", "application/json;charset=utf-8"); - headers.put("authorization", "Bearer " + token); - for (CtRebot ctRebot:ctRebotList) { - // 判断是否在线 - RebotStatu rebotStatu = new RebotStatu(ctRebot.getRobotClientUuid(), ctRebot.getAccountName()); - String returnStr = HttpClientUtil.postJson(Constants.REBOT_STATU, headers, JSONUtil.toJsonStr(rebotStatu), "utf-8"); - RebotStatuReturn rebotStatuReturn = JSONUtil.toBean(returnStr, RebotStatuReturn.class); - - if (ObjectUtil.isNotEmpty(rebotStatuReturn.getData()) && RobotStatusEnum.IDLE.value().equals(rebotStatuReturn.getData().getStatus())) { - Boolean result = ctRebotService.updateNewStatusByOldStatus(ctRebot.getId(), CtReboteStatusEnum.UNOCCUPIED.value(), ctRebot.getStatus()); - log.info("=======修改设备空闲状态=====ctRebot:{} --oldStatus:{}, ---newStatus{} --result:{}", JSONUtil.toJsonStr(ctRebot), ctRebot.getStatus(), CtReboteStatusEnum.UNOCCUPIED.value(), result); - } - } - - log.info("run 执行成功====time:" + DateUtil.now()); - } catch (Exception e) { - e.printStackTrace(); - } - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/quartz/task/TestTask.java b/wjcy-system/src/main/java/me/zhengjie/modules/quartz/task/TestTask.java deleted file mode 100644 index 5ec4a14..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/quartz/task/TestTask.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.quartz.task; - -import cn.hutool.core.date.DateUtil; -import lombok.extern.slf4j.Slf4j; -import org.springframework.stereotype.Component; - -/** - * 测试用 - * @author Zheng Jie - * @date 2019-01-08 - */ -@Slf4j -@Component -public class TestTask { - - public void run(){ - try { - Thread.sleep(5000); - log.info("run 执行成功====time:" + DateUtil.now()); - } catch (InterruptedException e) { - e.printStackTrace(); - } - - log.info("run---end!"); - } - - public void run1(String str){ - log.info("run1 执行成功,参数为: {}" + str); - } - - public void run2(){ - log.info("run2 执行成功"); - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/quartz/task/WellReceivedTask.java b/wjcy-system/src/main/java/me/zhengjie/modules/quartz/task/WellReceivedTask.java deleted file mode 100644 index eaab091..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/quartz/task/WellReceivedTask.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.quartz.task; - -import cn.hutool.json.JSONUtil; -import lombok.extern.slf4j.Slf4j; -import me.zhengjie.constant.PublicConstant; -import me.zhengjie.entity.quartz.Boss; -import me.zhengjie.service.YdQuartzService; -import org.springframework.stereotype.Component; -import org.springframework.transaction.annotation.Transactional; - -import javax.annotation.Resource; - -/** - * 刷单任务 - * @author rch - * @date 2022-10-17 - */ -@Slf4j -@Component -public class WellReceivedTask { - - @Resource - private YdQuartzService ydQuartzService; - - public void run(String str) throws Exception { - System.out.println("================================WellReceivedTask=========================1"); - Boss boss = JSONUtil.toBean(str, Boss.class); - String REBOT_KEY = PublicConstant.getRebotKeyPrefix(boss.getAccountName()); - System.out.println("================================WellReceivedTask=========================2"); - ydQuartzService.executeOnLock(REBOT_KEY, 1, 1, callBack -> { - try { - System.out.println("================================WellReceivedTask=========================3"); - return ydQuartzService.wellReceivedExec(str); - } catch (Exception e) { - throw new RuntimeException(e); - } - }); - } -} - diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/quartz/utils/ExecutionJob.java b/wjcy-system/src/main/java/me/zhengjie/modules/quartz/utils/ExecutionJob.java deleted file mode 100644 index 267f20b..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/quartz/utils/ExecutionJob.java +++ /dev/null @@ -1,140 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.quartz.utils; - -import cn.hutool.extra.template.Template; -import cn.hutool.extra.template.TemplateConfig; -import cn.hutool.extra.template.TemplateEngine; -import cn.hutool.extra.template.TemplateUtil; -import me.zhengjie.config.thread.ThreadPoolExecutorUtil; -import me.zhengjie.domain.vo.EmailVo; -import me.zhengjie.modules.quartz.domain.QuartzJob; -import me.zhengjie.modules.quartz.domain.QuartzLog; -import me.zhengjie.modules.quartz.repository.QuartzLogRepository; -import me.zhengjie.modules.quartz.service.QuartzJobService; -import me.zhengjie.service.EmailService; -import me.zhengjie.utils.RedisUtils; -import me.zhengjie.utils.SpringContextHolder; -import me.zhengjie.utils.StringUtils; -import me.zhengjie.utils.ThrowableUtil; -import org.quartz.DisallowConcurrentExecution; -import org.quartz.JobExecutionContext; -import org.springframework.scheduling.quartz.QuartzJobBean; - -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.concurrent.Future; -import java.util.concurrent.ThreadPoolExecutor; - -/** - * 参考人人开源,https://gitee.com/renrenio/renren-security - * @author / - * @date 2019-01-07 - */ -//@Async -@DisallowConcurrentExecution -public class ExecutionJob extends QuartzJobBean { - - /** 该处仅供参考 */ - private final static ThreadPoolExecutor EXECUTOR = ThreadPoolExecutorUtil.getPoll(); - - @Override - public void executeInternal(JobExecutionContext context) { - QuartzJob quartzJob = (QuartzJob) context.getMergedJobDataMap().get(QuartzJob.JOB_KEY); - // 获取spring bean - QuartzLogRepository quartzLogRepository = SpringContextHolder.getBean(QuartzLogRepository.class); - QuartzJobService quartzJobService = SpringContextHolder.getBean(QuartzJobService.class); - RedisUtils redisUtils = SpringContextHolder.getBean(RedisUtils.class); - - String uuid = quartzJob.getUuid(); - - QuartzLog log = new QuartzLog(); - log.setJobName(quartzJob.getJobName()); - log.setBeanName(quartzJob.getBeanName()); - log.setMethodName(quartzJob.getMethodName()); - log.setParams(quartzJob.getParams()); - log.setType(quartzJob.getType()); - long startTime = System.currentTimeMillis(); - log.setCronExpression(quartzJob.getCronExpression()); - try { - // 执行任务 - System.out.println("--------------------------------------------------------------"); - System.out.println("任务开始执行,任务名称:" + quartzJob.getJobName()); - QuartzRunnable task = new QuartzRunnable(quartzJob.getBeanName(), quartzJob.getMethodName(), - quartzJob.getParams()); - Future future = EXECUTOR.submit(task); - future.get(); - long times = System.currentTimeMillis() - startTime; - log.setTime(times); - if(StringUtils.isNotBlank(uuid)) { - redisUtils.set(uuid, true); - } - // 任务状态 - log.setIsSuccess(true); - System.out.println("任务执行完毕,任务名称:" + quartzJob.getJobName() + ", 执行时间:" + times + "毫秒"); - System.out.println("--------------------------------------------------------------"); - // 判断是否存在子任务 - if(StringUtils.isNotBlank(quartzJob.getSubTask())){ - String[] tasks = quartzJob.getSubTask().split("[,,]"); - // 执行子任务 - quartzJobService.executionSubJob(tasks); - } - } catch (Exception e) { - if(StringUtils.isNotBlank(uuid)) { - redisUtils.set(uuid, false); - } - System.out.println("任务执行失败,任务名称:" + quartzJob.getJobName()); - System.out.println("--------------------------------------------------------------"); - long times = System.currentTimeMillis() - startTime; - log.setTime(times); - // 任务状态 0:成功 1:失败 - log.setIsSuccess(false); - log.setExceptionDetail(ThrowableUtil.getStackTrace(e)); - // 任务如果失败了则暂停 - if(quartzJob.getPauseAfterFailure() != null && quartzJob.getPauseAfterFailure()){ - quartzJob.setIsPause(false); - //更新状态 - quartzJobService.updateIsPause(quartzJob); - } - if(quartzJob.getEmail() != null){ - EmailService emailService = SpringContextHolder.getBean(EmailService.class); - // 邮箱报警 - if(StringUtils.isNoneBlank(quartzJob.getEmail())){ - EmailVo emailVo = taskAlarm(quartzJob, ThrowableUtil.getStackTrace(e)); - emailService.send(emailVo, emailService.find()); - } - } - } finally { - quartzLogRepository.save(log); - } - } - - private EmailVo taskAlarm(QuartzJob quartzJob, String msg) { - EmailVo emailVo = new EmailVo(); - emailVo.setSubject("定时任务【"+ quartzJob.getJobName() +"】执行失败,请尽快处理!"); - Map data = new HashMap<>(16); - data.put("task", quartzJob); - data.put("msg", msg); - TemplateEngine engine = TemplateUtil.createEngine(new TemplateConfig("template", TemplateConfig.ResourceMode.CLASSPATH)); - Template template = engine.getTemplate("email/taskAlarm.ftl"); - emailVo.setContent(template.render(data)); - List emails = Arrays.asList(quartzJob.getEmail().split("[,,]")); - emailVo.setTos(emails); - return emailVo; - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/quartz/utils/QuartzManage.java b/wjcy-system/src/main/java/me/zhengjie/modules/quartz/utils/QuartzManage.java deleted file mode 100644 index e0cf1e0..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/quartz/utils/QuartzManage.java +++ /dev/null @@ -1,174 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.quartz.utils; - -import lombok.extern.slf4j.Slf4j; -import me.zhengjie.exception.BadRequestException; -import me.zhengjie.modules.quartz.domain.QuartzJob; -import org.quartz.*; -import org.quartz.impl.triggers.CronTriggerImpl; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; -import javax.annotation.Resource; -import java.util.Date; -import static org.quartz.TriggerBuilder.newTrigger; - -/** - * @author Zheng Jie - * @date 2019-01-07 - */ -@Slf4j -@Component -public class QuartzManage { - - private static final String JOB_NAME = "TASK_"; - - @Resource - private Scheduler scheduler; - - public void addJob(QuartzJob quartzJob){ - try { - // 构建job信息 - JobDetail jobDetail = JobBuilder.newJob(ExecutionJob.class). - withIdentity(JOB_NAME + quartzJob.getId()).build(); - - //通过触发器名和cron 表达式创建 Trigger - Trigger cronTrigger = newTrigger() - .withIdentity(JOB_NAME + quartzJob.getId()) - .startNow() - .withSchedule(CronScheduleBuilder.cronSchedule(quartzJob.getCronExpression())) - .build(); - - cronTrigger.getJobDataMap().put(QuartzJob.JOB_KEY, quartzJob); - - //重置启动时间 - ((CronTriggerImpl)cronTrigger).setStartTime(new Date()); - - //执行定时任务 - scheduler.scheduleJob(jobDetail,cronTrigger); - - // 暂停任务 - if (quartzJob.getIsPause()) { - pauseJob(quartzJob); - } - } catch (Exception e){ - log.error("创建定时任务失败", e); - throw new BadRequestException("创建定时任务失败"); - } - } - - /** - * 更新job cron表达式 - * @param quartzJob / - */ - public void updateJobCron(QuartzJob quartzJob){ - try { - TriggerKey triggerKey = TriggerKey.triggerKey(JOB_NAME + quartzJob.getId()); - CronTrigger trigger = (CronTrigger) scheduler.getTrigger(triggerKey); - // 如果不存在则创建一个定时任务 - if(trigger == null){ - addJob(quartzJob); - trigger = (CronTrigger) scheduler.getTrigger(triggerKey); - } - CronScheduleBuilder scheduleBuilder = CronScheduleBuilder.cronSchedule(quartzJob.getCronExpression()); - trigger = trigger.getTriggerBuilder().withIdentity(triggerKey).withSchedule(scheduleBuilder).build(); - //重置启动时间 - ((CronTriggerImpl)trigger).setStartTime(new Date()); - trigger.getJobDataMap().put(QuartzJob.JOB_KEY,quartzJob); - - scheduler.rescheduleJob(triggerKey, trigger); - // 暂停任务 - if (quartzJob.getIsPause()) { - pauseJob(quartzJob); - } - } catch (Exception e){ - log.error("更新定时任务失败", e); - throw new BadRequestException("更新定时任务失败"); - } - - } - - /** - * 删除一个job - * @param quartzJob / - */ - public void deleteJob(QuartzJob quartzJob){ - try { - JobKey jobKey = JobKey.jobKey(JOB_NAME + quartzJob.getId()); - scheduler.pauseJob(jobKey); - scheduler.deleteJob(jobKey); - } catch (Exception e){ - log.error("删除定时任务失败", e); - throw new BadRequestException("删除定时任务失败"); - } - } - - /** - * 恢复一个job - * @param quartzJob / - */ - public void resumeJob(QuartzJob quartzJob){ - try { - TriggerKey triggerKey = TriggerKey.triggerKey(JOB_NAME + quartzJob.getId()); - CronTrigger trigger = (CronTrigger) scheduler.getTrigger(triggerKey); - // 如果不存在则创建一个定时任务 - if(trigger == null) { - addJob(quartzJob); - } - JobKey jobKey = JobKey.jobKey(JOB_NAME + quartzJob.getId()); - scheduler.resumeJob(jobKey); - } catch (Exception e){ - log.error("恢复定时任务失败", e); - throw new BadRequestException("恢复定时任务失败"); - } - } - - /** - * 立即执行job - * @param quartzJob / - */ - public void runJobNow(QuartzJob quartzJob){ - try { - TriggerKey triggerKey = TriggerKey.triggerKey(JOB_NAME + quartzJob.getId()); - CronTrigger trigger = (CronTrigger) scheduler.getTrigger(triggerKey); - // 如果不存在则创建一个定时任务 - if(trigger == null) { - addJob(quartzJob); - } - JobDataMap dataMap = new JobDataMap(); - dataMap.put(QuartzJob.JOB_KEY, quartzJob); - JobKey jobKey = JobKey.jobKey(JOB_NAME + quartzJob.getId()); - scheduler.triggerJob(jobKey,dataMap); - } catch (Exception e){ - log.error("定时任务执行失败", e); - throw new BadRequestException("定时任务执行失败"); - } - } - - /** - * 暂停一个job - * @param quartzJob / - */ - public void pauseJob(QuartzJob quartzJob){ - try { - JobKey jobKey = JobKey.jobKey(JOB_NAME + quartzJob.getId()); - scheduler.pauseJob(jobKey); - } catch (Exception e){ - log.error("定时任务暂停失败", e); - throw new BadRequestException("定时任务暂停失败"); - } - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/quartz/utils/QuartzRunnable.java b/wjcy-system/src/main/java/me/zhengjie/modules/quartz/utils/QuartzRunnable.java deleted file mode 100644 index faf334c..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/quartz/utils/QuartzRunnable.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.quartz.utils; - -import lombok.extern.slf4j.Slf4j; -import me.zhengjie.utils.SpringContextHolder; -import org.apache.commons.lang3.StringUtils; -import org.springframework.util.ReflectionUtils; -import java.lang.reflect.Method; -import java.util.concurrent.Callable; - -/** - * 执行定时任务 - * @author / - */ -@Slf4j -public class QuartzRunnable implements Callable { - - private final Object target; - private final Method method; - private final String params; - - QuartzRunnable(String beanName, String methodName, String params) - throws NoSuchMethodException, SecurityException { - this.target = SpringContextHolder.getBean(beanName); - this.params = params; - - if (StringUtils.isNotBlank(params)) { - this.method = target.getClass().getDeclaredMethod(methodName, String.class); - } else { - this.method = target.getClass().getDeclaredMethod(methodName); - } - } - - @Override - public Object call() throws Exception { - ReflectionUtils.makeAccessible(method); - if (StringUtils.isNotBlank(params)) { - method.invoke(target, params); - } else { - method.invoke(target); - } - return null; - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/quartz/utils/YdApiUtil.java b/wjcy-system/src/main/java/me/zhengjie/modules/quartz/utils/YdApiUtil.java deleted file mode 100644 index 228ca67..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/quartz/utils/YdApiUtil.java +++ /dev/null @@ -1,31 +0,0 @@ -package me.zhengjie.modules.quartz.utils; - -import cn.hutool.json.JSONUtil; -import lombok.extern.slf4j.Slf4j; -import me.zhengjie.config.BeanFactory; -import me.zhengjie.constant.Constants; -import me.zhengjie.entity.CtApply; -import me.zhengjie.entity.CtRebot; -import me.zhengjie.entity.quartz.RebotStatu; -import me.zhengjie.entity.quartz.RebotStatuReturn; -import me.zhengjie.entity.quartz.SecreInfo; -import me.zhengjie.enums.RobotStatusEnum; -import me.zhengjie.enums.YesOrNoEnum; -import me.zhengjie.exception.BadRequestException; -import me.zhengjie.service.CtRebotService; -import me.zhengjie.utils.HttpClientUtil; - -import java.util.HashMap; -import java.util.Map; - -/** - * 调用影刀发起Api请求工具类 - * - * @author rch - * @create 2022-08-01 - */ -@Slf4j -public class YdApiUtil { - - -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/security/config/ConfigBeanConfiguration.java b/wjcy-system/src/main/java/me/zhengjie/modules/security/config/ConfigBeanConfiguration.java deleted file mode 100644 index 8cbc88d..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/security/config/ConfigBeanConfiguration.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2019-2020 the original author or authors. - * - * 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 me.zhengjie.modules.security.config; - -import me.zhengjie.modules.security.config.bean.LoginProperties; -import me.zhengjie.modules.security.config.bean.SecurityProperties; -import org.springframework.boot.context.properties.ConfigurationProperties; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - -/** - * @apiNote 配置文件转换Pojo类的 统一配置 类 - * @author: liaojinlong - * @date: 2020/6/10 19:04 - */ -@Configuration -public class ConfigBeanConfiguration { - - @Bean - @ConfigurationProperties(prefix = "login") - public LoginProperties loginProperties() { - return new LoginProperties(); - } - - @Bean - @ConfigurationProperties(prefix = "jwt") - public SecurityProperties securityProperties() { - return new SecurityProperties(); - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/security/config/SecurityConfig.java b/wjcy-system/src/main/java/me/zhengjie/modules/security/config/SecurityConfig.java deleted file mode 100644 index 9067f1c..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/security/config/SecurityConfig.java +++ /dev/null @@ -1,207 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.security.config; - -import lombok.RequiredArgsConstructor; -import me.zhengjie.annotation.AnonymousAccess; -import me.zhengjie.config.PropertiesConfig; -import me.zhengjie.modules.security.config.bean.SecurityProperties; -import me.zhengjie.modules.security.security.JwtAccessDeniedHandler; -import me.zhengjie.modules.security.security.JwtAuthenticationEntryPoint; -import me.zhengjie.modules.security.security.TokenConfigurer; -import me.zhengjie.modules.security.security.TokenProvider; -import me.zhengjie.modules.security.service.OnlineUserService; -import me.zhengjie.modules.security.service.UserCacheClean; -import me.zhengjie.service.LoginIpService; -import me.zhengjie.utils.enums.RequestMethodEnum; -import org.springframework.context.ApplicationContext; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.http.HttpMethod; -import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity; -import org.springframework.security.config.annotation.web.builders.HttpSecurity; -import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; -import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; -import org.springframework.security.config.core.GrantedAuthorityDefaults; -import org.springframework.security.config.http.SessionCreationPolicy; -import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; -import org.springframework.security.crypto.password.PasswordEncoder; -import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.filter.CorsFilter; -import org.springframework.web.method.HandlerMethod; -import org.springframework.web.servlet.mvc.method.RequestMappingInfo; -import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping; - -import javax.annotation.Resource; -import java.util.*; - -/** - * @author Zheng Jie - */ -@Configuration -@EnableWebSecurity -@RequiredArgsConstructor -@EnableGlobalMethodSecurity(prePostEnabled = true, securedEnabled = true) -public class SecurityConfig extends WebSecurityConfigurerAdapter { - - private final TokenProvider tokenProvider; - private final CorsFilter corsFilter; - private final JwtAuthenticationEntryPoint authenticationErrorHandler; - private final JwtAccessDeniedHandler jwtAccessDeniedHandler; - private final ApplicationContext applicationContext; - private final SecurityProperties properties; - private final OnlineUserService onlineUserService; - private final UserCacheClean userCacheClean; - private final LoginIpService loginIpService; - @Resource - private PropertiesConfig propertiesConfig; - - @Bean - GrantedAuthorityDefaults grantedAuthorityDefaults() { - // 去除 ROLE_ 前缀 - return new GrantedAuthorityDefaults(""); - } - - @Bean - public PasswordEncoder passwordEncoder() { - // 密码加密方式 - return new BCryptPasswordEncoder(); - } - - @Override - protected void configure(HttpSecurity httpSecurity) throws Exception { - // 搜寻匿名标记 url: @AnonymousAccess - // Map handlerMethodMap = applicationContext.getBean(RequestMappingHandlerMapping.class).getHandlerMethods(); - RequestMappingHandlerMapping requestMappingHandlerMapping = (RequestMappingHandlerMapping) applicationContext.getBean("requestMappingHandlerMapping"); - Map handlerMethodMap = requestMappingHandlerMapping.getHandlerMethods(); - - // 获取匿名标记 - Map> anonymousUrls = getAnonymousUrl(handlerMethodMap); - httpSecurity - // 禁用 CSRF - .csrf().disable() - .addFilterBefore(corsFilter, UsernamePasswordAuthenticationFilter.class) - // 授权异常 - .exceptionHandling() - .authenticationEntryPoint(authenticationErrorHandler) - .accessDeniedHandler(jwtAccessDeniedHandler) - // 防止iframe 造成跨域 - .and() - .headers() - .frameOptions() - .disable() - // 不创建会话 - .and() - .sessionManagement() - .sessionCreationPolicy(SessionCreationPolicy.STATELESS) - .and() - .authorizeRequests() - // 静态资源等等 - .antMatchers( - HttpMethod.GET, - "/*.html", - "/**/*.html", - "/**/*.css", - "/**/*.js", - "/webSocket/**" - ).permitAll() - // swagger 文档 - .antMatchers("/swagger-ui.html").permitAll() - .antMatchers("/doc.html").permitAll() - .antMatchers("/swagger-resources/**").permitAll() - .antMatchers("/webjars/**").permitAll() - .antMatchers("/*/api-docs").permitAll() - // 文件 - .antMatchers("/avatar/**").permitAll() - .antMatchers("/file/**").permitAll() - // 图片上传 - .antMatchers("/api/file/**").permitAll() - // 静态资源访问 - .antMatchers(propertiesConfig.getUploadPrefix()+"/**").permitAll() - // 阿里巴巴 druid - .antMatchers("/druid/**").permitAll() - // 放行OPTIONS请求 - .antMatchers(HttpMethod.OPTIONS, "/**").permitAll() - // 代理后台 - .antMatchers("/proxyAdmin/**").permitAll() - // 自定义匿名访问所有url放行:允许匿名和带Token访问,细腻化到每个 Request 类型 - // GET - .antMatchers(HttpMethod.GET, anonymousUrls.get(RequestMethodEnum.GET.getType()).toArray(new String[0])).permitAll() - // POST - .antMatchers(HttpMethod.POST, anonymousUrls.get(RequestMethodEnum.POST.getType()).toArray(new String[0])).permitAll() - // PUT - .antMatchers(HttpMethod.PUT, anonymousUrls.get(RequestMethodEnum.PUT.getType()).toArray(new String[0])).permitAll() - // PATCH - .antMatchers(HttpMethod.PATCH, anonymousUrls.get(RequestMethodEnum.PATCH.getType()).toArray(new String[0])).permitAll() - // DELETE - .antMatchers(HttpMethod.DELETE, anonymousUrls.get(RequestMethodEnum.DELETE.getType()).toArray(new String[0])).permitAll() - // 所有类型的接口都放行 - .antMatchers(anonymousUrls.get(RequestMethodEnum.ALL.getType()).toArray(new String[0])).permitAll() - // 所有请求都需要认证 - .anyRequest().authenticated() - .and().apply(securityConfigurerAdapter()); - } - - private Map> getAnonymousUrl(Map handlerMethodMap) { - Map> anonymousUrls = new HashMap<>(6); - Set get = new HashSet<>(); - Set post = new HashSet<>(); - Set put = new HashSet<>(); - Set patch = new HashSet<>(); - Set delete = new HashSet<>(); - Set all = new HashSet<>(); - for (Map.Entry infoEntry : handlerMethodMap.entrySet()) { - HandlerMethod handlerMethod = infoEntry.getValue(); - AnonymousAccess anonymousAccess = handlerMethod.getMethodAnnotation(AnonymousAccess.class); - if (null != anonymousAccess) { - List requestMethods = new ArrayList<>(infoEntry.getKey().getMethodsCondition().getMethods()); - RequestMethodEnum request = RequestMethodEnum.find(requestMethods.size() == 0 ? RequestMethodEnum.ALL.getType() : requestMethods.get(0).name()); - switch (Objects.requireNonNull(request)) { - case GET: - get.addAll(infoEntry.getKey().getPatternsCondition().getPatterns()); - break; - case POST: - post.addAll(infoEntry.getKey().getPatternsCondition().getPatterns()); - break; - case PUT: - put.addAll(infoEntry.getKey().getPatternsCondition().getPatterns()); - break; - case PATCH: - patch.addAll(infoEntry.getKey().getPatternsCondition().getPatterns()); - break; - case DELETE: - delete.addAll(infoEntry.getKey().getPatternsCondition().getPatterns()); - break; - default: - all.addAll(infoEntry.getKey().getPatternsCondition().getPatterns()); - break; - } - } - } - anonymousUrls.put(RequestMethodEnum.GET.getType(), get); - anonymousUrls.put(RequestMethodEnum.POST.getType(), post); - anonymousUrls.put(RequestMethodEnum.PUT.getType(), put); - anonymousUrls.put(RequestMethodEnum.PATCH.getType(), patch); - anonymousUrls.put(RequestMethodEnum.DELETE.getType(), delete); - anonymousUrls.put(RequestMethodEnum.ALL.getType(), all); - return anonymousUrls; - } - - private TokenConfigurer securityConfigurerAdapter() { - return new TokenConfigurer(tokenProvider, properties, onlineUserService, userCacheClean,loginIpService); - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/security/config/bean/LoginCode.java b/wjcy-system/src/main/java/me/zhengjie/modules/security/config/bean/LoginCode.java deleted file mode 100644 index fefd252..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/security/config/bean/LoginCode.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright 2019-2020 the original author or authors. - * - * 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 me.zhengjie.modules.security.config.bean; - -import lombok.Data; - -/** - * 登录验证码配置信息 - * - * @author liaojinlong - * @date 2020/6/10 18:53 - */ -@Data -public class LoginCode { - - /** - * 验证码配置 - */ - private LoginCodeEnum codeType; - /** - * 验证码有效期 分钟 - */ - private Long expiration = 2L; - /** - * 验证码内容长度 - */ - private int length = 2; - /** - * 验证码宽度 - */ - private int width = 111; - /** - * 验证码高度 - */ - private int height = 36; - /** - * 验证码字体 - */ - private String fontName; - /** - * 字体大小 - */ - private int fontSize = 25; - - public LoginCodeEnum getCodeType() { - return codeType; - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/security/config/bean/LoginCodeEnum.java b/wjcy-system/src/main/java/me/zhengjie/modules/security/config/bean/LoginCodeEnum.java deleted file mode 100644 index 9ff398f..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/security/config/bean/LoginCodeEnum.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2019-2020 the original author or authors. - * - * 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 me.zhengjie.modules.security.config.bean; - -/** - * 验证码配置枚举 - * - * @author: liaojinlong - * @date: 2020/6/10 17:40 - */ - -public enum LoginCodeEnum { - /** - * 算数 - */ - arithmetic, - /** - * 中文 - */ - chinese, - /** - * 中文闪图 - */ - chinese_gif, - /** - * 闪图 - */ - gif, - spec -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/security/config/bean/LoginProperties.java b/wjcy-system/src/main/java/me/zhengjie/modules/security/config/bean/LoginProperties.java deleted file mode 100644 index b13f173..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/security/config/bean/LoginProperties.java +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Copyright 2019-2020 the original author or authors. - * - * Licensed under the Apache License, Version loginCode.length.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-loginCode.length.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 me.zhengjie.modules.security.config.bean; - -import com.wf.captcha.*; -import com.wf.captcha.base.Captcha; -import lombok.Data; -import me.zhengjie.exception.BadConfigurationException; -import me.zhengjie.utils.StringUtils; - -import java.awt.*; -import java.util.Objects; - -/** - * 配置文件读取 - * - * @author liaojinlong - * @date loginCode.length0loginCode.length0/6/10 17:loginCode.length6 - */ -@Data -public class LoginProperties { - - /** - * 账号单用户 登录 - */ - private boolean singleLogin = false; - - private LoginCode loginCode; - - /** - * 用户登录信息缓存 - */ - private boolean cacheEnable; - - public boolean isSingleLogin() { - return singleLogin; - } - - public boolean isCacheEnable() { - return cacheEnable; - } - - /** - * 获取验证码生产类 - * - * @return / - */ - public Captcha getCaptcha() { - if (Objects.isNull(loginCode)) { - loginCode = new LoginCode(); - if (Objects.isNull(loginCode.getCodeType())) { - loginCode.setCodeType(LoginCodeEnum.arithmetic); - } - } - return switchCaptcha(loginCode); - } - - /** - * 依据配置信息生产验证码 - * - * @param loginCode 验证码配置信息 - * @return / - */ - private Captcha switchCaptcha(LoginCode loginCode) { - Captcha captcha; - synchronized (this) { - switch (loginCode.getCodeType()) { - case arithmetic: - // 算术类型 https://gitee.com/whvse/EasyCaptcha - captcha = new FixedArithmeticCaptcha(loginCode.getWidth(), loginCode.getHeight()); - // 几位数运算,默认是两位 - captcha.setLen(loginCode.getLength()); - break; - case chinese: - captcha = new ChineseCaptcha(loginCode.getWidth(), loginCode.getHeight()); - captcha.setLen(loginCode.getLength()); - break; - case chinese_gif: - captcha = new ChineseGifCaptcha(loginCode.getWidth(), loginCode.getHeight()); - captcha.setLen(loginCode.getLength()); - break; - case gif: - captcha = new GifCaptcha(loginCode.getWidth(), loginCode.getHeight()); - captcha.setLen(loginCode.getLength()); - break; - case spec: - captcha = new SpecCaptcha(loginCode.getWidth(), loginCode.getHeight()); - captcha.setLen(loginCode.getLength()); - break; - default: - throw new BadConfigurationException("验证码配置信息错误!正确配置查看 LoginCodeEnum "); - } - } - if(StringUtils.isNotBlank(loginCode.getFontName())){ - captcha.setFont(new Font(loginCode.getFontName(), Font.PLAIN, loginCode.getFontSize())); - } - return captcha; - } - - static class FixedArithmeticCaptcha extends ArithmeticCaptcha { - public FixedArithmeticCaptcha(int width, int height) { - super(width, height); - } - - @Override - protected char[] alphas() { - // 生成随机数字和运算符 - int n1 = num(1, 10), n2 = num(1, 10); - int opt = num(3); - - // 计算结果 - int res = new int[]{n1 + n2, n1 - n2, n1 * n2}[opt]; - // 转换为字符运算符 - char optChar = "+-x".charAt(opt); - - this.setArithmeticString(String.format("%s%c%s=?", n1, optChar, n2)); - this.chars = String.valueOf(res); - - return chars.toCharArray(); - } - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/security/config/bean/SecurityProperties.java b/wjcy-system/src/main/java/me/zhengjie/modules/security/config/bean/SecurityProperties.java deleted file mode 100644 index 16ec3cf..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/security/config/bean/SecurityProperties.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.security.config.bean; - -import lombok.Data; - -/** - * Jwt参数配置 - * - * @author Zheng Jie - * @date 2019年11月28日 - */ -@Data -public class SecurityProperties { - - /** - * Request Headers : Authorization - */ - private String header; - - /** - * 令牌前缀,最后留个空格 Bearer - */ - private String tokenStartWith; - - /** - * 必须使用最少88位的Base64对该令牌进行编码 - */ - private String base64Secret; - - /** - * 令牌过期时间 此处单位/毫秒 - */ - private Long tokenValidityInSeconds; - - /** - * 在线用户 key,根据 key 查询 redis 中在线用户的数据 - */ - private String onlineKey; - - /** - * 验证码 key - */ - private String codeKey; - - /** - * token 续期检查 - */ - private Long detect; - - /** - * 续期时间 - */ - private Long renew; - - public String getTokenStartWith() { - return tokenStartWith + " "; - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/security/rest/AuthorizationController.java b/wjcy-system/src/main/java/me/zhengjie/modules/security/rest/AuthorizationController.java deleted file mode 100644 index c9180cf..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/security/rest/AuthorizationController.java +++ /dev/null @@ -1,201 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.security.rest; - -import cn.hutool.core.map.MapUtil; -import cn.hutool.core.util.IdUtil; -import cn.hutool.core.util.ObjectUtil; -import com.wf.captcha.base.Captcha; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import me.zhengjie.annotation.Log; -import me.zhengjie.annotation.rest.AnonymousDeleteMapping; -import me.zhengjie.annotation.rest.AnonymousGetMapping; -import me.zhengjie.annotation.rest.AnonymousPostMapping; -import me.zhengjie.annotation.type.LogActionType; -import me.zhengjie.config.RsaProperties; -import me.zhengjie.dto.Dto; -import me.zhengjie.error.ErrorCodeEnum; -import me.zhengjie.exception.BadRequestException; -import me.zhengjie.modules.security.config.bean.LoginCodeEnum; -import me.zhengjie.modules.security.config.bean.LoginProperties; -import me.zhengjie.modules.security.config.bean.SecurityProperties; -import me.zhengjie.modules.security.security.TokenProvider; -import me.zhengjie.modules.security.service.OnlineUserService; -import me.zhengjie.modules.security.service.dto.AuthUserDto; -import me.zhengjie.modules.security.service.dto.JwtUserDto; -import me.zhengjie.modules.utils.GoogleAuthenticatorUtil; -import me.zhengjie.service.LoginIpService; -import me.zhengjie.service.SettingSiteService; -import me.zhengjie.utils.*; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; -import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; -import org.springframework.security.core.Authentication; -import org.springframework.security.core.context.SecurityContextHolder; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.HashMap; -import java.util.Map; -import java.util.concurrent.TimeUnit; - -import static me.zhengjie.error.ErrorCodeEnum.LOGIN_PWD_ERROR; - -/** - * @author Zheng Jie - * @date 2018-11-23 - * 授权、根据token获取用户详细信息 - */ -@Slf4j -@RestController -@RequestMapping("/api/auth") -@RequiredArgsConstructor -@Api(tags = "系统:系统授权接口") -public class AuthorizationController { - private final SecurityProperties properties; - private final RedisUtils redisUtils; - private final OnlineUserService onlineUserService; - private final TokenProvider tokenProvider; - private final AuthenticationManagerBuilder authenticationManagerBuilder; - private final LoginIpService loginIpService; - - @Resource - private LoginProperties loginProperties; - @Resource - private SettingSiteService settingSiteService; - - @Log(value = "用户登录", type = LogActionType.LOGIN) - @ApiOperation("登录授权") - @AnonymousPostMapping(value = "/login") - public Object login(@Validated @RequestBody AuthUserDto authUser, HttpServletRequest request) throws Exception { - String ip = StringUtils.getIp(request); - if (!loginIpService.whiteListFlag(ip)) { - return Dto.getInstance(ErrorCodeEnum.BLOCKED_LOGIN_IP_ERROR); - } - - String BLOCKED_ACCOUNT = String.format(RedisUtils.BLOCKED_ACCOUNT, authUser.getUsername()); - Object obj = redisUtils.get(BLOCKED_ACCOUNT); - if (ObjectUtil.isNotEmpty(obj)) { - return Dto.getInstance(ErrorCodeEnum.BLOCKED_ACCOUNT_ERROR); - } - - // 如果Google Auth开启使用google Auth 验证 - if (settingSiteService.getGooleAuthSwitch()) { - // 第二个参数是 host -TODO 待确认 request.getRemoteHost() 是否是符合要求的域 - if (!GoogleAuthenticatorUtil.authcode(authUser.getCode(), GoogleAuthenticatorUtil.genSecret(authUser.getUsername(), request.getRemoteHost()))) { -// throw new BadRequestException("验证码错误"); - return Dto.getInstance(ErrorCodeEnum.ERROR_2222); - } - } else { - // 查询验证码 - String code = (String) redisUtils.get(authUser.getUuid()); - // 清除验证码 - redisUtils.del(authUser.getUuid()); - if (StringUtils.isBlank(code)) { - return Dto.getInstance(ErrorCodeEnum.ERROR_2223); - } - if (StringUtils.isBlank(authUser.getCode()) || !authUser.getCode().equalsIgnoreCase(code)) { - return Dto.getInstance(ErrorCodeEnum.ERROR_2222); - } - } - - // 密码解密 - Authentication authentication = null; - try { - - String password = RsaUtils.decryptByPrivateKey(RsaProperties.privateKey, authUser.getPassword()); - - UsernamePasswordAuthenticationToken authenticationToken = - new UsernamePasswordAuthenticationToken(authUser.getUsername(), password); - authentication = authenticationManagerBuilder.getObject().authenticate(authenticationToken); - SecurityContextHolder.getContext().setAuthentication(authentication); - } catch (Exception e) { - String key = String.format(RedisUtils.LOGIN_FAIL_COUNT, authUser.getUsername()); - Long count = redisUtils.incrAndExpire(key, 300); - if (count >=3) { - // 冻结账户,24小时内不允许登录 - Map map = MapUtil.of("time", DateUtil.getCurrentTime()); - redisUtils.set(BLOCKED_ACCOUNT, map, 3600 * 24); - redisUtils.del(key); - } - - return Dto.getInstance(LOGIN_PWD_ERROR); - } - - - // 生成令牌与第三方系统获取令牌方式 - // UserDetails userDetails = userDetailsService.loadUserByUsername(userInfo.getUsername()); - // Authentication authentication = new UsernamePasswordAuthenticationToken(userDetails, null, userDetails.getAuthorities()); - // SecurityContextHolder.getContext().setAuthentication(authentication); - String token = tokenProvider.createToken(authentication); - final JwtUserDto jwtUserDto = (JwtUserDto) authentication.getPrincipal(); - // 保存在线信息 - onlineUserService.save(jwtUserDto, token, request); - // 返回 token 与 用户信息 - Map authInfo = new HashMap(2) {{ - put("token", properties.getTokenStartWith() + token); - put("user", jwtUserDto); - }}; - if (loginProperties.isSingleLogin()) { - //踢掉之前已经登录的token - onlineUserService.checkLoginOnUser(authUser.getUsername(), token); - } - return ResponseEntity.ok(authInfo); - } - - @ApiOperation("获取用户信息") - @GetMapping(value = "/info") - public ResponseEntity getUserInfo() { - return ResponseEntity.ok(SecurityUtils.getCurrentUser()); - } - - @ApiOperation("获取验证码") - @AnonymousGetMapping(value = "/code") - public ResponseEntity getCode() { - // 获取运算的结果 - Captcha captcha = loginProperties.getCaptcha(); - String uuid = properties.getCodeKey() + IdUtil.simpleUUID(); - //当验证码类型为 arithmetic时且长度 >= 2 时,captcha.text()的结果有几率为浮点型 - String captchaValue = captcha.text(); - if (captcha.getCharType() - 1 == LoginCodeEnum.arithmetic.ordinal() && captchaValue.contains(".")) { - captchaValue = captchaValue.split("\\.")[0]; - } - // 保存 - redisUtils.set(uuid, captchaValue, loginProperties.getLoginCode().getExpiration(), TimeUnit.MINUTES); - // 验证码信息 - Map imgResult = new HashMap(2) {{ - put("img", captcha.toBase64()); - put("uuid", uuid); - }}; - return ResponseEntity.ok(imgResult); - } - - @ApiOperation("退出登录") - @AnonymousDeleteMapping(value = "/logout") - public ResponseEntity logout(HttpServletRequest request) { - onlineUserService.logout(tokenProvider.getToken(request)); - return new ResponseEntity<>(HttpStatus.OK); - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/security/rest/OnlineController.java b/wjcy-system/src/main/java/me/zhengjie/modules/security/rest/OnlineController.java deleted file mode 100644 index 016f06f..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/security/rest/OnlineController.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.security.rest; - -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import lombok.RequiredArgsConstructor; -import me.zhengjie.modules.security.service.OnlineUserService; -import me.zhengjie.utils.EncryptUtils; -import org.springframework.data.domain.Pageable; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.*; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.Set; - -/** - * @author Zheng Jie - */ -@RestController -@RequiredArgsConstructor -@RequestMapping("/api/online") -@Api(tags = "系统:在线用户管理") -public class OnlineController { - - private final OnlineUserService onlineUserService; - - @ApiOperation("查询在线用户") - @GetMapping - @PreAuthorize("@el.check()") - public ResponseEntity query(String filter, Pageable pageable){ - return new ResponseEntity<>(onlineUserService.getAll(filter, pageable),HttpStatus.OK); - } - - @ApiOperation("导出数据") - @GetMapping(value = "/download") - @PreAuthorize("@el.check()") - public void download(HttpServletResponse response, String filter) throws IOException { - onlineUserService.download(onlineUserService.getAll(filter), response); - } - - @ApiOperation("踢出用户") - @DeleteMapping - @PreAuthorize("@el.check()") - public ResponseEntity delete(@RequestBody Set keys) throws Exception { - for (String key : keys) { - // 解密Key - key = EncryptUtils.desDecrypt(key); - onlineUserService.kickOut(key); - } - return new ResponseEntity<>(HttpStatus.OK); - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/security/security/JwtAccessDeniedHandler.java b/wjcy-system/src/main/java/me/zhengjie/modules/security/security/JwtAccessDeniedHandler.java deleted file mode 100644 index 8b3f8c1..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/security/security/JwtAccessDeniedHandler.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.security.security; - -import org.springframework.security.access.AccessDeniedException; -import org.springframework.security.web.access.AccessDeniedHandler; -import org.springframework.stereotype.Component; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; - -/** - * @author Zheng Jie - */ -@Component -public class JwtAccessDeniedHandler implements AccessDeniedHandler { - - @Override - public void handle(HttpServletRequest request, HttpServletResponse response, AccessDeniedException accessDeniedException) throws IOException { - //当用户在没有授权的情况下访问受保护的REST资源时,将调用此方法发送403 Forbidden响应 - response.sendError(HttpServletResponse.SC_FORBIDDEN, accessDeniedException.getMessage()); - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/security/security/JwtAuthenticationEntryPoint.java b/wjcy-system/src/main/java/me/zhengjie/modules/security/security/JwtAuthenticationEntryPoint.java deleted file mode 100644 index f881586..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/security/security/JwtAuthenticationEntryPoint.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.security.security; - -import org.springframework.security.core.AuthenticationException; -import org.springframework.security.web.AuthenticationEntryPoint; -import org.springframework.stereotype.Component; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; - -/** - * @author Zheng Jie - */ -@Component -public class JwtAuthenticationEntryPoint implements AuthenticationEntryPoint { - - @Override - public void commence(HttpServletRequest request, - HttpServletResponse response, - AuthenticationException authException) throws IOException { - // 当用户尝试访问安全的REST资源而不提供任何凭据时,将调用此方法发送401 响应 - response.sendError(HttpServletResponse.SC_UNAUTHORIZED, authException==null?"Unauthorized":authException.getMessage()); - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/security/security/TokenConfigurer.java b/wjcy-system/src/main/java/me/zhengjie/modules/security/security/TokenConfigurer.java deleted file mode 100644 index 9e4e533..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/security/security/TokenConfigurer.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.security.security; - -import lombok.RequiredArgsConstructor; -import me.zhengjie.modules.security.config.bean.SecurityProperties; -import me.zhengjie.modules.security.service.OnlineUserService; -import me.zhengjie.modules.security.service.UserCacheClean; -import me.zhengjie.service.LoginIpService; -import org.springframework.security.config.annotation.SecurityConfigurerAdapter; -import org.springframework.security.config.annotation.web.builders.HttpSecurity; -import org.springframework.security.web.DefaultSecurityFilterChain; -import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter; - -/** - * @author / - */ -@RequiredArgsConstructor -public class TokenConfigurer extends SecurityConfigurerAdapter { - - private final TokenProvider tokenProvider; - private final SecurityProperties properties; - private final OnlineUserService onlineUserService; - private final UserCacheClean userCacheClean; - private final LoginIpService loginIpService; - - @Override - public void configure(HttpSecurity http) { - TokenFilter customFilter = new TokenFilter(tokenProvider, properties, onlineUserService, userCacheClean,loginIpService); - http.addFilterBefore(customFilter, UsernamePasswordAuthenticationFilter.class); - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/security/security/TokenFilter.java b/wjcy-system/src/main/java/me/zhengjie/modules/security/security/TokenFilter.java deleted file mode 100644 index db96094..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/security/security/TokenFilter.java +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.security.security; - -import cn.hutool.core.util.StrUtil; -import io.jsonwebtoken.ExpiredJwtException; -import lombok.RequiredArgsConstructor; -import me.zhengjie.modules.security.config.bean.SecurityProperties; -import me.zhengjie.modules.security.service.OnlineUserService; -import me.zhengjie.modules.security.service.UserCacheClean; -import me.zhengjie.modules.security.service.dto.OnlineUserDto; -import me.zhengjie.service.LoginIpService; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.security.core.Authentication; -import org.springframework.security.core.context.SecurityContextHolder; -import org.springframework.util.StringUtils; -import org.springframework.web.filter.GenericFilterBean; - -import javax.servlet.FilterChain; -import javax.servlet.ServletException; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; -import javax.servlet.http.HttpServletRequest; -import java.io.IOException; -import java.util.Objects; - -/** - * @author / - */ -@RequiredArgsConstructor -public class TokenFilter extends GenericFilterBean { - private static final Logger log = LoggerFactory.getLogger(TokenFilter.class); - - - private final TokenProvider tokenProvider; - private final SecurityProperties properties; - private final OnlineUserService onlineUserService; - private final UserCacheClean userCacheClean; - private final LoginIpService loginIpService; - - @Override - public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) - throws IOException, ServletException { - HttpServletRequest httpServletRequest = (HttpServletRequest) servletRequest; - // 验证 -// String ip = me.zhengjie.utils.StringUtils.getIp(httpServletRequest); -// if (!loginIpService.whiteListFlag(ip)) { -// Dto dto = Dto.getInstance(ErrorCodeEnum.BLOCKED_LOGIN_IP_ERROR); -//// throw new BadRequestException(ErrorCodeEnum.BLOCKED_LOGIN_IP_ERROR); -// servletResponse.setContentType("application/json;charset=UTF-8"); -// servletResponse.getWriter().write(JSONUtil.toJsonStr(dto)); -// -// return; -// } - - String token = resolveToken(httpServletRequest); - // 对于 Token 为空的不需要去查 Redis - if (StrUtil.isNotBlank(token)) { - OnlineUserDto onlineUserDto = null; - boolean cleanUserCache = false; - try { - onlineUserDto = onlineUserService.getOne(properties.getOnlineKey() + token); - } catch (ExpiredJwtException e) { - log.error(e.getMessage()); - cleanUserCache = true; - } finally { - if (cleanUserCache || Objects.isNull(onlineUserDto)) { - userCacheClean.cleanUserCache(String.valueOf(tokenProvider.getClaims(token).get(TokenProvider.AUTHORITIES_KEY))); - } - } - if (onlineUserDto != null && StringUtils.hasText(token)) { - Authentication authentication = tokenProvider.getAuthentication(token); - SecurityContextHolder.getContext().setAuthentication(authentication); - // Token 续期 -// tokenProvider.checkRenewal(token); - } - } - filterChain.doFilter(servletRequest, servletResponse); - } - - /** - * 初步检测Token - * - * @param request / - * @return / - */ - private String resolveToken(HttpServletRequest request) { - String bearerToken = request.getHeader(properties.getHeader()); - if (StringUtils.hasText(bearerToken) && bearerToken.startsWith(properties.getTokenStartWith())) { - // 去掉令牌前缀 - return bearerToken.replace(properties.getTokenStartWith(), ""); - } else { - log.debug("非法Token:{}", bearerToken); - } - return null; - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/security/security/TokenProvider.java b/wjcy-system/src/main/java/me/zhengjie/modules/security/security/TokenProvider.java deleted file mode 100644 index db98fba..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/security/security/TokenProvider.java +++ /dev/null @@ -1,123 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.security.security; - -import cn.hutool.core.date.DateField; -import cn.hutool.core.date.DateUtil; -import cn.hutool.core.util.IdUtil; -import io.jsonwebtoken.*; -import io.jsonwebtoken.io.Decoders; -import io.jsonwebtoken.security.Keys; -import lombok.extern.slf4j.Slf4j; -import me.zhengjie.modules.security.config.bean.SecurityProperties; -import me.zhengjie.utils.RedisUtils; -import org.springframework.beans.factory.InitializingBean; -import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; -import org.springframework.security.core.Authentication; -import org.springframework.security.core.userdetails.User; -import org.springframework.stereotype.Component; -import javax.servlet.http.HttpServletRequest; -import java.security.Key; -import java.util.*; -import java.util.concurrent.TimeUnit; - -/** - * @author / - */ -@Slf4j -@Component -public class TokenProvider implements InitializingBean { - - private final SecurityProperties properties; - private final RedisUtils redisUtils; - public static final String AUTHORITIES_KEY = "user"; - private JwtParser jwtParser; - private JwtBuilder jwtBuilder; - - public TokenProvider(SecurityProperties properties, RedisUtils redisUtils) { - this.properties = properties; - this.redisUtils = redisUtils; - } - - @Override - public void afterPropertiesSet() { - byte[] keyBytes = Decoders.BASE64.decode(properties.getBase64Secret()); - Key key = Keys.hmacShaKeyFor(keyBytes); - jwtParser = Jwts.parserBuilder() - .setSigningKey(key) - .build(); - jwtBuilder = Jwts.builder() - .signWith(key, SignatureAlgorithm.HS512); - } - - /** - * 创建Token 设置永不过期, - * Token 的时间有效性转到Redis 维护 - * - * @param authentication / - * @return / - */ - public String createToken(Authentication authentication) { - return jwtBuilder - // 加入ID确保生成的 Token 都不一致 - .setId(IdUtil.simpleUUID()) - .claim(AUTHORITIES_KEY, authentication.getName()) - .setSubject(authentication.getName()) - .compact(); - } - - /** - * 依据Token 获取鉴权信息 - * - * @param token / - * @return / - */ - Authentication getAuthentication(String token) { - Claims claims = getClaims(token); - User principal = new User(claims.getSubject(), "******", new ArrayList<>()); - return new UsernamePasswordAuthenticationToken(principal, token, new ArrayList<>()); - } - - public Claims getClaims(String token) { - return jwtParser - .parseClaimsJws(token) - .getBody(); - } - - /** - * @param token 需要检查的token - */ - public void checkRenewal(String token) { - // 判断是否续期token,计算token的过期时间 - long time = redisUtils.getExpire(properties.getOnlineKey() + token) * 1000; - Date expireDate = DateUtil.offset(new Date(), DateField.MILLISECOND, (int) time); - // 判断当前时间与过期时间的时间差 - long differ = expireDate.getTime() - System.currentTimeMillis(); - // 如果在续期检查的范围内,则续期 - if (differ <= properties.getDetect()) { - long renew = time + properties.getRenew(); - redisUtils.expire(properties.getOnlineKey() + token, renew, TimeUnit.MILLISECONDS); - } - } - - public String getToken(HttpServletRequest request) { - final String requestHeader = request.getHeader(properties.getHeader()); - if (requestHeader != null && requestHeader.startsWith(properties.getTokenStartWith())) { - return requestHeader.substring(7); - } - return null; - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/security/service/OnlineUserService.java b/wjcy-system/src/main/java/me/zhengjie/modules/security/service/OnlineUserService.java deleted file mode 100644 index 96ebec4..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/security/service/OnlineUserService.java +++ /dev/null @@ -1,191 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.security.service; - -import lombok.extern.slf4j.Slf4j; -import me.zhengjie.modules.security.config.bean.SecurityProperties; -import me.zhengjie.modules.security.service.dto.JwtUserDto; -import me.zhengjie.modules.security.service.dto.OnlineUserDto; -import me.zhengjie.utils.*; -import org.springframework.data.domain.Pageable; -import org.springframework.scheduling.annotation.Async; -import org.springframework.stereotype.Service; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.*; - -/** - * @author Zheng Jie - * @date 2019年10月26日21:56:27 - */ -@Service -@Slf4j -public class OnlineUserService { - - private final SecurityProperties properties; - private final RedisUtils redisUtils; - - public OnlineUserService(SecurityProperties properties, RedisUtils redisUtils) { - this.properties = properties; - this.redisUtils = redisUtils; - } - - /** - * 保存在线用户信息 - * @param jwtUserDto / - * @param token / - * @param request / - */ - public void save(JwtUserDto jwtUserDto, String token, HttpServletRequest request){ - String dept = /*jwtUserDto.getUser().getDept().getName();*/null; - String ip = StringUtils.getIp(request); - String browser = StringUtils.getBrowser(request); -// String address = StringUtils.getCityInfo(ip); - OnlineUserDto onlineUserDto = null; - try { - onlineUserDto = new OnlineUserDto(jwtUserDto.getUsername(), jwtUserDto.getUser().getNickName(), dept, browser , ip, null, EncryptUtils.desEncrypt(token), new Date()); - } catch (Exception e) { - log.error(e.getMessage(),e); - } - redisUtils.set(properties.getOnlineKey() + token, onlineUserDto, properties.getTokenValidityInSeconds()/1000); - } - - /** - * 查询全部数据 - * @param filter / - * @param pageable / - * @return / - */ - public Map getAll(String filter, Pageable pageable){ - List onlineUserDtos = getAll(filter); - return PageUtil.toPage( - PageUtil.toPage(pageable.getPageNumber(),pageable.getPageSize(), onlineUserDtos), - onlineUserDtos.size() - ); - } - - /** - * 查询全部数据,不分页 - * @param filter / - * @return / - */ - public List getAll(String filter){ - List keys = redisUtils.scan(properties.getOnlineKey() + "*"); - Collections.reverse(keys); - List onlineUserDtos = new ArrayList<>(); - for (String key : keys) { - OnlineUserDto onlineUserDto = (OnlineUserDto) redisUtils.get(key); - if(StringUtils.isNotBlank(filter)){ - if(onlineUserDto.toString().contains(filter)){ - onlineUserDtos.add(onlineUserDto); - } - } else { - onlineUserDtos.add(onlineUserDto); - } - } - onlineUserDtos.sort((o1, o2) -> o2.getLoginTime().compareTo(o1.getLoginTime())); - return onlineUserDtos; - } - - /** - * 踢出用户 - * @param key / - */ - public void kickOut(String key){ - key = properties.getOnlineKey() + key; - redisUtils.del(key); - } - - /** - * 退出登录 - * @param token / - */ - public void logout(String token) { - String key = properties.getOnlineKey() + token; - redisUtils.del(key); - } - - /** - * 导出 - * @param all / - * @param response / - * @throws IOException / - */ - public void download(List all, HttpServletResponse response) throws IOException { - List> list = new ArrayList<>(); - for (OnlineUserDto user : all) { - Map map = new LinkedHashMap<>(); - map.put("用户名", user.getUserName()); - map.put("部门", user.getDept()); - map.put("登录IP", user.getIp()); - map.put("登录地点", user.getAddress()); - map.put("浏览器", user.getBrowser()); - map.put("登录日期", user.getLoginTime()); - list.add(map); - } - FileUtil.downloadExcel(list, response); - } - - /** - * 查询用户 - * @param key / - * @return / - */ - public OnlineUserDto getOne(String key) { - return (OnlineUserDto)redisUtils.get(key); - } - - /** - * 检测用户是否在之前已经登录,已经登录踢下线 - * @param userName 用户名 - */ - public void checkLoginOnUser(String userName, String igoreToken){ - List onlineUserDtos = getAll(userName); - if(onlineUserDtos ==null || onlineUserDtos.isEmpty()){ - return; - } - for(OnlineUserDto onlineUserDto : onlineUserDtos){ - if(onlineUserDto.getUserName().equals(userName)){ - try { - String token =EncryptUtils.desDecrypt(onlineUserDto.getKey()); - if(StringUtils.isNotBlank(igoreToken)&&!igoreToken.equals(token)){ - this.kickOut(token); - }else if(StringUtils.isBlank(igoreToken)){ - this.kickOut(token); - } - } catch (Exception e) { - log.error("checkUser is error",e); - } - } - } - } - - /** - * 根据用户名强退用户 - * @param username / - */ - @Async - public void kickOutForUsername(String username) throws Exception { - List onlineUsers = getAll(username); - for (OnlineUserDto onlineUser : onlineUsers) { - if (onlineUser.getUserName().equals(username)) { - String token =EncryptUtils.desDecrypt(onlineUser.getKey()); - kickOut(token); - } - } - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/security/service/UserCacheClean.java b/wjcy-system/src/main/java/me/zhengjie/modules/security/service/UserCacheClean.java deleted file mode 100644 index 3f9fe5b..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/security/service/UserCacheClean.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2019-2020 the original author or authors. - * - * 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 me.zhengjie.modules.security.service; - -import me.zhengjie.utils.StringUtils; -import org.springframework.stereotype.Component; - -/** - * @author: liaojinlong - * @date: 2020/6/11 18:01 - * @apiNote: 用于清理 用户登录信息缓存,为防止Spring循环依赖与安全考虑 ,单独构成工具类 - */ -@Component -public class UserCacheClean { - - /** - * 清理特定用户缓存信息
- * 用户信息变更时 - * - * @param userName / - */ - public void cleanUserCache(String userName) { - if (StringUtils.isNotEmpty(userName)) { - UserDetailsServiceImpl.userDtoCache.remove(userName); - } - } - - /** - * 清理所有用户的缓存信息
- * ,如发生角色授权信息变化,可以简便的全部失效缓存 - */ - public void cleanAll() { - UserDetailsServiceImpl.userDtoCache.clear(); - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/security/service/UserDetailsServiceImpl.java b/wjcy-system/src/main/java/me/zhengjie/modules/security/service/UserDetailsServiceImpl.java deleted file mode 100644 index c3657d1..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/security/service/UserDetailsServiceImpl.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.security.service; - -import lombok.RequiredArgsConstructor; -import me.zhengjie.exception.BadRequestException; -import me.zhengjie.exception.EntityNotFoundException; -import me.zhengjie.modules.security.config.bean.LoginProperties; -import me.zhengjie.modules.security.service.dto.JwtUserDto; -import me.zhengjie.modules.system.service.DataService; -import me.zhengjie.modules.system.service.RoleService; -import me.zhengjie.modules.system.service.UserService; -import me.zhengjie.modules.system.service.dto.UserDto; -import org.springframework.security.core.userdetails.UserDetailsService; -import org.springframework.security.core.userdetails.UsernameNotFoundException; -import org.springframework.stereotype.Service; - -import java.util.List; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; - -/** - * @author Zheng Jie - * @date 2018-11-22 - */ -@RequiredArgsConstructor -@Service("userDetailsService") -public class UserDetailsServiceImpl implements UserDetailsService { - private final UserService userService; - private final RoleService roleService; - private final DataService dataService; - private final LoginProperties loginProperties; - - public void setEnableCache(boolean enableCache) { - this.loginProperties.setCacheEnable(enableCache); - } - - /** - * 用户信息缓存 - * - * @see {@link UserCacheClean} - */ - static Map userDtoCache = new ConcurrentHashMap<>(); - - @Override - public JwtUserDto loadUserByUsername(String username) { - boolean searchDb = true; - JwtUserDto jwtUserDto = null; - if (loginProperties.isCacheEnable() && userDtoCache.containsKey(username)) { - jwtUserDto = userDtoCache.get(username); - // 检查dataScope是否修改 - List dataScopes = jwtUserDto.getDataScopes(); - dataScopes.clear(); - dataScopes.addAll(dataService.getDeptIds(jwtUserDto.getUser())); - searchDb = false; - } - if (searchDb) { - UserDto user; - try { - user = userService.findByName(username); - } catch (EntityNotFoundException e) { - // SpringSecurity会自动转换UsernameNotFoundException为BadCredentialsException - throw new UsernameNotFoundException("", e); - } - if (user == null) { - throw new UsernameNotFoundException(""); - } else { - if (!user.getEnabled()) { - throw new BadRequestException("账号未激活!"); - } - jwtUserDto = new JwtUserDto( - user, - dataService.getDeptIds(user), - roleService.mapToGrantedAuthorities(user) - ); - userDtoCache.put(username, jwtUserDto); - } - } - return jwtUserDto; - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/security/service/dto/AuthUserDto.java b/wjcy-system/src/main/java/me/zhengjie/modules/security/service/dto/AuthUserDto.java deleted file mode 100644 index 5219fc5..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/security/service/dto/AuthUserDto.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.security.service.dto; - -import lombok.Getter; -import lombok.Setter; -import javax.validation.constraints.NotBlank; - -/** - * @author Zheng Jie - * @date 2018-11-30 - */ -@Getter -@Setter -public class AuthUserDto { - - @NotBlank - private String username; - - @NotBlank - private String password; - - private String code; - - private String uuid = ""; -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/security/service/dto/JwtUserDto.java b/wjcy-system/src/main/java/me/zhengjie/modules/security/service/dto/JwtUserDto.java deleted file mode 100644 index 00f4372..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/security/service/dto/JwtUserDto.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.security.service.dto; - -import com.alibaba.fastjson.annotation.JSONField; -import lombok.AllArgsConstructor; -import lombok.Getter; -import me.zhengjie.modules.system.service.dto.UserDto; -import org.springframework.security.core.GrantedAuthority; -import org.springframework.security.core.userdetails.UserDetails; -import java.util.List; -import java.util.Set; -import java.util.stream.Collectors; - -/** - * @author Zheng Jie - * @date 2018-11-23 - */ -@Getter -@AllArgsConstructor -public class JwtUserDto implements UserDetails { - - private final UserDto user; - - private final List dataScopes; - - @JSONField(serialize = false) - private final List authorities; - - public Set getRoles() { - return authorities.stream().map(GrantedAuthority::getAuthority).collect(Collectors.toSet()); - } - - @Override - @JSONField(serialize = false) - public String getPassword() { - return user.getPassword(); - } - - @Override - @JSONField(serialize = false) - public String getUsername() { - return user.getUsername(); - } - - @JSONField(serialize = false) - @Override - public boolean isAccountNonExpired() { - return true; - } - - @JSONField(serialize = false) - @Override - public boolean isAccountNonLocked() { - return true; - } - - @JSONField(serialize = false) - @Override - public boolean isCredentialsNonExpired() { - return true; - } - - @Override - @JSONField(serialize = false) - public boolean isEnabled() { - return user.getEnabled(); - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/security/service/dto/OnlineUserDto.java b/wjcy-system/src/main/java/me/zhengjie/modules/security/service/dto/OnlineUserDto.java deleted file mode 100644 index 290ab6d..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/security/service/dto/OnlineUserDto.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.security.service.dto; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; -import java.util.Date; - -/** - * 在线用户 - * @author Zheng Jie - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class OnlineUserDto { - - /** - * 用户名 - */ - private String userName; - - /** - * 昵称 - */ - private String nickName; - - /** - * 岗位 - */ - private String dept; - - /** - * 浏览器 - */ - private String browser; - - /** - * IP - */ - private String ip; - - /** - * 地址 - */ - private String address; - - /** - * token - */ - private String key; - - /** - * 登录时间 - */ - private Date loginTime; - - -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/system/domain/Dept.java b/wjcy-system/src/main/java/me/zhengjie/modules/system/domain/Dept.java deleted file mode 100644 index 9f28af2..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/system/domain/Dept.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.system.domain; - -import com.alibaba.fastjson.annotation.JSONField; -import io.swagger.annotations.ApiModelProperty; -import lombok.Getter; -import lombok.Setter; -import me.zhengjie.base.BaseEntity; -import javax.persistence.*; -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; -import java.io.Serializable; -import java.util.Objects; -import java.util.Set; - -/** -* @author Zheng Jie -* @date 2019-03-25 -*/ -@Entity -@Getter -@Setter -@Table(name="sys_dept") -public class Dept extends BaseEntity implements Serializable { - - @Id - @Column(name = "dept_id") - @NotNull(groups = Update.class) - @ApiModelProperty(value = "ID", hidden = true) - @GeneratedValue(strategy = GenerationType.IDENTITY) - private Long id; - - @JSONField(serialize = false) - @ManyToMany(mappedBy = "depts") - @ApiModelProperty(value = "角色") - private Set roles; - - @ApiModelProperty(value = "排序") - private Integer deptSort; - - @NotBlank - @ApiModelProperty(value = "部门名称") - private String name; - - @NotNull - @ApiModelProperty(value = "是否启用") - private Boolean enabled; - - @ApiModelProperty(value = "上级部门") - private Long pid; - - @ApiModelProperty(value = "子节点数目", hidden = true) - private Integer subCount = 0; - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Dept dept = (Dept) o; - return Objects.equals(id, dept.id) && - Objects.equals(name, dept.name); - } - - @Override - public int hashCode() { - return Objects.hash(id, name); - } -} \ No newline at end of file diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/system/domain/Dict.java b/wjcy-system/src/main/java/me/zhengjie/modules/system/domain/Dict.java deleted file mode 100644 index 689cf2e..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/system/domain/Dict.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.system.domain; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Getter; -import lombok.Setter; -import me.zhengjie.base.BaseEntity; -import javax.persistence.*; -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; -import java.io.Serializable; -import java.util.List; - -/** -* @author Zheng Jie -* @date 2019-04-10 -*/ -@Entity -@Getter -@Setter -@Table(name="sys_dict") -public class Dict extends BaseEntity implements Serializable { - - @Id - @Column(name = "dict_id") - @NotNull(groups = Update.class) - @ApiModelProperty(value = "ID", hidden = true) - @GeneratedValue(strategy = GenerationType.IDENTITY) - private Long id; - - @OneToMany(mappedBy = "dict",cascade={CascadeType.PERSIST,CascadeType.REMOVE}) - private List dictDetails; - - @NotBlank - @ApiModelProperty(value = "名称") - private String name; - - @ApiModelProperty(value = "描述") - private String description; -} \ No newline at end of file diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/system/domain/DictDetail.java b/wjcy-system/src/main/java/me/zhengjie/modules/system/domain/DictDetail.java deleted file mode 100644 index 554dde6..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/system/domain/DictDetail.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.system.domain; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Getter; -import lombok.Setter; -import me.zhengjie.base.BaseEntity; -import javax.persistence.*; -import javax.validation.constraints.NotNull; -import java.io.Serializable; - -/** -* @author Zheng Jie -* @date 2019-04-10 -*/ -@Entity -@Getter -@Setter -@Table(name="sys_dict_detail") -public class DictDetail extends BaseEntity implements Serializable { - - @Id - @Column(name = "detail_id") - @NotNull(groups = Update.class) - @ApiModelProperty(value = "ID", hidden = true) - @GeneratedValue(strategy = GenerationType.IDENTITY) - private Long id; - - @JoinColumn(name = "dict_id") - @ManyToOne(fetch=FetchType.LAZY) - @ApiModelProperty(value = "字典", hidden = true) - private Dict dict; - - @ApiModelProperty(value = "字典标签") - private String label; - - @ApiModelProperty(value = "字典值") - private String value; - - @ApiModelProperty(value = "排序") - private Integer dictSort = 999; -} \ No newline at end of file diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/system/domain/Job.java b/wjcy-system/src/main/java/me/zhengjie/modules/system/domain/Job.java deleted file mode 100644 index f2d358a..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/system/domain/Job.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.system.domain; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Getter; -import lombok.Setter; -import me.zhengjie.base.BaseEntity; -import javax.persistence.*; -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; -import java.io.Serializable; -import java.util.Objects; - -/** -* @author Zheng Jie -* @date 2019-03-29 -*/ -@Entity -@Getter -@Setter -@Table(name="sys_job") -public class Job extends BaseEntity implements Serializable { - - @Id - @Column(name = "job_id") - @NotNull(groups = Update.class) - @ApiModelProperty(value = "ID", hidden = true) - @GeneratedValue(strategy = GenerationType.IDENTITY) - private Long id; - - @NotBlank - @ApiModelProperty(value = "岗位名称") - private String name; - - @NotNull - @ApiModelProperty(value = "岗位排序") - private Long jobSort; - - @NotNull - @ApiModelProperty(value = "是否启用") - private Boolean enabled; - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Job job = (Job) o; - return Objects.equals(id, job.id); - } - - @Override - public int hashCode() { - return Objects.hash(id); - } -} \ No newline at end of file diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/system/domain/Menu.java b/wjcy-system/src/main/java/me/zhengjie/modules/system/domain/Menu.java deleted file mode 100644 index b2ea225..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/system/domain/Menu.java +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.system.domain; - -import com.alibaba.fastjson.annotation.JSONField; -import io.swagger.annotations.ApiModelProperty; -import lombok.Getter; -import lombok.Setter; -import me.zhengjie.base.BaseEntity; - -import javax.persistence.*; -import javax.validation.constraints.NotNull; -import java.io.Serializable; -import java.util.Objects; -import java.util.Set; - -/** - * @author Zheng Jie - * @date 2018-12-17 - */ -@Entity -@Getter -@Setter -@Table(name = "sys_menu") -public class Menu extends BaseEntity implements Serializable { - - @Id - @Column(name = "menu_id") - @NotNull(groups = {Update.class}) - @ApiModelProperty(value = "ID", hidden = true) - @GeneratedValue(strategy = GenerationType.IDENTITY) - private Long id; - - @JSONField(serialize = false) - @ManyToMany(mappedBy = "menus") - @ApiModelProperty(value = "菜单角色") - private Set roles; - - @ApiModelProperty(value = "菜单标题") - private String title; - - @Column(name = "name") - @ApiModelProperty(value = "菜单组件名称") - private String componentName; - - @ApiModelProperty(value = "排序") - private Integer menuSort = 999; - - @ApiModelProperty(value = "组件路径") - private String component; - - @ApiModelProperty(value = "路由地址") - private String path; - - @ApiModelProperty(value = "菜单类型,目录、菜单、按钮") - private Integer type; - - @ApiModelProperty(value = "权限标识") - private String permission; - - @ApiModelProperty(value = "菜单图标") - private String icon; - - @Column(columnDefinition = "bit(1) default 0") - @ApiModelProperty(value = "缓存") - private Boolean cache; - - @Column(columnDefinition = "bit(1) default 0") - @ApiModelProperty(value = "是否隐藏") - private Boolean hidden; - - @ApiModelProperty(value = "上级菜单") - private Long pid; - - @ApiModelProperty(value = "子节点数目", hidden = true) - private Integer subCount = 0; - - @ApiModelProperty(value = "外链菜单") - private Boolean iFrame; - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Menu menu = (Menu) o; - return Objects.equals(id, menu.id); - } - - @Override - public int hashCode() { - return Objects.hash(id); - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/system/domain/Role.java b/wjcy-system/src/main/java/me/zhengjie/modules/system/domain/Role.java deleted file mode 100644 index 8b3ad19..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/system/domain/Role.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.system.domain; - -import com.alibaba.fastjson.annotation.JSONField; -import io.swagger.annotations.ApiModelProperty; -import lombok.Getter; -import lombok.Setter; -import me.zhengjie.base.BaseEntity; -import me.zhengjie.utils.enums.DataScopeEnum; - -import javax.persistence.*; -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; -import java.io.Serializable; -import java.util.Objects; -import java.util.Set; - -/** - * 角色 - * @author Zheng Jie - * @date 2018-11-22 - */ -@Getter -@Setter -@Entity -@Table(name = "sys_role") -public class Role extends BaseEntity implements Serializable { - - @Id - @Column(name = "role_id") - @NotNull(groups = {Update.class}) - @GeneratedValue(strategy = GenerationType.IDENTITY) - @ApiModelProperty(value = "ID", hidden = true) - private Long id; - - @JSONField(serialize = false) - @ManyToMany(mappedBy = "roles") - @ApiModelProperty(value = "用户", hidden = true) - private Set users; - - @ManyToMany - @JoinTable(name = "sys_roles_menus", - joinColumns = {@JoinColumn(name = "role_id",referencedColumnName = "role_id")}, - inverseJoinColumns = {@JoinColumn(name = "menu_id",referencedColumnName = "menu_id")}) - @ApiModelProperty(value = "菜单", hidden = true) - private Set menus; - - @ManyToMany - @JoinTable(name = "sys_roles_depts", - joinColumns = {@JoinColumn(name = "role_id",referencedColumnName = "role_id")}, - inverseJoinColumns = {@JoinColumn(name = "dept_id",referencedColumnName = "dept_id")}) - @ApiModelProperty(value = "部门", hidden = true) - private Set depts; - - @NotBlank - @ApiModelProperty(value = "名称", hidden = true) - private String name; - - @ApiModelProperty(value = "数据权限,全部 、 本级 、 自定义") - private String dataScope = DataScopeEnum.THIS_LEVEL.getValue(); - - @Column(name = "level") - @ApiModelProperty(value = "级别,数值越小,级别越大") - private Integer level = 3; - - @ApiModelProperty(value = "描述") - private String description; - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Role role = (Role) o; - return Objects.equals(id, role.id); - } - - @Override - public int hashCode() { - return Objects.hash(id); - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/system/domain/User.java b/wjcy-system/src/main/java/me/zhengjie/modules/system/domain/User.java deleted file mode 100644 index c496c91..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/system/domain/User.java +++ /dev/null @@ -1,129 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.system.domain; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Getter; -import lombok.Setter; -import me.zhengjie.annotation.CheckPwd; -import me.zhengjie.base.BaseEntity; -import javax.persistence.*; -import javax.validation.constraints.Email; -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Null; -import java.io.Serializable; -import java.util.Date; -import java.util.Objects; -import java.util.Set; - -/** - * @author Zheng Jie - * @date 2018-11-22 - */ -@Entity -@Getter -@Setter -@Table(name="sys_user") -public class User extends BaseEntity implements Serializable { - - @Id - @Column(name = "user_id") - @NotNull(groups = Update.class) - @GeneratedValue(strategy = GenerationType.IDENTITY) - @ApiModelProperty(value = "ID", hidden = true) - private Long id; - - @ManyToMany - @ApiModelProperty(value = "用户角色") - @JoinTable(name = "sys_users_roles", - joinColumns = {@JoinColumn(name = "user_id",referencedColumnName = "user_id")}, - inverseJoinColumns = {@JoinColumn(name = "role_id",referencedColumnName = "role_id")}) - private Set roles; - - @ManyToMany - @ApiModelProperty(value = "用户岗位") - @JoinTable(name = "sys_users_jobs", - joinColumns = {@JoinColumn(name = "user_id",referencedColumnName = "user_id")}, - inverseJoinColumns = {@JoinColumn(name = "job_id",referencedColumnName = "job_id")}) - private Set jobs; - - @OneToOne - @JoinColumn(name = "dept_id") - @ApiModelProperty(value = "用户部门") - private Dept dept; - - @NotBlank(groups = Create.class) - @Column(unique = true) - @ApiModelProperty(value = "用户名称") - private String username; - - @NotBlank(groups = Create.class) - @ApiModelProperty(value = "用户昵称") - private String nickName; - - @Email(groups = Create.class) - @NotBlank(groups = Create.class) - @ApiModelProperty(value = "邮箱") - private String email; - - @NotBlank(groups = Create.class) - @ApiModelProperty(value = "电话号码") - private String phone; - - @ApiModelProperty(value = "用户性别") - private String gender; - - @ApiModelProperty(value = "头像真实名称",hidden = true) - private String avatarName; - - @ApiModelProperty(value = "头像存储的路径", hidden = true) - private String avatarPath; - - @NotBlank(groups = Create.class) - @CheckPwd(groups = Create.class) - @ApiModelProperty(value = "密码") - private String password; - - @NotNull(groups = Create.class) - @ApiModelProperty(value = "是否启用") - private Boolean enabled; - - @ApiModelProperty(value = "是否为admin账号", hidden = true) - private Boolean isAdmin = false; - - @Column(name = "pwd_reset_time") - @ApiModelProperty(value = "最后修改密码的时间", hidden = true) - private Date pwdResetTime; - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - User user = (User) o; - return Objects.equals(id, user.id) && - Objects.equals(username, user.username); - } - - @Override - public int hashCode() { - return Objects.hash(id, username); - } -} \ No newline at end of file diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/system/domain/vo/MenuMetaVo.java b/wjcy-system/src/main/java/me/zhengjie/modules/system/domain/vo/MenuMetaVo.java deleted file mode 100644 index 647baa8..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/system/domain/vo/MenuMetaVo.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.system.domain.vo; - -import lombok.AllArgsConstructor; -import lombok.Data; -import java.io.Serializable; - -/** - * @author Zheng Jie - * @date 2018-12-20 - */ -@Data -@AllArgsConstructor -public class MenuMetaVo implements Serializable { - - private String title; - - private String icon; - - private Boolean noCache; -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/system/domain/vo/MenuVo.java b/wjcy-system/src/main/java/me/zhengjie/modules/system/domain/vo/MenuVo.java deleted file mode 100644 index 82fc0cc..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/system/domain/vo/MenuVo.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.system.domain.vo; - -import com.fasterxml.jackson.annotation.JsonInclude; -import lombok.Data; -import java.io.Serializable; -import java.util.List; - -/** - * 构建前端路由时用到 - * @author Zheng Jie - * @date 2018-12-20 - */ -@Data -@JsonInclude(JsonInclude.Include.NON_EMPTY) -public class MenuVo implements Serializable { - - private String name; - - private String path; - - private Boolean hidden; - - private String redirect; - - private String component; - - private Boolean alwaysShow; - - private MenuMetaVo meta; - - private List children; -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/system/domain/vo/UserPassVo.java b/wjcy-system/src/main/java/me/zhengjie/modules/system/domain/vo/UserPassVo.java deleted file mode 100644 index e92d472..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/system/domain/vo/UserPassVo.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.system.domain.vo; - -import lombok.Data; -import me.zhengjie.annotation.CheckPwd; - -import javax.validation.constraints.NotBlank; - -/** - * 修改密码的 Vo 类 - * @author Zheng Jie - * @date 2019年7月11日13:59:49 - */ -@Data -public class UserPassVo { - - private String oldPass; - - // 注:这里传的是加密后的字符串 - @NotBlank -// @CheckPwd - private String newPass; -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/system/repository/DeptRepository.java b/wjcy-system/src/main/java/me/zhengjie/modules/system/repository/DeptRepository.java deleted file mode 100644 index 9858322..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/system/repository/DeptRepository.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.system.repository; - -import me.zhengjie.modules.system.domain.Dept; -import org.springframework.data.jpa.repository.JpaRepository; -import org.springframework.data.jpa.repository.JpaSpecificationExecutor; -import org.springframework.data.jpa.repository.Modifying; -import org.springframework.data.jpa.repository.Query; -import java.util.List; -import java.util.Set; - -/** -* @author Zheng Jie -* @date 2019-03-25 -*/ -public interface DeptRepository extends JpaRepository, JpaSpecificationExecutor { - - /** - * 根据 PID 查询 - * @param id pid - * @return / - */ - List findByPid(Long id); - - /** - * 获取顶级部门 - * @return / - */ - List findByPidIsNull(); - - /** - * 根据角色ID 查询 - * @param roleId 角色ID - * @return / - */ - @Query(value = "select d.* from sys_dept d, sys_roles_depts r where " + - "d.dept_id = r.dept_id and r.role_id = ?1", nativeQuery = true) - Set findByRoleId(Long roleId); - - /** - * 判断是否存在子节点 - * @param pid / - * @return / - */ - int countByPid(Long pid); - - /** - * 根据ID更新sub_count - * @param count / - * @param id / - */ - @Modifying - @Query(value = " update sys_dept set sub_count = ?1 where dept_id = ?2 ",nativeQuery = true) - void updateSubCntById(Integer count, Long id); -} \ No newline at end of file diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/system/repository/DictDetailRepository.java b/wjcy-system/src/main/java/me/zhengjie/modules/system/repository/DictDetailRepository.java deleted file mode 100644 index d80b970..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/system/repository/DictDetailRepository.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.system.repository; - -import me.zhengjie.modules.system.domain.DictDetail; -import org.springframework.data.jpa.repository.JpaRepository; -import org.springframework.data.jpa.repository.JpaSpecificationExecutor; - -import java.util.List; - -/** -* @author Zheng Jie -* @date 2019-04-10 -*/ -public interface DictDetailRepository extends JpaRepository, JpaSpecificationExecutor { - - /** - * 根据字典名称查询 - * @param name / - * @return / - */ - List findByDictName(String name); -} \ No newline at end of file diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/system/repository/DictRepository.java b/wjcy-system/src/main/java/me/zhengjie/modules/system/repository/DictRepository.java deleted file mode 100644 index f09b6d1..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/system/repository/DictRepository.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.system.repository; - -import me.zhengjie.modules.system.domain.Dict; -import org.springframework.data.jpa.repository.JpaRepository; -import org.springframework.data.jpa.repository.JpaSpecificationExecutor; - -import java.util.List; -import java.util.Set; - -/** -* @author Zheng Jie -* @date 2019-04-10 -*/ -public interface DictRepository extends JpaRepository, JpaSpecificationExecutor { - - /** - * 删除 - * @param ids / - */ - void deleteByIdIn(Set ids); - - /** - * 查询 - * @param ids / - * @return / - */ - List findByIdIn(Set ids); -} \ No newline at end of file diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/system/repository/JobRepository.java b/wjcy-system/src/main/java/me/zhengjie/modules/system/repository/JobRepository.java deleted file mode 100644 index e39ebf0..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/system/repository/JobRepository.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.system.repository; - -import me.zhengjie.modules.system.domain.Job; -import org.springframework.data.jpa.repository.JpaRepository; -import org.springframework.data.jpa.repository.JpaSpecificationExecutor; - -import java.util.Set; - -/** -* @author Zheng Jie -* @date 2019-03-29 -*/ -public interface JobRepository extends JpaRepository, JpaSpecificationExecutor { - - /** - * 根据名称查询 - * @param name 名称 - * @return / - */ - Job findByName(String name); - - /** - * 根据Id删除 - * @param ids / - */ - void deleteAllByIdIn(Set ids); -} \ No newline at end of file diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/system/repository/MenuRepository.java b/wjcy-system/src/main/java/me/zhengjie/modules/system/repository/MenuRepository.java deleted file mode 100644 index 0907606..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/system/repository/MenuRepository.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.system.repository; - -import me.zhengjie.modules.system.domain.Menu; -import org.springframework.data.jpa.repository.JpaRepository; -import org.springframework.data.jpa.repository.JpaSpecificationExecutor; -import org.springframework.data.jpa.repository.Modifying; -import org.springframework.data.jpa.repository.Query; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Set; - -/** - * @author Zheng Jie - * @date 2018-12-17 - */ -public interface MenuRepository extends JpaRepository, JpaSpecificationExecutor { - - /** - * 根据菜单标题查询 - * @param title 菜单标题 - * @return / - */ - Menu findByTitle(String title); - - /** - * 根据组件名称查询 - * @param name 组件名称 - * @return / - */ - Menu findByComponentName(String name); - - /** - * 根据菜单的 PID 查询 - * @param pid / - * @return / - */ - List findByPid(long pid); - - /** - * 查询顶级菜单 - * @return / - */ - List findByPidIsNull(); - - /** - * 根据角色ID与菜单类型查询菜单 - * @param roleIds roleIDs - * @param type 类型 - * @return / - */ - @Query(value = "SELECT m.* FROM sys_menu m, sys_roles_menus r WHERE " + - "m.menu_id = r.menu_id AND r.role_id IN ?1 AND type != ?2 order by m.menu_sort asc",nativeQuery = true) - LinkedHashSet findByRoleIdsAndTypeNot(Set roleIds, int type); - - /** - * 获取节点数量 - * @param id / - * @return / - */ - int countByPid(Long id); - - /** - * 更新节点数目 - * @param count / - * @param menuId / - */ - @Modifying - @Query(value = " update sys_menu set sub_count = ?1 where menu_id = ?2 ",nativeQuery = true) - void updateSubCntById(int count, Long menuId); -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/system/repository/RoleRepository.java b/wjcy-system/src/main/java/me/zhengjie/modules/system/repository/RoleRepository.java deleted file mode 100644 index 8e76cc5..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/system/repository/RoleRepository.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.system.repository; - -import me.zhengjie.modules.system.domain.Role; -import org.springframework.data.jpa.repository.JpaRepository; -import org.springframework.data.jpa.repository.JpaSpecificationExecutor; -import org.springframework.data.jpa.repository.Modifying; -import org.springframework.data.jpa.repository.Query; - -import java.util.List; -import java.util.Set; - -/** - * @author Zheng Jie - * @date 2018-12-03 - */ -public interface RoleRepository extends JpaRepository, JpaSpecificationExecutor { - - /** - * 根据名称查询 - * @param name / - * @return / - */ - Role findByName(String name); - - /** - * 删除多个角色 - * @param ids / - */ - void deleteAllByIdIn(Set ids); - - /** - * 根据用户ID查询 - * @param id 用户ID - * @return / - */ - @Query(value = "SELECT r.* FROM sys_role r, sys_users_roles u WHERE " + - "r.role_id = u.role_id AND u.user_id = ?1",nativeQuery = true) - Set findByUserId(Long id); - - /** - * 解绑角色菜单 - * @param id 菜单ID - */ - @Modifying - @Query(value = "delete from sys_roles_menus where menu_id = ?1",nativeQuery = true) - void untiedMenu(Long id); - - /** - * 根据部门查询 - * @param deptIds / - * @return / - */ - @Query(value = "select count(1) from sys_role r, sys_roles_depts d where " + - "r.role_id = d.role_id and d.dept_id in ?1",nativeQuery = true) - int countByDepts(Set deptIds); - - /** - * 根据菜单Id查询 - * @param menuIds / - * @return / - */ - @Query(value = "SELECT r.* FROM sys_role r, sys_roles_menus m WHERE " + - "r.role_id = m.role_id AND m.menu_id in ?1",nativeQuery = true) - List findInMenuId(List menuIds); -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/system/repository/UserRepository.java b/wjcy-system/src/main/java/me/zhengjie/modules/system/repository/UserRepository.java deleted file mode 100644 index c5c88a8..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/system/repository/UserRepository.java +++ /dev/null @@ -1,130 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.system.repository; - -import me.zhengjie.modules.system.domain.User; -import org.springframework.data.jpa.repository.JpaRepository; -import org.springframework.data.jpa.repository.JpaSpecificationExecutor; -import org.springframework.data.jpa.repository.Modifying; -import org.springframework.data.jpa.repository.Query; -import java.util.Date; -import java.util.List; -import java.util.Set; - -/** - * @author Zheng Jie - * @date 2018-11-22 - */ -public interface UserRepository extends JpaRepository, JpaSpecificationExecutor { - - /** - * 根据用户名查询 - * @param username 用户名 - * @return / - */ - User findByUsername(String username); - - /** - * 根据邮箱查询 - * @param email 邮箱 - * @return / - */ - User findByEmail(String email); - - /** - * 根据手机号查询 - * @param phone 手机号 - * @return / - */ - User findByPhone(String phone); - - /** - * 修改密码 - * @param username 用户名 - * @param pass 密码 - * @param lastPasswordResetTime / - */ - @Modifying - @Query(value = "update sys_user set password = ?2 , pwd_reset_time = ?3 where username = ?1",nativeQuery = true) - void updatePass(String username, String pass, Date lastPasswordResetTime); - - /** - * 修改邮箱 - * @param username 用户名 - * @param email 邮箱 - */ - @Modifying - @Query(value = "update sys_user set email = ?2 where username = ?1",nativeQuery = true) - void updateEmail(String username, String email); - - /** - * 根据角色查询用户 - * @param roleId / - * @return / - */ - @Query(value = "SELECT u.* FROM sys_user u, sys_users_roles r WHERE" + - " u.user_id = r.user_id AND r.role_id = ?1", nativeQuery = true) - List findByRoleId(Long roleId); - - /** - * 根据角色中的部门查询 - * @param deptId / - * @return / - */ - @Query(value = "SELECT u.* FROM sys_user u, sys_users_roles r, sys_roles_depts d WHERE " + - "u.user_id = r.user_id AND r.role_id = d.role_id AND d.dept_id = ?1 group by u.user_id", nativeQuery = true) - List findByRoleDeptId(Long deptId); - - /** - * 根据菜单查询 - * @param id 菜单ID - * @return / - */ - @Query(value = "SELECT u.* FROM sys_user u, sys_users_roles ur, sys_roles_menus rm WHERE\n" + - "u.user_id = ur.user_id AND ur.role_id = rm.role_id AND rm.menu_id = ?1 group by u.user_id", nativeQuery = true) - List findByMenuId(Long id); - - /** - * 根据Id删除 - * @param ids / - */ - void deleteAllByIdIn(Set ids); - - /** - * 根据岗位查询 - * @param ids / - * @return / - */ - @Query(value = "SELECT count(1) FROM sys_user u, sys_users_jobs j WHERE u.user_id = j.user_id AND j.job_id IN ?1", nativeQuery = true) - int countByJobs(Set ids); - - /** - * 根据部门查询 - * @param deptIds / - * @return / - */ - @Query(value = "SELECT count(1) FROM sys_user u WHERE u.dept_id IN ?1", nativeQuery = true) - int countByDepts(Set deptIds); - - /** - * 根据角色查询 - * @param ids / - * @return / - */ - @Query(value = "SELECT count(1) FROM sys_user u, sys_users_roles r WHERE " + - "u.user_id = r.user_id AND r.role_id in ?1", nativeQuery = true) - int countByRoles(Set ids); -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/system/rest/DeptController.java b/wjcy-system/src/main/java/me/zhengjie/modules/system/rest/DeptController.java deleted file mode 100644 index 9b3b0ef..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/system/rest/DeptController.java +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.system.rest; - -import cn.hutool.core.collection.CollectionUtil; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import lombok.RequiredArgsConstructor; -import me.zhengjie.annotation.Log; -import me.zhengjie.exception.BadRequestException; -import me.zhengjie.modules.system.domain.Dept; -import me.zhengjie.modules.system.service.DeptService; -import me.zhengjie.modules.system.service.dto.DeptDto; -import me.zhengjie.modules.system.service.dto.DeptQueryCriteria; -import me.zhengjie.utils.PageUtil; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import javax.servlet.http.HttpServletResponse; -import java.util.*; - -/** -* @author Zheng Jie -* @date 2019-03-25 -*/ -@RestController -@RequiredArgsConstructor -@Api(tags = "系统:部门管理") -@RequestMapping("/api/dept") -public class DeptController { - - private final DeptService deptService; - private static final String ENTITY_NAME = "dept"; - - @ApiOperation("导出部门数据") - @GetMapping(value = "/download") - @PreAuthorize("@el.check('dept:list')") - public void download(HttpServletResponse response, DeptQueryCriteria criteria) throws Exception { - deptService.download(deptService.queryAll(criteria, false), response); - } - - @ApiOperation("查询部门") - @GetMapping - @PreAuthorize("@el.check('user:list','dept:list')") - public ResponseEntity query(DeptQueryCriteria criteria) throws Exception { - List deptDtos = deptService.queryAll(criteria, true); - return new ResponseEntity<>(PageUtil.toPage(deptDtos, deptDtos.size()),HttpStatus.OK); - } - - @ApiOperation("查询部门:根据ID获取同级与上级数据") - @PostMapping("/superior") - @PreAuthorize("@el.check('user:list','dept:list')") - public ResponseEntity getSuperior(@RequestBody List ids) { - Set deptDtos = new LinkedHashSet<>(); - for (Long id : ids) { - DeptDto deptDto = deptService.findById(id); - List depts = deptService.getSuperior(deptDto, new ArrayList<>()); - deptDtos.addAll(depts); - } - return new ResponseEntity<>(deptService.buildTree(new ArrayList<>(deptDtos)),HttpStatus.OK); - } - - @Log("新增部门") - @ApiOperation("新增部门") - @PostMapping - @PreAuthorize("@el.check('dept:add')") - public ResponseEntity create(@Validated @RequestBody Dept resources){ - if (resources.getId() != null) { - throw new BadRequestException("A new "+ ENTITY_NAME +" cannot already have an ID"); - } - deptService.create(resources); - return new ResponseEntity<>(HttpStatus.CREATED); - } - - @Log("修改部门") - @ApiOperation("修改部门") - @PutMapping - @PreAuthorize("@el.check('dept:edit')") - public ResponseEntity update(@Validated(Dept.Update.class) @RequestBody Dept resources){ - deptService.update(resources); - return new ResponseEntity<>(HttpStatus.NO_CONTENT); - } - - @Log("删除部门") - @ApiOperation("删除部门") - @DeleteMapping - @PreAuthorize("@el.check('dept:del')") - public ResponseEntity delete(@RequestBody Set ids){ - Set deptDtos = new HashSet<>(); - for (Long id : ids) { - List deptList = deptService.findByPid(id); - deptDtos.add(deptService.findById(id)); - if(CollectionUtil.isNotEmpty(deptList)){ - deptDtos = deptService.getDeleteDepts(deptList, deptDtos); - } - } - // 验证是否被角色或用户关联 - deptService.verification(deptDtos); - deptService.delete(deptDtos); - return new ResponseEntity<>(HttpStatus.OK); - } -} \ No newline at end of file diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/system/rest/DictController.java b/wjcy-system/src/main/java/me/zhengjie/modules/system/rest/DictController.java deleted file mode 100644 index f1e4d58..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/system/rest/DictController.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.system.rest; - -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import lombok.RequiredArgsConstructor; -import me.zhengjie.annotation.Log; -import me.zhengjie.exception.BadRequestException; -import me.zhengjie.modules.system.domain.Dict; -import me.zhengjie.modules.system.service.DictService; -import me.zhengjie.modules.system.service.dto.DictQueryCriteria; -import org.springframework.data.domain.Pageable; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.Set; - -/** -* @author Zheng Jie -* @date 2019-04-10 -*/ -@RestController -@RequiredArgsConstructor -@Api(tags = "系统:字典管理") -@RequestMapping("/api/dict") -public class DictController { - - private final DictService dictService; - private static final String ENTITY_NAME = "dict"; - - @ApiOperation("导出字典数据") - @GetMapping(value = "/download") - @PreAuthorize("@el.check('dict:list')") - public void download(HttpServletResponse response, DictQueryCriteria criteria) throws IOException { - dictService.download(dictService.queryAll(criteria), response); - } - - @ApiOperation("查询字典") - @GetMapping(value = "/all") - @PreAuthorize("@el.check('dict:list')") - public ResponseEntity queryAll(){ - return new ResponseEntity<>(dictService.queryAll(new DictQueryCriteria()),HttpStatus.OK); - } - - @ApiOperation("查询字典") - @GetMapping - @PreAuthorize("@el.check('dict:list')") - public ResponseEntity query(DictQueryCriteria resources, Pageable pageable){ - return new ResponseEntity<>(dictService.queryAll(resources,pageable),HttpStatus.OK); - } - - @Log("新增字典") - @ApiOperation("新增字典") - @PostMapping - @PreAuthorize("@el.check('dict:add')") - public ResponseEntity create(@Validated @RequestBody Dict resources){ - if (resources.getId() != null) { - throw new BadRequestException("A new "+ ENTITY_NAME +" cannot already have an ID"); - } - dictService.create(resources); - return new ResponseEntity<>(HttpStatus.CREATED); - } - - @Log("修改字典") - @ApiOperation("修改字典") - @PutMapping - @PreAuthorize("@el.check('dict:edit')") - public ResponseEntity update(@Validated(Dict.Update.class) @RequestBody Dict resources){ - dictService.update(resources); - return new ResponseEntity<>(HttpStatus.NO_CONTENT); - } - - @Log("删除字典") - @ApiOperation("删除字典") - @DeleteMapping - @PreAuthorize("@el.check('dict:del')") - public ResponseEntity delete(@RequestBody Set ids){ - dictService.delete(ids); - return new ResponseEntity<>(HttpStatus.OK); - } -} \ No newline at end of file diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/system/rest/DictDetailController.java b/wjcy-system/src/main/java/me/zhengjie/modules/system/rest/DictDetailController.java deleted file mode 100644 index 92f65fd..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/system/rest/DictDetailController.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.system.rest; - -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import lombok.RequiredArgsConstructor; -import me.zhengjie.annotation.Log; -import me.zhengjie.exception.BadRequestException; -import me.zhengjie.modules.system.domain.DictDetail; -import me.zhengjie.modules.system.service.DictDetailService; -import me.zhengjie.modules.system.service.dto.DictDetailDto; -import me.zhengjie.modules.system.service.dto.DictDetailQueryCriteria; -import org.springframework.data.domain.Pageable; -import org.springframework.data.domain.Sort; -import org.springframework.data.web.PageableDefault; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** -* @author Zheng Jie -* @date 2019-04-10 -*/ -@RestController -@RequiredArgsConstructor -@Api(tags = "系统:字典详情管理") -@RequestMapping("/api/dictDetail") -public class DictDetailController { - - private final DictDetailService dictDetailService; - private static final String ENTITY_NAME = "dictDetail"; - - @ApiOperation("查询字典详情") - @GetMapping - public ResponseEntity query(DictDetailQueryCriteria criteria, - @PageableDefault(sort = {"dictSort"}, direction = Sort.Direction.ASC) Pageable pageable){ - return new ResponseEntity<>(dictDetailService.queryAll(criteria,pageable),HttpStatus.OK); - } - - @ApiOperation("查询多个字典详情") - @GetMapping(value = "/map") - public ResponseEntity getDictDetailMaps(@RequestParam String dictName){ - String[] names = dictName.split("[,,]"); - Map> dictMap = new HashMap<>(16); - for (String name : names) { - dictMap.put(name, dictDetailService.getDictByName(name)); - } - return new ResponseEntity<>(dictMap, HttpStatus.OK); - } - - @Log("新增字典详情") - @ApiOperation("新增字典详情") - @PostMapping - @PreAuthorize("@el.check('dict:add')") - public ResponseEntity create(@Validated @RequestBody DictDetail resources){ - if (resources.getId() != null) { - throw new BadRequestException("A new "+ ENTITY_NAME +" cannot already have an ID"); - } - dictDetailService.create(resources); - return new ResponseEntity<>(HttpStatus.CREATED); - } - - @Log("修改字典详情") - @ApiOperation("修改字典详情") - @PutMapping - @PreAuthorize("@el.check('dict:edit')") - public ResponseEntity update(@Validated(DictDetail.Update.class) @RequestBody DictDetail resources){ - dictDetailService.update(resources); - return new ResponseEntity<>(HttpStatus.NO_CONTENT); - } - - @Log("删除字典详情") - @ApiOperation("删除字典详情") - @DeleteMapping(value = "/{id}") - @PreAuthorize("@el.check('dict:del')") - public ResponseEntity delete(@PathVariable Long id){ - dictDetailService.delete(id); - return new ResponseEntity<>(HttpStatus.OK); - } -} \ No newline at end of file diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/system/rest/JobController.java b/wjcy-system/src/main/java/me/zhengjie/modules/system/rest/JobController.java deleted file mode 100644 index cac14c0..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/system/rest/JobController.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.system.rest; - -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import lombok.RequiredArgsConstructor; -import me.zhengjie.annotation.Log; -import me.zhengjie.exception.BadRequestException; -import me.zhengjie.modules.system.domain.Job; -import me.zhengjie.modules.system.service.JobService; -import me.zhengjie.modules.system.service.dto.JobQueryCriteria; -import org.springframework.data.domain.Pageable; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.Set; - -/** -* @author Zheng Jie -* @date 2019-03-29 -*/ -@RestController -@RequiredArgsConstructor -@Api(tags = "系统:岗位管理") -@RequestMapping("/api/job") -public class JobController { - - private final JobService jobService; - private static final String ENTITY_NAME = "job"; - - @ApiOperation("导出岗位数据") - @GetMapping(value = "/download") - @PreAuthorize("@el.check('job:list')") - public void download(HttpServletResponse response, JobQueryCriteria criteria) throws IOException { - jobService.download(jobService.queryAll(criteria), response); - } - - @ApiOperation("查询岗位") - @GetMapping - @PreAuthorize("@el.check('job:list','user:list')") - public ResponseEntity query(JobQueryCriteria criteria, Pageable pageable){ - return new ResponseEntity<>(jobService.queryAll(criteria, pageable),HttpStatus.OK); - } - - @Log("新增岗位") - @ApiOperation("新增岗位") - @PostMapping - @PreAuthorize("@el.check('job:add')") - public ResponseEntity create(@Validated @RequestBody Job resources){ - if (resources.getId() != null) { - throw new BadRequestException("A new "+ ENTITY_NAME +" cannot already have an ID"); - } - jobService.create(resources); - return new ResponseEntity<>(HttpStatus.CREATED); - } - - @Log("修改岗位") - @ApiOperation("修改岗位") - @PutMapping - @PreAuthorize("@el.check('job:edit')") - public ResponseEntity update(@Validated(Job.Update.class) @RequestBody Job resources){ - jobService.update(resources); - return new ResponseEntity<>(HttpStatus.NO_CONTENT); - } - - @Log("删除岗位") - @ApiOperation("删除岗位") - @DeleteMapping - @PreAuthorize("@el.check('job:del')") - public ResponseEntity delete(@RequestBody Set ids){ - // 验证是否被用户关联 - jobService.verification(ids); - jobService.delete(ids); - return new ResponseEntity<>(HttpStatus.OK); - } -} \ No newline at end of file diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/system/rest/LimitController.java b/wjcy-system/src/main/java/me/zhengjie/modules/system/rest/LimitController.java deleted file mode 100644 index 329c5ac..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/system/rest/LimitController.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.system.rest; - -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import me.zhengjie.annotation.Limit; -import me.zhengjie.annotation.rest.AnonymousGetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import java.util.concurrent.atomic.AtomicInteger; - -/** - * @author / - * 接口限流测试类 - */ -@RestController -@RequestMapping("/api/limit") -@Api(tags = "系统:限流测试管理") -public class LimitController { - - private static final AtomicInteger ATOMIC_INTEGER = new AtomicInteger(); - - /** - * 测试限流注解,下面配置说明该接口 60秒内最多只能访问 10次,保存到redis的键名为 limit_test, - */ - @AnonymousGetMapping - @ApiOperation("测试") - @Limit(key = "test", period = 60, count = 10, name = "testLimit", prefix = "limit") - public int test() { - return ATOMIC_INTEGER.incrementAndGet(); - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/system/rest/MenuController.java b/wjcy-system/src/main/java/me/zhengjie/modules/system/rest/MenuController.java deleted file mode 100644 index d5461a2..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/system/rest/MenuController.java +++ /dev/null @@ -1,147 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.system.rest; - -import cn.hutool.core.collection.CollectionUtil; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import lombok.RequiredArgsConstructor; -import me.zhengjie.annotation.Log; -import me.zhengjie.modules.system.domain.Menu; -import me.zhengjie.exception.BadRequestException; -import me.zhengjie.modules.system.service.MenuService; -import me.zhengjie.modules.system.service.dto.MenuDto; -import me.zhengjie.modules.system.service.dto.MenuQueryCriteria; -import me.zhengjie.modules.system.service.mapstruct.MenuMapper; -import me.zhengjie.utils.PageUtil; -import me.zhengjie.utils.SecurityUtils; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import javax.servlet.http.HttpServletResponse; -import java.util.*; -import java.util.stream.Collectors; - -/** - * @author Zheng Jie - * @date 2018-12-03 - */ - -@RestController -@RequiredArgsConstructor -@Api(tags = "系统:菜单管理") -@RequestMapping("/api/menus") -public class MenuController { - - private final MenuService menuService; - private final MenuMapper menuMapper; - private static final String ENTITY_NAME = "menu"; - - @ApiOperation("导出菜单数据") - @GetMapping(value = "/download") - @PreAuthorize("@el.check('menu:list')") - public void download(HttpServletResponse response, MenuQueryCriteria criteria) throws Exception { - menuService.download(menuService.queryAll(criteria, false), response); - } - - @GetMapping(value = "/build") - @ApiOperation("获取前端所需菜单") - public ResponseEntity buildMenus(){ - List menuDtoList = menuService.findByUser(SecurityUtils.getCurrentUserId()); - List menuDtos = menuService.buildTree(menuDtoList); - return new ResponseEntity<>(menuService.buildMenus(menuDtos),HttpStatus.OK); - } - - @ApiOperation("返回全部的菜单") - @GetMapping(value = "/lazy") - @PreAuthorize("@el.check('menu:list','roles:list')") - public ResponseEntity query(@RequestParam Long pid){ - return new ResponseEntity<>(menuService.getMenus(pid),HttpStatus.OK); - } - - @ApiOperation("根据菜单ID返回所有子节点ID,包含自身ID") - @GetMapping(value = "/child") - @PreAuthorize("@el.check('menu:list','roles:list')") - public ResponseEntity child(@RequestParam Long id){ - Set menuSet = new HashSet<>(); - List menuList = menuService.getMenus(id); - menuSet.add(menuService.findOne(id)); - menuSet = menuService.getChildMenus(menuMapper.toEntity(menuList), menuSet); - Set ids = menuSet.stream().map(Menu::getId).collect(Collectors.toSet()); - return new ResponseEntity<>(ids,HttpStatus.OK); - } - - @GetMapping - @ApiOperation("查询菜单") - @PreAuthorize("@el.check('menu:list')") - public ResponseEntity query(MenuQueryCriteria criteria) throws Exception { - List menuDtoList = menuService.queryAll(criteria, true); - return new ResponseEntity<>(PageUtil.toPage(menuDtoList, menuDtoList.size()),HttpStatus.OK); - } - - @ApiOperation("查询菜单:根据ID获取同级与上级数据") - @PostMapping("/superior") - @PreAuthorize("@el.check('menu:list')") - public ResponseEntity getSuperior(@RequestBody List ids) { - Set menuDtos = new LinkedHashSet<>(); - if(CollectionUtil.isNotEmpty(ids)){ - for (Long id : ids) { - MenuDto menuDto = menuService.findById(id); - menuDtos.addAll(menuService.getSuperior(menuDto, new ArrayList<>())); - } - return new ResponseEntity<>(menuService.buildTree(new ArrayList<>(menuDtos)),HttpStatus.OK); - } - return new ResponseEntity<>(menuService.getMenus(null),HttpStatus.OK); - } - - @Log("新增菜单") - @ApiOperation("新增菜单") - @PostMapping - @PreAuthorize("@el.check('menu:add')") - public ResponseEntity create(@Validated @RequestBody Menu resources){ - if (resources.getId() != null) { - throw new BadRequestException("A new "+ ENTITY_NAME +" cannot already have an ID"); - } - menuService.create(resources); - return new ResponseEntity<>(HttpStatus.CREATED); - } - - @Log("修改菜单") - @ApiOperation("修改菜单") - @PutMapping - @PreAuthorize("@el.check('menu:edit')") - public ResponseEntity update(@Validated(Menu.Update.class) @RequestBody Menu resources){ - menuService.update(resources); - return new ResponseEntity<>(HttpStatus.NO_CONTENT); - } - - @Log("删除菜单") - @ApiOperation("删除菜单") - @DeleteMapping - @PreAuthorize("@el.check('menu:del')") - public ResponseEntity delete(@RequestBody Set ids){ - Set menuSet = new HashSet<>(); - for (Long id : ids) { - List menuList = menuService.getMenus(id); - menuSet.add(menuService.findOne(id)); - menuSet = menuService.getChildMenus(menuMapper.toEntity(menuList), menuSet); - } - menuService.delete(menuSet); - return new ResponseEntity<>(HttpStatus.OK); - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/system/rest/MonitorController.java b/wjcy-system/src/main/java/me/zhengjie/modules/system/rest/MonitorController.java deleted file mode 100644 index 35ac0c5..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/system/rest/MonitorController.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.system.rest; - -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import lombok.RequiredArgsConstructor; -import me.zhengjie.modules.system.service.MonitorService; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.*; - -/** - * @author Zheng Jie - * @date 2020-05-02 - */ -@RestController -@RequiredArgsConstructor -@Api(tags = "系统-服务监控管理") -@RequestMapping("/api/monitor") -public class MonitorController { - - private final MonitorService serverService; - - @GetMapping - @ApiOperation("查询服务监控") - @PreAuthorize("@el.check('monitor:list')") - public ResponseEntity query(){ - return new ResponseEntity<>(serverService.getServers(),HttpStatus.OK); - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/system/rest/RoleController.java b/wjcy-system/src/main/java/me/zhengjie/modules/system/rest/RoleController.java deleted file mode 100644 index a1edc93..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/system/rest/RoleController.java +++ /dev/null @@ -1,154 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.system.rest; - -import cn.hutool.core.lang.Dict; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import lombok.RequiredArgsConstructor; -import me.zhengjie.annotation.Log; -import me.zhengjie.modules.system.domain.Role; -import me.zhengjie.exception.BadRequestException; -import me.zhengjie.modules.system.service.RoleService; -import me.zhengjie.modules.system.service.dto.RoleDto; -import me.zhengjie.modules.system.service.dto.RoleQueryCriteria; -import me.zhengjie.modules.system.service.dto.RoleSmallDto; -import me.zhengjie.utils.SecurityUtils; -import org.springframework.data.domain.Pageable; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.Collections; -import java.util.List; -import java.util.Set; -import java.util.stream.Collectors; - -/** - * @author Zheng Jie - * @date 2018-12-03 - */ -@RestController -@RequiredArgsConstructor -@Api(tags = "系统:角色管理") -@RequestMapping("/api/roles") -public class RoleController { - - private final RoleService roleService; - - private static final String ENTITY_NAME = "role"; - - @ApiOperation("获取单个role") - @GetMapping(value = "/{id}") - @PreAuthorize("@el.check('roles:list')") - public ResponseEntity query(@PathVariable Long id){ - return new ResponseEntity<>(roleService.findById(id), HttpStatus.OK); - } - - @ApiOperation("导出角色数据") - @GetMapping(value = "/download") - @PreAuthorize("@el.check('role:list')") - public void download(HttpServletResponse response, RoleQueryCriteria criteria) throws IOException { - roleService.download(roleService.queryAll(criteria), response); - } - - @ApiOperation("返回全部的角色") - @GetMapping(value = "/all") - @PreAuthorize("@el.check('roles:list','user:add','user:edit')") - public ResponseEntity query(){ - return new ResponseEntity<>(roleService.queryAll(),HttpStatus.OK); - } - - @ApiOperation("查询角色") - @GetMapping - @PreAuthorize("@el.check('roles:list')") - public ResponseEntity query(RoleQueryCriteria criteria, Pageable pageable){ - return new ResponseEntity<>(roleService.queryAll(criteria,pageable),HttpStatus.OK); - } - - @ApiOperation("获取用户级别") - @GetMapping(value = "/level") - public ResponseEntity getLevel(){ - return new ResponseEntity<>(Dict.create().set("level", getLevels(null)),HttpStatus.OK); - } - - @Log("新增角色") - @ApiOperation("新增角色") - @PostMapping - @PreAuthorize("@el.check('roles:add')") - public ResponseEntity create(@Validated @RequestBody Role resources){ - if (resources.getId() != null) { - throw new BadRequestException("A new "+ ENTITY_NAME +" cannot already have an ID"); - } - getLevels(resources.getLevel()); - roleService.create(resources); - return new ResponseEntity<>(HttpStatus.CREATED); - } - - @Log("修改角色") - @ApiOperation("修改角色") - @PutMapping - @PreAuthorize("@el.check('roles:edit')") - public ResponseEntity update(@Validated(Role.Update.class) @RequestBody Role resources){ - getLevels(resources.getLevel()); - roleService.update(resources); - return new ResponseEntity<>(HttpStatus.NO_CONTENT); - } - - @Log("修改角色菜单") - @ApiOperation("修改角色菜单") - @PutMapping(value = "/menu") - @PreAuthorize("@el.check('roles:edit')") - public ResponseEntity updateMenu(@RequestBody Role resources){ - RoleDto role = roleService.findById(resources.getId()); - getLevels(role.getLevel()); - roleService.updateMenu(resources,role); - return new ResponseEntity<>(HttpStatus.NO_CONTENT); - } - - @Log("删除角色") - @ApiOperation("删除角色") - @DeleteMapping - @PreAuthorize("@el.check('roles:del')") - public ResponseEntity delete(@RequestBody Set ids){ - for (Long id : ids) { - RoleDto role = roleService.findById(id); - getLevels(role.getLevel()); - } - // 验证是否被用户关联 - roleService.verification(ids); - roleService.delete(ids); - return new ResponseEntity<>(HttpStatus.OK); - } - - /** - * 获取用户的角色级别 - * @return / - */ - private int getLevels(Integer level){ - List levels = roleService.findByUsersId(SecurityUtils.getCurrentUserId()).stream().map(RoleSmallDto::getLevel).collect(Collectors.toList()); - int min = Collections.min(levels); - if(level != null){ - if(level < min){ - throw new BadRequestException("权限不足,你的角色级别:" + min + ",低于操作的角色级别:" + level); - } - } - return min; - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/system/rest/UserController.java b/wjcy-system/src/main/java/me/zhengjie/modules/system/rest/UserController.java deleted file mode 100644 index a5e6dca..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/system/rest/UserController.java +++ /dev/null @@ -1,230 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.system.rest; - -import cn.hutool.core.collection.CollectionUtil; -import cn.hutool.core.util.ObjectUtil; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import lombok.RequiredArgsConstructor; -import me.zhengjie.annotation.Log; -import me.zhengjie.base.BaseEntity; -import me.zhengjie.config.RsaProperties; -import me.zhengjie.dto.Dto; -import me.zhengjie.modules.system.domain.Dept; -import me.zhengjie.modules.system.service.DataService; -import me.zhengjie.modules.system.domain.User; -import me.zhengjie.exception.BadRequestException; -import me.zhengjie.modules.system.domain.vo.UserPassVo; -import me.zhengjie.modules.system.service.DeptService; -import me.zhengjie.modules.system.service.RoleService; -import me.zhengjie.modules.system.service.dto.RoleSmallDto; -import me.zhengjie.modules.system.service.dto.UserDto; -import me.zhengjie.modules.system.service.dto.UserQueryCriteria; -import me.zhengjie.modules.system.service.VerifyService; -import me.zhengjie.utils.*; -import me.zhengjie.modules.system.service.UserService; -import me.zhengjie.utils.enums.CodeEnum; -import org.springframework.data.domain.Pageable; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.security.crypto.password.PasswordEncoder; -import org.springframework.util.CollectionUtils; -import org.springframework.util.ObjectUtils; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.*; -import java.util.regex.Pattern; -import java.util.stream.Collectors; - -/** - * @author Zheng Jie - * @date 2018-11-23 - */ -@Api(tags = "系统:用户管理") -@RestController -@RequestMapping("/api/users") -@RequiredArgsConstructor -public class UserController { - - private final PasswordEncoder passwordEncoder; - private final UserService userService; - private final DataService dataService; - private final DeptService deptService; - private final RoleService roleService; - private final VerifyService verificationCodeService; - private final RedisUtils redisUtils; - - @ApiOperation("导出用户数据") - @GetMapping(value = "/download") - @PreAuthorize("@el.check('user:list')") - public void download(HttpServletResponse response, UserQueryCriteria criteria) throws IOException { - userService.download(userService.queryAll(criteria), response); - } - - @ApiOperation("查询用户") - @GetMapping - @PreAuthorize("@el.check('user:list')") - public ResponseEntity query(UserQueryCriteria criteria, Pageable pageable){ - if (!ObjectUtils.isEmpty(criteria.getDeptId())) { - criteria.getDeptIds().add(criteria.getDeptId()); - // 先查找是否存在子节点 - List data = deptService.findByPid(criteria.getDeptId()); - // 然后把子节点的ID都加入到集合中 - criteria.getDeptIds().addAll(deptService.getDeptChildren(data)); - } - // 数据权限 - List dataScopes = dataService.getDeptIds(userService.findByName(SecurityUtils.getCurrentUsername())); - // criteria.getDeptIds() 不为空并且数据权限不为空则取交集 - if (!CollectionUtils.isEmpty(criteria.getDeptIds()) && !CollectionUtils.isEmpty(dataScopes)){ - // 取交集 - criteria.getDeptIds().retainAll(dataScopes); - if(!CollectionUtil.isEmpty(criteria.getDeptIds())){ - return new ResponseEntity<>(userService.queryAll(criteria,pageable),HttpStatus.OK); - } - } else { - // 否则取并集 - criteria.getDeptIds().addAll(dataScopes); - return new ResponseEntity<>(userService.queryAll(criteria,pageable),HttpStatus.OK); - } - return new ResponseEntity<>(PageUtil.toPage(null,0),HttpStatus.OK); - } - - /** - * 解冻账号 - * @author: zeng - */ - @GetMapping("/unfreeze") - @PreAuthorize("@el.check('user:list')") - public Dto unfreeze(String username) { - if (ObjectUtil.isEmpty(username)) { - return Dto.returnResult(null); - } - String key = String.format(RedisUtils.BLOCKED_ACCOUNT, username); - redisUtils.del(key); - return Dto.returnResult(true); - } - - @Log("新增用户") - @ApiOperation("新增用户") - @PostMapping - @PreAuthorize("@el.check('user:add')") - public ResponseEntity create(@Validated(BaseEntity.Create.class) @RequestBody User resources){ - checkLevel(resources); - // 默认密码 123456 - resources.setPassword(passwordEncoder.encode(resources.getPassword())); - userService.create(resources); - return new ResponseEntity<>(HttpStatus.CREATED); - } - - @Log("修改用户") - @ApiOperation("修改用户") - @PutMapping - @PreAuthorize("@el.check('user:edit')") - public ResponseEntity update(@Validated(User.Update.class) @RequestBody User resources) throws Exception { - checkLevel(resources); - userService.update(resources); - return new ResponseEntity<>(HttpStatus.NO_CONTENT); - } - - @Log("修改用户:个人中心") - @ApiOperation("修改用户:个人中心") - @PutMapping(value = "center") - public ResponseEntity center(@Validated(User.Update.class) @RequestBody User resources){ - if(!resources.getId().equals(SecurityUtils.getCurrentUserId())){ - throw new BadRequestException("不能修改他人资料"); - } - userService.updateCenter(resources); - return new ResponseEntity<>(HttpStatus.NO_CONTENT); - } - - @Log("删除用户") - @ApiOperation("删除用户") - @DeleteMapping - @PreAuthorize("@el.check('user:del')") - public ResponseEntity delete(@RequestBody Set ids){ - for (Long id : ids) { - Integer currentLevel = Collections.min(roleService.findByUsersId(SecurityUtils.getCurrentUserId()).stream().map(RoleSmallDto::getLevel).collect(Collectors.toList())); - Integer optLevel = Collections.min(roleService.findByUsersId(id).stream().map(RoleSmallDto::getLevel).collect(Collectors.toList())); - if (currentLevel > optLevel) { - throw new BadRequestException("角色权限不足,不能删除:" + userService.findById(id).getUsername()); - } - } - userService.delete(ids); - return new ResponseEntity<>(HttpStatus.OK); - } - - /** - * 修改密码 - * @param passVo 修改密码DTO - * @return - * @throws Exception - */ - @ApiOperation("修改密码") - @PostMapping(value = "/updatePass") - public ResponseEntity updatePass(@RequestBody @Validated UserPassVo passVo) throws Exception { - String oldPass = RsaUtils.decryptByPrivateKey(RsaProperties.privateKey,passVo.getOldPass()); - String newPass = RsaUtils.decryptByPrivateKey(RsaProperties.privateKey,passVo.getNewPass()); - UserDto user = userService.findByName(SecurityUtils.getCurrentUsername()); - if(!passwordEncoder.matches(oldPass, user.getPassword())){ - throw new BadRequestException("修改失败,旧密码错误"); - } - if(passwordEncoder.matches(newPass, user.getPassword())){ - throw new BadRequestException("新密码不能与旧密码相同"); - } - if (!Pattern.matches(CheckPwdValidator.p, newPass)) { - throw new BadRequestException("密码格式错误,必须包含大小写字母、数子、英文特殊符号,且长度在16~64之间!"); - } - userService.updatePass(user.getUsername(),passwordEncoder.encode(newPass)); - return new ResponseEntity<>(HttpStatus.OK); - } - - @ApiOperation("修改头像") - @PostMapping(value = "/updateAvatar") - public ResponseEntity updateAvatar(@RequestParam MultipartFile avatar){ - return new ResponseEntity<>(userService.updateAvatar(avatar), HttpStatus.OK); - } - - @Log("修改邮箱") - @ApiOperation("修改邮箱") - @PostMapping(value = "/updateEmail/{code}") - public ResponseEntity updateEmail(@PathVariable String code,@RequestBody User user) throws Exception { - String password = RsaUtils.decryptByPrivateKey(RsaProperties.privateKey,user.getPassword()); - UserDto userDto = userService.findByName(SecurityUtils.getCurrentUsername()); - if(!passwordEncoder.matches(password, userDto.getPassword())){ - throw new BadRequestException("密码错误"); - } - verificationCodeService.validated(CodeEnum.EMAIL_RESET_EMAIL_CODE.getKey() + user.getEmail(), code); - userService.updateEmail(userDto.getUsername(),user.getEmail()); - return new ResponseEntity<>(HttpStatus.OK); - } - - /** - * 如果当前用户的角色级别低于创建用户的角色级别,则抛出权限不足的错误 - * @param resources / - */ - private void checkLevel(User resources) { - Integer currentLevel = Collections.min(roleService.findByUsersId(SecurityUtils.getCurrentUserId()).stream().map(RoleSmallDto::getLevel).collect(Collectors.toList())); - Integer optLevel = roleService.findByRoles(resources.getRoles()); - if (currentLevel > optLevel) { - throw new BadRequestException("角色权限不足"); - } - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/system/rest/VerifyController.java b/wjcy-system/src/main/java/me/zhengjie/modules/system/rest/VerifyController.java deleted file mode 100644 index 09ba44b..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/system/rest/VerifyController.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.system.rest; - -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import lombok.RequiredArgsConstructor; -import me.zhengjie.domain.vo.EmailVo; -import me.zhengjie.service.EmailService; -import me.zhengjie.modules.system.service.VerifyService; -import me.zhengjie.utils.enums.CodeBiEnum; -import me.zhengjie.utils.enums.CodeEnum; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.*; -import java.util.Objects; - -/** - * @author Zheng Jie - * @date 2018-12-26 - */ -@RestController -@RequiredArgsConstructor -@RequestMapping("/api/code") -@Api(tags = "系统:验证码管理") -public class VerifyController { - - private final VerifyService verificationCodeService; - private final EmailService emailService; - - @PostMapping(value = "/resetEmail") - @ApiOperation("重置邮箱,发送验证码") - public ResponseEntity resetEmail(@RequestParam String email){ - EmailVo emailVo = verificationCodeService.sendEmail(email, CodeEnum.EMAIL_RESET_EMAIL_CODE.getKey()); - emailService.send(emailVo,emailService.find()); - return new ResponseEntity<>(HttpStatus.OK); - } - - @PostMapping(value = "/email/resetPass") - @ApiOperation("重置密码,发送验证码") - public ResponseEntity resetPass(@RequestParam String email){ - EmailVo emailVo = verificationCodeService.sendEmail(email, CodeEnum.EMAIL_RESET_PWD_CODE.getKey()); - emailService.send(emailVo,emailService.find()); - return new ResponseEntity<>(HttpStatus.OK); - } - - @GetMapping(value = "/validated") - @ApiOperation("验证码验证") - public ResponseEntity validated(@RequestParam String email, @RequestParam String code, @RequestParam Integer codeBi){ - CodeBiEnum biEnum = CodeBiEnum.find(codeBi); - switch (Objects.requireNonNull(biEnum)){ - case ONE: - verificationCodeService.validated(CodeEnum.EMAIL_RESET_EMAIL_CODE.getKey() + email ,code); - break; - case TWO: - verificationCodeService.validated(CodeEnum.EMAIL_RESET_PWD_CODE.getKey() + email ,code); - break; - default: - break; - } - return new ResponseEntity<>(HttpStatus.OK); - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/DataService.java b/wjcy-system/src/main/java/me/zhengjie/modules/system/service/DataService.java deleted file mode 100644 index 10258d9..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/DataService.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.system.service; - -import me.zhengjie.modules.system.service.dto.UserDto; -import java.util.List; - -/** - * 数据权限服务类 - * @author Zheng Jie - * @date 2020-05-07 - */ -public interface DataService { - - /** - * 获取数据权限 - * @param user / - * @return / - */ - List getDeptIds(UserDto user); -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/DeptService.java b/wjcy-system/src/main/java/me/zhengjie/modules/system/service/DeptService.java deleted file mode 100644 index d589bf8..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/DeptService.java +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.system.service; - -import me.zhengjie.modules.system.domain.Dept; -import me.zhengjie.modules.system.service.dto.DeptDto; -import me.zhengjie.modules.system.service.dto.DeptQueryCriteria; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.List; -import java.util.Set; - -/** -* @author Zheng Jie -* @date 2019-03-25 -*/ -public interface DeptService { - - /** - * 查询所有数据 - * @param criteria 条件 - * @param isQuery / - * @throws Exception / - * @return / - */ - List queryAll(DeptQueryCriteria criteria, Boolean isQuery) throws Exception; - - /** - * 根据ID查询 - * @param id / - * @return / - */ - DeptDto findById(Long id); - - /** - * 创建 - * @param resources / - */ - void create(Dept resources); - - /** - * 编辑 - * @param resources / - */ - void update(Dept resources); - - /** - * 删除 - * @param deptDtos / - * - */ - void delete(Set deptDtos); - - /** - * 根据PID查询 - * @param pid / - * @return / - */ - List findByPid(long pid); - - /** - * 根据角色ID查询 - * @param id / - * @return / - */ - Set findByRoleId(Long id); - - /** - * 导出数据 - * @param queryAll 待导出的数据 - * @param response / - * @throws IOException / - */ - void download(List queryAll, HttpServletResponse response) throws IOException; - - /** - * 获取待删除的部门 - * @param deptList / - * @param deptDtos / - * @return / - */ - Set getDeleteDepts(List deptList, Set deptDtos); - - /** - * 根据ID获取同级与上级数据 - * @param deptDto / - * @param depts / - * @return / - */ - List getSuperior(DeptDto deptDto, List depts); - - /** - * 构建树形数据 - * @param deptDtos / - * @return / - */ - Object buildTree(List deptDtos); - - /** - * 获取 - * @param deptList - * @return - */ - List getDeptChildren(List deptList); - - /** - * 验证是否被角色或用户关联 - * @param deptDtos / - */ - void verification(Set deptDtos); -} \ No newline at end of file diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/DictDetailService.java b/wjcy-system/src/main/java/me/zhengjie/modules/system/service/DictDetailService.java deleted file mode 100644 index 3912a47..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/DictDetailService.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.system.service; - -import me.zhengjie.modules.system.domain.DictDetail; -import me.zhengjie.modules.system.service.dto.DictDetailDto; -import me.zhengjie.modules.system.service.dto.DictDetailQueryCriteria; -import org.springframework.data.domain.Pageable; -import java.util.List; -import java.util.Map; - -/** -* @author Zheng Jie -* @date 2019-04-10 -*/ -public interface DictDetailService { - - /** - * 创建 - * @param resources / - */ - void create(DictDetail resources); - - /** - * 编辑 - * @param resources / - */ - void update(DictDetail resources); - - /** - * 删除 - * @param id / - */ - void delete(Long id); - - /** - * 分页查询 - * @param criteria 条件 - * @param pageable 分页参数 - * @return / - */ - Map queryAll(DictDetailQueryCriteria criteria, Pageable pageable); - - /** - * 根据字典名称获取字典详情 - * @param name 字典名称 - * @return / - */ - List getDictByName(String name); -} \ No newline at end of file diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/DictService.java b/wjcy-system/src/main/java/me/zhengjie/modules/system/service/DictService.java deleted file mode 100644 index 9a89e4c..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/DictService.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.system.service; - -import me.zhengjie.modules.system.domain.Dict; -import me.zhengjie.modules.system.service.dto.DictDto; -import me.zhengjie.modules.system.service.dto.DictQueryCriteria; -import org.springframework.data.domain.Pageable; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.List; -import java.util.Map; -import java.util.Set; - -/** -* @author Zheng Jie -* @date 2019-04-10 -*/ -public interface DictService { - - /** - * 分页查询 - * @param criteria 条件 - * @param pageable 分页参数 - * @return / - */ - Map queryAll(DictQueryCriteria criteria, Pageable pageable); - - /** - * 查询全部数据 - * @param dict / - * @return / - */ - List queryAll(DictQueryCriteria dict); - - /** - * 创建 - * @param resources / - * @return / - */ - void create(Dict resources); - - /** - * 编辑 - * @param resources / - */ - void update(Dict resources); - - /** - * 删除 - * @param ids / - */ - void delete(Set ids); - - /** - * 导出数据 - * @param queryAll 待导出的数据 - * @param response / - * @throws IOException / - */ - void download(List queryAll, HttpServletResponse response) throws IOException; -} \ No newline at end of file diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/JobService.java b/wjcy-system/src/main/java/me/zhengjie/modules/system/service/JobService.java deleted file mode 100644 index 21c1c98..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/JobService.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.system.service; - -import me.zhengjie.modules.system.domain.Job; -import me.zhengjie.modules.system.service.dto.JobDto; -import me.zhengjie.modules.system.service.dto.JobQueryCriteria; -import org.springframework.data.domain.Pageable; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.List; -import java.util.Map; -import java.util.Set; - -/** -* @author Zheng Jie -* @date 2019-03-29 -*/ -public interface JobService { - - /** - * 根据ID查询 - * @param id / - * @return / - */ - JobDto findById(Long id); - - /** - * 创建 - * @param resources / - * @return / - */ - void create(Job resources); - - /** - * 编辑 - * @param resources / - */ - void update(Job resources); - - /** - * 删除 - * @param ids / - */ - void delete(Set ids); - - /** - * 删除 - */ - void delete(); - - /** - * 分页查询 - * @param criteria 条件 - * @param pageable 分页参数 - * @return / - */ - Map queryAll(JobQueryCriteria criteria, Pageable pageable); - - /** - * 查询全部数据 - * @param criteria / - * @return / - */ - List queryAll(JobQueryCriteria criteria); - - /** - * 导出数据 - * @param queryAll 待导出的数据 - * @param response / - * @throws IOException / - */ - void download(List queryAll, HttpServletResponse response) throws IOException; - - /** - * 验证是否被用户关联 - * @param ids / - */ - void verification(Set ids); -} \ No newline at end of file diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/MenuService.java b/wjcy-system/src/main/java/me/zhengjie/modules/system/service/MenuService.java deleted file mode 100644 index f7b8ece..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/MenuService.java +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.system.service; - -import me.zhengjie.modules.system.domain.Menu; -import me.zhengjie.modules.system.service.dto.MenuDto; -import me.zhengjie.modules.system.service.dto.MenuQueryCriteria; - -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.List; -import java.util.Set; - -/** - * @author Zheng Jie - * @date 2018-12-17 - */ -public interface MenuService { - - /** - * 查询全部数据 - * @param criteria 条件 - * @param isQuery / - * @throws Exception / - * @return / - */ - List queryAll(MenuQueryCriteria criteria, Boolean isQuery) throws Exception; - - /** - * 根据ID查询 - * @param id / - * @return / - */ - MenuDto findById(long id); - - /** - * 创建 - * @param resources / - */ - void create(Menu resources); - - /** - * 编辑 - * @param resources / - */ - void update(Menu resources); - - /** - * 获取所有子节点,包含自身ID - * @param menuList / - * @param menuSet / - * @return / - */ - Set getChildMenus(List menuList, Set menuSet); - - /** - * 构建菜单树 - * @param menuDtos 原始数据 - * @return / - */ - List buildTree(List menuDtos); - - /** - * 构建菜单树 - * @param menuDtos / - * @return / - */ - Object buildMenus(List menuDtos); - - /** - * 根据ID查询 - * @param id / - * @return / - */ - Menu findOne(Long id); - - /** - * 删除 - * @param menuSet / - */ - void delete(Set menuSet); - - /** - * 导出 - * @param queryAll 待导出的数据 - * @param response / - * @throws IOException / - */ - void download(List queryAll, HttpServletResponse response) throws IOException; - - /** - * 懒加载菜单数据 - * @param pid / - * @return / - */ - List getMenus(Long pid); - - /** - * 根据ID获取同级与上级数据 - * @param menuDto / - * @param objects / - * @return / - */ - List getSuperior(MenuDto menuDto, List objects); - - /** - * 根据当前用户获取菜单 - * @param currentUserId / - * @return / - */ - List findByUser(Long currentUserId); -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/MonitorService.java b/wjcy-system/src/main/java/me/zhengjie/modules/system/service/MonitorService.java deleted file mode 100644 index 478225a..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/MonitorService.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.system.service; - -import java.util.Map; - -/** - * @author Zheng Jie - * @date 2020-05-02 - */ -public interface MonitorService { - - /** - * 查询数据分页 - * @return Map - */ - Map getServers(); -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/RoleService.java b/wjcy-system/src/main/java/me/zhengjie/modules/system/service/RoleService.java deleted file mode 100644 index 65e4f58..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/RoleService.java +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.system.service; - -import me.zhengjie.modules.system.domain.Role; -import me.zhengjie.modules.system.service.dto.RoleDto; -import me.zhengjie.modules.system.service.dto.RoleQueryCriteria; -import me.zhengjie.modules.system.service.dto.RoleSmallDto; -import me.zhengjie.modules.system.service.dto.UserDto; -import org.springframework.data.domain.Pageable; -import org.springframework.security.core.GrantedAuthority; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.List; -import java.util.Set; - -/** - * @author Zheng Jie - * @date 2018-12-03 - */ -public interface RoleService { - - /** - * 查询全部数据 - * @return / - */ - List queryAll(); - - /** - * 根据ID查询 - * @param id / - * @return / - */ - RoleDto findById(long id); - - /** - * 创建 - * @param resources / - */ - void create(Role resources); - - /** - * 编辑 - * @param resources / - */ - void update(Role resources); - - /** - * 删除 - * @param ids / - */ - void delete(Set ids); - - /** - * 根据用户ID查询 - * @param id 用户ID - * @return / - */ - List findByUsersId(Long id); - - /** - * 根据角色查询角色级别 - * @param roles / - * @return / - */ - Integer findByRoles(Set roles); - - /** - * 修改绑定的菜单 - * @param resources / - * @param roleDTO / - */ - void updateMenu(Role resources, RoleDto roleDTO); - - /** - * 解绑菜单 - * @param id / - */ - void untiedMenu(Long id); - - /** - * 待条件分页查询 - * @param criteria 条件 - * @param pageable 分页参数 - * @return / - */ - Object queryAll(RoleQueryCriteria criteria, Pageable pageable); - - /** - * 查询全部 - * @param criteria 条件 - * @return / - */ - List queryAll(RoleQueryCriteria criteria); - - /** - * 导出数据 - * @param queryAll 待导出的数据 - * @param response / - * @throws IOException / - */ - void download(List queryAll, HttpServletResponse response) throws IOException; - - /** - * 获取用户权限信息 - * @param user 用户信息 - * @return 权限信息 - */ - List mapToGrantedAuthorities(UserDto user); - - /** - * 验证是否被用户关联 - * @param ids / - */ - void verification(Set ids); - - /** - * 根据菜单Id查询 - * @param menuIds / - * @return / - */ - List findInMenuId(List menuIds); -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/UserService.java b/wjcy-system/src/main/java/me/zhengjie/modules/system/service/UserService.java deleted file mode 100644 index 814af92..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/UserService.java +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.system.service; - -import me.zhengjie.modules.system.domain.User; -import me.zhengjie.modules.system.service.dto.UserDto; -import me.zhengjie.modules.system.service.dto.UserQueryCriteria; -import org.springframework.data.domain.Pageable; -import org.springframework.web.multipart.MultipartFile; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.List; -import java.util.Map; -import java.util.Set; - -/** - * @author Zheng Jie - * @date 2018-11-23 - */ -public interface UserService { - - /** - * 根据ID查询 - * @param id ID - * @return / - */ - UserDto findById(long id); - - /** - * 新增用户 - * @param resources / - */ - void create(User resources); - - /** - * 编辑用户 - * @param resources / - */ - void update(User resources) throws Exception; - - /** - * 删除用户 - * @param ids / - */ - void delete(Set ids); - - /** - * 根据用户名查询 - * @param userName / - * @return / - */ - UserDto findByName(String userName); - - /** - * 修改密码 - * @param username 用户名 - * @param encryptPassword 密码 - */ - void updatePass(String username, String encryptPassword); - - /** - * 修改头像 - * @param file 文件 - * @return / - */ - Map updateAvatar(MultipartFile file); - - /** - * 修改邮箱 - * @param username 用户名 - * @param email 邮箱 - */ - void updateEmail(String username, String email); - - /** - * 查询全部 - * @param criteria 条件 - * @param pageable 分页参数 - * @return / - */ - Object queryAll(UserQueryCriteria criteria, Pageable pageable); - - /** - * 查询全部不分页 - * @param criteria 条件 - * @return / - */ - List queryAll(UserQueryCriteria criteria); - - /** - * 导出数据 - * @param queryAll 待导出的数据 - * @param response / - * @throws IOException / - */ - void download(List queryAll, HttpServletResponse response) throws IOException; - - /** - * 用户自助修改资料 - * @param resources / - */ - void updateCenter(User resources); -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/VerifyService.java b/wjcy-system/src/main/java/me/zhengjie/modules/system/service/VerifyService.java deleted file mode 100644 index 4ca39b9..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/VerifyService.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.system.service; - -import me.zhengjie.domain.vo.EmailVo; - -/** - * @author Zheng Jie - * @date 2018-12-26 - */ -public interface VerifyService { - - /** - * 发送验证码 - * @param email / - * @param key / - * @return / - */ - EmailVo sendEmail(String email, String key); - - - /** - * 验证 - * @param code / - * @param key / - */ - void validated(String key, String code); -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/dto/DeptDto.java b/wjcy-system/src/main/java/me/zhengjie/modules/system/service/dto/DeptDto.java deleted file mode 100644 index 4c3b12a..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/dto/DeptDto.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.system.service.dto; - -import com.fasterxml.jackson.annotation.JsonInclude; -import lombok.Getter; -import lombok.Setter; -import me.zhengjie.base.BaseDTO; -import java.io.Serializable; -import java.util.List; -import java.util.Objects; - -/** -* @author Zheng Jie -* @date 2019-03-25 -*/ -@Getter -@Setter -public class DeptDto extends BaseDTO implements Serializable { - - private Long id; - - private String name; - - private Boolean enabled; - - private Integer deptSort; - - @JsonInclude(JsonInclude.Include.NON_EMPTY) - private List children; - - private Long pid; - - private Integer subCount; - - public Boolean getHasChildren() { - return subCount > 0; - } - - public Boolean getLeaf() { - return subCount <= 0; - } - - public String getLabel() { - return name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - DeptDto deptDto = (DeptDto) o; - return Objects.equals(id, deptDto.id) && - Objects.equals(name, deptDto.name); - } - - @Override - public int hashCode() { - return Objects.hash(id, name); - } -} \ No newline at end of file diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/dto/DeptQueryCriteria.java b/wjcy-system/src/main/java/me/zhengjie/modules/system/service/dto/DeptQueryCriteria.java deleted file mode 100644 index 4d8cdf2..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/dto/DeptQueryCriteria.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.system.service.dto; - -import lombok.Data; -import me.zhengjie.annotation.DataPermission; -import me.zhengjie.annotation.Query; -import java.sql.Timestamp; -import java.util.List; - -/** -* @author Zheng Jie -* @date 2019-03-25 -*/ -@Data -@DataPermission(fieldName = "id") -public class DeptQueryCriteria{ - - @Query(type = Query.Type.INNER_LIKE) - private String name; - - @Query - private Boolean enabled; - - @Query - private Long pid; - - @Query(type = Query.Type.IS_NULL, propName = "pid") - private Boolean pidIsNull; - - @Query(type = Query.Type.BETWEEN) - private List createTime; -} \ No newline at end of file diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/dto/DeptSmallDto.java b/wjcy-system/src/main/java/me/zhengjie/modules/system/service/dto/DeptSmallDto.java deleted file mode 100644 index 4dc64e5..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/dto/DeptSmallDto.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.system.service.dto; - -import lombok.Data; -import java.io.Serializable; - -/** -* @author Zheng Jie -* @date 2019-6-10 16:32:18 -*/ -@Data -public class DeptSmallDto implements Serializable { - - private Long id; - - private String name; -} \ No newline at end of file diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/dto/DictDetailDto.java b/wjcy-system/src/main/java/me/zhengjie/modules/system/service/dto/DictDetailDto.java deleted file mode 100644 index a4b931b..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/dto/DictDetailDto.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.system.service.dto; - -import lombok.Getter; -import lombok.Setter; -import me.zhengjie.base.BaseDTO; -import java.io.Serializable; - -/** -* @author Zheng Jie -* @date 2019-04-10 -*/ -@Getter -@Setter -public class DictDetailDto extends BaseDTO implements Serializable { - - private Long id; - - private DictSmallDto dict; - - private String label; - - private String value; - - private Integer dictSort; -} \ No newline at end of file diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/dto/DictDetailQueryCriteria.java b/wjcy-system/src/main/java/me/zhengjie/modules/system/service/dto/DictDetailQueryCriteria.java deleted file mode 100644 index 91a01b1..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/dto/DictDetailQueryCriteria.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.system.service.dto; - -import lombok.Data; -import me.zhengjie.annotation.Query; - -/** -* @author Zheng Jie -* @date 2019-04-10 -*/ -@Data -public class DictDetailQueryCriteria { - - @Query(type = Query.Type.INNER_LIKE) - private String label; - - @Query(propName = "name",joinName = "dict") - private String dictName; -} \ No newline at end of file diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/dto/DictDto.java b/wjcy-system/src/main/java/me/zhengjie/modules/system/service/dto/DictDto.java deleted file mode 100644 index 048b4a1..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/dto/DictDto.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.system.service.dto; - -import lombok.Getter; -import lombok.Setter; -import me.zhengjie.base.BaseDTO; -import java.io.Serializable; -import java.util.List; - -/** -* @author Zheng Jie -* @date 2019-04-10 -*/ -@Getter -@Setter -public class DictDto extends BaseDTO implements Serializable { - - private Long id; - - private List dictDetails; - - private String name; - - private String description; -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/dto/DictQueryCriteria.java b/wjcy-system/src/main/java/me/zhengjie/modules/system/service/dto/DictQueryCriteria.java deleted file mode 100644 index 7207c61..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/dto/DictQueryCriteria.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.system.service.dto; - -import lombok.Data; -import me.zhengjie.annotation.Query; - -/** - * @author Zheng Jie - * 公共查询类 - */ -@Data -public class DictQueryCriteria { - - @Query(blurry = "name,description") - private String blurry; -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/dto/DictSmallDto.java b/wjcy-system/src/main/java/me/zhengjie/modules/system/service/dto/DictSmallDto.java deleted file mode 100644 index 98fc6ee..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/dto/DictSmallDto.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.system.service.dto; - -import lombok.Getter; -import lombok.Setter; -import java.io.Serializable; - -/** -* @author Zheng Jie -* @date 2019-04-10 -*/ -@Getter -@Setter -public class DictSmallDto implements Serializable { - - private Long id; -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/dto/GoogleAuthCodeDTO.java b/wjcy-system/src/main/java/me/zhengjie/modules/system/service/dto/GoogleAuthCodeDTO.java deleted file mode 100644 index da99a81..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/dto/GoogleAuthCodeDTO.java +++ /dev/null @@ -1,27 +0,0 @@ -package me.zhengjie.modules.system.service.dto; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import javax.validation.constraints.NotBlank; - -/** - * 验证身份验证码是否正确 DTO - * - * @author rch - * @since 2020-08-25 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class GoogleAuthCodeDTO { - - /** 输入的身份验证码 */ - @NotBlank(message = "身份验证码不能为空") - private String codes; - - /** 密钥 */ - @NotBlank(message = "密钥不能为空") - private String savedSecret; -} \ No newline at end of file diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/dto/GoogleAuthGenSecretDTO.java b/wjcy-system/src/main/java/me/zhengjie/modules/system/service/dto/GoogleAuthGenSecretDTO.java deleted file mode 100644 index dd506f4..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/dto/GoogleAuthGenSecretDTO.java +++ /dev/null @@ -1,23 +0,0 @@ -package me.zhengjie.modules.system.service.dto; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import javax.validation.constraints.NotBlank; - -/** - * 获取密钥 DTO - * - * @author rch - * @since 2020-08-25 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class GoogleAuthGenSecretDTO { - - /** 用户 */ - @NotBlank(message = "用户名不能为空") - private String userName; -} \ No newline at end of file diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/dto/GoogleAuthQrBarCodeUrlDTO.java b/wjcy-system/src/main/java/me/zhengjie/modules/system/service/dto/GoogleAuthQrBarCodeUrlDTO.java deleted file mode 100644 index 049f341..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/dto/GoogleAuthQrBarCodeUrlDTO.java +++ /dev/null @@ -1,23 +0,0 @@ -package me.zhengjie.modules.system.service.dto; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import javax.validation.constraints.NotBlank; - -/** - * 获取密钥 DTO - * - * @author rch - * @since 2020-08-25 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class GoogleAuthQrBarCodeUrlDTO { - - /** 用户 */ - @NotBlank(message = "用户名不能为空") - private String userName; -} \ No newline at end of file diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/dto/JobDto.java b/wjcy-system/src/main/java/me/zhengjie/modules/system/service/dto/JobDto.java deleted file mode 100644 index 8836d55..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/dto/JobDto.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.system.service.dto; - -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -import me.zhengjie.base.BaseDTO; - -import java.io.Serializable; - -/** -* @author Zheng Jie -* @date 2019-03-29 -*/ -@Getter -@Setter -@NoArgsConstructor -public class JobDto extends BaseDTO implements Serializable { - - private Long id; - - private Integer jobSort; - - private String name; - - private Boolean enabled; - - public JobDto(String name, Boolean enabled) { - this.name = name; - this.enabled = enabled; - } -} \ No newline at end of file diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/dto/JobQueryCriteria.java b/wjcy-system/src/main/java/me/zhengjie/modules/system/service/dto/JobQueryCriteria.java deleted file mode 100644 index ee851dc..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/dto/JobQueryCriteria.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.system.service.dto; - -import lombok.Data; -import lombok.NoArgsConstructor; -import me.zhengjie.annotation.Query; -import java.sql.Timestamp; -import java.util.List; - -/** -* @author Zheng Jie -* @date 2019-6-4 14:49:34 -*/ -@Data -@NoArgsConstructor -public class JobQueryCriteria { - - @Query(type = Query.Type.INNER_LIKE) - private String name; - - @Query - private Boolean enabled; - - @Query(type = Query.Type.BETWEEN) - private List createTime; -} \ No newline at end of file diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/dto/JobSmallDto.java b/wjcy-system/src/main/java/me/zhengjie/modules/system/service/dto/JobSmallDto.java deleted file mode 100644 index 09cfa62..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/dto/JobSmallDto.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.system.service.dto; - -import lombok.Data; -import lombok.NoArgsConstructor; -import java.io.Serializable; - -/** -* @author Zheng Jie -* @date 2019-6-10 16:32:18 -*/ -@Data -@NoArgsConstructor -public class JobSmallDto implements Serializable { - - private Long id; - - private String name; -} \ No newline at end of file diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/dto/MenuDto.java b/wjcy-system/src/main/java/me/zhengjie/modules/system/service/dto/MenuDto.java deleted file mode 100644 index d60dd29..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/dto/MenuDto.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.system.service.dto; - -import lombok.Getter; -import lombok.Setter; -import me.zhengjie.base.BaseDTO; -import java.io.Serializable; -import java.util.List; -import java.util.Objects; - -/** - * @author Zheng Jie - * @date 2018-12-17 - */ -@Getter -@Setter -public class MenuDto extends BaseDTO implements Serializable { - - private Long id; - - private List children; - - private Integer type; - - private String permission; - - private String title; - - private Integer menuSort; - - private String path; - - private String component; - - private Long pid; - - private Integer subCount; - - private Boolean iFrame; - - private Boolean cache; - - private Boolean hidden; - - private String componentName; - - private String icon; - - public Boolean getHasChildren() { - return subCount > 0; - } - - public Boolean getLeaf() { - return subCount <= 0; - } - - public String getLabel() { - return title; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - MenuDto menuDto = (MenuDto) o; - return Objects.equals(id, menuDto.id); - } - - @Override - public int hashCode() { - return Objects.hash(id); - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/dto/MenuQueryCriteria.java b/wjcy-system/src/main/java/me/zhengjie/modules/system/service/dto/MenuQueryCriteria.java deleted file mode 100644 index bd43e8d..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/dto/MenuQueryCriteria.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.system.service.dto; - -import lombok.Data; -import me.zhengjie.annotation.Query; -import java.sql.Timestamp; -import java.util.List; - -/** - * @author Zheng Jie - * 公共查询类 - */ -@Data -public class MenuQueryCriteria { - - @Query(blurry = "title,component,permission") - private String blurry; - - @Query(type = Query.Type.BETWEEN) - private List createTime; - - @Query(type = Query.Type.IS_NULL, propName = "pid") - private Boolean pidIsNull; - - @Query - private Long pid; -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/dto/RoleDto.java b/wjcy-system/src/main/java/me/zhengjie/modules/system/service/dto/RoleDto.java deleted file mode 100644 index fc74d84..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/dto/RoleDto.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.system.service.dto; - -import lombok.Getter; -import lombok.Setter; -import me.zhengjie.base.BaseDTO; -import java.io.Serializable; -import java.util.Objects; -import java.util.Set; - -/** - * @author Zheng Jie - * @date 2018-11-23 - */ -@Getter -@Setter -public class RoleDto extends BaseDTO implements Serializable { - - private Long id; - - private Set menus; - - private Set depts; - - private String name; - - private String dataScope; - - private Integer level; - - private String description; - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - RoleDto roleDto = (RoleDto) o; - return Objects.equals(id, roleDto.id); - } - - @Override - public int hashCode() { - return Objects.hash(id); - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/dto/RoleQueryCriteria.java b/wjcy-system/src/main/java/me/zhengjie/modules/system/service/dto/RoleQueryCriteria.java deleted file mode 100644 index 5454fc4..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/dto/RoleQueryCriteria.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.system.service.dto; - -import lombok.Data; -import me.zhengjie.annotation.Query; - -import java.sql.Timestamp; -import java.util.List; - -/** - * @author Zheng Jie - * 公共查询类 - */ -@Data -public class RoleQueryCriteria { - - @Query(blurry = "name,description") - private String blurry; - - @Query(type = Query.Type.BETWEEN) - private List createTime; -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/dto/RoleSmallDto.java b/wjcy-system/src/main/java/me/zhengjie/modules/system/service/dto/RoleSmallDto.java deleted file mode 100644 index 99215e6..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/dto/RoleSmallDto.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.system.service.dto; - -import lombok.Data; -import java.io.Serializable; - -/** - * @author Zheng Jie - * @date 2018-11-23 - */ -@Data -public class RoleSmallDto implements Serializable { - - private Long id; - - private String name; - - private Integer level; - - private String dataScope; -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/dto/UpdateGoogleAuthDTO.java b/wjcy-system/src/main/java/me/zhengjie/modules/system/service/dto/UpdateGoogleAuthDTO.java deleted file mode 100644 index befe410..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/dto/UpdateGoogleAuthDTO.java +++ /dev/null @@ -1,27 +0,0 @@ -package me.zhengjie.modules.system.service.dto; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import javax.validation.constraints.Max; -import javax.validation.constraints.Min; -import javax.validation.constraints.NotNull; - -/** - * 修改Google认证器开关 DTO - * - * @author rch - * @since 2020-08-25 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class UpdateGoogleAuthDTO { - - /** 用户 */ - @NotNull - @Min(value=0) - @Max(value=1) - private Integer isOpen; -} \ No newline at end of file diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/dto/UserDto.java b/wjcy-system/src/main/java/me/zhengjie/modules/system/service/dto/UserDto.java deleted file mode 100644 index 923e2d4..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/dto/UserDto.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.system.service.dto; - -import com.alibaba.fastjson.annotation.JSONField; -import lombok.Getter; -import lombok.Setter; -import me.zhengjie.base.BaseDTO; -import java.io.Serializable; -import java.util.Date; -import java.util.Set; - -/** - * @author Zheng Jie - * @date 2018-11-23 - */ -@Getter -@Setter -public class UserDto extends BaseDTO implements Serializable { - - private Long id; - - private Set roles; - - private Set jobs; - - private DeptSmallDto dept; - - private Long deptId; - - private String username; - - private String nickName; - - private String email; - - private String phone; - - private String gender; - - private String avatarName; - - private String avatarPath; - - @JSONField(serialize = false) - private String password; - - private Boolean enabled; - - @JSONField(serialize = false) - private Boolean isAdmin = false; - - private Date pwdResetTime; -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/dto/UserQueryCriteria.java b/wjcy-system/src/main/java/me/zhengjie/modules/system/service/dto/UserQueryCriteria.java deleted file mode 100644 index ad8e775..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/dto/UserQueryCriteria.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.system.service.dto; - -import lombok.Data; -import me.zhengjie.annotation.Query; -import java.io.Serializable; -import java.sql.Timestamp; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - -/** - * @author Zheng Jie - * @date 2018-11-23 - */ -@Data -public class UserQueryCriteria implements Serializable { - - @Query - private Long id; - - @Query(propName = "id", type = Query.Type.IN, joinName = "dept") - private Set deptIds = new HashSet<>(); - - @Query(blurry = "email,username,nickName") - private String blurry; - - @Query - private Boolean enabled; - - private Long deptId; - - @Query(type = Query.Type.BETWEEN) - private List createTime; -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/impl/DataServiceImpl.java b/wjcy-system/src/main/java/me/zhengjie/modules/system/service/impl/DataServiceImpl.java deleted file mode 100644 index 33a8148..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/impl/DataServiceImpl.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.system.service.impl; - -import lombok.RequiredArgsConstructor; -import me.zhengjie.modules.system.domain.Dept; -import me.zhengjie.modules.system.service.DataService; -import me.zhengjie.modules.system.service.DeptService; -import me.zhengjie.modules.system.service.RoleService; -import me.zhengjie.modules.system.service.dto.RoleSmallDto; -import me.zhengjie.modules.system.service.dto.UserDto; -import me.zhengjie.utils.enums.DataScopeEnum; -import org.springframework.cache.annotation.CacheConfig; -import org.springframework.cache.annotation.Cacheable; -import org.springframework.stereotype.Service; -import java.util.*; - -/** - * @author Zheng Jie - * @website https://el-admin.vip - * @description 数据权限服务实现 - * @date 2020-05-07 - **/ -@Service -@RequiredArgsConstructor -@CacheConfig(cacheNames = "data") -public class DataServiceImpl implements DataService { - - private final RoleService roleService; - private final DeptService deptService; - - /** - * 用户角色改变时需清理缓存 - * @param user / - * @return / - */ - @Override - @Cacheable(key = "'user:' + #p0.id") - public List getDeptIds(UserDto user) { - // 用于存储部门id - Set deptIds = new HashSet<>(); - // 查询用户角色 - List roleSet = roleService.findByUsersId(user.getId()); - // 获取对应的部门ID - for (RoleSmallDto role : roleSet) { - DataScopeEnum dataScopeEnum = DataScopeEnum.find(role.getDataScope()); - switch (Objects.requireNonNull(dataScopeEnum)) { - case THIS_LEVEL: - deptIds.add(user.getDept().getId()); - break; - case CUSTOMIZE: - deptIds.addAll(getCustomize(deptIds, role)); - break; - default: - return new ArrayList<>(deptIds); - } - } - return new ArrayList<>(deptIds); - } - - /** - * 获取自定义的数据权限 - * @param deptIds 部门ID - * @param role 角色 - * @return 数据权限ID - */ - public Set getCustomize(Set deptIds, RoleSmallDto role){ - Set depts = deptService.findByRoleId(role.getId()); - for (Dept dept : depts) { - deptIds.add(dept.getId()); - List deptChildren = deptService.findByPid(dept.getId()); - if (deptChildren != null && deptChildren.size() != 0) { - deptIds.addAll(deptService.getDeptChildren(deptChildren)); - } - } - return deptIds; - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/impl/DeptServiceImpl.java b/wjcy-system/src/main/java/me/zhengjie/modules/system/service/impl/DeptServiceImpl.java deleted file mode 100644 index a02bd69..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/impl/DeptServiceImpl.java +++ /dev/null @@ -1,283 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.system.service.impl; - -import cn.hutool.core.collection.CollectionUtil; -import cn.hutool.core.util.ObjectUtil; -import lombok.RequiredArgsConstructor; -import me.zhengjie.exception.BadRequestException; -import me.zhengjie.modules.system.domain.Dept; -import me.zhengjie.modules.system.domain.User; -import me.zhengjie.modules.system.repository.RoleRepository; -import me.zhengjie.modules.system.repository.UserRepository; -import me.zhengjie.modules.system.service.dto.DeptDto; -import me.zhengjie.modules.system.service.dto.DeptQueryCriteria; -import me.zhengjie.utils.*; -import me.zhengjie.modules.system.repository.DeptRepository; -import me.zhengjie.modules.system.service.DeptService; -import me.zhengjie.modules.system.service.mapstruct.DeptMapper; -import me.zhengjie.utils.enums.DataScopeEnum; -import org.springframework.cache.annotation.CacheConfig; -import org.springframework.cache.annotation.Cacheable; -import org.springframework.data.domain.Sort; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.lang.reflect.Field; -import java.util.*; -import java.util.stream.Collectors; - -/** -* @author Zheng Jie -* @date 2019-03-25 -*/ -@Service -@RequiredArgsConstructor -@CacheConfig(cacheNames = "dept") -public class DeptServiceImpl implements DeptService { - - private final DeptRepository deptRepository; - private final DeptMapper deptMapper; - private final UserRepository userRepository; - private final RedisUtils redisUtils; - private final RoleRepository roleRepository; - - @Override - public List queryAll(DeptQueryCriteria criteria, Boolean isQuery) throws Exception { - Sort sort = Sort.by(Sort.Direction.ASC, "deptSort"); - String dataScopeType = SecurityUtils.getDataScopeType(); - if (isQuery) { - if(dataScopeType.equals(DataScopeEnum.ALL.getValue())){ - criteria.setPidIsNull(true); - } - List fields = QueryHelp.getAllFields(criteria.getClass(), new ArrayList<>()); - List fieldNames = new ArrayList(){{ add("pidIsNull");add("enabled");}}; - for (Field field : fields) { - //设置对象的访问权限,保证对private的属性的访问 - field.setAccessible(true); - Object val = field.get(criteria); - if(fieldNames.contains(field.getName())){ - continue; - } - if (ObjectUtil.isNotNull(val)) { - criteria.setPidIsNull(null); - break; - } - } - } - List list = deptMapper.toDto(deptRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),sort)); - // 如果为空,就代表为自定义权限或者本级权限,就需要去重,不理解可以注释掉,看查询结果 - if(StringUtils.isBlank(dataScopeType)){ - return deduplication(list); - } - return list; - } - - @Override - @Cacheable(key = "'id:' + #p0") - public DeptDto findById(Long id) { - Dept dept = deptRepository.findById(id).orElseGet(Dept::new); - ValidationUtil.isNull(dept.getId(),"Dept","id",id); - return deptMapper.toDto(dept); - } - - @Override - public List findByPid(long pid) { - return deptRepository.findByPid(pid); - } - - @Override - public Set findByRoleId(Long id) { - return deptRepository.findByRoleId(id); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void create(Dept resources) { - deptRepository.save(resources); - // 计算子节点数目 - resources.setSubCount(0); - // 清理缓存 - updateSubCnt(resources.getPid()); - // 清理自定义角色权限的datascope缓存 - delCaches(resources.getPid()); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void update(Dept resources) { - // 旧的部门 - Long oldPid = findById(resources.getId()).getPid(); - Long newPid = resources.getPid(); - if(resources.getPid() != null && resources.getId().equals(resources.getPid())) { - throw new BadRequestException("上级不能为自己"); - } - Dept dept = deptRepository.findById(resources.getId()).orElseGet(Dept::new); - ValidationUtil.isNull( dept.getId(),"Dept","id",resources.getId()); - resources.setId(dept.getId()); - deptRepository.save(resources); - // 更新父节点中子节点数目 - updateSubCnt(oldPid); - updateSubCnt(newPid); - // 清理缓存 - delCaches(resources.getId()); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void delete(Set deptDtos) { - for (DeptDto deptDto : deptDtos) { - // 清理缓存 - delCaches(deptDto.getId()); - deptRepository.deleteById(deptDto.getId()); - updateSubCnt(deptDto.getPid()); - } - } - - @Override - public void download(List deptDtos, HttpServletResponse response) throws IOException { - List> list = new ArrayList<>(); - for (DeptDto deptDTO : deptDtos) { - Map map = new LinkedHashMap<>(); - map.put("部门名称", deptDTO.getName()); - map.put("部门状态", deptDTO.getEnabled() ? "启用" : "停用"); - map.put("创建日期", deptDTO.getCreateTime()); - list.add(map); - } - FileUtil.downloadExcel(list, response); - } - - @Override - public Set getDeleteDepts(List menuList, Set deptDtos) { - for (Dept dept : menuList) { - deptDtos.add(deptMapper.toDto(dept)); - List depts = deptRepository.findByPid(dept.getId()); - if(depts!=null && depts.size()!=0){ - getDeleteDepts(depts, deptDtos); - } - } - return deptDtos; - } - - @Override - public List getDeptChildren(List deptList) { - List list = new ArrayList<>(); - deptList.forEach(dept -> { - if (dept!=null && dept.getEnabled()) { - List depts = deptRepository.findByPid(dept.getId()); - if (depts.size() != 0) { - list.addAll(getDeptChildren(depts)); - } - list.add(dept.getId()); - } - } - ); - return list; - } - - @Override - public List getSuperior(DeptDto deptDto, List depts) { - if(deptDto.getPid() == null){ - depts.addAll(deptRepository.findByPidIsNull()); - return deptMapper.toDto(depts); - } - depts.addAll(deptRepository.findByPid(deptDto.getPid())); - return getSuperior(findById(deptDto.getPid()), depts); - } - - @Override - public Object buildTree(List deptDtos) { - Set trees = new LinkedHashSet<>(); - Set depts= new LinkedHashSet<>(); - List deptNames = deptDtos.stream().map(DeptDto::getName).collect(Collectors.toList()); - boolean isChild; - for (DeptDto deptDTO : deptDtos) { - isChild = false; - if (deptDTO.getPid() == null) { - trees.add(deptDTO); - } - for (DeptDto it : deptDtos) { - if (it.getPid() != null && deptDTO.getId().equals(it.getPid())) { - isChild = true; - if (deptDTO.getChildren() == null) { - deptDTO.setChildren(new ArrayList<>()); - } - deptDTO.getChildren().add(it); - } - } - if(isChild) { - depts.add(deptDTO); - } else if(deptDTO.getPid() != null && !deptNames.contains(findById(deptDTO.getPid()).getName())) { - depts.add(deptDTO); - } - } - - if (CollectionUtil.isEmpty(trees)) { - trees = depts; - } - Map map = new HashMap<>(2); - map.put("totalElements",deptDtos.size()); - map.put("content",CollectionUtil.isEmpty(trees)? deptDtos :trees); - return map; - } - - @Override - public void verification(Set deptDtos) { - Set deptIds = deptDtos.stream().map(DeptDto::getId).collect(Collectors.toSet()); - if(userRepository.countByDepts(deptIds) > 0){ - throw new BadRequestException("所选部门存在用户关联,请解除后再试!"); - } - if(roleRepository.countByDepts(deptIds) > 0){ - throw new BadRequestException("所选部门存在角色关联,请解除后再试!"); - } - } - - private void updateSubCnt(Long deptId){ - if(deptId != null){ - int count = deptRepository.countByPid(deptId); - deptRepository.updateSubCntById(count, deptId); - } - } - - private List deduplication(List list) { - List deptDtos = new ArrayList<>(); - for (DeptDto deptDto : list) { - boolean flag = true; - for (DeptDto dto : list) { - if (dto.getId().equals(deptDto.getPid())) { - flag = false; - break; - } - } - if (flag){ - deptDtos.add(deptDto); - } - } - return deptDtos; - } - - /** - * 清理缓存 - * @param id / - */ - public void delCaches(Long id){ - List users = userRepository.findByRoleDeptId(id); - // 删除数据权限 - redisUtils.delByKeys(CacheKey.DATA_USER, users.stream().map(User::getId).collect(Collectors.toSet())); - redisUtils.del(CacheKey.DEPT_ID + id); - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/impl/DictDetailServiceImpl.java b/wjcy-system/src/main/java/me/zhengjie/modules/system/service/impl/DictDetailServiceImpl.java deleted file mode 100644 index 3f5fc74..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/impl/DictDetailServiceImpl.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.system.service.impl; - -import lombok.RequiredArgsConstructor; -import me.zhengjie.modules.system.domain.Dict; -import me.zhengjie.modules.system.domain.DictDetail; -import me.zhengjie.modules.system.repository.DictRepository; -import me.zhengjie.modules.system.service.dto.DictDetailQueryCriteria; -import me.zhengjie.utils.*; -import me.zhengjie.modules.system.repository.DictDetailRepository; -import me.zhengjie.modules.system.service.DictDetailService; -import me.zhengjie.modules.system.service.dto.DictDetailDto; -import me.zhengjie.modules.system.service.mapstruct.DictDetailMapper; -import org.springframework.cache.annotation.CacheConfig; -import org.springframework.cache.annotation.Cacheable; -import org.springframework.data.domain.Page; -import org.springframework.data.domain.Pageable; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import java.util.List; -import java.util.Map; - -/** -* @author Zheng Jie -* @date 2019-04-10 -*/ -@Service -@RequiredArgsConstructor -@CacheConfig(cacheNames = "dict") -public class DictDetailServiceImpl implements DictDetailService { - - private final DictRepository dictRepository; - private final DictDetailRepository dictDetailRepository; - private final DictDetailMapper dictDetailMapper; - private final RedisUtils redisUtils; - - @Override - public Map queryAll(DictDetailQueryCriteria criteria, Pageable pageable) { - Page page = dictDetailRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable); - return PageUtil.toPage(page.map(dictDetailMapper::toDto)); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void create(DictDetail resources) { - dictDetailRepository.save(resources); - // 清理缓存 - delCaches(resources); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void update(DictDetail resources) { - DictDetail dictDetail = dictDetailRepository.findById(resources.getId()).orElseGet(DictDetail::new); - ValidationUtil.isNull( dictDetail.getId(),"DictDetail","id",resources.getId()); - resources.setId(dictDetail.getId()); - dictDetailRepository.save(resources); - // 清理缓存 - delCaches(resources); - } - - @Override - @Cacheable(key = "'name:' + #p0") - public List getDictByName(String name) { - return dictDetailMapper.toDto(dictDetailRepository.findByDictName(name)); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void delete(Long id) { - DictDetail dictDetail = dictDetailRepository.findById(id).orElseGet(DictDetail::new); - // 清理缓存 - delCaches(dictDetail); - dictDetailRepository.deleteById(id); - } - - public void delCaches(DictDetail dictDetail){ - Dict dict = dictRepository.findById(dictDetail.getDict().getId()).orElseGet(Dict::new); - redisUtils.del(CacheKey.DICT_NAME + dict.getName()); - } -} \ No newline at end of file diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/impl/DictServiceImpl.java b/wjcy-system/src/main/java/me/zhengjie/modules/system/service/impl/DictServiceImpl.java deleted file mode 100644 index 3a2bcd9..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/impl/DictServiceImpl.java +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.system.service.impl; - -import cn.hutool.core.collection.CollectionUtil; -import lombok.RequiredArgsConstructor; -import me.zhengjie.modules.system.domain.Dict; -import me.zhengjie.modules.system.service.dto.DictDetailDto; -import me.zhengjie.modules.system.service.dto.DictQueryCriteria; -import me.zhengjie.utils.*; -import me.zhengjie.modules.system.repository.DictRepository; -import me.zhengjie.modules.system.service.DictService; -import me.zhengjie.modules.system.service.dto.DictDto; -import me.zhengjie.modules.system.service.mapstruct.DictMapper; -import org.springframework.cache.annotation.CacheConfig; -import org.springframework.data.domain.Page; -import org.springframework.data.domain.Pageable; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.*; - -/** -* @author Zheng Jie -* @date 2019-04-10 -*/ -@Service -@RequiredArgsConstructor -@CacheConfig(cacheNames = "dict") -public class DictServiceImpl implements DictService { - - private final DictRepository dictRepository; - private final DictMapper dictMapper; - private final RedisUtils redisUtils; - - @Override - public Map queryAll(DictQueryCriteria dict, Pageable pageable){ - Page page = dictRepository.findAll((root, query, cb) -> QueryHelp.getPredicate(root, dict, cb), pageable); - return PageUtil.toPage(page.map(dictMapper::toDto)); - } - - @Override - public List queryAll(DictQueryCriteria dict) { - List list = dictRepository.findAll((root, query, cb) -> QueryHelp.getPredicate(root, dict, cb)); - return dictMapper.toDto(list); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void create(Dict resources) { - dictRepository.save(resources); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void update(Dict resources) { - // 清理缓存 - delCaches(resources); - Dict dict = dictRepository.findById(resources.getId()).orElseGet(Dict::new); - ValidationUtil.isNull( dict.getId(),"Dict","id",resources.getId()); - dict.setName(resources.getName()); - dict.setDescription(resources.getDescription()); - dictRepository.save(dict); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void delete(Set ids) { - // 清理缓存 - List dicts = dictRepository.findByIdIn(ids); - for (Dict dict : dicts) { - delCaches(dict); - } - dictRepository.deleteByIdIn(ids); - } - - @Override - public void download(List dictDtos, HttpServletResponse response) throws IOException { - List> list = new ArrayList<>(); - for (DictDto dictDTO : dictDtos) { - if(CollectionUtil.isNotEmpty(dictDTO.getDictDetails())){ - for (DictDetailDto dictDetail : dictDTO.getDictDetails()) { - Map map = new LinkedHashMap<>(); - map.put("字典名称", dictDTO.getName()); - map.put("字典描述", dictDTO.getDescription()); - map.put("字典标签", dictDetail.getLabel()); - map.put("字典值", dictDetail.getValue()); - map.put("创建日期", dictDetail.getCreateTime()); - list.add(map); - } - } else { - Map map = new LinkedHashMap<>(); - map.put("字典名称", dictDTO.getName()); - map.put("字典描述", dictDTO.getDescription()); - map.put("字典标签", null); - map.put("字典值", null); - map.put("创建日期", dictDTO.getCreateTime()); - list.add(map); - } - } - FileUtil.downloadExcel(list, response); - } - - public void delCaches(Dict dict){ - redisUtils.del(CacheKey.DICT_NAME + dict.getName()); - } -} \ No newline at end of file diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/impl/JobServiceImpl.java b/wjcy-system/src/main/java/me/zhengjie/modules/system/service/impl/JobServiceImpl.java deleted file mode 100644 index 5c76dfc..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/impl/JobServiceImpl.java +++ /dev/null @@ -1,132 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.system.service.impl; - -import lombok.RequiredArgsConstructor; -import me.zhengjie.exception.BadRequestException; -import me.zhengjie.exception.EntityExistException; -import me.zhengjie.modules.system.domain.Job; -import me.zhengjie.modules.system.repository.UserRepository; -import me.zhengjie.modules.system.service.dto.JobQueryCriteria; -import me.zhengjie.utils.*; -import me.zhengjie.modules.system.repository.JobRepository; -import me.zhengjie.modules.system.service.JobService; -import me.zhengjie.modules.system.service.dto.JobDto; -import me.zhengjie.modules.system.service.mapstruct.JobMapper; -import org.springframework.cache.annotation.CacheConfig; -import org.springframework.cache.annotation.CacheEvict; -import org.springframework.cache.annotation.Cacheable; -import org.springframework.data.domain.Page; -import org.springframework.data.domain.Pageable; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.*; - -/** -* @author Zheng Jie -* @date 2019-03-29 -*/ -@Service -@RequiredArgsConstructor -@CacheConfig(cacheNames = "job") -public class JobServiceImpl implements JobService { - - private final JobRepository jobRepository; - private final JobMapper jobMapper; - private final RedisUtils redisUtils; - private final UserRepository userRepository; - - @Override - public Map queryAll(JobQueryCriteria criteria, Pageable pageable) { - Page page = jobRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable); - return PageUtil.toPage(page.map(jobMapper::toDto).getContent(),page.getTotalElements()); - } - - @Override - public List queryAll(JobQueryCriteria criteria) { - List list = jobRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder)); - return jobMapper.toDto(list); - } - - @Override - @Cacheable(key = "'id:' + #p0") - public JobDto findById(Long id) { - Job job = jobRepository.findById(id).orElseGet(Job::new); - ValidationUtil.isNull(job.getId(),"Job","id",id); - return jobMapper.toDto(job); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void create(Job resources) { - Job job = jobRepository.findByName(resources.getName()); - if(job != null){ - throw new EntityExistException(Job.class,"name",resources.getName()); - } - jobRepository.save(resources); - } - - @Override - @CacheEvict(key = "'id:' + #p0.id") - @Transactional(rollbackFor = Exception.class) - public void update(Job resources) { - Job job = jobRepository.findById(resources.getId()).orElseGet(Job::new); - Job old = jobRepository.findByName(resources.getName()); - if(old != null && !old.getId().equals(resources.getId())){ - throw new EntityExistException(Job.class,"name",resources.getName()); - } - ValidationUtil.isNull( job.getId(),"Job","id",resources.getId()); - resources.setId(job.getId()); - jobRepository.save(resources); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void delete(Set ids) { - jobRepository.deleteAllByIdIn(ids); - jobRepository.deleteAll(); - // 删除缓存 - redisUtils.delByKeys(CacheKey.JOB_ID, ids); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void delete() { - jobRepository.deleteAll(); - } - - @Override - public void download(List jobDtos, HttpServletResponse response) throws IOException { - List> list = new ArrayList<>(); - for (JobDto jobDTO : jobDtos) { - Map map = new LinkedHashMap<>(); - map.put("岗位名称", jobDTO.getName()); - map.put("岗位状态", jobDTO.getEnabled() ? "启用" : "停用"); - map.put("创建日期", jobDTO.getCreateTime()); - list.add(map); - } - FileUtil.downloadExcel(list, response); - } - - @Override - public void verification(Set ids) { - if(userRepository.countByJobs(ids) > 0){ - throw new BadRequestException("所选的岗位中存在用户关联,请解除关联再试!"); - } - } -} \ No newline at end of file diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/impl/MenuServiceImpl.java b/wjcy-system/src/main/java/me/zhengjie/modules/system/service/impl/MenuServiceImpl.java deleted file mode 100644 index 0e54fc9..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/impl/MenuServiceImpl.java +++ /dev/null @@ -1,355 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.system.service.impl; - -import cn.hutool.core.collection.CollectionUtil; -import cn.hutool.core.util.ObjectUtil; -import lombok.RequiredArgsConstructor; -import me.zhengjie.modules.system.domain.Menu; -import me.zhengjie.modules.system.domain.Role; -import me.zhengjie.modules.system.domain.User; -import me.zhengjie.modules.system.domain.vo.MenuMetaVo; -import me.zhengjie.modules.system.domain.vo.MenuVo; -import me.zhengjie.exception.BadRequestException; -import me.zhengjie.exception.EntityExistException; -import me.zhengjie.modules.system.repository.MenuRepository; -import me.zhengjie.modules.system.repository.UserRepository; -import me.zhengjie.modules.system.service.MenuService; -import me.zhengjie.modules.system.service.RoleService; -import me.zhengjie.modules.system.service.dto.MenuDto; -import me.zhengjie.modules.system.service.dto.MenuQueryCriteria; -import me.zhengjie.modules.system.service.dto.RoleSmallDto; -import me.zhengjie.modules.system.service.mapstruct.MenuMapper; -import me.zhengjie.utils.*; -import org.springframework.cache.annotation.CacheConfig; -import org.springframework.cache.annotation.Cacheable; -import org.springframework.data.domain.Sort; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.lang.reflect.Field; -import java.util.*; -import java.util.stream.Collectors; - -/** - * @author Zheng Jie - */ -@Service -@RequiredArgsConstructor -@CacheConfig(cacheNames = "menu") -public class MenuServiceImpl implements MenuService { - - private final MenuRepository menuRepository; - private final UserRepository userRepository; - private final MenuMapper menuMapper; - private final RoleService roleService; - private final RedisUtils redisUtils; - - @Override - public List queryAll(MenuQueryCriteria criteria, Boolean isQuery) throws Exception { - Sort sort = Sort.by(Sort.Direction.ASC, "menuSort"); - if(isQuery){ - criteria.setPidIsNull(true); - List fields = QueryHelp.getAllFields(criteria.getClass(), new ArrayList<>()); - for (Field field : fields) { - //设置对象的访问权限,保证对private的属性的访问 - field.setAccessible(true); - Object val = field.get(criteria); - if("pidIsNull".equals(field.getName())){ - continue; - } - if (ObjectUtil.isNotNull(val)) { - criteria.setPidIsNull(null); - break; - } - } - } - return menuMapper.toDto(menuRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),sort)); - } - - @Override - @Cacheable(key = "'id:' + #p0") - public MenuDto findById(long id) { - Menu menu = menuRepository.findById(id).orElseGet(Menu::new); - ValidationUtil.isNull(menu.getId(),"Menu","id",id); - return menuMapper.toDto(menu); - } - - /** - * 用户角色改变时需清理缓存 - * @param currentUserId / - * @return / - */ - @Override - @Cacheable(key = "'user:' + #p0") - public List findByUser(Long currentUserId) { - List roles = roleService.findByUsersId(currentUserId); - Set roleIds = roles.stream().map(RoleSmallDto::getId).collect(Collectors.toSet()); - LinkedHashSet menus = menuRepository.findByRoleIdsAndTypeNot(roleIds, 2); - return menus.stream().map(menuMapper::toDto).collect(Collectors.toList()); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void create(Menu resources) { - if(menuRepository.findByTitle(resources.getTitle()) != null){ - throw new EntityExistException(Menu.class,"title",resources.getTitle()); - } - if(StringUtils.isNotBlank(resources.getComponentName())){ - if(menuRepository.findByComponentName(resources.getComponentName()) != null){ - throw new EntityExistException(Menu.class,"componentName",resources.getComponentName()); - } - } - if(resources.getPid().equals(0L)){ - resources.setPid(null); - } - if(resources.getIFrame()){ - String http = "http://", https = "https://"; - if (!(resources.getPath().toLowerCase().startsWith(http)||resources.getPath().toLowerCase().startsWith(https))) { - throw new BadRequestException("外链必须以http://或者https://开头"); - } - } - menuRepository.save(resources); - // 计算子节点数目 - resources.setSubCount(0); - // 更新父节点菜单数目 - updateSubCnt(resources.getPid()); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void update(Menu resources) { - if(resources.getId().equals(resources.getPid())) { - throw new BadRequestException("上级不能为自己"); - } - Menu menu = menuRepository.findById(resources.getId()).orElseGet(Menu::new); - ValidationUtil.isNull(menu.getId(),"Permission","id",resources.getId()); - - if(resources.getIFrame()){ - String http = "http://", https = "https://"; - if (!(resources.getPath().toLowerCase().startsWith(http)||resources.getPath().toLowerCase().startsWith(https))) { - throw new BadRequestException("外链必须以http://或者https://开头"); - } - } - Menu menu1 = menuRepository.findByTitle(resources.getTitle()); - - if(menu1 != null && !menu1.getId().equals(menu.getId())){ - throw new EntityExistException(Menu.class,"title",resources.getTitle()); - } - - if(resources.getPid().equals(0L)){ - resources.setPid(null); - } - - // 记录的父节点ID - Long oldPid = menu.getPid(); - Long newPid = resources.getPid(); - - if(StringUtils.isNotBlank(resources.getComponentName())){ - menu1 = menuRepository.findByComponentName(resources.getComponentName()); - if(menu1 != null && !menu1.getId().equals(menu.getId())){ - throw new EntityExistException(Menu.class,"componentName",resources.getComponentName()); - } - } - menu.setTitle(resources.getTitle()); - menu.setComponent(resources.getComponent()); - menu.setPath(resources.getPath()); - menu.setIcon(resources.getIcon()); - menu.setIFrame(resources.getIFrame()); - menu.setPid(resources.getPid()); - menu.setMenuSort(resources.getMenuSort()); - menu.setCache(resources.getCache()); - menu.setHidden(resources.getHidden()); - menu.setComponentName(resources.getComponentName()); - menu.setPermission(resources.getPermission()); - menu.setType(resources.getType()); - menuRepository.save(menu); - // 计算父级菜单节点数目 - updateSubCnt(oldPid); - updateSubCnt(newPid); - // 清理缓存 - delCaches(resources.getId()); - } - - @Override - public Set getChildMenus(List menuList, Set menuSet) { - for (Menu menu : menuList) { - menuSet.add(menu); - List menus = menuRepository.findByPid(menu.getId()); - if(menus!=null && menus.size()!=0){ - getChildMenus(menus, menuSet); - } - } - return menuSet; - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void delete(Set menuSet) { - for (Menu menu : menuSet) { - // 清理缓存 - delCaches(menu.getId()); - roleService.untiedMenu(menu.getId()); - menuRepository.deleteById(menu.getId()); - updateSubCnt(menu.getPid()); - } - } - - @Override - public List getMenus(Long pid) { - List menus; - if(pid != null && !pid.equals(0L)){ - menus = menuRepository.findByPid(pid); - } else { - menus = menuRepository.findByPidIsNull(); - } - return menuMapper.toDto(menus); - } - - @Override - public List getSuperior(MenuDto menuDto, List menus) { - if(menuDto.getPid() == null){ - menus.addAll(menuRepository.findByPidIsNull()); - return menuMapper.toDto(menus); - } - menus.addAll(menuRepository.findByPid(menuDto.getPid())); - return getSuperior(findById(menuDto.getPid()), menus); - } - - @Override - public List buildTree(List menuDtos) { - List trees = new ArrayList<>(); - Set ids = new HashSet<>(); - for (MenuDto menuDTO : menuDtos) { - if (menuDTO.getPid() == null) { - trees.add(menuDTO); - } - for (MenuDto it : menuDtos) { - if (menuDTO.getId().equals(it.getPid())) { - if (menuDTO.getChildren() == null) { - menuDTO.setChildren(new ArrayList<>()); - } - menuDTO.getChildren().add(it); - ids.add(it.getId()); - } - } - } - if(trees.size() == 0){ - trees = menuDtos.stream().filter(s -> !ids.contains(s.getId())).collect(Collectors.toList()); - } - return trees; - } - - @Override - public List buildMenus(List menuDtos) { - List list = new LinkedList<>(); - menuDtos.forEach(menuDTO -> { - if (menuDTO!=null){ - List menuDtoList = menuDTO.getChildren(); - MenuVo menuVo = new MenuVo(); - menuVo.setName(ObjectUtil.isNotEmpty(menuDTO.getComponentName()) ? menuDTO.getComponentName() : menuDTO.getTitle()); - // 一级目录需要加斜杠,不然会报警告 - menuVo.setPath(menuDTO.getPid() == null ? "/" + menuDTO.getPath() :menuDTO.getPath()); - menuVo.setHidden(menuDTO.getHidden()); - // 如果不是外链 - if(!menuDTO.getIFrame()){ - if(menuDTO.getPid() == null){ - menuVo.setComponent(StringUtils.isEmpty(menuDTO.getComponent())?"Layout":menuDTO.getComponent()); - // 如果不是一级菜单,并且菜单类型为目录,则代表是多级菜单 - }else if(menuDTO.getType() == 0){ - menuVo.setComponent(StringUtils.isEmpty(menuDTO.getComponent())?"ParentView":menuDTO.getComponent()); - }else if(StringUtils.isNoneBlank(menuDTO.getComponent())){ - menuVo.setComponent(menuDTO.getComponent()); - } - } - menuVo.setMeta(new MenuMetaVo(menuDTO.getTitle(),menuDTO.getIcon(),!menuDTO.getCache())); - if(CollectionUtil.isNotEmpty(menuDtoList)){ - menuVo.setAlwaysShow(true); - menuVo.setRedirect("noredirect"); - menuVo.setChildren(buildMenus(menuDtoList)); - // 处理是一级菜单并且没有子菜单的情况 - } else if(menuDTO.getPid() == null){ - MenuVo menuVo1 = new MenuVo(); - menuVo1.setMeta(menuVo.getMeta()); - // 非外链 - if(!menuDTO.getIFrame()){ - menuVo1.setPath("index"); - menuVo1.setName(menuVo.getName()); - menuVo1.setComponent(menuVo.getComponent()); - } else { - menuVo1.setPath(menuDTO.getPath()); - } - menuVo.setName(null); - menuVo.setMeta(null); - menuVo.setComponent("Layout"); - List list1 = new ArrayList<>(); - list1.add(menuVo1); - menuVo.setChildren(list1); - } - list.add(menuVo); - } - } - ); - return list; - } - - @Override - public Menu findOne(Long id) { - Menu menu = menuRepository.findById(id).orElseGet(Menu::new); - ValidationUtil.isNull(menu.getId(),"Menu","id",id); - return menu; - } - - @Override - public void download(List menuDtos, HttpServletResponse response) throws IOException { - List> list = new ArrayList<>(); - for (MenuDto menuDTO : menuDtos) { - Map map = new LinkedHashMap<>(); - map.put("菜单标题", menuDTO.getTitle()); - map.put("菜单类型", menuDTO.getType() == null ? "目录" : menuDTO.getType() == 1 ? "菜单" : "按钮"); - map.put("权限标识", menuDTO.getPermission()); - map.put("外链菜单", menuDTO.getIFrame() ? "是" : "否"); - map.put("菜单可见", menuDTO.getHidden() ? "否" : "是"); - map.put("是否缓存", menuDTO.getCache() ? "是" : "否"); - map.put("创建日期", menuDTO.getCreateTime()); - list.add(map); - } - FileUtil.downloadExcel(list, response); - } - - private void updateSubCnt(Long menuId){ - if(menuId != null){ - int count = menuRepository.countByPid(menuId); - menuRepository.updateSubCntById(count, menuId); - } - } - - /** - * 清理缓存 - * @param id 菜单ID - */ - public void delCaches(Long id){ - List users = userRepository.findByMenuId(id); - redisUtils.del(CacheKey.MENU_ID + id); - redisUtils.delByKeys(CacheKey.MENU_USER, users.stream().map(User::getId).collect(Collectors.toSet())); - // 清除 Role 缓存 - List roles = roleService.findInMenuId(new ArrayList(){{ - add(id); - }}); - redisUtils.delByKeys(CacheKey.ROLE_ID, roles.stream().map(Role::getId).collect(Collectors.toSet())); - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/impl/MonitorServiceImpl.java b/wjcy-system/src/main/java/me/zhengjie/modules/system/service/impl/MonitorServiceImpl.java deleted file mode 100644 index 7ff2e91..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/impl/MonitorServiceImpl.java +++ /dev/null @@ -1,187 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.system.service.impl; - -import cn.hutool.core.date.BetweenFormater; -import cn.hutool.core.date.DateUtil; -import me.zhengjie.exception.BadRequestException; -import me.zhengjie.modules.system.service.MonitorService; -import me.zhengjie.utils.ElAdminConstant; -import me.zhengjie.utils.FileUtil; -import me.zhengjie.utils.StringUtils; -import org.springframework.stereotype.Service; -import oshi.SystemInfo; -import oshi.hardware.*; -import oshi.software.os.FileSystem; -import oshi.software.os.OSFileStore; -import oshi.software.os.OperatingSystem; -import oshi.util.FormatUtil; -import oshi.util.Util; -import java.lang.management.ManagementFactory; -import java.text.DecimalFormat; -import java.util.*; - -/** -* @author Zheng Jie -* @date 2020-05-02 -*/ -@Service -public class MonitorServiceImpl implements MonitorService { - - private final DecimalFormat df = new DecimalFormat("0.00"); - - @Override - public Map getServers(){ - Map resultMap = new LinkedHashMap<>(8); - try { - SystemInfo si = new SystemInfo(); - OperatingSystem os = si.getOperatingSystem(); - HardwareAbstractionLayer hal = si.getHardware(); - // 系统信息 - resultMap.put("sys", getSystemInfo(os)); - // cpu 信息 - resultMap.put("cpu", getCpuInfo(hal.getProcessor())); - // 内存信息 - resultMap.put("memory", getMemoryInfo(hal.getMemory())); - // 交换区信息 - resultMap.put("swap", getSwapInfo(hal.getMemory())); - // 磁盘 - resultMap.put("disk", getDiskInfo(os)); - resultMap.put("time", DateUtil.format(new Date(), "HH:mm:ss")); - } catch (Exception e) { - e.printStackTrace(); - } - return resultMap; - } - - /** - * 获取磁盘信息 - * @return / - */ - private Map getDiskInfo(OperatingSystem os) { - Map diskInfo = new LinkedHashMap<>(); - FileSystem fileSystem = os.getFileSystem(); - List fsArray = fileSystem.getFileStores(); - String osName = System.getProperty("os.name"); - long available = 0, total = 0; - for (OSFileStore fs : fsArray){ - // windows 需要将所有磁盘分区累加,linux 和 mac 直接累加会出现磁盘重复的问题,待修复 - if(osName.toLowerCase().startsWith(ElAdminConstant.WIN)) { - available += fs.getUsableSpace(); - total += fs.getTotalSpace(); - } else { - available = fs.getUsableSpace(); - total = fs.getTotalSpace(); - break; - } - } - long used = total - available; - diskInfo.put("total", total > 0 ? FileUtil.getSize(total) : "?"); - diskInfo.put("available", FileUtil.getSize(available)); - diskInfo.put("used", FileUtil.getSize(used)); - if(total != 0){ - diskInfo.put("usageRate", df.format(used/(double)total * 100)); - } else { - diskInfo.put("usageRate", 0); - } - return diskInfo; - } - - /** - * 获取交换区信息 - * @param memory / - * @return / - */ - private Map getSwapInfo(GlobalMemory memory) { - Map swapInfo = new LinkedHashMap<>(); - VirtualMemory virtualMemory = memory.getVirtualMemory(); - long total = virtualMemory.getSwapTotal(); - long used = virtualMemory.getSwapUsed(); - swapInfo.put("total", FormatUtil.formatBytes(total)); - swapInfo.put("used", FormatUtil.formatBytes(used)); - swapInfo.put("available", FormatUtil.formatBytes(total - used)); - if(used == 0){ - swapInfo.put("usageRate", 0); - } else { - swapInfo.put("usageRate", df.format(used/(double)total * 100)); - } - return swapInfo; - } - - /** - * 获取内存信息 - * @param memory / - * @return / - */ - private Map getMemoryInfo(GlobalMemory memory) { - Map memoryInfo = new LinkedHashMap<>(); - memoryInfo.put("total", FormatUtil.formatBytes(memory.getTotal())); - memoryInfo.put("available", FormatUtil.formatBytes(memory.getAvailable())); - memoryInfo.put("used", FormatUtil.formatBytes(memory.getTotal() - memory.getAvailable())); - memoryInfo.put("usageRate", df.format((memory.getTotal() - memory.getAvailable())/(double)memory.getTotal() * 100)); - return memoryInfo; - } - - /** - * 获取Cpu相关信息 - * @param processor / - * @return / - */ - private Map getCpuInfo(CentralProcessor processor) { - Map cpuInfo = new LinkedHashMap<>(); - cpuInfo.put("name", processor.getProcessorIdentifier().getName()); - cpuInfo.put("package", processor.getPhysicalPackageCount() + "个物理CPU"); - cpuInfo.put("core", processor.getPhysicalProcessorCount() + "个物理核心"); - cpuInfo.put("coreNumber", processor.getPhysicalProcessorCount()); - cpuInfo.put("logic", processor.getLogicalProcessorCount() + "个逻辑CPU"); - // CPU信息 - long[] prevTicks = processor.getSystemCpuLoadTicks(); - // 等待1秒... - Util.sleep(1000); - long[] ticks = processor.getSystemCpuLoadTicks(); - long user = ticks[CentralProcessor.TickType.USER.getIndex()] - prevTicks[CentralProcessor.TickType.USER.getIndex()]; - long nice = ticks[CentralProcessor.TickType.NICE.getIndex()] - prevTicks[CentralProcessor.TickType.NICE.getIndex()]; - long sys = ticks[CentralProcessor.TickType.SYSTEM.getIndex()] - prevTicks[CentralProcessor.TickType.SYSTEM.getIndex()]; - long idle = ticks[CentralProcessor.TickType.IDLE.getIndex()] - prevTicks[CentralProcessor.TickType.IDLE.getIndex()]; - long iowait = ticks[CentralProcessor.TickType.IOWAIT.getIndex()] - prevTicks[CentralProcessor.TickType.IOWAIT.getIndex()]; - long irq = ticks[CentralProcessor.TickType.IRQ.getIndex()] - prevTicks[CentralProcessor.TickType.IRQ.getIndex()]; - long softirq = ticks[CentralProcessor.TickType.SOFTIRQ.getIndex()] - prevTicks[CentralProcessor.TickType.SOFTIRQ.getIndex()]; - long steal = ticks[CentralProcessor.TickType.STEAL.getIndex()] - prevTicks[CentralProcessor.TickType.STEAL.getIndex()]; - long totalCpu = user + nice + sys + idle + iowait + irq + softirq + steal; - cpuInfo.put("used", df.format(100d * user / totalCpu + 100d * sys / totalCpu)); - cpuInfo.put("idle", df.format(100d * idle / totalCpu)); - return cpuInfo; - } - - /** - * 获取系统相关信息,系统、运行天数、系统IP - * @param os / - * @return / - */ - private Map getSystemInfo(OperatingSystem os){ - Map systemInfo = new LinkedHashMap<>(); - // jvm 运行时间 - long time = ManagementFactory.getRuntimeMXBean().getStartTime(); - Date date = new Date(time); - // 计算项目运行时间 - String formatBetween = DateUtil.formatBetween(date, new Date(),BetweenFormater.Level.HOUR); - // 系统信息 - systemInfo.put("os", os.toString()); - systemInfo.put("day", formatBetween); - systemInfo.put("ip", StringUtils.getLocalIp()); - return systemInfo; - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/impl/RoleServiceImpl.java b/wjcy-system/src/main/java/me/zhengjie/modules/system/service/impl/RoleServiceImpl.java deleted file mode 100644 index e8b4143..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/impl/RoleServiceImpl.java +++ /dev/null @@ -1,226 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.system.service.impl; - -import cn.hutool.core.collection.CollectionUtil; -import lombok.RequiredArgsConstructor; -import me.zhengjie.exception.BadRequestException; -import me.zhengjie.modules.security.service.UserCacheClean; -import me.zhengjie.modules.system.domain.Menu; -import me.zhengjie.modules.system.domain.Role; -import me.zhengjie.exception.EntityExistException; -import me.zhengjie.modules.system.domain.User; -import me.zhengjie.modules.system.repository.RoleRepository; -import me.zhengjie.modules.system.repository.UserRepository; -import me.zhengjie.modules.system.service.RoleService; -import me.zhengjie.modules.system.service.dto.RoleDto; -import me.zhengjie.modules.system.service.dto.RoleQueryCriteria; -import me.zhengjie.modules.system.service.dto.RoleSmallDto; -import me.zhengjie.modules.system.service.dto.UserDto; -import me.zhengjie.modules.system.service.mapstruct.RoleMapper; -import me.zhengjie.modules.system.service.mapstruct.RoleSmallMapper; -import me.zhengjie.utils.*; -import org.springframework.cache.annotation.CacheConfig; -import org.springframework.cache.annotation.Cacheable; -import org.springframework.data.domain.Page; -import org.springframework.data.domain.Pageable; -import org.springframework.data.domain.Sort; -import org.springframework.security.core.GrantedAuthority; -import org.springframework.security.core.authority.SimpleGrantedAuthority; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.*; -import java.util.stream.Collectors; - -/** - * @author Zheng Jie - * @date 2018-12-03 - */ -@Service -@RequiredArgsConstructor -@CacheConfig(cacheNames = "role") -public class RoleServiceImpl implements RoleService { - - private final RoleRepository roleRepository; - private final RoleMapper roleMapper; - private final RoleSmallMapper roleSmallMapper; - private final RedisUtils redisUtils; - private final UserRepository userRepository; - private final UserCacheClean userCacheClean; - - @Override - public List queryAll() { - Sort sort = Sort.by(Sort.Direction.ASC, "level"); - return roleMapper.toDto(roleRepository.findAll(sort)); - } - - @Override - public List queryAll(RoleQueryCriteria criteria) { - return roleMapper.toDto(roleRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root, criteria, criteriaBuilder))); - } - - @Override - public Object queryAll(RoleQueryCriteria criteria, Pageable pageable) { - Page page = roleRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root, criteria, criteriaBuilder), pageable); - return PageUtil.toPage(page.map(roleMapper::toDto)); - } - - @Override - @Cacheable(key = "'id:' + #p0") - @Transactional(rollbackFor = Exception.class) - public RoleDto findById(long id) { - Role role = roleRepository.findById(id).orElseGet(Role::new); - ValidationUtil.isNull(role.getId(), "Role", "id", id); - return roleMapper.toDto(role); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void create(Role resources) { - if (roleRepository.findByName(resources.getName()) != null) { - throw new EntityExistException(Role.class, "username", resources.getName()); - } - roleRepository.save(resources); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void update(Role resources) { - Role role = roleRepository.findById(resources.getId()).orElseGet(Role::new); - ValidationUtil.isNull(role.getId(), "Role", "id", resources.getId()); - - Role role1 = roleRepository.findByName(resources.getName()); - - if (role1 != null && !role1.getId().equals(role.getId())) { - throw new EntityExistException(Role.class, "username", resources.getName()); - } - role.setName(resources.getName()); - role.setDescription(resources.getDescription()); - role.setDataScope(resources.getDataScope()); - role.setDepts(resources.getDepts()); - role.setLevel(resources.getLevel()); - roleRepository.save(role); - // 更新相关缓存 - delCaches(role.getId(), null); - } - - @Override - public void updateMenu(Role resources, RoleDto roleDTO) { - Role role = roleMapper.toEntity(roleDTO); - List users = userRepository.findByRoleId(role.getId()); - // 更新菜单 - role.setMenus(resources.getMenus()); - delCaches(resources.getId(), users); - roleRepository.save(role); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void untiedMenu(Long menuId) { - // 更新菜单 - roleRepository.untiedMenu(menuId); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void delete(Set ids) { - for (Long id : ids) { - // 更新相关缓存 - delCaches(id, null); - } - roleRepository.deleteAllByIdIn(ids); - } - - @Override - public List findByUsersId(Long id) { - return roleSmallMapper.toDto(new ArrayList<>(roleRepository.findByUserId(id))); - } - - @Override - public Integer findByRoles(Set roles) { - if (roles.size() == 0) { - return Integer.MAX_VALUE; - } - Set roleDtos = new HashSet<>(); - for (Role role : roles) { - roleDtos.add(findById(role.getId())); - } - return Collections.min(roleDtos.stream().map(RoleDto::getLevel).collect(Collectors.toList())); - } - - @Override - @Cacheable(key = "'auth:' + #p0.id") - public List mapToGrantedAuthorities(UserDto user) { - Set permissions = new HashSet<>(); - // 如果是管理员直接返回 - if (user.getIsAdmin()) { - permissions.add("admin"); - return permissions.stream().map(SimpleGrantedAuthority::new) - .collect(Collectors.toList()); - } - Set roles = roleRepository.findByUserId(user.getId()); - permissions = roles.stream().flatMap(role -> role.getMenus().stream()) - .filter(menu -> StringUtils.isNotBlank(menu.getPermission())) - .map(Menu::getPermission).collect(Collectors.toSet()); - return permissions.stream().map(SimpleGrantedAuthority::new) - .collect(Collectors.toList()); - } - - @Override - public void download(List roles, HttpServletResponse response) throws IOException { - List> list = new ArrayList<>(); - for (RoleDto role : roles) { - Map map = new LinkedHashMap<>(); - map.put("角色名称", role.getName()); - map.put("角色级别", role.getLevel()); - map.put("描述", role.getDescription()); - map.put("创建日期", role.getCreateTime()); - list.add(map); - } - FileUtil.downloadExcel(list, response); - } - - @Override - public void verification(Set ids) { - if (userRepository.countByRoles(ids) > 0) { - throw new BadRequestException("所选角色存在用户关联,请解除关联再试!"); - } - } - - @Override - public List findInMenuId(List menuIds) { - return roleRepository.findInMenuId(menuIds); - } - - /** - * 清理缓存 - * @param id / - */ - public void delCaches(Long id, List users) { - users = CollectionUtil.isEmpty(users) ? userRepository.findByRoleId(id) : users; - if (CollectionUtil.isNotEmpty(users)) { - users.forEach(item -> userCacheClean.cleanUserCache(item.getUsername())); - Set userIds = users.stream().map(User::getId).collect(Collectors.toSet()); - redisUtils.delByKeys(CacheKey.DATA_USER, userIds); - redisUtils.delByKeys(CacheKey.MENU_USER, userIds); - redisUtils.delByKeys(CacheKey.ROLE_AUTH, userIds); - } - redisUtils.del(CacheKey.ROLE_ID + id); - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/impl/UserServiceImpl.java b/wjcy-system/src/main/java/me/zhengjie/modules/system/service/impl/UserServiceImpl.java deleted file mode 100644 index 3a56692..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/impl/UserServiceImpl.java +++ /dev/null @@ -1,282 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.system.service.impl; - -import cn.hutool.core.util.ObjectUtil; -import cn.hutool.json.JSONUtil; -import lombok.RequiredArgsConstructor; -import me.zhengjie.config.FileProperties; -import me.zhengjie.exception.BadRequestException; -import me.zhengjie.modules.security.service.OnlineUserService; -import me.zhengjie.modules.security.service.UserCacheClean; -import me.zhengjie.modules.system.domain.User; -import me.zhengjie.exception.EntityExistException; -import me.zhengjie.exception.EntityNotFoundException; -import me.zhengjie.modules.system.repository.UserRepository; -import me.zhengjie.modules.system.service.UserService; -import me.zhengjie.modules.system.service.dto.JobSmallDto; -import me.zhengjie.modules.system.service.dto.RoleSmallDto; -import me.zhengjie.modules.system.service.dto.UserDto; -import me.zhengjie.modules.system.service.dto.UserQueryCriteria; -import me.zhengjie.modules.system.service.mapstruct.UserMapper; -import me.zhengjie.utils.*; -import org.springframework.cache.annotation.CacheConfig; -import org.springframework.cache.annotation.Cacheable; -import org.springframework.data.domain.Page; -import org.springframework.data.domain.Pageable; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.web.multipart.MultipartFile; -import javax.servlet.http.HttpServletResponse; -import javax.validation.constraints.NotBlank; -import java.io.File; -import java.io.IOException; -import java.util.*; -import java.util.stream.Collectors; - -/** - * @author Zheng Jie - * @date 2018-11-23 - */ -@Service -@RequiredArgsConstructor -@CacheConfig(cacheNames = "user") -public class UserServiceImpl implements UserService { - - private final UserRepository userRepository; - private final UserMapper userMapper; - private final FileProperties properties; - private final RedisUtils redisUtils; - private final UserCacheClean userCacheClean; - private final OnlineUserService onlineUserService; - - @Override - public Object queryAll(UserQueryCriteria criteria, Pageable pageable) { - Page page = userRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root, criteria, criteriaBuilder), pageable); - // 添加用户账户冻结状态 - Map map = PageUtil.toPage(page.map(userMapper::toDto)); - - List userDtoList = (List) map.get("content"); - if (ObjectUtil.isNotEmpty(userDtoList)) { - List list = new ArrayList(); - for (UserDto userDto : userDtoList) { - String key = String.format(RedisUtils.BLOCKED_ACCOUNT, userDto.getUsername()); - long expire = redisUtils.getExpire(key); - Integer blockedStatus = 0; - String blockedTime = ""; - if (expire > 0) { - blockedStatus = 1; - blockedTime = DateUtil.getHour(expire); - } - Map toMap = JSONUtil.parseObj(userDto); - toMap.put("blockedStatus", blockedStatus); - toMap.put("blockedTime", blockedTime); - list.add(toMap); - } - map.put("content", list); - } - - return map; - } - - @Override - public List queryAll(UserQueryCriteria criteria) { - List users = userRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root, criteria, criteriaBuilder)); - return userMapper.toDto(users); - } - - @Override - @Cacheable(key = "'id:' + #p0") - @Transactional(rollbackFor = Exception.class) - public UserDto findById(long id) { - User user = userRepository.findById(id).orElseGet(User::new); - ValidationUtil.isNull(user.getId(), "User", "id", id); - return userMapper.toDto(user); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void create(User resources) { - if (userRepository.findByUsername(resources.getUsername()) != null) { - throw new EntityExistException(User.class, "username", resources.getUsername()); - } - if (userRepository.findByEmail(resources.getEmail()) != null) { - throw new EntityExistException(User.class, "email", resources.getEmail()); - } - if (userRepository.findByPhone(resources.getPhone()) != null) { - throw new EntityExistException(User.class, "phone", resources.getPhone()); - } - userRepository.save(resources); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void update(User resources) throws Exception { - User user = userRepository.findById(resources.getId()).orElseGet(User::new); - ValidationUtil.isNull(user.getId(), "User", "id", resources.getId()); - User user1 = userRepository.findByUsername(resources.getUsername()); - User user2 = userRepository.findByEmail(resources.getEmail()); - User user3 = userRepository.findByPhone(resources.getPhone()); - if (user1 != null && !user.getId().equals(user1.getId())) { - throw new EntityExistException(User.class, "username", resources.getUsername()); - } - if (user2 != null && !user.getId().equals(user2.getId())) { - throw new EntityExistException(User.class, "email", resources.getEmail()); - } - if (user3 != null && !user.getId().equals(user3.getId())) { - throw new EntityExistException(User.class, "phone", resources.getPhone()); - } - // 如果用户的角色改变 - if (!resources.getRoles().equals(user.getRoles())) { - redisUtils.del(CacheKey.DATA_USER + resources.getId()); - redisUtils.del(CacheKey.MENU_USER + resources.getId()); - redisUtils.del(CacheKey.ROLE_AUTH + resources.getId()); - } - // 如果用户被禁用,则清除用户登录信息 - if(!resources.getEnabled()){ - onlineUserService.kickOutForUsername(resources.getUsername()); - } - user.setUsername(resources.getUsername()); - user.setEmail(resources.getEmail()); - user.setEnabled(resources.getEnabled()); - user.setRoles(resources.getRoles()); - user.setDept(resources.getDept()); - user.setJobs(resources.getJobs()); - user.setPhone(resources.getPhone()); - user.setNickName(resources.getNickName()); - user.setGender(resources.getGender()); - userRepository.save(user); - // 清除缓存 - delCaches(user.getId(), user.getUsername()); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void updateCenter(User resources) { - User user = userRepository.findById(resources.getId()).orElseGet(User::new); - User user1 = userRepository.findByPhone(resources.getPhone()); - if (user1 != null && !user.getId().equals(user1.getId())) { - throw new EntityExistException(User.class, "phone", resources.getPhone()); - } - user.setNickName(resources.getNickName()); - user.setPhone(resources.getPhone()); - user.setGender(resources.getGender()); - userRepository.save(user); - // 清理缓存 - delCaches(user.getId(), user.getUsername()); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void delete(Set ids) { - for (Long id : ids) { - // 清理缓存 - UserDto user = findById(id); - delCaches(user.getId(), user.getUsername()); - } - userRepository.deleteAllByIdIn(ids); - } - - @Override - public UserDto findByName(String userName) { - User user = userRepository.findByUsername(userName); - if (user == null) { - throw new EntityNotFoundException(User.class, "name", userName); - } else { - return userMapper.toDto(user); - } - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void updatePass(String username, String pass) { - userRepository.updatePass(username, pass, new Date()); - flushCache(username); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public Map updateAvatar(MultipartFile multipartFile) { - // 文件大小验证 - FileUtil.checkSize(properties.getAvatarMaxSize(), multipartFile.getSize()); - // 验证文件上传的格式 - String image = "gif jpg png jpeg"; - String fileType = FileUtil.getExtensionName(multipartFile.getOriginalFilename()); - if(fileType != null && !image.contains(fileType)){ - throw new BadRequestException("文件格式错误!, 仅支持 " + image +" 格式"); - } - User user = userRepository.findByUsername(SecurityUtils.getCurrentUsername()); - String oldPath = user.getAvatarPath(); - File file = FileUtil.upload(multipartFile, properties.getPath().getAvatar()); - user.setAvatarPath(Objects.requireNonNull(file).getPath()); - user.setAvatarName(file.getName()); - userRepository.save(user); - if (StringUtils.isNotBlank(oldPath)) { - FileUtil.del(oldPath); - } - @NotBlank String username = user.getUsername(); - flushCache(username); - return new HashMap(1) {{ - put("avatar", file.getName()); - }}; - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void updateEmail(String username, String email) { - userRepository.updateEmail(username, email); - flushCache(username); - } - - @Override - public void download(List queryAll, HttpServletResponse response) throws IOException { - List> list = new ArrayList<>(); - for (UserDto userDTO : queryAll) { - List roles = userDTO.getRoles().stream().map(RoleSmallDto::getName).collect(Collectors.toList()); - Map map = new LinkedHashMap<>(); - map.put("用户名", userDTO.getUsername()); - map.put("角色", roles); - map.put("部门", userDTO.getDept().getName()); - map.put("岗位", userDTO.getJobs().stream().map(JobSmallDto::getName).collect(Collectors.toList())); - map.put("邮箱", userDTO.getEmail()); - map.put("状态", userDTO.getEnabled() ? "启用" : "禁用"); - map.put("手机号码", userDTO.getPhone()); - map.put("修改密码的时间", userDTO.getPwdResetTime()); - map.put("创建日期", userDTO.getCreateTime()); - list.add(map); - } - FileUtil.downloadExcel(list, response); - } - - /** - * 清理缓存 - * - * @param id / - */ - public void delCaches(Long id, String username) { - redisUtils.del(CacheKey.USER_ID + id); - flushCache(username); - } - - /** - * 清理 登陆时 用户缓存信息 - * - * @param username / - */ - private void flushCache(String username) { - userCacheClean.cleanUserCache(username); - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/impl/VerifyServiceImpl.java b/wjcy-system/src/main/java/me/zhengjie/modules/system/service/impl/VerifyServiceImpl.java deleted file mode 100644 index ec3230c..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/impl/VerifyServiceImpl.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.system.service.impl; - -import cn.hutool.core.lang.Dict; -import cn.hutool.core.util.RandomUtil; -import cn.hutool.extra.template.Template; -import cn.hutool.extra.template.TemplateConfig; -import cn.hutool.extra.template.TemplateEngine; -import cn.hutool.extra.template.TemplateUtil; -import lombok.RequiredArgsConstructor; -import me.zhengjie.domain.vo.EmailVo; -import me.zhengjie.exception.BadRequestException; -import me.zhengjie.modules.system.service.VerifyService; -import me.zhengjie.utils.RedisUtils; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import java.util.Collections; - -/** - * @author Zheng Jie - * @date 2018-12-26 - */ -@Service -@RequiredArgsConstructor -public class VerifyServiceImpl implements VerifyService { - - @Value("${code.expiration}") - private Long expiration; - private final RedisUtils redisUtils; - - @Override - @Transactional(rollbackFor = Exception.class) - public EmailVo sendEmail(String email, String key) { - EmailVo emailVo; - String content; - String redisKey = key + email; - // 如果不存在有效的验证码,就创建一个新的 - TemplateEngine engine = TemplateUtil.createEngine(new TemplateConfig("template", TemplateConfig.ResourceMode.CLASSPATH)); - Template template = engine.getTemplate("email/email.ftl"); - Object oldCode = redisUtils.get(redisKey); - if(oldCode == null){ - String code = RandomUtil.randomNumbers (6); - // 存入缓存 - if(!redisUtils.set(redisKey, code, expiration)){ - throw new BadRequestException("服务异常,请联系网站负责人"); - } - content = template.render(Dict.create().set("code",code)); - emailVo = new EmailVo(Collections.singletonList(email),"EL-ADMIN后台管理系统",content); - // 存在就再次发送原来的验证码 - } else { - content = template.render(Dict.create().set("code",oldCode)); - emailVo = new EmailVo(Collections.singletonList(email),"EL-ADMIN后台管理系统",content); - } - return emailVo; - } - - @Override - public void validated(String key, String code) { - Object value = redisUtils.get(key); - if(value == null || !value.toString().equals(code)){ - throw new BadRequestException("无效验证码"); - } else { - redisUtils.del(key); - } - } -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/DeptMapper.java b/wjcy-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/DeptMapper.java deleted file mode 100644 index b0fb904..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/DeptMapper.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.system.service.mapstruct; - -import me.zhengjie.base.BaseMapper; -import me.zhengjie.modules.system.domain.Dept; -import me.zhengjie.modules.system.service.dto.DeptDto; -import org.mapstruct.Mapper; -import org.mapstruct.ReportingPolicy; - -/** -* @author Zheng Jie -* @date 2019-03-25 -*/ -@Mapper(componentModel = "spring",unmappedTargetPolicy = ReportingPolicy.IGNORE) -public interface DeptMapper extends BaseMapper { -} \ No newline at end of file diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/DeptSmallMapper.java b/wjcy-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/DeptSmallMapper.java deleted file mode 100644 index 7507600..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/DeptSmallMapper.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.system.service.mapstruct; - -import me.zhengjie.base.BaseMapper; -import me.zhengjie.modules.system.domain.Dept; -import me.zhengjie.modules.system.service.dto.DeptSmallDto; -import org.mapstruct.Mapper; -import org.mapstruct.ReportingPolicy; - -/** -* @author Zheng Jie -* @date 2019-03-25 -*/ -@Mapper(componentModel = "spring",unmappedTargetPolicy = ReportingPolicy.IGNORE) -public interface DeptSmallMapper extends BaseMapper { - -} \ No newline at end of file diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/DictDetailMapper.java b/wjcy-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/DictDetailMapper.java deleted file mode 100644 index 3f9fe84..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/DictDetailMapper.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.system.service.mapstruct; - -import me.zhengjie.base.BaseMapper; -import me.zhengjie.modules.system.domain.DictDetail; -import me.zhengjie.modules.system.service.dto.DictDetailDto; -import org.mapstruct.Mapper; -import org.mapstruct.ReportingPolicy; - -/** -* @author Zheng Jie -* @date 2019-04-10 -*/ -@Mapper(componentModel = "spring", uses = {DictSmallMapper.class}, unmappedTargetPolicy = ReportingPolicy.IGNORE) -public interface DictDetailMapper extends BaseMapper { - -} \ No newline at end of file diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/DictMapper.java b/wjcy-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/DictMapper.java deleted file mode 100644 index 1047b3b..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/DictMapper.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.system.service.mapstruct; - -import me.zhengjie.base.BaseMapper; -import me.zhengjie.modules.system.domain.Dict; -import me.zhengjie.modules.system.service.dto.DictDto; -import org.mapstruct.Mapper; -import org.mapstruct.ReportingPolicy; - -/** -* @author Zheng Jie -* @date 2019-04-10 -*/ -@Mapper(componentModel = "spring",unmappedTargetPolicy = ReportingPolicy.IGNORE) -public interface DictMapper extends BaseMapper { - -} \ No newline at end of file diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/DictSmallMapper.java b/wjcy-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/DictSmallMapper.java deleted file mode 100644 index 80ccc4e..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/DictSmallMapper.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.system.service.mapstruct; - -import me.zhengjie.base.BaseMapper; -import me.zhengjie.modules.system.domain.Dict; -import me.zhengjie.modules.system.service.dto.DictSmallDto; -import org.mapstruct.Mapper; -import org.mapstruct.ReportingPolicy; - -/** -* @author Zheng Jie -* @date 2019-04-10 -*/ -@Mapper(componentModel = "spring",unmappedTargetPolicy = ReportingPolicy.IGNORE) -public interface DictSmallMapper extends BaseMapper { - -} \ No newline at end of file diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/JobMapper.java b/wjcy-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/JobMapper.java deleted file mode 100644 index 3771930..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/JobMapper.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.system.service.mapstruct; - -import me.zhengjie.base.BaseMapper; -import me.zhengjie.modules.system.domain.Job; -import me.zhengjie.modules.system.service.dto.JobDto; -import org.mapstruct.Mapper; -import org.mapstruct.ReportingPolicy; - -/** -* @author Zheng Jie -* @date 2019-03-29 -*/ -@Mapper(componentModel = "spring",uses = {DeptMapper.class},unmappedTargetPolicy = ReportingPolicy.IGNORE) -public interface JobMapper extends BaseMapper { -} \ No newline at end of file diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/JobSmallMapper.java b/wjcy-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/JobSmallMapper.java deleted file mode 100644 index 36a59cf..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/JobSmallMapper.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.system.service.mapstruct; - -import me.zhengjie.base.BaseMapper; -import me.zhengjie.modules.system.domain.Job; -import me.zhengjie.modules.system.service.dto.JobSmallDto; -import org.mapstruct.Mapper; -import org.mapstruct.ReportingPolicy; - -/** -* @author Zheng Jie -* @date 2019-03-29 -*/ -@Mapper(componentModel = "spring",unmappedTargetPolicy = ReportingPolicy.IGNORE) -public interface JobSmallMapper extends BaseMapper { - -} \ No newline at end of file diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/MenuMapper.java b/wjcy-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/MenuMapper.java deleted file mode 100644 index 6d8bffa..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/MenuMapper.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.system.service.mapstruct; - -import me.zhengjie.base.BaseMapper; -import me.zhengjie.modules.system.domain.Menu; -import me.zhengjie.modules.system.service.dto.MenuDto; -import org.mapstruct.Mapper; -import org.mapstruct.ReportingPolicy; - -/** - * @author Zheng Jie - * @date 2018-12-17 - */ -@Mapper(componentModel = "spring",unmappedTargetPolicy = ReportingPolicy.IGNORE) -public interface MenuMapper extends BaseMapper { -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/RoleMapper.java b/wjcy-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/RoleMapper.java deleted file mode 100644 index 5dc551d..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/RoleMapper.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.system.service.mapstruct; - -import me.zhengjie.base.BaseMapper; -import me.zhengjie.modules.system.domain.Role; -import me.zhengjie.modules.system.service.dto.RoleDto; -import org.mapstruct.Mapper; -import org.mapstruct.ReportingPolicy; - -/** - * @author Zheng Jie - * @date 2018-11-23 - */ -@Mapper(componentModel = "spring", uses = {MenuMapper.class, DeptMapper.class}, unmappedTargetPolicy = ReportingPolicy.IGNORE) -public interface RoleMapper extends BaseMapper { - -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/RoleSmallMapper.java b/wjcy-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/RoleSmallMapper.java deleted file mode 100644 index db034b5..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/RoleSmallMapper.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.system.service.mapstruct; - -import me.zhengjie.base.BaseMapper; -import me.zhengjie.modules.system.domain.Role; -import me.zhengjie.modules.system.service.dto.RoleSmallDto; -import org.mapstruct.Mapper; -import org.mapstruct.ReportingPolicy; - -/** - * @author Zheng Jie - * @date 2019-5-23 - */ -@Mapper(componentModel = "spring",unmappedTargetPolicy = ReportingPolicy.IGNORE) -public interface RoleSmallMapper extends BaseMapper { - -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/UserMapper.java b/wjcy-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/UserMapper.java deleted file mode 100644 index 510c21b..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/UserMapper.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.modules.system.service.mapstruct; - -import me.zhengjie.base.BaseMapper; -import me.zhengjie.modules.system.domain.User; -import me.zhengjie.modules.system.service.dto.UserDto; -import org.mapstruct.Mapper; -import org.mapstruct.ReportingPolicy; - -/** - * @author Zheng Jie - * @date 2018-11-23 - */ -@Mapper(componentModel = "spring",uses = {RoleMapper.class, DeptMapper.class, JobMapper.class},unmappedTargetPolicy = ReportingPolicy.IGNORE) -public interface UserMapper extends BaseMapper { -} diff --git a/wjcy-system/src/main/java/me/zhengjie/modules/utils/GoogleAuthenticatorUtil.java b/wjcy-system/src/main/java/me/zhengjie/modules/utils/GoogleAuthenticatorUtil.java deleted file mode 100644 index 0861ddf..0000000 --- a/wjcy-system/src/main/java/me/zhengjie/modules/utils/GoogleAuthenticatorUtil.java +++ /dev/null @@ -1,179 +0,0 @@ -package me.zhengjie.modules.utils; - -import cn.hutool.core.util.ObjectUtil; -import me.zhengjie.config.GoogleAuthProperties; -import me.zhengjie.utils.RedisUtils; -import org.apache.commons.codec.binary.Base32; -import org.apache.commons.codec.binary.Base64; -import org.springframework.stereotype.Component; - -import javax.annotation.Resource; -import javax.crypto.Mac; -import javax.crypto.spec.SecretKeySpec; -import java.security.InvalidKeyException; -import java.security.NoSuchAlgorithmException; -import java.security.SecureRandom; - -/** - *

- * Google Authenticator 工具类 - *

- * - * @author: rch - * @since: 2020-08-25 - */ -@Component -public class GoogleAuthenticatorUtil { - - private static RedisUtils redisUtils; - @Resource(name = "redisUtils") - public void setRedisUtils(RedisUtils redisUtils) { - GoogleAuthenticatorUtil.redisUtils = redisUtils; - } - - /** default 3 - max 17 (from google docs)最多可偏移的时间 */ - int window_size = 0; - - public void setWindowSize(int s) { - if (s >= 1 && s <= 17) { - window_size = s; - } - } - - /** - * 验证身份验证码是否正确 - * - * @param codes - * 输入的身份验证码 - * @param savedSecret - * 密钥 - * @return - */ - public static Boolean authcode(String codes, String savedSecret) { - long code = 0; - try { - code = Long.parseLong(codes); - } catch (Exception e) { - e.printStackTrace(); - } - long t = System.currentTimeMillis(); - GoogleAuthenticatorUtil ga = new GoogleAuthenticatorUtil(); - // should give 5 * 30 seconds of grace... - ga.setWindowSize(GoogleAuthProperties.WINDOW_SIZE); - boolean r = ga.check_code(savedSecret, code, t); - return r; - } - - /** - * 获取密钥 - * - * @param user - * 用户 - * @param host - * 域 - * @return 密钥 - */ - public static String genSecret(String user, String host) { - - String secretKey = GoogleAuthProperties.REDIS_GOOGLE_AUTH_KEY + "_" + GoogleAuthProperties.SEED + "_" + user; - Object secretValue = redisUtils.get(secretKey); - if (ObjectUtil.isEmpty(secretValue)) { - String secret = generateSecretKey(); - getQRBarcodeURL(user, host, secret); - secretValue = secret; - redisUtils.set(secretKey, secret); - } - - return secretValue.toString(); - } - - private static String generateSecretKey() { - SecureRandom sr = null; - try { - sr = SecureRandom.getInstance(GoogleAuthProperties.RANDOM_NUMBER_ALGORITHM); - sr.setSeed(Base64.decodeBase64(GoogleAuthProperties.SEED)); - byte[] buffer = sr.generateSeed(GoogleAuthProperties.SECRET_SIZE); - Base32 codec = new Base32(); - byte[] bEncodedKey = codec.encode(buffer); - String encodedKey = new String(bEncodedKey); - return encodedKey; - } catch (NoSuchAlgorithmException e) { - // should never occur... configuration error - } - return null; - } - - /** - * 获取二维码图片URL - * - * @param user - * 用户 - * @param host - * 域 - * @param secret - * 密钥 - * @return 二维码URL - */ - public static String getQRBarcodeURL(String user, String host, String secret) { - return String.format(GoogleAuthProperties.QR_CREATE_PREFIX_URL, user, host, secret); - } - - private boolean check_code(String secret, long code, long timeMsec) { - Base32 codec = new Base32(); - byte[] decodedKey = codec.decode(secret); - long t = (timeMsec / 1000L) / 30L; - for (int i = -window_size; i <= window_size; ++i) { - long hash; - try { - hash = verify_code(decodedKey, t + i); - } catch (Exception e) { - e.printStackTrace(); - throw new RuntimeException(e.getMessage()); - } - if (hash == code) { - return true; - } - } - return false; - } - - private static int verify_code(byte[] key, long t) - throws NoSuchAlgorithmException, InvalidKeyException { - byte[] data = new byte[8]; - long value = t; - for (int i = 8; i-- > 0; value >>>= 8) { - data[i] = (byte) value; - } - SecretKeySpec signKey = new SecretKeySpec(key, "HmacSHA1"); - Mac mac = Mac.getInstance("HmacSHA1"); - mac.init(signKey); - byte[] hash = mac.doFinal(data); - int offset = hash[20 - 1] & 0xF; - long truncatedHash = 0; - for (int i = 0; i < 4; ++i) { - truncatedHash <<= 8; - truncatedHash |= (hash[offset + i] & 0xFF); - } - truncatedHash &= 0x7FFFFFFF; - truncatedHash %= 1000000; - return (int) truncatedHash; - } - - public static void main(String[] args) { - /* - * 注意:先运行前两步,获取密钥和二维码url。 然后只运行第三步,填写需要验证的验证码,和第一步生成的密钥 - */ - String user = "testUser"; - String host = "testHost"; - // 第一步:获取密钥 - String secret = genSecret(user, host); - System.out.println("secret:" + secret); - // 第二步:根据密钥获取二维码图片url(可忽略) - String url = getQRBarcodeURL(user, host, secret); - System.out.println("url:" + url); - // 第三步:验证(第一个参数是需要验证的验证码,第二个参数是第一步生成的secret运行) - boolean result = authcode("271239", "OHXU6PLMZMDJIDY6"); - System.out.println("result:" + result); - } -} - diff --git a/wjcy-system/src/main/resources/banner.txt b/wjcy-system/src/main/resources/banner.txt deleted file mode 100644 index d0f401a..0000000 --- a/wjcy-system/src/main/resources/banner.txt +++ /dev/null @@ -1,8 +0,0 @@ - _ _ _ - | | | | (_) - ___| |______ __ _ __| |_ __ ___ _ _ __ - / _ | |______/ _` |/ _` | '_ ` _ \| | '_ \ - | __| | | (_| | (_| | | | | | | | | | | - \___|_| \__,_|\__,_|_| |_| |_|_|_| |_| - - :: Spring Boot :: (v2.1.0.RELEASE) \ No newline at end of file diff --git a/wjcy-system/src/main/resources/config/application-dev.yml b/wjcy-system/src/main/resources/config/application-dev.yml deleted file mode 100644 index 81d0a99..0000000 --- a/wjcy-system/src/main/resources/config/application-dev.yml +++ /dev/null @@ -1,285 +0,0 @@ -#配置数据源 -spring: - datasource: - druid: - db-type: com.alibaba.druid.pool.DruidDataSource - driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy - url: jdbc:log4jdbc:mysql://192.168.10.136:3306/wjcy?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false -# url: jdbc:log4jdbc:mysql://192.168.10.85:3306/wjcy?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false - username: root - password: wjcy@123456 -# url: jdbc:log4jdbc:mysql://120.77.145.59:3306/wjcy_2?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false -# username: root -# password: 416909 - # 初始连接数 - initial-size: 5 - # 最小连接数 - min-idle: 15 - # 最大连接数 - max-active: 30 - # 超时时间(以秒数为单位) - remove-abandoned-timeout: 180 - # 获取连接超时时间 - max-wait: 3000 - # 连接有效性检测时间 - time-between-eviction-runs-millis: 60000 - # 连接在池中最小生存的时间 - min-evictable-idle-time-millis: 300000 - # 连接在池中最大生存的时间 - max-evictable-idle-time-millis: 900000 - # 指明连接是否被空闲连接回收器(如果有)进行检验.如果检测失败,则连接将被从池中去除 - test-while-idle: true - # 指明是否在从池中取出连接前进行检验,如果检验失败, 则从池中去除连接并尝试取出另一个 - test-on-borrow: true - # 是否在归还到池中前进行检验 - test-on-return: false - # 检测连接是否有效 - validation-query: select 1 - # 配置监控统计 - webStatFilter: - enabled: true - stat-view-servlet: - enabled: true - url-pattern: /druid/* - reset-enable: false - filter: - stat: - enabled: true - # 记录慢SQL - log-slow-sql: true - slow-sql-millis: 1000 - merge-sql: true - wall: - config: - multi-statement-allow: true - slf4j: - enabled: true - statement-create-after-log-enabled: false - statement-close-after-log-enabled: false - result-set-open-after-log-enabled: false - result-set-close-after-log-enabled: false - result-set-next-after-log-enabled: false - - redis: - #数据库索引 - database: 13 - host: 192.168.10.136 - port: 6379 - password: wjcy@123456 -# host: 120.77.145.59 -# port: 6379 -# password: 416909 - #连接超时时间 - timeout: 5000 - #过期时间 1个月(60*60*24*30) - expired: 2592000 - - mvc: - view: - prefix: classpath:/templates/ - suffix: .html - thymeleaf: - cache: false - -knife4j: - enable: true - basic: - enable: true - username: wjcy - password: 123456 - - -logging: - config: classpath:log4j2.xml - level: - me.zhengjie: debug - -#Mybatis plus 配置 -mybatis-plus: - # 映射文件所在路径 - mapper-locations: classpath*:me/zhengjie/dao/mapper/*.xml - # pojo类所在包路径 - #typeAliasesPackage: - # 开启驼峰命名规则自动转换 - configuration: - map-underscore-to-camel-case: true - log-impl: org.apache.ibatis.logging.log4j2.Log4j2Impl - global-config: - db-config: - # 配置表明前缀,例如表设计时表名为tb_manager,对应entity为Manager - #table-prefix: tb_ - #逻辑已删除值 - logic-delete-value: 1 - #逻辑未删除值 - logic-not-delete-value: 0 - # 是否开启like查询,即对 stirng 字段是否使用 like,默认不开启 - column-like: true - -# 登录相关配置 -login: - # 登录缓存 - cache-enable: true - # 是否限制单用户登录 - single-login: false - # 验证码 - login-code: - # 验证码类型配置 查看 LoginProperties 类 - code-type: arithmetic - # 登录图形验证码有效时间/分钟 - expiration: 2 - # 验证码高度 - width: 111 - # 验证码宽度 - height: 36 - # 内容长度 - length: 2 - # 字体名称,为空则使用默认字体 - font-name: - # 字体大小 - font-size: 25 - -#jwt -jwt: - header: Authorization - # 令牌前缀 - token-start-with: Bearer - # 必须使用最少88位的Base64对该令牌进行编码 - base64-secret: ZmQ0ZGI5NjQ0MDQwY2I4MjMxY2Y3ZmI3MjdhN2ZmMjNhODViOTg1ZGE0NTBjMGM4NDA5NzYxMjdjOWMwYWRmZTBlZjlhNGY3ZTg4Y2U3YTE1ODVkZDU5Y2Y3OGYwZWE1NzUzNWQ2YjFjZDc0NGMxZWU2MmQ3MjY1NzJmNTE0MzI= - # 令牌过期时间 此处单位/毫秒 ,默认4小时,可在此网站生成 https://www.convertworld.com/zh-hans/time/milliseconds.html - token-validity-in-seconds: 14400000 - # 在线用户key - online-key: online-token- - # 验证码 - code-key: code-key- - # token 续期检查时间范围(默认30分钟,单位毫秒),在token即将过期的一段时间内用户操作了,则给用户的token续期 - detect: 1800000 - # 续期时间范围,默认1小时,单位毫秒 - renew: 3600000 - -#是否允许生成代码,生产环境设置为false -generator: - enabled: true - -#是否开启 swagger-ui -swagger: - enabled: true - -# IP 本地解析 -ip: - local-parsing: true - -# 文件存储路径 -file: - mac: - path: ~/file/ - avatar: ~/avatar/ - linux: - path: /home/luckyDraw/file/ - avatar: /home/luckyDraw/avatar/ - windows: - path: E:\wjcyFileSpace\file\ - avatar: E:\wjcyFileSpace\avatar\ - # 文件大小 /M - maxSize: 100 - avatarMaxSize: 5 - - -system: - imgPath: E:\wjcyFileSpace\file - # 静态资源访问路径(返回前端时添加) -# fileVisitAddr: http://www.images.com - fileVisitAddr: http://localhost:8008/file - #文件上传接口后缀,用来放行xss过滤 - uploadSuffix: file/uploadFile - # 单文件上传大小限制,单位 :MB - maxFileSize: 10 - # 视频单文件上传限制,单位 :MB - maxVideoFileSize: 25 - # ip库文件的绝对路径 window 就是指到resource下的ip2region下 - ip2regionDbPath: E:\CodeWorkSpace\wjcy\wjcy-system\src\main\resources\ip2region\ip2region.db - # 多语言文件路径 - languagePath: /home/waguda/wjcy/language - -config: - # 放掉的api 校验token huijia@biying123 - https://md5jiami.51240.com/ - apiToken: "e6f5e41ca6b103070ff89c812a36eaec" - #文件上传前缀(首位+'/' 末尾不加'/'),用来放行静态资源访问权限(图片,音频等) - uploadPrefix: /capital - # 图片上传保存路径(注意格式,首尾带‘/’) key:图片上传类型 value: - uploadImgPath: - # 用户头像修改 - 1: /wjcy/img/ - 2: /wjcy/rotation/ - 3: /wjcy/article/ - 4: /wjcy/currency/ - # 提现审核提示音 - 5: /wjcy/tones/ - # 聊天室默认头像 - 6: /wjcy/chat/head/ - # 聊天室会员上传的图片 - 7: /wjcy/chat/img/ - # 聊天室会员上传视频 - 8: /wjcy/chat/video/ - 9: /wjcy/promotion/ - # excel - 10: /wjcy/excel/ - 11: /wjcy/export/ - 12: /wjcy/wellReceived/ - 13: /wjcy/dhWellReceived/ - # 支持文件上传的文件格式 - sustainImgFormat: - - img - - jpg - - png - - mp3 - - pem - - jpeg - - gif - - JPG - - JPEG - - PNG - - AVI - - mov - - rmvb - - rm - - FLV - - mp4 - - 3GP - - zip - - xlsx - -# Goole Auth -auth: - secret_size: 10 - seed: g8GjEvTbW5oVSV7avLBdwIHqGlUYNzKFI7izOF8GwLDVKs2m0QN7vxRs2im5MDaNCWGmcD2rvcZx - random_number_algorithm: SHA1PRNG - window_size: 0 - redis_google_auth_key: googelAuthKey - qr_create_prefix_url: https://api.qrserver.com/v1/create-qr-code/?size=150x150&data=otpauth://totp/%s@%s?secret=%s - - -#敦煌api 请求参数 -dh: - access_token: 0QkUo9opYCcmB0UMzqK2XKFFNDDvlpmpRYyDkcVJ - buy_order_url: http://api.dhgate.com/dop/router - buy_order_method: dh.buyer.order.place - buy_order_v: 2.0 - pay_order_url: http://api.dhgate.com/dop/router - pay_order_method: dh.buyer.order.pay - pay_order_v: 1.0 - -# 平台配置 -plats: - dh: - buyOrderUrl: http://api.dhgate.com/dop/router - buyOrderMethod: dh.buyer.order.place - buyOrderv: 2.0 - payOrder_url: http://api.dhgate.com/dop/router - payOrderMethod: dh.buyer.order.pay - payOrderv: 1.0 - -# 影刀 -yd: - accessKeyId: navkbKspVWfjPgm6@platform - accessKeySecret: SuUc0zMfhrQX594eJnwFPm1sqk8CYtNv - callback: http://test.vogocm.com:8008/api/yd/callback diff --git a/wjcy-system/src/main/resources/config/application-local.yml b/wjcy-system/src/main/resources/config/application-local.yml deleted file mode 100644 index 262baba..0000000 --- a/wjcy-system/src/main/resources/config/application-local.yml +++ /dev/null @@ -1,411 +0,0 @@ -#配置数据源 -spring: - datasource: - druid: - db-type: com.alibaba.druid.pool.DruidDataSource - driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy - url: jdbc:log4jdbc:mysql://192.168.110.108:3306/jlt_capiltal_xxs5?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false - username: root - password: root - # 初始连接数 - initial-size: 5 - # 最小连接数 - min-idle: 15 - # 最大连接数 - max-active: 30 - # 超时时间(以秒数为单位) - remove-abandoned-timeout: 180 - # 获取连接超时时间 - max-wait: 3000 - # 连接有效性检测时间 - time-between-eviction-runs-millis: 60000 - # 连接在池中最小生存的时间 - min-evictable-idle-time-millis: 300000 - # 连接在池中最大生存的时间 - max-evictable-idle-time-millis: 900000 - # 指明连接是否被空闲连接回收器(如果有)进行检验.如果检测失败,则连接将被从池中去除 - test-while-idle: true - # 指明是否在从池中取出连接前进行检验,如果检验失败, 则从池中去除连接并尝试取出另一个 - test-on-borrow: true - # 是否在归还到池中前进行检验 - test-on-return: false - # 检测连接是否有效 - validation-query: select 1 - # 配置监控统计 - webStatFilter: - enabled: true - stat-view-servlet: - enabled: true - url-pattern: /druid/* - reset-enable: false - filter: - stat: - enabled: true - # 记录慢SQL - log-slow-sql: true - slow-sql-millis: 1000 - merge-sql: true - wall: - config: - multi-statement-allow: true - slf4j: - enabled: true - statement-create-after-log-enabled: false - statement-close-after-log-enabled: false - result-set-open-after-log-enabled: false - result-set-close-after-log-enabled: false - result-set-next-after-log-enabled: false - - redis: - #数据库索引 - database: 12 - host: 192.168.110.108 - port: 6379 - password: tiyu!tiyu! - #连接超时时间 - timeout: 5000 - #过期时间 1个月(60*60*24*30) - expired: 2592000 - - mvc: - view: - prefix: classpath:/templates/ - suffix: .html - thymeleaf: - cache: false - - -logging: - config: classpath:log4j2.xml - level: - me.zhengjie: debug - -#Mybatis plus 配置 -mybatis-plus: - # 映射文件所在路径 - mapper-locations: classpath*:me/zhengjie/dao/mapper/*.xml - # pojo类所在包路径 - #typeAliasesPackage: - # 开启驼峰命名规则自动转换 - configuration: - map-underscore-to-camel-case: true - log-impl: org.apache.ibatis.logging.log4j2.Log4j2Impl - global-config: - db-config: - # 配置表明前缀,例如表设计时表名为tb_manager,对应entity为Manager - #table-prefix: tb_ - #逻辑已删除值 - logic-delete-value: 1 - #逻辑未删除值 - logic-not-delete-value: 0 - # 是否开启like查询,即对 stirng 字段是否使用 like,默认不开启 - column-like: true - -# 登录相关配置 -login: - # 登录缓存 - cache-enable: true - # 是否限制单用户登录 - single-login: false - # 验证码 - login-code: - # 验证码类型配置 查看 LoginProperties 类 - code-type: arithmetic - # 登录图形验证码有效时间/分钟 - expiration: 2 - # 验证码高度 - width: 111 - # 验证码宽度 - height: 36 - # 内容长度 - length: 2 - # 字体名称,为空则使用默认字体 - font-name: - # 字体大小 - font-size: 25 - -#jwt -jwt: - header: Authorization - # 令牌前缀 - token-start-with: Bearer - # 必须使用最少88位的Base64对该令牌进行编码 - base64-secret: ZmQ0ZGI5NjQ0MDQwY2I4MjMxY2Y3ZmI3MjdhN2ZmMjNhODViOTg1ZGE0NTBjMGM4NDA5NzYxMjdjOWMwYWRmZTBlZjlhNGY3ZTg4Y2U3YTE1ODVkZDU5Y2Y3OGYwZWE1NzUzNWQ2YjFjZDc0NGMxZWU2MmQ3MjY1NzJmNTE0MzI= - # 令牌过期时间 此处单位/毫秒 ,默认4小时,可在此网站生成 https://www.convertworld.com/zh-hans/time/milliseconds.html - token-validity-in-seconds: 14400000 - # 在线用户key - online-key: online-token- - # 验证码 - code-key: code-key- - # token 续期检查时间范围(默认30分钟,单位毫秒),在token即将过期的一段时间内用户操作了,则给用户的token续期 - detect: 1800000 - # 续期时间范围,默认1小时,单位毫秒 - renew: 3600000 - -#是否允许生成代码,生产环境设置为false -generator: - enabled: true - -#是否开启 swagger-ui -swagger: - enabled: true - -# IP 本地解析 -ip: - local-parsing: true - -# 文件存储路径 -file: - mac: - path: ~/file/ - avatar: ~/avatar/ - linux: - path: /home/luckyDraw/file/ - avatar: /home/luckyDraw/avatar/ - windows: - path: C:\luckyDraw\file\ - avatar: C:\luckyDraw\avatar\ - # 文件大小 /M - maxSize: 100 - avatarMaxSize: 5 - - -system: - imgPath: /home/waguda/capiltal/file/ - # 静态资源访问路径(返回前端时添加) - fileVisitAddr: http://img.com - #文件上传接口后缀,用来放行xss过滤 - uploadSuffix: file/uploadFile - # 单文件上传大小限制,单位 :MB - maxFileSize: 10 - # 视频单文件上传限制,单位 :MB - maxVideoFileSize: 25 - # ip库文件的绝对路径 window 就是指到resource下的ip2region下 - ip2regionDbPath: /home/work/services/capiltal/capiltal-system/ip2region/ip2region.db - # 多语言文件路径 - languagePath: /home/waguda/capiltal/language - wsUrl: ws://192.168.110.99:8110 - # 百度翻译 APPID - baiduAppId: 20211116001000718 - # 百度翻译privateKey - baiduPrivateKey: jSDxw0_QkRnbRdRT0rKY - -config: - # 放掉的api 校验token huijia@biying123 - https://md5jiami.51240.com/ - apiToken: "e6f5e41ca6b103070ff89c812a36eaec" - #文件上传前缀(首位+'/' 末尾不加'/'),用来放行静态资源访问权限(图片,音频等) - uploadPrefix: /capital - # 图片上传保存路径(注意格式,首尾带‘/’) key:图片上传类型 value: - uploadImgPath: - # 用户头像修改 - 1: /capital/img/ - 2: /capital/rotation/ - 3: /capital/article/ - 4: /capital/currency/ - - # 支持文件上传的文件格式 - sustainImgFormat: - - img - - jpg - - png - - mp3 - - pem - - jpeg - - gif - - JPG - - JPEG - - PNG - - AVI - - mov - - rmvb - - rm - - FLV - - mp4 - - 3GP - - zip - -web3j: - # web3j 区块链信息 - linkAddress: - #火币 - - name: HECO - # 服务实现类全限定类名 - serverName: "me.zhengjie.web3j.service.impl.ETHBlockchainServiceImpl" - # rpc 连接地址 - url: https://http-testnet.hecochain.com - # 官网域名+查询交易明细 - domain: https://testnet.hecoinfo.com/tx - # 链路Id,必须以 0x开头 - chainId: "0x100" - #合约币种 - contracts: - USDT: - address: "0x425a2d7c3df8a7872f05405dc6e34b6d9cd714be" - accuracy: 18 - MDX: - address: "0x30e552B5Ce0495A55b9138343dD88d6457a6C66b" - accuracy: 18 - DMT: - address: "0x4da2F416aa79fB0BeCA3D6cf6EB6Fe86b4a747CF" - accuracy: 18 - - # ok链 - - name: OKEX - # 服务实现类全限定类名 - serverName: "me.zhengjie.web3j.service.impl.ETHBlockchainServiceImpl" - # rpc 连接地址 - url: https://exchaintestrpc.okex.org - # 官网域名+查询交易明细 - domain: https://www.oklink.com/zh-cn/oec-test/tx - # 链路Id,必须以 0x开头 - chainId: "0x41" - #合约币种 - contracts: - USDT: - address: "0x1328bB18fe06647878d04fcB94BA5474c85C7616" - accuracy: 18 - MDX: - address: "" - accuracy: 0 - DMT: - address: "" - accuracy: 0 - - # 币安链 - - name: BNB - # 服务实现类全限定类名 - serverName: "me.zhengjie.web3j.service.impl.ETHBlockchainServiceImpl" - # rpc 连接地址 https://data-seed-prebsc-1-s1.binance.org:8545/ https://data-seed-prebsc-2-s3.binance.org:8545 - url: https://data-seed-prebsc-1-s1.binance.org:8545/ - # 官网域名+查询交易明细 - domain: https://testnet.bscscan.com/tx - # 链路Id,必须以 0x开头 - chainId: "0x61" - #合约币种 - contracts: - USDT: - # address: "0x3D39e763d2942816c96E783bb53C7c5DB44AFFF3" - address: "0xA12327AaE5C6CCcf816bAC49136f050FeFe89CB6" - accuracy: 18 - MDX: - address: "0x79CA70F863c4273Bb276F37381e1aD2096b77CeE" - accuracy: 18 - ETH: - address: "0x19E6689Bb9CF7Ef04AFf57B77562E4C943c415cD" - accuracy: 18 - CAKE: - address: "0xeBb3CD5EF4a5875AEfcf02CeAaa77Ac8A164523f" - accuracy: 18 - - # 波场 - - name: TRON - # 服务实现类全限定类名 - serverName: "me.zhengjie.web3j.service.impl.TronBlockchainServiceImpl" - # rpc 连接地址, 可选: mainnet、shasta、nile,或其他节点(例:47.252.19.181) - network: shasta - # http接口请求的URL - url: https://api.shasta.trongrid.io - # 官网域名+查询交易明细 - domain: https://shasta.tronscan.org//#/transaction - # 私钥,波场调用API时,不管什么接口都必须要设置私钥 - hexPrivateKey: "780e0d9997862dfac8e0698c8dd457531c9c13ecf6cec377315e95c30b43c8c4" - # 说明:https://cn.developers.tron.network/reference/%E4%BB%80%E4%B9%88%E6%98%AFapi-key e3506c97-a4b6-4bf7-829a-6a5d48b112f7 - apiKey: "" - #合约币种 - contracts: - USDT: - # TNuoKL1ni8aoshfFL1ASca1Gou9RXwAzfn USDT:TXYZopYRdj2D9XRtbG411XZZ3kM5VkAeBf - address: "TNpzntv25qsy1HVWQW2jCrhWj5wad3tVcj" - accuracy: 10 - MDX: - address: "" - accuracy: 0 - DMT: - address: "" - accuracy: 0 - - blockchain: - 1: - - currencyType: 1 - name: USDT - - currencyType: 2 - name: MDX - - currencyType: 3 - name: DMT - 2: - - currencyType: 1 - name: USDT - 4: - - currencyType: 1 - name: USDT - - currencyType: 2 - name: MDX - - currencyType: 5 - name: ETH - - currencyType: 4 - name: CAKE - 5: - - currencyType: 1 - name: USDT - -# 采集开奖结果配置 -draw: - config: - configs: - - passType: 1 #链路 火币链 - currency: BTC #采集币种 BTC - url: https://api.huobi.pro/market/history/kline #采集地址 - period: 1min #采集周期 1min, 5min, 15min, 30min, ---- 60min, 4hour, 1day, 1mon, 1week, 1year - symbol: btcusdt #交易对 btcusdt, ethbtc - size: 10 #返回数据条数 1 - 2000 - - passType: 4 #链路 币安链 - currency: BTC #采集币种 BTC - url: https://api.binance.com/api/v3/klines #采集地址 - period: 1m #采集周期 #采集周期 1m, 3m, 5m, 15m, 30m, ---- 1h, 2h, 4h, 6h, 8h, 12h, 1d, 3d, 1w, 1M - symbol: BTCUSDT #交易对 - size: 10 #返回数据条数 1 - 1000 - - - - -#该应用是否启用生产者 -rocketmq: - producer: - isOnOff: on - #发送同一类消息的设置为同一个group,保证唯一,默认不需要设置,rocketmq会使用ip@pid(pid代表jvm名字)作为唯一标示 - groupName: springboot-rocketmq-producer-capiltal - #mq的nameserver地址 43.240.95.168 - namesrvAddr: 192.168.110.108:9876 - #消息最大长度 默认1024*4(4M) - maxMessageSize: 4096 - #发送消息超时时间,默认3000 - sendMsgTimeout: 3000 - #发送消息失败重试次数,默认2 - retryTimesWhenSendFailed: 2 - consumer: - isOnOff: on - groupName: springboot-rocketmq-consumer-capiltal - #mq的nameserver地址 43.240.95.168 - namesrvAddr: 192.168.110.108:9876 - #该消费者订阅的主题和tags("*"号表示订阅该主题下所有的tags),格式:topic~tag1||tag2||tag3;topic2~*; - topics: capiltal-settlement-top~*;capiltal-statistics-member-top~* - consumeThreadMin: 20 - consumeThreadMax: 64 - #设置一次消费消息的条数,默认为1条 - consumeMessageBatchMaxSize: 1 - - -#Goole Auth -auth: - secret_size: 10 - seed: g8GjEvTbW5oVSV7avLBdwIHqGlUYNzKFI7izOF8GwLDVKs2m0QN7vxRs2im5MDaNCWGmcD2rvcZx - random_number_algorithm: SHA1PRNG - window_size: 0 - redis_google_auth_key: googelAuthKey - qr_create_prefix_url: https://api.qrserver.com/v1/create-qr-code/?size=150x150&data=otpauth://totp/%s@%s?secret=%s - -telegram: - bot: - username: capiltal_uat_bot - token: 5008414161:AAHflrbo2v0DN8hpLhZAg5gC787yxFloWlk - chatId: -665412272 \ No newline at end of file diff --git a/wjcy-system/src/main/resources/config/application-prod.yml b/wjcy-system/src/main/resources/config/application-prod.yml deleted file mode 100644 index 08396dc..0000000 --- a/wjcy-system/src/main/resources/config/application-prod.yml +++ /dev/null @@ -1,250 +0,0 @@ -#配置数据源 -spring: - datasource: - druid: - db-type: com.alibaba.druid.pool.DruidDataSource - driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy - url: jdbc:log4jdbc:mysql://mysql:3306/wjcy?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false - username: root - password: wjcy@123456 - # 初始连接数 - initial-size: 5 - # 最小连接数 - min-idle: 15 - # 最大连接数 - max-active: 30 - # 超时时间(以秒数为单位) - remove-abandoned-timeout: 180 - # 获取连接超时时间 - max-wait: 3000 - # 连接有效性检测时间 - time-between-eviction-runs-millis: 60000 - # 连接在池中最小生存的时间 - min-evictable-idle-time-millis: 300000 - # 连接在池中最大生存的时间 - max-evictable-idle-time-millis: 900000 - # 指明连接是否被空闲连接回收器(如果有)进行检验.如果检测失败,则连接将被从池中去除 - test-while-idle: true - # 指明是否在从池中取出连接前进行检验,如果检验失败, 则从池中去除连接并尝试取出另一个 - test-on-borrow: true - # 是否在归还到池中前进行检验 - test-on-return: false - # 检测连接是否有效 - validation-query: select 1 - # 配置监控统计 - webStatFilter: - enabled: true - stat-view-servlet: - enabled: true - url-pattern: /druid/* - reset-enable: false - filter: - stat: - enabled: true - # 记录慢SQL - log-slow-sql: true - slow-sql-millis: 1000 - merge-sql: true - wall: - config: - multi-statement-allow: true - slf4j: - enabled: true - statement-create-after-log-enabled: false - statement-close-after-log-enabled: false - result-set-open-after-log-enabled: false - result-set-close-after-log-enabled: false - result-set-next-after-log-enabled: false - - redis: - #数据库索引 - database: 12 - host: redis - port: 6379 - password: wjcy@123456 - #连接超时时间 - timeout: 5000 - #过期时间 1个月(60*60*24*30) - expired: 2592000 - - mvc: - view: - prefix: classpath:/templates/ - suffix: .html - thymeleaf: - cache: false - - -logging: - config: classpath:log4j2.xml - level: - me.zhengjie: debug - -#Mybatis plus 配置 -mybatis-plus: - # 映射文件所在路径 - mapper-locations: classpath*:me/zhengjie/dao/mapper/*.xml - # pojo类所在包路径 - #typeAliasesPackage: - # 开启驼峰命名规则自动转换 - configuration: - map-underscore-to-camel-case: true - log-impl: org.apache.ibatis.logging.log4j2.Log4j2Impl - global-config: - db-config: - # 配置表明前缀,例如表设计时表名为tb_manager,对应entity为Manager - #table-prefix: tb_ - #逻辑已删除值 - logic-delete-value: 1 - #逻辑未删除值 - logic-not-delete-value: 0 - # 是否开启like查询,即对 stirng 字段是否使用 like,默认不开启 - column-like: true - -# 登录相关配置 -login: - # 登录缓存 - cache-enable: true - # 是否限制单用户登录 - single-login: false - # 验证码 - login-code: - # 验证码类型配置 查看 LoginProperties 类 - code-type: arithmetic - # 登录图形验证码有效时间/分钟 - expiration: 2 - # 验证码高度 - width: 111 - # 验证码宽度 - height: 36 - # 内容长度 - length: 2 - # 字体名称,为空则使用默认字体 - font-name: - # 字体大小 - font-size: 25 - -#jwt -jwt: - header: Authorization - # 令牌前缀 - token-start-with: Bearer - # 必须使用最少88位的Base64对该令牌进行编码 - base64-secret: ZmQ0ZGI5NjQ0MDQwY2I4MjMxY2Y3ZmI3MjdhN2ZmMjNhODViOTg1ZGE0NTBjMGM4NDA5NzYxMjdjOWMwYWRmZTBlZjlhNGY3ZTg4Y2U3YTE1ODVkZDU5Y2Y3OGYwZWE1NzUzNWQ2YjFjZDc0NGMxZWU2MmQ3MjY1NzJmNTE0MzI= - # 令牌过期时间 此处单位/毫秒 ,默认4小时,可在此网站生成 https://www.convertworld.com/zh-hans/time/milliseconds.html - token-validity-in-seconds: 14400000 - # 在线用户key - online-key: online-token- - # 验证码 - code-key: code-key- - # token 续期检查时间范围(默认30分钟,单位毫秒),在token即将过期的一段时间内用户操作了,则给用户的token续期 - detect: 1800000 - # 续期时间范围,默认1小时,单位毫秒 - renew: 3600000 - -#是否允许生成代码,生产环境设置为false -generator: - enabled: true - -#是否开启 swagger-ui -swagger: - enabled: true - -# IP 本地解析 -ip: - local-parsing: true - -# 文件存储路径 -file: - mac: - path: ~/file/ - avatar: ~/avatar/ - linux: - path: /home/luckyDraw/file/ - avatar: /home/luckyDraw/avatar/ - windows: - path: C:\luckyDraw\file\ - avatar: C:\luckyDraw\avatar\ - # 文件大小 /M - maxSize: 100 - avatarMaxSize: 5 - - -system: - imgPath: /home/work/wjcy/file - # 静态资源访问路径(返回前端时添加) - fileVisitAddr: http://img.com - #文件上传接口后缀,用来放行xss过滤 - uploadSuffix: file/uploadFile - # 单文件上传大小限制,单位 :MB - maxFileSize: 10 - # 视频单文件上传限制,单位 :MB - maxVideoFileSize: 25 - # ip库文件的绝对路径 window 就是指到resource下的ip2region下 - ip2regionDbPath: /home/work/wjcy/wjcy-system/src/main/resources/ip2region/ip2region.db - # 多语言文件路径 - languagePath: /home/work/wjcy/wjcy-system/language - -config: - # 放掉的api 校验token huijia@biying123 - https://md5jiami.51240.com/ - apiToken: "e6f5e41ca6b103070ff89c812a36eaec" - #文件上传前缀(首位+'/' 末尾不加'/'),用来放行静态资源访问权限(图片,音频等) - uploadPrefix: /capital - # 图片上传保存路径(注意格式,首尾带‘/’) key:图片上传类型 value: - uploadImgPath: - # 用户头像修改 - 1: /wjcy/img/ - 2: /wjcy/rotation/ - 3: /wjcy/article/ - 4: /wjcy/currency/ - # 提现审核提示音 - 5: /wjcy/tones/ - # 聊天室默认头像 - 6: /wjcy/chat/head/ - # 聊天室会员上传的图片 - 7: /wjcy/chat/img/ - # 聊天室会员上传视频 - 8: /wjcy/chat/video/ - 9: /wjcy/promotion/ - # excel - 10: /wjcy/excel/ - # 支持文件上传的文件格式 - sustainImgFormat: - - img - - jpg - - png - - mp3 - - pem - - jpeg - - gif - - JPG - - JPEG - - PNG - - AVI - - mov - - rmvb - - rm - - FLV - - mp4 - - 3GP - - zip - - xlsx - -# Goole Auth -auth: - secret_size: 10 - seed: g8GjEvTbW5oVSV7avLBdwIHqGlUYNzKFI7izOF8GwLDVKs2m0QN7vxRs2im5MDaNCWGmcD2rvcZx - random_number_algorithm: SHA1PRNG - window_size: 0 - redis_google_auth_key: googelAuthKey - qr_create_prefix_url: https://api.qrserver.com/v1/create-qr-code/?size=150x150&data=otpauth://totp/%s@%s?secret=%s - -#敦煌api 请求参数 -dh: - access_token: 0QkUo9opYCcmB0UMzqK2XKFFNDDvlpmpRYyDkcVJ - buy_order_url: http://api.dhgate.com/dop/router - buy_order_method: dh.buyer.order.place - buy_order_v: 2.0 - pay_order_url: http://api.dhgate.com/dop/router - pay_order_method: dh.buyer.order.pay - pay_order_v: 1.0 \ No newline at end of file diff --git a/wjcy-system/src/main/resources/config/application-xxs.yml b/wjcy-system/src/main/resources/config/application-xxs.yml deleted file mode 100644 index 7471b8b..0000000 --- a/wjcy-system/src/main/resources/config/application-xxs.yml +++ /dev/null @@ -1,417 +0,0 @@ -#配置数据源 -spring: - datasource: - druid: - db-type: com.alibaba.druid.pool.DruidDataSource - driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy - url: jdbc:log4jdbc:mysql://120.77.145.59:3306/jlt_capiltal?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false - username: root - password: 416909 - # 初始连接数 - initial-size: 5 - # 最小连接数 - min-idle: 15 - # 最大连接数 - max-active: 30 - # 超时时间(以秒数为单位) - remove-abandoned-timeout: 180 - # 获取连接超时时间 - max-wait: 3000 - # 连接有效性检测时间 - time-between-eviction-runs-millis: 60000 - # 连接在池中最小生存的时间 - min-evictable-idle-time-millis: 300000 - # 连接在池中最大生存的时间 - max-evictable-idle-time-millis: 900000 - # 指明连接是否被空闲连接回收器(如果有)进行检验.如果检测失败,则连接将被从池中去除 - test-while-idle: true - # 指明是否在从池中取出连接前进行检验,如果检验失败, 则从池中去除连接并尝试取出另一个 - test-on-borrow: true - # 是否在归还到池中前进行检验 - test-on-return: false - # 检测连接是否有效 - validation-query: select 1 - # 配置监控统计 - webStatFilter: - enabled: true - stat-view-servlet: - enabled: true - url-pattern: /druid/* - reset-enable: false - filter: - stat: - enabled: true - # 记录慢SQL - log-slow-sql: true - slow-sql-millis: 1000 - merge-sql: true - wall: - config: - multi-statement-allow: true - slf4j: - enabled: true - statement-create-after-log-enabled: false - statement-close-after-log-enabled: false - result-set-open-after-log-enabled: false - result-set-close-after-log-enabled: false - result-set-next-after-log-enabled: false - - redis: - #数据库索引 - database: 12 - host: 120.77.145.59 - port: 6379 - password: 416909 - #连接超时时间 - timeout: 5000 - #过期时间 1个月(60*60*24*30) - expired: 2592000 - - mvc: - view: - prefix: classpath:/templates/ - suffix: .html - thymeleaf: - cache: false - - -logging: - config: classpath:log4j2.xml - level: - me.zhengjie: debug - -#Mybatis plus 配置 -mybatis-plus: - # 映射文件所在路径 - mapper-locations: classpath*:me/zhengjie/dao/mapper/*.xml - # pojo类所在包路径 - #typeAliasesPackage: - # 开启驼峰命名规则自动转换 - configuration: - map-underscore-to-camel-case: true - log-impl: org.apache.ibatis.logging.log4j2.Log4j2Impl - global-config: - db-config: - # 配置表明前缀,例如表设计时表名为tb_manager,对应entity为Manager - #table-prefix: tb_ - #逻辑已删除值 - logic-delete-value: 1 - #逻辑未删除值 - logic-not-delete-value: 0 - # 是否开启like查询,即对 stirng 字段是否使用 like,默认不开启 - column-like: true - -# 登录相关配置 -login: - # 登录缓存 - cache-enable: true - # 是否限制单用户登录 - single-login: false - # 验证码 - login-code: - # 验证码类型配置 查看 LoginProperties 类 - code-type: arithmetic - # 登录图形验证码有效时间/分钟 - expiration: 2 - # 验证码高度 - width: 111 - # 验证码宽度 - height: 36 - # 内容长度 - length: 2 - # 字体名称,为空则使用默认字体 - font-name: - # 字体大小 - font-size: 25 - -#jwt -jwt: - header: Authorization - # 令牌前缀 - token-start-with: Bearer - # 必须使用最少88位的Base64对该令牌进行编码 - base64-secret: ZmQ0ZGI5NjQ0MDQwY2I4MjMxY2Y3ZmI3MjdhN2ZmMjNhODViOTg1ZGE0NTBjMGM4NDA5NzYxMjdjOWMwYWRmZTBlZjlhNGY3ZTg4Y2U3YTE1ODVkZDU5Y2Y3OGYwZWE1NzUzNWQ2YjFjZDc0NGMxZWU2MmQ3MjY1NzJmNTE0MzI= - # 令牌过期时间 此处单位/毫秒 ,默认4小时,可在此网站生成 https://www.convertworld.com/zh-hans/time/milliseconds.html - token-validity-in-seconds: 14400000 - # 在线用户key - online-key: online-token- - # 验证码 - code-key: code-key- - # token 续期检查时间范围(默认30分钟,单位毫秒),在token即将过期的一段时间内用户操作了,则给用户的token续期 - detect: 1800000 - # 续期时间范围,默认1小时,单位毫秒 - renew: 3600000 - -#是否允许生成代码,生产环境设置为false -generator: - enabled: true - -#是否开启 swagger-ui -swagger: - enabled: true - -# IP 本地解析 -ip: - local-parsing: true - -# 文件存储路径 -file: - mac: - path: ~/file/ - avatar: ~/avatar/ - linux: - path: /home/luckyDraw/file/ - avatar: /home/luckyDraw/avatar/ - windows: - path: C:\luckyDraw\file\ - avatar: C:\luckyDraw\avatar\ - # 文件大小 /M - maxSize: 100 - avatarMaxSize: 5 - - -system: - imgPath: /home/waguda/capiltal/file/ - # 静态资源访问路径(返回前端时添加) - fileVisitAddr: http://img.com - #文件上传接口后缀,用来放行xss过滤 - uploadSuffix: file/uploadFile - # 单文件上传大小限制,单位 :MB - maxFileSize: 10 - # 视频单文件上传限制,单位 :MB - maxVideoFileSize: 25 - # ip库文件的绝对路径 window 就是指到resource下的ip2region下 - ip2regionDbPath: /home/work/services/capiltal/capiltal-system/ip2region/ip2region.db - # 多语言文件路径 - languagePath: /home/waguda/capiltal/language - wsUrl: ws://192.168.110.99:8110 - # 百度翻译 APPID - baiduAppId: 20211116001000718 - # 百度翻译privateKey - baiduPrivateKey: jSDxw0_QkRnbRdRT0rKY - -config: - # 放掉的api 校验token huijia@biying123 - https://md5jiami.51240.com/ - apiToken: "e6f5e41ca6b103070ff89c812a36eaec" - #文件上传前缀(首位+'/' 末尾不加'/'),用来放行静态资源访问权限(图片,音频等) - uploadPrefix: /capital - # 图片上传保存路径(注意格式,首尾带‘/’) key:图片上传类型 value: - uploadImgPath: - # 用户头像修改 - 1: /capital/img/ - 2: /capital/rotation/ - 3: /capital/article/ - 4: /capital/currency/ - # 提现审核提示音 - 5: /capital/tones/ - # 聊天室默认头像 - 6: /capital/chat/head/ - # 聊天室会员上传的图片 - 7: /capital/chat/img/ - # 聊天室会员上传视频 - 8: /capital/chat/video/ - 9: /capital/promotion/ - # 平台UBB 富文本 - 10: /capital/platUBB/ - # 支持文件上传的文件格式 - sustainImgFormat: - - img - - jpg - - png - - mp3 - - pem - - jpeg - - gif - - JPG - - JPEG - - PNG - - AVI - - mov - - rmvb - - rm - - FLV - - mp4 - - 3GP - - zip - -web3j: - # web3j 区块链信息 - linkAddress: - #火币 - - name: HECO - # 服务实现类全限定类名 - serverName: "me.zhengjie.web3j.service.impl.ETHBlockchainServiceImpl" - # rpc 连接地址 - url: https://http-testnet.hecochain.com - # 官网域名+查询交易明细 - domain: https://testnet.hecoinfo.com/tx - # 链路Id,必须以 0x开头 - chainId: "0x100" - #合约币种 - contracts: - USDT: - address: "0x425a2d7c3df8a7872f05405dc6e34b6d9cd714be" - accuracy: 18 - MDX: - address: "0x30e552B5Ce0495A55b9138343dD88d6457a6C66b" - accuracy: 18 - DMT: - address: "0x4da2F416aa79fB0BeCA3D6cf6EB6Fe86b4a747CF" - accuracy: 18 - - # ok链 - - name: OKEX - # 服务实现类全限定类名 - serverName: "me.zhengjie.web3j.service.impl.ETHBlockchainServiceImpl" - # rpc 连接地址 - url: https://exchaintestrpc.okex.org - # 官网域名+查询交易明细 - domain: https://www.oklink.com/zh-cn/oec-test/tx - # 链路Id,必须以 0x开头 - chainId: "0x41" - #合约币种 - contracts: - USDT: - address: "0x1328bB18fe06647878d04fcB94BA5474c85C7616" - accuracy: 18 - MDX: - address: "" - accuracy: 0 - DMT: - address: "" - accuracy: 0 - - # 币安链 - - name: BSC - # 服务实现类全限定类名 - serverName: "me.zhengjie.web3j.service.impl.ETHBlockchainServiceImpl" - # rpc 连接地址 https://data-seed-prebsc-1-s1.binance.org:8545/ https://data-seed-prebsc-2-s3.binance.org:8545 - url: https://data-seed-prebsc-1-s1.binance.org:8545/ - # 官网域名+查询交易明细 - domain: https://testnet.bscscan.com/tx - # 链路Id,必须以 0x开头 - chainId: "0x61" - #合约币种 - contracts: - USDT: - # address: "0x3D39e763d2942816c96E783bb53C7c5DB44AFFF3" - address: "0xA12327AaE5C6CCcf816bAC49136f050FeFe89CB6" - accuracy: 18 - MDX: - address: "0x79CA70F863c4273Bb276F37381e1aD2096b77CeE" - accuracy: 18 - ETH: - address: "0x19E6689Bb9CF7Ef04AFf57B77562E4C943c415cD" - accuracy: 18 - CAKE: - address: "0xeBb3CD5EF4a5875AEfcf02CeAaa77Ac8A164523f" - accuracy: 18 - - # 波场 - - name: TRON - # 服务实现类全限定类名 - serverName: "me.zhengjie.web3j.service.impl.TronBlockchainServiceImpl" - # rpc 连接地址, 可选: mainnet、shasta、nile,或其他节点(例:47.252.19.181) - network: shasta - # http接口请求的URL - url: https://api.shasta.trongrid.io - # 官网域名+查询交易明细 - domain: https://shasta.tronscan.org//#/transaction - # 私钥,波场调用API时,不管什么接口都必须要设置私钥 - hexPrivateKey: "780e0d9997862dfac8e0698c8dd457531c9c13ecf6cec377315e95c30b43c8c4" - # 说明:https://cn.developers.tron.network/reference/%E4%BB%80%E4%B9%88%E6%98%AFapi-key e3506c97-a4b6-4bf7-829a-6a5d48b112f7 - apiKey: "" - #合约币种 - contracts: - USDT: - # TNuoKL1ni8aoshfFL1ASca1Gou9RXwAzfn USDT:TXYZopYRdj2D9XRtbG411XZZ3kM5VkAeBf - address: "TNpzntv25qsy1HVWQW2jCrhWj5wad3tVcj" - accuracy: 10 - MDX: - address: "" - accuracy: 0 - DMT: - address: "" - accuracy: 0 - - blockchain: - 1: - - currencyType: 1 - name: USDT - - currencyType: 2 - name: MDX - - currencyType: 3 - name: DMT - 2: - - currencyType: 1 - name: USDT - 4: - - currencyType: 1 - name: USDT - - currencyType: 2 - name: MDX - - currencyType: 5 - name: ETH - - currencyType: 4 - name: CAKE - 5: - - currencyType: 1 - name: USDT - -# 采集开奖结果配置 -draw: - config: - configs: - - passType: 1 #链路 火币链 - currency: BTC #采集币种 BTC - url: https://api.huobi.pro/market/history/kline #采集地址 - period: 1min #采集周期 1min, 5min, 15min, 30min, ---- 60min, 4hour, 1day, 1mon, 1week, 1year - symbol: btcusdt #交易对 btcusdt, ethbtc - size: 120 #返回数据条数 1 - 2000 - - passType: 4 #链路 币安链 - currency: BTC #采集币种 BTC - url: https://api.binance.com/api/v3/klines #采集地址 - period: 1m #采集周期 #采集周期 1m, 3m, 5m, 15m, 30m, ---- 1h, 2h, 4h, 6h, 8h, 12h, 1d, 3d, 1w, 1M - symbol: BTCUSDT #交易对 - size: 120 #返回数据条数 1 - 1000 - -#该应用是否启用生产者 -rocketmq: - producer: - isOnOff: on - #发送同一类消息的设置为同一个group,保证唯一,默认不需要设置,rocketmq会使用ip@pid(pid代表jvm名字)作为唯一标示 - groupName: springboot-rocketmq-producer-capiltal - #mq的nameserver地址 - namesrvAddr: 120.77.145.59:9876 - #消息最大长度 默认1024*4(4M) - maxMessageSize: 4096 - #发送消息超时时间,默认3000 - sendMsgTimeout: 3000 - #发送消息失败重试次数,默认2 - retryTimesWhenSendFailed: 2 - consumer: - isOnOff: on - groupName: springboot-rocketmq-consumer-capiltal - #mq的nameserver地址 43.240.95.168 - namesrvAddr: 120.77.145.59:9876 - #该消费者订阅的主题和tags("*"号表示订阅该主题下所有的tags),格式:topic~tag1||tag2||tag3;topic2~*; - topics: capiltal-settlement-top~* - consumeThreadMin: 20 - consumeThreadMax: 64 - #设置一次消费消息的条数,默认为1条 - consumeMessageBatchMaxSize: 1 - -# Goole Auth -auth: - secret_size: 10 - seed: g8GjEvTbW5oVSV7avLBdwIHqGlUYNzKFI7izOF8GwLDVKs2m0QN7vxRs2im5MDaNCWGmcD2rvcZx - random_number_algorithm: SHA1PRNG - window_size: 0 - redis_google_auth_key: googelAuthKey - qr_create_prefix_url: https://api.qrserver.com/v1/create-qr-code/?size=150x150&data=otpauth://totp/%s@%s?secret=%s - -#telegram: -# bot: -# username: capiltal_uat_bot -# token: 5008414161:AAHflrbo2v0DN8hpLhZAg5gC787yxFloWlk -# chatId: -665412272 \ No newline at end of file diff --git a/wjcy-system/src/main/resources/config/application.yml b/wjcy-system/src/main/resources/config/application.yml deleted file mode 100644 index bf5a2ad..0000000 --- a/wjcy-system/src/main/resources/config/application.yml +++ /dev/null @@ -1,56 +0,0 @@ -server: - port: 8008 - -spring: - cache: - type: redis - freemarker: - check-template-location: false - profiles: - active: dev - jackson: - time-zone: GMT+8 - data: - redis: - repositories: - enabled: false - - #配置 Jpa - jpa: - properties: - hibernate: - ddl-auto: none - dialect: org.hibernate.dialect.MySQL5InnoDBDialect - open-in-view: true - -# 开启security功能,配置访问账号密码 -management: - security: - enabled: true -security: - username: admin - userpassword: capiltal&xxs&123 - -task: - pool: - # 核心线程池大小 - core-pool-size: 10 - # 最大线程数 - max-pool-size: 30 - # 活跃时间 - keep-alive-seconds: 60 - # 队列容量 - queue-capacity: 50 - -#七牛云 -qiniu: - # 文件大小 /M - max-size: 15 - -#邮箱验证码有效时间/秒 -code: - expiration: 300 - -#密码加密传输,前端公钥加密,后端私钥解密 -rsa: - private_key: MIIBUwIBADANBgkqhkiG9w0BAQEFAASCAT0wggE5AgEAAkEA0vfvyTdGJkdbHkB8mp0f3FE0GYP3AYPaJF7jUd1M0XxFSE2ceK3k2kw20YvQ09NJKk+OMjWQl9WitG9pB6tSCQIDAQABAkA2SimBrWC2/wvauBuYqjCFwLvYiRYqZKThUS3MZlebXJiLB+Ue/gUifAAKIg1avttUZsHBHrop4qfJCwAI0+YRAiEA+W3NK/RaXtnRqmoUUkb59zsZUBLpvZgQPfj1MhyHDz0CIQDYhsAhPJ3mgS64NbUZmGWuuNKp5coY2GIj/zYDMJp6vQIgUueLFXv/eZ1ekgz2Oi67MNCk5jeTF2BurZqNLR3MSmUCIFT3Q6uHMtsB9Eha4u7hS31tj1UWE+D+ADzp59MGnoftAiBeHT7gDMuqeJHPL4b+kC+gzV4FGTfhR9q3tTbklZkD2A== diff --git a/wjcy-system/src/main/resources/generator.properties b/wjcy-system/src/main/resources/generator.properties deleted file mode 100644 index 2ed9370..0000000 --- a/wjcy-system/src/main/resources/generator.properties +++ /dev/null @@ -1,27 +0,0 @@ -#数据库类型转Java类型 -tinyint=Integer -smallint=Integer -mediumint=Integer -int=Integer -integer=Integer - -bigint=Long - -float=Float - -double=Double - -decimal=BigDecimal - -bit=Boolean - -char=String -varchar=String -tinytext=String -text=String -mediumtext=String -longtext=String - -date=Timestamp -datetime=Timestamp -timestamp=Timestamp \ No newline at end of file diff --git a/wjcy-system/src/main/resources/ip2region/ip2region.db b/wjcy-system/src/main/resources/ip2region/ip2region.db deleted file mode 100644 index 43e1daf..0000000 Binary files a/wjcy-system/src/main/resources/ip2region/ip2region.db and /dev/null differ diff --git a/wjcy-system/src/main/resources/log4j2.xml b/wjcy-system/src/main/resources/log4j2.xml deleted file mode 100644 index 8a40859..0000000 --- a/wjcy-system/src/main/resources/log4j2.xml +++ /dev/null @@ -1,252 +0,0 @@ - - - - - - - - - /home/work/logs/wjcy-system/gz - - - info - - 10M - 1 - 10 - 30d - - 10M - - 7 - 10 - 30d - - 10M - 10 - 30d - - 10M - 10 - 30d - - - %d{yyyy-MM-dd HH:mm:ss.SSS} |-%-5level [%20.40thread] %c [%L] -| %msg%n - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/wjcy-system/src/main/resources/log4jdbc.log4j2.properties b/wjcy-system/src/main/resources/log4jdbc.log4j2.properties deleted file mode 100644 index 7a39410..0000000 --- a/wjcy-system/src/main/resources/log4jdbc.log4j2.properties +++ /dev/null @@ -1,5 +0,0 @@ -# If you use SLF4J. First, you need to tell log4jdbc-log4j2 that you want to use the SLF4J logger -log4jdbc.spylogdelegator.name=net.sf.log4jdbc.log.slf4j.Slf4jSpyLogDelegator -log4jdbc.auto.load.popular.drivers=false -log4jdbc.drivers=com.mysql.cj.jdbc.Driver -log4j2.formatMsgNoLookups=true \ No newline at end of file diff --git a/wjcy-system/src/main/resources/template/email/email.ftl b/wjcy-system/src/main/resources/template/email/email.ftl deleted file mode 100644 index 2f82fcb..0000000 --- a/wjcy-system/src/main/resources/template/email/email.ftl +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - -
-
-

尊敬的用户,您好:

-

您正在申请邮箱验证,您的验证码为:

-

${code}

-
-
-
- Copyright ©${.now?string("yyyy")} EL-ADMIN 后台管理系统 All Rights Reserved. -
- -
-
- - diff --git a/wjcy-system/src/main/resources/template/email/taskAlarm.ftl b/wjcy-system/src/main/resources/template/email/taskAlarm.ftl deleted file mode 100644 index b116dec..0000000 --- a/wjcy-system/src/main/resources/template/email/taskAlarm.ftl +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - - -
-
-

任务信息:

- - - - - - - - - - - - - - - - - -
任务名称Bean名称执行方法参数内容Cron表达式描述内容
${task.jobName}${task.beanName}${task.methodName}${(task.params)!""}${task.cronExpression}${(task.description)!""}
-
-
-

异常信息:

-
-                ${msg}
-            
-
-
-
-
- Copyright ©${.now?string("yyyy")} EL-ADMIN 后台管理系统 All Rights Reserved. -
- -
- - - diff --git a/wjcy-system/src/main/resources/template/generator/admin/Controller.ftl b/wjcy-system/src/main/resources/template/generator/admin/Controller.ftl deleted file mode 100644 index 5a6aa1e..0000000 --- a/wjcy-system/src/main/resources/template/generator/admin/Controller.ftl +++ /dev/null @@ -1,87 +0,0 @@ -/* -* Copyright 2019-2020 Zheng Jie -* -* 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 ${package}.rest; - -import me.zhengjie.annotation.Log; -import ${package}.domain.${className}; -import ${package}.service.${className}Service; -import ${package}.service.dto.${className}QueryCriteria; -import org.springframework.data.domain.Pageable; -import lombok.RequiredArgsConstructor; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import io.swagger.annotations.*; -import java.io.IOException; -import javax.servlet.http.HttpServletResponse; - -/** -* @website https://el-admin.vip -* @author ${author} -* @date ${date} -**/ -@RestController -@RequiredArgsConstructor -@Api(tags = "${apiAlias}管理") -@RequestMapping("/api/${changeClassName}") -public class ${className}Controller { - - private final ${className}Service ${changeClassName}Service; - - @Log("导出数据") - @ApiOperation("导出数据") - @GetMapping(value = "/download") - @PreAuthorize("@el.check('${changeClassName}:list')") - public void download(HttpServletResponse response, ${className}QueryCriteria criteria) throws IOException { - ${changeClassName}Service.download(${changeClassName}Service.queryAll(criteria), response); - } - - @GetMapping - @Log("查询${apiAlias}") - @ApiOperation("查询${apiAlias}") - @PreAuthorize("@el.check('${changeClassName}:list')") - public ResponseEntity query(${className}QueryCriteria criteria, Pageable pageable){ - return new ResponseEntity<>(${changeClassName}Service.queryAll(criteria,pageable),HttpStatus.OK); - } - - @PostMapping - @Log("新增${apiAlias}") - @ApiOperation("新增${apiAlias}") - @PreAuthorize("@el.check('${changeClassName}:add')") - public ResponseEntity create(@Validated @RequestBody ${className} resources){ - return new ResponseEntity<>(${changeClassName}Service.create(resources),HttpStatus.CREATED); - } - - @PutMapping - @Log("修改${apiAlias}") - @ApiOperation("修改${apiAlias}") - @PreAuthorize("@el.check('${changeClassName}:edit')") - public ResponseEntity update(@Validated @RequestBody ${className} resources){ - ${changeClassName}Service.update(resources); - return new ResponseEntity<>(HttpStatus.NO_CONTENT); - } - - @Log("删除${apiAlias}") - @ApiOperation("删除${apiAlias}") - @PreAuthorize("@el.check('${changeClassName}:del')") - @DeleteMapping - public ResponseEntity delete(@RequestBody ${pkColumnType}[] ids) { - ${changeClassName}Service.deleteAll(ids); - return new ResponseEntity<>(HttpStatus.OK); - } -} \ No newline at end of file diff --git a/wjcy-system/src/main/resources/template/generator/admin/Dto.ftl b/wjcy-system/src/main/resources/template/generator/admin/Dto.ftl deleted file mode 100644 index e388a0b..0000000 --- a/wjcy-system/src/main/resources/template/generator/admin/Dto.ftl +++ /dev/null @@ -1,54 +0,0 @@ -/* -* Copyright 2019-2020 Zheng Jie -* -* 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 ${package}.service.dto; - -import lombok.Data; -<#if hasTimestamp> -import java.sql.Timestamp; - -<#if hasBigDecimal> -import java.math.BigDecimal; - -import java.io.Serializable; -<#if !auto && pkColumnType = 'Long'> -import com.alibaba.fastjson.annotation.JSONField; -import com.alibaba.fastjson.serializer.ToStringSerializer; - - -/** -* @website https://el-admin.vip -* @description / -* @author ${author} -* @date ${date} -**/ -@Data -public class ${className}Dto implements Serializable { -<#if columns??> - <#list columns as column> - - <#if column.remark != ''> - /** ${column.remark} */ - - <#if column.columnKey = 'PRI'> - <#if !auto && pkColumnType = 'Long'> - /** 防止精度丢失 */ - @JSONField(serializeUsing = ToStringSerializer.class) - - - private ${column.columnType} ${column.changeColumnName}; - - -} \ No newline at end of file diff --git a/wjcy-system/src/main/resources/template/generator/admin/Entity.ftl b/wjcy-system/src/main/resources/template/generator/admin/Entity.ftl deleted file mode 100644 index 9d8b1e7..0000000 --- a/wjcy-system/src/main/resources/template/generator/admin/Entity.ftl +++ /dev/null @@ -1,85 +0,0 @@ -/* -* Copyright 2019-2020 Zheng Jie -* -* 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 ${package}.domain; - -import lombok.Data; -import cn.hutool.core.bean.BeanUtil; -import io.swagger.annotations.ApiModelProperty; -import cn.hutool.core.bean.copier.CopyOptions; -import javax.persistence.*; -<#if isNotNullColumns??> -import javax.validation.constraints.*; - -<#if hasDateAnnotation> -import javax.persistence.Entity; -import javax.persistence.Table; -import org.hibernate.annotations.*; - -<#if hasTimestamp> -import java.sql.Timestamp; - -<#if hasBigDecimal> -import java.math.BigDecimal; - -import java.io.Serializable; - -/** -* @website https://el-admin.vip -* @description / -* @author ${author} -* @date ${date} -**/ -@Entity -@Data -@Table(name="${tableName}") -public class ${className} implements Serializable { -<#if columns??> - <#list columns as column> - - <#if column.columnKey = 'PRI'> - @Id - <#if auto> - @GeneratedValue(strategy = GenerationType.IDENTITY) - - - @Column(name = "${column.columnName}"<#if column.columnKey = 'UNI'>,unique = true<#if column.istNotNull && column.columnKey != 'PRI'>,nullable = false) - <#if column.istNotNull && column.columnKey != 'PRI'> - <#if column.columnType = 'String'> - @NotBlank - <#else> - @NotNull - - - <#if (column.dateAnnotation)?? && column.dateAnnotation != ''> - <#if column.dateAnnotation = 'CreationTimestamp'> - @CreationTimestamp - <#else> - @UpdateTimestamp - - - <#if column.remark != ''> - @ApiModelProperty(value = "${column.remark}") - <#else> - @ApiModelProperty(value = "${column.changeColumnName}") - - private ${column.columnType} ${column.changeColumnName}; - - - - public void copy(${className} source){ - BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true)); - } -} \ No newline at end of file diff --git a/wjcy-system/src/main/resources/template/generator/admin/Mapper.ftl b/wjcy-system/src/main/resources/template/generator/admin/Mapper.ftl deleted file mode 100644 index 3387f06..0000000 --- a/wjcy-system/src/main/resources/template/generator/admin/Mapper.ftl +++ /dev/null @@ -1,32 +0,0 @@ -/* -* Copyright 2019-2020 Zheng Jie -* -* 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 ${package}.service.mapstruct; - -import me.zhengjie.base.BaseMapper; -import ${package}.domain.${className}; -import ${package}.service.dto.${className}Dto; -import org.mapstruct.Mapper; -import org.mapstruct.ReportingPolicy; - -/** -* @website https://el-admin.vip -* @author ${author} -* @date ${date} -**/ -@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE) -public interface ${className}Mapper extends BaseMapper<${className}Dto, ${className}> { - -} \ No newline at end of file diff --git a/wjcy-system/src/main/resources/template/generator/admin/QueryCriteria.ftl b/wjcy-system/src/main/resources/template/generator/admin/QueryCriteria.ftl deleted file mode 100644 index 2a4d1ff..0000000 --- a/wjcy-system/src/main/resources/template/generator/admin/QueryCriteria.ftl +++ /dev/null @@ -1,81 +0,0 @@ -/* -* Copyright 2019-2020 Zheng Jie -* -* 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 ${package}.service.dto; - -import lombok.Data; -<#if queryHasTimestamp> -import java.sql.Timestamp; - -<#if queryHasBigDecimal> -import java.math.BigDecimal; - -<#if betweens??> -import java.util.List; - -<#if queryColumns??> -import me.zhengjie.annotation.Query; - - -/** -* @website https://el-admin.vip -* @author ${author} -* @date ${date} -**/ -@Data -public class ${className}QueryCriteria{ -<#if queryColumns??> - <#list queryColumns as column> - -<#if column.queryType = '='> - /** 精确 */ - @Query - private ${column.columnType} ${column.changeColumnName}; - -<#if column.queryType = 'Like'> - /** 模糊 */ - @Query(type = Query.Type.INNER_LIKE) - private ${column.columnType} ${column.changeColumnName}; - -<#if column.queryType = '!='> - /** 不等于 */ - @Query(type = Query.Type.NOT_EQUAL) - private ${column.columnType} ${column.changeColumnName}; - -<#if column.queryType = 'NotNull'> - /** 不为空 */ - @Query(type = Query.Type.NOT_NULL) - private ${column.columnType} ${column.changeColumnName}; - -<#if column.queryType = '>='> - /** 大于等于 */ - @Query(type = Query.Type.GREATER_THAN) - private ${column.columnType} ${column.changeColumnName}; - -<#if column.queryType = '<='> - /** 小于等于 */ - @Query(type = Query.Type.LESS_THAN) - private ${column.columnType} ${column.changeColumnName}; - - - -<#if betweens??> - <#list betweens as column> - /** BETWEEN */ - @Query(type = Query.Type.BETWEEN) - private List<${column.columnType}> ${column.changeColumnName}; - - -} \ No newline at end of file diff --git a/wjcy-system/src/main/resources/template/generator/admin/Repository.ftl b/wjcy-system/src/main/resources/template/generator/admin/Repository.ftl deleted file mode 100644 index 2420d4b..0000000 --- a/wjcy-system/src/main/resources/template/generator/admin/Repository.ftl +++ /dev/null @@ -1,40 +0,0 @@ -/* -* Copyright 2019-2020 Zheng Jie -* -* 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 ${package}.repository; - -import ${package}.domain.${className}; -import org.springframework.data.jpa.repository.JpaRepository; -import org.springframework.data.jpa.repository.JpaSpecificationExecutor; - -/** -* @website https://el-admin.vip -* @author ${author} -* @date ${date} -**/ -public interface ${className}Repository extends JpaRepository<${className}, ${pkColumnType}>, JpaSpecificationExecutor<${className}> { -<#if columns??> - <#list columns as column> - <#if column.columnKey = 'UNI'> - /** - * 根据 ${column.capitalColumnName} 查询 - * @param ${column.columnName} / - * @return / - */ - ${className} findBy${column.capitalColumnName}(${column.columnType} ${column.columnName}); - - - -} \ No newline at end of file diff --git a/wjcy-system/src/main/resources/template/generator/admin/Service.ftl b/wjcy-system/src/main/resources/template/generator/admin/Service.ftl deleted file mode 100644 index 9ecbe24..0000000 --- a/wjcy-system/src/main/resources/template/generator/admin/Service.ftl +++ /dev/null @@ -1,83 +0,0 @@ -/* -* Copyright 2019-2020 Zheng Jie -* -* 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 ${package}.service; - -import ${package}.domain.${className}; -import ${package}.service.dto.${className}Dto; -import ${package}.service.dto.${className}QueryCriteria; -import org.springframework.data.domain.Pageable; -import java.util.Map; -import java.util.List; -import java.io.IOException; -import javax.servlet.http.HttpServletResponse; - -/** -* @website https://el-admin.vip -* @description 服务接口 -* @author ${author} -* @date ${date} -**/ -public interface ${className}Service { - - /** - * 查询数据分页 - * @param criteria 条件 - * @param pageable 分页参数 - * @return Map - */ - Map queryAll(${className}QueryCriteria criteria, Pageable pageable); - - /** - * 查询所有数据不分页 - * @param criteria 条件参数 - * @return List<${className}Dto> - */ - List<${className}Dto> queryAll(${className}QueryCriteria criteria); - - /** - * 根据ID查询 - * @param ${pkChangeColName} ID - * @return ${className}Dto - */ - ${className}Dto findById(${pkColumnType} ${pkChangeColName}); - - /** - * 创建 - * @param resources / - * @return ${className}Dto - */ - ${className}Dto create(${className} resources); - - /** - * 编辑 - * @param resources / - */ - void update(${className} resources); - - /** - * 多选删除 - * @param ids / - */ - void deleteAll(${pkColumnType}[] ids); - - /** - * 导出数据 - * @param all 待导出的数据 - * @param response / - * @throws IOException / - */ - void download(List<${className}Dto> all, HttpServletResponse response) throws IOException; -} \ No newline at end of file diff --git a/wjcy-system/src/main/resources/template/generator/admin/ServiceImpl.ftl b/wjcy-system/src/main/resources/template/generator/admin/ServiceImpl.ftl deleted file mode 100644 index 17f0454..0000000 --- a/wjcy-system/src/main/resources/template/generator/admin/ServiceImpl.ftl +++ /dev/null @@ -1,157 +0,0 @@ -/* -* Copyright 2019-2020 Zheng Jie -* -* 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 ${package}.service.impl; - -import ${package}.domain.${className}; -<#if columns??> - <#list columns as column> - <#if column.columnKey = 'UNI'> - <#if column_index = 1> -import me.zhengjie.exception.EntityExistException; - - - - -import me.zhengjie.utils.ValidationUtil; -import me.zhengjie.utils.FileUtil; -import lombok.RequiredArgsConstructor; -import ${package}.repository.${className}Repository; -import ${package}.service.${className}Service; -import ${package}.service.dto.${className}Dto; -import ${package}.service.dto.${className}QueryCriteria; -import ${package}.service.mapstruct.${className}Mapper; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -<#if !auto && pkColumnType = 'Long'> -import cn.hutool.core.lang.Snowflake; -import cn.hutool.core.util.IdUtil; - -<#if !auto && pkColumnType = 'String'> -import cn.hutool.core.util.IdUtil; - -import org.springframework.data.domain.Page; -import org.springframework.data.domain.Pageable; -import me.zhengjie.utils.PageUtil; -import me.zhengjie.utils.QueryHelp; -import java.util.List; -import java.util.Map; -import java.io.IOException; -import javax.servlet.http.HttpServletResponse; -import java.util.ArrayList; -import java.util.LinkedHashMap; - -/** -* @website https://el-admin.vip -* @description 服务实现 -* @author ${author} -* @date ${date} -**/ -@Service -@RequiredArgsConstructor -public class ${className}ServiceImpl implements ${className}Service { - - private final ${className}Repository ${changeClassName}Repository; - private final ${className}Mapper ${changeClassName}Mapper; - - @Override - public Map queryAll(${className}QueryCriteria criteria, Pageable pageable){ - Page<${className}> page = ${changeClassName}Repository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable); - return PageUtil.toPage(page.map(${changeClassName}Mapper::toDto)); - } - - @Override - public List<${className}Dto> queryAll(${className}QueryCriteria criteria){ - return ${changeClassName}Mapper.toDto(${changeClassName}Repository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder))); - } - - @Override - @Transactional - public ${className}Dto findById(${pkColumnType} ${pkChangeColName}) { - ${className} ${changeClassName} = ${changeClassName}Repository.findById(${pkChangeColName}).orElseGet(${className}::new); - ValidationUtil.isNull(${changeClassName}.get${pkCapitalColName}(),"${className}","${pkChangeColName}",${pkChangeColName}); - return ${changeClassName}Mapper.toDto(${changeClassName}); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public ${className}Dto create(${className} resources) { -<#if !auto && pkColumnType = 'Long'> - Snowflake snowflake = IdUtil.createSnowflake(1, 1); - resources.set${pkCapitalColName}(snowflake.nextId()); - -<#if !auto && pkColumnType = 'String'> - resources.set${pkCapitalColName}(IdUtil.simpleUUID()); - -<#if columns??> - <#list columns as column> - <#if column.columnKey = 'UNI'> - if(${changeClassName}Repository.findBy${column.capitalColumnName}(resources.get${column.capitalColumnName}()) != null){ - throw new EntityExistException(${className}.class,"${column.columnName}",resources.get${column.capitalColumnName}()); - } - - - - return ${changeClassName}Mapper.toDto(${changeClassName}Repository.save(resources)); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void update(${className} resources) { - ${className} ${changeClassName} = ${changeClassName}Repository.findById(resources.get${pkCapitalColName}()).orElseGet(${className}::new); - ValidationUtil.isNull( ${changeClassName}.get${pkCapitalColName}(),"${className}","id",resources.get${pkCapitalColName}()); -<#if columns??> - <#list columns as column> - <#if column.columnKey = 'UNI'> - <#if column_index = 1> - ${className} ${changeClassName}1 = null; - - ${changeClassName}1 = ${changeClassName}Repository.findBy${column.capitalColumnName}(resources.get${column.capitalColumnName}()); - if(${changeClassName}1 != null && !${changeClassName}1.get${pkCapitalColName}().equals(${changeClassName}.get${pkCapitalColName}())){ - throw new EntityExistException(${className}.class,"${column.columnName}",resources.get${column.capitalColumnName}()); - } - - - - ${changeClassName}.copy(resources); - ${changeClassName}Repository.save(${changeClassName}); - } - - @Override - public void deleteAll(${pkColumnType}[] ids) { - for (${pkColumnType} ${pkChangeColName} : ids) { - ${changeClassName}Repository.deleteById(${pkChangeColName}); - } - } - - @Override - public void download(List<${className}Dto> all, HttpServletResponse response) throws IOException { - List> list = new ArrayList<>(); - for (${className}Dto ${changeClassName} : all) { - Map map = new LinkedHashMap<>(); - <#list columns as column> - <#if column.columnKey != 'PRI'> - <#if column.remark != ''> - map.put("${column.remark}", ${changeClassName}.get${column.capitalColumnName}()); - <#else> - map.put(" ${column.changeColumnName}", ${changeClassName}.get${column.capitalColumnName}()); - - - - list.add(map); - } - FileUtil.downloadExcel(list, response); - } -} \ No newline at end of file diff --git a/wjcy-system/src/main/resources/template/generator/front/api.ftl b/wjcy-system/src/main/resources/template/generator/front/api.ftl deleted file mode 100644 index 9587d0d..0000000 --- a/wjcy-system/src/main/resources/template/generator/front/api.ftl +++ /dev/null @@ -1,27 +0,0 @@ -import request from '@/utils/request' - -export function add(data) { - return request({ - url: 'api/${changeClassName}', - method: 'post', - data - }) -} - -export function del(ids) { - return request({ - url: 'api/${changeClassName}/', - method: 'delete', - data: ids - }) -} - -export function edit(data) { - return request({ - url: 'api/${changeClassName}', - method: 'put', - data - }) -} - -export default { add, edit, del } diff --git a/wjcy-system/src/main/resources/template/generator/front/index.ftl b/wjcy-system/src/main/resources/template/generator/front/index.ftl deleted file mode 100644 index 4b9111a..0000000 --- a/wjcy-system/src/main/resources/template/generator/front/index.ftl +++ /dev/null @@ -1,169 +0,0 @@ -<#--noinspection ALL--> - - - - - diff --git a/wjcy-system/src/main/resources/templates/index.html b/wjcy-system/src/main/resources/templates/index.html deleted file mode 100644 index e79ccbb..0000000 --- a/wjcy-system/src/main/resources/templates/index.html +++ /dev/null @@ -1,244 +0,0 @@ - - - - - - 测试页面 - - - - -
- -
- - -
-
- - - - - - - - - - - - - - - - - - - - - -
-
    -
  • - -
  • -
  • - - -
  • -
  • - - -
  • -
  • - - -
  • -
  • - -
  • -
-
- -
-
    -
  • -
  • -
  • -
  • -
-
-
    -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
-
-
    -
  • -
  • -
-
-
    -
  • -
  • - - -
  • -
  • -
-
- -
- - -
- - \ No newline at end of file diff --git a/wjcy-system/src/test/java/me/zhengjie/CtBuyerControllerTest.java b/wjcy-system/src/test/java/me/zhengjie/CtBuyerControllerTest.java deleted file mode 100644 index 5f10518..0000000 --- a/wjcy-system/src/test/java/me/zhengjie/CtBuyerControllerTest.java +++ /dev/null @@ -1,127 +0,0 @@ -package me.zhengjie; - -import cn.hutool.json.JSONUtil; -import com.alibaba.fastjson.JSONArray; -import me.zhengjie.config.SystemConfig; -import me.zhengjie.entity.CtBuyer; -import me.zhengjie.entity.CtExcel; -import me.zhengjie.entity.CtExcelImportInfo; -import me.zhengjie.enums.ExcelStatusEnum; -import me.zhengjie.enums.YesOrNoEnum; -import me.zhengjie.service.CtBuyerService; -import me.zhengjie.service.CtExcelImportInfoService; -import me.zhengjie.service.CtExcelService; -import me.zhengjie.utils.excel.ExcelUtils; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; -import java.io.File; -import java.util.ArrayList; -import java.util.List; - - -@RunWith(SpringRunner.class) -@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) -public class CtBuyerControllerTest { - - @Resource - private CtBuyerService ctBuyerService; - - @Test - public void testTest() { - - System.out.println("ttttttttttttttttt"); - } - - - @Test - public void batchAddCtBuyer() { - List ctBuyerServiceList = new ArrayList<>(); - for (int i = 0; i < 100; i++) { - CtBuyer ctBuyer = new CtBuyer(); - ctBuyer.setAccount("account-" + i); - ctBuyer.setNickName("nickName-" + i); - ctBuyer.setPwd("pwd-" + i); - - ctBuyerServiceList.add(ctBuyer); - } - - ctBuyerService.saveBatch(ctBuyerServiceList); - } - - - /** - * Excel 导入解析为json - */ - @Test - public void JsonArryByExcel() throws Exception { - - // 读取文件 - File file = new File("E:\\home\\waguda\\wjcy\\file\\wjcy\\excel\\20220622\\1539559881726894080.xlsx"); - JSONArray array = ExcelUtils.readFile(file); - System.out.println("=======json解析:" + array); - } - - - @Test - public void excelJson() { - String value = "[{\"name\":\"rch1\", \"age\":100},{\"name\":\"rch2\", \"age\":101}]"; - - cn.hutool.json.JSONArray userJsonArray = JSONUtil.parseArray(value); - List excelUserTestList = JSONUtil.toList(userJsonArray, ExcelUserTest.class); - for (ExcelUserTest excelUserTest:excelUserTestList) { - System.out.println("----excelUserTest:" + excelUserTest); - } - - // ----excelUserTest:ExcelUserTest(name=rch1, age=100) - // ----excelUserTest:ExcelUserTest(name=rch2, age=101) - } - - - @Resource - private CtExcelService ctExcelService; - @Resource - private CtExcelImportInfoService ctExcelImportInfoService; - - @Test - public void sqlExcelJson() { - CtExcel ctExcel = ctExcelService.getById(22L); - - String platImageUrl = SystemConfig.IMG_PATH; - String pathUrl = ctExcel.getPath(); - String excelPathUrl = platImageUrl + pathUrl; - - // 读取文件 - File file = new File(excelPathUrl); - - - - try { - - JSONArray array = ExcelUtils.readFile(file); - System.out.println("=======json解析:" + array); - - List excelImportInfoList = ExcelUtils.readFile(file, CtExcelImportInfo.class); - System.out.println("array:" + JSONUtil.toJsonStr(excelImportInfoList)); - - - ctExcelImportInfoService.saveBatch(excelImportInfoList); - - System.out.println("=========end"); - } catch (Exception exception) { - System.out.println(exception.getMessage()); - } - } - - @Test - public void enumTest() { - Integer yesOrNo = YesOrNoEnum.YES.value(); - Integer value = ExcelStatusEnum.TOBE.value(); - System.out.println("ttt"); - } -} - - diff --git a/wjcy-system/src/test/java/me/zhengjie/CtPlatformControllerTest.java b/wjcy-system/src/test/java/me/zhengjie/CtPlatformControllerTest.java deleted file mode 100644 index d3acdb2..0000000 --- a/wjcy-system/src/test/java/me/zhengjie/CtPlatformControllerTest.java +++ /dev/null @@ -1,43 +0,0 @@ -package me.zhengjie; - -import me.zhengjie.entity.CtPlatform; -import me.zhengjie.service.CtPlatformService; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; -import java.util.ArrayList; -import java.util.List; - - -@RunWith(SpringRunner.class) -@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) -public class CtPlatformControllerTest { - - @Resource - private CtPlatformService ctPlatformService; - - - - - - @Test - public void batchAddCtBuyer() { - List ctPlatformList = new ArrayList<>(); - for (int i = 0; i < 100; i++) { - CtPlatform ctPlatform = new CtPlatform(); - - ctPlatform.setAddress("address-" + i); - ctPlatform.setName("name-" + i); - ctPlatform.setPhone("phone-" + i); - - ctPlatformList.add(ctPlatform); - } - - ctPlatformService.saveBatch(ctPlatformList); - } -} - - diff --git a/wjcy-system/src/test/java/me/zhengjie/DhApiTest.java b/wjcy-system/src/test/java/me/zhengjie/DhApiTest.java deleted file mode 100644 index e51ffcc..0000000 --- a/wjcy-system/src/test/java/me/zhengjie/DhApiTest.java +++ /dev/null @@ -1,461 +0,0 @@ -package me.zhengjie; - -import cn.hutool.core.util.ObjectUtil; -import cn.hutool.json.JSONUtil; -import com.alibaba.fastjson.JSONArray; -import me.zhengjie.constant.PublicConstant; -import me.zhengjie.entity.*; -import me.zhengjie.entity.quartz.JobQueryByUuidReturn; -import me.zhengjie.entity.quartz.Params; -import me.zhengjie.enums.ClickFarmingStatusEnum; -import me.zhengjie.service.*; -import me.zhengjie.service.vo.BuyOrderVO; -import me.zhengjie.service.vo.CtBuyerDetailVO; -import me.zhengjie.utils.HttpClientUtil; -import me.zhengjie.utils.RedisUtils; -import me.zhengjie.utils.YdSignUtil; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; -import java.io.File; -import java.util.*; -import java.util.stream.Collectors; - -/** - * 对接请求敦煌Api测试 - * - * @author rch - * @create 2022-06-27 - */ - -@RunWith(SpringRunner.class) -@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) -public class DhApiTest { - - @Resource - private CtExcelImportInfoService ctExcelImportInfoService; - @Resource - private YdQuartzService ydQuartzService; - @Resource - private CtClickFarmingService ctClickFarmingService; - @Resource - private CtBuyerService ctBuyerService; - - @Test - public void doGetHttp() { - // PostMan - DoGet - 分销-订单-下单模块-第三方Api - // 1. 请求参数 - - String url = "http://api.dhgate.com/dop/router"; - String v = "2.0"; - String accessToken = "0QkUo9opYCcmB0UMzqK2XKFFNDDvlpmpRYyDkcVJ"; - String method = "dh.buyer.order.place"; - String formDetailInfo = "ssshop"; - - Map params = new HashMap<>(); - // 统一请求参数 - params.put("timestamp", System.currentTimeMillis()); - params.put("v", v); - params.put("access_token", accessToken); - params.put("method", method); - - // boby - params.put("fromDetailInfo", formDetailInfo); - - // PostMan - DoGet - 分销-订单-支付模块-第三方Api - CtExcelImportInfo ctExcelImportInfo = ctExcelImportInfoService.getById(1L); - - String carList = ctExcelImportInfo.getCartList(); - String contacInfo = ctExcelImportInfo.getContactInfo(); - - // Json 处理 参数检验 -// List ctParamProductList = JSONUtil.toList(JSONUtil.parseArray(carList), CtParamProduct.class); -// CtParamContactInfo ctParamContactInfo = JSONUtil.toBean(JSONUtil.parseObj(contacInfo), CtParamContactInfo.class); -// -//// JSONArray ctParamProductJsonArray = new JSONArray(); -//// for (CtParamProduct ctParamProduct:ctParamProductList) { -//// System.out.println("------ctParamProduct:" + ctParamProduct.toString()); -//// // 产品数量 必填 -//// if (ObjectUtil.isEmpty(ctParamProduct.getQuantity())) { -//// // 参数必填 -//// continue; -//// } -//// -//// // 产品编码 必填 -//// if (ObjectUtil.isEmpty(ctParamProduct.getQuantity())) { -//// // 参数必填 -//// continue; -//// } -//// -//// // 产品skuMd5 必填 -//// if (ObjectUtil.isEmpty(ctParamProduct.getQuantity())) { -//// // 参数必填 -//// continue; -//// } -//// -//// // 处理 -//// JSONObject ctParamProductJsonObject = JsonDealUtils.getNoNullValue(JSONUtil.toJsonStr(ctParamProduct)); -//// ctParamProductJsonArray.add(ctParamProductJsonObject); -//// } -//// -//// if (ObjectUtil.isNotEmpty(ctParamContactInfo)) { -//// System.out.println("------contactInfoList:" + ctParamContactInfo.toString()); -//// } -//// -//// // 空值去除 -////// JSONObject carListJsonObject = JsonDealUtils.getNoNullValue(carList); -//// JSONObject contacInfoJsonObject = JsonDealUtils.getNoNullValue(contacInfo); -//// -////// System.out.println("carListJsonObject:" + carListJsonObject.toString()); -//// System.out.println("contacInfoJsonObject:" + contacInfoJsonObject.toString()); -//// System.out.println("ctParamProductJsonArray:" + ctParamProductJsonArray.toString()); - - params.put("cartList", carList); - params.put("contactInfo", contacInfo); - - - String responseStr = HttpClientUtil.doPostHttp(url, params); - System.out.println("responseStr: " + responseStr); - } - - - @Test - public void postParamQuest() { - - String url = "http://api.dhgate.com/dop/router"; - String v = "2.0"; - String accessToken = "0QkUo9opYCcmB0UMzqK2XKFFNDDvlpmpRYyDkcVJ"; - String method = "dh.buyer.order.place"; - String formDetailInfo = "ssshop"; - - Map params = new HashMap<>(); - // 统一请求参数 - params.put("timestamp", System.currentTimeMillis()); - params.put("v", v); - params.put("access_token", accessToken); - params.put("method", method); - - // boby - params.put("fromDetailInfo", formDetailInfo); - params.put("cartList", "[{\"quantity\":10,\"itemcode\":634706114,\"skuMd5\":\"562e86410bd37a7bb4170cfe6e03203f\"}]"); - params.put("contactInfo", "{\"country\":\"US\",\"firstname\":\"zhao\",\"city\":\"Chicago\",\"postalcode\":\"12345\",\"orgnazationbaseid\":\"ff80808166f780340167547325e700e0\",\"addressline2\":\"youshengdasha apartment\",\"addressline1\":\"chengfulu road, hawio\",\"tel\":\"1311111111\",\"state\":\"California\",\"email\":\"zhaoyiyi@163.com\",\"lastname\":\"yiyi\"}"); - - String responseStr = HttpClientUtil.doPostHttp(url, params); - - // JONS 类型转换 - BuyOrderVO buyOrderVO = JSONUtil.toBean(responseStr, BuyOrderVO.class); - System.out.println("==================buyOrderVO:" + buyOrderVO.toString()); - - System.out.println("responseStr: " + responseStr); - } - - - @Resource - private CtOrderService ctOrderService; - - @Test - public void funRequestExcelInfoToOrder() { - CtExcelImportInfo ctExcelImportInfo = ctExcelImportInfoService.getById(2L); - Boolean resultBoolean = ctOrderService.buyOrderApi(ctExcelImportInfo); - System.out.println("========resultBoolean:" + resultBoolean); - } - - - @Test - public void payOrder() { - CtOrder ctOrder = ctOrderService.getById(1L); - Boolean result = ctOrderService.payOrderApi(ctOrder); - System.out.println("pay Order result:" + result); - } - - @Test - public void testAccountName() { -// CtRebot ctRebot = ctRebotService.getByAccountNameLock("supren@vogocm"); -// System.out.println("ctRebot:" + JSONUtil.toJsonStr(ctRebot)); - } - - - @Test - public void testSign() { - // 鉴权 - YdSign ydSign = new YdSign(); - ydSign.setTimestamp(Long.valueOf("1659757066")); - ydSign.setAccessKeyId("navkbKspVWfjPgm6@platform"); - ydSign.setAccessKeySecret("SuUc0zMfhrQX594eJnwFPm1sqk8CYtNv"); - ydSign.setBodyMd5("ed88dfe75bf53a33c49531d0d4635c71"); - - String getSign = "75bd5b7154a738c8b9c65eca523c31abfcfc24c3"; - String sign = YdSignUtil.getSign(ydSign); - System.out.println("sign:" + sign); - - if (ObjectUtil.isEmpty(sign) || !getSign.equals(sign)) { - System.out.println("不相等"); - } - } - - - @Test - public void queryJobByUuid() { - String uuid = "ef75ea22-7b63-4fcb-acf5-6de3b02ce7f7"; - String accessKey = "navkbKspVWfjPgm6@platform"; - String accessSercet = "SuUc0zMfhrQX594eJnwFPm1sqk8CYtNv"; - JobQueryByUuidReturn jobQueryByUuidReturn = ydQuartzService.queryJobUuid(uuid, accessKey, accessSercet); - System.out.println("==========JSON(jobQueryByUuidReturn) =" + JSONUtil.toJsonStr(jobQueryByUuidReturn)); - } - - - /** - * 解析json 区分错误类型 4.有订单id之前的异常 5.有订单未支付 6.支付成功异常 - * @param remark - * @return - */ - private Integer analysisReturnJson(String remark) { - - final String startModular = "】任务失败,在【"; - final String endModular = "】中第"; - final String endLineNumber = "行:出错"; - - // 根据规则解析 - // "remark": "【0757f764-07b4-4d4d-a48d-e1e13b598a1f】任务失败,在【5-1清空银行卡】中第17行:出错:未找到元素, 元素名: 按钮_OK", - // "remark": "【9a92a414-e957-47f8-ada1-7296723769a9】任务失败,在【9-1优惠劵】中第7行:出错:未找到元素", - // "remark": "【60a92f00-f7cb-4321-aa0b-6f18814fb462】任务失败,在【3.切换国家】中第8行:出错:未找到元素", - // "remark": "【81f6c1ac-6493-40cf-83fd-867b1a39e3ca】任务失败,在【9-3添加银行卡】中第5行:出错:未找到元素, 元素名: SAVE CARD", - // "remark": "【e201a1b3-f0a1-42b9-8315-d6736eead5a4】任务失败,在【1-2清空浏览器数据】中第1行:出错:操作无法执行!请重启当前浏览器 或 重装当前浏览器插件后再次尝试。", - - /** - * 1.切换VPN - * 2.关闭弹窗 - * 3.清空浏览器 - * 4.切换国家 - * 5.登录 - * 6.清空购物车 - * 6-1.清空银行卡 - * 7.搜索商品 - * 7-1.随意浏览界面 - * 7-2.滚动鼠标浏览界面 - * 7-3.随机点击商品 - * 7-4.浏览随机商品 - * 7-5匹配商品信息 - * 8.商品下单 --------------------------订单前:流程第12行点击加入购物车 - * 8-1.滚动鼠标浏览商品 - * 8-2.查找规格 - * 8-3.查找颜色 - * 8-4.商品个数 - * 9.购物车 - * 9-1.留言 - * 9-2.添加银行卡 - * 9-3.选择银行卡有效时间 - * 9-4.选择优惠券 - * 10.回到首页----------------------回到首页:流程第11行点击首页 - * 10-1.获取订单信息 - * 11.退出账号 - */ - if (ObjectUtil.isEmpty(remark)) { - return ClickFarmingStatusEnum.EXECUTION_FAILE.value(); - } - - String modular = remark.substring(remark.indexOf(startModular) + 8, remark.indexOf(endModular)); - String lineNumber = remark.substring(remark.indexOf(endModular) + 3, remark.indexOf(endLineNumber)); - - // 子模块可以忽略 - Integer modularInteger = 0; - Integer lineNumberInteger = 0; - if (ObjectUtil.isNotEmpty(modular)) { - if (modular.contains(".")) { - modularInteger = Integer.valueOf(modular.substring(0, modular.indexOf("."))); - } else if (modular.contains("-")) { - modularInteger = Integer.valueOf(modular.split("-")[0]); - } - } - if (ObjectUtil.isNotEmpty(lineNumber)) { - lineNumberInteger = Integer.valueOf(lineNumber); - } - - if (modularInteger < 8) { - return ClickFarmingStatusEnum.EXECUTION_FAILE.value(); - } else if(modularInteger == 8) { - if (lineNumberInteger <= 12) { - return ClickFarmingStatusEnum.EXECUTION_FAILE.value(); - } else { - return ClickFarmingStatusEnum.AWAITING_PAYMENT.value(); - } - } else if (modularInteger < 10){ - return ClickFarmingStatusEnum.AWAITING_PAYMENT.value(); - } else if(modularInteger == 10) { - if (lineNumberInteger <= 11) { - return ClickFarmingStatusEnum.AWAITING_PAYMENT.value(); - } else { - return ClickFarmingStatusEnum.PAY_OK_ERROR.value(); - } - } else { - return ClickFarmingStatusEnum.PAY_OK_ERROR.value(); - } - } - - @Test - public void test11() { - - // 根据规则解析 - // "remark": "【0757f764-07b4-4d4d-a48d-e1e13b598a1f】任务失败,在【5-1清空银行卡】中第17行:出错:未找到元素, 元素名: 按钮_OK", - // "remark": "【9a92a414-e957-47f8-ada1-7296723769a9】任务失败,在【9-1优惠劵】中第7行:出错:未找到元素", - // "remark": "【60a92f00-f7cb-4321-aa0b-6f18814fb462】任务失败,在【3.切换国家】中第8行:出错:未找到元素", - // "remark": "【81f6c1ac-6493-40cf-83fd-867b1a39e3ca】任务失败,在【9-3添加银行卡】中第5行:出错:未找到元素, 元素名: SAVE CARD", - // "remark": "【e201a1b3-f0a1-42b9-8315-d6736eead5a4】任务失败,在【11.清空浏览器数据】中第1行:出错:操作无法执行!请重启当前浏览器 或 重装当前浏览器插件后再次尝试。", - - String remark1 = "【0757f764-07b4-4d4d-a48d-e1e13b598a1f】任务失败,在【5-1清空银行卡】中第17行:出错:未找到元素, 元素名: 按钮_OK"; - String remark2 = "【9a92a414-e957-47f8-ada1-7296723769a9】任务失败,在【9-1优惠劵】中第7行:出错:未找到元素"; - String remark3 = "【60a92f00-f7cb-4321-aa0b-6f18814fb462】任务失败,在【3.切换国家】中第8行:出错:未找到元素"; - String remark4 = "【81f6c1ac-6493-40cf-83fd-867b1a39e3ca】任务失败,在【9-3添加银行卡】中第5行:出错:未找到元素, 元素名: SAVE CARD"; - String remark5 = "【e201a1b3-f0a1-42b9-8315-d6736eead5a4】任务失败,在【11.清空浏览器数据】中第1行:出错:操作无法执行!请重启当前浏览器 或 重装当前浏览器插件后再次尝试。"; - - List remarkList = new ArrayList<>(); - remarkList.add(remark1); - remarkList.add(remark2); - remarkList.add(remark3); - remarkList.add(remark4); - remarkList.add(remark5); - - for (String remark:remarkList) { - Integer status = analysisReturnJson(remark); - System.out.println("status:" + status); - } - } - - @Test - public void test22() { - String t = "3.切换国家".substring(0, "3.切换国家".indexOf(".")); - Integer modularInteger = Integer.valueOf(t); - System.out.println(modularInteger); - } - - - - @Test - public void jsonTest() { - int[] my = new int[5]; - my[0] = 0; - my[1] = 1; - my[2] = 2; - my[3] = 3; - my[4] = 4; - // 数组转为 JSONArray - JSONArray jsonArray = (JSONArray) JSONArray.toJSON(my); - System.out.println(jsonArray instanceof JSONArray); - System.out.println(jsonArray.getClass().isArray()); - System.out.println(jsonArray.toString()); - try { - JSONArray jsonObj = (JSONArray) JSONArray.toJSON(my);// 数组转为JsonArray - System.out.println(jsonObj instanceof JSONArray);// 是否是Json数组? - System.out.println(jsonObj.getClass().isArray());// 是否为数组? - String jsonStr = jsonObj.toString();// JsonArray转为String - System.out.println(jsonStr instanceof String);// 是否为String? - System.out.println(jsonStr); - } catch (Exception e) { - System.out.println("数组转json失败"); - } - } - - @Test - public void test222() { - List resultObjList = new ArrayList<>(); - for (int i = 0; i < 5; i++) { - ResultObj resultObj = new ResultObj(); - resultObj.setName("name-" + i); - resultObj.setType("str"); - resultObj.setValue("value-" + i); - resultObjList.add(resultObj); - } - - String paramsListStr = ((JSONArray) JSONArray.toJSON(resultObjList)).toString(); - System.out.println("paramsListStr:" + paramsListStr); - - System.out.println("==========================="); - Params paramsObj = new Params(); - paramsObj.setAccountName("accountName"); - paramsObj.setApplyId(1L); - paramsObj.setParams(resultObjList.toString()); - System.out.println("JSONUtil.toJsonStr(paramsObj):" + JSONUtil.toJsonStr(paramsObj)); - } - - @Test - public void ruleGetCtBuyer() { - String buyerAccount = "jhudsonyy@gmail.com"; - String country = "Korea"; - String shopName = "JXP Official Store"; - - // 获取所有成功的刷单信息买家 然后统计每个成功的个数并返回 同时剔除传过来的参数信息 - // TODO 先随机取一个好了。 后面有了规则 我们再按照规则处理 这里需要 保证获取的买家信息是没有被占用的 通过redis 再执行的时候 添加redis 信息 - List ctBuyerClickSuccessList = ctClickFarmingService.ruleGetCtBuyer(buyerAccount, country, shopName); - Random random = new Random(); - CtBuyerClickSuccess ctBuyerClickSuccess = ctBuyerClickSuccessList.get(random.nextInt(ctBuyerClickSuccessList.size())); - CtBuyerDetailVO ctBuyerDetailVO = ctBuyerService.getDetailById(ctBuyerClickSuccess.getBuyerId()); - } - - @Resource - private SettingSiteService settingSiteService; - - @Test - public void testSettingSite() { - String googleAuth = settingSiteService.getValue("googleAuth1"); - System.out.println(googleAuth); - } - - - @Resource - private RedisUtils redisUtils; - - @Test - public void getRuleCtBuyer() { - String buyerAccount = "jhudsonyy@gmail.com"; - String country = "Korea"; - String shopName = "JXP Official Store"; - Long clickFarmingId = 56L; - - // 获取所有成功的刷单信息买家 然后统计每个成功的个数并返回 同时剔除传过来的参数信息 - // TODO 这里不能无限制的取, 通过redis 根据 刷单id 设置取过的买家信息,取过的不再取了 - List ctBuyerClickSuccessList = ctClickFarmingService.ruleGetCtBuyer(buyerAccount, country, shopName); - - while (true) { - - String clickFarmingExecBuyerIdPrefix = PublicConstant.getClickFarmingExecBuyerIdPrefix(clickFarmingId); - Long setSize = redisUtils.sGetSetSize(clickFarmingExecBuyerIdPrefix); - Long buyerId = null; - if (setSize == 0) { - buyerId = ctBuyerClickSuccessList.get(new Random().nextInt(ctBuyerClickSuccessList.size())).getBuyerId(); - - } else { - for (CtBuyerClickSuccess ctBuyerClickSuccess : ctBuyerClickSuccessList) { - buyerId = ctBuyerClickSuccess.getBuyerId(); - if (redisUtils.sHasKey(clickFarmingExecBuyerIdPrefix, buyerId.toString())) { - continue; - } - break; - } - System.out.println("没有取到合适的========================================"); - } - System.out.println("==========取到的id:" + buyerId); - redisUtils.sSet(clickFarmingExecBuyerIdPrefix, buyerId.toString()); -// CtBuyerDetailVO ctBuyerDetailVO = ctBuyerService.getDetailById(buyerId); -// System.out.println("ctBuyerDetailVO:" + JSONUtil.toJsonStr(ctBuyerDetailVO)); - } - } - - - @Test - public void joinPath() { - String paths = "123,456,789,012"; - List pathList = Arrays.asList(paths.split(",")); - - String newPaths = pathList.stream().map(s -> s = "pathUrl/" + s).collect(Collectors.joining(",")); - System.out.println(JSONUtil.toJsonStr(pathList)); - System.out.println(newPaths); - } - - @Test - public void testFile() { - System.out.println(File.separator); - } -} diff --git a/wjcy-system/src/test/java/me/zhengjie/ExcelUserTest.java b/wjcy-system/src/test/java/me/zhengjie/ExcelUserTest.java deleted file mode 100644 index 0085394..0000000 --- a/wjcy-system/src/test/java/me/zhengjie/ExcelUserTest.java +++ /dev/null @@ -1,21 +0,0 @@ -package me.zhengjie; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * ExcelJson导入解析实体对象 - * - * @author rch - * @create 2022-06-23 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class ExcelUserTest { - /** 姓名 */ - private String name; - /** 年龄 */ - private Integer age; -} diff --git a/wjcy-system/src/test/java/me/zhengjie/SettingSiteServiceTest.java b/wjcy-system/src/test/java/me/zhengjie/SettingSiteServiceTest.java deleted file mode 100644 index 64c0227..0000000 --- a/wjcy-system/src/test/java/me/zhengjie/SettingSiteServiceTest.java +++ /dev/null @@ -1,48 +0,0 @@ -package me.zhengjie; - -import cn.hutool.json.JSONUtil; -import me.zhengjie.entity.CtBuyer; -import me.zhengjie.entity.CtSettingSite; -import me.zhengjie.entity.quartz.JobQueryByUuidReturn; -import me.zhengjie.modules.capital.controller.SettingSiteController; -import me.zhengjie.modules.quartz.service.QuartzJobService; -import me.zhengjie.service.CtBuyerService; -import me.zhengjie.service.SettingSiteService; -import me.zhengjie.service.YdQuartzService; -import org.apache.rocketmq.client.producer.TransactionMQProducer; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; -import java.util.ArrayList; -import java.util.List; - -/* - * - * @Description 运营设置 - * @Date 2021/11/30 - * @Author zeng - */ -@RunWith(SpringRunner.class) -@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) -public class SettingSiteServiceTest { - - @Resource - private CtBuyerService ctBuyerService; - @Test - public void batchAddCtBuyer() { - List ctBuyerServiceList = new ArrayList<>(); - for (int i = 0; i < 100; i++) { - CtBuyer ctBuyer = new CtBuyer(); - ctBuyer.setAccount("account-" + i); - ctBuyer.setNickName("nickName-" + i); - ctBuyer.setPwd("pwd-" + i); - - ctBuyerServiceList.add(ctBuyer); - } - - ctBuyerService.saveBatch(ctBuyerServiceList); - } -} diff --git a/wjcy-system/src/test/java/me/zhengjie/TransactionSignDemo.java b/wjcy-system/src/test/java/me/zhengjie/TransactionSignDemo.java deleted file mode 100644 index 79fe252..0000000 --- a/wjcy-system/src/test/java/me/zhengjie/TransactionSignDemo.java +++ /dev/null @@ -1,8 +0,0 @@ -package me.zhengjie;/** -

- -

-@author: rch -@date: 2021-10-27 -*/public class TransactionSignDemo { -} diff --git a/wjcy-tools/pom.xml b/wjcy-tools/pom.xml deleted file mode 100644 index b2498c9..0000000 --- a/wjcy-tools/pom.xml +++ /dev/null @@ -1,57 +0,0 @@ - - - - me.zhengjie - wjcy - 1.0 - - 4.0.0 - - wjcy-tools - 工具模块 - - - 1.4.7 - [7.2.0, 7.2.99] - 4.9.153.ALL - - - - - - me.zhengjie - wjcy-logging - 1.0 - - - - - javax.mail - mail - ${mail.version} - - - - - com.qiniu - qiniu-java-sdk - ${qiniu.version} - - - - - com.alipay.sdk - alipay-sdk-java - ${alipay.version} - - - - - com.xuxueli - xxl-job-core - 2.2.0 - - - \ No newline at end of file diff --git a/wjcy-tools/src/main/java/me/zhengjie/config/MultipartConfig.java b/wjcy-tools/src/main/java/me/zhengjie/config/MultipartConfig.java deleted file mode 100644 index 2700e22..0000000 --- a/wjcy-tools/src/main/java/me/zhengjie/config/MultipartConfig.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.config; - -import org.springframework.boot.web.servlet.MultipartConfigFactory; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import javax.servlet.MultipartConfigElement; -import java.io.File; - -/** - * @date 2018-12-28 - * @author https://blog.csdn.net/llibin1024530411/article/details/79474953 - */ -@Configuration -public class MultipartConfig { - - /** - * 文件上传临时路径 - */ - @Bean - MultipartConfigElement multipartConfigElement() { - MultipartConfigFactory factory = new MultipartConfigFactory(); - String location = System.getProperty("user.home") + "/.dy/file/tmp"; - File tmpFile = new File(location); - if (!tmpFile.exists()) { - if (!tmpFile.mkdirs()) { - System.out.println("create was not successful."); - } - } - factory.setLocation(location); - return factory.createMultipartConfig(); - } -} \ No newline at end of file diff --git a/wjcy-tools/src/main/java/me/zhengjie/domain/AlipayConfig.java b/wjcy-tools/src/main/java/me/zhengjie/domain/AlipayConfig.java deleted file mode 100644 index def695d..0000000 --- a/wjcy-tools/src/main/java/me/zhengjie/domain/AlipayConfig.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.domain; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import javax.persistence.*; -import javax.validation.constraints.NotBlank; -import java.io.Serializable; - -/** - * 支付宝配置类 - * @author Zheng Jie - * @date 2018-12-31 - */ -@Data -@Entity -@Table(name = "tool_alipay_config") -public class AlipayConfig implements Serializable { - - @Id - @Column(name = "config_id") - @ApiModelProperty(value = "ID", hidden = true) - private Long id; - - @NotBlank - @ApiModelProperty(value = "应用ID") - private String appId; - - @NotBlank - @ApiModelProperty(value = "商户私钥") - private String privateKey; - - @NotBlank - @ApiModelProperty(value = "支付宝公钥") - private String publicKey; - - @ApiModelProperty(value = "签名方式") - private String signType="RSA2"; - - @Column(name = "gateway_url") - @ApiModelProperty(value = "支付宝开放安全地址", hidden = true) - private String gatewayUrl = "https://openapi.alipaydev.com/gateway.do"; - - @ApiModelProperty(value = "编码", hidden = true) - private String charset= "utf-8"; - - @NotBlank - @ApiModelProperty(value = "异步通知地址") - private String notifyUrl; - - @NotBlank - @ApiModelProperty(value = "订单完成后返回的页面") - private String returnUrl; - - @ApiModelProperty(value = "类型") - private String format="JSON"; - - @NotBlank - @ApiModelProperty(value = "商户号") - private String sysServiceProviderId; - -} diff --git a/wjcy-tools/src/main/java/me/zhengjie/domain/EmailConfig.java b/wjcy-tools/src/main/java/me/zhengjie/domain/EmailConfig.java deleted file mode 100644 index b4fc1e6..0000000 --- a/wjcy-tools/src/main/java/me/zhengjie/domain/EmailConfig.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.domain; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import javax.persistence.*; -import javax.validation.constraints.NotBlank; -import java.io.Serializable; - -/** - * 邮件配置类,数据存覆盖式存入数据存 - * @author Zheng Jie - * @date 2018-12-26 - */ -@Entity -@Data -@Table(name = "tool_email_config") -public class EmailConfig implements Serializable { - - @Id - @Column(name = "config_id") - @ApiModelProperty(value = "ID", hidden = true) - private Long id; - - @NotBlank - @ApiModelProperty(value = "邮件服务器SMTP地址") - private String host; - - @NotBlank - @ApiModelProperty(value = "邮件服务器 SMTP 端口") - private String port; - - @NotBlank - @ApiModelProperty(value = "发件者用户名") - private String user; - - @NotBlank - @ApiModelProperty(value = "密码") - private String pass; - - @NotBlank - @ApiModelProperty(value = "收件人") - private String fromUser; -} diff --git a/wjcy-tools/src/main/java/me/zhengjie/domain/LocalStorage.java b/wjcy-tools/src/main/java/me/zhengjie/domain/LocalStorage.java deleted file mode 100644 index 59fd0ab..0000000 --- a/wjcy-tools/src/main/java/me/zhengjie/domain/LocalStorage.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.domain; - -import io.swagger.annotations.ApiModelProperty; -import lombok.*; -import cn.hutool.core.bean.BeanUtil; -import cn.hutool.core.bean.copier.CopyOptions; -import me.zhengjie.base.BaseEntity; -import javax.persistence.*; -import java.io.Serializable; - -/** -* @author Zheng Jie -* @date 2019-09-05 -*/ -@Getter -@Setter -@Entity -@Table(name="tool_local_storage") -@NoArgsConstructor -public class LocalStorage extends BaseEntity implements Serializable { - - @Id - @Column(name = "storage_id") - @ApiModelProperty(value = "ID", hidden = true) - @GeneratedValue(strategy = GenerationType.IDENTITY) - private Long id; - - @ApiModelProperty(value = "真实文件名") - private String realName; - - @ApiModelProperty(value = "文件名") - private String name; - - @ApiModelProperty(value = "后缀") - private String suffix; - - @ApiModelProperty(value = "路径") - private String path; - - @ApiModelProperty(value = "类型") - private String type; - - @ApiModelProperty(value = "大小") - private String size; - - public LocalStorage(String realName,String name, String suffix, String path, String type, String size) { - this.realName = realName; - this.name = name; - this.suffix = suffix; - this.path = path; - this.type = type; - this.size = size; - } - - public void copy(LocalStorage source){ - BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true)); - } -} \ No newline at end of file diff --git a/wjcy-tools/src/main/java/me/zhengjie/domain/QiniuConfig.java b/wjcy-tools/src/main/java/me/zhengjie/domain/QiniuConfig.java deleted file mode 100644 index 0247e67..0000000 --- a/wjcy-tools/src/main/java/me/zhengjie/domain/QiniuConfig.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.domain; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import javax.persistence.*; -import javax.validation.constraints.NotBlank; -import java.io.Serializable; - -/** - * 七牛云对象存储配置类 - * @author Zheng Jie - * @date 2018-12-31 - */ -@Data -@Entity -@Table(name = "tool_qiniu_config") -public class QiniuConfig implements Serializable { - - @Id - @Column(name = "config_id") - @ApiModelProperty(value = "ID") - private Long id; - - @NotBlank - @ApiModelProperty(value = "accessKey") - private String accessKey; - - @NotBlank - @ApiModelProperty(value = "secretKey") - private String secretKey; - - @NotBlank - @ApiModelProperty(value = "存储空间名称作为唯一的 Bucket 识别符") - private String bucket; - - /** - * Zone表示与机房的对应关系 - * 华东 Zone.zone0() - * 华北 Zone.zone1() - * 华南 Zone.zone2() - * 北美 Zone.zoneNa0() - * 东南亚 Zone.zoneAs0() - */ - @NotBlank - @ApiModelProperty(value = "Zone表示与机房的对应关系") - private String zone; - - @NotBlank - @ApiModelProperty(value = "外链域名,可自定义,需在七牛云绑定") - private String host; - - @ApiModelProperty(value = "空间类型:公开/私有") - private String type = "公开"; -} diff --git a/wjcy-tools/src/main/java/me/zhengjie/domain/QiniuContent.java b/wjcy-tools/src/main/java/me/zhengjie/domain/QiniuContent.java deleted file mode 100644 index db69a6a..0000000 --- a/wjcy-tools/src/main/java/me/zhengjie/domain/QiniuContent.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.domain; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import org.hibernate.annotations.UpdateTimestamp; -import javax.persistence.*; -import java.io.Serializable; -import java.sql.Timestamp; - -/** - * 上传成功后,存储结果 - * @author Zheng Jie - * @date 2018-12-31 - */ -@Data -@Entity -@Table(name = "tool_qiniu_content") -public class QiniuContent implements Serializable { - - @Id - @Column(name = "content_id") - @ApiModelProperty(value = "ID", hidden = true) - @GeneratedValue(strategy = GenerationType.IDENTITY) - private Long id; - - @Column(name = "name") - @ApiModelProperty(value = "文件名") - private String key; - - @ApiModelProperty(value = "空间名") - private String bucket; - - @ApiModelProperty(value = "大小") - private String size; - - @ApiModelProperty(value = "文件地址") - private String url; - - @ApiModelProperty(value = "文件类型") - private String suffix; - - @ApiModelProperty(value = "空间类型:公开/私有") - private String type = "公开"; - - @UpdateTimestamp - @ApiModelProperty(value = "创建或更新时间") - @Column(name = "update_time") - private Timestamp updateTime; -} diff --git a/wjcy-tools/src/main/java/me/zhengjie/domain/vo/EmailVo.java b/wjcy-tools/src/main/java/me/zhengjie/domain/vo/EmailVo.java deleted file mode 100644 index 1fb759f..0000000 --- a/wjcy-tools/src/main/java/me/zhengjie/domain/vo/EmailVo.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.domain.vo; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotEmpty; -import java.util.List; - -/** - * 发送邮件时,接收参数的类 - * @author 郑杰 - * @date 2018/09/28 12:02:14 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class EmailVo { - - /** 收件人,支持多个收件人 */ - @NotEmpty - private List tos; - - @NotBlank - private String subject; - - @NotBlank - private String content; -} diff --git a/wjcy-tools/src/main/java/me/zhengjie/domain/vo/TradeVo.java b/wjcy-tools/src/main/java/me/zhengjie/domain/vo/TradeVo.java deleted file mode 100644 index 01c1c2f..0000000 --- a/wjcy-tools/src/main/java/me/zhengjie/domain/vo/TradeVo.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.domain.vo; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import javax.validation.constraints.NotBlank; -import java.sql.Date; -import java.sql.Timestamp; - -/** - * 交易详情,按需应该存入数据库,这里存入数据库,仅供临时测试 - * @author Zheng Jie - * @date 2018-12-31 - */ -@Data -public class TradeVo { - - /** (必填)商品描述 */ - @NotBlank - private String body; - - /** (必填)商品名称 */ - @NotBlank - private String subject; - - /** (必填)商户订单号,应该由后台生成 */ - @ApiModelProperty(hidden = true) - private String outTradeNo; - - /** (必填)第三方订单号 */ - @ApiModelProperty(hidden = true) - private String tradeNo; - - /** (必填)价格 */ - @NotBlank - private String totalAmount; - - /** 订单状态,已支付,未支付,作废 */ - @ApiModelProperty(hidden = true) - private String state; - - /** 创建时间,存入数据库时需要 */ - @ApiModelProperty(hidden = true) - private Timestamp createTime; - - /** 作废时间,存入数据库时需要 */ - @ApiModelProperty(hidden = true) - private Date cancelTime; -} diff --git a/wjcy-tools/src/main/java/me/zhengjie/repository/AliPayRepository.java b/wjcy-tools/src/main/java/me/zhengjie/repository/AliPayRepository.java deleted file mode 100644 index 61183b4..0000000 --- a/wjcy-tools/src/main/java/me/zhengjie/repository/AliPayRepository.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.repository; - -import me.zhengjie.domain.AlipayConfig; -import org.springframework.data.jpa.repository.JpaRepository; - -/** - * @author Zheng Jie - * @date 2018-12-31 - */ -public interface AliPayRepository extends JpaRepository { -} diff --git a/wjcy-tools/src/main/java/me/zhengjie/repository/EmailRepository.java b/wjcy-tools/src/main/java/me/zhengjie/repository/EmailRepository.java deleted file mode 100644 index 7765602..0000000 --- a/wjcy-tools/src/main/java/me/zhengjie/repository/EmailRepository.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.repository; - -import me.zhengjie.domain.EmailConfig; -import org.springframework.data.jpa.repository.JpaRepository; - -/** - * @author Zheng Jie - * @date 2018-12-26 - */ -public interface EmailRepository extends JpaRepository { -} diff --git a/wjcy-tools/src/main/java/me/zhengjie/repository/LocalStorageRepository.java b/wjcy-tools/src/main/java/me/zhengjie/repository/LocalStorageRepository.java deleted file mode 100644 index 8c1e85a..0000000 --- a/wjcy-tools/src/main/java/me/zhengjie/repository/LocalStorageRepository.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.repository; - -import me.zhengjie.domain.LocalStorage; -import org.springframework.data.jpa.repository.JpaRepository; -import org.springframework.data.jpa.repository.JpaSpecificationExecutor; - -/** -* @author Zheng Jie -* @date 2019-09-05 -*/ -public interface LocalStorageRepository extends JpaRepository, JpaSpecificationExecutor { -} \ No newline at end of file diff --git a/wjcy-tools/src/main/java/me/zhengjie/repository/QiNiuConfigRepository.java b/wjcy-tools/src/main/java/me/zhengjie/repository/QiNiuConfigRepository.java deleted file mode 100644 index 9379f55..0000000 --- a/wjcy-tools/src/main/java/me/zhengjie/repository/QiNiuConfigRepository.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.repository; - -import me.zhengjie.domain.QiniuConfig; -import org.springframework.data.jpa.repository.JpaRepository; -import org.springframework.data.jpa.repository.Modifying; -import org.springframework.data.jpa.repository.Query; - -/** - * @author Zheng Jie - * @date 2018-12-31 - */ -public interface QiNiuConfigRepository extends JpaRepository { - - /** - * 编辑类型 - * @param type - */ - @Modifying - @Query(value = "update QiniuConfig set type = ?1") - void update(String type); -} diff --git a/wjcy-tools/src/main/java/me/zhengjie/repository/QiniuContentRepository.java b/wjcy-tools/src/main/java/me/zhengjie/repository/QiniuContentRepository.java deleted file mode 100644 index 55f813f..0000000 --- a/wjcy-tools/src/main/java/me/zhengjie/repository/QiniuContentRepository.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.repository; - -import me.zhengjie.domain.QiniuContent; -import org.springframework.data.jpa.repository.JpaRepository; -import org.springframework.data.jpa.repository.JpaSpecificationExecutor; - -/** - * @author Zheng Jie - * @date 2018-12-31 - */ -public interface QiniuContentRepository extends JpaRepository, JpaSpecificationExecutor { - - /** - * 根据key查询 - * @param key 文件名 - * @return QiniuContent - */ - QiniuContent findByKey(String key); -} diff --git a/wjcy-tools/src/main/java/me/zhengjie/rest/AliPayController.java b/wjcy-tools/src/main/java/me/zhengjie/rest/AliPayController.java deleted file mode 100644 index 128bb40..0000000 --- a/wjcy-tools/src/main/java/me/zhengjie/rest/AliPayController.java +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.rest; - -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import me.zhengjie.annotation.AnonymousAccess; -import me.zhengjie.annotation.Log; -import me.zhengjie.annotation.rest.AnonymousGetMapping; -import me.zhengjie.domain.vo.TradeVo; -import me.zhengjie.domain.AlipayConfig; -import me.zhengjie.utils.AliPayStatusEnum; -import me.zhengjie.utils.AlipayUtils; -import me.zhengjie.service.AliPayService; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import springfox.documentation.annotations.ApiIgnore; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.nio.charset.StandardCharsets; -import java.util.Map; - -/** - * @author Zheng Jie - * @date 2018-12-31 - */ -@Slf4j -@RestController -@RequiredArgsConstructor -@RequestMapping("/api/aliPay") -@Api(tags = "工具:支付宝管理") -public class AliPayController { - - private final AlipayUtils alipayUtils; - private final AliPayService alipayService; - - @GetMapping - public ResponseEntity queryConfig() { - return new ResponseEntity<>(alipayService.find(), HttpStatus.OK); - } - - @Log("配置支付宝") - @ApiOperation("配置支付宝") - @PutMapping - public ResponseEntity updateConfig(@Validated @RequestBody AlipayConfig alipayConfig) { - alipayService.config(alipayConfig); - return new ResponseEntity<>(HttpStatus.OK); - } - - @Log("支付宝PC网页支付") - @ApiOperation("PC网页支付") - @PostMapping(value = "/toPayAsPC") - public ResponseEntity toPayAsPc(@Validated @RequestBody TradeVo trade) throws Exception { - AlipayConfig aliPay = alipayService.find(); - trade.setOutTradeNo(alipayUtils.getOrderCode()); - String payUrl = alipayService.toPayAsPc(aliPay, trade); - return ResponseEntity.ok(payUrl); - } - - @Log("支付宝手机网页支付") - @ApiOperation("手机网页支付") - @PostMapping(value = "/toPayAsWeb") - public ResponseEntity toPayAsWeb(@Validated @RequestBody TradeVo trade) throws Exception { - AlipayConfig alipay = alipayService.find(); - trade.setOutTradeNo(alipayUtils.getOrderCode()); - String payUrl = alipayService.toPayAsWeb(alipay, trade); - return ResponseEntity.ok(payUrl); - } - - @ApiIgnore - @AnonymousGetMapping("/return") - @ApiOperation("支付之后跳转的链接") - public ResponseEntity returnPage(HttpServletRequest request, HttpServletResponse response) { - AlipayConfig alipay = alipayService.find(); - response.setContentType("text/html;charset=" + alipay.getCharset()); - //内容验签,防止黑客篡改参数 - if (alipayUtils.rsaCheck(request, alipay)) { - //商户订单号 - String outTradeNo = new String(request.getParameter("out_trade_no").getBytes(StandardCharsets.ISO_8859_1), StandardCharsets.UTF_8); - //支付宝交易号 - String tradeNo = new String(request.getParameter("trade_no").getBytes(StandardCharsets.ISO_8859_1), StandardCharsets.UTF_8); - System.out.println("商户订单号" + outTradeNo + " " + "第三方交易号" + tradeNo); - - // 根据业务需要返回数据,这里统一返回OK - return new ResponseEntity<>("payment successful", HttpStatus.OK); - } else { - // 根据业务需要返回数据 - return new ResponseEntity<>(HttpStatus.BAD_REQUEST); - } - } - - @ApiIgnore - @RequestMapping("/notify") - @AnonymousAccess - @ApiOperation("支付异步通知(要公网访问),接收异步通知,检查通知内容app_id、out_trade_no、total_amount是否与请求中的一致,根据trade_status进行后续业务处理") - public ResponseEntity notify(HttpServletRequest request) { - AlipayConfig alipay = alipayService.find(); - Map parameterMap = request.getParameterMap(); - //内容验签,防止黑客篡改参数 - if (alipayUtils.rsaCheck(request, alipay)) { - //交易状态 - String tradeStatus = new String(request.getParameter("trade_status").getBytes(StandardCharsets.ISO_8859_1), StandardCharsets.UTF_8); - // 商户订单号 - String outTradeNo = new String(request.getParameter("out_trade_no").getBytes(StandardCharsets.ISO_8859_1), StandardCharsets.UTF_8); - //支付宝交易号 - String tradeNo = new String(request.getParameter("trade_no").getBytes(StandardCharsets.ISO_8859_1), StandardCharsets.UTF_8); - //付款金额 - String totalAmount = new String(request.getParameter("total_amount").getBytes(StandardCharsets.ISO_8859_1), StandardCharsets.UTF_8); - //验证 - if (tradeStatus.equals(AliPayStatusEnum.SUCCESS.getValue()) || tradeStatus.equals(AliPayStatusEnum.FINISHED.getValue())) { - // 验证通过后应该根据业务需要处理订单 - } - return new ResponseEntity<>(HttpStatus.OK); - } - return new ResponseEntity<>(HttpStatus.BAD_REQUEST); - } -} diff --git a/wjcy-tools/src/main/java/me/zhengjie/rest/EmailController.java b/wjcy-tools/src/main/java/me/zhengjie/rest/EmailController.java deleted file mode 100644 index 974de99..0000000 --- a/wjcy-tools/src/main/java/me/zhengjie/rest/EmailController.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.rest; - -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import lombok.RequiredArgsConstructor; -import me.zhengjie.annotation.Log; -import me.zhengjie.domain.vo.EmailVo; -import me.zhengjie.domain.EmailConfig; -import me.zhengjie.service.EmailService; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; - -/** - * 发送邮件 - * @author 郑杰 - * @date 2018/09/28 6:55:53 - */ -@RestController -@RequiredArgsConstructor -@RequestMapping("api/email") -@Api(tags = "工具:邮件管理") -public class EmailController { - - private final EmailService emailService; - - @GetMapping - public ResponseEntity queryConfig(){ - return new ResponseEntity<>(emailService.find(),HttpStatus.OK); - } - - @Log("配置邮件") - @PutMapping - @ApiOperation("配置邮件") - public ResponseEntity updateConfig(@Validated @RequestBody EmailConfig emailConfig) throws Exception { - emailService.config(emailConfig,emailService.find()); - return new ResponseEntity<>(HttpStatus.OK); - } - - @Log("发送邮件") - @PostMapping - @ApiOperation("发送邮件") - public ResponseEntity sendEmail(@Validated @RequestBody EmailVo emailVo){ - emailService.send(emailVo,emailService.find()); - return new ResponseEntity<>(HttpStatus.OK); - } -} diff --git a/wjcy-tools/src/main/java/me/zhengjie/rest/LocalStorageController.java b/wjcy-tools/src/main/java/me/zhengjie/rest/LocalStorageController.java deleted file mode 100644 index 6d7083d..0000000 --- a/wjcy-tools/src/main/java/me/zhengjie/rest/LocalStorageController.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.rest; - -import lombok.RequiredArgsConstructor; -import me.zhengjie.annotation.Log; -import me.zhengjie.domain.LocalStorage; -import me.zhengjie.exception.BadRequestException; -import me.zhengjie.service.LocalStorageService; -import me.zhengjie.service.dto.LocalStorageQueryCriteria; -import me.zhengjie.utils.FileUtil; -import org.springframework.data.domain.Pageable; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import io.swagger.annotations.*; -import org.springframework.web.multipart.MultipartFile; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; - -/** -* @author Zheng Jie -* @date 2019-09-05 -*/ -@RestController -@RequiredArgsConstructor -@Api(tags = "工具:本地存储管理") -@RequestMapping("/api/localStorage") -public class LocalStorageController { - - private final LocalStorageService localStorageService; - - @ApiOperation("查询文件") - @GetMapping - @PreAuthorize("@el.check('storage:list')") - public ResponseEntity query(LocalStorageQueryCriteria criteria, Pageable pageable){ - return new ResponseEntity<>(localStorageService.queryAll(criteria,pageable),HttpStatus.OK); - } - - @ApiOperation("导出数据") - @GetMapping(value = "/download") - @PreAuthorize("@el.check('storage:list')") - public void download(HttpServletResponse response, LocalStorageQueryCriteria criteria) throws IOException { - localStorageService.download(localStorageService.queryAll(criteria), response); - } - - @ApiOperation("上传文件") - @PostMapping - @PreAuthorize("@el.check('storage:add')") - public ResponseEntity create(@RequestParam String name, @RequestParam("file") MultipartFile file){ - localStorageService.create(name, file); - return new ResponseEntity<>(HttpStatus.CREATED); - } - - @PostMapping("/pictures") - @ApiOperation("上传图片") - public ResponseEntity upload(@RequestParam MultipartFile file){ - // 判断文件是否为图片 - String suffix = FileUtil.getExtensionName(file.getOriginalFilename()); - if(!FileUtil.IMAGE.equals(FileUtil.getFileType(suffix))){ - throw new BadRequestException("只能上传图片"); - } - LocalStorage localStorage = localStorageService.create(null, file); - return new ResponseEntity<>(localStorage, HttpStatus.OK); - } - - @Log("修改文件") - @ApiOperation("修改文件") - @PutMapping - @PreAuthorize("@el.check('storage:edit')") - public ResponseEntity update(@Validated @RequestBody LocalStorage resources){ - localStorageService.update(resources); - return new ResponseEntity<>(HttpStatus.NO_CONTENT); - } - - @Log("删除文件") - @DeleteMapping - @ApiOperation("多选删除") - public ResponseEntity delete(@RequestBody Long[] ids) { - localStorageService.deleteAll(ids); - return new ResponseEntity<>(HttpStatus.OK); - } -} \ No newline at end of file diff --git a/wjcy-tools/src/main/java/me/zhengjie/rest/QiniuController.java b/wjcy-tools/src/main/java/me/zhengjie/rest/QiniuController.java deleted file mode 100644 index 1bb32d7..0000000 --- a/wjcy-tools/src/main/java/me/zhengjie/rest/QiniuController.java +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.rest; - -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import me.zhengjie.annotation.Log; -import me.zhengjie.domain.QiniuConfig; -import me.zhengjie.domain.QiniuContent; -import me.zhengjie.service.dto.QiniuQueryCriteria; -import me.zhengjie.service.QiNiuService; -import org.springframework.data.domain.Pageable; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; - -/** - * 发送邮件 - * @author 郑杰 - * @date 2018/09/28 6:55:53 - */ -@Slf4j -@RestController -@RequiredArgsConstructor -@RequestMapping("/api/qiNiuContent") -@Api(tags = "工具:七牛云存储管理") -public class QiniuController { - - private final QiNiuService qiNiuService; - - @GetMapping(value = "/config") - public ResponseEntity queryConfig(){ - return new ResponseEntity<>(qiNiuService.find(), HttpStatus.OK); - } - - @Log("配置七牛云存储") - @ApiOperation("配置七牛云存储") - @PutMapping(value = "/config") - public ResponseEntity updateConfig(@Validated @RequestBody QiniuConfig qiniuConfig){ - qiNiuService.config(qiniuConfig); - qiNiuService.update(qiniuConfig.getType()); - return new ResponseEntity<>(HttpStatus.OK); - } - - @ApiOperation("导出数据") - @GetMapping(value = "/download") - public void download(HttpServletResponse response, QiniuQueryCriteria criteria) throws IOException { - qiNiuService.downloadList(qiNiuService.queryAll(criteria), response); - } - - @ApiOperation("查询文件") - @GetMapping - public ResponseEntity query(QiniuQueryCriteria criteria, Pageable pageable){ - return new ResponseEntity<>(qiNiuService.queryAll(criteria,pageable),HttpStatus.OK); - } - - @Log("上传文件") - @ApiOperation("上传文件") - @PostMapping - public ResponseEntity upload(@RequestParam MultipartFile file){ - QiniuContent qiniuContent = qiNiuService.upload(file,qiNiuService.find()); - Map map = new HashMap<>(3); - map.put("id",qiniuContent.getId()); - map.put("errno",0); - map.put("data",new String[]{qiniuContent.getUrl()}); - return new ResponseEntity<>(map,HttpStatus.OK); - } - - @Log("同步七牛云数据") - @ApiOperation("同步七牛云数据") - @PostMapping(value = "/synchronize") - public ResponseEntity synchronize(){ - qiNiuService.synchronize(qiNiuService.find()); - return new ResponseEntity<>(HttpStatus.OK); - } - - @Log("下载文件") - @ApiOperation("下载文件") - @GetMapping(value = "/download/{id}") - public ResponseEntity download(@PathVariable Long id){ - Map map = new HashMap<>(1); - map.put("url", qiNiuService.download(qiNiuService.findByContentId(id),qiNiuService.find())); - return new ResponseEntity<>(map,HttpStatus.OK); - } - - @Log("删除文件") - @ApiOperation("删除文件") - @DeleteMapping(value = "/{id}") - public ResponseEntity delete(@PathVariable Long id){ - qiNiuService.delete(qiNiuService.findByContentId(id),qiNiuService.find()); - return new ResponseEntity<>(HttpStatus.OK); - } - - @Log("删除多张图片") - @ApiOperation("删除多张图片") - @DeleteMapping - public ResponseEntity deleteAll(@RequestBody Long[] ids) { - qiNiuService.deleteAll(ids, qiNiuService.find()); - return new ResponseEntity<>(HttpStatus.OK); - } -} diff --git a/wjcy-tools/src/main/java/me/zhengjie/service/AliPayService.java b/wjcy-tools/src/main/java/me/zhengjie/service/AliPayService.java deleted file mode 100644 index be19c90..0000000 --- a/wjcy-tools/src/main/java/me/zhengjie/service/AliPayService.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.service; - -import me.zhengjie.domain.vo.TradeVo; -import me.zhengjie.domain.AlipayConfig; - -/** - * @author Zheng Jie - * @date 2018-12-31 - */ -public interface AliPayService { - - /** - * 查询配置 - * @return AlipayConfig - */ - AlipayConfig find(); - - /** - * 更新配置 - * @param alipayConfig 支付宝配置 - * @return AlipayConfig - */ - AlipayConfig config(AlipayConfig alipayConfig); - - /** - * 处理来自PC的交易请求 - * @param alipay 支付宝配置 - * @param trade 交易详情 - * @return String - * @throws Exception 异常 - */ - String toPayAsPc(AlipayConfig alipay, TradeVo trade) throws Exception; - - /** - * 处理来自手机网页的交易请求 - * @param alipay 支付宝配置 - * @param trade 交易详情 - * @return String - * @throws Exception 异常 - */ - String toPayAsWeb(AlipayConfig alipay, TradeVo trade) throws Exception; -} diff --git a/wjcy-tools/src/main/java/me/zhengjie/service/EmailService.java b/wjcy-tools/src/main/java/me/zhengjie/service/EmailService.java deleted file mode 100644 index aabfcb0..0000000 --- a/wjcy-tools/src/main/java/me/zhengjie/service/EmailService.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.service; - -import me.zhengjie.domain.vo.EmailVo; -import me.zhengjie.domain.EmailConfig; - -/** - * @author Zheng Jie - * @date 2018-12-26 - */ -public interface EmailService { - - /** - * 更新邮件配置 - * @param emailConfig 邮箱配置 - * @param old / - * @return / - * @throws Exception / - */ - EmailConfig config(EmailConfig emailConfig, EmailConfig old) throws Exception; - - /** - * 查询配置 - * @return EmailConfig 邮件配置 - */ - EmailConfig find(); - - /** - * 发送邮件 - * @param emailVo 邮件发送的内容 - * @param emailConfig 邮件配置 - * @throws Exception / - */ - void send(EmailVo emailVo, EmailConfig emailConfig); -} diff --git a/wjcy-tools/src/main/java/me/zhengjie/service/LocalStorageService.java b/wjcy-tools/src/main/java/me/zhengjie/service/LocalStorageService.java deleted file mode 100644 index 6df0624..0000000 --- a/wjcy-tools/src/main/java/me/zhengjie/service/LocalStorageService.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.service; - -import me.zhengjie.domain.LocalStorage; -import me.zhengjie.service.dto.LocalStorageDto; -import me.zhengjie.service.dto.LocalStorageQueryCriteria; -import org.springframework.data.domain.Pageable; -import org.springframework.web.multipart.MultipartFile; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.List; - -/** -* @author Zheng Jie -* @date 2019-09-05 -*/ -public interface LocalStorageService { - - /** - * 分页查询 - * @param criteria 条件 - * @param pageable 分页参数 - * @return / - */ - Object queryAll(LocalStorageQueryCriteria criteria, Pageable pageable); - - /** - * 查询全部数据 - * @param criteria 条件 - * @return / - */ - List queryAll(LocalStorageQueryCriteria criteria); - - /** - * 根据ID查询 - * @param id / - * @return / - */ - LocalStorageDto findById(Long id); - - /** - * 上传 - * @param name 文件名称 - * @param file 文件 - * @return - */ - LocalStorage create(String name, MultipartFile file); - - /** - * 编辑 - * @param resources 文件信息 - */ - void update(LocalStorage resources); - - /** - * 多选删除 - * @param ids / - */ - void deleteAll(Long[] ids); - - /** - * 导出数据 - * @param localStorageDtos 待导出的数据 - * @param response / - * @throws IOException / - */ - void download(List localStorageDtos, HttpServletResponse response) throws IOException; -} \ No newline at end of file diff --git a/wjcy-tools/src/main/java/me/zhengjie/service/QiNiuService.java b/wjcy-tools/src/main/java/me/zhengjie/service/QiNiuService.java deleted file mode 100644 index 09dca6a..0000000 --- a/wjcy-tools/src/main/java/me/zhengjie/service/QiNiuService.java +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.service; - -import me.zhengjie.domain.QiniuConfig; -import me.zhengjie.domain.QiniuContent; -import me.zhengjie.service.dto.QiniuQueryCriteria; -import org.springframework.data.domain.Pageable; -import org.springframework.web.multipart.MultipartFile; - -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.List; - -/** - * @author Zheng Jie - * @date 2018-12-31 - */ -public interface QiNiuService { - - /** - * 查配置 - * @return QiniuConfig - */ - QiniuConfig find(); - - /** - * 修改配置 - * @param qiniuConfig 配置 - * @return QiniuConfig - */ - QiniuConfig config(QiniuConfig qiniuConfig); - - /** - * 分页查询 - * @param criteria 条件 - * @param pageable 分页参数 - * @return / - */ - Object queryAll(QiniuQueryCriteria criteria, Pageable pageable); - - /** - * 查询全部 - * @param criteria 条件 - * @return / - */ - List queryAll(QiniuQueryCriteria criteria); - - /** - * 上传文件 - * @param file 文件 - * @param qiniuConfig 配置 - * @return QiniuContent - */ - QiniuContent upload(MultipartFile file, QiniuConfig qiniuConfig); - - /** - * 查询文件 - * @param id 文件ID - * @return QiniuContent - */ - QiniuContent findByContentId(Long id); - - /** - * 下载文件 - * @param content 文件信息 - * @param config 配置 - * @return String - */ - String download(QiniuContent content, QiniuConfig config); - - /** - * 删除文件 - * @param content 文件 - * @param config 配置 - */ - void delete(QiniuContent content, QiniuConfig config); - - /** - * 同步数据 - * @param config 配置 - */ - void synchronize(QiniuConfig config); - - /** - * 删除文件 - * @param ids 文件ID数组 - * @param config 配置 - */ - void deleteAll(Long[] ids, QiniuConfig config); - - /** - * 更新数据 - * @param type 类型 - */ - void update(String type); - - /** - * 导出数据 - * @param queryAll / - * @param response / - * @throws IOException / - */ - void downloadList(List queryAll, HttpServletResponse response) throws IOException; -} diff --git a/wjcy-tools/src/main/java/me/zhengjie/service/dto/LocalStorageDto.java b/wjcy-tools/src/main/java/me/zhengjie/service/dto/LocalStorageDto.java deleted file mode 100644 index 14221c2..0000000 --- a/wjcy-tools/src/main/java/me/zhengjie/service/dto/LocalStorageDto.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.service.dto; - -import lombok.Getter; -import lombok.Setter; -import me.zhengjie.base.BaseDTO; -import java.io.Serializable; - -/** -* @author Zheng Jie -* @date 2019-09-05 -*/ -@Getter -@Setter -public class LocalStorageDto extends BaseDTO implements Serializable { - - private Long id; - - private String realName; - - private String name; - - private String suffix; - - private String type; - - private String size; -} \ No newline at end of file diff --git a/wjcy-tools/src/main/java/me/zhengjie/service/dto/LocalStorageQueryCriteria.java b/wjcy-tools/src/main/java/me/zhengjie/service/dto/LocalStorageQueryCriteria.java deleted file mode 100644 index bea1cc7..0000000 --- a/wjcy-tools/src/main/java/me/zhengjie/service/dto/LocalStorageQueryCriteria.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.service.dto; - -import lombok.Data; -import java.sql.Timestamp; -import java.util.List; - -import me.zhengjie.annotation.Query; - -/** -* @author Zheng Jie -* @date 2019-09-05 -*/ -@Data -public class LocalStorageQueryCriteria{ - - @Query(blurry = "name,suffix,type,createBy,size") - private String blurry; - - @Query(type = Query.Type.BETWEEN) - private List createTime; -} \ No newline at end of file diff --git a/wjcy-tools/src/main/java/me/zhengjie/service/dto/PictureQueryCriteria.java b/wjcy-tools/src/main/java/me/zhengjie/service/dto/PictureQueryCriteria.java deleted file mode 100644 index e7d4f1b..0000000 --- a/wjcy-tools/src/main/java/me/zhengjie/service/dto/PictureQueryCriteria.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.service.dto; - -import lombok.Data; -import me.zhengjie.annotation.Query; -import java.sql.Timestamp; -import java.util.List; - -/** - * sm.ms图床 - * - * @author Zheng Jie - * @date 2019-6-4 09:52:09 - */ -@Data -public class PictureQueryCriteria{ - - @Query(type = Query.Type.INNER_LIKE) - private String filename; - - @Query(type = Query.Type.INNER_LIKE) - private String username; - - @Query(type = Query.Type.BETWEEN) - private List createTime; -} diff --git a/wjcy-tools/src/main/java/me/zhengjie/service/dto/QiniuQueryCriteria.java b/wjcy-tools/src/main/java/me/zhengjie/service/dto/QiniuQueryCriteria.java deleted file mode 100644 index f5c2240..0000000 --- a/wjcy-tools/src/main/java/me/zhengjie/service/dto/QiniuQueryCriteria.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.service.dto; - -import lombok.Data; -import me.zhengjie.annotation.Query; - -import java.sql.Timestamp; -import java.util.List; - -/** - * @author Zheng Jie - * @date 2019-6-4 09:54:37 - */ -@Data -public class QiniuQueryCriteria{ - - @Query(type = Query.Type.INNER_LIKE) - private String key; - - @Query(type = Query.Type.BETWEEN) - private List createTime; -} diff --git a/wjcy-tools/src/main/java/me/zhengjie/service/impl/AliPayServiceImpl.java b/wjcy-tools/src/main/java/me/zhengjie/service/impl/AliPayServiceImpl.java deleted file mode 100644 index 0625ba4..0000000 --- a/wjcy-tools/src/main/java/me/zhengjie/service/impl/AliPayServiceImpl.java +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.service.impl; - -import com.alipay.api.AlipayClient; -import com.alipay.api.DefaultAlipayClient; -import com.alipay.api.request.AlipayTradePagePayRequest; -import com.alipay.api.request.AlipayTradeWapPayRequest; -import lombok.RequiredArgsConstructor; -import me.zhengjie.domain.vo.TradeVo; -import me.zhengjie.domain.AlipayConfig; -import me.zhengjie.exception.BadRequestException; -import me.zhengjie.repository.AliPayRepository; -import me.zhengjie.service.AliPayService; -import org.springframework.cache.annotation.CacheConfig; -import org.springframework.cache.annotation.CachePut; -import org.springframework.cache.annotation.Cacheable; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import java.util.Optional; - -/** - * @author Zheng Jie - * @date 2018-12-31 - */ -@Service -@RequiredArgsConstructor -@CacheConfig(cacheNames = "aliPay") -public class AliPayServiceImpl implements AliPayService { - - private final AliPayRepository alipayRepository; - - @Override - @Cacheable(key = "'config'") - public AlipayConfig find() { - Optional alipayConfig = alipayRepository.findById(1L); - return alipayConfig.orElseGet(AlipayConfig::new); - } - - @Override - @CachePut(key = "'config'") - @Transactional(rollbackFor = Exception.class) - public AlipayConfig config(AlipayConfig alipayConfig) { - alipayConfig.setId(1L); - return alipayRepository.save(alipayConfig); - } - - @Override - public String toPayAsPc(AlipayConfig alipay, TradeVo trade) throws Exception { - - if(alipay.getId() == null){ - throw new BadRequestException("请先添加相应配置,再操作"); - } - AlipayClient alipayClient = new DefaultAlipayClient(alipay.getGatewayUrl(), alipay.getAppId(), alipay.getPrivateKey(), alipay.getFormat(), alipay.getCharset(), alipay.getPublicKey(), alipay.getSignType()); - - // 创建API对应的request(电脑网页版) - AlipayTradePagePayRequest request = new AlipayTradePagePayRequest(); - - // 订单完成后返回的页面和异步通知地址 - request.setReturnUrl(alipay.getReturnUrl()); - request.setNotifyUrl(alipay.getNotifyUrl()); - // 填充订单参数 - request.setBizContent("{" + - " \"out_trade_no\":\""+trade.getOutTradeNo()+"\"," + - " \"product_code\":\"FAST_INSTANT_TRADE_PAY\"," + - " \"total_amount\":"+trade.getTotalAmount()+"," + - " \"subject\":\""+trade.getSubject()+"\"," + - " \"body\":\""+trade.getBody()+"\"," + - " \"extend_params\":{" + - " \"sys_service_provider_id\":\""+alipay.getSysServiceProviderId()+"\"" + - " }"+ - " }");//填充业务参数 - // 调用SDK生成表单, 通过GET方式,口可以获取url - return alipayClient.pageExecute(request, "GET").getBody(); - - } - - @Override - public String toPayAsWeb(AlipayConfig alipay, TradeVo trade) throws Exception { - if(alipay.getId() == null){ - throw new BadRequestException("请先添加相应配置,再操作"); - } - AlipayClient alipayClient = new DefaultAlipayClient(alipay.getGatewayUrl(), alipay.getAppId(), alipay.getPrivateKey(), alipay.getFormat(), alipay.getCharset(), alipay.getPublicKey(), alipay.getSignType()); - - double money = Double.parseDouble(trade.getTotalAmount()); - double maxMoney = 5000; - if(money <= 0 || money >= maxMoney){ - throw new BadRequestException("测试金额过大"); - } - // 创建API对应的request(手机网页版) - AlipayTradeWapPayRequest request = new AlipayTradeWapPayRequest(); - request.setReturnUrl(alipay.getReturnUrl()); - request.setNotifyUrl(alipay.getNotifyUrl()); - request.setBizContent("{" + - " \"out_trade_no\":\""+trade.getOutTradeNo()+"\"," + - " \"product_code\":\"FAST_INSTANT_TRADE_PAY\"," + - " \"total_amount\":"+trade.getTotalAmount()+"," + - " \"subject\":\""+trade.getSubject()+"\"," + - " \"body\":\""+trade.getBody()+"\"," + - " \"extend_params\":{" + - " \"sys_service_provider_id\":\""+alipay.getSysServiceProviderId()+"\"" + - " }"+ - " }"); - return alipayClient.pageExecute(request, "GET").getBody(); - } -} diff --git a/wjcy-tools/src/main/java/me/zhengjie/service/impl/EmailServiceImpl.java b/wjcy-tools/src/main/java/me/zhengjie/service/impl/EmailServiceImpl.java deleted file mode 100644 index c98c76e..0000000 --- a/wjcy-tools/src/main/java/me/zhengjie/service/impl/EmailServiceImpl.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.service.impl; - -import cn.hutool.extra.mail.Mail; -import cn.hutool.extra.mail.MailAccount; -import lombok.RequiredArgsConstructor; -import me.zhengjie.domain.EmailConfig; -import me.zhengjie.domain.vo.EmailVo; -import me.zhengjie.exception.BadRequestException; -import me.zhengjie.repository.EmailRepository; -import me.zhengjie.service.EmailService; -import me.zhengjie.utils.EncryptUtils; -import org.springframework.cache.annotation.CacheConfig; -import org.springframework.cache.annotation.CachePut; -import org.springframework.cache.annotation.Cacheable; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import java.util.Optional; - -/** - * @author Zheng Jie - * @date 2018-12-26 - */ -@Service -@RequiredArgsConstructor -@CacheConfig(cacheNames = "email") -public class EmailServiceImpl implements EmailService { - - private final EmailRepository emailRepository; - - @Override - @CachePut(key = "'config'") - @Transactional(rollbackFor = Exception.class) - public EmailConfig config(EmailConfig emailConfig, EmailConfig old) throws Exception { - emailConfig.setId(1L); - if(!emailConfig.getPass().equals(old.getPass())){ - // 对称加密 - emailConfig.setPass(EncryptUtils.desEncrypt(emailConfig.getPass())); - } - return emailRepository.save(emailConfig); - } - - @Override - @Cacheable(key = "'config'") - public EmailConfig find() { - Optional emailConfig = emailRepository.findById(1L); - return emailConfig.orElseGet(EmailConfig::new); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void send(EmailVo emailVo, EmailConfig emailConfig){ - if(emailConfig.getId() == null){ - throw new BadRequestException("请先配置,再操作"); - } - // 封装 - MailAccount account = new MailAccount(); - // 设置用户 - String user = emailConfig.getFromUser().split("@")[0]; - account.setUser(user); - account.setHost(emailConfig.getHost()); - account.setPort(Integer.parseInt(emailConfig.getPort())); - account.setAuth(true); - try { - // 对称解密 - account.setPass(EncryptUtils.desDecrypt(emailConfig.getPass())); - } catch (Exception e) { - throw new BadRequestException(e.getMessage()); - } - account.setFrom(emailConfig.getUser()+"<"+emailConfig.getFromUser()+">"); - // ssl方式发送 - account.setSslEnable(true); - // 使用STARTTLS安全连接 - account.setStarttlsEnable(true); - String content = emailVo.getContent(); - // 发送 - try { - int size = emailVo.getTos().size(); - Mail.create(account) - .setTos(emailVo.getTos().toArray(new String[size])) - .setTitle(emailVo.getSubject()) - .setContent(content) - .setHtml(true) - //关闭session - .setUseGlobalSession(false) - .send(); - }catch (Exception e){ - throw new BadRequestException(e.getMessage()); - } - } -} diff --git a/wjcy-tools/src/main/java/me/zhengjie/service/impl/LocalStorageServiceImpl.java b/wjcy-tools/src/main/java/me/zhengjie/service/impl/LocalStorageServiceImpl.java deleted file mode 100644 index 77174c4..0000000 --- a/wjcy-tools/src/main/java/me/zhengjie/service/impl/LocalStorageServiceImpl.java +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.service.impl; - -import cn.hutool.core.util.ObjectUtil; -import lombok.RequiredArgsConstructor; -import me.zhengjie.config.FileProperties; -import me.zhengjie.domain.LocalStorage; -import me.zhengjie.service.dto.LocalStorageDto; -import me.zhengjie.service.dto.LocalStorageQueryCriteria; -import me.zhengjie.service.mapstruct.LocalStorageMapper; -import me.zhengjie.exception.BadRequestException; -import me.zhengjie.utils.*; -import me.zhengjie.repository.LocalStorageRepository; -import me.zhengjie.service.LocalStorageService; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import java.io.File; -import java.io.IOException; -import java.util.ArrayList; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import org.springframework.data.domain.Page; -import org.springframework.data.domain.Pageable; -import org.springframework.web.multipart.MultipartFile; -import javax.servlet.http.HttpServletResponse; - -/** -* @author Zheng Jie -* @date 2019-09-05 -*/ -@Service -@RequiredArgsConstructor -public class LocalStorageServiceImpl implements LocalStorageService { - - private final LocalStorageRepository localStorageRepository; - private final LocalStorageMapper localStorageMapper; - private final FileProperties properties; - - @Override - public Object queryAll(LocalStorageQueryCriteria criteria, Pageable pageable){ - Page page = localStorageRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable); - return PageUtil.toPage(page.map(localStorageMapper::toDto)); - } - - @Override - public List queryAll(LocalStorageQueryCriteria criteria){ - return localStorageMapper.toDto(localStorageRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder))); - } - - @Override - public LocalStorageDto findById(Long id){ - LocalStorage localStorage = localStorageRepository.findById(id).orElseGet(LocalStorage::new); - ValidationUtil.isNull(localStorage.getId(),"LocalStorage","id",id); - return localStorageMapper.toDto(localStorage); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public LocalStorage create(String name, MultipartFile multipartFile) { - FileUtil.checkSize(properties.getMaxSize(), multipartFile.getSize()); - String suffix = FileUtil.getExtensionName(multipartFile.getOriginalFilename()); - String type = FileUtil.getFileType(suffix); - File file = FileUtil.upload(multipartFile, properties.getPath().getPath() + type + File.separator); - if(ObjectUtil.isNull(file)){ - throw new BadRequestException("上传失败"); - } - try { - name = StringUtils.isBlank(name) ? FileUtil.getFileNameNoEx(multipartFile.getOriginalFilename()) : name; - LocalStorage localStorage = new LocalStorage( - file.getName(), - name, - suffix, - file.getPath(), - type, - FileUtil.getSize(multipartFile.getSize()) - ); - return localStorageRepository.save(localStorage); - }catch (Exception e){ - FileUtil.del(file); - throw e; - } - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void update(LocalStorage resources) { - LocalStorage localStorage = localStorageRepository.findById(resources.getId()).orElseGet(LocalStorage::new); - ValidationUtil.isNull( localStorage.getId(),"LocalStorage","id",resources.getId()); - localStorage.copy(resources); - localStorageRepository.save(localStorage); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void deleteAll(Long[] ids) { - for (Long id : ids) { - LocalStorage storage = localStorageRepository.findById(id).orElseGet(LocalStorage::new); - FileUtil.del(storage.getPath()); - localStorageRepository.delete(storage); - } - } - - @Override - public void download(List queryAll, HttpServletResponse response) throws IOException { - List> list = new ArrayList<>(); - for (LocalStorageDto localStorageDTO : queryAll) { - Map map = new LinkedHashMap<>(); - map.put("文件名", localStorageDTO.getRealName()); - map.put("备注名", localStorageDTO.getName()); - map.put("文件类型", localStorageDTO.getType()); - map.put("文件大小", localStorageDTO.getSize()); - map.put("创建者", localStorageDTO.getCreateBy()); - map.put("创建日期", localStorageDTO.getCreateTime()); - list.add(map); - } - FileUtil.downloadExcel(list, response); - } -} diff --git a/wjcy-tools/src/main/java/me/zhengjie/service/impl/QiNiuServiceImpl.java b/wjcy-tools/src/main/java/me/zhengjie/service/impl/QiNiuServiceImpl.java deleted file mode 100644 index 942f437..0000000 --- a/wjcy-tools/src/main/java/me/zhengjie/service/impl/QiNiuServiceImpl.java +++ /dev/null @@ -1,237 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.service.impl; - -import com.alibaba.fastjson.JSON; -import com.qiniu.common.QiniuException; -import com.qiniu.http.Response; -import com.qiniu.storage.BucketManager; -import com.qiniu.storage.Configuration; -import com.qiniu.storage.UploadManager; -import com.qiniu.storage.model.DefaultPutRet; -import com.qiniu.storage.model.FileInfo; -import com.qiniu.util.Auth; -import lombok.RequiredArgsConstructor; -import me.zhengjie.domain.QiniuConfig; -import me.zhengjie.domain.QiniuContent; -import me.zhengjie.repository.QiniuContentRepository; -import me.zhengjie.service.dto.QiniuQueryCriteria; -import me.zhengjie.utils.QiNiuUtil; -import me.zhengjie.exception.BadRequestException; -import me.zhengjie.repository.QiNiuConfigRepository; -import me.zhengjie.service.QiNiuService; -import me.zhengjie.utils.FileUtil; -import me.zhengjie.utils.PageUtil; -import me.zhengjie.utils.QueryHelp; -import me.zhengjie.utils.ValidationUtil; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.cache.annotation.CacheConfig; -import org.springframework.cache.annotation.CachePut; -import org.springframework.cache.annotation.Cacheable; -import org.springframework.data.domain.Pageable; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.web.multipart.MultipartFile; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.*; - -/** - * @author Zheng Jie - * @date 2018-12-31 - */ -@Service -@RequiredArgsConstructor -@CacheConfig(cacheNames = "qiNiu") -public class QiNiuServiceImpl implements QiNiuService { - - private final QiNiuConfigRepository qiNiuConfigRepository; - private final QiniuContentRepository qiniuContentRepository; - - @Value("${qiniu.max-size}") - private Long maxSize; - - @Override - @Cacheable(key = "'config'") - public QiniuConfig find() { - Optional qiniuConfig = qiNiuConfigRepository.findById(1L); - return qiniuConfig.orElseGet(QiniuConfig::new); - } - - @Override - @CachePut(key = "'config'") - @Transactional(rollbackFor = Exception.class) - public QiniuConfig config(QiniuConfig qiniuConfig) { - qiniuConfig.setId(1L); - String http = "http://", https = "https://"; - if (!(qiniuConfig.getHost().toLowerCase().startsWith(http)||qiniuConfig.getHost().toLowerCase().startsWith(https))) { - throw new BadRequestException("外链域名必须以http://或者https://开头"); - } - return qiNiuConfigRepository.save(qiniuConfig); - } - - @Override - public Object queryAll(QiniuQueryCriteria criteria, Pageable pageable){ - return PageUtil.toPage(qiniuContentRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable)); - } - - @Override - public List queryAll(QiniuQueryCriteria criteria) { - return qiniuContentRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder)); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public QiniuContent upload(MultipartFile file, QiniuConfig qiniuConfig) { - FileUtil.checkSize(maxSize, file.getSize()); - if(qiniuConfig.getId() == null){ - throw new BadRequestException("请先添加相应配置,再操作"); - } - // 构造一个带指定Zone对象的配置类 - Configuration cfg = new Configuration(QiNiuUtil.getRegion(qiniuConfig.getZone())); - UploadManager uploadManager = new UploadManager(cfg); - Auth auth = Auth.create(qiniuConfig.getAccessKey(), qiniuConfig.getSecretKey()); - String upToken = auth.uploadToken(qiniuConfig.getBucket()); - try { - String key = file.getOriginalFilename(); - if(qiniuContentRepository.findByKey(key) != null) { - key = QiNiuUtil.getKey(key); - } - Response response = uploadManager.put(file.getBytes(), key, upToken); - //解析上传成功的结果 - - DefaultPutRet putRet = JSON.parseObject(response.bodyString(), DefaultPutRet.class); - QiniuContent content = qiniuContentRepository.findByKey(FileUtil.getFileNameNoEx(putRet.key)); - if(content == null){ - //存入数据库 - QiniuContent qiniuContent = new QiniuContent(); - qiniuContent.setSuffix(FileUtil.getExtensionName(putRet.key)); - qiniuContent.setBucket(qiniuConfig.getBucket()); - qiniuContent.setType(qiniuConfig.getType()); - qiniuContent.setKey(FileUtil.getFileNameNoEx(putRet.key)); - qiniuContent.setUrl(qiniuConfig.getHost()+"/"+putRet.key); - qiniuContent.setSize(FileUtil.getSize(Integer.parseInt(file.getSize()+""))); - return qiniuContentRepository.save(qiniuContent); - } - return content; - } catch (Exception e) { - throw new BadRequestException(e.getMessage()); - } - } - - @Override - public QiniuContent findByContentId(Long id) { - QiniuContent qiniuContent = qiniuContentRepository.findById(id).orElseGet(QiniuContent::new); - ValidationUtil.isNull(qiniuContent.getId(),"QiniuContent", "id",id); - return qiniuContent; - } - - @Override - public String download(QiniuContent content,QiniuConfig config){ - String finalUrl; - String type = "公开"; - if(type.equals(content.getType())){ - finalUrl = content.getUrl(); - } else { - Auth auth = Auth.create(config.getAccessKey(), config.getSecretKey()); - // 1小时,可以自定义链接过期时间 - long expireInSeconds = 3600; - finalUrl = auth.privateDownloadUrl(content.getUrl(), expireInSeconds); - } - return finalUrl; - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void delete(QiniuContent content, QiniuConfig config) { - //构造一个带指定Zone对象的配置类 - Configuration cfg = new Configuration(QiNiuUtil.getRegion(config.getZone())); - Auth auth = Auth.create(config.getAccessKey(), config.getSecretKey()); - BucketManager bucketManager = new BucketManager(auth, cfg); - try { - bucketManager.delete(content.getBucket(), content.getKey() + "." + content.getSuffix()); - qiniuContentRepository.delete(content); - } catch (QiniuException ex) { - qiniuContentRepository.delete(content); - } - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void synchronize(QiniuConfig config) { - if(config.getId() == null){ - throw new BadRequestException("请先添加相应配置,再操作"); - } - //构造一个带指定Zone对象的配置类 - Configuration cfg = new Configuration(QiNiuUtil.getRegion(config.getZone())); - Auth auth = Auth.create(config.getAccessKey(), config.getSecretKey()); - BucketManager bucketManager = new BucketManager(auth, cfg); - //文件名前缀 - String prefix = ""; - //每次迭代的长度限制,最大1000,推荐值 1000 - int limit = 1000; - //指定目录分隔符,列出所有公共前缀(模拟列出目录效果)。缺省值为空字符串 - String delimiter = ""; - //列举空间文件列表 - BucketManager.FileListIterator fileListIterator = bucketManager.createFileListIterator(config.getBucket(), prefix, limit, delimiter); - while (fileListIterator.hasNext()) { - //处理获取的file list结果 - QiniuContent qiniuContent; - FileInfo[] items = fileListIterator.next(); - for (FileInfo item : items) { - if(qiniuContentRepository.findByKey(FileUtil.getFileNameNoEx(item.key)) == null){ - qiniuContent = new QiniuContent(); - qiniuContent.setSize(FileUtil.getSize(Integer.parseInt(item.fsize+""))); - qiniuContent.setSuffix(FileUtil.getExtensionName(item.key)); - qiniuContent.setKey(FileUtil.getFileNameNoEx(item.key)); - qiniuContent.setType(config.getType()); - qiniuContent.setBucket(config.getBucket()); - qiniuContent.setUrl(config.getHost()+"/"+item.key); - qiniuContentRepository.save(qiniuContent); - } - } - } - } - - @Override - public void deleteAll(Long[] ids, QiniuConfig config) { - for (Long id : ids) { - delete(findByContentId(id), config); - } - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void update(String type) { - qiNiuConfigRepository.update(type); - } - - @Override - public void downloadList(List queryAll, HttpServletResponse response) throws IOException { - List> list = new ArrayList<>(); - for (QiniuContent content : queryAll) { - Map map = new LinkedHashMap<>(); - map.put("文件名", content.getKey()); - map.put("文件类型", content.getSuffix()); - map.put("空间名称", content.getBucket()); - map.put("文件大小", content.getSize()); - map.put("空间类型", content.getType()); - map.put("创建日期", content.getUpdateTime()); - list.add(map); - } - FileUtil.downloadExcel(list, response); - } -} diff --git a/wjcy-tools/src/main/java/me/zhengjie/service/mapstruct/LocalStorageMapper.java b/wjcy-tools/src/main/java/me/zhengjie/service/mapstruct/LocalStorageMapper.java deleted file mode 100644 index 4c6d955..0000000 --- a/wjcy-tools/src/main/java/me/zhengjie/service/mapstruct/LocalStorageMapper.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.service.mapstruct; - -import me.zhengjie.base.BaseMapper; -import me.zhengjie.service.dto.LocalStorageDto; -import me.zhengjie.domain.LocalStorage; -import org.mapstruct.Mapper; -import org.mapstruct.ReportingPolicy; - -/** -* @author Zheng Jie -* @date 2019-09-05 -*/ -@Mapper(componentModel = "spring",unmappedTargetPolicy = ReportingPolicy.IGNORE) -public interface LocalStorageMapper extends BaseMapper { - -} \ No newline at end of file diff --git a/wjcy-tools/src/main/java/me/zhengjie/utils/AliPayStatusEnum.java b/wjcy-tools/src/main/java/me/zhengjie/utils/AliPayStatusEnum.java deleted file mode 100644 index c114fd1..0000000 --- a/wjcy-tools/src/main/java/me/zhengjie/utils/AliPayStatusEnum.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.utils; - -/** - * 支付状态 - * @author zhengjie - * @date 2018/08/01 16:45:43 - */ -public enum AliPayStatusEnum { - - /** 交易成功 */ - FINISHED("TRADE_FINISHED"), - - /** 支付成功 */ - SUCCESS("TRADE_SUCCESS"), - - /** 交易创建 */ - BUYER_PAY("WAIT_BUYER_PAY"), - - /** 交易关闭 */ - CLOSED("TRADE_CLOSED"); - - private final String value; - - AliPayStatusEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } -} diff --git a/wjcy-tools/src/main/java/me/zhengjie/utils/AlipayUtils.java b/wjcy-tools/src/main/java/me/zhengjie/utils/AlipayUtils.java deleted file mode 100644 index 203f7db..0000000 --- a/wjcy-tools/src/main/java/me/zhengjie/utils/AlipayUtils.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.utils; - -import com.alipay.api.AlipayApiException; -import com.alipay.api.internal.util.AlipaySignature; -import me.zhengjie.domain.AlipayConfig; -import org.springframework.stereotype.Component; -import javax.servlet.http.HttpServletRequest; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.HashMap; -import java.util.Map; - -/** - * 支付宝工具类 - * @author zhengjie - * @date 2018/09/30 14:04:35 - */ -@Component -public class AlipayUtils { - - /** - * 生成订单号 - * @return String - */ - public String getOrderCode() { - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - int a = (int)(Math.random() * 9000.0D) + 1000; - System.out.println(a); - Date date = new Date(); - String str = sdf.format(date); - String[] split = str.split("-"); - String s = split[0] + split[1] + split[2]; - String[] split1 = s.split(" "); - String s1 = split1[0] + split1[1]; - String[] split2 = s1.split(":"); - return split2[0] + split2[1] + split2[2] + a; - } - - /** - * 校验签名 - * @param request HttpServletRequest - * @param alipay 阿里云配置 - * @return boolean - */ - public boolean rsaCheck(HttpServletRequest request, AlipayConfig alipay){ - - // 获取支付宝POST过来反馈信息 - Map params = new HashMap<>(1); - Map requestParams = request.getParameterMap(); - for (Object o : requestParams.keySet()) { - String name = (String) o; - String[] values = requestParams.get(name); - String valueStr = ""; - for (int i = 0; i < values.length; i++) { - valueStr = (i == values.length - 1) ? valueStr + values[i] - : valueStr + values[i] + ","; - } - params.put(name, valueStr); - } - - try { - return AlipaySignature.rsaCheckV1(params, - alipay.getPublicKey(), - alipay.getCharset(), - alipay.getSignType()); - } catch (AlipayApiException e) { - return false; - } - } -} diff --git a/wjcy-tools/src/main/java/me/zhengjie/utils/QiNiuUtil.java b/wjcy-tools/src/main/java/me/zhengjie/utils/QiNiuUtil.java deleted file mode 100644 index 8091a95..0000000 --- a/wjcy-tools/src/main/java/me/zhengjie/utils/QiNiuUtil.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * 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 me.zhengjie.utils; - -import com.qiniu.storage.Region; -import java.text.SimpleDateFormat; -import java.util.Date; - -/** - * 七牛云存储工具类 - * @author Zheng Jie - * @date 2018-12-31 - */ -public class QiNiuUtil { - - private static final String HUAD = "华东"; - - private static final String HUAB = "华北"; - - private static final String HUAN = "华南"; - - private static final String BEIM = "北美"; - - /** - * 得到机房的对应关系 - * @param zone 机房名称 - * @return Region - */ - public static Region getRegion(String zone){ - - if(HUAD.equals(zone)){ - return Region.huadong(); - } else if(HUAB.equals(zone)){ - return Region.huabei(); - } else if(HUAN.equals(zone)){ - return Region.huanan(); - } else if (BEIM.equals(zone)){ - return Region.beimei(); - // 否则就是东南亚 - } else { - return Region.qvmHuadong(); - } - } - - /** - * 默认不指定key的情况下,以文件内容的hash值作为文件名 - * @param file 文件名 - * @return String - */ - public static String getKey(String file){ - SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss"); - Date date = new Date(); - return FileUtil.getFileNameNoEx(file) + "-" + - sdf.format(date) + - "." + - FileUtil.getExtensionName(file); - } -} diff --git a/wjcy-tools/src/main/java/me/zhengjie/utils/RSACoderUtil.java b/wjcy-tools/src/main/java/me/zhengjie/utils/RSACoderUtil.java deleted file mode 100644 index 12fb60f..0000000 --- a/wjcy-tools/src/main/java/me/zhengjie/utils/RSACoderUtil.java +++ /dev/null @@ -1,234 +0,0 @@ -package me.zhengjie.utils; - -import org.apache.commons.codec.binary.Base64; - -import javax.crypto.Cipher; -import java.security.*; -import java.security.interfaces.RSAPrivateKey; -import java.security.interfaces.RSAPublicKey; -import java.security.spec.PKCS8EncodedKeySpec; -import java.security.spec.X509EncodedKeySpec; -import java.util.HashMap; -import java.util.Map; - -/** - *

- * 非对称加密算法RSA算法组件 - * 非对称算法一般是用来传送对称加密算法的密钥来使用的,相对于DH算法,RSA算法只需要一方构造密钥,不需要 - * 大费周章的构造各自本地的密钥对了。DH算法只能算法非对称算法的底层实现。而RSA算法算法实现起来较为简单 - *

- * - * @author: rch - * @date: 2021-09-25 - */ -public class RSACoderUtil { - //非对称密钥算法 - public static final String KEY_ALGORITHM = "RSA"; - - - /** - * 密钥长度,DH算法的默认密钥长度是1024 - * 密钥长度必须是64的倍数,在512到65536位之间 - */ - private static final int KEY_SIZE = 512; - //公钥 - private static final String PUBLIC_KEY = "RSAPublicKey"; - - //私钥 - private static final String PRIVATE_KEY = "RSAPrivateKey"; - - /** - * 初始化密钥对 - * - * @return Map 甲方密钥的Map - */ - public static Map initKey() throws Exception { - //实例化密钥生成器 - KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance(KEY_ALGORITHM); - //初始化密钥生成器 - keyPairGenerator.initialize(KEY_SIZE); - //生成密钥对 - KeyPair keyPair = keyPairGenerator.generateKeyPair(); - //甲方公钥 - RSAPublicKey publicKey = (RSAPublicKey) keyPair.getPublic(); - //甲方私钥 - RSAPrivateKey privateKey = (RSAPrivateKey) keyPair.getPrivate(); - //将密钥存储在map中 - Map keyMap = new HashMap(16); - keyMap.put(PUBLIC_KEY, publicKey); - keyMap.put(PRIVATE_KEY, privateKey); - return keyMap; - - } - - - /** - * 私钥加密 - * - * @param data 待加密数据 - * @param key 密钥 - * @return byte[] 加密数据 - */ - public static byte[] encryptByPrivateKey(byte[] data, byte[] key) throws Exception { - - //取得私钥 - PKCS8EncodedKeySpec pkcs8KeySpec = new PKCS8EncodedKeySpec(key); - KeyFactory keyFactory = KeyFactory.getInstance(KEY_ALGORITHM); - //生成私钥 - PrivateKey privateKey = keyFactory.generatePrivate(pkcs8KeySpec); - //数据加密 - Cipher cipher = Cipher.getInstance(keyFactory.getAlgorithm()); - cipher.init(Cipher.ENCRYPT_MODE, privateKey); - return cipher.doFinal(data); - } - - /** - * 公钥加密 - * - * @param data 待加密数据 - * @param key 密钥 - * @return byte[] 加密数据 - */ - public static byte[] encryptByPublicKey(byte[] data, byte[] key) throws Exception { - - //实例化密钥工厂 - KeyFactory keyFactory = KeyFactory.getInstance(KEY_ALGORITHM); - //初始化公钥 - //密钥材料转换 - X509EncodedKeySpec x509KeySpec = new X509EncodedKeySpec(key); - //产生公钥 - PublicKey pubKey = keyFactory.generatePublic(x509KeySpec); - - //数据加密 - Cipher cipher = Cipher.getInstance(keyFactory.getAlgorithm()); - cipher.init(Cipher.ENCRYPT_MODE, pubKey); - return cipher.doFinal(data); - } - - /** - * 私钥解密 - * - * @param data 待解密数据 - * @param key 密钥 - * @return byte[] 解密数据 - */ - public static byte[] decryptByPrivateKey(byte[] data, byte[] key) throws Exception { - //取得私钥 - PKCS8EncodedKeySpec pkcs8KeySpec = new PKCS8EncodedKeySpec(key); - KeyFactory keyFactory = KeyFactory.getInstance(KEY_ALGORITHM); - //生成私钥 - PrivateKey privateKey = keyFactory.generatePrivate(pkcs8KeySpec); - //数据解密 - Cipher cipher = Cipher.getInstance(keyFactory.getAlgorithm()); - cipher.init(Cipher.DECRYPT_MODE, privateKey); - return cipher.doFinal(data); - } - - /** - * 公钥解密 - * - * @param data 待解密数据 - * @param key 密钥 - * @return byte[] 解密数据 - */ - public static byte[] decryptByPublicKey(byte[] data, byte[] key) throws Exception { - - //实例化密钥工厂 - KeyFactory keyFactory = KeyFactory.getInstance(KEY_ALGORITHM); - //初始化公钥 - //密钥材料转换 - X509EncodedKeySpec x509KeySpec = new X509EncodedKeySpec(key); - //产生公钥 - PublicKey pubKey = keyFactory.generatePublic(x509KeySpec); - //数据解密 - Cipher cipher = Cipher.getInstance(keyFactory.getAlgorithm()); - cipher.init(Cipher.DECRYPT_MODE, pubKey); - return cipher.doFinal(data); - } - - /** - * 取得私钥 - * - * @param keyMap 密钥map - * @return byte[] 私钥 - */ - public static byte[] getPrivateKey(Map keyMap) { - Key key = (Key) keyMap.get(PRIVATE_KEY); - return key.getEncoded(); - } - - /** - * 取得公钥 - * - * @param keyMap 密钥map - * @return byte[] 公钥 - */ - public static byte[] getPublicKey(Map keyMap) throws Exception { - Key key = (Key) keyMap.get(PUBLIC_KEY); - return key.getEncoded(); - } - - /** - * @param args - * @throws Exception - */ - public static void main(String[] args) throws Exception { - //初始化密钥 - //生成密钥对 - Map keyMap = RSACoderUtil.initKey(); - //公钥 - byte[] publicKey = RSACoderUtil.getPublicKey(keyMap); - - //私钥 - byte[] privateKey = RSACoderUtil.getPrivateKey(keyMap); - System.out.println("公钥:/n" + Base64.encodeBase64String(publicKey)); - System.out.println("私钥:/n" + Base64.encodeBase64String(privateKey)); - -// System.out.println("================密钥对构造完毕,甲方将公钥公布给乙方,开始进行加密数据的传输============="); -// String str = "RSA密码交换算法"; -// System.out.println("/n===========甲方向乙方发送加密数据=============="); -// System.out.println("原文:" + str); -// //甲方进行数据的加密 -// byte[] code1 = RSACoderUtil.encryptByPrivateKey(str.getBytes(), privateKey); -// System.out.println("加密后的数据:" + Base64.encodeBase64String(code1)); -// System.out.println("===========乙方使用甲方提供的公钥对数据进行解密=============="); -// //乙方进行数据的解密 -// byte[] decode1 = RSACoderUtil.decryptByPublicKey(code1, publicKey); -// System.out.println("乙方解密后的数据:" + new String(decode1) + "/n/n"); -// -// System.out.println("===========反向进行操作,乙方向甲方发送数据==============/n/n"); - - String str = "乙方向甲方发送数据RSA算法"; - - System.out.println("原文:" + str); - - //乙方使用公钥对数据进行加密 - byte[] code2 = RSACoderUtil.encryptByPublicKey(str.getBytes(), publicKey); - System.out.println("===========乙方使用公钥对数据进行加密=============="); - System.out.println("加密后的数据:" + Base64.encodeBase64String(code2)); - - System.out.println("=============乙方将数据传送给甲方======================"); - System.out.println("===========甲方使用私钥对数据进行解密=============="); - - //甲方使用私钥对数据进行解密 - byte[] decode2 = RSACoderUtil.decryptByPrivateKey(code2, privateKey); - - System.out.println("甲方解密后的数据:" + new String(decode2)); - - System.out.println("------------------------------------"); - - //私钥对数据进行加密 - str = "我丢你老母====你是个小可爱"; - byte[] code5 = RSACoderUtil.encryptByPrivateKey(str.getBytes(), privateKey); - System.out.println("===========乙方使用私钥对数据进行加密=============="); - System.out.println("加密后的数据:" + Base64.encodeBase64String(code5)); - - System.out.println("=============乙方将数据传送给甲方======================"); - System.out.println("===========甲方使用私钥对数据进行解密=============="); - - //公钥对数据进行解密 - byte[] decode5 = RSACoderUtil.decryptByPublicKey(code5, publicKey); - - System.out.println("甲方解密后的数据:" + new String(decode5)); - } -}