|
| 1 | +package com.semosan.api.domain.semofeed.controller.docs; |
| 2 | + |
| 3 | +import com.semosan.api.common.response.ApiResponse; |
| 4 | +import com.semosan.api.common.response.PageResponse; |
| 5 | +import com.semosan.api.domain.semofeed.dto.SemoFeedResponse; |
| 6 | +import io.swagger.v3.oas.annotations.Operation; |
| 7 | +import io.swagger.v3.oas.annotations.Parameter; |
| 8 | +import io.swagger.v3.oas.annotations.media.Content; |
| 9 | +import io.swagger.v3.oas.annotations.media.Schema; |
| 10 | +import io.swagger.v3.oas.annotations.responses.ApiResponses; |
| 11 | +import io.swagger.v3.oas.annotations.tags.Tag; |
| 12 | +import org.springframework.data.domain.Pageable; |
| 13 | +import org.springframework.data.web.PageableDefault; |
| 14 | +import org.springframework.http.ResponseEntity; |
| 15 | +import org.springframework.security.core.annotation.AuthenticationPrincipal; |
| 16 | +import org.springframework.web.bind.annotation.PathVariable; |
| 17 | +import org.springframework.web.bind.annotation.RequestBody; |
| 18 | + |
| 19 | +import java.util.List; |
| 20 | + |
| 21 | +@Tag(name = "SemoFeed", description = "세모피드 API") |
| 22 | +public interface SemoFeedControllerDocs { |
| 23 | + |
| 24 | + @Operation( |
| 25 | + summary = "세모피드 저장", |
| 26 | + description = "트래킹 사진으로 생성된 세모피드 이미지를 저장합니다. 저장 시 비공개 상태로 생성됩니다." |
| 27 | + ) |
| 28 | + @ApiResponses({ |
| 29 | + @io.swagger.v3.oas.annotations.responses.ApiResponse( |
| 30 | + responseCode = "201", |
| 31 | + description = "세모피드 저장 성공", |
| 32 | + content = @Content(schema = @Schema(implementation = SemoFeedResponse.class)) |
| 33 | + ), |
| 34 | + @io.swagger.v3.oas.annotations.responses.ApiResponse( |
| 35 | + responseCode = "401", |
| 36 | + description = "인증 필요", |
| 37 | + content = @Content(schema = @Schema(implementation = ApiResponse.class)) |
| 38 | + ) |
| 39 | + }) |
| 40 | + ResponseEntity<ApiResponse<SemoFeedResponse>> create( |
| 41 | + @AuthenticationPrincipal Long userId, |
| 42 | + @RequestBody String imageUrl |
| 43 | + ); |
| 44 | + |
| 45 | + @Operation( |
| 46 | + summary = "공개 세모피드 목록 조회", |
| 47 | + description = "공개 상태인 세모피드를 최신순으로 최대 100개 페이징 조회합니다." |
| 48 | + ) |
| 49 | + @ApiResponses({ |
| 50 | + @io.swagger.v3.oas.annotations.responses.ApiResponse( |
| 51 | + responseCode = "200", |
| 52 | + description = "공개 세모피드 목록 조회 성공" |
| 53 | + ) |
| 54 | + }) |
| 55 | + ResponseEntity<ApiResponse<PageResponse<SemoFeedResponse>>> listPublic( |
| 56 | + @PageableDefault(size = 100) Pageable pageable |
| 57 | + ); |
| 58 | + |
| 59 | + @Operation( |
| 60 | + summary = "내 세모피드 목록 조회", |
| 61 | + description = "로그인한 사용자의 세모피드를 최신순으로 전체 조회합니다." |
| 62 | + ) |
| 63 | + @ApiResponses({ |
| 64 | + @io.swagger.v3.oas.annotations.responses.ApiResponse( |
| 65 | + responseCode = "200", |
| 66 | + description = "내 세모피드 목록 조회 성공" |
| 67 | + ), |
| 68 | + @io.swagger.v3.oas.annotations.responses.ApiResponse( |
| 69 | + responseCode = "401", |
| 70 | + description = "인증 필요", |
| 71 | + content = @Content(schema = @Schema(implementation = ApiResponse.class)) |
| 72 | + ) |
| 73 | + }) |
| 74 | + ResponseEntity<ApiResponse<List<SemoFeedResponse>>> listMine( |
| 75 | + @AuthenticationPrincipal Long userId |
| 76 | + ); |
| 77 | + |
| 78 | + @Operation( |
| 79 | + summary = "세모피드 공개/비공개 토글", |
| 80 | + description = "본인의 세모피드 공개 상태를 토글합니다. 공개 시 모든 사용자의 피드에 노출됩니다." |
| 81 | + ) |
| 82 | + @ApiResponses({ |
| 83 | + @io.swagger.v3.oas.annotations.responses.ApiResponse( |
| 84 | + responseCode = "200", |
| 85 | + description = "공개 상태 변경 성공" |
| 86 | + ), |
| 87 | + @io.swagger.v3.oas.annotations.responses.ApiResponse( |
| 88 | + responseCode = "403", |
| 89 | + description = "본인의 세모피드만 처리 가능 (SF_403_1)", |
| 90 | + content = @Content(schema = @Schema(implementation = ApiResponse.class)) |
| 91 | + ), |
| 92 | + @io.swagger.v3.oas.annotations.responses.ApiResponse( |
| 93 | + responseCode = "404", |
| 94 | + description = "세모피드를 찾을 수 없음 (SF_404_1)", |
| 95 | + content = @Content(schema = @Schema(implementation = ApiResponse.class)) |
| 96 | + ) |
| 97 | + }) |
| 98 | + ResponseEntity<ApiResponse<Boolean>> togglePublic( |
| 99 | + @AuthenticationPrincipal Long userId, |
| 100 | + @Parameter(description = "세모피드 ID", required = true) |
| 101 | + @PathVariable Long semoFeedId |
| 102 | + ); |
| 103 | + |
| 104 | + @Operation( |
| 105 | + summary = "세모피드 삭제", |
| 106 | + description = "본인의 세모피드를 삭제합니다." |
| 107 | + ) |
| 108 | + @ApiResponses({ |
| 109 | + @io.swagger.v3.oas.annotations.responses.ApiResponse( |
| 110 | + responseCode = "200", |
| 111 | + description = "세모피드 삭제 성공" |
| 112 | + ), |
| 113 | + @io.swagger.v3.oas.annotations.responses.ApiResponse( |
| 114 | + responseCode = "403", |
| 115 | + description = "본인의 세모피드만 처리 가능 (SF_403_1)", |
| 116 | + content = @Content(schema = @Schema(implementation = ApiResponse.class)) |
| 117 | + ), |
| 118 | + @io.swagger.v3.oas.annotations.responses.ApiResponse( |
| 119 | + responseCode = "404", |
| 120 | + description = "세모피드를 찾을 수 없음 (SF_404_1)", |
| 121 | + content = @Content(schema = @Schema(implementation = ApiResponse.class)) |
| 122 | + ) |
| 123 | + }) |
| 124 | + ResponseEntity<ApiResponse<Void>> delete( |
| 125 | + @AuthenticationPrincipal Long userId, |
| 126 | + @Parameter(description = "세모피드 ID", required = true) |
| 127 | + @PathVariable Long semoFeedId |
| 128 | + ); |
| 129 | +} |
0 commit comments