From 15498dafcc01144111011a2adeb1ab1a5d65cdf0 Mon Sep 17 00:00:00 2001 From: yexuejc <1107047387@qq.com> Date: Tue, 19 Sep 2023 11:26:17 +0800 Subject: [PATCH] =?UTF-8?q?2.1.3[=E5=8E=9F=E5=8A=9F=E8=83=BD=E7=9A=84?= =?UTF-8?q?=E6=9C=80=E5=90=8E=E4=B8=80=E4=B8=AA=E7=89=88=E6=9C=AC]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- UPDATE.md | 67 +++++++---- doc/MENU.md | 8 ++ pom.xml | 104 +++++++----------- yexuejc-springboot-base/pom.xml | 12 +- .../base/security/domain/Consumer.java | 10 +- .../springboot/base/test/ApplicationTest.java | 17 +-- .../springboot/base/test/KeyStoreHelper.java | 7 +- .../yexuejc/springboot/base/test/MnsTest.java | 5 +- .../yexuejc/springboot/base/test/OssTest.java | 9 +- .../springboot/base/test/RedisTest.java | 4 +- .../src/test/resources/application.properties | 46 ++++---- yexuejc-springboot-example/pom.xml | 19 ++++ .../springboot-security-login-simple/pom.xml | 20 ++-- .../demo/security/domain/Consumer.java | 10 +- .../src/main/resources/application.properties | 39 +++---- .../example/demo/DemoApplicationTests.java | 5 +- .../yexuejc-springboot-simple/pom.xml | 5 +- ...xuejcSpringbootSimpleApplicationTests.java | 5 +- 18 files changed, 183 insertions(+), 209 deletions(-) diff --git a/UPDATE.md b/UPDATE.md index 626d28d..eae71af 100644 --- a/UPDATE.md +++ b/UPDATE.md @@ -1,6 +1,20 @@ yexuejc-springboot 更新内容 ------------------- +#### version :2.1.3 +**time:2023-9-19 11:15:33**
+**branch:** 2.x
+**关联工程:**
+``` +springboot-base:1.5.0-jre8 +spring-boot-starter-parent:2.7.15 +``` +**update:**
+1. 全面更新依赖(时隔3年多,该项目又活了) +2. 保证原功能正常的最后一个版本 +3. 该版本基于JDK1.8 +--- + #### version :2.1.2 **time:2020-5-18 12:18:14**
**branch:** master
@@ -13,6 +27,7 @@ spring-boot-starter-parent:1.5.16.RELEASE 1. 更新依赖 2. 更新仓库地址 https://nexus.yexuejc.club/ 为 https://nexus.yexuejc.top/ +--- #### version :2.1.1 **time:2019-11-1 13:32:07**
**branch:** master
@@ -23,7 +38,7 @@ spring-boot-starter-parent:2.0.5.RELEASE ``` **update:**
1. redis 配置修改,增加开关,更兼容 - +--- #### version :2.1.0 **time:2019-7-24 18:30:49**
**branch:** master
@@ -35,7 +50,7 @@ spring-boot-starter-parent:2.0.5.RELEASE **update:**
1. 所有自动装配增加开关,默认不装配。装配方式请参考[本项目自动装配开关](doc/plugin/AutoConfigure.md) - +--- # #### version :2.0.6 **time:2019年4月2日21:08:453**
@@ -49,7 +64,7 @@ spring-boot-starter-parent:2.0.5.RELEASE 1. 升级依赖 2. 出入参加密 ParamsRequestBodyAdvice/ParamsResponseBodyAdvice 增加开关(默认关) - +--- # #### version :2.0.5 @@ -65,7 +80,7 @@ spring-boot-starter-parent:2.0.5.RELEASE 支持账号登录、短信登录、第三方授权openid登录
功能链接[security重构-多方登录](doc/SECURITY.md) - +--- # #### version :2.0.3 **time:2018-11-9 16:58:06**
@@ -78,7 +93,7 @@ spring-boot-starter-parent:2.0.5.RELEASE **update:**
1. 集成springboot security 多方登录 2. 文档拆分 - +--- # #### version :2.0.2 @@ -107,8 +122,8 @@ logging.level.root=info logging.path=/logs/yexuejc-springboot-parent ``` -# +--- #### version :2.0.1 **time:2018-9-28 15:25:30**
**branch:** 2.x
@@ -119,8 +134,8 @@ spring-boot-starter-parent:2.0.5.RELEASE ``` **update:**
1. 新增声明包 -# +--- #### version :2.0.0 **time:2018-9-26 16:55:00**
**branch:** 2.x
@@ -132,8 +147,8 @@ spring-boot-starter-parent:2.0.5.RELEASE **update:**
1. 升级依赖 2. 2.x分支将基于springboot 2.x 开发 -# +--- #### version :1.1.0 **time:2018-9-23 12:49:36**
**branch:** master
@@ -146,8 +161,8 @@ spring-boot-starter-parent:1.5.15.RELEASE 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**
**branch:** master
@@ -158,8 +173,8 @@ spring-boot-starter-parent:1.5.15.RELEASE ``` **update:**
1. 升级依赖 -# +--- #### version :1.0.14 **time:2018-8-25 14:31:05**
**branch:** master
@@ -171,8 +186,8 @@ spring-boot-starter-parent:1.5.15.RELEASE **update:**
1. 升级依赖 2. 优化拦截规则:增加通配符 /** -# +--- #### version :1.0.13 **time:2018-8-17 11:41:18**
**branch:** master
@@ -182,8 +197,8 @@ springboot-base:1.1.7 ``` **update:**
1. 升级base -# +--- #### version :1.0.12 **time:2018-6-19 22:18:03**
**branch:** master
@@ -193,30 +208,32 @@ springboot-base:1.1.6 ``` **update:**
1. maven仓库更新 - +--- # #### version :1.0.11 **time:2018-6-19 22:18:03**
**branch:** master
**update:**
1. 更新springboot-base:1.1.5依赖 -# +--- #### version :1.0.10 **time:2018年6月14日22:31:18**
**branch:** master
**update:**
1. 更新springboot-base:1.1.4依赖 2. 统一编码:UTF-8 -# + +--- #### version :1.0.9 **time:2018年6月2日12:17:18**
**branch:** master
**update:**
1. 更新base依赖 -# + +--- #### version :1.0.8 **time:** 2018-5-4 09:54:18
**branch:** master
@@ -235,7 +252,7 @@ yexuejc.http.encrypt.private-alias=别名 yexuejc.http.encrypt.private-pwd=密码 ``` -# +--- ##### version :1.0.7 **time:** 2018-5-4 09:54:18
**branch:** master
@@ -243,7 +260,7 @@ yexuejc.http.encrypt.private-pwd=密码 >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
**time:** 2018-5-4 09:54:18
@@ -252,32 +269,34 @@ yexuejc.http.encrypt.private-pwd=密码 > [使用加密解密](doc/PARAMS_RSA_DECRYPT_ENCRYPT.md) > >1.增加json入参解密、出参加密 -# + +--- ##### version :1.0.4 **time:** 2018-5-4 09:54:18
**branch:** master
**update:**
>1.更新springboot至1.5.12.RELEASE -# + +--- #### version :1.0.3 **time:** 2018-4-9 15:24:13
**branch:** master
**update:**
>1.变更包名 -# +--- #### version :1.0.2 **time:** 2018-4-1 17:00:15
**env:** prod
**update:**
>1.修复工具包ApiVO -# +--- #### version :0.0.2 **time:** 2018-1-31 13:48:34
**env:** ivt
**update:**
>1.集成日志【security】 -# +--- ##### version :0.0.1 **time:** 2018-1-31 12:16:10
@@ -285,4 +304,4 @@ yexuejc.http.encrypt.private-pwd=密码 **update:**
>1.第一次上传,集成通用环境 -# +--- diff --git a/doc/MENU.md b/doc/MENU.md index a614dd5..2bae09b 100644 --- a/doc/MENU.md +++ b/doc/MENU.md @@ -13,3 +13,11 @@ 单独使用例子工程:[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)
* [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 +``` \ No newline at end of file diff --git a/pom.xml b/pom.xml index 85b5f28..c434fa3 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ com.yexuejc.springboot yexuejc-springboot-parent - 2.1.2 + 2.1.3 pom ${project.artifactId} @@ -15,7 +15,7 @@ org.springframework.boot spring-boot-starter-parent - 2.0.5.RELEASE + 2.7.15 @@ -26,59 +26,58 @@ - 1.4.0 - https://nexus.yexuejc.top/repository/ - - http://maven.aliyun.com/nexus/content/groups/public - https://jitpack.io - - - true + UTF-8 + UTF-8 1.8 - 2.0.1.Final - 2.9.2 - 1.3.2 - 3.4.6 + ${java.version} + ${java.version} + true - 0.9.1 + 1.5.0-jre8 + ${project.version} + + 2.0.1.Final + 2.10.5 + 2.3.1 + 3.5.13 + + 0.11.5 1.2.49 - 1.11 + 1.15 - 4.1.1 - 3.0.0 - 3.1.0 - 1.1.0 - 1.1.8 + 4.6.4 + 3.1.1 + 3.17.1 + 2.2.1 + 1.1.9.2 - 3.3.49.ALL + 4.38.76.ALL 0.0.4 - 42.2.4 + 42.6.0 - 3.0.9.RELEASE - 2.3.0 - 3.0.2.RELEASE + 3.1.2.RELEASE + 3.3.0 + 3.0.5.RELEASE - 1.09 - - 0.2.0 - 3.0.3 + 1.11.9 + 3.5.3.2 - - - - - top.yexuejc yexuejc-base ${yexuejc.base.version} + + com.yexuejc.springboot + yexuejc-springboot-base + ${yexuejc-springboot.version} + commons-codec @@ -88,15 +87,9 @@ io.jsonwebtoken - jjwt + jjwt-api ${jjwt.version} - - - com.alibaba - fastjson - ${fastjson.version} - @@ -193,11 +186,6 @@ reflectasm ${reflectasm.version} - - com.alibaba.boot - dubbo-spring-boot-starter - ${dubbo-spring-boot-starter.version} - com.baomidou @@ -279,35 +267,17 @@ - - - - yexuejc-nexus-public - yexuejc-nexus-public - ${repos.yexuejc.url}maven-public/ - - - aliyun-nexus-public - aliyun-nexus-public - ${repos.aliyun.url} - - - jitpack.io - ${repos.jitpack.url} - - releases nexus-release - ${repos.yexuejc.url}maven-releases/ + https://nexus.yexuejc.top/repository/maven-releases/ snapshots nexus-snapshots - ${repos.yexuejc.url}maven-snapshots/ + https://nexus.yexuejc.top/repository/maven-snapshots/ - diff --git a/yexuejc-springboot-base/pom.xml b/yexuejc-springboot-base/pom.xml index f6c3661..d09580a 100644 --- a/yexuejc-springboot-base/pom.xml +++ b/yexuejc-springboot-base/pom.xml @@ -9,27 +9,19 @@ com.yexuejc.springboot yexuejc-springboot-parent - 2.1.2 + 2.1.3 ${project.artifactId} - - - - top.yexuejc yexuejc-base - - - - @@ -65,7 +57,7 @@ io.jsonwebtoken - jjwt + jjwt-api true diff --git a/yexuejc-springboot-base/src/test/java/com/yexuejc/springboot/base/security/domain/Consumer.java b/yexuejc-springboot-base/src/test/java/com/yexuejc/springboot/base/security/domain/Consumer.java index bf7d8d2..2035f90 100644 --- a/yexuejc-springboot-base/src/test/java/com/yexuejc/springboot/base/security/domain/Consumer.java +++ b/yexuejc-springboot-base/src/test/java/com/yexuejc/springboot/base/security/domain/Consumer.java @@ -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 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 implements User { /** * 角色、权限 */ - @TableField(value = "roles", el = "roles,typeHandler=com.yexuejc.guansc.core.mybatis.handler.JsonTypeHandler") + @TableField(value = "roles", typeHandler = JsonTypeHandler.class) private List roles; /** * 支付密码 @@ -157,19 +158,16 @@ public class Consumer extends Model 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 implements User { } @Override - protected Serializable pkVal() { + public Serializable pkVal() { return this.consumerId; } } diff --git a/yexuejc-springboot-base/src/test/java/com/yexuejc/springboot/base/test/ApplicationTest.java b/yexuejc-springboot-base/src/test/java/com/yexuejc/springboot/base/test/ApplicationTest.java index 61ff94e..50f4cc6 100644 --- a/yexuejc-springboot-base/src/test/java/com/yexuejc/springboot/base/test/ApplicationTest.java +++ b/yexuejc-springboot-base/src/test/java/com/yexuejc/springboot/base/test/ApplicationTest.java @@ -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"; diff --git a/yexuejc-springboot-base/src/test/java/com/yexuejc/springboot/base/test/KeyStoreHelper.java b/yexuejc-springboot-base/src/test/java/com/yexuejc/springboot/base/test/KeyStoreHelper.java index c9318e4..b93fd2f 100644 --- a/yexuejc-springboot-base/src/test/java/com/yexuejc/springboot/base/test/KeyStoreHelper.java +++ b/yexuejc-springboot-base/src/test/java/com/yexuejc/springboot/base/test/KeyStoreHelper.java @@ -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()); diff --git a/yexuejc-springboot-base/src/test/java/com/yexuejc/springboot/base/test/MnsTest.java b/yexuejc-springboot-base/src/test/java/com/yexuejc/springboot/base/test/MnsTest.java index 9df5d21..55641c8 100644 --- a/yexuejc-springboot-base/src/test/java/com/yexuejc/springboot/base/test/MnsTest.java +++ b/yexuejc-springboot-base/src/test/java/com/yexuejc/springboot/base/test/MnsTest.java @@ -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 { diff --git a/yexuejc-springboot-base/src/test/java/com/yexuejc/springboot/base/test/OssTest.java b/yexuejc-springboot-base/src/test/java/com/yexuejc/springboot/base/test/OssTest.java index b1250b4..ebce9ea 100644 --- a/yexuejc-springboot-base/src/test/java/com/yexuejc/springboot/base/test/OssTest.java +++ b/yexuejc-springboot-base/src/test/java/com/yexuejc/springboot/base/test/OssTest.java @@ -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 *

- * 这里是模拟微信登录时,获取到微信头像地址,缓存到base64,然后上传到OSS + * 这里是模拟微信登录时,获取到微信头像地址,缓存到base64,然后上传到OSS *

*/ @Test - public void put(){ + public void put() { putOss4Head(null, "https://avatar.csdn.net/7/8/1/3_wulex.jpg"); } diff --git a/yexuejc-springboot-base/src/test/java/com/yexuejc/springboot/base/test/RedisTest.java b/yexuejc-springboot-base/src/test/java/com/yexuejc/springboot/base/test/RedisTest.java index 2d4ada4..4a92c40 100644 --- a/yexuejc-springboot-base/src/test/java/com/yexuejc/springboot/base/test/RedisTest.java +++ b/yexuejc-springboot-base/src/test/java/com/yexuejc/springboot/base/test/RedisTest.java @@ -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 { /** diff --git a/yexuejc-springboot-base/src/test/resources/application.properties b/yexuejc-springboot-base/src/test/resources/application.properties index 528fd55..bbca371 100644 --- a/yexuejc-springboot-base/src/test/resources/application.properties +++ b/yexuejc-springboot-base/src/test/resources/application.properties @@ -7,21 +7,21 @@ logging.path=/logs/yexuejc-springboot-parent #======================================================================================================================== #======================================================================================================================== -#核心 -#开启功能 redis webmvc +#\u6838\u5FC3 +#\u5F00\u542F\u529F\u80FD redis webmvc yexuejc.autoconfigure.redis.enable=true -#webmvc 包含以下功能 +#webmvc \u5305\u542B\u4EE5\u4E0B\u529F\u80FD yexuejc.autoconfigure.webmvc.enable=true -#全局异常处理 +#\u5168\u5C40\u5F02\u5E38\u5904\u7406 yexuejc.ssl-ignore.enable=true -#开启HTTPS(SSL)请求证书验证忽略 +#\u5F00\u542FHTTPS\uFF08SSL\uFF09\u8BF7\u6C42\u8BC1\u4E66\u9A8C\u8BC1\u5FFD\u7565 yexuejc.global.exception.enable=true -#开启校验过滤器,目前校验HTTP Header是否符合规范 +#\u5F00\u542F\u6821\u9A8C\u8FC7\u6EE4\u5668\uFF0C\u76EE\u524D\u6821\u9A8CHTTP Header\u662F\u5426\u7B26\u5408\u89C4\u8303 yexuejc.web.validation-filter.enable=true -# 拦截类型(请求路径):0忽略模式,默认拦截全部;1拦截模式,默认一个都不拦截 +# \u62E6\u622A\u7C7B\u578B\uFF08\u8BF7\u6C42\u8DEF\u5F84\uFF09\uFF1A0\u5FFD\u7565\u6A21\u5F0F\uFF0C\u9ED8\u8BA4\u62E6\u622A\u5168\u90E8\uFF1B1\u62E6\u622A\u6A21\u5F0F\uFF0C\u9ED8\u8BA4\u4E00\u4E2A\u90FD\u4E0D\u62E6\u622A #yexuejc.http.filter=0 yexuejc.http.filter.type=1 -#忽略路径:示例放开swagger +#\u5FFD\u7565\u8DEF\u5F84\uFF1A\u793A\u4F8B\u653E\u5F00swagger #yexuejc.http.filter.ignored=/,/swagger/**,/error,/v2/api-docs,/webjars/** #======================================================================================================================== #======================================================================================================================== @@ -29,22 +29,22 @@ yexuejc.http.filter.type=1 yexuejc.http.encrypt.encrypt=true yexuejc.http.encrypt.decrypt=true -#配置密钥方式 +#\u914D\u7F6E\u5BC6\u94A5\u65B9\u5F0F #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 -#配置证书方式 +#\u914D\u7F6E\u8BC1\u4E66\u65B9\u5F0F yexuejc.http.encrypt.private-key-path=/lgfishing.keystore yexuejc.http.encrypt.private-alias=lgfishing yexuejc.http.encrypt.private-pwd=lgfishing2018 -#编码 +#\u7F16\u7801 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 +#\u662F\u5426\u5F00\u542FHTTPS\uFF08SSL\uFF09\u8BF7\u6C42\u8BC1\u4E66\u9A8C\u8BC1\u5FFD\u7565\uFF1A\u9ED8\u8BA4false yexuejc.enable.ssl-ignore=true @@ -66,16 +66,16 @@ yexuejc.alibaba.oss.bucket=guansichou #======================================================================================================================== -# security相关 +# security\u76F8\u5173 #reids -#开启指定redis库db0默认开启 +#\u5F00\u542F\u6307\u5B9Aredis\u5E93db0\u9ED8\u8BA4\u5F00\u542F 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 @@ -93,19 +93,19 @@ spring.datasource.data=classpath:db/data.sql #======================================================================================================================== #mybatis-plus mybatis-plus.mapper-locations=classpath*:mapper/*.xml -#实体扫描,多个package用逗号或者分号分隔 +#\u5B9E\u4F53\u626B\u63CF\uFF0C\u591A\u4E2Apackage\u7528\u9017\u53F7\u6216\u8005\u5206\u53F7\u5206\u9694 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 的字符串表示); +#\u4E3B\u952E\u7C7B\u578B0:"\u6570\u636E\u5E93ID\u81EA\u589E", 1:"\u7528\u6237\u8F93\u5165ID",2:"\u8BE5\u7C7B\u578B\u4E3A\u672A\u8BBE\u7F6E\u4E3B\u952E\u7C7B\u578B", 3:"\u5168\u5C40\u552F\u4E00ID UUID",4:\u5168\u5C40\u552F\u4E00ID (UUID),5:\u5B57\u7B26\u4E32\u5168\u5C40\u552F\u4E00ID (idWorker \u7684\u5B57\u7B26\u4E32\u8868\u793A); mybatis-plus.global-config.db-config.id-type=uuid mybatis-plus.global-config.db-config.db-type=POSTGRE_SQL -#字段策略 0:"忽略判断",1:"非 NULL 判断"),2:"非空判断" +#\u5B57\u6BB5\u7B56\u7565 0:"\u5FFD\u7565\u5224\u65AD",1:"\u975E NULL \u5224\u65AD"),2:"\u975E\u7A7A\u5224\u65AD" mybatis-plus.global-config.db-config.field-strategy=not_empty -#驼峰下划线转换 +#\u9A7C\u5CF0\u4E0B\u5212\u7EBF\u8F6C\u6362 mybatis-plus.global-config.db-config.column-underline=true -#逻辑删除配置(下面3个配置) +#\u903B\u8F91\u5220\u9664\u914D\u7F6E\uFF08\u4E0B\u97623\u4E2A\u914D\u7F6E\uFF09 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) +#\u914D\u7F6E\u8FD4\u56DE\u6570\u636E\u5E93(column\u4E0B\u5212\u7EBF\u547D\u540D&&\u8FD4\u56DEjava\u5B9E\u4F53\u662F\u9A7C\u5CF0\u547D\u540D)\uFF0C\u81EA\u52A8\u5339\u914D\u65E0\u9700as\uFF08\u6CA1\u5F00\u542F\u8FD9\u4E2A\uFF0CSQL\u9700\u8981\u5199as\uFF1A select user_id as userId\uFF09 mybatis-plus.configuration.map-underscore-to-camel-case=true mybatis-plus.configuration.cache-enabled=false #======================================================================================================================== diff --git a/yexuejc-springboot-example/pom.xml b/yexuejc-springboot-example/pom.xml index d11457c..1c4c987 100644 --- a/yexuejc-springboot-example/pom.xml +++ b/yexuejc-springboot-example/pom.xml @@ -9,8 +9,27 @@ pom yexuejc-springboot-example + + com.yexuejc.springboot + yexuejc-springboot-parent + 2.1.3 + ../pom.xml + + + + UTF-8 + UTF-8 + 1.8 + ${java.version} + ${java.version} + true + + ${parent.version} + + yexuejc-springboot-simple springboot-security-login-simple + diff --git a/yexuejc-springboot-example/springboot-security-login-simple/pom.xml b/yexuejc-springboot-example/springboot-security-login-simple/pom.xml index 14a49ae..e08795a 100644 --- a/yexuejc-springboot-example/springboot-security-login-simple/pom.xml +++ b/yexuejc-springboot-example/springboot-security-login-simple/pom.xml @@ -13,14 +13,16 @@ https://gitee.com/incloudcode/yexuejc-springboot使用例子 + + ${parent.version} + + com.yexuejc.springboot yexuejc-springboot-parent - 2.1.1 + 2.1.3 - - 1.3.9 - + @@ -32,7 +34,6 @@ top.yexuejc yexuejc-base - ${yexuejc.base.version} @@ -47,7 +48,7 @@ io.jsonwebtoken - jjwt + jjwt-api true @@ -80,13 +81,6 @@ test - - - yexuejc-nexus-public - yexuejc-nexus-public - https://nexus.yexuejc.club/repository/maven-public/ - - diff --git a/yexuejc-springboot-example/springboot-security-login-simple/src/main/java/com/example/demo/security/domain/Consumer.java b/yexuejc-springboot-example/springboot-security-login-simple/src/main/java/com/example/demo/security/domain/Consumer.java index dd4b35e..ce29c1e 100644 --- a/yexuejc-springboot-example/springboot-security-login-simple/src/main/java/com/example/demo/security/domain/Consumer.java +++ b/yexuejc-springboot-example/springboot-security-login-simple/src/main/java/com/example/demo/security/domain/Consumer.java @@ -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 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 implements User { /** * 角色、权限 */ - @TableField(value = "roles", el = "roles,typeHandler=com.yexuejc.guansc.core.mybatis.handler.JsonTypeHandler") + @TableField(value = "roles", typeHandler = JsonTypeHandler.class) private List roles; /** * 支付密码 @@ -157,19 +158,16 @@ public class Consumer extends Model 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 implements User { } @Override - protected Serializable pkVal() { + public Serializable pkVal() { return this.consumerId; } } diff --git a/yexuejc-springboot-example/springboot-security-login-simple/src/main/resources/application.properties b/yexuejc-springboot-example/springboot-security-login-simple/src/main/resources/application.properties index c13c487..6f4e859 100644 --- a/yexuejc-springboot-example/springboot-security-login-simple/src/main/resources/application.properties +++ b/yexuejc-springboot-example/springboot-security-login-simple/src/main/resources/application.properties @@ -1,35 +1,36 @@ +server.port=8545 logging.level.root=info #======================================================================================================================== #======================================================================================================================== -#核心 -#开启功能 redis webmvc +#\u6838\u5FC3 +#\u5F00\u542F\u529F\u80FD redis webmvc yexuejc.autoconfigure.redis.enable=true -#webmvc 包含以下功能 +#webmvc \u5305\u542B\u4EE5\u4E0B\u529F\u80FD yexuejc.autoconfigure.webmvc.enable=true -#全局异常处理 +#\u5168\u5C40\u5F02\u5E38\u5904\u7406 yexuejc.ssl-ignore.enable=true -#开启HTTPS(SSL)请求证书验证忽略 +#\u5F00\u542FHTTPS\uFF08SSL\uFF09\u8BF7\u6C42\u8BC1\u4E66\u9A8C\u8BC1\u5FFD\u7565 yexuejc.global.exception.enable=true -#开启校验过滤器,目前校验HTTP Header是否符合规范 +#\u5F00\u542F\u6821\u9A8C\u8FC7\u6EE4\u5668\uFF0C\u76EE\u524D\u6821\u9A8CHTTP Header\u662F\u5426\u7B26\u5408\u89C4\u8303 yexuejc.web.validation-filter.enable=true -# 拦截类型(请求路径):0忽略模式,默认拦截全部;1拦截模式,默认一个都不拦截 +# \u62E6\u622A\u7C7B\u578B\uFF08\u8BF7\u6C42\u8DEF\u5F84\uFF09\uFF1A0\u5FFD\u7565\u6A21\u5F0F\uFF0C\u9ED8\u8BA4\u62E6\u622A\u5168\u90E8\uFF1B1\u62E6\u622A\u6A21\u5F0F\uFF0C\u9ED8\u8BA4\u4E00\u4E2A\u90FD\u4E0D\u62E6\u622A yexuejc.http.filter=0 -#忽略路径:示例放开swagger +#\u5FFD\u7565\u8DEF\u5F84\uFF1A\u793A\u4F8B\u653E\u5F00swagger yexuejc.http.filter.ignored=/,/swagger/**,/error,/v2/api-docs,/webjars/** #======================================================================================================================== #======================================================================================================================== #======================================================================================================================== -# security相关 +# security\u76F8\u5173 #reids -#开启指定redis库db0默认开启 +#\u5F00\u542F\u6307\u5B9Aredis\u5E93db0\u9ED8\u8BA4\u5F00\u542F 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 @@ -47,19 +48,19 @@ spring.datasource.data=classpath:db/data.sql #======================================================================================================================== #mybatis-plus mybatis-plus.mapper-locations=classpath*:mapper/*.xml -#实体扫描,多个package用逗号或者分号分隔 +#\u5B9E\u4F53\u626B\u63CF\uFF0C\u591A\u4E2Apackage\u7528\u9017\u53F7\u6216\u8005\u5206\u53F7\u5206\u9694 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 的字符串表示); +#\u4E3B\u952E\u7C7B\u578B0:"\u6570\u636E\u5E93ID\u81EA\u589E", 1:"\u7528\u6237\u8F93\u5165ID",2:"\u8BE5\u7C7B\u578B\u4E3A\u672A\u8BBE\u7F6E\u4E3B\u952E\u7C7B\u578B", 3:"\u5168\u5C40\u552F\u4E00ID UUID",4:\u5168\u5C40\u552F\u4E00ID (UUID),5:\u5B57\u7B26\u4E32\u5168\u5C40\u552F\u4E00ID (idWorker \u7684\u5B57\u7B26\u4E32\u8868\u793A); mybatis-plus.global-config.db-config.id-type=uuid mybatis-plus.global-config.db-config.db-type=POSTGRE_SQL -#字段策略 0:"忽略判断",1:"非 NULL 判断"),2:"非空判断" +#\u5B57\u6BB5\u7B56\u7565 0:"\u5FFD\u7565\u5224\u65AD",1:"\u975E NULL \u5224\u65AD"),2:"\u975E\u7A7A\u5224\u65AD" mybatis-plus.global-config.db-config.field-strategy=not_empty -#驼峰下划线转换 +#\u9A7C\u5CF0\u4E0B\u5212\u7EBF\u8F6C\u6362 mybatis-plus.global-config.db-config.column-underline=true -#逻辑删除配置(下面3个配置) +#\u903B\u8F91\u5220\u9664\u914D\u7F6E\uFF08\u4E0B\u97623\u4E2A\u914D\u7F6E\uFF09 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) +#\u914D\u7F6E\u8FD4\u56DE\u6570\u636E\u5E93(column\u4E0B\u5212\u7EBF\u547D\u540D&&\u8FD4\u56DEjava\u5B9E\u4F53\u662F\u9A7C\u5CF0\u547D\u540D)\uFF0C\u81EA\u52A8\u5339\u914D\u65E0\u9700as\uFF08\u6CA1\u5F00\u542F\u8FD9\u4E2A\uFF0CSQL\u9700\u8981\u5199as\uFF1A select user_id as userId\uFF09 mybatis-plus.configuration.map-underscore-to-camel-case=true mybatis-plus.configuration.cache-enabled=false #======================================================================================================================== diff --git a/yexuejc-springboot-example/springboot-security-login-simple/src/test/java/com/example/demo/DemoApplicationTests.java b/yexuejc-springboot-example/springboot-security-login-simple/src/test/java/com/example/demo/DemoApplicationTests.java index 480d1ca..392e910 100644 --- a/yexuejc-springboot-example/springboot-security-login-simple/src/test/java/com/example/demo/DemoApplicationTests.java +++ b/yexuejc-springboot-example/springboot-security-login-simple/src/test/java/com/example/demo/DemoApplicationTests.java @@ -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 { diff --git a/yexuejc-springboot-example/yexuejc-springboot-simple/pom.xml b/yexuejc-springboot-example/yexuejc-springboot-simple/pom.xml index 45f0be1..cd2e129 100644 --- a/yexuejc-springboot-example/yexuejc-springboot-simple/pom.xml +++ b/yexuejc-springboot-example/yexuejc-springboot-simple/pom.xml @@ -5,7 +5,7 @@ com.yexuejc.springboot yexuejc-springboot-parent - 2.1.1 + 2.1.3 top.yexuejc yexuejc-springboot-simple @@ -14,14 +14,13 @@ 测试工程 - 1.8 + ${parent.version} com.yexuejc.springboot yexuejc-springboot-base - ${parent.version} org.springframework.boot diff --git a/yexuejc-springboot-example/yexuejc-springboot-simple/src/test/java/top/yexuejc/springboot/simple/YexuejcSpringbootSimpleApplicationTests.java b/yexuejc-springboot-example/yexuejc-springboot-simple/src/test/java/top/yexuejc/springboot/simple/YexuejcSpringbootSimpleApplicationTests.java index 7fe783b..48a8ab3 100644 --- a/yexuejc-springboot-example/yexuejc-springboot-simple/src/test/java/top/yexuejc/springboot/simple/YexuejcSpringbootSimpleApplicationTests.java +++ b/yexuejc-springboot-example/yexuejc-springboot-simple/src/test/java/top/yexuejc/springboot/simple/YexuejcSpringbootSimpleApplicationTests.java @@ -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 {