generated from semicolondsm/Semicolon_Repository_Generator
-
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.
π :: (#558) μ¬μ§ μ
λ‘λ λ‘μ§ λ³κ²½
- Loading branch information
Showing
18 changed files
with
275 additions
and
64 deletions.
There are no files selected for viewing
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
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
35 changes: 35 additions & 0 deletions
35
Services/AttachmentService/Sources/Data/Remote/API/PresignedUrlAPI.swift
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,35 @@ | ||
import Moya | ||
import Foundation | ||
|
||
enum PresignedUrlAPI { | ||
case uploadImageToS3(presignedURL: String, contentType: String, data: Data) | ||
} | ||
|
||
extension PresignedUrlAPI: TargetType { | ||
|
||
var baseURL: URL { | ||
switch self { | ||
case .uploadImageToS3(let presignedURL, _, _): | ||
return URL(string: presignedURL)! | ||
} | ||
} | ||
|
||
var path: String { | ||
return "" | ||
} | ||
|
||
var method: Moya.Method { | ||
return .put | ||
} | ||
|
||
var task: Moya.Task { | ||
switch self { | ||
case .uploadImageToS3(_, _, let data): | ||
return .requestData(data) | ||
} | ||
} | ||
|
||
var headers: [String: String]? { | ||
return ["Content-Type": "image/jpg"] | ||
} | ||
} |
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
Oops, something went wrong.