Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

style: uuid 변수명 suffix 통일 #229

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
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 @@ -41,12 +41,13 @@ public class CommentController {
)
})
@Parameters({
@Parameter(name = "postId", description = "일대다 상담 ID")
@Parameter(name = "postUuid", description = "일대다 상담 ID")
})
@GetMapping("/counselors/{postId}")
public ResponseEntity<List<CommentGetResponse>> getCounselorComments(@PathVariable UUID postId,
@AuthenticationPrincipal CustomUserDetails customUserDetails) {
return ResponseEntity.ok(commentService.getCounselorComments(postId,
@GetMapping("/counselors/{postUuid}")
public ResponseEntity<List<CommentGetResponse>> getCounselorComments(
@PathVariable UUID postUuid,
@AuthenticationPrincipal CustomUserDetails customUserDetails) {
return ResponseEntity.ok(commentService.getCounselorComments(postUuid,
customUserDetails.getCustomer().getCustomerId()));
}

Expand All @@ -55,8 +56,9 @@ public ResponseEntity<List<CommentGetResponse>> getCounselorComments(@PathVariab
- 주소 형식: /api/v1/comments/counselors""")
@ApiResponses({
@ApiResponse(responseCode = "201", description = "댓글 생성 성공"),
@ApiResponse(responseCode = "400", description = "1. 진행중이지 않은 상담\n 2. 마감된 상담 중 상담사 본인이 답변을 작성하지 않은 상담" +
"3. 이미 답변을 작성한 상담 4. 자기자신에게 댓글 작성한 상담",
@ApiResponse(responseCode = "400", description =
"1. 진행중이지 않은 상담\n 2. 마감된 상담 중 상담사 본인이 답변을 작성하지 않은 상담" +
"3. 이미 답변을 작성한 상담 4. 자기자신에게 댓글 작성한 상담",
content = @Content(mediaType = "application/json",
schema = @Schema(implementation = CustomExceptionResponse.class))
)
Expand All @@ -81,12 +83,12 @@ public ResponseEntity<Void> createComments(
)
})
@Parameters({
@Parameter(name = "postId", description = "일대다 상담 ID")
@Parameter(name = "postUuid", description = "일대다 상담 ID")
})
@GetMapping("/customers/{postId}")
public ResponseEntity<List<CommentGetResponse>> getCustomerComments(@PathVariable UUID postId,
@AuthenticationPrincipal CustomUserDetails customUserDetails) {
return ResponseEntity.ok(commentService.getCustomerComments(postId,
@GetMapping("/customers/{postUuid}")
public ResponseEntity<List<CommentGetResponse>> getCustomerComments(@PathVariable UUID postUuid,
@AuthenticationPrincipal CustomUserDetails customUserDetails) {
return ResponseEntity.ok(commentService.getCustomerComments(postUuid,
customUserDetails == null ? 0 : customUserDetails.getCustomer().getCustomerId()));
}

Expand All @@ -102,20 +104,23 @@ public ResponseEntity<List<CommentGetResponse>> getCustomerComments(@PathVariabl
content = @Content(mediaType = "application/json",
schema = @Schema(implementation = CustomExceptionResponse.class))
),
@ApiResponse(responseCode = "404", description = "1. 존재하지 않는 사용자일 때 2. 존재하지 않는 일대다 상담 ID 일 때 "
+ "3. 존재하지 않는 답변 ID 일 때 4. 해당 게시물에 달린 답변이 아닐 때",
@ApiResponse(responseCode = "404", description =
"1. 존재하지 않는 사용자일 때 2. 존재하지 않는 일대다 상담 ID 일 때 "
+ "3. 존재하지 않는 답변 ID 일 때 4. 해당 게시물에 달린 답변이 아닐 때",
content = @Content(mediaType = "application/json",
schema = @Schema(implementation = CustomExceptionResponse.class))
)
})
@Parameters({
@Parameter(name = "postId", description = "일대다 상담 ID"),
@Parameter(name = "postUuid", description = "일대다 상담 ID"),
@Parameter(name = "commentId", description = "답변 ID")
})
@PatchMapping("/customers/{postId}")
public ResponseEntity<Void> updateCustomerChosenComment(@PathVariable UUID postId, @RequestParam Long commentId,
@AuthenticationPrincipal CustomUserDetails customUserDetails) {
commentService.updateCustomerChosenComment(postId, commentId, customUserDetails.getCustomer().getCustomerId());
@PatchMapping("/customers/{postUuid}")
public ResponseEntity<Void> updateCustomerChosenComment(@PathVariable UUID postUuid,
@RequestParam Long commentId,
@AuthenticationPrincipal CustomUserDetails customUserDetails) {
commentService.updateCustomerChosenComment(postUuid, commentId,
customUserDetails.getCustomer().getCustomerId());
return ResponseEntity.ok().build();
}

Expand All @@ -129,11 +134,12 @@ public ResponseEntity<Void> updateCustomerChosenComment(@PathVariable UUID postI
)
})
@Parameters({
@Parameter(name = "postId", description = "일대다 상담 ID"),
@Parameter(name = "postUuid", description = "일대다 상담 ID"),
})
@GetMapping("/counselors/authentication/{postId}")
public Boolean getIsCommentOwner(@PathVariable UUID postId,
@AuthenticationPrincipal CustomUserDetails customUserDetails) {
return commentService.getIsCommentOwner(postId, customUserDetails.getCustomer().getCustomerId());
@GetMapping("/counselors/authentication/{postUuid}")
public Boolean getIsCommentOwner(@PathVariable UUID postUuid,
@AuthenticationPrincipal CustomUserDetails customUserDetails) {
return commentService.getIsCommentOwner(postUuid,
customUserDetails.getCustomer().getCustomerId());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,12 @@ public ResponseEntity<Void> updatePost(@Valid @RequestBody PostUpdateRequest pos
)
})
@Parameters({
@Parameter(name = "postId", description = "일대다 질문 아이디")
@Parameter(name = "postUuid", description = "일대다 질문 아이디")
})
@GetMapping("/{postId}")
public ResponseEntity<PostGetResponse> getPost(@PathVariable UUID postId,
@GetMapping("/{postUuid}")
public ResponseEntity<PostGetResponse> getPost(@PathVariable UUID postUuid,
@AuthenticationPrincipal CustomUserDetails customUserDetails) {
return ResponseEntity.ok(postService.getPost(postId,
return ResponseEntity.ok(postService.getPost(postUuid,
customUserDetails == null ? 0 : customUserDetails.getCustomer().getCustomerId()));
}

Expand All @@ -114,65 +114,65 @@ public ResponseEntity<PostGetResponse> getPost(@PathVariable UUID postId,
})
@Parameters({
@Parameter(name = "filter", description = "완료/취소된 상담 제외: true, 포함: false"),
@Parameter(name = "postId", description = """
- 조회 결과는 4개씩 반환하며, postId로 구분
1. 최초 조회 요청이면 postId는 00000000-0000-0000-0000-000000000000
2. 2번째 요청부터 postId는 직전 요청의 조회 결과 4개 중 마지막 postId""")
@Parameter(name = "postUuid", description = """
- 조회 결과는 4개씩 반환하며, postUuid로 구분
1. 최초 조회 요청이면 postUuid는 00000000-0000-0000-0000-000000000000
2. 2번째 요청부터 postUuid는 직전 요청의 조회 결과 4개 중 마지막 postUuid""")
})
@GetMapping("/customers")
public ResponseEntity<List<PostGetCustomerListResponse>> getPostsByCustomer(
@RequestParam Boolean filter,
@RequestParam UUID postId,
@RequestParam UUID postUuid,
@AuthenticationPrincipal CustomUserDetails customUserDetails) {
return ResponseEntity.ok(postService.getPostsByCustomer(filter, postId,
return ResponseEntity.ok(postService.getPostsByCustomer(filter, postUuid,
customUserDetails.getCustomer().getCustomerId()));
}

@Operation(summary = "상담사 본인 일대다 상담 리스트 조회", description = """
- 상담사 상담 탭에서 본인이 댓글 작성한 일대다 상담 질문 리스트 조회
- 주소 형식: /api/v1/posts/counselors?filter=true&postId=0""")
- 주소 형식: /api/v1/posts/counselors?filter=true&postUuid=0""")
@ApiResponses({
@ApiResponse(responseCode = "200", description = "조회 성공")
})
@Parameters({
@Parameter(name = "filter", description = "완료/취소된 상담 제외: true, 포함: false"),
@Parameter(name = "postId", description = """
- 조회 결과는 4개씩 반환하며, postId로 구분
1. 최초 조회 요청이면 postId는 00000000-0000-0000-0000-000000000000
2. 2번째 요청부터 postId는 직전 요청의 조회 결과 4개 중 마지막 postId""")
@Parameter(name = "postUuid", description = """
- 조회 결과는 4개씩 반환하며, postUuid로 구분
1. 최초 조회 요청이면 postUuid는 00000000-0000-0000-0000-000000000000
2. 2번째 요청부터 postUuid는 직전 요청의 조회 결과 4개 중 마지막 postId""")
})
@GetMapping("/counselors")
public ResponseEntity<List<PostGetCounselorListResponse>> getPostsByCounselor(
@RequestParam Boolean filter,
@RequestParam UUID postId,
@RequestParam UUID postUuid,
@AuthenticationPrincipal CustomUserDetails customUserDetails) {
return ResponseEntity.ok(postService.getPostsByCounselor(filter, postId,
return ResponseEntity.ok(postService.getPostsByCounselor(filter, postUuid,
customUserDetails.getCustomer().getCustomerId()));
}

@Operation(summary = "구매자 사이드 공개상담 탭 일대다 상담 리스트 기본순 조회", description = """
- 구매자 사이드의 공개상담 탭에서 답변 완료된 일대다 상담 질문 리스트 기본순 조회
- 로그인한 사용자일 경우 헤더에 accessToken을 넣어주세요
- 주소 형식: /api/v1/posts/customers/public?postId=0&finishedAt=2024-03-22T00:47:59""")
- 주소 형식: /api/v1/posts/customers/public?postUuid=0&finishedAt=2024-03-22T00:47:59""")
@ApiResponses({
@ApiResponse(responseCode = "200", description = "조회 성공")
})
@Parameters({
@Parameter(name = "postId", description = """
- 조회 결과는 4개씩 반환하며, postId와 finishedAt으로 구분
1. 최초 조회 요청이면 postId는 00000000-0000-0000-0000-000000000000
2. 2번째 요청부터 postId는 직전 요청의 조회 결과 4개 중 마지막 postId"""),
@Parameter(name = "postUuid", description = """
- 조회 결과는 4개씩 반환하며, postUuid와 finishedAt으로 구분
1. 최초 조회 요청이면 postUuid는 00000000-0000-0000-0000-000000000000
2. 2번째 요청부터 postUuid는 직전 요청의 조회 결과 4개 중 마지막 postId"""),
@Parameter(name = "finishedAt", description = """
1. 최초 조회 요청이면 지금 시간
2. 2번째 요청부터 finishedAt은 직전 요청의 조회 결과 4개 중 마지막 finishedAt
3. 형식 예시에 적어둔 것과 꼭 맞춰주셔야 합니다""")
})
@GetMapping("/customers/public")
public ResponseEntity<List<PostGetPublicListResponse>> getPublicPostsByCustomer(
@RequestParam UUID postId,
@RequestParam UUID postUuid,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss") LocalDateTime finishedAt,
@AuthenticationPrincipal CustomUserDetails customUserDetails) {
return ResponseEntity.ok(postService.getPublicPostsByCustomer(postId, finishedAt,
return ResponseEntity.ok(postService.getPublicPostsByCustomer(postUuid, finishedAt,
customUserDetails == null ? 0 : customUserDetails.getCustomer().getCustomerId()));
}

Expand All @@ -184,21 +184,21 @@ public ResponseEntity<List<PostGetPublicListResponse>> getPublicPostsByCustomer(
@ApiResponse(responseCode = "200", description = "조회 성공")
})
@Parameters({
@Parameter(name = "postId", description = """
- 조회 결과는 4개씩 반환하며, postId와 finishedAt으로 구분
1. 최초 조회 요청이면 postId는 00000000-0000-0000-0000-000000000000
2. 2번째 요청부터 postId는 직전 요청의 조회 결과 4개 중 마지막 postId"""),
@Parameter(name = "postUuid", description = """
- 조회 결과는 4개씩 반환하며, postUuid와 finishedAt으로 구분
1. 최초 조회 요청이면 postUuid는 00000000-0000-0000-0000-000000000000
2. 2번째 요청부터 postUuid는 직전 요청의 조회 결과 4개 중 마지막 postUuid"""),
@Parameter(name = "finishedAt", description = """
1. 최초 조회 요청이면 지금 시간
2. 2번째 요청부터 finishedAt은 직전 요청의 조회 결과 4개 중 마지막 finishedAt
3. 형식 예시에 적어둔 것과 꼭 맞춰주셔야 합니다""")
})
@GetMapping("/customers/public/likes")
public ResponseEntity<List<PostGetPublicListResponse>> getPopularityPosts(
@RequestParam UUID postId,
@RequestParam UUID postUuid,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss") LocalDateTime finishedAt,
@AuthenticationPrincipal CustomUserDetails customUserDetails) {
return ResponseEntity.ok(postService.getPopularityPosts(postId, finishedAt,
return ResponseEntity.ok(postService.getPopularityPosts(postUuid, finishedAt,
customUserDetails == null ? 0 : customUserDetails.getCustomer().getCustomerId()));
}

Expand All @@ -225,13 +225,12 @@ public ResponseEntity<List<UUID>> getRandomPosts() {
)
})
@Parameters({
@Parameter(name = "postId", description = """
- 일대다 상담 ID""")
@Parameter(name = "postUuid", description = "일대다 상담 ID")
})
@GetMapping("/counselors/{postId}")
public ResponseEntity<PostGetResponse> getPostInfo(@PathVariable UUID postId,
@GetMapping("/counselors/{postUuid}")
public ResponseEntity<PostGetResponse> getPostInfo(@PathVariable UUID postUuid,
@AuthenticationPrincipal CustomUserDetails customUserDetails) {
return ResponseEntity.ok(postService.getCounselorPostContent(postId,
return ResponseEntity.ok(postService.getCounselorPostContent(postUuid,
customUserDetails.getCustomer().getCustomerId()));
}

Expand All @@ -245,12 +244,12 @@ public ResponseEntity<PostGetResponse> getPostInfo(@PathVariable UUID postId,
)
})
@Parameters({
@Parameter(name = "postId", description = "일대다 질문 아이디")
@Parameter(name = "postUuid", description = "일대다 질문 아이디")
})
@GetMapping("/customers/public/{postId}")
public Boolean getIsPostOwner(@PathVariable UUID postId,
@GetMapping("/customers/public/{postUuid}")
public Boolean getIsPostOwner(@PathVariable UUID postUuid,
@AuthenticationPrincipal CustomUserDetails customUserDetails) {
return postService.getIsPostOwner(postId,
return postService.getIsPostOwner(postUuid,
customUserDetails == null ? 0 : customUserDetails.getCustomer().getCustomerId());
}
}