mirror of
https://github.com/MewoLab/AquaDX.git
synced 2026-02-11 05:57:26 +08:00
[O] Make data dir if not exist
This commit is contained in:
@@ -1,9 +1,11 @@
|
|||||||
package icu.samnyan.aqua
|
package icu.samnyan.aqua
|
||||||
|
|
||||||
|
import icu.samnyan.aqua.net.utils.EmailService
|
||||||
import icu.samnyan.aqua.sega.aimedb.AimeDbServer
|
import icu.samnyan.aqua.sega.aimedb.AimeDbServer
|
||||||
import icu.samnyan.aqua.spring.util.AutoChecker
|
import icu.samnyan.aqua.spring.util.AutoChecker
|
||||||
import org.springframework.boot.SpringApplication
|
import org.springframework.boot.SpringApplication
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication
|
import org.springframework.boot.autoconfigure.SpringBootApplication
|
||||||
|
import java.io.File
|
||||||
|
|
||||||
@SpringBootApplication
|
@SpringBootApplication
|
||||||
class AquaServerApplication
|
class AquaServerApplication
|
||||||
@@ -12,11 +14,21 @@ class AquaServerApplication
|
|||||||
* Main method, entry point of the application
|
* Main method, entry point of the application
|
||||||
*/
|
*/
|
||||||
fun main(args: Array<String>) {
|
fun main(args: Array<String>) {
|
||||||
|
// If data/ is not found, create it
|
||||||
|
File("data").mkdirs()
|
||||||
|
|
||||||
|
// Run the application
|
||||||
val ctx = SpringApplication.run(AquaServerApplication::class.java, *args)
|
val ctx = SpringApplication.run(AquaServerApplication::class.java, *args)
|
||||||
|
|
||||||
|
// Start the AimeDbServer
|
||||||
val aimeDbServer = ctx.getBean(AimeDbServer::class.java)
|
val aimeDbServer = ctx.getBean(AimeDbServer::class.java)
|
||||||
aimeDbServer.start()
|
aimeDbServer.start()
|
||||||
|
|
||||||
|
// Start the AutoChecker
|
||||||
val checker = ctx.getBean(AutoChecker::class.java)
|
val checker = ctx.getBean(AutoChecker::class.java)
|
||||||
checker.check()
|
checker.check()
|
||||||
|
|
||||||
|
// Test the email service
|
||||||
|
val emailService = ctx.getBean(EmailService::class.java)
|
||||||
|
emailService.testConnection()
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user