-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
101 additions
and
0 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
post/src/main/java/com/oing/dto/response/PostVoiceCommentResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package com.oing.dto.response; | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import java.time.ZonedDateTime; | ||
|
||
@Schema(description = "피드 게시물 음성 댓글 응답") | ||
public record PostVoiceCommentResponse( | ||
@Schema(description = "피드 게시물 댓글 ID", example = "01HGW2N7EHJVJ4CJ999RRS2E97") | ||
String commentId, | ||
|
||
@Schema(description = "피드 게시물 ID", example = "01HGW2N7EHJVJ4CJ999RRS2E97") | ||
String postId, | ||
|
||
@Schema(description = "음성 댓글 작성 사용자 ID", example = "01HGW2N7EHJVJ4CJ999RRS2E97") | ||
String memberId, | ||
|
||
@Schema(description = "음성 댓글 오디오 URL", example = "https://..") | ||
String audioUrl, | ||
|
||
@Schema(description = "댓글 작성 시간", example = "2023-12-23T01:53:21.577347+09:00") | ||
ZonedDateTime createdAt | ||
) { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
package com.oing.restapi; | ||
|
||
import com.oing.dto.request.CreatePostCommentRequest; | ||
import com.oing.dto.response.DefaultResponse; | ||
import com.oing.dto.response.PaginationResponse; | ||
import com.oing.dto.response.PostVoiceCommentResponse; | ||
import com.oing.util.security.LoginMemberId; | ||
import io.swagger.v3.oas.annotations.Operation; | ||
import io.swagger.v3.oas.annotations.Parameter; | ||
import io.swagger.v3.oas.annotations.tags.Tag; | ||
import jakarta.validation.Valid; | ||
import jakarta.validation.constraints.Min; | ||
import org.springframework.web.bind.annotation.*; | ||
|
||
@Tag(name = "게시물 음성 댓글 API", description = "게시물 음성 댓글 관련 API") | ||
@RestController | ||
@Valid | ||
@RequestMapping("/v1/posts/{postId}/voice-comments") | ||
public interface VoiceCommentApi { | ||
@Operation(summary = "게시물 음성 댓글 추가", description = "게시물에 음성 댓글을 추가합니다.") | ||
@PostMapping | ||
PostVoiceCommentResponse createPostVoiceComment( | ||
@Parameter(description = "게시물 ID", example = "01HGW2N7EHJVJ4CJ999RRS2E97") | ||
@PathVariable | ||
String postId, | ||
|
||
@Valid | ||
@RequestBody | ||
CreatePostCommentRequest request, | ||
|
||
@Parameter(hidden = true) | ||
@LoginMemberId | ||
String loginMemberId | ||
); | ||
|
||
@Operation(summary = "게시물 음성 댓글 삭제", description = "게시물에 음성 댓글을 삭제합니다.") | ||
@DeleteMapping("/{commentId}") | ||
DefaultResponse deletePostVoiceComment( | ||
@Parameter(description = "게시물 ID", example = "01HGW2N7EHJVJ4CJ999RRS2E97") | ||
@PathVariable | ||
String postId, | ||
|
||
@Parameter(description = "음성 댓글 ID", example = "01HGW2N7EHJVJ4CJ999RRS2E97") | ||
@PathVariable | ||
String commentId, | ||
|
||
@Parameter(hidden = true) | ||
@LoginMemberId | ||
String loginMemberId | ||
); | ||
|
||
@Operation(summary = "게시물 음성 댓글 조회", description = "게시물에 달린 음성 댓글을 조회합니다.") | ||
@GetMapping | ||
PaginationResponse<PostVoiceCommentResponse> getPostComments( | ||
@Parameter(description = "게시물 ID", example = "01HGW2N7EHJVJ4CJ999RRS2E97") | ||
@PathVariable | ||
String postId, | ||
|
||
@RequestParam(required = false, defaultValue = "1") | ||
@Parameter(description = "가져올 현재 페이지", example = "1") | ||
@Min(value = 1) | ||
Integer page, | ||
|
||
@RequestParam(required = false, defaultValue = "10") | ||
@Parameter(description = "가져올 페이지당 크기", example = "10") | ||
@Min(value = 1) | ||
Integer size, | ||
|
||
@RequestParam(required = false) | ||
@Parameter(description = "정렬 방식", example = "DESC | ASC") | ||
String sort, | ||
|
||
@Parameter(hidden = true) | ||
@LoginMemberId | ||
String loginMemberId | ||
); | ||
} |