-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathEmotionEndpoint.swift
More file actions
53 lines (45 loc) · 1.05 KB
/
EmotionEndpoint.swift
File metadata and controls
53 lines (45 loc) · 1.05 KB
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
//
// EmotionEndpoint.swift
// DataSource
//
// Created by 최정인 on 7/28/25.
//
enum EmotionEndpoint {
case fetchEmotions
case registerEmotion(emotion: String)
}
extension EmotionEndpoint: Endpoint {
var baseURL: String {
return AppProperties.baseURL + "/api/v1/emotion-marbles"
}
var path: String {
return baseURL
}
var method: HTTPMethod {
switch self {
case .fetchEmotions: .get
case .registerEmotion: .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 .fetchEmotions:
return [:]
case .registerEmotion(let emotion):
return ["emotionMarbleType": emotion]
}
}
var isAuthorized: Bool {
return true
}
}