-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
15 changed files
with
236 additions
and
101 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 0 additions & 21 deletions
21
...src/main/kotlin/team/comit/simtong/domain/file/exception/FileInvalidExtensionException.kt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
...ong-presentation/src/main/kotlin/team/comit/simtong/domain/file/error/WebFileErrorCode.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package team.comit.simtong.domain.file.error | ||
|
||
import team.comit.simtong.global.error.WebErrorProperty | ||
|
||
/** | ||
* | ||
* 표현 계층의 File Error를 관리하는 WebFileErrorCode | ||
* | ||
* @author Chokyunghyeon | ||
* @date 2022/12/09 | ||
* @version 1.0.0 | ||
**/ | ||
enum class WebFileErrorCode( | ||
private val status: Int, | ||
private val message: String | ||
) : WebErrorProperty { | ||
|
||
INVALID_EXTENSION(400, "제한된 확장자"); | ||
|
||
override fun status(): Int = status | ||
|
||
override fun message(): String = message | ||
|
||
} |
21 changes: 21 additions & 0 deletions
21
...src/main/kotlin/team/comit/simtong/domain/file/exception/FileInvalidExtensionException.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package team.comit.simtong.domain.file.exception | ||
|
||
import team.comit.simtong.domain.file.error.WebFileErrorCode | ||
import team.comit.simtong.global.error.WebException | ||
|
||
/** | ||
* | ||
* 파일 확장자 제한 에러를 발생시키는 FileInvalidExtensionException | ||
* | ||
* @author Chokyunghyeon | ||
* @date 2022/12/09 | ||
* @version 1.0.0 | ||
**/ | ||
class FileInvalidExtensionException private constructor() : WebException(WebFileErrorCode.INVALID_EXTENSION) { | ||
|
||
companion object { | ||
@JvmField | ||
val EXCEPTION = FileInvalidExtensionException() | ||
} | ||
|
||
} |
24 changes: 24 additions & 0 deletions
24
...resentation/src/main/kotlin/team/comit/simtong/domain/file/transfer/ExcelFileConvertor.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package team.comit.simtong.domain.file.transfer | ||
|
||
import org.springframework.web.multipart.MultipartFile | ||
import team.comit.simtong.domain.file.FileExtensionUtils.XLS | ||
import team.comit.simtong.domain.file.FileExtensionUtils.XLSX | ||
|
||
/** | ||
* | ||
* Excel File의 변환을 담당하는 ExcelFileConvertor | ||
* | ||
* @author Chokyunghyeon | ||
* @date 2022/12/09 | ||
* @version 1.0.0 | ||
**/ | ||
object ExcelFileConvertor : FileConvertor { | ||
|
||
override fun isCorrectExtension(multipartFile: MultipartFile): Boolean { | ||
return when (multipartFile.extension) { | ||
XLS, XLSX -> true | ||
else -> false | ||
} | ||
} | ||
|
||
} |
Oops, something went wrong.