[+] Optimize upload photo

This commit is contained in:
Azalea
2024-03-05 17:56:16 -05:00
parent b9c063c41e
commit c9ac38de01
8 changed files with 165 additions and 172 deletions

View File

@@ -0,0 +1,21 @@
package icu.samnyan.aqua.net.utils
import ext.path
import jakarta.annotation.PostConstruct
import org.springframework.boot.context.properties.ConfigurationProperties
import org.springframework.context.annotation.Configuration
@Configuration
@ConfigurationProperties(prefix = "paths")
class PathProps {
var mai2Plays: String = "data/upload/mai2/plays"
var mai2Portrait: String = "data/upload/mai2/portrait"
var aquaNetPortrait: String = "data/upload/net/portrait"
@PostConstruct
fun init() {
mai2Plays = mai2Plays.path().apply { toFile().mkdirs() }.toString()
mai2Portrait = mai2Portrait.path().apply { toFile().mkdirs() }.toString()
aquaNetPortrait = aquaNetPortrait.path().apply { toFile().mkdirs() }.toString()
}
}