Skip to content

Commit

Permalink
[DVK-118] fix: 전자책 사진 저장 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
LeeSM0518 committed Nov 25, 2024
1 parent a9acef1 commit af6815b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class BackendApplication(
}

companion object {
const val STATIC_ROOT_PATH = "/static"
const val STATIC_ROOT_PATH = "static"
const val PROFILE_IMAGE_ROOT_PATH = "$STATIC_ROOT_PATH/profile-image"
const val MAIN_IMAGE_ROOT_PATH = "$STATIC_ROOT_PATH/main-image"
const val PDF_ROOT_PATH = "$STATIC_ROOT_PATH/pdf"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ suspend inline fun saveImage(image: Image, rootPath: String): String =
rootPath = rootPath,
content = image.convertDecodedImage()
).await()
?.path
?.absolutePath
?: throw CommonError.FAIL_SAVE_FILE.exception

fun saveFileOrNull(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import com.devooks.backend.pdf.v1.domain.PdfInfo
import java.time.Instant
import java.util.*
import kotlin.io.path.Path
import kotlin.io.path.pathString
import kotlin.io.path.absolutePathString
import org.springframework.data.annotation.Id
import org.springframework.data.domain.Persistable
import org.springframework.data.relational.core.mapping.Column
Expand Down Expand Up @@ -40,9 +40,9 @@ data class PdfEntity(
companion object {
fun PdfInfo.toEntity(uploadMemberId: UUID): PdfEntity =
PdfEntity(
filePath = this.filePath.pathString,
filePath = this.filePath.absolutePathString(),
pageCount = this.pageCount,
uploadMemberId = uploadMemberId
)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import com.devooks.backend.pdf.v1.domain.PreviewImage
import com.devooks.backend.pdf.v1.domain.PreviewImageInfo
import java.util.*
import kotlin.io.path.Path
import kotlin.io.path.pathString
import kotlin.io.path.absolutePathString
import org.springframework.data.annotation.Id
import org.springframework.data.domain.Persistable
import org.springframework.data.relational.core.mapping.Column
Expand Down Expand Up @@ -35,9 +35,9 @@ data class PreviewImageEntity(

companion object {
fun PreviewImageInfo.toEntity(pdfId: UUID) = PreviewImageEntity(
imagePath = this.imagePath.pathString,
imagePath = this.imagePath.absolutePathString(),
previewOrder = this.order,
pdfId = pdfId
)
}
}
}

0 comments on commit af6815b

Please sign in to comment.