mirror of
https://github.com/usbharu/Hideout.git
synced 2026-09-26 06:51:09 +00:00
fix: メディア付き投稿に失敗する問題を修正
This commit is contained in:
+9
-1
@@ -7,6 +7,7 @@ import org.slf4j.LoggerFactory
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
|
||||
import org.springframework.stereotype.Component
|
||||
import java.net.URI
|
||||
import java.nio.file.Files
|
||||
import java.nio.file.Path
|
||||
import kotlin.io.path.copyTo
|
||||
|
||||
@@ -19,9 +20,16 @@ class LocalFileSystemMediaStore(
|
||||
MediaStore {
|
||||
|
||||
private val publicUrl = localStorageConfig.publicUrl ?: "${applicationConfig.url}/files/"
|
||||
|
||||
private val savePath = Path.of(localStorageConfig.path)
|
||||
|
||||
init {
|
||||
Files.createDirectories(savePath)
|
||||
}
|
||||
|
||||
override suspend fun upload(path: Path, id: String): URI {
|
||||
logger.info("START Media upload. {}", id)
|
||||
val fileSavePath = buildSavePath(path, id)
|
||||
val fileSavePath = buildSavePath(savePath, id)
|
||||
|
||||
val fileSavePathString = fileSavePath.toAbsolutePath().toString()
|
||||
logger.info("MEDIA save. path: {}", fileSavePathString)
|
||||
|
||||
Reference in New Issue
Block a user