9
9
import com .spoony .spoony_server .adapter .dto .zzim .ZzimPostAddRequestDTO ;
10
10
import com .spoony .spoony_server .adapter .dto .zzim .ZzimCardListResponseDTO ;
11
11
import com .spoony .spoony_server .adapter .dto .zzim .ZzimFocusListResponseDTO ;
12
+ import io .swagger .v3 .oas .annotations .Operation ;
12
13
import lombok .RequiredArgsConstructor ;
13
14
import org .springframework .http .HttpStatus ;
14
15
import org .springframework .http .ResponseEntity ;
@@ -24,38 +25,52 @@ public class ZzimPostController {
24
25
private final ZzimDeleteUseCase zzimRemoveUseCase ;
25
26
26
27
@ PostMapping
27
- public ResponseEntity <ResponseDTO <Void >> addZzimPost (@ RequestBody ZzimPostAddRequestDTO zzimPostAddRequestDTO ) {
28
+ @ Operation (summary = "북마크 추가 API" , description = "북마크에 새로운 게시물을 추가하는 API" )
29
+ public ResponseEntity <ResponseDTO <Void >> addZzimPost (
30
+ @ UserId Long userId ,
31
+ @ RequestBody ZzimPostAddRequestDTO zzimPostAddRequestDTO ) {
28
32
ZzimAddCommand command = new ZzimAddCommand (
29
- zzimPostAddRequestDTO . userId () ,
33
+ userId ,
30
34
zzimPostAddRequestDTO .postId ()
31
35
);
32
36
zzimAddUseCase .addZzimPost (command );
33
37
return ResponseEntity .status (HttpStatus .OK ).body (ResponseDTO .success (null ));
34
38
}
35
39
36
40
@ GetMapping
37
- public ResponseEntity <ResponseDTO <ZzimCardListResponseDTO >> getZzimCardList (@ UserId Long userId ) {
41
+ @ Operation (summary = "북마크 조회 API" , description = "북마크 장소 리스트를 조회하는 API" )
42
+ public ResponseEntity <ResponseDTO <ZzimCardListResponseDTO >> getZzimCardList (
43
+ @ UserId Long userId ) {
38
44
ZzimGetCardCommand command = new ZzimGetCardCommand (userId );
39
45
ZzimCardListResponseDTO zzimCardListResponse = zzimGetUseCase .getZzimCardList (command );
40
46
return ResponseEntity .status (HttpStatus .OK ).body (ResponseDTO .success (zzimCardListResponse ));
41
47
}
42
48
43
49
@ GetMapping ("/{placeId}" )
44
- public ResponseEntity <ResponseDTO <ZzimFocusListResponseDTO >> getZzimFocusList (@ UserId Long userId , @ PathVariable long placeId ) {
50
+ @ Operation (summary = "특정 장소의 북마크 리스트 조회 API" , description = "특정 장소의 북마크 장소 리스트를 조회하는 API" )
51
+ public ResponseEntity <ResponseDTO <ZzimFocusListResponseDTO >> getZzimFocusList (
52
+ @ UserId Long userId ,
53
+ @ PathVariable long placeId ) {
45
54
ZzimGetFocusCommand command = new ZzimGetFocusCommand (userId , placeId );
46
55
ZzimFocusListResponseDTO zzimFocusListResponse = zzimGetUseCase .getZzimFocusList (command );
47
56
return ResponseEntity .status (HttpStatus .OK ).body (ResponseDTO .success (zzimFocusListResponse ));
48
57
}
49
58
50
59
@ GetMapping ("/location/{locationId}" )
51
- public ResponseEntity <ResponseDTO <ZzimCardListResponseDTO >> getZzimLocationCardList (@ UserId Long userId , @ PathVariable long locationId ) {
60
+ @ Operation (summary = "특정 지역의 북마크 조회 API" , description = "특정 지역의 북마크 장소 리스트를 조회하는 API" )
61
+ public ResponseEntity <ResponseDTO <ZzimCardListResponseDTO >> getZzimLocationCardList (
62
+ @ UserId Long userId ,
63
+ @ PathVariable long locationId ) {
52
64
ZzimGetLocationCardCommand command = new ZzimGetLocationCardCommand (userId , locationId );
53
65
ZzimCardListResponseDTO zzimCardListResponse = zzimGetUseCase .getZzimByLocation (command );
54
66
return ResponseEntity .status (HttpStatus .OK ).body (ResponseDTO .success (zzimCardListResponse ));
55
67
}
56
68
57
69
@ DeleteMapping ("/{postId}" )
58
- public ResponseEntity <ResponseDTO <Void >> deleteZzim (@ UserId Long userId , @ PathVariable long postId ) {
70
+ @ Operation (summary = "북마크 삭제 API" , description = "북마크에서 특정 게시물을 삭제하는 API" )
71
+ public ResponseEntity <ResponseDTO <Void >> deleteZzim (
72
+ @ UserId Long userId ,
73
+ @ PathVariable long postId ) {
59
74
ZzimDeleteCommand command = new ZzimDeleteCommand (userId , postId );
60
75
zzimRemoveUseCase .deleteZzim (command );
61
76
return ResponseEntity .status (HttpStatus .OK ).body (ResponseDTO .success (null ));
0 commit comments