-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #171 from mash-up-kr/feature/add-place-images
- Loading branch information
Showing
10 changed files
with
71 additions
and
38 deletions.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
piikii-application/src/main/kotlin/com/piikii/application/domain/image/ImageFolderType.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,6 @@ | ||
package com.piikii.application.domain.image | ||
|
||
enum class ImageFolderType { | ||
ROOM, | ||
PLACE, | ||
} |
23 changes: 23 additions & 0 deletions
23
piikii-application/src/main/kotlin/com/piikii/application/domain/image/ImageUploadService.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,23 @@ | ||
package com.piikii.application.domain.image | ||
|
||
import com.piikii.application.port.input.ImageUploadUseCase | ||
import com.piikii.application.port.output.objectstorage.ObjectStoragePort | ||
import org.springframework.stereotype.Service | ||
import org.springframework.web.multipart.MultipartFile | ||
|
||
@Service | ||
class ImageUploadService( | ||
private val objectStoragePort: ObjectStoragePort, | ||
) : ImageUploadUseCase { | ||
override fun upload( | ||
images: List<MultipartFile>?, | ||
imageFolderType: ImageFolderType, | ||
): List<String> { | ||
return images?.let { | ||
objectStoragePort.uploadAll( | ||
imageFolderType = imageFolderType, | ||
multipartFiles = it, | ||
).get() | ||
} ?: emptyList() | ||
} | ||
} |
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
11 changes: 11 additions & 0 deletions
11
piikii-application/src/main/kotlin/com/piikii/application/port/input/ImageUploadUseCase.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,11 @@ | ||
package com.piikii.application.port.input | ||
|
||
import com.piikii.application.domain.image.ImageFolderType | ||
import org.springframework.web.multipart.MultipartFile | ||
|
||
interface ImageUploadUseCase { | ||
fun upload( | ||
images: List<MultipartFile>?, | ||
imageFolderType: ImageFolderType, | ||
): List<String> | ||
} |
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
6 changes: 0 additions & 6 deletions
6
...tion/src/main/kotlin/com/piikii/application/port/output/objectstorage/BucketFolderType.kt
This file was deleted.
Oops, something went wrong.
7 changes: 4 additions & 3 deletions
7
...ion/src/main/kotlin/com/piikii/application/port/output/objectstorage/ObjectStoragePort.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 |
---|---|---|
@@ -1,22 +1,23 @@ | ||
package com.piikii.application.port.output.objectstorage | ||
|
||
import com.piikii.application.domain.image.ImageFolderType | ||
import org.springframework.web.multipart.MultipartFile | ||
import java.util.concurrent.Future | ||
|
||
interface ObjectStoragePort { | ||
fun uploadAll( | ||
bucketFolderType: BucketFolderType, | ||
imageFolderType: ImageFolderType, | ||
multipartFiles: List<MultipartFile>, | ||
): Future<List<String>> | ||
|
||
fun updateAllByUrls( | ||
bucketFolderType: BucketFolderType, | ||
imageFolderType: ImageFolderType, | ||
deleteTargetUrls: List<String>, | ||
newMultipartFiles: List<MultipartFile>, | ||
): Future<List<String>> | ||
|
||
fun deleteAllByUrls( | ||
bucketFolderType: BucketFolderType, | ||
imageFolderType: ImageFolderType, | ||
deleteTargetUrls: List<String>, | ||
) | ||
} |
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