Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.example.leets7th.domain.comment.dto.res.CommentResponseDTO;
import com.example.leets7th.global.apiPayload.ApiResponse;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.responses.ApiResponses;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
Expand All @@ -26,8 +27,8 @@ public interface CommentControllerDocs {
})
@GetMapping("/api/posts/{postId}/comments")
ApiResponse<List<CommentResponseDTO.CommentResDTO>> getCommentList(
@RequestHeader @Valid Long userId,
@PathVariable Long postId
@Parameter(description = "유저 ID", example = "1") @RequestHeader @Valid Long userId,
@Parameter(description = "게시글 ID", example = "1") @PathVariable Long postId
);

@Operation(
Expand All @@ -48,9 +49,9 @@ ApiResponse<List<CommentResponseDTO.CommentResDTO>> getCommentList(
})
@PatchMapping("/api/posts/{postId}/comments/{commentId}/adopt")
ApiResponse<Void> adoptComment(
@RequestHeader @Valid Long userId,
@PathVariable Long postId,
@PathVariable Long commentId
@Parameter(description = "유저 ID", example = "1") @RequestHeader @Valid Long userId,
@Parameter(description = "게시글 ID", example = "1") @PathVariable Long postId,
@Parameter(description = "채택할 댓글 ID", example = "10") @PathVariable Long commentId
);

@Operation(
Expand All @@ -66,8 +67,8 @@ ApiResponse<Void> adoptComment(
})
@PostMapping("/api/posts/{postId}/comments")
ApiResponse<CommentResponseDTO.CreateCommentResDTO> createComment(
@RequestHeader @Valid Long userId,
@PathVariable Long postId,
@Parameter(description = "유저 ID", example = "1") @RequestHeader @Valid Long userId,
@Parameter(description = "게시글 ID", example = "1") @PathVariable Long postId,
@RequestBody @Valid CommentRequestDTO.CreateCommentDTO request
);

Expand All @@ -87,9 +88,9 @@ ApiResponse<CommentResponseDTO.CreateCommentResDTO> createComment(
})
@PostMapping("/api/posts/{postId}/comments/{commentId}/replies")
ApiResponse<CommentResponseDTO.CreateCommentResDTO> createReply(
@RequestHeader @Valid Long userId,
@PathVariable Long postId,
@PathVariable Long commentId,
@Parameter(description = "유저 ID", example = "1") @RequestHeader @Valid Long userId,
@Parameter(description = "게시글 ID", example = "1") @PathVariable Long postId,
@Parameter(description = "부모 댓글 ID", example = "10") @PathVariable Long commentId,
@RequestBody @Valid CommentRequestDTO.CreateCommentDTO request
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.example.leets7th.domain.post.dto.res.PostResponseDTO;
import com.example.leets7th.global.apiPayload.ApiResponse;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.responses.ApiResponses;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
Expand All @@ -23,7 +24,7 @@ public interface PostControllerDocs {
})
@GetMapping("/api/posts")
ApiResponse<List<PostResponseDTO.PostListResDTO>> getPostList(
@RequestHeader @Valid Long userId
@Parameter(description = "유저 ID", example = "1") @RequestHeader @Valid Long userId
);

@Operation(
Expand All @@ -37,8 +38,8 @@ ApiResponse<List<PostResponseDTO.PostListResDTO>> getPostList(
})
@GetMapping("/api/posts/{postId}")
ApiResponse<PostResponseDTO.PostDetailResDTO> getPostDetail(
@PathVariable Long postId,
@RequestHeader @Valid Long userId
@Parameter(description = "게시글 ID", example = "1") @PathVariable Long postId,
@Parameter(description = "유저 ID", example = "1") @RequestHeader @Valid Long userId
);

@Operation(
Expand All @@ -54,7 +55,7 @@ ApiResponse<PostResponseDTO.PostDetailResDTO> getPostDetail(
})
@PostMapping("/api/posts")
ApiResponse<PostResponseDTO.CreatePostResDTO> createPost(
@RequestHeader @Valid Long userId,
@Parameter(description = "유저 ID", example = "1") @RequestHeader @Valid Long userId,
@Valid @RequestBody PostRequestDTO.PostReqDTO req
);

Expand All @@ -74,8 +75,8 @@ ApiResponse<PostResponseDTO.CreatePostResDTO> createPost(
})
@PostMapping("/api/posts/{postId}")
ApiResponse<PostResponseDTO.PostDetailResDTO> patchPost(
@PathVariable Long postId,
@RequestHeader @Valid Long userId,
@Parameter(description = "게시글 ID", example = "1") @PathVariable Long postId,
@Parameter(description = "유저 ID", example = "1") @RequestHeader @Valid Long userId,
@Valid @RequestBody PostRequestDTO.PostReqDTO req
);

Expand All @@ -92,7 +93,7 @@ ApiResponse<PostResponseDTO.PostDetailResDTO> patchPost(
})
@PostMapping("/api/posts/{postId}")
ApiResponse<Void> deletePost(
@PathVariable Long postId,
@RequestHeader @Valid Long userId
@Parameter(description = "게시글 ID", example = "1") @PathVariable Long postId,
@Parameter(description = "유저 ID", example = "1") @RequestHeader @Valid Long userId
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.example.leets7th.domain.report.dto.req.ReportReqDTO;
import com.example.leets7th.global.apiPayload.ApiResponse;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.responses.ApiResponses;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
Expand All @@ -27,7 +28,7 @@ public interface ReportControllerDocs {
})
@PostMapping("/api/report/{postId}")
ApiResponse<Void> reportPost(
@RequestHeader @Valid Long userId,
@Parameter(description = "유저 ID", example = "1") @RequestHeader @Valid Long userId,
@RequestBody @Valid ReportReqDTO.CreateReportDTO request
);

Expand All @@ -41,5 +42,6 @@ ApiResponse<Void> reportPost(
@io.swagger.v3.oas.annotations.responses.ApiResponse(responseCode = "REPORT404_1", description = "해당 게시글에 대한 신고가 존재하지 않습니다."),
})
@PatchMapping("/api/admin/report/{postId}")
ApiResponse<Void> processReport(@PathVariable Long postId);
ApiResponse<Void> processReport(
@Parameter(description = "게시글 ID", example = "1") @PathVariable Long postId);
}