Skip to content

Commit f7da51c

Browse files
committed
DSW012-JWT-token-JSON配置文件读取
1 parent 86225e9 commit f7da51c

File tree

2 files changed

+97
-0
lines changed

2 files changed

+97
-0
lines changed

handsonDoc/DSW011-JWT-token.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,55 @@ public class JWTUtil {
274274
}
275275
```
276276

277+
## build.gradle文件
278+
```gradle
279+
plugins {
280+
id 'java'
281+
id 'org.springframework.boot' version '3.3.2'
282+
id 'io.spring.dependency-management' version '1.1.6'
283+
}
284+
285+
group = 'com.jinwei'
286+
version = '0.0.1-SNAPSHOT'
287+
288+
java {
289+
toolchain {
290+
languageVersion = JavaLanguageVersion.of(17)
291+
}
292+
}
293+
294+
repositories {
295+
mavenCentral()
296+
}
297+
298+
dependencies {
299+
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
300+
implementation 'org.springframework.boot:spring-boot-starter-data-mongodb'
301+
implementation 'org.springframework.boot:spring-boot-starter-web'
302+
testImplementation 'org.springframework.boot:spring-boot-starter-test'
303+
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
304+
305+
compileOnly 'org.projectlombok:lombok:1.18.34'
306+
annotationProcessor 'org.projectlombok:lombok:1.18.34'
307+
testCompileOnly 'org.projectlombok:lombok:1.18.34'
308+
testAnnotationProcessor 'org.projectlombok:lombok:1.18.34'
309+
310+
implementation group: 'io.jsonwebtoken', name: 'jjwt', version: '0.12.6'
311+
implementation group: 'io.jsonwebtoken', name: 'jjwt-api', version: '0.12.6'
312+
runtimeOnly group: 'io.jsonwebtoken', name: 'jjwt-impl', version: '0.12.6'
313+
runtimeOnly group: 'io.jsonwebtoken', name: 'jjwt-jackson', version: '0.12.6'
314+
315+
implementation group: 'com.google.code.gson', name: 'gson', version: '2.11.0'
316+
317+
implementation group: 'com.alibaba.fastjson2', name: 'fastjson2', version: '2.0.52'
318+
}
319+
320+
tasks.named('test') {
321+
useJUnitPlatform()
322+
}
323+
```
324+
325+
277326
## 测试主文件
278327

279328
```java

handsonDoc/DSW012-JWT-token-JSON配置文件读取.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,54 @@ public class S8MongotemplateApplication {
276276
}
277277
```
278278

279+
## build.gradle文件
280+
```gradle
281+
plugins {
282+
id 'java'
283+
id 'org.springframework.boot' version '3.3.2'
284+
id 'io.spring.dependency-management' version '1.1.6'
285+
}
286+
287+
group = 'com.jinwei'
288+
version = '0.0.1-SNAPSHOT'
289+
290+
java {
291+
toolchain {
292+
languageVersion = JavaLanguageVersion.of(17)
293+
}
294+
}
295+
296+
repositories {
297+
mavenCentral()
298+
}
299+
300+
dependencies {
301+
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
302+
implementation 'org.springframework.boot:spring-boot-starter-data-mongodb'
303+
implementation 'org.springframework.boot:spring-boot-starter-web'
304+
testImplementation 'org.springframework.boot:spring-boot-starter-test'
305+
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
306+
307+
compileOnly 'org.projectlombok:lombok:1.18.34'
308+
annotationProcessor 'org.projectlombok:lombok:1.18.34'
309+
testCompileOnly 'org.projectlombok:lombok:1.18.34'
310+
testAnnotationProcessor 'org.projectlombok:lombok:1.18.34'
311+
312+
implementation group: 'io.jsonwebtoken', name: 'jjwt', version: '0.12.6'
313+
implementation group: 'io.jsonwebtoken', name: 'jjwt-api', version: '0.12.6'
314+
runtimeOnly group: 'io.jsonwebtoken', name: 'jjwt-impl', version: '0.12.6'
315+
runtimeOnly group: 'io.jsonwebtoken', name: 'jjwt-jackson', version: '0.12.6'
316+
317+
implementation group: 'com.google.code.gson', name: 'gson', version: '2.11.0'
318+
319+
implementation group: 'com.alibaba.fastjson2', name: 'fastjson2', version: '2.0.52'
320+
}
321+
322+
tasks.named('test') {
323+
useJUnitPlatform()
324+
}
325+
```
326+
279327
## 测试
280328

281329
```bash

0 commit comments

Comments
 (0)