From fb33ff51bf44de22b4c95779770cc0ebadbd585a Mon Sep 17 00:00:00 2001 From: letskuku Date: Mon, 22 Jul 2024 15:40:58 +0900 Subject: [PATCH 1/3] =?UTF-8?q?#228=20feat:=20post=20uuid=EB=A1=9C=20?= =?UTF-8?q?=EC=A1=B0=ED=9A=8C=20=EC=8B=9C=20response=20=ED=95=84=EB=93=9C?= =?UTF-8?q?=20=ED=83=80=EC=9E=85,=20=ED=95=84=EB=93=9C=EB=AA=85=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...IdResponse.java => PostGetByUuidResponse.java} | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) rename src/main/java/com/example/sharemind/admin/dto/response/{PostGetByIdResponse.java => PostGetByUuidResponse.java} (68%) diff --git a/src/main/java/com/example/sharemind/admin/dto/response/PostGetByIdResponse.java b/src/main/java/com/example/sharemind/admin/dto/response/PostGetByUuidResponse.java similarity index 68% rename from src/main/java/com/example/sharemind/admin/dto/response/PostGetByIdResponse.java rename to src/main/java/com/example/sharemind/admin/dto/response/PostGetByUuidResponse.java index 42e10150..21722a8d 100644 --- a/src/main/java/com/example/sharemind/admin/dto/response/PostGetByIdResponse.java +++ b/src/main/java/com/example/sharemind/admin/dto/response/PostGetByUuidResponse.java @@ -2,14 +2,15 @@ import com.example.sharemind.post.domain.Post; import io.swagger.v3.oas.annotations.media.Schema; +import java.util.UUID; import lombok.Builder; import lombok.Getter; @Getter -public class PostGetByIdResponse { +public class PostGetByUuidResponse { @Schema(description = "공개상담 아이디") - private final Long postId; + private final UUID postUuid; @Schema(description = "상담 카테고리") private final String consultCategory; @@ -21,16 +22,16 @@ public class PostGetByIdResponse { private final String content; @Builder - public PostGetByIdResponse(Long postId, String consultCategory, String title, String content) { - this.postId = postId; + public PostGetByUuidResponse(UUID postUuid, String consultCategory, String title, String content) { + this.postUuid = postUuid; this.consultCategory = consultCategory; this.title = title; this.content = content; } - public static PostGetByIdResponse of(Post post) { - return PostGetByIdResponse.builder() - .postId(post.getPostId()) + public static PostGetByUuidResponse of(Post post) { + return PostGetByUuidResponse.builder() + .postUuid(post.getPostUuid()) .consultCategory(post.getConsultCategory().getDisplayName()) .title(post.getTitle()) .content(post.getContent()) From b3a7c848104a5e52751a2776c0aea8d28027094b Mon Sep 17 00:00:00 2001 From: letskuku Date: Mon, 22 Jul 2024 15:42:28 +0900 Subject: [PATCH 2/3] =?UTF-8?q?#228=20feat:=20post=20=EC=A1=B0=ED=9A=8C=20?= =?UTF-8?q?=EB=B0=8F=20=EC=82=AD=EC=A0=9C=20=EC=96=B4=EB=93=9C=EB=AF=BC=20?= =?UTF-8?q?=EA=B8=B0=EB=8A=A5=20uuid=EB=A1=9C=20=ED=95=A0=20=EC=88=98=20?= =?UTF-8?q?=EC=9E=88=EB=8F=84=EB=A1=9D=20=EB=B9=84=EC=A6=88=EB=8B=88?= =?UTF-8?q?=EC=8A=A4=20=EB=A1=9C=EC=A7=81=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sharemind/admin/application/AdminService.java | 7 ++++--- .../admin/application/AdminServiceImpl.java | 13 +++++++------ 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/example/sharemind/admin/application/AdminService.java b/src/main/java/com/example/sharemind/admin/application/AdminService.java index b667d56d..c1e8e43d 100644 --- a/src/main/java/com/example/sharemind/admin/application/AdminService.java +++ b/src/main/java/com/example/sharemind/admin/application/AdminService.java @@ -6,11 +6,12 @@ import com.example.sharemind.admin.dto.response.InformationGetResponse; import com.example.sharemind.admin.dto.response.PaymentGetRefundWaitingResponse; import com.example.sharemind.admin.dto.response.PaymentGetSettlementOngoingResponse; -import com.example.sharemind.admin.dto.response.PostGetByIdResponse; +import com.example.sharemind.admin.dto.response.PostGetByUuidResponse; import com.example.sharemind.admin.dto.response.PostGetUnpaidPrivateResponse; import com.example.sharemind.counselor.dto.response.CounselorGetProfileResponse; import java.util.List; +import java.util.UUID; public interface AdminService { List getUnpaidConsults(); @@ -41,9 +42,9 @@ public interface AdminService { void updateCounselorPending(Long counselorId); - PostGetByIdResponse getPostByPostId(Long postId); + PostGetByUuidResponse getPostByPostUuid(UUID postUuid); - void deletePostByPostId(Long postId); + void deletePostByPostUuid(UUID postUuid); InformationGetResponse getInformation(); diff --git a/src/main/java/com/example/sharemind/admin/application/AdminServiceImpl.java b/src/main/java/com/example/sharemind/admin/application/AdminServiceImpl.java index 101f56c2..d8700f29 100644 --- a/src/main/java/com/example/sharemind/admin/application/AdminServiceImpl.java +++ b/src/main/java/com/example/sharemind/admin/application/AdminServiceImpl.java @@ -6,7 +6,7 @@ import com.example.sharemind.admin.dto.response.InformationGetResponse; import com.example.sharemind.admin.dto.response.PaymentGetRefundWaitingResponse; import com.example.sharemind.admin.dto.response.PaymentGetSettlementOngoingResponse; -import com.example.sharemind.admin.dto.response.PostGetByIdResponse; +import com.example.sharemind.admin.dto.response.PostGetByUuidResponse; import com.example.sharemind.admin.dto.response.PostGetUnpaidPrivateResponse; import com.example.sharemind.chat.application.ChatService; import com.example.sharemind.chat.content.ChatStatus; @@ -40,6 +40,7 @@ import com.example.sharemind.post.domain.Post; import com.example.sharemind.post.exception.PostErrorCode; import com.example.sharemind.post.exception.PostException; +import java.util.UUID; import lombok.RequiredArgsConstructor; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.ValueOperations; @@ -210,15 +211,15 @@ public void updateCounselorPending(Long counselorId) { } @Override - public PostGetByIdResponse getPostByPostId(Long postId) { - Post post = postService.getPostByPostId(postId); - return PostGetByIdResponse.of(post); + public PostGetByUuidResponse getPostByPostUuid(UUID postUuid) { + Post post = postService.getPostByPostUuid(postUuid); + return PostGetByUuidResponse.of(post); } @Transactional @Override - public void deletePostByPostId(Long postId) { - Post post = postService.getPostByPostId(postId); + public void deletePostByPostUuid(UUID postUuid) { + Post post = postService.getPostByPostUuid(postUuid); post.updateIsActivatedFalse(); } From 616d1ee964d85593a15c642c95726cd6a3571ed9 Mon Sep 17 00:00:00 2001 From: letskuku Date: Mon, 22 Jul 2024 15:42:42 +0900 Subject: [PATCH 3/3] =?UTF-8?q?#228=20feat:=20post=20=EC=A1=B0=ED=9A=8C=20?= =?UTF-8?q?=EB=B0=8F=20=EC=82=AD=EC=A0=9C=20=EC=96=B4=EB=93=9C=EB=AF=BC=20?= =?UTF-8?q?=EA=B8=B0=EB=8A=A5=20uuid=EB=A1=9C=20=ED=95=A0=20=EC=88=98=20?= =?UTF-8?q?=EC=9E=88=EB=8F=84=EB=A1=9D=20api=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/presentation/AdminController.java | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/example/sharemind/admin/presentation/AdminController.java b/src/main/java/com/example/sharemind/admin/presentation/AdminController.java index 559bda59..80288e8e 100644 --- a/src/main/java/com/example/sharemind/admin/presentation/AdminController.java +++ b/src/main/java/com/example/sharemind/admin/presentation/AdminController.java @@ -7,7 +7,7 @@ import com.example.sharemind.admin.dto.response.InformationGetResponse; import com.example.sharemind.admin.dto.response.PaymentGetRefundWaitingResponse; import com.example.sharemind.admin.dto.response.PaymentGetSettlementOngoingResponse; -import com.example.sharemind.admin.dto.response.PostGetByIdResponse; +import com.example.sharemind.admin.dto.response.PostGetByUuidResponse; import com.example.sharemind.admin.dto.response.PostGetUnpaidPrivateResponse; import com.example.sharemind.counselor.dto.response.CounselorGetProfileResponse; import com.example.sharemind.global.exception.CustomExceptionResponse; @@ -19,6 +19,7 @@ import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; import io.swagger.v3.oas.annotations.tags.Tag; +import java.util.UUID; import lombok.RequiredArgsConstructor; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; @@ -260,11 +261,11 @@ public ResponseEntity updateCounselorPending(@PathVariable Long counselorI ) }) @Parameters({ - @Parameter(name = "postId", description = "조회할 공개상담 아이디") + @Parameter(name = "postUuid", description = "조회할 공개상담 아이디") }) - @GetMapping("/posts/{postId}") - public ResponseEntity getPostByPostId(@PathVariable Long postId) { - return ResponseEntity.ok(adminService.getPostByPostId(postId)); + @GetMapping("/posts/{postUuid}") + public ResponseEntity getPostByPostUuid(@PathVariable UUID postUuid) { + return ResponseEntity.ok(adminService.getPostByPostUuid(postUuid)); } @Operation(summary = "특정 공개상담 게시물 삭제", description = "특정 공개상담 게시물 비활성화 상태로 수정") @@ -276,11 +277,11 @@ public ResponseEntity getPostByPostId(@PathVariable Long po ) }) @Parameters({ - @Parameter(name = "postId", description = "삭제할 공개상담 아이디") + @Parameter(name = "postUuid", description = "삭제할 공개상담 아이디") }) - @DeleteMapping("/posts/{postId}") - public ResponseEntity deletePostByPostId(@PathVariable Long postId) { - adminService.deletePostByPostId(postId); + @DeleteMapping("/posts/{postUuid}") + public ResponseEntity deletePostByPostUuid(@PathVariable UUID postUuid) { + adminService.deletePostByPostUuid(postUuid); return ResponseEntity.ok().build(); }