SpringBoot配置内容提交

This commit is contained in:
筱锋xiao_lfeng 2023-11-29 22:12:07 +08:00
parent 31a4ef5470
commit 8ff8fbd317
4 changed files with 40 additions and 2 deletions

View File

@ -22,6 +22,10 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-aop</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.module</groupId>
<artifactId>jackson-module-kotlin</artifactId>
@ -51,6 +55,11 @@
<version>3.0.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.33</version>
</dependency>
</dependencies>
<build>

View File

@ -2,8 +2,12 @@ package com.xlf.dromstarkotlin
import org.springframework.boot.autoconfigure.SpringBootApplication
import org.springframework.boot.runApplication
import org.springframework.context.annotation.EnableAspectJAutoProxy
import org.springframework.scheduling.annotation.EnableScheduling
@SpringBootApplication
@EnableAspectJAutoProxy
@EnableScheduling
class DromStarKotlinApplication
fun main(args: Array<String>) {

View File

@ -1 +1,6 @@
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://192.168.5.190:3306
username: dormstar
password: 114477225588

View File

@ -2,12 +2,32 @@ package com.xlf.dromstarkotlin
import org.junit.jupiter.api.Test
import org.springframework.boot.test.context.SpringBootTest
import java.util.*
@SpringBootTest
class DromStarKotlinApplicationTests {
@Test
fun contextLoads() {
var token = (Date().time/1000).toString()
val random = Random()
// 判定随机范围
var i: Int
var j = 0
while (j++ < 3) {
val x: Int = if(j == 1 || j == 2) 6 else 10
token += "-"
i = 0
while (i < x) {
if (random.nextBoolean()) {
token += random.nextInt(10)
} else {
token += random.nextInt(97, 123).toChar()
}
i++
}
}
println(token)
assert(true)
}
}