Repository navigation
Expand file tree
/
Copy pathapi.http
More file actions
175 lines (142 loc) · 4.49 KB
/
Copy pathapi.http
File metadata and controls
175 lines (142 loc) · 4.49 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
### IntelliJ HTTP Client 요청 모음 (docs/API.md 기준)
### 사용법: 우측 상단 환경을 'local'로 선택 → 요청 옆 ▶ 클릭
### 회원가입 또는 로그인을 먼저 실행하면 jwt 변수가 자동 저장됩니다.
### email, password는 http/http-client.env.json 의 local 환경 값을 씁니다.
### 0. 서버 동작 확인
GET {{baseUrl}}/api/hello
### 1-1. 회원가입 (이미 가입했으면 409 → 1-2 로그인)
POST {{baseUrl}}/api/auth/signup
Content-Type: application/json
{
"email": "{{email}}",
"password": "{{password}}",
"nickname": "음악덕후"
}
> {%
if (response.status === 201) {
client.global.set("jwt", response.body.accessToken);
client.global.set("myId", response.body.user.id);
}
%}
### 1-2. 로그인
POST {{baseUrl}}/api/auth/login
Content-Type: application/json
{
"email": "{{email}}",
"password": "{{password}}"
}
> {%
client.global.set("jwt", response.body.accessToken);
client.global.set("myId", response.body.user.id);
%}
### 2. 내 정보
GET {{baseUrl}}/api/users/me
Authorization: Bearer {{jwt}}
### 3. 내 정보 수정 (보낸 필드만)
PATCH {{baseUrl}}/api/users/me
Authorization: Bearer {{jwt}}
Content-Type: application/json
{
"nickname": "바뀐닉네임"
}
### 3-1. 비밀번호 변경
PATCH {{baseUrl}}/api/users/me/password
Authorization: Bearer {{jwt}}
Content-Type: application/json
{
"currentPassword": "{{password}}",
"newPassword": "{{password}}"
}
### S-1. Spotify 검색 (서버에 SPOTIFY_CLIENT_ID/SECRET 필요, 없으면 503)
GET {{baseUrl}}/api/spotify/search?q=아이유&type=track&limit=10
Authorization: Bearer {{jwt}}
### S-2. Spotify 곡 정보
GET {{baseUrl}}/api/spotify/tracks/4uLU6hMCjMI75M1A2tKUQC
Authorization: Bearer {{jwt}}
### S-3. Spotify 플리 정보 + 수록곡
GET {{baseUrl}}/api/spotify/playlists/3cEYpjA9oz9GiPac4AsH4n
Authorization: Bearer {{jwt}}
### 4-1. 리뷰 작성 (곡)
POST {{baseUrl}}/api/reviews
Authorization: Bearer {{jwt}}
Content-Type: application/json
{
"type": "TRACK",
"spotifyId": "4uLU6hMCjMI75M1A2tKUQC",
"item": {
"name": "Never Gonna Give You Up",
"subtitle": "Rick Astley",
"imageUrl": "https://i.scdn.co/image/ab67616d0000b27315ebbedaacef61af244262a8"
},
"rating": 4.5,
"comment": "몇 번을 들어도 좋다",
"tags": ["신나는", "80년대"]
}
> {% client.global.set("reviewId", response.body.id); %}
### 4-2. 리뷰 작성 (플레이리스트)
POST {{baseUrl}}/api/reviews
Authorization: Bearer {{jwt}}
Content-Type: application/json
{
"type": "PLAYLIST",
"spotifyId": "3cEYpjA9oz9GiPac4AsH4n",
"item": {
"name": "새벽 드라이브",
"subtitle": "smedjan",
"imageUrl": "https://i.scdn.co/image/ab67706c0000da84"
},
"rating": 4.5,
"conceptScore": 5.0,
"flowScore": 4.5,
"discoveryScore": 3.5,
"snapshotId": "MTY4NjY2OTQ0MCwwMDAwMDAwMA==",
"ownerSpotifyId": "smedjan",
"comment": "곡 순서가 자연스럽다",
"tags": ["드라이브"]
}
### 4-3. 검증 실패 예시 (곡 리뷰에 플리 필드) → 400 INVALID_REVIEW_FIELDS
POST {{baseUrl}}/api/reviews
Authorization: Bearer {{jwt}}
Content-Type: application/json
{
"type": "TRACK",
"spotifyId": "11dFghVXANMlKmJXsNCbNl",
"item": { "name": "Cut To The Feeling" },
"rating": 4.0,
"flowScore": 3.0
}
### 5. 리뷰 단건 조회
GET {{baseUrl}}/api/reviews/{{reviewId}}
Authorization: Bearer {{jwt}}
### 6. 리뷰 수정
PATCH {{baseUrl}}/api/reviews/{{reviewId}}
Authorization: Bearer {{jwt}}
Content-Type: application/json
{
"rating": 5.0,
"tags": ["명곡"]
}
### 7. 리뷰 삭제
DELETE {{baseUrl}}/api/reviews/{{reviewId}}
Authorization: Bearer {{jwt}}
### 8. 항목의 리뷰 목록
GET {{baseUrl}}/api/items/track/4uLU6hMCjMI75M1A2tKUQC/reviews?page=0&size=20&sort=latest
Authorization: Bearer {{jwt}}
### 9. 항목 요약
GET {{baseUrl}}/api/items/playlist/3cEYpjA9oz9GiPac4AsH4n/summary
Authorization: Bearer {{jwt}}
### 10. 최신 피드
GET {{baseUrl}}/api/feed?page=0&size=20
Authorization: Bearer {{jwt}}
### 11. 인기 항목
GET {{baseUrl}}/api/feed/popular?days=7&limit=10
Authorization: Bearer {{jwt}}
### 12. 유저의 리뷰 + 통계 (4.5점 이상 곡만)
GET {{baseUrl}}/api/users/{{myId}}/reviews?type=TRACK&minRating=4.5
Authorization: Bearer {{jwt}}
### 13. 내 리뷰 일괄 조회
GET {{baseUrl}}/api/reviews/mine?type=TRACK&spotifyIds=4uLU6hMCjMI75M1A2tKUQC,11dFghVXANMlKmJXsNCbNl
Authorization: Bearer {{jwt}}
### 14. 큐레이터 랭킹
GET {{baseUrl}}/api/curators/ranking?minReviews=1&limit=20
Authorization: Bearer {{jwt}}