-
Notifications
You must be signed in to change notification settings - Fork 1
[Feat] 제보 완료화면 ViewModel 추가 #74
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
Open
taipaise
wants to merge
9
commits into
develop
Choose a base branch
from
feat/report-registration-completion
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
abe4b88
feat: 제보완료 VC 뷰 모델 추가
taipaise 885a272
Feat: 제보하기 로직 구현, 제보 히스토리 로직 구현 (#T3-204)
taipaise 549716a
feat: 제보완료 VC 뷰 모델 추가
taipaise 7a4721e
Fix: UI 일부 레이아웃 수정 및 서버 Enum 값 수정
choijungp a25dd6f
Fix: ReportCompleteViewController 충돌 해결
choijungp 79e42b6
Fix: PhotoURL 딕셔너리 제거
choijungp 2592b29
Fix: Report UI Date 형식 수정
choijungp 86493ac
Feat: 추천 루틴 탭 플로팅 버튼에 '제보하기' 진입점 추가
choijungp d3f482e
Feat: ReportRegistrationViewController 키보드 내려가기 및 이미지 선택 일부 수정
choijungp 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
11 changes: 11 additions & 0 deletions
11
Projects/DataSource/Sources/Common/Enum/EndpointBodyType.swift
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 @@ | ||
| // | ||
| // EndpointBodyType.swift | ||
| // DataSource | ||
| // | ||
| // Created by 이동현 on 11/22/25. | ||
| // | ||
|
|
||
| public enum EndpointBodyType { | ||
| case json | ||
| case rawData | ||
| } |
11 changes: 11 additions & 0 deletions
11
Projects/DataSource/Sources/DTO/FilePresignedConditionDTO.swift
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 @@ | ||
| // | ||
| // FilePresignedConditionDTO.swift | ||
| // DataSource | ||
| // | ||
| // Created by 이동현 on 11/22/25. | ||
| // | ||
|
|
||
| struct FilePresignedConditionDTO: Codable { | ||
| let prefix: String? | ||
| let fileName: String | ||
| } |
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,18 @@ | ||
| // | ||
| // FilePresignedDTO.swift | ||
| // DataSource | ||
| // | ||
| // Created by 이동현 on 11/22/25. | ||
| // | ||
|
|
||
| struct FilePresignedDTO: Decodable { | ||
| let file1: String? | ||
| let file2: String? | ||
| let file3: String? | ||
|
|
||
| enum CodingKeys: String, CodingKey { | ||
| case file1 = "additionalProp1" | ||
| case file2 = "additionalProp2" | ||
| case file3 = "additionalProp3" | ||
| } | ||
| } |
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
68 changes: 68 additions & 0 deletions
68
Projects/DataSource/Sources/Endpoint/FilePresignedEndpoint.swift
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,68 @@ | ||
| // | ||
| // FilePresignedEndpoint.swift | ||
| // DataSource | ||
| // | ||
| // Created by 이동현 on 11/22/25. | ||
| // | ||
|
|
||
| import Foundation | ||
|
|
||
| enum FilePresignedEndpoint { | ||
| case fetchPresignedURL(presignedConditions: [FilePresignedConditionDTO]) | ||
| } | ||
|
|
||
| extension FilePresignedEndpoint: Endpoint { | ||
| var baseURL: String { | ||
| switch self { | ||
| case .fetchPresignedURL: | ||
| return AppProperties.baseURL + "/api/v2/files" | ||
| } | ||
| } | ||
|
|
||
| var path: String { | ||
| switch self { | ||
| case .fetchPresignedURL: | ||
| return baseURL + "/presigned-urls" | ||
| } | ||
| } | ||
|
|
||
| var method: HTTPMethod { | ||
| switch self { | ||
| case .fetchPresignedURL: .post | ||
| } | ||
| } | ||
|
|
||
| var headers: [String : String] { | ||
| let headers: [String: String] = [ | ||
| "Content-Type": "application/json", | ||
| "accept": "*/*" | ||
| ] | ||
| return headers | ||
| } | ||
|
|
||
| var queryParameters: [String : String] { | ||
| return [:] | ||
| } | ||
|
|
||
| var bodyParameters: [String : Any] { | ||
| switch self { | ||
| case .fetchPresignedURL(let presignedConditions): | ||
| return [:] | ||
| } | ||
| } | ||
|
|
||
| var isAuthorized: Bool { | ||
| return true | ||
| } | ||
|
|
||
| var bodyType: EndpointBodyType { | ||
| return .rawData | ||
| } | ||
|
|
||
| var bodyData: Data? { | ||
| switch self { | ||
| case .fetchPresignedURL(let presignedConditions): | ||
| return try? JSONEncoder().encode(presignedConditions) | ||
| } | ||
| } | ||
| } | ||
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
63 changes: 63 additions & 0 deletions
63
Projects/DataSource/Sources/Endpoint/S3UploadEndpoint.swift
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,63 @@ | ||
| // | ||
| // S3UploadEndpoint.swift | ||
| // DataSource | ||
| // | ||
| // Created by 이동현 on 11/22/25. | ||
| // | ||
|
|
||
| import Foundation | ||
|
|
||
| enum S3Endpoint { | ||
| case uploadImage(uploadURL: String, data: Data) | ||
| } | ||
|
|
||
| extension S3Endpoint: Endpoint { | ||
| var baseURL: String { | ||
| return "" | ||
| } | ||
|
|
||
| var path: String { | ||
| switch self { | ||
| case .uploadImage(let uploadURL, _): | ||
| return uploadURL | ||
| } | ||
| } | ||
|
|
||
| var method: HTTPMethod { | ||
| switch self { | ||
| case .uploadImage: | ||
| return .put | ||
| } | ||
| } | ||
|
|
||
| var headers: [String : String] { | ||
| switch self { | ||
| case .uploadImage: | ||
| return [:] | ||
| } | ||
| } | ||
|
|
||
| var queryParameters: [String : String] { | ||
|
|
||
| return [:] | ||
| } | ||
|
|
||
| var bodyParameters: [String : Any] { | ||
| return [:] | ||
| } | ||
|
|
||
| var isAuthorized: Bool { | ||
| return false | ||
| } | ||
|
|
||
| var bodyType: EndpointBodyType { | ||
| return .rawData | ||
| } | ||
|
|
||
| var bodyData: Data? { | ||
| switch self { | ||
| case .uploadImage(_, let data): | ||
| return data | ||
| } | ||
| } | ||
| } |
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
25 changes: 25 additions & 0 deletions
25
Projects/DataSource/Sources/Repository/FileRepository.swift
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 @@ | ||
| // | ||
| // FileRepository.swift | ||
| // DataSource | ||
| // | ||
| // Created by 이동현 on 11/22/25. | ||
| // | ||
|
|
||
| import Domain | ||
| import Foundation | ||
|
|
||
| final class FileRepository: FileRepositoryProtocol { | ||
| private let networkService = NetworkService.shared | ||
|
|
||
| func fetchPresignedURL(prefix: String?, fileNames: [String]) async throws -> [String : String]? { | ||
| let dtos = fileNames.map { FilePresignedConditionDTO(prefix: prefix, fileName: $0) } | ||
| let endpoint = FilePresignedEndpoint.fetchPresignedURL(presignedConditions: dtos) | ||
|
|
||
| return try await networkService.request(endpoint: endpoint, type: [String:String].self) | ||
| } | ||
|
|
||
| func uploadFile(url: String, data: Data) async throws { | ||
| let endPoint = S3Endpoint.uploadImage(uploadURL: url, data: data) | ||
| _ = try await networkService.request(endpoint: endPoint, type: EmptyResponseDTO.self) | ||
| } | ||
| } |
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.
method프로퍼티에서return누락으로 컴파일 에러가 발생합니다switch내부에서.post를 리턴하지 않아 현재 코드는 빌드되지 않습니다. 아래처럼return을 명시해야 합니다.var method: HTTPMethod { switch self { - case .fetchPresignedURL: .post + case .fetchPresignedURL: + return .post } }추가로, 이 케이스가 하나뿐이라면
switch대신 단순히return .post로 구현해도 충분합니다.🤖 Prompt for AI Agents