1818
1919@ RequiredArgsConstructor
2020@ RestController
21- @ RequestMapping ("/v1/albums" )
2221@ Validated
2322@ Tag (name = "Albums" , description = "Albums 관련 API" )
2423public class AlbumController {
2524 private final AlbumService albumService ;
2625
27- @ PostMapping ("" )
26+ @ PostMapping ("/v1/albums " )
2827 @ ApiResponses (
2928 value = {
3029 @ ApiResponse (
@@ -40,7 +39,7 @@ public List<AlbumCreateResponse> createAlbum(@Valid @RequestBody AlbumCreateRequ
4039 return albumService .createAlbum (albumCreateRequest , userPrincipal );
4140 }
4241
43- @ PostMapping ("/{joyId}" )
42+ @ PostMapping ("/v1/albums/ {joyId}" )
4443 @ ApiResponses (
4544 value = {
4645 @ ApiResponse (
@@ -57,7 +56,7 @@ public void addJoyToAlbum(@PathVariable Long joyId,
5756 albumService .addJoyToAlbum (joyId , albumSaveJoyRequest , userPrincipal );
5857 }
5958
60- @ PutMapping ("/{albumId}" )
59+ @ PutMapping ("/v1/albums/ {albumId}" )
6160 @ ApiResponses (
6261 value = {
6362 @ ApiResponse (
@@ -74,7 +73,7 @@ public void putMyAlbum(@PathVariable Long albumId,
7473 albumService .putMyAlbum (albumId , albumPutRequest , userPrincipal );
7574 }
7675
77- @ PutMapping ("/{albumId}/status" )
76+ @ PutMapping ("/v1/albums/ {albumId}/status" )
7877 @ ApiResponses (
7978 value = {
8079 @ ApiResponse (
@@ -90,7 +89,7 @@ public void putMyAlbumStatus(@PathVariable Long albumId,
9089 albumService .putMyAlbumStatus (albumId , userPrincipal );
9190 }
9291
93- @ GetMapping ("/{albumId}" )
92+ @ GetMapping ("/v1/albums/ {albumId}" )
9493 @ ApiResponses (
9594 value = {
9695 @ ApiResponse (
@@ -106,7 +105,7 @@ public AlbumGetDetailResponse getAlbumDetail(@PathVariable Long albumId,
106105 return albumService .getAlbumDetail (albumId , userPrincipal );
107106 }
108107
109- @ PostMapping ("/{albumId}/bookmarks" )
108+ @ PostMapping ("/v1/albums/ {albumId}/bookmarks" )
110109 @ ApiResponses (
111110 value = {
112111 @ ApiResponse (
@@ -122,7 +121,7 @@ public void createAlbumBookmark(@PathVariable Long albumId,
122121 albumService .createAlbumBookmark (albumId , userPrincipal );
123122 }
124123
125- @ DeleteMapping ("/{albumId}/bookmarks" )
124+ @ DeleteMapping ("/v1/albums/ {albumId}/bookmarks" )
126125 @ ApiResponses (
127126 value = {
128127 @ ApiResponse (
@@ -138,7 +137,7 @@ public void deleteAlbumBookmark(@PathVariable Long albumId,
138137 albumService .deleteAlbumBookmark (albumId , userPrincipal );
139138 }
140139
141- @ GetMapping ("" )
140+ @ GetMapping ("/v1/albums " )
142141 @ ApiResponses (
143142 value = {
144143 @ ApiResponse (
@@ -153,7 +152,7 @@ public List<AlbumGetMyAllResponse> getMyAllAlbums(@AuthenticationPrincipal final
153152 return albumService .getMyAllAlbums (userPrincipal );
154153 }
155154
156- @ GetMapping ("/created" )
155+ @ GetMapping ("/v1/albums/ created" )
157156 @ ApiResponses (
158157 value = {
159158 @ ApiResponse (
@@ -168,7 +167,7 @@ public List<AlbumGetCreatedResponse> getCreatedAlbums(@AuthenticationPrincipal f
168167 return albumService .getCreatedAlbums (userPrincipal );
169168 }
170169
171- @ GetMapping ("/joy/{joyId}" )
170+ @ GetMapping ("/v1/albums/ joy/{joyId}" )
172171 @ ApiResponses (
173172 value = {
174173 @ ApiResponse (
@@ -184,7 +183,7 @@ public List<AlbumGetJoyAllResponse> getMyJoyAllAlbums(@PathVariable Long joyId,
184183 return albumService .getMyJoyAllAlbums (joyId , userPrincipal );
185184 }
186185
187- @ GetMapping ("/all" )
186+ @ GetMapping ("/v1/albums/ all" )
188187 @ ApiResponses (
189188 value = {
190189 @ ApiResponse (
@@ -200,7 +199,7 @@ public Slice<AlbumGetAllResponse> getAllAlbums(@RequestParam(required = false) L
200199 return albumService .getAllAlbums (albumId , size );
201200 }
202201
203- @ GetMapping ("/{albumId}/random" )
202+ @ GetMapping ("/v1/albums/ {albumId}/random" )
204203 @ ApiResponses (
205204 value = {
206205 @ ApiResponse (
@@ -216,7 +215,7 @@ public List<AlbumGetOthersResponse> getOtherAlbums(@PathVariable Long albumId,
216215 return albumService .getOtherAlbums (albumId , userPrincipal );
217216 }
218217
219- @ PostMapping ("/recent/{albumId}" )
218+ @ PostMapping ("/v1/albums/ recent/{albumId}" )
220219 @ ApiResponses (
221220 value = {
222221 @ ApiResponse (
@@ -232,7 +231,7 @@ public void createRecentAlbums(@PathVariable Long albumId,
232231 albumService .createRecentAlbums (albumId , userPrincipal );
233232 }
234233
235- @ GetMapping ("/recent" )
234+ @ GetMapping ("/v1/albums/ recent" )
236235 @ ApiResponses (
237236 value = {
238237 @ ApiResponse (
@@ -247,23 +246,39 @@ public List<AlbumGetRecentResponse> getRecentAlbums(@AuthenticationPrincipal fin
247246 return albumService .getRecentAlbums (userPrincipal );
248247 }
249248
250- @ DeleteMapping ("/{albumId}" )
249+ @ DeleteMapping ("/v1/albums/ {albumId}" )
251250 @ ApiResponses (
252251 value = {
253252 @ ApiResponse (
254253 responseCode = "200" ,
255- description = "앨범 삭제 성공" ,
254+ description = "앨범 한 개 삭제 성공" ,
256255 useReturnTypeSchema = true
257256 )
258257 }
259258 )
260- @ Operation (summary = "앨범 삭제 API" , description = "앨범 삭제 API입니다." )
259+ @ Operation (summary = "앨범 삭제 (한 개) API" , description = "앨범 삭제 (한 개) API입니다." )
261260 public void deleteAlbum (@ PathVariable Long albumId ,
262261 @ AuthenticationPrincipal final UserPrincipal userPrincipal ) {
263262 albumService .deleteAlbum (albumId , userPrincipal );
264263 }
265264
266- @ PostMapping ("/{albumId}/report" )
265+ @ DeleteMapping ("/v2/albums" )
266+ @ ApiResponses (
267+ value = {
268+ @ ApiResponse (
269+ responseCode = "200" ,
270+ description = "앨범 한 개 이상 삭제 성공" ,
271+ useReturnTypeSchema = true
272+ )
273+ }
274+ )
275+ @ Operation (summary = "앨범 삭제 (한 개 이상) API" , description = "앨범 삭제 (한 개 이상) API입니다." )
276+ public void deleteAlbums (@ RequestParam List <Long > albumIds ,
277+ @ AuthenticationPrincipal final UserPrincipal userPrincipal ) {
278+ albumService .deleteAlbums (albumIds , userPrincipal );
279+ }
280+
281+ @ PostMapping ("/v1/albums/{albumId}/report" )
267282 @ ApiResponses (
268283 value = {
269284 @ ApiResponse (
@@ -281,7 +296,7 @@ public void reportAlbum(@Valid @RequestBody AlbumReportRequest albumReportReques
281296 }
282297
283298
284- @ PutMapping ("/{albumId}/all" )
299+ @ PutMapping ("/v1/albums/ {albumId}/all" )
285300 @ ApiResponses (
286301 value = {
287302 @ ApiResponse (
0 commit comments