mirror of
https://gitee.com/incloudcode/yexuejc-springboot.git
synced 2025-07-27 05:49:44 +08:00
Compare commits
22 Commits
Author | SHA1 | Date | |
---|---|---|---|
9ce56206f5 | |||
15498dafcc | |||
4dc52444ce | |||
|
76e4b858e9 | ||
4c9520de70 | |||
55c64e59d4 | |||
53437a57e2 | |||
|
0dc6b8aa6d | ||
|
c23db40776 | ||
|
ab074953db | ||
|
b8cba48792 | ||
f3b23730d6 | |||
85362e6537 | |||
73b767786f | |||
4cdc2b631c | |||
8e86b352ac | |||
8e39507e18 | |||
09f2138327 | |||
01b94cbdd2 | |||
2b82d8205d | |||
0cd3709838 | |||
d4ec02db64 |
197
1.x-update.md
Normal file
197
1.x-update.md
Normal file
@ -0,0 +1,197 @@
|
||||
yexuejc-springboot 更新内容
|
||||
-------------------
|
||||
|
||||
#### version :1.2.2
|
||||
**time:2019-11-1 13:11:44** <br/>
|
||||
**branch:** master <br/>
|
||||
**关联工程:** <br/>
|
||||
```
|
||||
springboot-base:1.3.9
|
||||
spring-boot-starter-parent:1.5.16.RELEASE
|
||||
```
|
||||
**update:** <br/>
|
||||
1. redis 配置修改,增加开关,更兼容
|
||||
|
||||
|
||||
#### version :1.2.1
|
||||
**time:2019-7-27 09:39:24** <br/>
|
||||
**branch:** master <br/>
|
||||
**关联工程:** <br/>
|
||||
```
|
||||
springboot-base:1.3.9
|
||||
spring-boot-starter-parent:1.5.16.RELEASE
|
||||
```
|
||||
**update:** <br/>
|
||||
1. 所有自动装配增加开关,默认不装配。装配方式请参考[本项目自动装配开关](doc/plugin/AutoConfigure.md)
|
||||
|
||||
#
|
||||
#### version :1.2.0
|
||||
**time:2018-12-1 12:19:06** <br/>
|
||||
**branch:** master <br/>
|
||||
**关联工程:** <br/>
|
||||
```
|
||||
springboot-base:1.2.4
|
||||
spring-boot-starter-parent:1.5.16.RELEASE
|
||||
```
|
||||
**update:** <br/>
|
||||
1. security多方登录第一个稳定版<br/>
|
||||
支持账号登录、短信登录、第三方授权openid登录<br/>
|
||||
功能链接[security重构-多方登录](doc/SECURITY.md)
|
||||
|
||||
---
|
||||
#### version :1.1.0
|
||||
**time:2018-9-23 12:49:36** <br/>
|
||||
**branch:** master <br/>
|
||||
**关联工程:** <br/>
|
||||
```
|
||||
springboot-base:1.1.9
|
||||
spring-boot-starter-parent:1.5.15.RELEASE
|
||||
```
|
||||
**update:** <br/>
|
||||
1. 升级依赖
|
||||
2. 增加SSL证书忽略:默认关闭
|
||||
3. 本版本更新工具依赖[https://github.com/yexuejc/yexuejc-base.git](https://github.com/yexuejc/yexuejc-base.git)不向下兼容
|
||||
|
||||
---
|
||||
#### version :1.0.15
|
||||
**time:2018-9-3 19:29:39** <br/>
|
||||
**branch:** master <br/>
|
||||
**关联工程:** <br/>
|
||||
```
|
||||
springboot-base:1.1.8
|
||||
spring-boot-starter-parent:1.5.15.RELEASE
|
||||
```
|
||||
**update:** <br/>
|
||||
1. 升级依赖
|
||||
|
||||
---
|
||||
#### version :1.0.14
|
||||
**time:2018-8-25 14:31:05** <br/>
|
||||
**branch:** master <br/>
|
||||
**关联工程:** <br/>
|
||||
```
|
||||
springboot-base:1.1.7
|
||||
spring-boot-starter-parent:1.5.15.RELEASE
|
||||
```
|
||||
**update:** <br/>
|
||||
1. 升级依赖
|
||||
2. 优化拦截规则:增加通配符 /**
|
||||
|
||||
---
|
||||
#### version :1.0.13
|
||||
**time:2018-8-17 11:41:18** <br/>
|
||||
**branch:** master <br/>
|
||||
**关联工程:** <br/>
|
||||
```
|
||||
springboot-base:1.1.7
|
||||
```
|
||||
**update:** <br/>
|
||||
1. 升级base
|
||||
|
||||
---
|
||||
#### version :1.0.12
|
||||
**time:2018-6-19 22:18:03** <br/>
|
||||
**branch:** master <br/>
|
||||
**关联工程:** <br/>
|
||||
```
|
||||
springboot-base:1.1.6
|
||||
```
|
||||
**update:** <br/>
|
||||
1. maven仓库更新
|
||||
---
|
||||
#
|
||||
#### version :1.0.11
|
||||
**time:2018-6-19 22:18:03** <br/>
|
||||
**branch:** master <br/>
|
||||
**update:** <br/>
|
||||
1. 更新springboot-base:1.1.5依赖
|
||||
|
||||
---
|
||||
#### version :1.0.10
|
||||
**time:2018年6月14日22:31:18** <br/>
|
||||
**branch:** master <br/>
|
||||
**update:** <br/>
|
||||
1. 更新springboot-base:1.1.4依赖
|
||||
2. 统一编码:UTF-8
|
||||
|
||||
|
||||
---
|
||||
#### version :1.0.9
|
||||
**time:2018年6月2日12:17:18** <br/>
|
||||
**branch:** master <br/>
|
||||
**update:** <br/>
|
||||
1. 更新base依赖
|
||||
|
||||
|
||||
---
|
||||
#### version :1.0.8
|
||||
**time:** 2018-5-4 09:54:18<br/>
|
||||
**branch:** master <br/>
|
||||
**update:** <br/>
|
||||
1. 修复依赖
|
||||
2. 使用加密:配置密钥方式/配置密钥方式 二选一
|
||||
```
|
||||
#加密开关
|
||||
yexuejc.http.encrypt.encrypt=true
|
||||
yexuejc.http.encrypt.decrypt=true
|
||||
#配置密钥方式
|
||||
yexuejc.http.encrypt.private-key=私钥
|
||||
#配置证书方式
|
||||
yexuejc.http.encrypt.private-key-path=/lgfishing.keystore 路径
|
||||
yexuejc.http.encrypt.private-alias=别名
|
||||
yexuejc.http.encrypt.private-pwd=密码
|
||||
```
|
||||
|
||||
---
|
||||
##### version :1.0.7
|
||||
**time:** 2018-5-4 09:54:18<br/>
|
||||
**branch:** master <br/>
|
||||
**update:** <br/>
|
||||
>1. 新增加密证书配置
|
||||
>2. RSA迁移到[yexuejc-base:1.1.1](https://github.com/yexuejc/yexuejc-base)工程
|
||||
|
||||
---
|
||||
##### version :1.0.6 ~~1.0.5~~
|
||||
**【change:2018-5-15 09:24:37】** 1.0.5 jitpack打包失败,升级版本1.0.6<br/>
|
||||
**time:** 2018-5-4 09:54:18<br/>
|
||||
**branch:** master <br/>
|
||||
**update:** <br/>
|
||||
> [使用加密解密](doc/PARAMS_RSA_DECRYPT_ENCRYPT.md)
|
||||
>
|
||||
>1.增加json入参解密、出参加密
|
||||
|
||||
---
|
||||
|
||||
##### version :1.0.4
|
||||
**time:** 2018-5-4 09:54:18<br/>
|
||||
**branch:** master <br/>
|
||||
**update:** <br/>
|
||||
>1.更新springboot至1.5.12.RELEASE
|
||||
|
||||
---
|
||||
#### version :1.0.3
|
||||
**time:** 2018-4-9 15:24:13<br/>
|
||||
**branch:** master <br/>
|
||||
**update:** <br/>
|
||||
>1.变更包名
|
||||
---
|
||||
#### version :1.0.2
|
||||
**time:** 2018-4-1 17:00:15<br/>
|
||||
**env:** prod <br/>
|
||||
**update:** <br/>
|
||||
>1.修复工具包ApiVO
|
||||
---
|
||||
#### version :0.0.2
|
||||
**time:** 2018-1-31 13:48:34<br/>
|
||||
**env:** ivt <br/>
|
||||
**update:** <br/>
|
||||
>1.集成日志【security】
|
||||
---
|
||||
|
||||
##### version :0.0.1
|
||||
**time:** 2018-1-31 12:16:10<br/>
|
||||
**env:** ivt <br/>
|
||||
**update:** <br/>
|
||||
>1.第一次上传,集成通用环境
|
||||
|
||||
---
|
@ -1,77 +1,108 @@
|
||||
yexuejc-springboot 更新内容
|
||||
-------------------
|
||||
#### version :2.1.3
|
||||
**time:2023-9-19 11:15:33** <br/>
|
||||
**branch:** 2.x <br/>
|
||||
**关联工程:** <br/>
|
||||
```
|
||||
springboot-base:1.5.0-jre8
|
||||
spring-boot-starter-parent:2.7.15
|
||||
```
|
||||
**update:** <br/>
|
||||
1. 全面更新依赖(时隔3年多,该项目又活了)
|
||||
2. 保证原功能正常的最后一个版本
|
||||
3. 该版本基于JDK1.8
|
||||
---
|
||||
|
||||
#### version :1.2.1
|
||||
**time:2019-7-27 09:39:24** <br/>
|
||||
#### version :2.1.2
|
||||
**time:2020-5-18 12:18:14** <br/>
|
||||
**branch:** master <br/>
|
||||
**关联工程:** <br/>
|
||||
```
|
||||
springboot-base:1.4.0
|
||||
spring-boot-starter-parent:1.5.16.RELEASE
|
||||
```
|
||||
**update:** <br/>
|
||||
1. 更新依赖
|
||||
2. 更新仓库地址 https://nexus.yexuejc.club/ 为 https://nexus.yexuejc.top/
|
||||
---
|
||||
|
||||
#### version :2.1.1
|
||||
**time:2019-11-1 13:32:07** <br/>
|
||||
**branch:** master <br/>
|
||||
**关联工程:** <br/>
|
||||
```
|
||||
springboot-base:1.3.9
|
||||
spring-boot-starter-parent:1.5.16.RELEASE
|
||||
spring-boot-starter-parent:2.0.5.RELEASE
|
||||
```
|
||||
**update:** <br/>
|
||||
1. redis 配置修改,增加开关,更兼容
|
||||
|
||||
|
||||
#### version :2.1.0
|
||||
**time:2019-7-24 18:30:49** <br/>
|
||||
**branch:** master <br/>
|
||||
**关联工程:** <br/>
|
||||
```
|
||||
springboot-base:1.3.9
|
||||
spring-boot-starter-parent:2.0.5.RELEASE
|
||||
```
|
||||
**update:** <br/>
|
||||
1. 所有自动装配增加开关,默认不装配。装配方式请参考[本项目自动装配开关](doc/plugin/AutoConfigure.md)
|
||||
|
||||
|
||||
#
|
||||
#### version :1.2.0
|
||||
**time:2018-12-1 12:19:06** <br/>
|
||||
#### version :2.0.6
|
||||
**time:2019年4月2日21:08:453** <br/>
|
||||
**branch:** master <br/>
|
||||
**关联工程:** <br/>
|
||||
```
|
||||
springboot-base:1.3.9
|
||||
spring-boot-starter-parent:2.0.5.RELEASE
|
||||
```
|
||||
**update:** <br/>
|
||||
1. 升级依赖
|
||||
2. 出入参加密 ParamsRequestBodyAdvice/ParamsResponseBodyAdvice 增加开关(默认关)
|
||||
|
||||
|
||||
#
|
||||
|
||||
#### version :2.0.5
|
||||
**time:2018-12-1 12:27:10** <br/>
|
||||
**branch:** master <br/>
|
||||
**关联工程:** <br/>
|
||||
```
|
||||
springboot-base:1.2.4
|
||||
spring-boot-starter-parent:1.5.16.RELEASE
|
||||
spring-boot-starter-parent:2.0.5.RELEASE
|
||||
```
|
||||
**update:** <br/>
|
||||
1. security多方登录第一个稳定版<br/>
|
||||
支持账号登录、短信登录、第三方授权openid登录<br/>
|
||||
功能链接[security重构-多方登录](doc/SECURITY.md)
|
||||
#
|
||||
|
||||
#### version :1.1.6-1.1.9
|
||||
**time:2018-11-21 15:03:01** <br/>
|
||||
|
||||
#
|
||||
#### version :2.0.3
|
||||
**time:2018-11-9 16:58:06** <br/>
|
||||
**branch:** master <br/>
|
||||
**关联工程:** <br/>
|
||||
```
|
||||
springboot-base:1.2.1
|
||||
spring-boot-starter-parent:1.5.16.RELEASE
|
||||
```
|
||||
**update:** <br/>
|
||||
1. security 登录开放处理
|
||||
#
|
||||
|
||||
#### version :1.1.5
|
||||
**time:2018年11月20日20:26:06** <br/>
|
||||
**branch:** master <br/>
|
||||
**关联工程:** <br/>
|
||||
```
|
||||
springboot-base:1.2.1
|
||||
spring-boot-starter-parent:1.5.16.RELEASE
|
||||
```
|
||||
**update:** <br/>
|
||||
1. 修复security登录
|
||||
#
|
||||
|
||||
#### version :1.1.4
|
||||
**time:2018-11-9 16:55:53** <br/>
|
||||
**branch:** master <br/>
|
||||
**关联工程:** <br/>
|
||||
```
|
||||
springboot-base:1.2.1
|
||||
spring-boot-starter-parent:1.5.16.RELEASE
|
||||
spring-boot-starter-parent:2.0.5.RELEASE
|
||||
```
|
||||
**update:** <br/>
|
||||
1. 集成springboot security 多方登录
|
||||
2. 文档拆分
|
||||
|
||||
|
||||
#
|
||||
|
||||
|
||||
#### version :1.1.3
|
||||
**time:2018-10-27 16:40:36** <br/>
|
||||
#### version :2.0.2
|
||||
**time:2018-10-27 16:42:08** <br/>
|
||||
**branch:** master <br/>
|
||||
**关联工程:** <br/>
|
||||
```
|
||||
springboot-base:1.2.0
|
||||
spring-boot-starter-parent:1.5.16.RELEASE
|
||||
spring-boot-starter-parent:2.0.5.RELEASE
|
||||
```
|
||||
**update:** <br/>
|
||||
1. 日志优化,按天切割日志<br>
|
||||
@ -93,28 +124,29 @@ logging.path=/logs/yexuejc-springboot-parent
|
||||
```
|
||||
#
|
||||
|
||||
#### version :1.1.2
|
||||
**time:2018-9-28 15:23:32** <br/>
|
||||
**branch:** master <br/>
|
||||
#### version :2.0.1
|
||||
**time:2018-9-28 15:25:30** <br/>
|
||||
**branch:** 2.x <br/>
|
||||
**关联工程:** <br/>
|
||||
```
|
||||
springboot-base:1.1.9
|
||||
spring-boot-starter-parent:1.5.16.RELEASE
|
||||
spring-boot-starter-parent:2.0.5.RELEASE
|
||||
```
|
||||
**update:** <br/>
|
||||
1. 新增声明包
|
||||
#
|
||||
|
||||
#### version :1.1.1
|
||||
**time:2018-9-26 17:00:38** <br/>
|
||||
**branch:** master <br/>
|
||||
#### version :2.0.0
|
||||
**time:2018-9-26 16:55:00** <br/>
|
||||
**branch:** 2.x <br/>
|
||||
**关联工程:** <br/>
|
||||
```
|
||||
springboot-base:1.1.9
|
||||
spring-boot-starter-parent:1.5.16.RELEASE
|
||||
spring-boot-starter-parent:2.0.5.RELEASE
|
||||
```
|
||||
**update:** <br/>
|
||||
1. 升级依赖
|
||||
2. 2.x分支将基于springboot 2.x 开发
|
||||
#
|
||||
|
||||
#### version :1.1.0
|
20
README.md
20
README.md
@ -2,7 +2,7 @@
|
||||
|
||||
### 说明
|
||||
>基于springboot版本分别维护1.x(对应springboot1.5.16.RELEASE) 2.x(对应springboot2.0.5.RELEASE) 分支 <br>
|
||||
>master将继续同步1.x分支(后期获取会同步于2.x)
|
||||
>master不再提供源代码,源代码请到具体分支中查看
|
||||
|
||||
|
||||
#### 项目介绍
|
||||
@ -13,8 +13,9 @@ parent:版本封装<br/>
|
||||
base:功能封装
|
||||
|
||||
#### 最新版本
|
||||
* yexuejc.springboot.version=1.2.1 <br>
|
||||
* yexuejc.base.version=1.3.9
|
||||
* 1.x yexuejc.springboot.version=1.2.2 <br>
|
||||
* 2.x yexuejc.springboot.version=2.1.3 <br>
|
||||
* yexuejc.base.version=1.5.0-jre8
|
||||
|
||||
pom.xml
|
||||
```
|
||||
@ -35,16 +36,16 @@ pom.xml
|
||||
<!--推荐使用-->
|
||||
<!--https://gitee.com/incloudcode/yexuejc-base.git-->
|
||||
<dependency>
|
||||
<groupId>com.yexuejc.base</groupId>
|
||||
<groupId>top.yexuejc</groupId>
|
||||
<artifactId>yexuejc-base</artifactId>
|
||||
<version>${yexuejc.base.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>yexuejc-nexus-public</id>
|
||||
<name>yexuejc-nexus-public</name>
|
||||
<url>https://nexus.yexuejc.club/repository/maven-public/</url>
|
||||
<id>yexuejc-maven</id>
|
||||
<name>yexuejc maven</name>
|
||||
<url>https://nexus.yexuejc.top/repository/maven-public/</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
```
|
||||
@ -104,7 +105,10 @@ pom.xml
|
||||
|
||||
|
||||
#### 版本更新
|
||||
持续集成中...
|
||||
<br/>
|
||||
集成到自己项目前请先阅读文档,或者先运行示例工程
|
||||
|
||||
[更新记录](UPDATE.md)
|
||||
更新记录: [1.x](1.x-update.md)、[2.x](2.x-update.md)
|
||||
<br/>
|
||||
[相关功能使用指南](doc/MENU.md)
|
||||
|
13
doc/MENU.md
13
doc/MENU.md
@ -9,8 +9,15 @@
|
||||
|
||||
### 内部集成
|
||||
#
|
||||
* 1.2.1 项目所集成的插件都增加开关-默认关闭,升级版本请阅读[第三方集成具体使用](plugin/AutoConfigure.md)
|
||||
* [1.1.4新增 集成security登录](SECURITY.md)
|
||||
|
||||
* [(2.0.3-2.0.5)新增 集成security多方登录](SECURITY.md)
|
||||
单独使用例子工程:[https://github.com/yexuejc/springboot-security-login-simple](https://github.com/yexuejc/springboot-security-login-simple)
|
||||
* [1.0.6新增 针对API请求安全解决方案](PARAMS_RSA_DECRYPT_ENCRYPT.md)<br/>
|
||||
* [1.0.6新增 加密功能](PARAMS_RSA_DECRYPT_ENCRYPT.md)
|
||||
|
||||
|
||||
### 运行错误
|
||||
1. jdk版本问题,请切换jdk为1.8版或者jvm增加启动参数`--add-opens java.base/java.util=ALL-UNNAMED`
|
||||
```
|
||||
Cannot load configuration class: com.example.demo.DemoApplication
|
||||
Unable to make protected final java.lang.Class java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain) throws java.lang.ClassFormatError accessible: module java.base does not "opens java.lang" to unnamed module @5af3afd9
|
||||
```
|
117
pom.xml
117
pom.xml
@ -5,7 +5,7 @@
|
||||
|
||||
<groupId>com.yexuejc.springboot</groupId>
|
||||
<artifactId>yexuejc-springboot-parent</artifactId>
|
||||
<version>1.2.1</version>
|
||||
<version>2.1.3</version>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<name>${project.artifactId}</name>
|
||||
@ -15,64 +15,68 @@
|
||||
<!-- spring boot父级,包含了统一版本管理,统一插件管理等 -->
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>1.5.16.RELEASE</version>
|
||||
<!-- <relativePath/> lookup parent from repository -->
|
||||
<version>2.7.15</version>
|
||||
<!--<relativePath/>-->
|
||||
<!--lookup parent from repository-->
|
||||
</parent>
|
||||
|
||||
|
||||
<modules>
|
||||
<module>yexuejc-springboot-base</module>
|
||||
</modules>
|
||||
|
||||
<properties>
|
||||
<yexuejc.base.version>1.3.9</yexuejc.base.version>
|
||||
<repos.yexuejc.url>https://nexus.yexuejc.club/repository/</repos.yexuejc.url>
|
||||
|
||||
<repos.aliyun.url>http://maven.aliyun.com/nexus/content/groups/public</repos.aliyun.url>
|
||||
<repos.jitpack.url>https://jitpack.io</repos.jitpack.url>
|
||||
|
||||
|
||||
<maven.compiler.verbose>true</maven.compiler.verbose>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
<java.version>1.8</java.version>
|
||||
<validation-api.version>2.0.1.Final</validation-api.version>
|
||||
<springfox-swagger2.version>2.9.2</springfox-swagger2.version>
|
||||
<mybatis-spring-boot-starter.version>1.3.2</mybatis-spring-boot-starter.version>
|
||||
<mybatis.version>3.4.6</mybatis.version>
|
||||
<maven.compiler.target>${java.version}</maven.compiler.target>
|
||||
<maven.compiler.source>${java.version}</maven.compiler.source>
|
||||
<maven.compiler.verbose>true</maven.compiler.verbose>
|
||||
|
||||
<jjwt.version>0.9.1</jjwt.version>
|
||||
<yexuejc.base.version>1.5.0-jre8</yexuejc.base.version>
|
||||
<yexuejc-springboot.version>${project.version}</yexuejc-springboot.version>
|
||||
|
||||
<validation-api.version>2.0.1.Final</validation-api.version>
|
||||
<springfox-swagger2.version>2.10.5</springfox-swagger2.version>
|
||||
<mybatis-spring-boot-starter.version>2.3.1</mybatis-spring-boot-starter.version>
|
||||
<mybatis.version>3.5.13</mybatis.version>
|
||||
|
||||
<jjwt.version>0.11.5</jjwt.version>
|
||||
<fastjson.version>1.2.49</fastjson.version>
|
||||
<commons-codec.version>1.11</commons-codec.version>
|
||||
<commons-codec.version>1.15</commons-codec.version>
|
||||
<!-- 阿里云相关 -->
|
||||
<aliyun-java-sdk-core.version>4.1.1</aliyun-java-sdk-core.version>
|
||||
<aliyun-java-sdk-sts.version>3.0.0</aliyun-java-sdk-sts.version>
|
||||
<aliyun-sdk-oss.version>3.1.0</aliyun-sdk-oss.version>
|
||||
<aliyun-java-sdk-dysmsapi.version>1.1.0</aliyun-java-sdk-dysmsapi.version>
|
||||
<aliyun-sdk-mns.version>1.1.8</aliyun-sdk-mns.version>
|
||||
<aliyun-java-sdk-core.version>4.6.4</aliyun-java-sdk-core.version>
|
||||
<aliyun-java-sdk-sts.version>3.1.1</aliyun-java-sdk-sts.version>
|
||||
<aliyun-sdk-oss.version>3.17.1</aliyun-sdk-oss.version>
|
||||
<aliyun-java-sdk-dysmsapi.version>2.2.1</aliyun-java-sdk-dysmsapi.version>
|
||||
<aliyun-sdk-mns.version>1.1.9.2</aliyun-sdk-mns.version>
|
||||
<!-- 支付宝相关 -->
|
||||
<alipay-sdk-java.version>3.3.49.ALL</alipay-sdk-java.version>
|
||||
<alipay-sdk-java.version>4.38.76.ALL</alipay-sdk-java.version>
|
||||
<!-- 微信相关 -->
|
||||
<WXPay-SDK-Java.version>0.0.4</WXPay-SDK-Java.version>
|
||||
<postgresql.version>42.2.4</postgresql.version>
|
||||
<postgresql.version>42.6.0</postgresql.version>
|
||||
<!--thymeleaf 相关-->
|
||||
<thymeleaf.version>3.1.2.RELEASE</thymeleaf.version>
|
||||
<thymeleaf-layout-dialect.version>3.3.0</thymeleaf-layout-dialect.version>
|
||||
<thymeleaf-extras-springsecurity4.version>3.0.5.RELEASE</thymeleaf-extras-springsecurity4.version>
|
||||
|
||||
<thymeleaf.version>3.0.9.RELEASE</thymeleaf.version>
|
||||
<thymeleaf-layout-dialect.version>2.3.0</thymeleaf-layout-dialect.version>
|
||||
<thymeleaf-extras-springsecurity4.version>3.0.2.RELEASE</thymeleaf-extras-springsecurity4.version>
|
||||
|
||||
<reflectasm.version>1.09</reflectasm.version>
|
||||
<!--dubbo-->
|
||||
<dubbo-spring-boot-starter.version>0.2.0</dubbo-spring-boot-starter.version>
|
||||
<mybatis-plus.version>3.0.3</mybatis-plus.version>
|
||||
<reflectasm.version>1.11.9</reflectasm.version>
|
||||
<mybatis-plus.version>3.5.3.2</mybatis-plus.version>
|
||||
</properties>
|
||||
<!-- 声明包版本 继承项目自引入 -->
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<!--基础包-->
|
||||
<!--<dependency>-->
|
||||
<!--<groupId>com.github.yexuejc</groupId>-->
|
||||
<!--<artifactId>yexuejc-base</artifactId>-->
|
||||
<!--<version>${yexuejc.base.version}</version>-->
|
||||
<!--</dependency>-->
|
||||
<dependency>
|
||||
<groupId>top.yexuejc</groupId>
|
||||
<artifactId>yexuejc-base</artifactId>
|
||||
<version>${yexuejc.base.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.yexuejc.springboot</groupId>
|
||||
<artifactId>yexuejc-springboot-base</artifactId>
|
||||
<version>${yexuejc-springboot.version}</version>
|
||||
</dependency>
|
||||
<!-- 编码包 说明:http://blog.csdn.net/jianggujin/article/details/51149133 -->
|
||||
<dependency>
|
||||
<groupId>commons-codec</groupId>
|
||||
@ -82,15 +86,9 @@
|
||||
<!-- JJWT -->
|
||||
<dependency>
|
||||
<groupId>io.jsonwebtoken</groupId>
|
||||
<artifactId>jjwt</artifactId>
|
||||
<artifactId>jjwt-api</artifactId>
|
||||
<version>${jjwt.version}</version>
|
||||
</dependency>
|
||||
<!-- fastjson -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>fastjson</artifactId>
|
||||
<version>${fastjson.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- MVC数据校验框架 -->
|
||||
<dependency>
|
||||
@ -187,11 +185,6 @@
|
||||
<artifactId>reflectasm</artifactId>
|
||||
<version>${reflectasm.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba.boot</groupId>
|
||||
<artifactId>dubbo-spring-boot-starter</artifactId>
|
||||
<version>${dubbo-spring-boot-starter.version}</version>
|
||||
</dependency>
|
||||
<!-- springboot mybatis-plus-->
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
@ -273,39 +266,17 @@
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
</build>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>yexuejc-nexus-public</id>
|
||||
<name>yexuejc-nexus-public</name>
|
||||
<url>${repos.yexuejc.url}maven-public/</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>aliyun-nexus-public</id>
|
||||
<name>aliyun-nexus-public</name>
|
||||
<url>${repos.aliyun.url}</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>jitpack.io</id>
|
||||
<url>${repos.jitpack.url}</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
<!-- 中间件jar包发布目标 -->
|
||||
<distributionManagement>
|
||||
<repository>
|
||||
<id>releases</id>
|
||||
<name>nexus-release</name>
|
||||
<url>${repos.yexuejc.url}maven-releases/</url>
|
||||
<url>https://nexus.yexuejc.top/repository/maven-releases/</url>
|
||||
</repository>
|
||||
<snapshotRepository>
|
||||
<id>snapshots</id>
|
||||
<name>nexus-snapshots</name>
|
||||
<url>${repos.yexuejc.url}maven-snapshots/</url>
|
||||
<url>https://nexus.yexuejc.top/repository/maven-snapshots/</url>
|
||||
</snapshotRepository>
|
||||
</distributionManagement>
|
||||
|
||||
<modules>
|
||||
<module>yexuejc-springboot-base</module>
|
||||
<module>yexuejc-springboot-example</module>
|
||||
</modules>
|
||||
</project>
|
||||
|
@ -9,27 +9,19 @@
|
||||
<parent>
|
||||
<groupId>com.yexuejc.springboot</groupId>
|
||||
<artifactId>yexuejc-springboot-parent</artifactId>
|
||||
<version>1.2.1</version>
|
||||
<version>2.1.3</version>
|
||||
<!-- 本地打包:使用相对关联路径 -->
|
||||
<!--<relativePath>../../yexuejc</relativePath>-->
|
||||
<!--<relativePath>../</relativePath>-->
|
||||
</parent>
|
||||
|
||||
<name>${project.artifactId}</name>
|
||||
|
||||
<!--<properties>-->
|
||||
<!--<main.basedir>${basedir}/..</main.basedir>-->
|
||||
<!--</properties>-->
|
||||
|
||||
<dependencies>
|
||||
<!--基础包-->
|
||||
<dependency>
|
||||
<groupId>top.yexuejc</groupId>
|
||||
<artifactId>yexuejc-base</artifactId>
|
||||
</dependency>
|
||||
<!--<dependency>-->
|
||||
<!--<groupId>com.github.yexuejc</groupId>-->
|
||||
<!--<artifactId>yexuejc-base</artifactId>-->
|
||||
<!--</dependency>-->
|
||||
|
||||
<!-- 使用springMVC -->
|
||||
<dependency>
|
||||
@ -65,7 +57,7 @@
|
||||
<!-- JJWT -->
|
||||
<dependency>
|
||||
<groupId>io.jsonwebtoken</groupId>
|
||||
<artifactId>jjwt</artifactId>
|
||||
<artifactId>jjwt-api</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<!-- 使用Redis -->
|
||||
|
@ -1,22 +1,19 @@
|
||||
package com.yexuejc.springboot.base.autoconfigure;
|
||||
|
||||
import org.apache.commons.pool2.impl.GenericObjectPool;
|
||||
import org.springframework.beans.factory.ObjectProvider;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.boot.autoconfigure.data.redis.RedisProperties;
|
||||
import org.springframework.boot.autoconfigure.data.redis.RedisProperties.Cluster;
|
||||
import org.springframework.boot.autoconfigure.data.redis.RedisProperties.Sentinel;
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Primary;
|
||||
import org.springframework.core.annotation.Order;
|
||||
import org.springframework.data.redis.connection.RedisClusterConfiguration;
|
||||
import org.springframework.data.redis.connection.RedisConnectionFactory;
|
||||
import org.springframework.data.redis.connection.RedisNode;
|
||||
import org.springframework.data.redis.connection.RedisSentinelConfiguration;
|
||||
import org.springframework.data.redis.connection.RedisPassword;
|
||||
import org.springframework.data.redis.connection.RedisStandaloneConfiguration;
|
||||
import org.springframework.data.redis.connection.jedis.JedisClientConfiguration;
|
||||
import org.springframework.data.redis.connection.jedis.JedisConnection;
|
||||
import org.springframework.data.redis.connection.jedis.JedisConnectionFactory;
|
||||
import org.springframework.data.redis.core.RedisOperations;
|
||||
@ -24,25 +21,17 @@ import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.data.redis.core.StringRedisTemplate;
|
||||
import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer;
|
||||
import org.springframework.data.redis.serializer.StringRedisSerializer;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.StringUtils;
|
||||
import redis.clients.jedis.Jedis;
|
||||
import redis.clients.jedis.JedisPoolConfig;
|
||||
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
import java.net.UnknownHostException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 对redis 多个databasse封装
|
||||
* 多个database配置
|
||||
*
|
||||
* @author maxf
|
||||
* @version 1.0
|
||||
* @ClassName MutiRedisAutoConfiguration
|
||||
* @PackageName com.yexuejc.springboot.base.autoconfigure
|
||||
* @Description
|
||||
* @date 2018/11/1 10:31
|
||||
* @date 2018/9/26 15:27
|
||||
*/
|
||||
@Configuration
|
||||
@ConditionalOnClass({JedisConnection.class, RedisOperations.class, Jedis.class})
|
||||
@ -50,7 +39,6 @@ import java.util.List;
|
||||
@Order(1)
|
||||
@ConditionalOnProperty(name = "yexuejc.autoconfigure.redis.enable", matchIfMissing = false)
|
||||
public class MutiRedisAutoConfiguration {
|
||||
|
||||
public static final String BEAN_REDIS_FACTORY0 = "redisConnectionFactory";
|
||||
public static final String BEAN_REDIS_TEMPLATE0 = "redisTemplate";
|
||||
public static final String BEAN_REDIS_STRING_TEMPLATE0 = "stringRedisTemplate";
|
||||
@ -83,211 +71,100 @@ public class MutiRedisAutoConfiguration {
|
||||
public static final String BEAN_REDIS_TEMPLATE9 = "redis-template-9";
|
||||
public static final String BEAN_REDIS_STRING_TEMPLATE9 = "redis-string-template-9";
|
||||
|
||||
/**
|
||||
* Redis connection configuration.
|
||||
*/
|
||||
@Configuration
|
||||
@ConditionalOnClass(GenericObjectPool.class)
|
||||
@ConditionalOnProperty(name = "yexuejc.autoconfigure.redis.enable", matchIfMissing = false)
|
||||
protected static class RedisConnectionConfiguration {
|
||||
|
||||
private final RedisProperties properties;
|
||||
|
||||
private final RedisSentinelConfiguration sentinelConfiguration;
|
||||
|
||||
private final RedisClusterConfiguration clusterConfiguration;
|
||||
|
||||
public RedisConnectionConfiguration(RedisProperties properties,
|
||||
ObjectProvider<RedisSentinelConfiguration> sentinelConfiguration,
|
||||
ObjectProvider<RedisClusterConfiguration> clusterConfiguration) {
|
||||
public RedisConnectionConfiguration(RedisProperties properties) {
|
||||
this.properties = properties;
|
||||
this.sentinelConfiguration = sentinelConfiguration.getIfAvailable();
|
||||
this.clusterConfiguration = clusterConfiguration.getIfAvailable();
|
||||
}
|
||||
|
||||
@Primary
|
||||
@Bean(BEAN_REDIS_FACTORY0)
|
||||
@ConditionalOnProperty(name = "yexuejc.redis.db0", matchIfMissing = true)
|
||||
public JedisConnectionFactory redisConnectionFactory0() throws UnknownHostException {
|
||||
return applyProperties(createJedisConnectionFactory(), 0);
|
||||
return createJedisConnectionFactory(0);
|
||||
}
|
||||
|
||||
@Bean(BEAN_REDIS_FACTORY1)
|
||||
@ConditionalOnProperty(name = "yexuejc.redis.db1")
|
||||
public JedisConnectionFactory redisConnectionFactory1() throws UnknownHostException {
|
||||
return applyProperties(createJedisConnectionFactory(), 1);
|
||||
return createJedisConnectionFactory(1);
|
||||
}
|
||||
|
||||
@Bean(BEAN_REDIS_FACTORY2)
|
||||
@ConditionalOnProperty(name = "yexuejc.redis.db2")
|
||||
public JedisConnectionFactory redisConnectionFactory2() throws UnknownHostException {
|
||||
return applyProperties(createJedisConnectionFactory(), 2);
|
||||
return createJedisConnectionFactory(2);
|
||||
}
|
||||
|
||||
@Bean(BEAN_REDIS_FACTORY3)
|
||||
@ConditionalOnProperty(name = "yexuejc.redis.db3")
|
||||
public JedisConnectionFactory redisConnectionFactory3() throws UnknownHostException {
|
||||
return applyProperties(createJedisConnectionFactory(), 3);
|
||||
return createJedisConnectionFactory(3);
|
||||
}
|
||||
|
||||
@Bean(BEAN_REDIS_FACTORY4)
|
||||
@ConditionalOnProperty(name = "yexuejc.redis.db4")
|
||||
public JedisConnectionFactory redisConnectionFactory4() throws UnknownHostException {
|
||||
return applyProperties(createJedisConnectionFactory(), 4);
|
||||
return createJedisConnectionFactory(4);
|
||||
}
|
||||
|
||||
@Bean(BEAN_REDIS_FACTORY5)
|
||||
@ConditionalOnProperty(name = "yexuejc.redis.db5")
|
||||
public JedisConnectionFactory redisConnectionFactory5() throws UnknownHostException {
|
||||
return applyProperties(createJedisConnectionFactory(), 5);
|
||||
return createJedisConnectionFactory(5);
|
||||
}
|
||||
|
||||
@Bean(BEAN_REDIS_FACTORY6)
|
||||
@ConditionalOnProperty(name = "yexuejc.redis.db6")
|
||||
public JedisConnectionFactory redisConnectionFactory6() throws UnknownHostException {
|
||||
return applyProperties(createJedisConnectionFactory(), 6);
|
||||
return createJedisConnectionFactory(6);
|
||||
}
|
||||
|
||||
@Bean(BEAN_REDIS_FACTORY7)
|
||||
@ConditionalOnProperty(name = "yexuejc.redis.db7")
|
||||
public JedisConnectionFactory redisConnectionFactory7() throws UnknownHostException {
|
||||
return applyProperties(createJedisConnectionFactory(), 7);
|
||||
return createJedisConnectionFactory(7);
|
||||
}
|
||||
|
||||
@Bean(BEAN_REDIS_FACTORY8)
|
||||
@ConditionalOnProperty(name = "yexuejc.redis.db8")
|
||||
public JedisConnectionFactory redisConnectionFactory8() throws UnknownHostException {
|
||||
return applyProperties(createJedisConnectionFactory(), 8);
|
||||
return createJedisConnectionFactory(8);
|
||||
}
|
||||
|
||||
@Bean(BEAN_REDIS_FACTORY9)
|
||||
@ConditionalOnProperty(name = "yexuejc.redis.db9")
|
||||
public JedisConnectionFactory redisConnectionFactory9() throws UnknownHostException {
|
||||
return applyProperties(createJedisConnectionFactory(), 9);
|
||||
return createJedisConnectionFactory(9);
|
||||
}
|
||||
|
||||
protected final JedisConnectionFactory applyProperties(JedisConnectionFactory factory, int database) {
|
||||
configureConnection(factory);
|
||||
if (this.properties.isSsl()) {
|
||||
factory.setUseSsl(true);
|
||||
}
|
||||
factory.setDatabase(database);
|
||||
if (this.properties.getTimeout() > 0) {
|
||||
factory.setTimeout(this.properties.getTimeout());
|
||||
}
|
||||
private JedisConnectionFactory createJedisConnectionFactory(int database) {
|
||||
RedisStandaloneConfiguration redisStandaloneConfiguration = new RedisStandaloneConfiguration();
|
||||
redisStandaloneConfiguration.setHostName(properties.getHost());
|
||||
redisStandaloneConfiguration.setPort(properties.getPort());
|
||||
redisStandaloneConfiguration.setDatabase(database);
|
||||
redisStandaloneConfiguration.setPassword(RedisPassword.of(properties.getPassword()));
|
||||
|
||||
JedisClientConfiguration.JedisClientConfigurationBuilder jedisClientConfiguration = JedisClientConfiguration.builder();
|
||||
|
||||
JedisConnectionFactory factory = new JedisConnectionFactory(redisStandaloneConfiguration,
|
||||
jedisClientConfiguration.build());
|
||||
return factory;
|
||||
}
|
||||
|
||||
private void configureConnection(JedisConnectionFactory factory) {
|
||||
if (StringUtils.hasText(this.properties.getUrl())) {
|
||||
configureConnectionFromUrl(factory);
|
||||
} else {
|
||||
factory.setHostName(this.properties.getHost());
|
||||
factory.setPort(this.properties.getPort());
|
||||
if (this.properties.getPassword() != null) {
|
||||
factory.setPassword(this.properties.getPassword());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void configureConnectionFromUrl(JedisConnectionFactory factory) {
|
||||
String url = this.properties.getUrl();
|
||||
if (url.startsWith("rediss://")) {
|
||||
factory.setUseSsl(true);
|
||||
}
|
||||
try {
|
||||
URI uri = new URI(url);
|
||||
factory.setHostName(uri.getHost());
|
||||
factory.setPort(uri.getPort());
|
||||
if (uri.getUserInfo() != null) {
|
||||
String password = uri.getUserInfo();
|
||||
int index = password.lastIndexOf(":");
|
||||
if (index >= 0) {
|
||||
password = password.substring(index + 1);
|
||||
}
|
||||
factory.setPassword(password);
|
||||
}
|
||||
} catch (URISyntaxException ex) {
|
||||
throw new IllegalArgumentException("Malformed 'spring.redis.url' " + url, ex);
|
||||
}
|
||||
}
|
||||
|
||||
protected final RedisSentinelConfiguration getSentinelConfig() {
|
||||
if (this.sentinelConfiguration != null) {
|
||||
return this.sentinelConfiguration;
|
||||
}
|
||||
Sentinel sentinelProperties = this.properties.getSentinel();
|
||||
if (sentinelProperties != null) {
|
||||
RedisSentinelConfiguration config = new RedisSentinelConfiguration();
|
||||
config.master(sentinelProperties.getMaster());
|
||||
config.setSentinels(createSentinels(sentinelProperties));
|
||||
return config;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a {@link RedisClusterConfiguration} if necessary.
|
||||
*
|
||||
* @return {@literal null} if no cluster settings are set.
|
||||
*/
|
||||
protected final RedisClusterConfiguration getClusterConfiguration() {
|
||||
if (this.clusterConfiguration != null) {
|
||||
return this.clusterConfiguration;
|
||||
}
|
||||
if (this.properties.getCluster() == null) {
|
||||
return null;
|
||||
}
|
||||
Cluster clusterProperties = this.properties.getCluster();
|
||||
RedisClusterConfiguration config = new RedisClusterConfiguration(clusterProperties.getNodes());
|
||||
|
||||
if (clusterProperties.getMaxRedirects() != null) {
|
||||
config.setMaxRedirects(clusterProperties.getMaxRedirects());
|
||||
}
|
||||
return config;
|
||||
}
|
||||
|
||||
private List<RedisNode> createSentinels(Sentinel sentinel) {
|
||||
List<RedisNode> nodes = new ArrayList<RedisNode>();
|
||||
for (String node : StringUtils.commaDelimitedListToStringArray(sentinel.getNodes())) {
|
||||
try {
|
||||
String[] parts = StringUtils.split(node, ":");
|
||||
Assert.state(parts.length == 2, "Must be defined as 'host:port'");
|
||||
nodes.add(new RedisNode(parts[0], Integer.valueOf(parts[1])));
|
||||
} catch (RuntimeException ex) {
|
||||
throw new IllegalStateException("Invalid redis sentinel " + "property '" + node + "'", ex);
|
||||
}
|
||||
}
|
||||
return nodes;
|
||||
}
|
||||
|
||||
private JedisConnectionFactory createJedisConnectionFactory() {
|
||||
JedisPoolConfig poolConfig = this.properties.getPool() != null ? jedisPoolConfig() : new JedisPoolConfig();
|
||||
|
||||
if (getSentinelConfig() != null) {
|
||||
return new JedisConnectionFactory(getSentinelConfig(), poolConfig);
|
||||
}
|
||||
if (getClusterConfiguration() != null) {
|
||||
return new JedisConnectionFactory(getClusterConfiguration(), poolConfig);
|
||||
}
|
||||
return new JedisConnectionFactory(poolConfig);
|
||||
}
|
||||
|
||||
private JedisPoolConfig jedisPoolConfig() {
|
||||
JedisPoolConfig config = new JedisPoolConfig();
|
||||
RedisProperties.Pool props = this.properties.getPool();
|
||||
config.setMaxTotal(props.getMaxActive());
|
||||
config.setMaxIdle(props.getMaxIdle());
|
||||
config.setMinIdle(props.getMinIdle());
|
||||
config.setMaxWaitMillis(props.getMaxWait());
|
||||
return config;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Standard Redis configuration.
|
||||
*/
|
||||
@Configuration
|
||||
@ConditionalOnProperty(name = "yexuejc.autoconfigure.redis.enable", matchIfMissing = false)
|
||||
protected static class RedisConfiguration {
|
||||
|
||||
@Primary
|
||||
@ -469,5 +346,4 @@ public class MutiRedisAutoConfiguration {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -19,7 +19,6 @@ import com.yexuejc.springboot.base.util.LogUtil;
|
||||
import com.yexuejc.springboot.base.util.SSLUtil;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnResource;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
import org.springframework.boot.web.servlet.FilterRegistrationBean;
|
||||
|
@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import com.yexuejc.base.util.JsonUtil;
|
||||
import com.yexuejc.springboot.base.mapper.handler.JsonTypeHandler;
|
||||
import com.yexuejc.springboot.base.security.inte.User;
|
||||
|
||||
import java.io.Serializable;
|
||||
@ -27,7 +28,7 @@ public class Consumer extends Model<Consumer> implements User {
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@TableId(value = "consumer_id", type = IdType.UUID)
|
||||
@TableId(value = "consumer_id", type = IdType.ASSIGN_UUID)
|
||||
private String consumerId;
|
||||
/**
|
||||
* 手机号
|
||||
@ -92,7 +93,7 @@ public class Consumer extends Model<Consumer> implements User {
|
||||
/**
|
||||
* 角色、权限
|
||||
*/
|
||||
@TableField(value = "roles", el = "roles,typeHandler=com.yexuejc.guansc.core.mybatis.handler.JsonTypeHandler")
|
||||
@TableField(value = "roles", typeHandler = JsonTypeHandler.class)
|
||||
private List<String> roles;
|
||||
/**
|
||||
* 支付密码
|
||||
@ -157,19 +158,16 @@ public class Consumer extends Model<Consumer> implements User {
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
public Consumer setEnable(boolean enable) {
|
||||
this.enable = enable;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
public Consumer setNonExpire(boolean nonExpire) {
|
||||
this.nonExpire = nonExpire;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
public Consumer setNonLock(boolean nonLock) {
|
||||
this.nonLock = nonLock;
|
||||
return this;
|
||||
@ -276,7 +274,7 @@ public class Consumer extends Model<Consumer> implements User {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Serializable pkVal() {
|
||||
public Serializable pkVal() {
|
||||
return this.consumerId;
|
||||
}
|
||||
}
|
||||
|
@ -7,11 +7,9 @@ import com.yexuejc.base.util.JsonUtil;
|
||||
import com.yexuejc.base.util.StrUtil;
|
||||
import com.yexuejc.springboot.base.ApplicationRun;
|
||||
import com.yexuejc.springboot.base.filter.RsaProperties;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.security.KeyStoreException;
|
||||
@ -19,14 +17,12 @@ import java.security.NoSuchAlgorithmException;
|
||||
import java.security.UnrecoverableKeyException;
|
||||
import java.security.cert.CertificateException;
|
||||
import java.security.spec.InvalidKeySpecException;
|
||||
import java.util.Base64;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@SpringBootTest(classes = ApplicationRun.class)
|
||||
public class ApplicationTest {
|
||||
@Autowired
|
||||
@ -76,10 +72,8 @@ public class ApplicationTest {
|
||||
// String strData = "HgTMgxEEFSr6zRLvZQ3U5CAKjJqwKf0lfruZTi32iWObkbJA5mHuOTKU4rXYkej4UsPfArYUA45GfxatwFoB4Q";
|
||||
String strData = "K9Zyg82WDvIApFmXTxPwjQw_VA041jfBcxMIP6jpMM6xWe1XajGf3__7DqSLrS9MwCra9cYkidcjVJAKZn9cmQ";
|
||||
|
||||
|
||||
String mapData = "cEPfMp7-rim76XFdbNDSIzDRXyHySpz0VOZP6HC8U-JPl-ZxNZKp6ethEQWWITcuUPzIhp4fHiGKNsHA7F6OxCxibpMLj5-ZsgJJvcczw8Liens5kYgciRF1UziR3LFy6vybN9H1CJnqXaddbl3t_41P-_1l5Ev7YYa8woWp7ulaRPeTCDjohEpmx2Vi6aPSrm3hjjmitkD9gb0O6vFDNnclyNhFepKV3oh93tNv50sEQQ_QSBUXSHUtCnhTiBX8VsRX3h58F2tie7bG8VSk-6KFuXI07OiqFZSNpcwDOuq-GfMlEfPL3pX-gYhoOORPNClRlQHwyfHXBJly3gRtNVpVksHWQjr1xutWgYfwRjQPHBHNZwfx4E0XoCTuz9qH1CzFmmz68i63GzCM286zJ-J26MkiTDO1zH4jhglo38tnzz9HLeDcbbCuJg1jzkvpFiWamM-6odWhtCg65BS1tJJVWg023kWygZMu5Ebrm5WBbbatN87_K5zn211tFpKwRq2oVjO_AfJRY90WlQGEIHnzZNz_cf8mAjlmilHDuNdjYlj3axTUqLfgLDVaIkasREnjMI7oe8oAtG2ju2aq-xSAQZ_U-7-rsyBpoy0jnwRmlyUxhXgIX0zrfBQNXEjzPtg-iJ14R5qz1iOAJL7NtQQeuYngGTj6msDlKGEd_MQTLAFDbpiVPwWX00jLT1Ll3_zhivpPCUAmC8Yz58khkqrqi4FdIxJTDkxd0PFOBH8DYicF7ls4UdOHT24mAKDwUF_TfZ32oiiKSzCD9MJB8GEXjzx7tDFok-HsdOjI6ZnSUJCOTj3wne2E6_a8Gq2_vp5CWyW12wthJbH79aa7JVfy5cx-cZmNid7oCe54KYclz1tdUgLPCQ1ajsEevbRJ_NBkTmY2wAmUpHODeocDaYt_2AwAU2DLiv2uZuaVszNSUy593Zrzxq5AaY-oWbEeD24SyEWJObJtz5knYzr4NxjZShcjx9ezwiwkRZMtLZpA_cCPFAK1nOrN8zHCOZquS17CCSLDySLvGbxNqYeBa_lGSq8cQuQo8yybd1WkuLKUjUiJecmH2XcZNTPCtdRe0eLlRtk5928AQGsQugwSig";
|
||||
|
||||
|
||||
// String listData = "X65trOhRSpeaN-2qP0zhdYi2jeJDcrTz2JHkc6UFG17xAho-VO0fkD0cA8wxoxcqyTaulOiSzaidZ2VeIvKjuinlKT2r23kdMJxjJodOZojssxgGSxm5gnry2tq5X8dbP7n-jodvAvLE9Gtq7AaBQ36ZQBQ2RcFB3TiHKHGin0gfn6T6A80orYD7i-Bdc0rh_pBEdLwGt1wWY_C8QuxeBmMWh0jmLVfpa3ZZOXVc9I7wIxzc1taQ7f-8Om9SNfXc";
|
||||
String listData = "Sf_FO8YC9EUNTeM0n9EVuDzwvLz3DcxOuG4-5UZ9486lLHAx7IOuAhPgVHpQGsQiqJ7Y3fTaWFr6rRFPL12rVg";
|
||||
|
||||
@ -107,7 +101,6 @@ public class ApplicationTest {
|
||||
)
|
||||
).isEqualTo("f721e7b0d5415302f5fe7dc5beb2938a");
|
||||
|
||||
|
||||
//list
|
||||
assertThat(
|
||||
StrUtil.toMD5(
|
||||
@ -120,7 +113,6 @@ public class ApplicationTest {
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 证书操作
|
||||
*
|
||||
@ -142,15 +134,13 @@ public class ApplicationTest {
|
||||
// String dataStr = "{\"ret\":\"0\",\"expireTime\":\"2015/10/28 23:59:59\",\"rettxt\":\"OK\",\"token\":\"69296128A59798E2D423D3B1A9F766F4\"}";
|
||||
String dataStr = "{\"foodsCode\":\"49\",\"latlng\":\"22.5,114.0\",\"pageIndex\":1,\"pageSize\":10}";
|
||||
|
||||
|
||||
|
||||
/***************************************************************************************************************************************************************************************************************************************/
|
||||
//客户端公钥加密
|
||||
// String publicEncryptResult = RSA.publicEncrypt(dataStr, RSA2.getPublicKey(publicKey));
|
||||
// System.out.println(publicEncryptResult);
|
||||
// System.out.println(StrUtil.toMD5(dataStr));
|
||||
|
||||
String publicEncryptResult="KHAtNzGkT/Mn7d/Ei6aoZ8KCA04mYJi5b/sxt/Jgzq76jNi0O/EMACDsipgQuwZTJrrys5xOPyy4\n1Gf8LMEldZE3GeY3i92A5jnH7IeWnLojYhNaKdIuLuf4l5uJmFgpzxhoxqSkp2JJ5Vbt8j5Hy4ov\n7tfxPDBwnT6FSfDqGLU\u003d\n";
|
||||
String publicEncryptResult = "KHAtNzGkT/Mn7d/Ei6aoZ8KCA04mYJi5b/sxt/Jgzq76jNi0O/EMACDsipgQuwZTJrrys5xOPyy4\n1Gf8LMEldZE3GeY3i92A5jnH7IeWnLojYhNaKdIuLuf4l5uJmFgpzxhoxqSkp2JJ5Vbt8j5Hy4ov\n7tfxPDBwnT6FSfDqGLU\u003d\n";
|
||||
|
||||
//服务器私钥解密
|
||||
String privateDecryptResult = RSA.privateDecrypt(publicEncryptResult, RSA2.getPrivateKey(privateKey, privateAlias, privatePwd));
|
||||
@ -168,9 +158,9 @@ public class ApplicationTest {
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* key加解密
|
||||
*
|
||||
* @throws NoSuchAlgorithmException
|
||||
* @throws InvalidKeySpecException
|
||||
*/
|
||||
@ -179,7 +169,6 @@ public class ApplicationTest {
|
||||
String publicKey = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCX9uSsfJeIDIPzxCtwwFh5vrIKar69i3DPUTDEiKPRdtmADa8Ls6KAsPVpzgtQYoYVpYBoMbBtp0cGRoQULO83NWIAhmsU2cvd0nmGlB2xPRz+uGYW1rsYyCM8RSvfAwCVNsJD10A9voLhRQuYHPIDmay1sBA/casvEvYwMqDZtQIDAQAB";
|
||||
System.out.println(publicKey.length());
|
||||
|
||||
|
||||
// String privateKey = "MIIBVAIBADANBgkqhkiG9w0BAQEFAASCAT4wggE6AgEAAkEAiSo5blJ9-QJ0_QElcy5AaRTq-3oO4lJ8PvIOIt-Xr5SUFODVj3DUbiy6_0bxQYO3NiYHlXPb37UVV3jjlXJsXwIDAQABAkBE0WOJH2hGs93gRl_0vwLf9ffDfkTTdlER_73p70aad3QZRslEkinQH7G5aE_DgBm5m72TCeH-PD2FZ2lwtavBAiEAvnRown5Lpqbl0tN_OUxr_e1u9d_-8dNL_JEETO7BZCECIQC4XtY-18j0bVVLxaXPjKQ00D59yntwObihDNyRK0nAfwIgHPHEGgrnpGQo-Wl7JFIg925mNqfcLxRVsAS6CpcefQECIQCUsLdsmy6QIhTmNRJSXoSXq1KatE_05DhIekzwLs8eFQIgfMawMiu52ZxBI5_pZ7ancQZ6Dsxl45utFqJShzV1pio";
|
||||
//// String publicKey = "MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAIkqOW5SffkCdP0BJXMuQGkU6vt6DuJSfD7yDiLfl6-UlBTg1Y9w1G4suv9G8UGDtzYmB5Vz29-1FVd445VybF8CAwEAAQ";
|
||||
// String publicKey = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCX9uSsfJeIDIPzxCtwwFh5vrIKar69i3DPUTDEiKPRdtmADa8Ls6KAsPVpzgtQYoYVpYBoMbBtp0cGRoQULO83NWIAhmsU2cvd0nmGlB2xPRz+uGYW1rsYyCM8RSvfAwCVNsJD10A9voLhRQuYHPIDmay1sBA/casvEvYwMqDZtQIDAQAB";
|
||||
|
@ -1,7 +1,5 @@
|
||||
package com.yexuejc.springboot.base.test;
|
||||
|
||||
import sun.misc.BASE64Encoder;
|
||||
|
||||
import java.io.*;
|
||||
import java.security.KeyStore;
|
||||
import java.security.PrivateKey;
|
||||
@ -9,8 +7,11 @@ import java.security.PublicKey;
|
||||
import java.security.cert.Certificate;
|
||||
import java.security.cert.CertificateException;
|
||||
import java.security.cert.CertificateFactory;
|
||||
import java.util.Base64;
|
||||
|
||||
/**
|
||||
* 生成公钥工具; http://bijian1013.iteye.com/blog/2339874
|
||||
*
|
||||
* @ClassName: KeyStoreHelper
|
||||
* @Description:
|
||||
* @author: maxf
|
||||
@ -33,7 +34,7 @@ public class KeyStoreHelper {
|
||||
byte[] publicKeyBytes = publicKey.getEncoded();
|
||||
// byte[] privateKeyBytes = privateKey.getEncoded();
|
||||
|
||||
String publicKeyBase64 = new BASE64Encoder().encode(publicKeyBytes);
|
||||
String publicKeyBase64 = Base64.getEncoder().encodeToString(publicKeyBytes);
|
||||
// String privateKeyBase64 = new BASE64Encoder().encode(privateKeyBytes);
|
||||
|
||||
System.out.println("publicKeyBase64.length():" + publicKeyBase64.length());
|
||||
|
@ -4,11 +4,9 @@ import com.aliyun.mns.model.Message;
|
||||
import com.yexuejc.base.util.JsonUtil;
|
||||
import com.yexuejc.base.util.StrUtil;
|
||||
import com.yexuejc.springboot.base.autoconfigure.MnsFacade;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
@ -20,7 +18,6 @@ import java.util.Map;
|
||||
* @Description
|
||||
* @date 2018/11/1 14:25
|
||||
*/
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest
|
||||
public class MnsTest {
|
||||
|
||||
|
@ -6,11 +6,9 @@ import com.yexuejc.base.util.StrUtil;
|
||||
import com.yexuejc.springboot.base.autoconfigure.OssFacade;
|
||||
import com.yexuejc.springboot.base.exception.ImageException;
|
||||
import com.yexuejc.springboot.base.util.LogUtil;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
@ -23,7 +21,6 @@ import java.io.InputStream;
|
||||
* @Description
|
||||
* @date 2018/11/1 14:58
|
||||
*/
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest
|
||||
public class OssTest {
|
||||
@Autowired
|
||||
@ -32,11 +29,11 @@ public class OssTest {
|
||||
/**
|
||||
* 上传图片到oss
|
||||
* <p>
|
||||
* 这里是模拟微信登录时,获取到微信头像地址,缓存到base64,然后上传到OSS
|
||||
* 这里是模拟微信登录时,获取到微信头像地址,缓存到base64,然后上传到OSS
|
||||
* </p>
|
||||
*/
|
||||
@Test
|
||||
public void put(){
|
||||
public void put() {
|
||||
putOss4Head(null, "https://avatar.csdn.net/7/8/1/3_wulex.jpg");
|
||||
}
|
||||
|
||||
|
@ -3,8 +3,7 @@ package com.yexuejc.springboot.base.test;
|
||||
import com.yexuejc.base.util.JsonUtil;
|
||||
import com.yexuejc.base.util.StrUtil;
|
||||
import com.yexuejc.springboot.base.autoconfigure.MutiRedisAutoConfiguration;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
@ -24,7 +23,6 @@ import java.util.concurrent.TimeUnit;
|
||||
* @Description
|
||||
* @date 2018/11/1 11:16
|
||||
*/
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest
|
||||
public class RedisTest {
|
||||
/**
|
||||
|
@ -5,28 +5,46 @@ spring.application.name=@pom.artifactId@
|
||||
logging.level.root=info
|
||||
logging.path=/logs/yexuejc-springboot-parent
|
||||
|
||||
|
||||
#========================================================================================================================
|
||||
#========================================================================================================================
|
||||
#核心
|
||||
#开启功能 redis webmvc
|
||||
yexuejc.autoconfigure.redis.enable=true
|
||||
#webmvc 包含以下功能
|
||||
yexuejc.autoconfigure.webmvc.enable=true
|
||||
#全局异常处理
|
||||
yexuejc.ssl-ignore.enable=true
|
||||
#开启HTTPS(SSL)请求证书验证忽略
|
||||
yexuejc.global.exception.enable=true
|
||||
#开启校验过滤器,目前校验HTTP Header是否符合规范
|
||||
yexuejc.web.validation-filter.enable=true
|
||||
# 拦截类型(请求路径):0忽略模式,默认拦截全部;1拦截模式,默认一个都不拦截
|
||||
#yexuejc.http.filter=0
|
||||
yexuejc.http.filter.type=1
|
||||
#忽略路径:示例放开swagger
|
||||
#yexuejc.http.filter.ignored=/,/swagger/**,/error,/v2/api-docs,/webjars/**
|
||||
#========================================================================================================================
|
||||
#========================================================================================================================
|
||||
|
||||
|
||||
yexuejc.http.encrypt.encrypt=true
|
||||
yexuejc.http.encrypt.decrypt=true
|
||||
#配置密钥方式
|
||||
#配置密钥方式
|
||||
#yexuejc.http.encrypt.private-key=MIIBVAIBADANBgkqhkiG9w0BAQEFAASCAT4wggE6AgEAAkEAiSo5blJ9-QJ0_QElcy5AaRTq-3oO4lJ8PvIOIt-Xr5SUFODVj3DUbiy6_0bxQYO3NiYHlXPb37UVV3jjlXJsXwIDAQABAkBE0WOJH2hGs93gRl_0vwLf9ffDfkTTdlER_73p70aad3QZRslEkinQH7G5aE_DgBm5m72TCeH-PD2FZ2lwtavBAiEAvnRown5Lpqbl0tN_OUxr_e1u9d_-8dNL_JEETO7BZCECIQC4XtY-18j0bVVLxaXPjKQ00D59yntwObihDNyRK0nAfwIgHPHEGgrnpGQo-Wl7JFIg925mNqfcLxRVsAS6CpcefQECIQCUsLdsmy6QIhTmNRJSXoSXq1KatE_05DhIekzwLs8eFQIgfMawMiu52ZxBI5_pZ7ancQZ6Dsxl45utFqJShzV1pio
|
||||
#yexuejc.http.encrypt.public-key=MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAIkqOW5SffkCdP0BJXMuQGkU6vt6DuJSfD7yDiLfl6-UlBTg1Y9w1G4suv9G8UGDtzYmB5Vz29-1FVd445VybF8CAwEAAQ
|
||||
#配置证书方式
|
||||
#配置证书方式
|
||||
yexuejc.http.encrypt.private-key-path=/lgfishing.keystore
|
||||
yexuejc.http.encrypt.private-alias=lgfishing
|
||||
yexuejc.http.encrypt.private-pwd=lgfishing2018
|
||||
|
||||
|
||||
#编码
|
||||
#编码
|
||||
spring.http.encoding.force=true
|
||||
spring.http.encoding.charset=UTF-8
|
||||
spring.http.encoding.enabled=true
|
||||
server.tomcat.uri-encoding=UTF-8
|
||||
|
||||
#是否开启HTTPS(SSL)请求证书验证忽略:默认false
|
||||
#是否开启HTTPS(SSL)请求证书验证忽略:默认false
|
||||
yexuejc.enable.ssl-ignore=true
|
||||
|
||||
|
||||
@ -48,16 +66,16 @@ yexuejc.alibaba.oss.bucket=guansichou
|
||||
|
||||
|
||||
#========================================================================================================================
|
||||
# security相关
|
||||
# security相关
|
||||
#reids
|
||||
#开启指定redis库db0默认开启
|
||||
#开启指定redis库db0默认开启
|
||||
yexuejc.redis.db1=true
|
||||
spring.redis.jedis.pool.max-active=100
|
||||
spring.redis.jedis.pool.max-idle=10
|
||||
spring.redis.jedis.pool.min-idle=3
|
||||
spring.redis.host=121.42.165.89
|
||||
spring.redis.password=
|
||||
spring.redis.port=16379
|
||||
spring.redis.host=192.168.0.107
|
||||
spring.redis.password=yexuejc2022
|
||||
spring.redis.port=6379
|
||||
|
||||
|
||||
#db
|
||||
@ -75,19 +93,19 @@ spring.datasource.data=classpath:db/data.sql
|
||||
#========================================================================================================================
|
||||
#mybatis-plus
|
||||
mybatis-plus.mapper-locations=classpath*:mapper/*.xml
|
||||
#实体扫描,多个package用逗号或者分号分隔
|
||||
#实体扫描,多个package用逗号或者分号分隔
|
||||
mybatis-plus.type-aliases-package=com.yexuejc.springboot.base.security.domain
|
||||
#主键类型0:"数据库ID自增", 1:"用户输入ID",2:"该类型为未设置主键类型", 3:"全局唯一ID UUID",4:全局唯一ID (UUID),5:字符串全局唯一ID (idWorker 的字符串表示);
|
||||
#主键类型0:"数据库ID自增", 1:"用户输入ID",2:"该类型为未设置主键类型", 3:"全局唯一ID UUID",4:全局唯一ID (UUID),5:字符串全局唯一ID (idWorker 的字符串表示);
|
||||
mybatis-plus.global-config.db-config.id-type=uuid
|
||||
mybatis-plus.global-config.db-config.db-type=POSTGRE_SQL
|
||||
#字段策略 0:"忽略判断",1:"非 NULL 判断"),2:"非空判断"
|
||||
#字段策略 0:"忽略判断",1:"非 NULL 判断"),2:"非空判断"
|
||||
mybatis-plus.global-config.db-config.field-strategy=not_empty
|
||||
#驼峰下划线转换
|
||||
#驼峰下划线转换
|
||||
mybatis-plus.global-config.db-config.column-underline=true
|
||||
#逻辑删除配置(下面3个配置)
|
||||
#逻辑删除配置(下面3个配置)
|
||||
mybatis-plus.global-config.db-config.logic-delete-value=true
|
||||
mybatis-plus.global-config.db-config.logic-not-delete-value=false
|
||||
#配置返回数据库(column下划线命名&&返回java实体是驼峰命名),自动匹配无需as(没开启这个,SQL需要写as: select user_id as userId)
|
||||
#配置返回数据库(column下划线命名&&返回java实体是驼峰命名),自动匹配无需as(没开启这个,SQL需要写as: select user_id as userId)
|
||||
mybatis-plus.configuration.map-underscore-to-camel-case=true
|
||||
mybatis-plus.configuration.cache-enabled=false
|
||||
#========================================================================================================================
|
||||
|
@ -13,14 +13,16 @@
|
||||
https://gitee.com/incloudcode/yexuejc-springboot使用例子
|
||||
</description>
|
||||
|
||||
<properties>
|
||||
<yexuejc-springboot.version>${parent.version}</yexuejc-springboot.version>
|
||||
</properties>
|
||||
|
||||
<parent>
|
||||
<groupId>com.yexuejc.springboot</groupId>
|
||||
<artifactId>yexuejc-springboot-parent</artifactId>
|
||||
<version>1.2.1</version>
|
||||
<version>2.1.3</version>
|
||||
</parent>
|
||||
<properties>
|
||||
<yexuejc.base.version>1.3.9</yexuejc.base.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<!--base 引用-->
|
||||
<dependency>
|
||||
@ -32,7 +34,6 @@
|
||||
<dependency>
|
||||
<groupId>top.yexuejc</groupId>
|
||||
<artifactId>yexuejc-base</artifactId>
|
||||
<version>${yexuejc.base.version}</version>
|
||||
</dependency>
|
||||
<!-- 使用springMVC -->
|
||||
<dependency>
|
||||
@ -47,7 +48,7 @@
|
||||
<!-- JJWT -->
|
||||
<dependency>
|
||||
<groupId>io.jsonwebtoken</groupId>
|
||||
<artifactId>jjwt</artifactId>
|
||||
<artifactId>jjwt-api</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<!-- 使用Redis -->
|
||||
@ -80,13 +81,6 @@
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>yexuejc-nexus-public</id>
|
||||
<name>yexuejc-nexus-public</name>
|
||||
<url>https://nexus.yexuejc.club/repository/maven-public/</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
|
@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import com.example.demo.mapper.handler.JsonTypeHandler;
|
||||
import com.yexuejc.base.util.JsonUtil;
|
||||
import com.yexuejc.springboot.base.security.inte.User;
|
||||
|
||||
@ -27,7 +28,7 @@ public class Consumer extends Model<Consumer> implements User {
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@TableId(value = "consumer_id", type = IdType.UUID)
|
||||
@TableId(value = "consumer_id", type = IdType.ASSIGN_UUID)
|
||||
private String consumerId;
|
||||
/**
|
||||
* 手机号
|
||||
@ -92,7 +93,7 @@ public class Consumer extends Model<Consumer> implements User {
|
||||
/**
|
||||
* 角色、权限
|
||||
*/
|
||||
@TableField(value = "roles", el = "roles,typeHandler=com.yexuejc.guansc.core.mybatis.handler.JsonTypeHandler")
|
||||
@TableField(value = "roles", typeHandler = JsonTypeHandler.class)
|
||||
private List<String> roles;
|
||||
/**
|
||||
* 支付密码
|
||||
@ -157,19 +158,16 @@ public class Consumer extends Model<Consumer> implements User {
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
public Consumer setEnable(boolean enable) {
|
||||
this.enable = enable;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
public Consumer setNonExpire(boolean nonExpire) {
|
||||
this.nonExpire = nonExpire;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
public Consumer setNonLock(boolean nonLock) {
|
||||
this.nonLock = nonLock;
|
||||
return this;
|
||||
@ -275,7 +273,7 @@ public class Consumer extends Model<Consumer> implements User {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Serializable pkVal() {
|
||||
public Serializable pkVal() {
|
||||
return this.consumerId;
|
||||
}
|
||||
}
|
||||
|
@ -1,3 +1,4 @@
|
||||
server.port=8545
|
||||
logging.level.root=info
|
||||
|
||||
#========================================================================================================================
|
||||
@ -27,9 +28,9 @@ yexuejc.redis.db1=true
|
||||
spring.redis.jedis.pool.max-active=100
|
||||
spring.redis.jedis.pool.max-idle=10
|
||||
spring.redis.jedis.pool.min-idle=3
|
||||
spring.redis.host=121.42.165.89
|
||||
spring.redis.password=
|
||||
spring.redis.port=16379
|
||||
spring.redis.host=192.168.0.107
|
||||
spring.redis.password=yexuejc2022
|
||||
spring.redis.port=6379
|
||||
|
||||
|
||||
#db
|
||||
|
@ -1,11 +1,8 @@
|
||||
package com.example.demo;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest
|
||||
public class DemoApplicationTests {
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>com.yexuejc.springboot</groupId>
|
||||
<artifactId>yexuejc-springboot-parent</artifactId>
|
||||
<version>1.2.1</version>
|
||||
<version>2.1.3</version>
|
||||
</parent>
|
||||
<groupId>top.yexuejc</groupId>
|
||||
<artifactId>yexuejc-springboot-simple</artifactId>
|
||||
@ -14,14 +14,13 @@
|
||||
<description>测试工程</description>
|
||||
|
||||
<properties>
|
||||
<java.version>1.8</java.version>
|
||||
<yexuejc-springboot.version>${parent.version}</yexuejc-springboot.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.yexuejc.springboot</groupId>
|
||||
<artifactId>yexuejc-springboot-base</artifactId>
|
||||
<version>1.2.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
|
@ -1,11 +1,8 @@
|
||||
package top.yexuejc.springboot.simple;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest
|
||||
public class YexuejcSpringbootSimpleApplicationTests {
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user