1
0
mirror of https://gitee.com/incloudcode/yexuejc-springboot.git synced 2025-07-27 22:09:35 +08:00

Compare commits

..

No commits in common. "master" and "2.1.1" have entirely different histories.

19 changed files with 158 additions and 322 deletions

View File

@ -1,197 +0,0 @@
yexuejc-springboot 更新内容
-------------------
#### version 1.2.2
**time2019-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
**time2019-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
**time2018-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
**time2018-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
**time2018-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
**time2018-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
**time2018-8-17 11:41:18** <br/>
**branch** master <br/>
**关联工程:** <br/>
```
springboot-base:1.1.7
```
**update** <br/>
1. 升级base
---
#### version 1.0.12
**time2018-6-19 22:18:03** <br/>
**branch** master <br/>
**关联工程:** <br/>
```
springboot-base:1.1.6
```
**update** <br/>
1. maven仓库更新
---
#
#### version 1.0.11
**time2018-6-19 22:18:03** <br/>
**branch** master <br/>
**update** <br/>
1. 更新springboot-base:1.1.5依赖
---
#### version 1.0.10
**time2018年6月14日22:31:18** <br/>
**branch** master <br/>
**update** <br/>
1. 更新springboot-base:1.1.4依赖
2. 统一编码UTF-8
---
#### version 1.0.9
**time2018年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.第一次上传,集成通用环境
---

View File

@ -1,9 +1,8 @@
# yexuejc-springboot # yexuejc-springboot
### 说明 ### 说明
>基于springboot版本分别维护1.x(对应springboot1.5.16.RELEASE) 2.x(对应springboot2.0.5.RELEASE) 分支 <br> >本分支基于 springboot 2.x 开发版本号也将保持2.x
>master不再提供源代码源代码请到具体分支中查看 >1.x分支继续基于 springboot 1.x开发
#### 项目介绍 #### 项目介绍
基于springboot maven 封装可继承基础工程 基于springboot maven 封装可继承基础工程
@ -13,9 +12,8 @@ parent版本封装<br/>
base:功能封装 base:功能封装
#### 最新版本 #### 最新版本
* 1.x yexuejc.springboot.version=1.2.2 <br> >yexuejc.springboot.version=2.1.1 <br>
* 2.x yexuejc.springboot.version=2.1.3 <br> >yexuejc.base.version=1.3.9
* yexuejc.base.version=1.5.0-jre8
pom.xml pom.xml
``` ```
@ -36,16 +34,16 @@ pom.xml
<!--推荐使用--> <!--推荐使用-->
<!--https://gitee.com/incloudcode/yexuejc-base.git--> <!--https://gitee.com/incloudcode/yexuejc-base.git-->
<dependency> <dependency>
<groupId>top.yexuejc</groupId> <groupId>com.yexuejc.base</groupId>
<artifactId>yexuejc-base</artifactId> <artifactId>yexuejc-base</artifactId>
<version>${yexuejc.base.version}</version> <version>${yexuejc.base.version}</version>
</dependency> </dependency>
</dependencies> </dependencies>
<repositories> <repositories>
<repository> <repository>
<id>yexuejc-maven</id> <id>yexuejc-nexus-public</id>
<name>yexuejc maven</name> <name>yexuejc-nexus-public</name>
<url>https://nexus.yexuejc.top/repository/maven-public/</url> <url>https://nexus.yexuejc.club/repository/maven-public/</url>
</repository> </repository>
</repositories> </repositories>
``` ```
@ -105,10 +103,7 @@ pom.xml
#### 版本更新 #### 版本更新
持续集成中...
<br/>
集成到自己项目前请先阅读文档,或者先运行示例工程
更新记录: [1.x](1.x-update.md)、[2.x](2.x-update.md) [更新记录](UPDATE.md)
<br/> <br/>
[相关功能使用指南](doc/MENU.md) [相关功能使用指南](doc/MENU.md)

View File

@ -1,31 +1,5 @@
yexuejc-springboot 更新内容 yexuejc-springboot 更新内容
------------------- -------------------
#### version 2.1.3
**time2023-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 2.1.2
**time2020-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 #### version 2.1.1
**time2019-11-1 13:32:07** <br/> **time2019-11-1 13:32:07** <br/>
@ -38,7 +12,6 @@ spring-boot-starter-parent:2.0.5.RELEASE
**update** <br/> **update** <br/>
1. redis 配置修改,增加开关,更兼容 1. redis 配置修改,增加开关,更兼容
#### version 2.1.0 #### version 2.1.0
**time2019-7-24 18:30:49** <br/> **time2019-7-24 18:30:49** <br/>
**branch** master <br/> **branch** master <br/>

View File

@ -13,11 +13,3 @@
单独使用例子工程:[https://github.com/yexuejc/springboot-security-login-simple](https://github.com/yexuejc/springboot-security-login-simple) 单独使用例子工程:[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新增 针对API请求安全解决方案](PARAMS_RSA_DECRYPT_ENCRYPT.md)<br/>
* [1.0.6新增 加密功能](PARAMS_RSA_DECRYPT_ENCRYPT.md) * [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
```

103
pom.xml
View File

@ -5,7 +5,7 @@
<groupId>com.yexuejc.springboot</groupId> <groupId>com.yexuejc.springboot</groupId>
<artifactId>yexuejc-springboot-parent</artifactId> <artifactId>yexuejc-springboot-parent</artifactId>
<version>2.1.3</version> <version>2.1.1</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<name>${project.artifactId}</name> <name>${project.artifactId}</name>
@ -15,7 +15,7 @@
<!-- spring boot父级,包含了统一版本管理,统一插件管理等 --> <!-- spring boot父级,包含了统一版本管理,统一插件管理等 -->
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId> <artifactId>spring-boot-starter-parent</artifactId>
<version>2.7.15</version> <version>2.0.5.RELEASE</version>
<!--<relativePath/>--> <!--<relativePath/>-->
<!--lookup parent from repository--> <!--lookup parent from repository-->
</parent> </parent>
@ -26,57 +26,59 @@
</modules> </modules>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <yexuejc.base.version>1.3.9</yexuejc.base.version>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <repos.yexuejc.url>https://nexus.yexuejc.club/repository/</repos.yexuejc.url>
<java.version>1.8</java.version>
<maven.compiler.target>${java.version}</maven.compiler.target> <repos.aliyun.url>http://maven.aliyun.com/nexus/content/groups/public</repos.aliyun.url>
<maven.compiler.source>${java.version}</maven.compiler.source> <repos.jitpack.url>https://jitpack.io</repos.jitpack.url>
<maven.compiler.verbose>true</maven.compiler.verbose> <maven.compiler.verbose>true</maven.compiler.verbose>
<java.version>1.8</java.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> <validation-api.version>2.0.1.Final</validation-api.version>
<springfox-swagger2.version>2.10.5</springfox-swagger2.version> <springfox-swagger2.version>2.9.2</springfox-swagger2.version>
<mybatis-spring-boot-starter.version>2.3.1</mybatis-spring-boot-starter.version> <mybatis-spring-boot-starter.version>1.3.2</mybatis-spring-boot-starter.version>
<mybatis.version>3.5.13</mybatis.version> <mybatis.version>3.4.6</mybatis.version>
<jjwt.version>0.11.5</jjwt.version> <jjwt.version>0.9.1</jjwt.version>
<fastjson.version>1.2.49</fastjson.version> <fastjson.version>1.2.49</fastjson.version>
<commons-codec.version>1.15</commons-codec.version> <commons-codec.version>1.11</commons-codec.version>
<!-- 阿里云相关 --> <!-- 阿里云相关 -->
<aliyun-java-sdk-core.version>4.6.4</aliyun-java-sdk-core.version> <aliyun-java-sdk-core.version>4.1.1</aliyun-java-sdk-core.version>
<aliyun-java-sdk-sts.version>3.1.1</aliyun-java-sdk-sts.version> <aliyun-java-sdk-sts.version>3.0.0</aliyun-java-sdk-sts.version>
<aliyun-sdk-oss.version>3.17.1</aliyun-sdk-oss.version> <aliyun-sdk-oss.version>3.1.0</aliyun-sdk-oss.version>
<aliyun-java-sdk-dysmsapi.version>2.2.1</aliyun-java-sdk-dysmsapi.version> <aliyun-java-sdk-dysmsapi.version>1.1.0</aliyun-java-sdk-dysmsapi.version>
<aliyun-sdk-mns.version>1.1.9.2</aliyun-sdk-mns.version> <aliyun-sdk-mns.version>1.1.8</aliyun-sdk-mns.version>
<!-- 支付宝相关 --> <!-- 支付宝相关 -->
<alipay-sdk-java.version>4.38.76.ALL</alipay-sdk-java.version> <alipay-sdk-java.version>3.3.49.ALL</alipay-sdk-java.version>
<!-- 微信相关 --> <!-- 微信相关 -->
<WXPay-SDK-Java.version>0.0.4</WXPay-SDK-Java.version> <WXPay-SDK-Java.version>0.0.4</WXPay-SDK-Java.version>
<postgresql.version>42.6.0</postgresql.version> <postgresql.version>42.2.4</postgresql.version>
<!--thymeleaf 相关--> <!--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>
<reflectasm.version>1.11.9</reflectasm.version> <thymeleaf.version>3.0.9.RELEASE</thymeleaf.version>
<mybatis-plus.version>3.5.3.2</mybatis-plus.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>
</properties> </properties>
<!-- 声明包版本 继承项目自引入 --> <!-- 声明包版本 继承项目自引入 -->
<dependencyManagement> <dependencyManagement>
<dependencies> <dependencies>
<!--基础包--> <!--基础包-->
<!--<dependency>-->
<!--<groupId>com.github.yexuejc</groupId>-->
<!--<artifactId>yexuejc-base</artifactId>-->
<!--<version>${yexuejc.base.version}</version>-->
<!--</dependency>-->
<dependency> <dependency>
<groupId>top.yexuejc</groupId> <groupId>top.yexuejc</groupId>
<artifactId>yexuejc-base</artifactId> <artifactId>yexuejc-base</artifactId>
<version>${yexuejc.base.version}</version> <version>${yexuejc.base.version}</version>
</dependency> </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 --> <!-- 编码包 说明http://blog.csdn.net/jianggujin/article/details/51149133 -->
<dependency> <dependency>
<groupId>commons-codec</groupId> <groupId>commons-codec</groupId>
@ -86,9 +88,15 @@
<!-- JJWT --> <!-- JJWT -->
<dependency> <dependency>
<groupId>io.jsonwebtoken</groupId> <groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt-api</artifactId> <artifactId>jjwt</artifactId>
<version>${jjwt.version}</version> <version>${jjwt.version}</version>
</dependency> </dependency>
<!-- fastjson -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>${fastjson.version}</version>
</dependency>
<!-- MVC数据校验框架 --> <!-- MVC数据校验框架 -->
<dependency> <dependency>
@ -185,6 +193,11 @@
<artifactId>reflectasm</artifactId> <artifactId>reflectasm</artifactId>
<version>${reflectasm.version}</version> <version>${reflectasm.version}</version>
</dependency> </dependency>
<dependency>
<groupId>com.alibaba.boot</groupId>
<artifactId>dubbo-spring-boot-starter</artifactId>
<version>${dubbo-spring-boot-starter.version}</version>
</dependency>
<!-- springboot mybatis-plus--> <!-- springboot mybatis-plus-->
<dependency> <dependency>
<groupId>com.baomidou</groupId> <groupId>com.baomidou</groupId>
@ -266,17 +279,35 @@
</plugins> </plugins>
</pluginManagement> </pluginManagement>
</build> </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包发布目标 --> <!-- 中间件jar包发布目标 -->
<distributionManagement> <distributionManagement>
<repository> <repository>
<id>releases</id> <id>releases</id>
<name>nexus-release</name> <name>nexus-release</name>
<url>https://nexus.yexuejc.top/repository/maven-releases/</url> <url>${repos.yexuejc.url}maven-releases/</url>
</repository> </repository>
<snapshotRepository> <snapshotRepository>
<id>snapshots</id> <id>snapshots</id>
<name>nexus-snapshots</name> <name>nexus-snapshots</name>
<url>https://nexus.yexuejc.top/repository/maven-snapshots/</url> <url>${repos.yexuejc.url}maven-snapshots/</url>
</snapshotRepository> </snapshotRepository>
</distributionManagement> </distributionManagement>
</project> </project>

View File

@ -9,19 +9,27 @@
<parent> <parent>
<groupId>com.yexuejc.springboot</groupId> <groupId>com.yexuejc.springboot</groupId>
<artifactId>yexuejc-springboot-parent</artifactId> <artifactId>yexuejc-springboot-parent</artifactId>
<version>2.1.3</version> <version>2.1.1</version>
<!-- 本地打包:使用相对关联路径 --> <!-- 本地打包:使用相对关联路径 -->
<!--<relativePath>../</relativePath>--> <!--<relativePath>../</relativePath>-->
</parent> </parent>
<name>${project.artifactId}</name> <name>${project.artifactId}</name>
<!--<properties>-->
<!--<main.basedir>${basedir}/..</main.basedir>-->
<!--</properties>-->
<dependencies> <dependencies>
<!--基础包--> <!--基础包-->
<dependency> <dependency>
<groupId>top.yexuejc</groupId> <groupId>top.yexuejc</groupId>
<artifactId>yexuejc-base</artifactId> <artifactId>yexuejc-base</artifactId>
</dependency> </dependency>
<!--<dependency>-->
<!--<groupId>com.github.yexuejc</groupId>-->
<!--<artifactId>yexuejc-base</artifactId>-->
<!--</dependency>-->
<!-- 使用springMVC --> <!-- 使用springMVC -->
<dependency> <dependency>
@ -57,7 +65,7 @@
<!-- JJWT --> <!-- JJWT -->
<dependency> <dependency>
<groupId>io.jsonwebtoken</groupId> <groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt-api</artifactId> <artifactId>jjwt</artifactId>
<optional>true</optional> <optional>true</optional>
</dependency> </dependency>
<!-- 使用Redis --> <!-- 使用Redis -->

View File

@ -6,7 +6,6 @@ import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model; import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.yexuejc.base.util.JsonUtil; import com.yexuejc.base.util.JsonUtil;
import com.yexuejc.springboot.base.mapper.handler.JsonTypeHandler;
import com.yexuejc.springboot.base.security.inte.User; import com.yexuejc.springboot.base.security.inte.User;
import java.io.Serializable; import java.io.Serializable;
@ -28,7 +27,7 @@ public class Consumer extends Model<Consumer> implements User {
/** /**
* 用户id * 用户id
*/ */
@TableId(value = "consumer_id", type = IdType.ASSIGN_UUID) @TableId(value = "consumer_id", type = IdType.UUID)
private String consumerId; private String consumerId;
/** /**
* 手机号 * 手机号
@ -93,7 +92,7 @@ public class Consumer extends Model<Consumer> implements User {
/** /**
* 角色权限 * 角色权限
*/ */
@TableField(value = "roles", typeHandler = JsonTypeHandler.class) @TableField(value = "roles", el = "roles,typeHandler=com.yexuejc.guansc.core.mybatis.handler.JsonTypeHandler")
private List<String> roles; private List<String> roles;
/** /**
* 支付密码 * 支付密码
@ -158,16 +157,19 @@ public class Consumer extends Model<Consumer> implements User {
return this; return this;
} }
public Consumer setEnable(boolean enable) { public Consumer setEnable(boolean enable) {
this.enable = enable; this.enable = enable;
return this; return this;
} }
public Consumer setNonExpire(boolean nonExpire) { public Consumer setNonExpire(boolean nonExpire) {
this.nonExpire = nonExpire; this.nonExpire = nonExpire;
return this; return this;
} }
public Consumer setNonLock(boolean nonLock) { public Consumer setNonLock(boolean nonLock) {
this.nonLock = nonLock; this.nonLock = nonLock;
return this; return this;
@ -274,7 +276,7 @@ public class Consumer extends Model<Consumer> implements User {
} }
@Override @Override
public Serializable pkVal() { protected Serializable pkVal() {
return this.consumerId; return this.consumerId;
} }
} }

View File

@ -7,9 +7,11 @@ import com.yexuejc.base.util.JsonUtil;
import com.yexuejc.base.util.StrUtil; import com.yexuejc.base.util.StrUtil;
import com.yexuejc.springboot.base.ApplicationRun; import com.yexuejc.springboot.base.ApplicationRun;
import com.yexuejc.springboot.base.filter.RsaProperties; import com.yexuejc.springboot.base.filter.RsaProperties;
import org.junit.jupiter.api.Test; import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import java.io.IOException; import java.io.IOException;
import java.security.KeyStoreException; import java.security.KeyStoreException;
@ -17,12 +19,14 @@ import java.security.NoSuchAlgorithmException;
import java.security.UnrecoverableKeyException; import java.security.UnrecoverableKeyException;
import java.security.cert.CertificateException; import java.security.cert.CertificateException;
import java.security.spec.InvalidKeySpecException; import java.security.spec.InvalidKeySpecException;
import java.util.Base64;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest(classes = ApplicationRun.class) @SpringBootTest(classes = ApplicationRun.class)
public class ApplicationTest { public class ApplicationTest {
@Autowired @Autowired
@ -72,8 +76,10 @@ public class ApplicationTest {
// String strData = "HgTMgxEEFSr6zRLvZQ3U5CAKjJqwKf0lfruZTi32iWObkbJA5mHuOTKU4rXYkej4UsPfArYUA45GfxatwFoB4Q"; // String strData = "HgTMgxEEFSr6zRLvZQ3U5CAKjJqwKf0lfruZTi32iWObkbJA5mHuOTKU4rXYkej4UsPfArYUA45GfxatwFoB4Q";
String strData = "K9Zyg82WDvIApFmXTxPwjQw_VA041jfBcxMIP6jpMM6xWe1XajGf3__7DqSLrS9MwCra9cYkidcjVJAKZn9cmQ"; 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 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 = "X65trOhRSpeaN-2qP0zhdYi2jeJDcrTz2JHkc6UFG17xAho-VO0fkD0cA8wxoxcqyTaulOiSzaidZ2VeIvKjuinlKT2r23kdMJxjJodOZojssxgGSxm5gnry2tq5X8dbP7n-jodvAvLE9Gtq7AaBQ36ZQBQ2RcFB3TiHKHGin0gfn6T6A80orYD7i-Bdc0rh_pBEdLwGt1wWY_C8QuxeBmMWh0jmLVfpa3ZZOXVc9I7wIxzc1taQ7f-8Om9SNfXc";
String listData = "Sf_FO8YC9EUNTeM0n9EVuDzwvLz3DcxOuG4-5UZ9486lLHAx7IOuAhPgVHpQGsQiqJ7Y3fTaWFr6rRFPL12rVg"; String listData = "Sf_FO8YC9EUNTeM0n9EVuDzwvLz3DcxOuG4-5UZ9486lLHAx7IOuAhPgVHpQGsQiqJ7Y3fTaWFr6rRFPL12rVg";
@ -101,6 +107,7 @@ public class ApplicationTest {
) )
).isEqualTo("f721e7b0d5415302f5fe7dc5beb2938a"); ).isEqualTo("f721e7b0d5415302f5fe7dc5beb2938a");
//list //list
assertThat( assertThat(
StrUtil.toMD5( StrUtil.toMD5(
@ -113,6 +120,7 @@ public class ApplicationTest {
} }
/** /**
* 证书操作 * 证书操作
* *
@ -134,13 +142,15 @@ public class ApplicationTest {
// String dataStr = "{\"ret\":\"0\",\"expireTime\":\"2015/10/28 23:59:59\",\"rettxt\":\"OK\",\"token\":\"69296128A59798E2D423D3B1A9F766F4\"}"; // 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 dataStr = "{\"foodsCode\":\"49\",\"latlng\":\"22.5,114.0\",\"pageIndex\":1,\"pageSize\":10}";
/***************************************************************************************************************************************************************************************************************************************/ /***************************************************************************************************************************************************************************************************************************************/
//客户端公钥加密 //客户端公钥加密
// String publicEncryptResult = RSA.publicEncrypt(dataStr, RSA2.getPublicKey(publicKey)); // String publicEncryptResult = RSA.publicEncrypt(dataStr, RSA2.getPublicKey(publicKey));
// System.out.println(publicEncryptResult); // System.out.println(publicEncryptResult);
// System.out.println(StrUtil.toMD5(dataStr)); // 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)); String privateDecryptResult = RSA.privateDecrypt(publicEncryptResult, RSA2.getPrivateKey(privateKey, privateAlias, privatePwd));
@ -158,9 +168,9 @@ public class ApplicationTest {
} }
/** /**
* key加解密 * key加解密
*
* @throws NoSuchAlgorithmException * @throws NoSuchAlgorithmException
* @throws InvalidKeySpecException * @throws InvalidKeySpecException
*/ */
@ -169,6 +179,7 @@ public class ApplicationTest {
String publicKey = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCX9uSsfJeIDIPzxCtwwFh5vrIKar69i3DPUTDEiKPRdtmADa8Ls6KAsPVpzgtQYoYVpYBoMbBtp0cGRoQULO83NWIAhmsU2cvd0nmGlB2xPRz+uGYW1rsYyCM8RSvfAwCVNsJD10A9voLhRQuYHPIDmay1sBA/casvEvYwMqDZtQIDAQAB"; String publicKey = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCX9uSsfJeIDIPzxCtwwFh5vrIKar69i3DPUTDEiKPRdtmADa8Ls6KAsPVpzgtQYoYVpYBoMbBtp0cGRoQULO83NWIAhmsU2cvd0nmGlB2xPRz+uGYW1rsYyCM8RSvfAwCVNsJD10A9voLhRQuYHPIDmay1sBA/casvEvYwMqDZtQIDAQAB";
System.out.println(publicKey.length()); 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 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 = "MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAIkqOW5SffkCdP0BJXMuQGkU6vt6DuJSfD7yDiLfl6-UlBTg1Y9w1G4suv9G8UGDtzYmB5Vz29-1FVd445VybF8CAwEAAQ";
// String publicKey = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCX9uSsfJeIDIPzxCtwwFh5vrIKar69i3DPUTDEiKPRdtmADa8Ls6KAsPVpzgtQYoYVpYBoMbBtp0cGRoQULO83NWIAhmsU2cvd0nmGlB2xPRz+uGYW1rsYyCM8RSvfAwCVNsJD10A9voLhRQuYHPIDmay1sBA/casvEvYwMqDZtQIDAQAB"; // String publicKey = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCX9uSsfJeIDIPzxCtwwFh5vrIKar69i3DPUTDEiKPRdtmADa8Ls6KAsPVpzgtQYoYVpYBoMbBtp0cGRoQULO83NWIAhmsU2cvd0nmGlB2xPRz+uGYW1rsYyCM8RSvfAwCVNsJD10A9voLhRQuYHPIDmay1sBA/casvEvYwMqDZtQIDAQAB";

View File

@ -1,5 +1,7 @@
package com.yexuejc.springboot.base.test; package com.yexuejc.springboot.base.test;
import sun.misc.BASE64Encoder;
import java.io.*; import java.io.*;
import java.security.KeyStore; import java.security.KeyStore;
import java.security.PrivateKey; import java.security.PrivateKey;
@ -7,11 +9,8 @@ import java.security.PublicKey;
import java.security.cert.Certificate; import java.security.cert.Certificate;
import java.security.cert.CertificateException; import java.security.cert.CertificateException;
import java.security.cert.CertificateFactory; import java.security.cert.CertificateFactory;
import java.util.Base64;
/** /**
* 生成公钥工具; http://bijian1013.iteye.com/blog/2339874 * 生成公钥工具; http://bijian1013.iteye.com/blog/2339874
*
* @ClassName: KeyStoreHelper * @ClassName: KeyStoreHelper
* @Description: * @Description:
* @author: maxf * @author: maxf
@ -34,7 +33,7 @@ public class KeyStoreHelper {
byte[] publicKeyBytes = publicKey.getEncoded(); byte[] publicKeyBytes = publicKey.getEncoded();
// byte[] privateKeyBytes = privateKey.getEncoded(); // byte[] privateKeyBytes = privateKey.getEncoded();
String publicKeyBase64 = Base64.getEncoder().encodeToString(publicKeyBytes); String publicKeyBase64 = new BASE64Encoder().encode(publicKeyBytes);
// String privateKeyBase64 = new BASE64Encoder().encode(privateKeyBytes); // String privateKeyBase64 = new BASE64Encoder().encode(privateKeyBytes);
System.out.println("publicKeyBase64.length():" + publicKeyBase64.length()); System.out.println("publicKeyBase64.length():" + publicKeyBase64.length());

View File

@ -4,9 +4,11 @@ import com.aliyun.mns.model.Message;
import com.yexuejc.base.util.JsonUtil; import com.yexuejc.base.util.JsonUtil;
import com.yexuejc.base.util.StrUtil; import com.yexuejc.base.util.StrUtil;
import com.yexuejc.springboot.base.autoconfigure.MnsFacade; import com.yexuejc.springboot.base.autoconfigure.MnsFacade;
import org.junit.jupiter.api.Test; import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
@ -18,6 +20,7 @@ import java.util.Map;
* @Description * @Description
* @date 2018/11/1 14:25 * @date 2018/11/1 14:25
*/ */
@RunWith(SpringRunner.class)
@SpringBootTest @SpringBootTest
public class MnsTest { public class MnsTest {

View File

@ -6,9 +6,11 @@ import com.yexuejc.base.util.StrUtil;
import com.yexuejc.springboot.base.autoconfigure.OssFacade; import com.yexuejc.springboot.base.autoconfigure.OssFacade;
import com.yexuejc.springboot.base.exception.ImageException; import com.yexuejc.springboot.base.exception.ImageException;
import com.yexuejc.springboot.base.util.LogUtil; import com.yexuejc.springboot.base.util.LogUtil;
import org.junit.jupiter.api.Test; import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import java.io.ByteArrayInputStream; import java.io.ByteArrayInputStream;
import java.io.IOException; import java.io.IOException;
@ -21,6 +23,7 @@ import java.io.InputStream;
* @Description * @Description
* @date 2018/11/1 14:58 * @date 2018/11/1 14:58
*/ */
@RunWith(SpringRunner.class)
@SpringBootTest @SpringBootTest
public class OssTest { public class OssTest {
@Autowired @Autowired
@ -29,11 +32,11 @@ public class OssTest {
/** /**
* 上传图片到oss * 上传图片到oss
* <p> * <p>
* 这里是模拟微信登录时获取到微信头像地址缓存到base64然后上传到OSS * 这里是模拟微信登录时获取到微信头像地址缓存到base64然后上传到OSS
* </p> * </p>
*/ */
@Test @Test
public void put() { public void put(){
putOss4Head(null, "https://avatar.csdn.net/7/8/1/3_wulex.jpg"); putOss4Head(null, "https://avatar.csdn.net/7/8/1/3_wulex.jpg");
} }

View File

@ -3,7 +3,8 @@ package com.yexuejc.springboot.base.test;
import com.yexuejc.base.util.JsonUtil; import com.yexuejc.base.util.JsonUtil;
import com.yexuejc.base.util.StrUtil; import com.yexuejc.base.util.StrUtil;
import com.yexuejc.springboot.base.autoconfigure.MutiRedisAutoConfiguration; import com.yexuejc.springboot.base.autoconfigure.MutiRedisAutoConfiguration;
import org.junit.jupiter.api.Test; import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest;
@ -23,6 +24,7 @@ import java.util.concurrent.TimeUnit;
* @Description * @Description
* @date 2018/11/1 11:16 * @date 2018/11/1 11:16
*/ */
@RunWith(SpringRunner.class)
@SpringBootTest @SpringBootTest
public class RedisTest { public class RedisTest {
/** /**

View File

@ -73,9 +73,9 @@ yexuejc.redis.db1=true
spring.redis.jedis.pool.max-active=100 spring.redis.jedis.pool.max-active=100
spring.redis.jedis.pool.max-idle=10 spring.redis.jedis.pool.max-idle=10
spring.redis.jedis.pool.min-idle=3 spring.redis.jedis.pool.min-idle=3
spring.redis.host=192.168.0.107 spring.redis.host=121.42.165.89
spring.redis.password=yexuejc2022 spring.redis.password=
spring.redis.port=6379 spring.redis.port=16379
#db #db

View File

@ -13,16 +13,14 @@
https://gitee.com/incloudcode/yexuejc-springboot使用例子 https://gitee.com/incloudcode/yexuejc-springboot使用例子
</description> </description>
<properties>
<yexuejc-springboot.version>${parent.version}</yexuejc-springboot.version>
</properties>
<parent> <parent>
<groupId>com.yexuejc.springboot</groupId> <groupId>com.yexuejc.springboot</groupId>
<artifactId>yexuejc-springboot-parent</artifactId> <artifactId>yexuejc-springboot-parent</artifactId>
<version>2.1.3</version> <version>2.1.1</version>
</parent> </parent>
<properties>
<yexuejc.base.version>1.3.9</yexuejc.base.version>
</properties>
<dependencies> <dependencies>
<!--base 引用--> <!--base 引用-->
<dependency> <dependency>
@ -34,6 +32,7 @@
<dependency> <dependency>
<groupId>top.yexuejc</groupId> <groupId>top.yexuejc</groupId>
<artifactId>yexuejc-base</artifactId> <artifactId>yexuejc-base</artifactId>
<version>${yexuejc.base.version}</version>
</dependency> </dependency>
<!-- 使用springMVC --> <!-- 使用springMVC -->
<dependency> <dependency>
@ -48,7 +47,7 @@
<!-- JJWT --> <!-- JJWT -->
<dependency> <dependency>
<groupId>io.jsonwebtoken</groupId> <groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt-api</artifactId> <artifactId>jjwt</artifactId>
<optional>true</optional> <optional>true</optional>
</dependency> </dependency>
<!-- 使用Redis --> <!-- 使用Redis -->
@ -81,6 +80,13 @@
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
</dependencies> </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> <build>
<plugins> <plugins>

View File

@ -5,7 +5,6 @@ import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model; import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.example.demo.mapper.handler.JsonTypeHandler;
import com.yexuejc.base.util.JsonUtil; import com.yexuejc.base.util.JsonUtil;
import com.yexuejc.springboot.base.security.inte.User; import com.yexuejc.springboot.base.security.inte.User;
@ -28,7 +27,7 @@ public class Consumer extends Model<Consumer> implements User {
/** /**
* 用户id * 用户id
*/ */
@TableId(value = "consumer_id", type = IdType.ASSIGN_UUID) @TableId(value = "consumer_id", type = IdType.UUID)
private String consumerId; private String consumerId;
/** /**
* 手机号 * 手机号
@ -93,7 +92,7 @@ public class Consumer extends Model<Consumer> implements User {
/** /**
* 角色权限 * 角色权限
*/ */
@TableField(value = "roles", typeHandler = JsonTypeHandler.class) @TableField(value = "roles", el = "roles,typeHandler=com.yexuejc.guansc.core.mybatis.handler.JsonTypeHandler")
private List<String> roles; private List<String> roles;
/** /**
* 支付密码 * 支付密码
@ -158,16 +157,19 @@ public class Consumer extends Model<Consumer> implements User {
return this; return this;
} }
public Consumer setEnable(boolean enable) { public Consumer setEnable(boolean enable) {
this.enable = enable; this.enable = enable;
return this; return this;
} }
public Consumer setNonExpire(boolean nonExpire) { public Consumer setNonExpire(boolean nonExpire) {
this.nonExpire = nonExpire; this.nonExpire = nonExpire;
return this; return this;
} }
public Consumer setNonLock(boolean nonLock) { public Consumer setNonLock(boolean nonLock) {
this.nonLock = nonLock; this.nonLock = nonLock;
return this; return this;
@ -273,7 +275,7 @@ public class Consumer extends Model<Consumer> implements User {
} }
@Override @Override
public Serializable pkVal() { protected Serializable pkVal() {
return this.consumerId; return this.consumerId;
} }
} }

View File

@ -1,4 +1,3 @@
server.port=8545
logging.level.root=info logging.level.root=info
#======================================================================================================================== #========================================================================================================================
@ -28,9 +27,9 @@ yexuejc.redis.db1=true
spring.redis.jedis.pool.max-active=100 spring.redis.jedis.pool.max-active=100
spring.redis.jedis.pool.max-idle=10 spring.redis.jedis.pool.max-idle=10
spring.redis.jedis.pool.min-idle=3 spring.redis.jedis.pool.min-idle=3
spring.redis.host=192.168.0.107 spring.redis.host=121.42.165.89
spring.redis.password=yexuejc2022 spring.redis.password=
spring.redis.port=6379 spring.redis.port=16379
#db #db

View File

@ -1,8 +1,11 @@
package com.example.demo; package com.example.demo;
import org.junit.jupiter.api.Test; import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@SpringBootTest @SpringBootTest
public class DemoApplicationTests { public class DemoApplicationTests {

View File

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>com.yexuejc.springboot</groupId> <groupId>com.yexuejc.springboot</groupId>
<artifactId>yexuejc-springboot-parent</artifactId> <artifactId>yexuejc-springboot-parent</artifactId>
<version>2.1.3</version> <version>2.1.1</version>
</parent> </parent>
<groupId>top.yexuejc</groupId> <groupId>top.yexuejc</groupId>
<artifactId>yexuejc-springboot-simple</artifactId> <artifactId>yexuejc-springboot-simple</artifactId>
@ -14,13 +14,14 @@
<description>测试工程</description> <description>测试工程</description>
<properties> <properties>
<yexuejc-springboot.version>${parent.version}</yexuejc-springboot.version> <java.version>1.8</java.version>
</properties> </properties>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>com.yexuejc.springboot</groupId> <groupId>com.yexuejc.springboot</groupId>
<artifactId>yexuejc-springboot-base</artifactId> <artifactId>yexuejc-springboot-base</artifactId>
<version>${parent.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>

View File

@ -1,8 +1,11 @@
package top.yexuejc.springboot.simple; package top.yexuejc.springboot.simple;
import org.junit.jupiter.api.Test; import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@SpringBootTest @SpringBootTest
public class YexuejcSpringbootSimpleApplicationTests { public class YexuejcSpringbootSimpleApplicationTests {