-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5cca8aa
commit c25e2f5
Showing
18 changed files
with
369 additions
and
9 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
application/src/main/kotlin/com/threedays/application/auth/config/UserProperties.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,13 @@ | ||
package com.threedays.application.auth.config | ||
|
||
import org.springframework.boot.context.properties.ConfigurationProperties | ||
|
||
@ConfigurationProperties(prefix = "user") | ||
data class UserProperties( | ||
val profileImage: ProfileImageProperties | ||
) { | ||
data class ProfileImageProperties( | ||
val maxContentLength: Long, | ||
val uploadExpiresIn: Long | ||
) | ||
} |
16 changes: 16 additions & 0 deletions
16
...main/kotlin/com/threedays/application/user/port/inbound/CompleteUserProfileImageUpload.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,16 @@ | ||
package com.threedays.application.user.port.inbound | ||
|
||
import com.threedays.domain.user.entity.User | ||
import com.threedays.domain.user.entity.UserProfileImage | ||
|
||
interface CompleteUserProfileImageUpload { | ||
|
||
fun invoke(command: Command) | ||
|
||
data class Command( | ||
val userId: User.Id, | ||
val imageId: UserProfileImage.Id, | ||
val extension: UserProfileImage.Extension, | ||
) | ||
|
||
} |
20 changes: 20 additions & 0 deletions
20
...c/main/kotlin/com/threedays/application/user/port/inbound/GetUserProfileImageUploadUrl.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,20 @@ | ||
package com.threedays.application.user.port.inbound | ||
|
||
import com.threedays.domain.user.entity.UserProfileImage | ||
import java.net.URL | ||
import java.util.UUID | ||
|
||
interface GetUserProfileImageUploadUrl { | ||
|
||
fun invoke(command: Command): Result | ||
|
||
data class Command(val extension: UserProfileImage.Extension) | ||
|
||
data class Result( | ||
val imageId: UUID, | ||
val extension: UserProfileImage.Extension, | ||
val url: URL, | ||
val uploadExpiresIn: Long | ||
) | ||
|
||
} |
21 changes: 21 additions & 0 deletions
21
...tion/src/main/kotlin/com/threedays/application/user/port/outbound/UserProfileImagePort.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 com.threedays.application.user.port.outbound | ||
|
||
import com.threedays.domain.user.entity.UserProfileImage | ||
import java.net.URL | ||
import java.util.UUID | ||
|
||
interface UserProfileImagePort { | ||
|
||
fun getUploadUrl( | ||
id: UUID, | ||
extension: UserProfileImage.Extension, | ||
expiresIn: Long, // seconds | ||
maxContentLength: Long, // bytes | ||
): URL | ||
|
||
fun findImageUrlByIdAndExtension( | ||
id: UserProfileImage.Id, | ||
extension: UserProfileImage.Extension, | ||
): URL | ||
|
||
} |
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
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
15 changes: 15 additions & 0 deletions
15
infrastructure/aws/src/main/kotlin/com/threedays/aws/s3/config/S3Config.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,15 @@ | ||
package com.threedays.aws.s3.config | ||
|
||
import org.springframework.context.annotation.Bean | ||
import org.springframework.context.annotation.Configuration | ||
import software.amazon.awssdk.services.s3.presigner.S3Presigner | ||
|
||
@Configuration | ||
class S3Config { | ||
|
||
@Bean | ||
fun s3Presigner(): S3Presigner { | ||
return S3Presigner.create() | ||
} | ||
|
||
} |
15 changes: 15 additions & 0 deletions
15
infrastructure/aws/src/main/kotlin/com/threedays/aws/s3/config/S3Properties.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,15 @@ | ||
package com.threedays.aws.s3.config | ||
|
||
import org.springframework.boot.context.properties.ConfigurationProperties | ||
|
||
@ConfigurationProperties(prefix = "aws.s3") | ||
class S3Properties( | ||
val userProfileImage: UserProfileImage, | ||
) { | ||
|
||
data class UserProfileImage( | ||
val bucketName: String, | ||
val keyPrefix: String, | ||
) | ||
|
||
} |
Oops, something went wrong.