瀏覽代碼

first commit

pull/1/head
做个有用的人 3 月之前
當前提交
f281bc64b2
共有 100 個文件被更改,包括 5616 次插入0 次删除
  1. +33
    -0
      .gitignore
  2. +191
    -0
      LICENSE
  3. +83
    -0
      README.md
  4. +321
    -0
      pom.xml
  5. +37
    -0
      wjcy-common/pom.xml
  6. +30
    -0
      wjcy-common/src/main/java/me/zhengjie/annotation/AnonymousAccess.java
  7. +25
    -0
      wjcy-common/src/main/java/me/zhengjie/annotation/CheckPwd.java
  8. +47
    -0
      wjcy-common/src/main/java/me/zhengjie/annotation/DataPermission.java
  9. +31
    -0
      wjcy-common/src/main/java/me/zhengjie/annotation/DateTime.java
  10. +28
    -0
      wjcy-common/src/main/java/me/zhengjie/annotation/FormSubmission.java
  11. +49
    -0
      wjcy-common/src/main/java/me/zhengjie/annotation/Limit.java
  12. +90
    -0
      wjcy-common/src/main/java/me/zhengjie/annotation/Query.java
  13. +91
    -0
      wjcy-common/src/main/java/me/zhengjie/annotation/rest/AnonymousDeleteMapping.java
  14. +90
    -0
      wjcy-common/src/main/java/me/zhengjie/annotation/rest/AnonymousGetMapping.java
  15. +91
    -0
      wjcy-common/src/main/java/me/zhengjie/annotation/rest/AnonymousPatchMapping.java
  16. +91
    -0
      wjcy-common/src/main/java/me/zhengjie/annotation/rest/AnonymousPostMapping.java
  17. +91
    -0
      wjcy-common/src/main/java/me/zhengjie/annotation/rest/AnonymousPutMapping.java
  18. +99
    -0
      wjcy-common/src/main/java/me/zhengjie/aspect/LimitAspect.java
  19. +27
    -0
      wjcy-common/src/main/java/me/zhengjie/aspect/LimitType.java
  20. +40
    -0
      wjcy-common/src/main/java/me/zhengjie/base/BaseDTO.java
  21. +85
    -0
      wjcy-common/src/main/java/me/zhengjie/base/BaseEntity.java
  22. +53
    -0
      wjcy-common/src/main/java/me/zhengjie/base/BaseMapper.java
  23. +45
    -0
      wjcy-common/src/main/java/me/zhengjie/config/AuditorConfig.java
  24. +105
    -0
      wjcy-common/src/main/java/me/zhengjie/config/BeanFactory.java
  25. +36
    -0
      wjcy-common/src/main/java/me/zhengjie/config/CorsInterceptor.java
  26. +39
    -0
      wjcy-common/src/main/java/me/zhengjie/config/CustomIdGenerator.java
  27. +58
    -0
      wjcy-common/src/main/java/me/zhengjie/config/DhApiProperties.java
  28. +37
    -0
      wjcy-common/src/main/java/me/zhengjie/config/ElPermissionConfig.java
  29. +60
    -0
      wjcy-common/src/main/java/me/zhengjie/config/FileProperties.java
  30. +31
    -0
      wjcy-common/src/main/java/me/zhengjie/config/MvcConfig.java
  31. +82
    -0
      wjcy-common/src/main/java/me/zhengjie/config/MyMetaObjectHandler.java
  32. +32
    -0
      wjcy-common/src/main/java/me/zhengjie/config/MybatisPlusConfig.java
  33. +44
    -0
      wjcy-common/src/main/java/me/zhengjie/config/PlatsProperties.java
  34. +30
    -0
      wjcy-common/src/main/java/me/zhengjie/config/PropertiesConfig.java
  35. +223
    -0
      wjcy-common/src/main/java/me/zhengjie/config/RedisConfig.java
  36. +48
    -0
      wjcy-common/src/main/java/me/zhengjie/config/RedissonConfig.java
  37. +38
    -0
      wjcy-common/src/main/java/me/zhengjie/config/RsaProperties.java
  38. +217
    -0
      wjcy-common/src/main/java/me/zhengjie/config/SwaggerConfig.java
  39. +97
    -0
      wjcy-common/src/main/java/me/zhengjie/config/SystemConfig.java
  40. +34
    -0
      wjcy-common/src/main/java/me/zhengjie/config/YdApiProperties.java
  41. +30
    -0
      wjcy-common/src/main/java/me/zhengjie/config/constant/Constants.java
  42. +16
    -0
      wjcy-common/src/main/java/me/zhengjie/constant/Constants.java
  43. +56
    -0
      wjcy-common/src/main/java/me/zhengjie/constant/PublicConstant.java
  44. +39
    -0
      wjcy-common/src/main/java/me/zhengjie/dao/CtApplyDao.java
  45. +61
    -0
      wjcy-common/src/main/java/me/zhengjie/dao/CtBrowseDao.java
  46. +56
    -0
      wjcy-common/src/main/java/me/zhengjie/dao/CtBuyerDao.java
  47. +34
    -0
      wjcy-common/src/main/java/me/zhengjie/dao/CtCardDao.java
  48. +90
    -0
      wjcy-common/src/main/java/me/zhengjie/dao/CtClickFarmingDao.java
  49. +100
    -0
      wjcy-common/src/main/java/me/zhengjie/dao/CtClickOrderDao.java
  50. +34
    -0
      wjcy-common/src/main/java/me/zhengjie/dao/CtCompanyDao.java
  51. +24
    -0
      wjcy-common/src/main/java/me/zhengjie/dao/CtDhPayDao.java
  52. +17
    -0
      wjcy-common/src/main/java/me/zhengjie/dao/CtExcelDao.java
  53. +17
    -0
      wjcy-common/src/main/java/me/zhengjie/dao/CtExcelImportInfoDao.java
  54. +17
    -0
      wjcy-common/src/main/java/me/zhengjie/dao/CtOrderDao.java
  55. +17
    -0
      wjcy-common/src/main/java/me/zhengjie/dao/CtPlatformDao.java
  56. +41
    -0
      wjcy-common/src/main/java/me/zhengjie/dao/CtRebotDao.java
  57. +17
    -0
      wjcy-common/src/main/java/me/zhengjie/dao/CtResponseOrderAddressDao.java
  58. +17
    -0
      wjcy-common/src/main/java/me/zhengjie/dao/CtResponseOrderDao.java
  59. +17
    -0
      wjcy-common/src/main/java/me/zhengjie/dao/CtResponseOrderProductDao.java
  60. +35
    -0
      wjcy-common/src/main/java/me/zhengjie/dao/CtVpnDao.java
  61. +61
    -0
      wjcy-common/src/main/java/me/zhengjie/dao/DhAddCarDao.java
  62. +48
    -0
      wjcy-common/src/main/java/me/zhengjie/dao/DhAddCarOrderDao.java
  63. +17
    -0
      wjcy-common/src/main/java/me/zhengjie/dao/DhCarGoodsDao.java
  64. +17
    -0
      wjcy-common/src/main/java/me/zhengjie/dao/LoginIpDao.java
  65. +17
    -0
      wjcy-common/src/main/java/me/zhengjie/dao/SettingSiteDao.java
  66. +26
    -0
      wjcy-common/src/main/java/me/zhengjie/dao/SysQuartzJobDao.java
  67. +23
    -0
      wjcy-common/src/main/java/me/zhengjie/dao/SysQuartzLogDao.java
  68. +12
    -0
      wjcy-common/src/main/java/me/zhengjie/dao/mapper/CtDhPayService.xml
  69. +73
    -0
      wjcy-common/src/main/java/me/zhengjie/dto/Dto.java
  70. +49
    -0
      wjcy-common/src/main/java/me/zhengjie/dto/PageDTO.java
  71. +38
    -0
      wjcy-common/src/main/java/me/zhengjie/dto/StatementAggregateDTO.java
  72. +73
    -0
      wjcy-common/src/main/java/me/zhengjie/entity/CtApply.java
  73. +45
    -0
      wjcy-common/src/main/java/me/zhengjie/entity/CtBrowse.java
  74. +33
    -0
      wjcy-common/src/main/java/me/zhengjie/entity/CtBrowseYdParams.java
  75. +103
    -0
      wjcy-common/src/main/java/me/zhengjie/entity/CtBuyer.java
  76. +19
    -0
      wjcy-common/src/main/java/me/zhengjie/entity/CtBuyerClickSuccess.java
  77. +45
    -0
      wjcy-common/src/main/java/me/zhengjie/entity/CtBuyerContactInfo.java
  78. +71
    -0
      wjcy-common/src/main/java/me/zhengjie/entity/CtBuyerExport.java
  79. +67
    -0
      wjcy-common/src/main/java/me/zhengjie/entity/CtBuyerExportTemple.java
  80. +84
    -0
      wjcy-common/src/main/java/me/zhengjie/entity/CtBuyerImport.java
  81. +80
    -0
      wjcy-common/src/main/java/me/zhengjie/entity/CtCard.java
  82. +40
    -0
      wjcy-common/src/main/java/me/zhengjie/entity/CtCardExport.java
  83. +46
    -0
      wjcy-common/src/main/java/me/zhengjie/entity/CtCardExportTemple.java
  84. +96
    -0
      wjcy-common/src/main/java/me/zhengjie/entity/CtCardImport.java
  85. +22
    -0
      wjcy-common/src/main/java/me/zhengjie/entity/CtCardInfo.java
  86. +41
    -0
      wjcy-common/src/main/java/me/zhengjie/entity/CtClickFarmSupplyMentYdParams.java
  87. +59
    -0
      wjcy-common/src/main/java/me/zhengjie/entity/CtClickFarmYdParams.java
  88. +70
    -0
      wjcy-common/src/main/java/me/zhengjie/entity/CtClickFarming.java
  89. +59
    -0
      wjcy-common/src/main/java/me/zhengjie/entity/CtClickFarmingExport.java
  90. +53
    -0
      wjcy-common/src/main/java/me/zhengjie/entity/CtClickFarmingExportTemp.java
  91. +64
    -0
      wjcy-common/src/main/java/me/zhengjie/entity/CtClickFarmingImport.java
  92. +37
    -0
      wjcy-common/src/main/java/me/zhengjie/entity/CtClickFarmingOrderInfo.java
  93. +55
    -0
      wjcy-common/src/main/java/me/zhengjie/entity/CtClickOrder.java
  94. +37
    -0
      wjcy-common/src/main/java/me/zhengjie/entity/CtClickOrderExport.java
  95. +39
    -0
      wjcy-common/src/main/java/me/zhengjie/entity/CtClickOrderExportTemple.java
  96. +40
    -0
      wjcy-common/src/main/java/me/zhengjie/entity/CtClickOrderImport.java
  97. +33
    -0
      wjcy-common/src/main/java/me/zhengjie/entity/CtClickOrderYdParams.java
  98. +43
    -0
      wjcy-common/src/main/java/me/zhengjie/entity/CtCompany.java
  99. +23
    -0
      wjcy-common/src/main/java/me/zhengjie/entity/CtCompanyInfo.java
  100. +44
    -0
      wjcy-common/src/main/java/me/zhengjie/entity/CtDhPay.java

+ 33
- 0
.gitignore 查看文件

@@ -0,0 +1,33 @@
HELP.md
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/

### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache

### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/

### VS Code ###
.vscode/

+ 191
- 0
LICENSE 查看文件

@@ -0,0 +1,191 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/

TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

1. Definitions.

"License" shall mean the terms and conditions for use, reproduction, and
distribution as defined by Sections 1 through 9 of this document.

"Licensor" shall mean the copyright owner or entity authorized by the copyright
owner that is granting the License.

"Legal Entity" shall mean the union of the acting entity and all other entities
that control, are controlled by, or are under common control with that entity.
For the purposes of this definition, "control" means (i) the power, direct or
indirect, to cause the direction or management of such entity, whether by
contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.

"You" (or "Your") shall mean an individual or Legal Entity exercising
permissions granted by this License.

"Source" form shall mean the preferred form for making modifications, including
but not limited to software source code, documentation source, and configuration
files.

"Object" form shall mean any form resulting from mechanical transformation or
translation of a Source form, including but not limited to compiled object code,
generated documentation, and conversions to other media types.

"Work" shall mean the work of authorship, whether in Source or Object form, made
available under the License, as indicated by a copyright notice that is included
in or attached to the work (an example is provided in the Appendix below).

"Derivative Works" shall mean any work, whether in Source or Object form, that
is based on (or derived from) the Work and for which the editorial revisions,
annotations, elaborations, or other modifications represent, as a whole, an
original work of authorship. For the purposes of this License, Derivative Works
shall not include works that remain separable from, or merely link (or bind by
name) to the interfaces of, the Work and Derivative Works thereof.

"Contribution" shall mean any work of authorship, including the original version
of the Work and any modifications or additions to that Work or Derivative Works
thereof, that is intentionally submitted to Licensor for inclusion in the Work
by the copyright owner or by an individual or Legal Entity authorized to submit
on behalf of the copyright owner. For the purposes of this definition,
"submitted" means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems, and
issue tracking systems that are managed by, or on behalf of, the Licensor for
the purpose of discussing and improving the Work, but excluding communication
that is conspicuously marked or otherwise designated in writing by the copyright
owner as "Not a Contribution."

"Contributor" shall mean Licensor and any individual or Legal Entity on behalf
of whom a Contribution has been received by Licensor and subsequently
incorporated within the Work.

2. Grant of Copyright License.

Subject to the terms and conditions of this License, each Contributor hereby
grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
irrevocable copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the Work and such
Derivative Works in Source or Object form.

3. Grant of Patent License.

Subject to the terms and conditions of this License, each Contributor hereby
grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
irrevocable (except as stated in this section) patent license to make, have
made, use, offer to sell, sell, import, and otherwise transfer the Work, where
such license applies only to those patent claims licensable by such Contributor
that are necessarily infringed by their Contribution(s) alone or by combination
of their Contribution(s) with the Work to which such Contribution(s) was
submitted. If You institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work or a
Contribution incorporated within the Work constitutes direct or contributory
patent infringement, then any patent licenses granted to You under this License
for that Work shall terminate as of the date such litigation is filed.

4. Redistribution.

You may reproduce and distribute copies of the Work or Derivative Works thereof
in any medium, with or without modifications, and in Source or Object form,
provided that You meet the following conditions:

You must give any other recipients of the Work or Derivative Works a copy of
this License; and
You must cause any modified files to carry prominent notices stating that You
changed the files; and
You must retain, in the Source form of any Derivative Works that You distribute,
all copyright, patent, trademark, and attribution notices from the Source form
of the Work, excluding those notices that do not pertain to any part of the
Derivative Works; and
If the Work includes a "NOTICE" text file as part of its distribution, then any
Derivative Works that You distribute must include a readable copy of the
attribution notices contained within such NOTICE file, excluding those notices
that do not pertain to any part of the Derivative Works, in at least one of the
following places: within a NOTICE text file distributed as part of the
Derivative Works; within the Source form or documentation, if provided along
with the Derivative Works; or, within a display generated by the Derivative
Works, if and wherever such third-party notices normally appear. The contents of
the NOTICE file are for informational purposes only and do not modify the
License. You may add Your own attribution notices within Derivative Works that
You distribute, alongside or as an addendum to the NOTICE text from the Work,
provided that such additional attribution notices cannot be construed as
modifying the License.
You may add Your own copyright statement to Your modifications and may provide
additional or different license terms and conditions for use, reproduction, or
distribution of Your modifications, or for any such Derivative Works as a whole,
provided Your use, reproduction, and distribution of the Work otherwise complies
with the conditions stated in this License.

5. Submission of Contributions.

Unless You explicitly state otherwise, any Contribution intentionally submitted
for inclusion in the Work by You to the Licensor shall be under the terms and
conditions of this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify the terms of
any separate license agreement you may have executed with Licensor regarding
such Contributions.

6. Trademarks.

This License does not grant permission to use the trade names, trademarks,
service marks, or product names of the Licensor, except as required for
reasonable and customary use in describing the origin of the Work and
reproducing the content of the NOTICE file.

7. Disclaimer of Warranty.

Unless required by applicable law or agreed to in writing, Licensor provides the
Work (and each Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
including, without limitation, any warranties or conditions of TITLE,
NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are
solely responsible for determining the appropriateness of using or
redistributing the Work and assume any risks associated with Your exercise of
permissions under this License.

8. Limitation of Liability.

In no event and under no legal theory, whether in tort (including negligence),
contract, or otherwise, unless required by applicable law (such as deliberate
and grossly negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special, incidental,
or consequential damages of any character arising as a result of this License or
out of the use or inability to use the Work (including but not limited to
damages for loss of goodwill, work stoppage, computer failure or malfunction, or
any and all other commercial damages or losses), even if such Contributor has
been advised of the possibility of such damages.

9. Accepting Warranty or Additional Liability.

While redistributing the Work or Derivative Works thereof, You may choose to
offer, and charge a fee for, acceptance of support, warranty, indemnity, or
other liability obligations and/or rights consistent with this License. However,
in accepting such obligations, You may act only on Your own behalf and on Your
sole responsibility, not on behalf of any other Contributor, and only if You
agree to indemnify, defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason of your
accepting any such warranty or additional liability.

END OF TERMS AND CONDITIONS

APPENDIX: How to apply the Apache License to your work

To apply the Apache License to your work, attach the following boilerplate
notice, with the fields enclosed by brackets "{}" replaced with your own
identifying information. (Don't include the brackets!) The text should be
enclosed in the appropriate comment syntax for the file format. We also
recommend that a file or class name and description of purpose be included on
the same "printed page" as the copyright notice for easier identification within
third-party archives.

Copyright 2019-2020 Zheng Jie

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

+ 83
- 0
README.md 查看文件

@@ -0,0 +1,83 @@
<h1 style="text-align: center">EL-ADMIN 后台管理系统</h1>
<div style="text-align: center">
#### 项目简介
一个基于 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 系统代码生成模块
```


+ 321
- 0
pom.xml 查看文件

@@ -0,0 +1,321 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>me.zhengjie</groupId>
<artifactId>wjcy</artifactId>
<packaging>pom</packaging>
<version>1.0</version>

<modules>
<module>wjcy-common</module>
<module>wjcy-logging</module>
<module>wjcy-system</module>
<module>wjcy-tools</module>
<module>wjcy-generator</module>
</modules>

<name>EL-ADMIN 后台管理</name>
<url>http://auauz.net</url>

<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.10.RELEASE</version>
</parent>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<log4jdbc.version>1.16</log4jdbc.version>
<fastjson.version>1.2.70</fastjson.version>
<druid.version>1.1.24</druid.version>
<commons-pool2.version>2.5.0</commons-pool2.version>
<mapstruct.version>1.3.1.Final</mapstruct.version>
<rocketmq-version>2.1.1</rocketmq-version>
<log4j2.version>2.15.0</log4j2.version>
<knife4j.version>2.0.7</knife4j.version>
</properties>

<dependencies>
<!--Spring boot 核心-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>

<!--Spring boot Web容器-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>

<!--Spring boot 测试-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>

<!--Spring boot 安全框架-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>

<!-- spring boot 缓存 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-cache</artifactId>
</dependency>

<!--Spring boot Redis-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
</dependency>

<!--spring boot 集成redis所需common-pool2-->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-pool2</artifactId>
<version>${commons-pool2.version}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional>
</dependency>
<!--监控sql日志-->
<dependency>
<groupId>org.bgee.log4jdbc-log4j2</groupId>
<artifactId>log4jdbc-log4j2-jdbc4.1</artifactId>
<version>${log4jdbc.version}</version>
</dependency>

<!-- 新版本 -->
<dependency>
<groupId>com.github.xiaoymin</groupId>
<artifactId>knife4j-spring-boot-starter</artifactId>
<version>${knife4j.version}</version>
</dependency>

<!--Mysql依赖包-->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency>

<!-- druid数据源驱动 -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId>
<version>${druid.version}</version>
</dependency>
<dependency>
<groupId>org.lionsoul</groupId>
<artifactId>ip2region</artifactId>
<version>1.7.2</version>
</dependency>

<!--lombok插件-->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>



<!-- fastjson -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>${fastjson.version}</version>
</dependency>

<!--mapStruct依赖-->
<dependency>
<groupId>org.mapstruct</groupId>
<artifactId>mapstruct</artifactId>
<version>${mapstruct.version}</version>
</dependency>
<dependency>
<groupId>org.mapstruct</groupId>
<artifactId>mapstruct-processor</artifactId>
<version>${mapstruct.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<version>1</version>
</dependency>

<!-- Java图形验证码 -->
<dependency>
<groupId>com.github.whvcse</groupId>
<artifactId>easy-captcha</artifactId>
<version>1.6.2</version>
</dependency>

<!-- 解析客户端操作系统、浏览器信息 -->
<dependency>
<groupId>nl.basjes.parse.useragent</groupId>
<artifactId>yauaa</artifactId>
<version>5.23</version>
</dependency>

<!--mybatis-plus-boot-->
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
<version>3.3.2</version>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>runtime</scope>
</dependency>
<!--log4j2-->
<!--添加对日志系统的支持,采用最新的log4j2框架-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-log4j2</artifactId>
</dependency>
<!-- 引入poi,解析workbook视图 -->
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>4.0.1</version>
</dependency>

<!-- https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>4.0.1</version>
</dependency>
<!-- 处理excel和上面功能是一样的-->
<dependency>
<groupId>net.sourceforge.jexcelapi</groupId>
<artifactId>jxl</artifactId>
<version>2.6.10</version>
</dependency>
<!--redisson 依赖-->
<dependency>
<groupId>org.redisson</groupId>
<artifactId>redisson</artifactId>
<version>3.5.7</version>
</dependency>

<!--rocketMq-->
<dependency>
<groupId>org.apache.rocketmq</groupId>
<artifactId>rocketmq-client</artifactId>
<version>4.4.0</version>
</dependency>

<!--trc-->
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>24.1-jre</version>
</dependency>
<dependency>
<groupId>com.madgag.spongycastle</groupId>
<artifactId>core</artifactId>
<version>1.58.0.0</version>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>

<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-openfeign</artifactId>
<version>2.2.5.RELEASE</version>
</dependency>
<dependency>
<groupId>com.netflix.feign</groupId>
<artifactId>feign-jackson</artifactId>
<version>8.18.0</version>
</dependency>

<dependency>
<groupId>org.telegram</groupId>
<artifactId>telegrambots</artifactId>
<version>5.5.0</version>
</dependency>

</dependencies>

<build>
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
</includes>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<!-- 打包时跳过测试 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>

<repositories>
<repository>
<id>public</id>
<name>aliyun nexus</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<releases>
<enabled>true</enabled>
</releases>
</repository>
</repositories>

<pluginRepositories>
<pluginRepository>
<id>public</id>
<name>aliyun nexus</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</project>

+ 37
- 0
wjcy-common/pom.xml 查看文件

@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>wjcy</artifactId>
<groupId>me.zhengjie</groupId>
<version>1.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<properties>
<hutool.version>5.3.4</hutool.version>
</properties>

<artifactId>wjcy-common</artifactId>
<name>公共模块</name>

<dependencies>
<!--工具包-->
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
<version>${hutool.version}</version>
</dependency>

<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.12</version>
</dependency>
<dependency>
<groupId>org.jodd</groupId>
<artifactId>jodd-core</artifactId>
<version>3.7.1</version>
</dependency>
</dependencies>
</project>

+ 30
- 0
wjcy-common/src/main/java/me/zhengjie/annotation/AnonymousAccess.java 查看文件

@@ -0,0 +1,30 @@
/*
* Copyright 2019-2020 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS 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 java.lang.annotation.*;

/**
* @author jacky
* 用于标记匿名访问方法
*/
@Inherited
@Documented
@Target({ElementType.METHOD,ElementType.ANNOTATION_TYPE})
@Retention(RetentionPolicy.RUNTIME)
public @interface AnonymousAccess {

}

+ 25
- 0
wjcy-common/src/main/java/me/zhengjie/annotation/CheckPwd.java 查看文件

@@ -0,0 +1,25 @@
package me.zhengjie.annotation;

import me.zhengjie.utils.CheckPwdValidator;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.*;

/*
*
* @Description 密码校验
* @Date 2022/3/21
* @Author zeng
*/
@Target({ElementType.FIELD, ElementType.PARAMETER})
@Retention(RetentionPolicy.RUNTIME)
@Constraint(validatedBy = CheckPwdValidator.class)
public @interface CheckPwd {

String message() default "密码格式错误,必须包含大小写字母、数子、英文特殊符号,且长度在16~64之间!";

Class<?>[] groups() default {};

Class<? extends Payload>[] payload() default {};
}

+ 47
- 0
wjcy-common/src/main/java/me/zhengjie/annotation/DataPermission.java 查看文件

@@ -0,0 +1,47 @@
/*
* Copyright 2019-2020 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS 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 java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
* <p>
* 用于判断是否过滤数据权限
* 1、如果没有用到 @OneToOne 这种关联关系,只需要填写 fieldName [参考:DeptQueryCriteria.class]
* 2、如果用到了 @OneToOne ,fieldName 和 joinName 都需要填写,拿UserQueryCriteria.class举例:
* 应该是 @DataPermission(joinName = "dept", fieldName = "id")
* </p>
* @author Zheng Jie
* @website https://el-admin.vip
* @date 2020-05-07
**/
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface DataPermission {

/**
* Entity 中的字段名称
*/
String fieldName() default "";

/**
* Entity 中与部门关联的字段名称
*/
String joinName() default "";
}

+ 31
- 0
wjcy-common/src/main/java/me/zhengjie/annotation/DateTime.java 查看文件

@@ -0,0 +1,31 @@
package me.zhengjie.annotation;

import me.zhengjie.utils.DateTimeValidator;

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;
/**
* <p>
* 日期格式效验
* </p>
*
* @Author xx
* @Date 2021/7/27
**/
@Target({ElementType.FIELD, ElementType.PARAMETER})
@Retention(RetentionPolicy.RUNTIME)
@Constraint(validatedBy = DateTimeValidator.class)
public @interface DateTime {

String message() default "日期格式错误";

String format() default "yyyy-MM-dd HH:mm:ss";

Class<?>[] groups() default {};

Class<? extends Payload>[] payload() default {};
}

+ 28
- 0
wjcy-common/src/main/java/me/zhengjie/annotation/FormSubmission.java 查看文件

@@ -0,0 +1,28 @@
package me.zhengjie.annotation;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import static me.zhengjie.config.constant.Constants.FORM_SUB_SECOND;

/**
* <p>
* 表单提交
* </p>
*
* @author: rch
* @date: 2022-08-30
*/
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
public @interface FormSubmission {

/** 是否开启防止表单重复提交验证 */
boolean isOpen() default true;
/** 表单重复提交时间间隔,单位;秒 */
long second() default FORM_SUB_SECOND;


}

+ 49
- 0
wjcy-common/src/main/java/me/zhengjie/annotation/Limit.java 查看文件

@@ -0,0 +1,49 @@
/*
* Copyright 2019-2020 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS 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.aspect.LimitType;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
* @author jacky
*/
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
public @interface Limit {

// 资源名称,用于描述接口功能
String name() default "";

// 资源 key
String key() default "";

// key prefix
String prefix() default "";

// 时间的,单位秒
int period();

// 限制访问次数
int count();

// 限制类型
LimitType limitType() default LimitType.CUSTOMER;

}

+ 90
- 0
wjcy-common/src/main/java/me/zhengjie/annotation/Query.java 查看文件

@@ -0,0 +1,90 @@
/*
* Copyright 2019-2020 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS 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 java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
* @author Zheng Jie
* @date 2019-6-4 13:52:30
*/
@Target(ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)
public @interface Query {

// Dong ZhaoYang 2017/8/7 基本对象的属性名
String propName() default "";
// Dong ZhaoYang 2017/8/7 查询方式
Type type() default Type.EQUAL;

/**
* 连接查询的属性名,如User类中的dept
*/
String joinName() default "";

/**
* 默认左连接
*/
Join join() default Join.LEFT;

/**
* 多字段模糊搜索,仅支持String类型字段,多个用逗号隔开, 如@Query(blurry = "email,username")
*/
String blurry() default "";

enum Type {
// jie 2019/6/4 相等
EQUAL
// Dong ZhaoYang 2017/8/7 大于等于
, GREATER_THAN
// Dong ZhaoYang 2017/8/7 小于等于
, LESS_THAN
// Dong ZhaoYang 2017/8/7 中模糊查询
, INNER_LIKE
// Dong ZhaoYang 2017/8/7 左模糊查询
, LEFT_LIKE
// Dong ZhaoYang 2017/8/7 右模糊查询
, RIGHT_LIKE
// Dong ZhaoYang 2017/8/7 小于
, LESS_THAN_NQ
// jie 2019/6/4 包含
, IN
// 不包含
, NOT_IN
// 不等于
,NOT_EQUAL
// between
,BETWEEN
// 不为空
,NOT_NULL
// 为空
,IS_NULL
}

/**
* @author Zheng Jie
* 适用于简单连接查询,复杂的请自定义该注解,或者使用sql查询
*/
enum Join {
/** jie 2019-6-4 13:18:30 */
LEFT, RIGHT, INNER
}

}


+ 91
- 0
wjcy-common/src/main/java/me/zhengjie/annotation/rest/AnonymousDeleteMapping.java 查看文件

@@ -0,0 +1,91 @@
/*
* Copyright 2002-2016 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.annotation.rest;

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 me.zhengjie.annotation.AnonymousAccess;
import org.springframework.core.annotation.AliasFor;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
* Annotation for mapping HTTP {@code DELETE} requests onto specific handler
* methods.
* 支持匿名访问 DeleteMapping
*
* @author liaojinlong
* @see AnonymousGetMapping
* @see AnonymousPostMapping
* @see AnonymousPutMapping
* @see AnonymousPatchMapping
* @see RequestMapping
*/
@AnonymousAccess
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@Documented
@RequestMapping(method = RequestMethod.DELETE)
public @interface AnonymousDeleteMapping {

/**
* Alias for {@link RequestMapping#name}.
*/
@AliasFor(annotation = RequestMapping.class)
String name() default "";

/**
* Alias for {@link RequestMapping#value}.
*/
@AliasFor(annotation = RequestMapping.class)
String[] value() default {};

/**
* Alias for {@link RequestMapping#path}.
*/
@AliasFor(annotation = RequestMapping.class)
String[] path() default {};

/**
* Alias for {@link RequestMapping#params}.
*/
@AliasFor(annotation = RequestMapping.class)
String[] params() default {};

/**
* Alias for {@link RequestMapping#headers}.
*/
@AliasFor(annotation = RequestMapping.class)
String[] headers() default {};

/**
* Alias for {@link RequestMapping#consumes}.
*/
@AliasFor(annotation = RequestMapping.class)
String[] consumes() default {};

/**
* Alias for {@link RequestMapping#produces}.
*/
@AliasFor(annotation = RequestMapping.class)
String[] produces() default {};

}

+ 90
- 0
wjcy-common/src/main/java/me/zhengjie/annotation/rest/AnonymousGetMapping.java 查看文件

@@ -0,0 +1,90 @@
/*
* Copyright 2002-2016 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.annotation.rest;

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 me.zhengjie.annotation.AnonymousAccess;
import org.springframework.core.annotation.AliasFor;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
* Annotation for mapping HTTP {@code GET} requests onto specific handler
* methods.
* <p>
* 支持匿名访问 GetMapping
*
* @author liaojinlong
* @see RequestMapping
*/
@AnonymousAccess
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@Documented
@RequestMapping(method = RequestMethod.GET)
public @interface AnonymousGetMapping {

/**
* Alias for {@link RequestMapping#name}.
*/
@AliasFor(annotation = RequestMapping.class)
String name() default "";

/**
* Alias for {@link RequestMapping#value}.
*/
@AliasFor(annotation = RequestMapping.class)
String[] value() default {};

/**
* Alias for {@link RequestMapping#path}.
*/
@AliasFor(annotation = RequestMapping.class)
String[] path() default {};

/**
* Alias for {@link RequestMapping#params}.
*/
@AliasFor(annotation = RequestMapping.class)
String[] params() default {};

/**
* Alias for {@link RequestMapping#headers}.
*/
@AliasFor(annotation = RequestMapping.class)
String[] headers() default {};

/**
* Alias for {@link RequestMapping#consumes}.
*
* @since 4.3.5
*/
@AliasFor(annotation = RequestMapping.class)
String[] consumes() default {};

/**
* Alias for {@link RequestMapping#produces}.
*/
@AliasFor(annotation = RequestMapping.class)
String[] produces() default {};

}

+ 91
- 0
wjcy-common/src/main/java/me/zhengjie/annotation/rest/AnonymousPatchMapping.java 查看文件

@@ -0,0 +1,91 @@
/*
* Copyright 2002-2016 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.annotation.rest;

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 me.zhengjie.annotation.AnonymousAccess;
import org.springframework.core.annotation.AliasFor;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
* Annotation for mapping HTTP {@code PATCH} requests onto specific handler
* methods.
* * 支持匿名访问 PatchMapping
*
* @author liaojinlong
* @see AnonymousGetMapping
* @see AnonymousPostMapping
* @see AnonymousPutMapping
* @see AnonymousDeleteMapping
* @see RequestMapping
*/
@AnonymousAccess
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@Documented
@RequestMapping(method = RequestMethod.PATCH)
public @interface AnonymousPatchMapping {

/**
* Alias for {@link RequestMapping#name}.
*/
@AliasFor(annotation = RequestMapping.class)
String name() default "";

/**
* Alias for {@link RequestMapping#value}.
*/
@AliasFor(annotation = RequestMapping.class)
String[] value() default {};

/**
* Alias for {@link RequestMapping#path}.
*/
@AliasFor(annotation = RequestMapping.class)
String[] path() default {};

/**
* Alias for {@link RequestMapping#params}.
*/
@AliasFor(annotation = RequestMapping.class)
String[] params() default {};

/**
* Alias for {@link RequestMapping#headers}.
*/
@AliasFor(annotation = RequestMapping.class)
String[] headers() default {};

/**
* Alias for {@link RequestMapping#consumes}.
*/
@AliasFor(annotation = RequestMapping.class)
String[] consumes() default {};

/**
* Alias for {@link RequestMapping#produces}.
*/
@AliasFor(annotation = RequestMapping.class)
String[] produces() default {};

}

+ 91
- 0
wjcy-common/src/main/java/me/zhengjie/annotation/rest/AnonymousPostMapping.java 查看文件

@@ -0,0 +1,91 @@
/*
* Copyright 2002-2016 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.annotation.rest;

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 me.zhengjie.annotation.AnonymousAccess;
import org.springframework.core.annotation.AliasFor;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
* Annotation for mapping HTTP {@code POST} requests onto specific handler
* methods.
* 支持匿名访问 PostMapping
*
* @author liaojinlong
* @see AnonymousGetMapping
* @see AnonymousPostMapping
* @see AnonymousPutMapping
* @see AnonymousDeleteMapping
* @see RequestMapping
*/
@AnonymousAccess
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@Documented
@RequestMapping(method = RequestMethod.POST)
public @interface AnonymousPostMapping {

/**
* Alias for {@link RequestMapping#name}.
*/
@AliasFor(annotation = RequestMapping.class)
String name() default "";

/**
* Alias for {@link RequestMapping#value}.
*/
@AliasFor(annotation = RequestMapping.class)
String[] value() default {};

/**
* Alias for {@link RequestMapping#path}.
*/
@AliasFor(annotation = RequestMapping.class)
String[] path() default {};

/**
* Alias for {@link RequestMapping#params}.
*/
@AliasFor(annotation = RequestMapping.class)
String[] params() default {};

/**
* Alias for {@link RequestMapping#headers}.
*/
@AliasFor(annotation = RequestMapping.class)
String[] headers() default {};

/**
* Alias for {@link RequestMapping#consumes}.
*/
@AliasFor(annotation = RequestMapping.class)
String[] consumes() default {};

/**
* Alias for {@link RequestMapping#produces}.
*/
@AliasFor(annotation = RequestMapping.class)
String[] produces() default {};

}

+ 91
- 0
wjcy-common/src/main/java/me/zhengjie/annotation/rest/AnonymousPutMapping.java 查看文件

@@ -0,0 +1,91 @@
/*
* Copyright 2002-2016 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.annotation.rest;

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 me.zhengjie.annotation.AnonymousAccess;
import org.springframework.core.annotation.AliasFor;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
* Annotation for mapping HTTP {@code PUT} requests onto specific handler
* methods.
* * 支持匿名访问 PutMapping
*
* @author liaojinlong
* @see AnonymousGetMapping
* @see AnonymousPostMapping
* @see AnonymousPutMapping
* @see AnonymousDeleteMapping
* @see RequestMapping
*/
@AnonymousAccess
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@Documented
@RequestMapping(method = RequestMethod.PUT)
public @interface AnonymousPutMapping {

/**
* Alias for {@link RequestMapping#name}.
*/
@AliasFor(annotation = RequestMapping.class)
String name() default "";

/**
* Alias for {@link RequestMapping#value}.
*/
@AliasFor(annotation = RequestMapping.class)
String[] value() default {};

/**
* Alias for {@link RequestMapping#path}.
*/
@AliasFor(annotation = RequestMapping.class)
String[] path() default {};

/**
* Alias for {@link RequestMapping#params}.
*/
@AliasFor(annotation = RequestMapping.class)
String[] params() default {};

/**
* Alias for {@link RequestMapping#headers}.
*/
@AliasFor(annotation = RequestMapping.class)
String[] headers() default {};

/**
* Alias for {@link RequestMapping#consumes}.
*/
@AliasFor(annotation = RequestMapping.class)
String[] consumes() default {};

/**
* Alias for {@link RequestMapping#produces}.
*/
@AliasFor(annotation = RequestMapping.class)
String[] produces() default {};

}

+ 99
- 0
wjcy-common/src/main/java/me/zhengjie/aspect/LimitAspect.java 查看文件

@@ -0,0 +1,99 @@
/*
* Copyright 2019-2020 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS 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 com.google.common.collect.ImmutableList;
import me.zhengjie.annotation.Limit;
import me.zhengjie.exception.BadRequestException;
import me.zhengjie.utils.RequestHolder;
import me.zhengjie.utils.StringUtils;
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.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.script.DefaultRedisScript;
import org.springframework.data.redis.core.script.RedisScript;
import org.springframework.stereotype.Component;
import javax.servlet.http.HttpServletRequest;
import java.lang.reflect.Method;

/**
* @author /
*/
@Aspect
@Component
public class LimitAspect {

private final RedisTemplate<Object,Object> redisTemplate;
private static final Logger logger = LoggerFactory.getLogger(LimitAspect.class);

public LimitAspect(RedisTemplate<Object,Object> redisTemplate) {
this.redisTemplate = redisTemplate;
}

@Pointcut("@annotation(me.zhengjie.annotation.Limit)")
public void pointcut() {
}

@Around("pointcut()")
public Object around(ProceedingJoinPoint joinPoint) throws Throwable {
HttpServletRequest request = RequestHolder.getHttpServletRequest();
MethodSignature signature = (MethodSignature) joinPoint.getSignature();
Method signatureMethod = signature.getMethod();
Limit limit = signatureMethod.getAnnotation(Limit.class);
LimitType limitType = limit.limitType();
String key = limit.key();
if (StringUtils.isEmpty(key)) {
if (limitType == LimitType.IP) {
key = StringUtils.getIp(request);
} else {
key = signatureMethod.getName();
}
}

ImmutableList<Object> keys = ImmutableList.of(StringUtils.join(limit.prefix(), "_", key, "_", request.getRequestURI().replaceAll("/","_")));

String luaScript = buildLuaScript();
RedisScript<Number> redisScript = new DefaultRedisScript<>(luaScript, Number.class);
Number count = redisTemplate.execute(redisScript, keys, limit.count(), limit.period());
if (null != count && count.intValue() <= limit.count()) {
logger.info("第{}次访问key为 {},描述为 [{}] 的接口", count, keys, limit.name());
return joinPoint.proceed();
} else {
throw new BadRequestException("访问次数受限制");
}
}

/**
* 限流脚本
*/
private String buildLuaScript() {
return "local c" +
"\nc = redis.call('get',KEYS[1])" +
"\nif c and tonumber(c) > tonumber(ARGV[1]) then" +
"\nreturn c;" +
"\nend" +
"\nc = redis.call('incr',KEYS[1])" +
"\nif tonumber(c) == 1 then" +
"\nredis.call('expire',KEYS[1],ARGV[2])" +
"\nend" +
"\nreturn c;";
}
}

+ 27
- 0
wjcy-common/src/main/java/me/zhengjie/aspect/LimitType.java 查看文件

@@ -0,0 +1,27 @@
/*
* Copyright 2019-2020 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS 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;

/**
* 限流枚举
* @author /
*/
public enum LimitType {
// 默认
CUSTOMER,
// by ip addr
IP
}

+ 40
- 0
wjcy-common/src/main/java/me/zhengjie/base/BaseDTO.java 查看文件

@@ -0,0 +1,40 @@
package me.zhengjie.base;

import lombok.Getter;
import lombok.Setter;
import org.apache.commons.lang3.builder.ToStringBuilder;
import java.io.Serializable;
import java.lang.reflect.Field;
import java.sql.Timestamp;

/**
* @author Zheng Jie
* @date 2019年10月24日20:48:53
*/
@Getter
@Setter
public class BaseDTO implements Serializable {

private String createBy;

private String updateBy;

private Timestamp createTime;

private Timestamp updateTime;

@Override
public String toString() {
ToStringBuilder builder = new ToStringBuilder(this);
Field[] fields = this.getClass().getDeclaredFields();
try {
for (Field f : fields) {
f.setAccessible(true);
builder.append(f.getName(), f.get(this)).append("\n");
}
} catch (Exception e) {
builder.append("toString builder encounter an error");
}
return builder.toString();
}
}

+ 85
- 0
wjcy-common/src/main/java/me/zhengjie/base/BaseEntity.java 查看文件

@@ -0,0 +1,85 @@
/*
* Copyright 2019-2020 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package me.zhengjie.base;

import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.UpdateTimestamp;
import org.springframework.data.annotation.CreatedBy;
import org.springframework.data.annotation.LastModifiedBy;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import javax.persistence.Column;
import javax.persistence.EntityListeners;
import javax.persistence.MappedSuperclass;
import java.io.Serializable;
import java.lang.reflect.Field;
import java.sql.Timestamp;

/**
* 通用字段, is_del 根据需求自行添加
* @author Zheng Jie
* @Date 2019年10月24日20:46:32
*/
@Getter
@Setter
@MappedSuperclass
@EntityListeners(AuditingEntityListener.class)
public class BaseEntity implements Serializable {

@CreatedBy
@Column(name = "create_by", updatable = false)
@ApiModelProperty(value = "创建人", hidden = true)
private String createBy;

@LastModifiedBy
@Column(name = "update_by")
@ApiModelProperty(value = "更新人", hidden = true)
private String updateBy;

@CreationTimestamp
@Column(name = "create_time", updatable = false)
@ApiModelProperty(value = "创建时间", hidden = true)
private Timestamp createTime;

@UpdateTimestamp
@Column(name = "update_time")
@ApiModelProperty(value = "更新时间", hidden = true)
private Timestamp updateTime;

/* 分组校验 */
public @interface Create {}

/* 分组校验 */
public @interface Update {}

@Override
public String toString() {
ToStringBuilder builder = new ToStringBuilder(this);
Field[] fields = this.getClass().getDeclaredFields();
try {
for (Field f : fields) {
f.setAccessible(true);
builder.append(f.getName(), f.get(this)).append("\n");
}
} catch (Exception e) {
builder.append("toString builder encounter an error");
}
return builder.toString();
}
}

+ 53
- 0
wjcy-common/src/main/java/me/zhengjie/base/BaseMapper.java 查看文件

@@ -0,0 +1,53 @@
/*
* Copyright 2019-2020 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package me.zhengjie.base;

import java.util.List;

/**
* @author Zheng Jie
* @date 2018-11-23
*/
public interface BaseMapper<D, E> {

/**
* DTO转Entity
* @param dto /
* @return /
*/
E toEntity(D dto);

/**
* Entity转DTO
* @param entity /
* @return /
*/
D toDto(E entity);

/**
* DTO集合转Entity集合
* @param dtoList /
* @return /
*/
List <E> toEntity(List<D> dtoList);

/**
* Entity集合转DTO集合
* @param entityList /
* @return /
*/
List <D> toDto(List<E> entityList);
}

+ 45
- 0
wjcy-common/src/main/java/me/zhengjie/config/AuditorConfig.java 查看文件

@@ -0,0 +1,45 @@
/*
* Copyright 2019-2020 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS 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 me.zhengjie.utils.SecurityUtils;
import org.springframework.data.domain.AuditorAware;
import org.springframework.stereotype.Component;
import java.util.Optional;

/**
* @description : 设置审计
* @author : Dong ZhaoYang
* @date : 2019/10/28
*/
@Component("auditorAware")
public class AuditorConfig implements AuditorAware<String> {

/**
* 返回操作员标志信息
*
* @return /
*/
@Override
public Optional<String> getCurrentAuditor() {
try {
// 这里应根据实际业务情况获取具体信息
return Optional.of(SecurityUtils.getCurrentUsername());
}catch (Exception ignored){}
// 用户定时任务,或者无Token调用的情况
return Optional.of("System");
}
}

+ 105
- 0
wjcy-common/src/main/java/me/zhengjie/config/BeanFactory.java 查看文件

@@ -0,0 +1,105 @@
package me.zhengjie.config;


import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.Map;
/**
* <p>
* bean 工厂, 通过spring容器获取容器中定义的bean
* </p>
*
* @Author xx
* @Date 2021/7/22
**/
@Configuration
public class BeanFactory implements ApplicationContextAware
{
/**
* Spring应用上下文环境
*/
private static ApplicationContext context;

/**
* 实现ApplicationContextAware接口的回调方法,设置上下文环境
*
* @param applicationContext
*/
@Override
public void setApplicationContext(ApplicationContext applicationContext)
{
context = applicationContext;
}

/**
* @return ApplicationContext
*/
final public static ApplicationContext getApplicationContext()
{
return context;
}

public static Object getBean(String name)
{
return context.getBean(name);
}

public static <T> T getBean(String name, Class<T> requiredType)
{
return context.getBean(name, requiredType);
}

public static <T> T getBean(Class<T> requiredType)
{
return context.getBean(requiredType);
}

public static Object getBean(String name, Object... args)
{
return context.getBean(name, args);
}

public static <T> Map<String, T> getBeansOfType(Class<T> type)
{
return context.getBeansOfType(type);
}

public static <T> List<T> getBeans(Class<T> type)
{
Collection<T> beans = context.getBeansOfType(type).values();

@SuppressWarnings("unchecked")
List<T> result = (List<T>) Arrays.asList(beans.toArray());

return result;
}

public static boolean containsBean(String name)
{
return context.containsBean(name);
}

final public static ApplicationContext loadContext()
{
context = new ClassPathXmlApplicationContext("spring_mysql.xml");

return context;
}

public static void main(String[] args)
{
// Map<String, LoginPlugin> plugins = getBeansOfType(LoginPlugin.class);
//
// for (Map.Entry<String, LoginPlugin> element: plugins.entrySet())
// {
// System.out.println(element.getKey() + ": " + element.getValue());
// }
}
}


+ 36
- 0
wjcy-common/src/main/java/me/zhengjie/config/CorsInterceptor.java 查看文件

@@ -0,0 +1,36 @@
package me.zhengjie.config;

import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.HandlerInterceptor;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* <p>
*
* </p>
*
* @Author xx
* @Date 2021/7/19
**/
@Component
public class CorsInterceptor implements HandlerInterceptor {

@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) {
response.setHeader("Access-Control-Allow-Origin", "*");
response.setHeader("Access-Control-Allow-Credentials", "true");
response.setHeader("Access-Control-Allow-Methods", "GET, HEAD, POST, PUT, PATCH, DELETE, OPTIONS");
response.setHeader("Access-Control-Max-Age", "86400");
response.setHeader("Access-Control-Allow-Headers", "*");

// 如果是OPTIONS则结束请求
if (HttpMethod.OPTIONS.toString().equals(request.getMethod())) {
response.setStatus(HttpStatus.NO_CONTENT.value());
return false;
}
return true;
}
}

+ 39
- 0
wjcy-common/src/main/java/me/zhengjie/config/CustomIdGenerator.java 查看文件

@@ -0,0 +1,39 @@
package me.zhengjie.config;


import java.util.concurrent.atomic.AtomicLong;

import org.apache.ibatis.reflection.MetaObject;
import org.apache.ibatis.reflection.SystemMetaObject;
import org.springframework.stereotype.Component;

import com.baomidou.mybatisplus.core.incrementer.IdentifierGenerator;

import lombok.extern.slf4j.Slf4j;

/**
* <p>
* 自定义ID生成器
* </p>
*
* @Author xx
* @Date 2021/7/12
**/
@Slf4j
@Component
public class CustomIdGenerator implements IdentifierGenerator {

private final AtomicLong al = new AtomicLong(1);

@Override
public Long nextId(Object entity) {
//可以将当前传入的class全类名来作为bizKey,或者提取参数来生成bizKey进行分布式Id调用生成.
String bizKey = entity.getClass().getName();
log.info("bizKey:{}", bizKey);
MetaObject metaObject = SystemMetaObject.forObject(entity);
String name = (String) metaObject.getValue("name");
final long id = al.getAndAdd(1);
log.info("为{}生成主键值->:{}", name, id);
return id;
}
}

+ 58
- 0
wjcy-common/src/main/java/me/zhengjie/config/DhApiProperties.java 查看文件

@@ -0,0 +1,58 @@
package me.zhengjie.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;

/**
* 敦煌Api Properties
* @author rch
* @date 2022-06-27
*/
@Component
@Configuration
public class DhApiProperties {

public static String ACCESS_TOKEN;
public static String BUY_ORDER_URL;
public static String BUY_ORDER_METHOD;
public static String BUY_ORDER_V;
public static String PAY_ORDER_URL;
public static String PAY_ORDER_METHOD;
public static String PAY_ORDER_V;

@Value("${dh.access_token}")
public void setAccessToken(String accessToken) {
DhApiProperties.ACCESS_TOKEN = accessToken;
}

@Value("${dh.buy_order_url}")
public void setBuyOrderUrl(String buyOrderUrl) {
DhApiProperties.BUY_ORDER_URL = buyOrderUrl;
}

@Value("${dh.buy_order_method}")
public void setBuyOrderMethod(String buyOrderMethod) {
DhApiProperties.BUY_ORDER_METHOD = buyOrderMethod;
}

@Value("${dh.buy_order_v}")
public void setBuyOrderV(String buyOrderV) {
DhApiProperties.BUY_ORDER_V = buyOrderV;
}

@Value("${dh.pay_order_url}")
public void setPayOrderUrl(String payOrderUrl) {
DhApiProperties.PAY_ORDER_URL = payOrderUrl;
}

@Value("${dh.pay_order_method}")
public void setPayOrderMethod(String payOrderMethod) {
DhApiProperties.PAY_ORDER_METHOD = payOrderMethod;
}

@Value("${dh.pay_order_v}")
public void setPayOrderV(String payOrderV) {
DhApiProperties.PAY_ORDER_V = payOrderV;
}
}

+ 37
- 0
wjcy-common/src/main/java/me/zhengjie/config/ElPermissionConfig.java 查看文件

@@ -0,0 +1,37 @@
/*
* Copyright 2019-2020 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS 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 me.zhengjie.utils.SecurityUtils;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.stereotype.Service;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

/**
* @author Zheng Jie
*/
@Service(value = "el")
public class ElPermissionConfig {

public Boolean check(String ...permissions){
// 获取当前用户的所有权限
List<String> elPermissions = SecurityUtils.getCurrentUser().getAuthorities().stream().map(GrantedAuthority::getAuthority).collect(Collectors.toList());
// 判断当前用户的所有权限是否包含接口上定义的权限
return elPermissions.contains("admin") || Arrays.stream(permissions).anyMatch(elPermissions::contains);
}
}

+ 60
- 0
wjcy-common/src/main/java/me/zhengjie/config/FileProperties.java 查看文件

@@ -0,0 +1,60 @@
/*
* Copyright 2019-2020 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS 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 lombok.Data;
import me.zhengjie.utils.ElAdminConstant;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

/**
* @author Zheng Jie
*/
@Data
@Configuration
@ConfigurationProperties(prefix = "file")
public class FileProperties {

/** 文件大小限制 */
private Long maxSize;

/** 头像大小限制 */
private Long avatarMaxSize;

private ElPath mac;

private ElPath linux;

private ElPath windows;

public ElPath getPath(){
String os = System.getProperty("os.name");
if(os.toLowerCase().startsWith(ElAdminConstant.WIN)) {
return windows;
} else if(os.toLowerCase().startsWith(ElAdminConstant.MAC)){
return mac;
}
return linux;
}

@Data
public static class ElPath{

private String path;

private String avatar;
}
}

+ 31
- 0
wjcy-common/src/main/java/me/zhengjie/config/MvcConfig.java 查看文件

@@ -0,0 +1,31 @@
package me.zhengjie.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
* <p>
* 开放url访问上传到本地的图片
* </p>
*
* @Author xx
* @Date 2021/8/11
**/
@Configuration
public class MvcConfig implements WebMvcConfigurer {

@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
/*
* 说明:增加虚拟路径(经过本人测试:在此处配置的虚拟路径,用springboot内置的tomcat时有效,
* 用外部的tomcat也有效;所以用到外部的tomcat时不需在tomcat/config下的相应文件配置虚拟路径了,阿里云linux也没问题)
*/
registry.addResourceHandler("/**").addResourceLocations("file:"+SystemConfig.IMG_PATH);

// 因为doc.html是在jar包里的,需要使用资源处理器注册静态资源。
registry.addResourceHandler("doc.html").addResourceLocations("classpath:/META-INF/resources/");
registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/");
}

}

+ 82
- 0
wjcy-common/src/main/java/me/zhengjie/config/MyMetaObjectHandler.java 查看文件

@@ -0,0 +1,82 @@
package me.zhengjie.config;

import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import me.zhengjie.utils.DateUtil;
import me.zhengjie.utils.SecurityUtils;
import me.zhengjie.utils.StringUtils;
import me.zhengjie.utils.ValidationUtil;
import org.apache.ibatis.reflection.MetaObject;
import org.springframework.stereotype.Component;

import java.lang.reflect.Field;
import java.lang.reflect.Method;

/**
* <p>
* MyBatis Plus自动填充插入&更新时间
* </p>
*
* @author: zeng
* @since: 2020-07-15
*/
@Slf4j
@Component
public class MyMetaObjectHandler implements MetaObjectHandler {

@Override
public void insertFill(MetaObject metaObject) {
log.info("start insert fill ....");
Object object = metaObject.getOriginalObject();
String gmName = getGmName();
if (ObjectUtil.isNotEmpty(gmName)) {
setValue(object,"gmName",gmName);
}

if (ValidationUtil.isExistFieldName("createdAt", object)) {
setValue(object, "createdAt", DateUtil.getCurrentTime());
}

if (ValidationUtil.isExistFieldName("updatedAt", object)) {
setValue(object, "updatedAt", DateUtil.getCurrentTime());
}
}

@SneakyThrows
@Override
public void updateFill(MetaObject metaObject) {
Object object = metaObject.getOriginalObject();
log.info("start update fill ....");
String gmName = getGmName();
if (ObjectUtil.isNotNull(gmName)) {
setValue(object,"gmName",gmName);
}

if (ValidationUtil.isExistFieldName("updatedAt", object)) {
setValue(object, "updatedAt", DateUtil.getCurrentTime());
}
}

private void setValue( Object object, String fieldName, Object value) {
try {
if (ObjectUtil.isNotNull(value)) {
String str = "set" + StringUtils.toUpperCase4Index(fieldName);
Method method = object.getClass().getMethod(str, String.class);
method.invoke(object, value);
}
} catch (Exception e) {
e.printStackTrace();
}
}


private String getGmName() {
try {
return SecurityUtils.getCurrentUsername();
} catch (Exception e) {
return null;
}
}
}

+ 32
- 0
wjcy-common/src/main/java/me/zhengjie/config/MybatisPlusConfig.java 查看文件

@@ -0,0 +1,32 @@
package me.zhengjie.config;

import com.baomidou.mybatisplus.extension.plugins.OptimisticLockerInterceptor;
import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.transaction.annotation.EnableTransactionManagement;

/**
* @author
* @date
*/
@Configuration
@ConditionalOnClass(value = {PaginationInterceptor.class})
@EnableTransactionManagement
public class MybatisPlusConfig {
@Bean
public PaginationInterceptor paginationInterceptor() {
PaginationInterceptor paginationInterceptor = new PaginationInterceptor();
return paginationInterceptor;
}

/**
* 乐观锁 :CAS方案解决 当要更新一条记录的时候,希望这条记录没有被别人更新
* @return
*/
@Bean
public OptimisticLockerInterceptor optimisticLockerInterceptor() {
return new OptimisticLockerInterceptor();
}
}

+ 44
- 0
wjcy-common/src/main/java/me/zhengjie/config/PlatsProperties.java 查看文件

@@ -0,0 +1,44 @@
/*
* Copyright 2019-2020 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS 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 lombok.Data;
import me.zhengjie.utils.ElAdminConstant;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

/**
* @author rch
* @date 2022-07-06
*/
@Data
@Configuration
@ConfigurationProperties(prefix = "plats")
public class PlatsProperties {
private DhProperties dh;
@Data
public static class DhProperties{
private String buyOrderUrl;
private String buyOrderMethod;
private String buyOrderv;
private String payOrder_url;
private String payOrderMethod;
private String payOrderv;
}
}

+ 30
- 0
wjcy-common/src/main/java/me/zhengjie/config/PropertiesConfig.java 查看文件

@@ -0,0 +1,30 @@
package me.zhengjie.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;
/**
* <p>
*
* </p>
*
* @Author xx
* @Date 2021/7/26
**/
@Data
@Component
@Configuration
@ConfigurationProperties(prefix = "config")
public class PropertiesConfig {

private String uploadPrefix;
private Map<Integer,String> uploadImgPath;
private List<String> excludeUrlList;
private List<String> sustainImgFormat;
/** 放掉的api 校验token */
private String apiToken;
}

+ 223
- 0
wjcy-common/src/main/java/me/zhengjie/config/RedisConfig.java 查看文件

@@ -0,0 +1,223 @@
/*
* Copyright 2019-2020 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS 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 cn.hutool.core.lang.Assert;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.parser.ParserConfig;
import com.alibaba.fastjson.serializer.SerializerFeature;
import lombok.extern.slf4j.Slf4j;
import me.zhengjie.utils.StringUtils;
import org.apache.commons.codec.digest.DigestUtils;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.data.redis.RedisProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.cache.Cache;
import org.springframework.cache.annotation.CachingConfigurerSupport;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.cache.interceptor.CacheErrorHandler;
import org.springframework.cache.interceptor.KeyGenerator;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.cache.RedisCacheConfiguration;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.core.RedisOperations;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.data.redis.serializer.RedisSerializationContext;
import org.springframework.data.redis.serializer.RedisSerializer;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.time.Duration;
import java.util.HashMap;
import java.util.Map;

/**
* @author Zheng Jie
* @date 2018-11-24
*/
@Slf4j
@Configuration
@EnableCaching
@ConditionalOnClass(RedisOperations.class)
@EnableConfigurationProperties(RedisProperties.class)
public class RedisConfig extends CachingConfigurerSupport {

/**
* 设置 redis 数据默认过期时间,默认2小时
* 设置@cacheable 序列化方式
*/
@Bean
public RedisCacheConfiguration redisCacheConfiguration(){
FastJsonRedisSerializer<Object> fastJsonRedisSerializer = new FastJsonRedisSerializer<>(Object.class);
RedisCacheConfiguration configuration = RedisCacheConfiguration.defaultCacheConfig();
configuration = configuration.serializeValuesWith(RedisSerializationContext.
SerializationPair.fromSerializer(fastJsonRedisSerializer)).entryTtl(Duration.ofHours(6));
return configuration;
}

@SuppressWarnings("all")
@Bean(name = "redisTemplate")
@ConditionalOnMissingBean(name = "redisTemplate")
public RedisTemplate<Object, Object> redisTemplate(RedisConnectionFactory redisConnectionFactory) {
RedisTemplate<Object, Object> template = new RedisTemplate<>();
//序列化
FastJsonRedisSerializer<Object> fastJsonRedisSerializer = new FastJsonRedisSerializer<>(Object.class);
// value值的序列化采用fastJsonRedisSerializer
template.setValueSerializer(fastJsonRedisSerializer);
template.setHashValueSerializer(fastJsonRedisSerializer);
// 全局开启AutoType,这里方便开发,使用全局的方式
ParserConfig.getGlobalInstance().setAutoTypeSupport(true);
// 建议使用这种方式,小范围指定白名单
// ParserConfig.getGlobalInstance().addAccept("me.zhengjie.domain");
// key的序列化采用StringRedisSerializer
template.setKeySerializer(new StringRedisSerializer());
template.setHashKeySerializer(new StringRedisSerializer());
template.setConnectionFactory(redisConnectionFactory);
return template;
}

@Bean
public StringRedisTemplate stringRedisTemplate(RedisConnectionFactory redisConnectionFactory) {
StringRedisTemplate stringRedisTemplate = new StringRedisTemplate();
stringRedisTemplate.setConnectionFactory(redisConnectionFactory);
return stringRedisTemplate;
}

/**
* 自定义缓存key生成策略,默认将使用该策略
*/
@Bean
@Override
public KeyGenerator keyGenerator() {
return (target, method, params) -> {
Map<String,Object> container = new HashMap<>(3);
Class<?> targetClassClass = target.getClass();
// 类地址
container.put("class",targetClassClass.toGenericString());
// 方法名称
container.put("methodName",method.getName());
// 包名称
container.put("package",targetClassClass.getPackage());
// 参数列表
for (int i = 0; i < params.length; i++) {
container.put(String.valueOf(i),params[i]);
}
// 转为JSON字符串
String jsonString = JSON.toJSONString(container);
// 做SHA256 Hash计算,得到一个SHA256摘要作为Key
return DigestUtils.sha256Hex(jsonString);
};
}

@Bean
@Override
public CacheErrorHandler errorHandler() {
// 异常处理,当Redis发生异常时,打印日志,但是程序正常走
log.info("初始化 -> [{}]", "Redis CacheErrorHandler");
return new CacheErrorHandler() {
@Override
public void handleCacheGetError(RuntimeException e, Cache cache, Object key) {
log.error("Redis occur handleCacheGetError:key -> [{}]", key, e);
}

@Override
public void handleCachePutError(RuntimeException e, Cache cache, Object key, Object value) {
log.error("Redis occur handleCachePutError:key -> [{}];value -> [{}]", key, value, e);
}

@Override
public void handleCacheEvictError(RuntimeException e, Cache cache, Object key) {
log.error("Redis occur handleCacheEvictError:key -> [{}]", key, e);
}

@Override
public void handleCacheClearError(RuntimeException e, Cache cache) {
log.error("Redis occur handleCacheClearError:", e);
}
};
}

}

/**
* Value 序列化
*
* @author /
* @param <T>
*/
class FastJsonRedisSerializer<T> implements RedisSerializer<T> {

private final Class<T> clazz;

FastJsonRedisSerializer(Class<T> clazz) {
super();
this.clazz = clazz;
}

@Override
public byte[] serialize(T t) {
if (t == null) {
return new byte[0];
}
return JSON.toJSONString(t, SerializerFeature.WriteClassName).getBytes(StandardCharsets.UTF_8);
}

@Override
public T deserialize(byte[] bytes) {
if (bytes == null || bytes.length <= 0) {
return null;
}
String str = new String(bytes, StandardCharsets.UTF_8);
return JSON.parseObject(str, clazz);
}

}

/**
* 重写序列化器
*
* @author /
*/
class StringRedisSerializer implements RedisSerializer<Object> {

private final Charset charset;

StringRedisSerializer() {
this(StandardCharsets.UTF_8);
}

private StringRedisSerializer(Charset charset) {
Assert.notNull(charset, "Charset must not be null!");
this.charset = charset;
}

@Override
public String deserialize(byte[] bytes) {
return (bytes == null ? null : new String(bytes, charset));
}

@Override
public byte[] serialize(Object object) {
String string = JSON.toJSONString(object);
if (StringUtils.isBlank(string)) {
return null;
}
string = string.replace("\"", "");
return string.getBytes(charset);
}
}

+ 48
- 0
wjcy-common/src/main/java/me/zhengjie/config/RedissonConfig.java 查看文件

@@ -0,0 +1,48 @@
package me.zhengjie.config;

import cn.hutool.core.util.ObjectUtil;
import lombok.Data;
import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
* <p>
*redisson 配置类
* </p>
*
* @Author xx
* @Date 2021/8/11
**/
@Configuration
@Data
public class RedissonConfig {
@Value("${spring.redis.host}")
private String host;

@Value("${spring.redis.port}")
private String port;

@Value("${spring.redis.password}")
private String password;

@Value("${spring.redis.database}")
private Integer database;

@Bean
public RedissonClient getRedisson(){

Config config = new Config();
// 若redis为设置密码,将密码设置为null (防止password='' 运行报错)
if (ObjectUtil.isEmpty(password)) {
password = null;
}
config.useSingleServer().setAddress("redis://" + host + ":" + port).setDatabase(database).setPassword(password);
//添加主从配置
// config.useMasterSlaveServers().setMasterAddress("").setPassword("").addSlaveAddress(new String[]{"",""});

return Redisson.create(config);
}
}

+ 38
- 0
wjcy-common/src/main/java/me/zhengjie/config/RsaProperties.java 查看文件

@@ -0,0 +1,38 @@
/*
* Copyright 2019-2020 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS 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 lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
* @author Zheng Jie
* @website https://el-admin.vip
* @description
* @date 2020-05-18
**/
@Data
@Component
public class RsaProperties {

public static String privateKey;

@Value("${rsa.private_key}")
public void setPrivateKey(String privateKey) {
RsaProperties.privateKey = privateKey;
}
}

+ 217
- 0
wjcy-common/src/main/java/me/zhengjie/config/SwaggerConfig.java 查看文件

@@ -0,0 +1,217 @@
/*
* Copyright 2019-2020 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS 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 springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.ParameterBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.schema.ModelRef;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact;
import springfox.documentation.service.Parameter;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc;

import java.util.ArrayList;
import java.util.List;

/**
* api页面 /doc.html
* @author Zheng Jie
* @date 2018-11-23
*/
@Configuration
@EnableSwagger2WebMvc//新版本
public class SwaggerConfig {

@Bean(value = "buildBaseDocket")
public Docket buildBaseDocket() {
return new Docket(DocumentationType.SWAGGER_2)
.groupName("基础业务接口")
.apiInfo(buildApiInf())
.select()
//controller包路径
.apis(RequestHandlerSelectors.basePackage("me.zhengjie.modules.group.controller.base"))
.paths(PathSelectors.any())
.build()
.globalOperationParameters(getParmeter());
}

@Bean(value = "buildOtherDocket")
public Docket buildOtherDocket() {
return new Docket(DocumentationType.SWAGGER_2)
.groupName("其他业务接口")
.apiInfo(buildApiInf())
.select()
//controller包路径
.apis(RequestHandlerSelectors.basePackage("me.zhengjie.modules.capital.controller.base"))
.paths(PathSelectors.any())
.build()
.globalOperationParameters(getParmeter());
}

@Bean(value = "buildCallBackDocket")
public Docket buildCallBackDocket() {
return new Docket(DocumentationType.SWAGGER_2)
.groupName("回调业务接口")
.apiInfo(buildApiInf())
.select()
//controller包路径
.apis(RequestHandlerSelectors.basePackage("me.zhengjie.modules.group.controller.callbcak"))
.paths(PathSelectors.any())
.build()
.globalOperationParameters(getParmeter());
}

@Bean(value = "buildSystemDocket")
public Docket buildSystemDocket() {
return new Docket(DocumentationType.SWAGGER_2)
.groupName("系统业务接口")
.apiInfo(buildApiInf())
.select()
//controller包路径
.apis(RequestHandlerSelectors.basePackage("me.zhengjie.modules.system.rest"))
.paths(PathSelectors.any())
.build()
.globalOperationParameters(getParmeter());
}

/**
* 描述信息
*/
private ApiInfo buildApiInf() {
return new ApiInfoBuilder()
// 文档标题
.title("旺嘉分销管理系统-接口文档")
// 版本信息
.version("1.0")
// 文档描述
.description("旺嘉分销管理系统管理文档")
// 版权地址
.termsOfServiceUrl("http://www.wjcy.com")
// 版权
.license("旺嘉创亿")
// 联系人信息
.contact(new Contact("rch", "http://www.baidu.com", "baidu@qq.com"))
.build();
}


public List<Parameter> getParmeter() {
ParameterBuilder tokenPar = new ParameterBuilder();
List<Parameter> pars = new ArrayList<>();
tokenPar.name("Authorization").description("令牌").defaultValue("设置token默认值").modelRef(new ModelRef("string")).parameterType("header").required(false).build();
pars.add(tokenPar.build());
return pars;
}


// @Bean
// @SuppressWarnings("all")
// public Docket createRestApi() {
// return new Docket(DocumentationType.SWAGGER_2)
// .enable(enabled)
// .pathMapping("/")
// .apiInfo(apiInfo())
// .select()
// .paths(Predicates.not(PathSelectors.regex("/error.*")))
// .paths(PathSelectors.any())
// .build()
// //添加登陆认证
// .securitySchemes(securitySchemes())
// .securityContexts(securityContexts());
// }
//
// private ApiInfo apiInfo() {
// return new ApiInfoBuilder()
// .description("一个简单且易上手的 Spring boot 后台管理框架")
// .title("EL-ADMIN 接口文档")
// .version("2.6")
// .build();
// }
//
// private List<SecurityScheme> securitySchemes() {
// //设置请求头信息
// List<SecurityScheme> securitySchemes = new ArrayList<>();
// ApiKey apiKey = new ApiKey(tokenHeader, tokenHeader, "header");
// securitySchemes.add(apiKey);
// return securitySchemes;
// }
//
// private List<SecurityContext> securityContexts() {
// //设置需要登录认证的路径
// List<SecurityContext> securityContexts = new ArrayList<>();
// // ^(?!auth).*$ 表示所有包含auth的接口不需要使用securitySchemes即不需要带token
// // ^标识开始 ()里是一子表达式 ?!/auth表示匹配不是/auth的位置,匹配上则添加请求头,注意路径已/开头 .表示任意字符 *表示前面的字符匹配多次 $标识结束
// securityContexts.add(getContextByPath());
// return securityContexts;
// }
//
// private SecurityContext getContextByPath() {
// return SecurityContext.builder()
// .securityReferences(defaultAuth())
// .forPaths(PathSelectors.regex("^(?!/auth).*$"))
// .build();
// }
//
// private List<SecurityReference> defaultAuth() {
// List<SecurityReference> securityReferences = new ArrayList<>();
// AuthorizationScope authorizationScope = new AuthorizationScope("global", "accessEverything");
// AuthorizationScope[] authorizationScopes = new AuthorizationScope[1];
// authorizationScopes[0] = authorizationScope;
// securityReferences.add(new SecurityReference(tokenHeader, authorizationScopes));
// return securityReferences;
// }
//}
//
///**
// * 将Pageable转换展示在swagger中
// */
//@Configuration
//class SwaggerDataConfig {
//
// @Bean
// public AlternateTypeRuleConvention pageableConvention(final TypeResolver resolver) {
// return new AlternateTypeRuleConvention() {
// @Override
// public int getOrder() {
// return Ordered.HIGHEST_PRECEDENCE;
// }
//
// @Override
// public List<AlternateTypeRule> rules() {
// return newArrayList(newRule(resolver.resolve(Pageable.class), resolver.resolve(Page.class)));
// }
// };
// }
//
// @ApiModel
// @Data
// private static class Page {
// @ApiModelProperty("页码 (0..N)")
// private Integer page;
//
// @ApiModelProperty("每页显示的数目")
// private Integer size;
//
// @ApiModelProperty("以下列格式排序标准:property[,asc | desc]。 默认排序顺序为升序。 支持多种排序条件:如:id,asc")
// private List<String> sort;
// }
}

+ 97
- 0
wjcy-common/src/main/java/me/zhengjie/config/SystemConfig.java 查看文件

@@ -0,0 +1,97 @@
package me.zhengjie.config;


import cn.hutool.core.lang.Snowflake;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;
/**
* <p>
* 系统配置类,从配置文件中注入配置信息
* </p>
*
* @Author xx
* @Date 2021/7/21
**/
@Component
@Configuration
public class SystemConfig {

/** 聊天室默认头像 */
public static String DEFAULT_MEMBER_HEAD = "/capital/chat/head/default.jpg";
/**
* 图片存放的绝对路径
*/
public static String IMG_PATH;
/**
* 静态资源访问路径(返回前端时添加)
*/
public static String FILE_VISIT_ADDR;
/**
* 文件上传接口后缀,用来放行xss过滤
*/
public static String UPLOAD_SUFFIX;
/**
* 单文件上传大小限制,单位 :MB
*/
public static Integer MAX_FILE_SIZE;
/**
* 视频单文件上传大小限制,单位 :MB
*/
public static Integer VIDEO_MAX_FILE_SIZE;

/** 多语言文件路径 */
public static String LANGUAGE_PATH;

public static final String publicKey = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCn4jGDcYFGhxNaIKO+oK6ALzHzXupk7+aYa7FYlnS6A/AM9cwgzdksGqfKi7//XDlrqp5jyfecciU7KW7xzs9g+8ZHGy8IEVBqhsOBOjPvi3twc9kdWPhtsRY5X1J2PfRilT/jIMDpBflLf0CrrrPXezKENwRMxlkmSOZqvg0sOwIDAQAB";
public static final String privateKey = "MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBAKfiMYNxgUaHE1ogo76groAvMfNe6mTv5phrsViWdLoD8Az1zCDN2Swap8qLv/9cOWuqnmPJ95xyJTspbvHOz2D7xkcbLwgRUGqGw4E6M++Le3Bz2R1Y+G2xFjlfUnY99GKVP+MgwOkF+Ut/QKuus9d7MoQ3BEzGWSZI5mq+DSw7AgMBAAECgYEAlnQ7JW5aicdSC4qG1LcRy+T/4filHXJ1+RFCbX7g+ze+MQ8zMg7o2wLEbtvRZFvVRe0xZ4K/+p+9SAj42ZIa/H7ktxhkaxNHVYHVafAuLu2/VFCc7vNPUVu5Fx1xLEg0q2q5TJ2OPlzh9aARh4PW1IetLPBeQSi1qUHVrhPQvskCQQDSxIYv3dpFw9ljqtSriNtIfHSqYAATGtp5SvFfw63fRtvxK6X5Zkdy9ExYe9SOm9u3Q7P4QEKbd4Rbf22Zp2O3AkEAy+mjDGtUP7unrfpuEpe/b+uMPB5+jcmTDDsu3ReZcTzH6BFCqeyR3FBsApLSVWLXuJNKfdKGmH/SwXv2nFUjnQJBAMUE7CKmkbkRYI7oS7ClV8YkgLIa1zcErSEgyw0nz8qdZE/G63l9AGEWuJ8l8gX076gaY4s2Fo1ZZaJaNcuiS3UCQCXFxbpLN3QG4uzLcxBmo8OrsnKAg5joOiEN5YR3FqlvROisKdkoRWy2SQvA/s1qXeOHBUmBcgVVyEinGeujqdECQAeBvDraddWeGuqTEtOXJhQiPxmahUWE2h5htpFdK3+cVt5HiRM89SLM64kHAx7m/RxiGscnhbbXUvSx0H/36R0=";

/** websocket服务器连接地址 */
public static String WS_URL;
/** 百度翻译 APPID */
public static String BAIDU_APPID;
/** 百度翻译privateKey */
public static String BAIDU_PRIVATEKEY;
/** 百度翻译URL */
public static final String BAIDU_URL = "https://fanyi-api.baidu.com/api/trans/vip/translate";

public static String IP2REGION_DB_PATH;
@Value("${system.imgPath}")
public void setImgPath(String imgPath) {
IMG_PATH = imgPath;
}

@Value("${system.fileVisitAddr}")
public void setFileVisitAddr(String fileVisitAddr) {
FILE_VISIT_ADDR = fileVisitAddr;
}
@Value("${system.uploadSuffix}")
public void setUploadSuffix(String uploadSuffix) {
UPLOAD_SUFFIX = uploadSuffix;
}
@Value("${system.maxFileSize}")
public void setMaxFileSize(Integer maxFileSize) {
MAX_FILE_SIZE = maxFileSize;
}

@Value("${system.maxVideoFileSize}")
public void setVideoMaxFileSize(Integer maxVideoFileSize) {
VIDEO_MAX_FILE_SIZE = maxVideoFileSize;
}

@Value("${system.ip2regionDbPath}")
public void setIp2regionDbPath(String ip2regionDbPath) {
IP2REGION_DB_PATH = ip2regionDbPath;
}

@Value("${system.languagePath}")
public void setLanguagePath(String languagePath) {
LANGUAGE_PATH = languagePath;
}

@Bean
public Snowflake snowFlakeInit() {
return new Snowflake(2, 3);
}
}

+ 34
- 0
wjcy-common/src/main/java/me/zhengjie/config/YdApiProperties.java 查看文件

@@ -0,0 +1,34 @@
package me.zhengjie.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;

/**
* 影刀Api Properties
* @author rch
* @date 2022-07-27
*/
@Component
@Configuration
public class YdApiProperties {

public static String ACCESS_KEY_ID;
public static String ACCESS_KEY_SECRET;
public static String CALLBACK;

@Value("${yd.accessKeyId}")
public void setAccessKeyId(String accessKeyId) {
ACCESS_KEY_ID = accessKeyId;
}

@Value("${yd.accessKeySecret}")
public void setAccessKeySecret(String accessKeySecret) {
ACCESS_KEY_SECRET = accessKeySecret;
}

@Value("${yd.callback}")
public void setCALLBACK(String CALLBACK) {
YdApiProperties.CALLBACK = CALLBACK;
}
}

+ 30
- 0
wjcy-common/src/main/java/me/zhengjie/config/constant/Constants.java 查看文件

@@ -0,0 +1,30 @@
package me.zhengjie.config.constant;

/**
* <p>
* 常量实体类
* </p>
*
* @author: rch
* @date: 2021-11-23
*/
public class Constants {
/** redis token前缀*/
public static final String TOKEN_PREFIX = "sessions:";
/** 前端token请求头名称*/
public static final String TOKEN_HEAD_NAME = "token";
/** redis 手机验证码前缀*/
public static final String PHONE_VERIFY_CODE = "phone:";
/** 表单重复提交时间间隔,单位;秒 */
public static final long FORM_SUB_SECOND = 1L;
/** 表单重复提交验证的token前缀*/
public static final String FORM_SUB_TOKEN = "formSubToken:";
/** 用户默认头像地址 */
public static final String USER_DEFAULT_HEAD = "/sports/file/userHead/default.jpg";

/** 代理后台用户token redis key前缀 */
public static final String PROXY_ADMIN_TOKEN_PREFIX = "proxy:sessions:";

/** 代理后台 访问量统计 "pageviews:"+invite_code*/
public final static String PAGE_VIEWS_REDIS_PREFIX = "pageviews:";
}

+ 16
- 0
wjcy-common/src/main/java/me/zhengjie/constant/Constants.java 查看文件

@@ -0,0 +1,16 @@
package me.zhengjie.constant;

/**
* 通用常量信息
*
* @author rch
* @create 2022-08-01
*/
public class Constants {
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 final static String QUERY_JOB_URL = "https://api.winrobot360.com/oapi/dispatch/v2/job/query";

public final static String ERP_AUTH_TOKEN = "ErpAuthToken ddabd37130f86a8ee5f03887552c0b69";
}

+ 56
- 0
wjcy-common/src/main/java/me/zhengjie/constant/PublicConstant.java 查看文件

@@ -0,0 +1,56 @@
package me.zhengjie.constant;

/**
*
* @Description 通用常量
* @Date 2022/1/20
* @Author zeng
*/
public interface PublicConstant {

/** 缓存失效时间 */
Integer CACHE_OVER_TIME = 1800;

/** 设备使用缓存前缀 */
String REBOT_PREFIX = "rebot:%s";

/** 全局系统设置 */
String SETTING_SITE_PREFIX = "setting_site:%s";

/** 更新会员信息 */
String MEMBER_PROFIT_LOCK_KEY = "member_update_key:%s";

String DH_REQUEST_SUCCESS_STATUS_CODE = "00000000";

String RESPONSE_SUCCESS = "SUCCESS";

Integer EXPORT_EXCEL_FILE_TYPE = 11;

/** 刷单信息对应执行过的买家信息 */
String CLICK_FARMING_EXEC_ID_SET = "click_farming_exec:id:%s";

/** 执行任务前缀 */
String JOB_UUID_KEY_PREFIX = "JOB_UUID_KEY:%s";

static String getMemberUpdateKeyPrefix(Long memberId) {
return String.format(MEMBER_PROFIT_LOCK_KEY, memberId);
}

static String getJobUuidKeyPrefix(String jobUuid) {
return String.format(JOB_UUID_KEY_PREFIX, jobUuid);
}

/**
* 刷单信息对应执行过的买家Id集合拼接
* @param clickFarmingId
* @return
*/
static String getClickFarmingExecBuyerIdPrefix(Long clickFarmingId) {
return String.format(CLICK_FARMING_EXEC_ID_SET, clickFarmingId);
}


static String getRebotKeyPrefix(String accountName) {
return String.format(REBOT_PREFIX, accountName);
}
}

+ 39
- 0
wjcy-common/src/main/java/me/zhengjie/dao/CtApplyDao.java 查看文件

@@ -0,0 +1,39 @@
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.CtApply;
import me.zhengjie.service.vo.CtApplyListVO;
import me.zhengjie.service.vo.CtBuyerListVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
* 影刀应用信息(CtApply)表数据库访问层
*
* @author rch
* @since 2022-07-23
*/
@Mapper
public interface CtApplyDao extends BaseMapper<CtApply> {


@Select("select * from ct_apply ${ew.customSqlSegment}")
IPage<CtApplyListVO> searchPageList(IPage<CtApplyListVO> page, Wrapper ew);

/**
* 获取所有应用名称
* @return List
*/
@Select("select id,name, platform_id from ct_apply")
List<CtApplyListVO> getAllApplyName();

@Select("select * from ct_apply where task_name = #{taskName} and method_name = #{method}")
CtApply getApplyByTaskAndMethod(String taskName, String method);
}




+ 61
- 0
wjcy-common/src/main/java/me/zhengjie/dao/CtBrowseDao.java 查看文件

@@ -0,0 +1,61 @@
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.CtBrowse;
import me.zhengjie.service.vo.CtBrowseDetailVO;
import me.zhengjie.service.vo.CtBrowseListVO;
import me.zhengjie.service.vo.CtBuyerListVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

/**
* 刷单-订单信息(CtBrowse)表数据库访问层
*
* @author rch
* @since 2022-11-04
*/
@Mapper
public interface CtBrowseDao extends BaseMapper<CtBrowse> {

/**
* 分页查询
* @param page
* @param ew
*/
// @Select("select * from ct_browse ${ew.customSqlSegment} ")
@Select("SELECT\n" +
"\tctBrowse.id,\n" +
"\tctBrowse.buyer_id,\n" +
"\tctBrowse.link_url,\n" +
"\tctBrowse.created_at,\n" +
"\tctBrowse.updated_at,\n" +
"\tctBrowse.payment_results,\n" +
"\tctBrowse.status,\n" +
"\tctBrowse.gm_name,\n" +
"\tctBuyer.contntry_short as country,\n" +
"\tctBuyer.account\n" +
"FROM\n" +
"\tct_browse ctBrowse\n" +
"LEFT JOIN \n" +
"\tct_buyer ctBuyer \n" +
"ON \n" +
"\tctBrowse.buyer_id = ctBuyer.id ${ ew.customSqlSegment}")
IPage<CtBrowseListVO> searchPageList(IPage<CtBrowseListVO> page, Wrapper ew);

@Select("select * from ct_browse where id = #{id} for update")
CtBrowse getByIdLock(Long id);

@Select("SELECT\n" +
"\tctBrowse.*,\n" +
"\tctBuyer.account,\n" +
"\tctBuyer.contntry_short as country\n" +
"FROM\n" +
"\tct_browse ctBrowse\n" +
"\tLEFT JOIN ct_buyer ctBuyer ON ctBrowse.buyer_id = ctBuyer.id \n" +
"WHERE\n" +
"\tctBrowse.id = #{id}")
CtBrowseDetailVO getBrowseDetailById(Long id);
}


+ 56
- 0
wjcy-common/src/main/java/me/zhengjie/dao/CtBuyerDao.java 查看文件

@@ -0,0 +1,56 @@
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.CtBuyer;
import me.zhengjie.service.vo.CtBuyerDetailVO;
import me.zhengjie.service.vo.CtBuyerListVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
* 买家信息表(CtBuyer)表数据库访问层
*
* @author rch
* @since 2022-06-22
*/
@Mapper
public interface CtBuyerDao extends BaseMapper<CtBuyer> {

// @Select("select t1.*, t2.name as companyName, t3.id as cardId, t3.number as number, t3.pwd as cardPwd, t3.holder_surname as holderSurname, t3.holder_name as holderName, t4.id as vpnId, t4.ip_address as ipAddress, t4.link as vpn from ct_buyer t1 left join ct_company t2 on t1.company_id = t2.id left join ct_card t3 on t1.card_id = t3.id left join ct_vpn t4 on t1.vpn_id = t4.id ${ew.customSqlSegment} ")
@Select("SELECT\n" +
"\tt1.*,\n" +
"\tt2.NAME AS companyName,\n" +
"\tt5.NAME AS platformName,\n" +
"\tt3.id AS cardId,\n" +
"\tt3.number AS number,\n" +
"\tt3.pwd AS cardPwd,\n" +
"\tt3.holder_surname AS holderSurname,\n" +
"\tt3.holder_name AS holderName,\n" +
"\tt4.id AS vpnId,\n" +
"\tt4.ip_address AS ipAddress,\n" +
"\tt4.link AS vpn \n" +
"FROM\n" +
"\tct_buyer t1\n" +
"\tLEFT JOIN ct_company t2 ON t1.company_id = t2.id\n" +
"\tLEFT JOIN ct_platform t5 ON t1.platform_id = t5.id\n" +
"\tLEFT JOIN ct_card t3 ON t1.card_id = t3.id\n" +
"\tLEFT JOIN ct_vpn t4 ON t1.vpn_id = t4.id ${ ew.customSqlSegment }")
IPage<CtBuyerListVO> searchPageList(IPage<CtBuyerListVO> page, Wrapper ew);

@Select("select t1.*, t2.name as companyName, t3.ip_address as ipAddress, t3.link as vpn, t4.number, t4.pwd as cardPwd, t4.holder_surname as holderSurname, t4.holder_name as holderName from ct_buyer t1 left join ct_company t2 on t1.company_id = t2.id left join ct_vpn t3 on t1.vpn_id = t3.id left join ct_card t4 on t1.card_id = t4.id where t1.id = ${id}")
CtBuyerDetailVO getDetailById(Long id);

@Select("select account from ct_buyer")
List<String> getAllAccount();

@Select("select pwd from ct_buyer where account = #{name}")
String getPwdByName(String name);

@Select("select id, occupy_status, company_id, platform_id from ct_buyer where account = #{buyerName} for update")
CtBuyer getBuyerOccupyStatusLock(String buyerName);
}


+ 34
- 0
wjcy-common/src/main/java/me/zhengjie/dao/CtCardDao.java 查看文件

@@ -0,0 +1,34 @@
package me.zhengjie.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import me.zhengjie.entity.CtCard;
import me.zhengjie.entity.CtCardInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
* 信用卡信息(CtCard)表数据库访问层
*
* @author rch
* @since 2022-07-07
*/
@Mapper
public interface CtCardDao extends BaseMapper<CtCard> {

@Select("select number from ct_card")
List<String> getNumberList();

//@Select("select id,number from ct_card where number in ${number}")
@Select({
"<script>",
"SELECT id, number FROM ct_card where number in",
"<foreach collection='list' item='item' open='(' separator=',' close=')'>",
"#{item}",
"</foreach>",
"</script>"
})
List<CtCardInfo> getCardInfoByNumber(List<String> number);
}


+ 90
- 0
wjcy-common/src/main/java/me/zhengjie/dao/CtClickFarmingDao.java 查看文件

@@ -0,0 +1,90 @@
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<CtClickFarming> {

// @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<CtClickFarmingVO> searchPageList(IPage<CtClickFarmingVO> 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<CtBuyerClickSuccess> 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);
}


+ 100
- 0
wjcy-common/src/main/java/me/zhengjie/dao/CtClickOrderDao.java 查看文件

@@ -0,0 +1,100 @@
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<CtClickOrder> {

/**
* 分页查询
* @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<CtClickOrderListVO> searchPageList(IPage<CtClickOrderListVO> 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);
}


+ 34
- 0
wjcy-common/src/main/java/me/zhengjie/dao/CtCompanyDao.java 查看文件

@@ -0,0 +1,34 @@
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<CtCompany> {

@Select({
"<script>",
"select id, name from ct_company where name in ",
"<foreach collection='names' item='name' open='(' separator=',' close=')'>",
"#{name}",
"</foreach>",
"</script>"
})
List<CtCompanyInfo> getByName(@Param("names") List<String> names);

@Select("select id,name from ct_company")
List<CtCompanyInfo> getCompanyList();
}


+ 24
- 0
wjcy-common/src/main/java/me/zhengjie/dao/CtDhPayDao.java 查看文件

@@ -0,0 +1,24 @@
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<CtDhPay> {

@Select("select * from ct_dh_pay ${ew.customSqlSegment}")
IPage<CtDhPayListVO> searchPageList(IPage<CtDhPayListVO> page, Wrapper ew);
}


+ 17
- 0
wjcy-common/src/main/java/me/zhengjie/dao/CtExcelDao.java 查看文件

@@ -0,0 +1,17 @@
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<CtExcel> {

}


+ 17
- 0
wjcy-common/src/main/java/me/zhengjie/dao/CtExcelImportInfoDao.java 查看文件

@@ -0,0 +1,17 @@
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<CtExcelImportInfo> {

}


+ 17
- 0
wjcy-common/src/main/java/me/zhengjie/dao/CtOrderDao.java 查看文件

@@ -0,0 +1,17 @@
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<CtOrder> {

}


+ 17
- 0
wjcy-common/src/main/java/me/zhengjie/dao/CtPlatformDao.java 查看文件

@@ -0,0 +1,17 @@
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<CtPlatform> {

}


+ 41
- 0
wjcy-common/src/main/java/me/zhengjie/dao/CtRebotDao.java 查看文件

@@ -0,0 +1,41 @@
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<CtRebot> {

@Select("select * from ct_rebot where account_name = #{accountName} for update")
CtRebot getByAccountNameLock(String accountName);


@Select("select * from ct_rebot ${ew.customSqlSegment}")
IPage<CtRebotListVO> searchRebotList(IPage<CtRebotListVO> page, Wrapper ew);

@Select("select account_name from ct_rebot")
List<String> getAccountNameList();

@Select("select robot_client_uuid from ct_rebot")
List<String> getClientUuidList();

@Update("update ct_rebot set status = #{newStatus} where id = #{id} and status = #{oldStatus}")
Boolean updateNewStatusByOldStatus(Long id, Integer newStatus, Integer oldStatus);
}


+ 17
- 0
wjcy-common/src/main/java/me/zhengjie/dao/CtResponseOrderAddressDao.java 查看文件

@@ -0,0 +1,17 @@
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<CtResponseOrderAddress> {

}


+ 17
- 0
wjcy-common/src/main/java/me/zhengjie/dao/CtResponseOrderDao.java 查看文件

@@ -0,0 +1,17 @@
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<CtResponseOrder> {

}


+ 17
- 0
wjcy-common/src/main/java/me/zhengjie/dao/CtResponseOrderProductDao.java 查看文件

@@ -0,0 +1,17 @@
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<CtResponseOrderProduct> {

}


+ 35
- 0
wjcy-common/src/main/java/me/zhengjie/dao/CtVpnDao.java 查看文件

@@ -0,0 +1,35 @@
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<CtVpn> {

@Select("select ip_address from ct_vpn")
List<String> getIpList();

//@Select("select id,ip_address from ct_vpn where ip_address in ${ipAddress}")
@Select({
"<script>",
"SELECT id, ip_address FROM ct_vpn where ip_address in",
"<foreach collection='list' item='item' open='(' separator=',' close=')'>",
"#{item}",
"</foreach>",
"</script>"
})
List<CtVpnInfo> getVpnInfoByIp(List<String> ipAddress);

}


+ 61
- 0
wjcy-common/src/main/java/me/zhengjie/dao/DhAddCarDao.java 查看文件

@@ -0,0 +1,61 @@
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<DhAddCar> {

@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<DhAddCarListVO> searchPageList(IPage<DhAddCarListVO> 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);
}


+ 48
- 0
wjcy-common/src/main/java/me/zhengjie/dao/DhAddCarOrderDao.java 查看文件

@@ -0,0 +1,48 @@
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<DhAddCarOrder> {

@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<DhAddCarOrderListVO> 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);
}


+ 17
- 0
wjcy-common/src/main/java/me/zhengjie/dao/DhCarGoodsDao.java 查看文件

@@ -0,0 +1,17 @@
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<DhCarGoods> {

}


+ 17
- 0
wjcy-common/src/main/java/me/zhengjie/dao/LoginIpDao.java 查看文件

@@ -0,0 +1,17 @@
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<LoginIp> {

}


+ 17
- 0
wjcy-common/src/main/java/me/zhengjie/dao/SettingSiteDao.java 查看文件

@@ -0,0 +1,17 @@
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<CtSettingSite> {
String getValueByKey(String key);
}


+ 26
- 0
wjcy-common/src/main/java/me/zhengjie/dao/SysQuartzJobDao.java 查看文件

@@ -0,0 +1,26 @@
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<SysQuartzJob> {

@Select("select * from sys_quartz_job ${ew.customSqlSegment}")
IPage<SysQuartzJobListVO> searchPageList(IPage<SysQuartzJobListVO> page, Wrapper ew);

@Select("select * from sys_quartz_job where task_num = #{taskNum}")
SysQuartzJob getByTaskNum(String taskNum);
}


+ 23
- 0
wjcy-common/src/main/java/me/zhengjie/dao/SysQuartzLogDao.java 查看文件

@@ -0,0 +1,23 @@
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<SysQuartzLog> {

@Select("select * from sys_quartz_log ${ew.customSqlSegment} ")
IPage<SysQuartzLogListVO> searchPageList(IPage<SysQuartzLogListVO> page, Wrapper ew);
}


+ 12
- 0
wjcy-common/src/main/java/me/zhengjie/dao/mapper/CtDhPayService.xml 查看文件

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="me.zhengjie.dao.SettingSiteDao">

<select id="getValueByKey" resultType="java.lang.String">
select setting_value from ct_setting_site
where setting_key = #{key}
</select>

</mapper>

+ 73
- 0
wjcy-common/src/main/java/me/zhengjie/dto/Dto.java 查看文件

@@ -0,0 +1,73 @@
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;

/**
* <p>
* 请求结果通用数据结构
* </p>
*
* @author: zeng
* @since: 2020-07-01
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Slf4j
public class Dto<T> 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;
}
}
}

+ 49
- 0
wjcy-common/src/main/java/me/zhengjie/dto/PageDTO.java 查看文件

@@ -0,0 +1,49 @@
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<T> 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<T> getiPage(){
return new Page(page, pageSize);
}


public boolean isAsc() {
return "asc".equalsIgnoreCase(order);
}

}

+ 38
- 0
wjcy-common/src/main/java/me/zhengjie/dto/StatementAggregateDTO.java 查看文件

@@ -0,0 +1,38 @@
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<T> {

/** 列表 */
private List<T> list;

/** 本页小计 */
private T pageTotal;

/** 总计 */
private T aggregate;

/** 总记录数 */
private Long total;

public StatementAggregateDTO(PageUtils<T> pageUtils, T pageTotal, T aggregate) {
this.list = pageUtils.getList();
this.pageTotal = pageTotal;
this.aggregate = aggregate;
this.total = pageUtils.getTotal();
}
}

+ 73
- 0
wjcy-common/src/main/java/me/zhengjie/entity/CtApply.java 查看文件

@@ -0,0 +1,73 @@
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<CtApply> {

@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;
}


+ 45
- 0
wjcy-common/src/main/java/me/zhengjie/entity/CtBrowse.java 查看文件

@@ -0,0 +1,45 @@
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<CtBrowse> {

@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;
}


+ 33
- 0
wjcy-common/src/main/java/me/zhengjie/entity/CtBrowseYdParams.java 查看文件

@@ -0,0 +1,33 @@
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;
}

+ 103
- 0
wjcy-common/src/main/java/me/zhengjie/entity/CtBuyer.java 查看文件

@@ -0,0 +1,103 @@
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<CtBuyer> {

@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
}


+ 19
- 0
wjcy-common/src/main/java/me/zhengjie/entity/CtBuyerClickSuccess.java 查看文件

@@ -0,0 +1,19 @@
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;
}

+ 45
- 0
wjcy-common/src/main/java/me/zhengjie/entity/CtBuyerContactInfo.java 查看文件

@@ -0,0 +1,45 @@
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;
}


+ 71
- 0
wjcy-common/src/main/java/me/zhengjie/entity/CtBuyerExport.java 查看文件

@@ -0,0 +1,71 @@
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;
}

+ 67
- 0
wjcy-common/src/main/java/me/zhengjie/entity/CtBuyerExportTemple.java 查看文件

@@ -0,0 +1,67 @@
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;
}

+ 84
- 0
wjcy-common/src/main/java/me/zhengjie/entity/CtBuyerImport.java 查看文件

@@ -0,0 +1,84 @@
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;
}

+ 80
- 0
wjcy-common/src/main/java/me/zhengjie/entity/CtCard.java 查看文件

@@ -0,0 +1,80 @@
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<CtCard> {

@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;
}

+ 40
- 0
wjcy-common/src/main/java/me/zhengjie/entity/CtCardExport.java 查看文件

@@ -0,0 +1,40 @@
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<CtCardExport> {
/** 卡号 */
@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;
}

+ 46
- 0
wjcy-common/src/main/java/me/zhengjie/entity/CtCardExportTemple.java 查看文件

@@ -0,0 +1,46 @@
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<CtCardExportTemple> {
/** 卡号 */
@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;
}

+ 96
- 0
wjcy-common/src/main/java/me/zhengjie/entity/CtCardImport.java 查看文件

@@ -0,0 +1,96 @@
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<CtCardImport> {

/** 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;
}

+ 22
- 0
wjcy-common/src/main/java/me/zhengjie/entity/CtCardInfo.java 查看文件

@@ -0,0 +1,22 @@
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;
}

+ 41
- 0
wjcy-common/src/main/java/me/zhengjie/entity/CtClickFarmSupplyMentYdParams.java 查看文件

@@ -0,0 +1,41 @@
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;
}


+ 59
- 0
wjcy-common/src/main/java/me/zhengjie/entity/CtClickFarmYdParams.java 查看文件

@@ -0,0 +1,59 @@
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;
}


+ 70
- 0
wjcy-common/src/main/java/me/zhengjie/entity/CtClickFarming.java 查看文件

@@ -0,0 +1,70 @@
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<CtClickFarming> {

@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;
}


+ 59
- 0
wjcy-common/src/main/java/me/zhengjie/entity/CtClickFarmingExport.java 查看文件

@@ -0,0 +1,59 @@
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;
}

+ 53
- 0
wjcy-common/src/main/java/me/zhengjie/entity/CtClickFarmingExportTemp.java 查看文件

@@ -0,0 +1,53 @@
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;
}

+ 64
- 0
wjcy-common/src/main/java/me/zhengjie/entity/CtClickFarmingImport.java 查看文件

@@ -0,0 +1,64 @@
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;
}

+ 37
- 0
wjcy-common/src/main/java/me/zhengjie/entity/CtClickFarmingOrderInfo.java 查看文件

@@ -0,0 +1,37 @@
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;
}


+ 55
- 0
wjcy-common/src/main/java/me/zhengjie/entity/CtClickOrder.java 查看文件

@@ -0,0 +1,55 @@
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<CtClickOrder> {
@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;
}

+ 37
- 0
wjcy-common/src/main/java/me/zhengjie/entity/CtClickOrderExport.java 查看文件

@@ -0,0 +1,37 @@
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;
}

+ 39
- 0
wjcy-common/src/main/java/me/zhengjie/entity/CtClickOrderExportTemple.java 查看文件

@@ -0,0 +1,39 @@
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;
}

+ 40
- 0
wjcy-common/src/main/java/me/zhengjie/entity/CtClickOrderImport.java 查看文件

@@ -0,0 +1,40 @@
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;
}

+ 33
- 0
wjcy-common/src/main/java/me/zhengjie/entity/CtClickOrderYdParams.java 查看文件

@@ -0,0 +1,33 @@
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;

}

+ 43
- 0
wjcy-common/src/main/java/me/zhengjie/entity/CtCompany.java 查看文件

@@ -0,0 +1,43 @@
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<CtCompany> {

@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;
}


+ 23
- 0
wjcy-common/src/main/java/me/zhengjie/entity/CtCompanyInfo.java 查看文件

@@ -0,0 +1,23 @@
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;

}

+ 44
- 0
wjcy-common/src/main/java/me/zhengjie/entity/CtDhPay.java 查看文件

@@ -0,0 +1,44 @@
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<CtDhPay> {

@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;
}


部分文件因文件數量過多而無法顯示

Loading…
取消
儲存