-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTodoCertificationsRouter.swift
57 lines (50 loc) · 1.31 KB
/
TodoCertificationsRouter.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
//
// TodoCertificationsRouter.swift
// dogether
//
// Created by seungyooooong on 2/6/25.
//
import Foundation
enum TodoCertificationsRouter: NetworkEndpoint {
case reviewTodo(todoId: String, reviewTodoRequest: ReviewTodoRequest)
case getReviews
var path: String {
switch self {
case .reviewTodo(let todoId, _):
return Path.api + Path.todoCertifications + "/\(todoId)/review"
case .getReviews:
return Path.api + Path.todoCertifications + "/pending-review"
}
}
var method: NetworkMethod {
switch self {
case .getReviews:
return .get
case .reviewTodo:
return .post
}
}
var parameters: [URLQueryItem]? {
switch self {
default:
return nil
}
}
var header: [String : String]? {
switch self {
default:
return [
Header.Key.contentType: Header.Value.applicationJson,
Header.Key.authorization: Header.Value.bearer + Header.Value.accessToken
]
}
}
var body: (any Encodable)? {
switch self {
case .reviewTodo(_, let reviewTodoRequest):
return reviewTodoRequest
default:
return nil
}
}
}