-
Notifications
You must be signed in to change notification settings - Fork 0
[Feat] Storage Presigned URL API 정의 #205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
The head ref may contain hidden characters: "FLT-8-\uD504\uB85C\uD544-\uC774\uBBF8\uC9C0-\uB4F1\uB85D-\uAE30\uB2A5"
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
d024c78
feat: change profile image
kimjw2003 4eb676b
Merge remote-tracking branch 'origin/develop' into FLT-8-프로필-이미지-등록-기능
kimjw2003 ac5a9bd
feat: 온보딩 약관 화면 네비게이션 연결 및 UI 개선
kimjw2003 ee05ee5
feat: 온보딩 약관 화면 텍스트 스타일 수정
kimjw2003 9745aa0
feat: Storage Presigned URL API 정의
kimjw2003 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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.flint.data.api | ||
|
|
||
| import com.flint.data.dto.base.BaseResponse | ||
| import com.flint.data.dto.storage.response.PresignedUrlResponseDto | ||
| import retrofit2.http.GET | ||
| import retrofit2.http.Query | ||
|
|
||
| interface StorageApi { | ||
| // Presigned URL 발급 | ||
| @GET("/api/v1/storage/presigned-url") | ||
| suspend fun getPresignedUrl( | ||
| @Query("pathType") pathType: String, | ||
| @Query("extension") extension: String, | ||
| ): BaseResponse<PresignedUrlResponseDto> | ||
| } |
This file contains hidden or 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
12 changes: 12 additions & 0 deletions
12
app/src/main/java/com/flint/data/dto/storage/response/PresignedUrlResponseDto.kt
This file contains hidden or 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,12 @@ | ||
| package com.flint.data.dto.storage.response | ||
|
|
||
| import kotlinx.serialization.SerialName | ||
| import kotlinx.serialization.Serializable | ||
|
|
||
| @Serializable | ||
| data class PresignedUrlResponseDto( | ||
| @SerialName("uploadUrl") | ||
| val uploadUrl: String, | ||
| @SerialName("key") | ||
| val key: String, | ||
| ) |
10 changes: 10 additions & 0 deletions
10
app/src/main/java/com/flint/domain/mapper/storage/PresignedUrlMapper.kt
This file contains hidden or 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,10 @@ | ||
| package com.flint.domain.mapper.storage | ||
|
|
||
| import com.flint.data.dto.storage.response.PresignedUrlResponseDto | ||
| import com.flint.domain.model.storage.PresignedUrlModel | ||
|
|
||
| fun PresignedUrlResponseDto.toModel(): PresignedUrlModel = | ||
| PresignedUrlModel( | ||
| uploadUrl = uploadUrl, | ||
| key = key, | ||
| ) |
6 changes: 6 additions & 0 deletions
6
app/src/main/java/com/flint/domain/model/storage/PresignedUrlModel.kt
This file contains hidden or 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.flint.domain.model.storage | ||
|
|
||
| data class PresignedUrlModel( | ||
| val uploadUrl: String, | ||
| val key: String, | ||
| ) |
25 changes: 25 additions & 0 deletions
25
app/src/main/java/com/flint/domain/repository/StorageRepository.kt
This file contains hidden or 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,25 @@ | ||
| package com.flint.domain.repository | ||
|
|
||
| import com.flint.core.common.util.suspendRunCatching | ||
| import com.flint.data.api.StorageApi | ||
| import com.flint.domain.mapper.storage.toModel | ||
| import com.flint.domain.model.storage.PresignedUrlModel | ||
| import com.flint.domain.type.FileExtension | ||
| import com.flint.domain.type.StoragePathType | ||
| import javax.inject.Inject | ||
|
|
||
| class StorageRepository @Inject constructor( | ||
| private val api: StorageApi, | ||
| ) { | ||
| // Presigned URL 발급 | ||
| suspend fun getPresignedUrl( | ||
| pathType: StoragePathType, | ||
| extension: FileExtension, | ||
| ): Result<PresignedUrlModel> = | ||
| suspendRunCatching { | ||
| api.getPresignedUrl( | ||
| pathType = pathType.name, | ||
| extension = extension.name, | ||
| ).data.toModel() | ||
| } | ||
| } |
This file contains hidden or 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.flint.domain.type | ||
|
|
||
| enum class FileExtension { | ||
| JPG, | ||
| JPEG, | ||
| PNG, | ||
| GIF, | ||
| WEBP, | ||
| SVG, | ||
| PDF, | ||
| } |
This file contains hidden or 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,8 @@ | ||
| package com.flint.domain.type | ||
|
|
||
| enum class StoragePathType { | ||
| USER_PROFILE, | ||
| LOGO_IMAGE, | ||
| COLLECTION_THUMBNAIL, | ||
| COLLECTION_CONTENT, | ||
| } |
This file contains hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
메뉴 액션 이후 바텀시트를 명시적으로 닫아주세요.
Line 229, Line 238의
clickAction에서showProfileBottomSheet = false처리가 없어 바텀시트가 남을 수 있습니다. 액션 직후 닫기를 명시하는 편이 안전합니다.수정 예시
MenuBottomSheetData( label = "갤러리에서 선택", clickAction = { + showProfileBottomSheet = false galleryLauncher.launch( PickVisualMediaRequest(ActivityResultContracts.PickVisualMedia.ImageOnly) ) } ), MenuBottomSheetData( label = "프로필 사진 삭제", color = FlintTheme.colors.error500, - clickAction = { selectedImageUri = null } + clickAction = { + selectedImageUri = null + showProfileBottomSheet = false + } ),Also applies to: 236-239
🤖 Prompt for AI Agents