From 818e3f622eebf47eb8c37a0692035cc9428d0b7a Mon Sep 17 00:00:00 2001 From: Yerin Lee <91695537+lxxyxin@users.noreply.github.com> Date: Fri, 30 Aug 2024 16:19:39 +0900 Subject: [PATCH 01/12] =?UTF-8?q?feat=20:=20=EC=97=90=EB=9F=AC=EC=BD=94?= =?UTF-8?q?=EB=93=9C=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/pickple/server/global/response/enums/ErrorCode.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/com/pickple/server/global/response/enums/ErrorCode.java b/src/main/java/com/pickple/server/global/response/enums/ErrorCode.java index e08ac98..ab468af 100644 --- a/src/main/java/com/pickple/server/global/response/enums/ErrorCode.java +++ b/src/main/java/com/pickple/server/global/response/enums/ErrorCode.java @@ -21,6 +21,7 @@ public enum ErrorCode { MISSING_IMAGE_URL(40009, HttpStatus.BAD_REQUEST, "필수 이미지가 없습니다."), DUPLICATION_REVIEW(40010, HttpStatus.BAD_REQUEST, "해당 사용자가 이미 작성한 리뷰가 존재합니다"), NO_SUBMISSION_FOUND_FOR_REVIEW(40011, HttpStatus.BAD_REQUEST, "리뷰를 작성할 수 있는 신청이 없습니다"), + NOT_AUTHOR(40012, HttpStatus.BAD_REQUEST, "해당 댓글의 작성자가 아닙니다."), // 401 Unauthorized ACCESS_TOKEN_EXPIRED(40100, HttpStatus.UNAUTHORIZED, "액세스 토큰이 만료되었습니다."), @@ -41,6 +42,7 @@ public enum ErrorCode { MOIM_SUBMISSION_NOT_FOUND(40406, HttpStatus.NOT_FOUND, "해당 모임에 신청한 내역이 없습니다."), SUBMITTER_NOT_FOUND(40408, HttpStatus.NOT_FOUND, "존재하지 않는 호스트 승인 신청입니다."), NOTICE_NOT_FOUND(40409, HttpStatus.NOT_FOUND, "존재하지 않는 공지사항입니다."), + COMMENT_NOT_FOUND(40410, HttpStatus.NOT_FOUND, "존재하지 않는 댓글입니다."), // 405 Method Not Allowed Error METHOD_NOT_ALLOWED(40500, HttpStatus.METHOD_NOT_ALLOWED, "지원하지 않는 메소드입니다."), From d1382e3d342fa617e36fece24caf4f5ce244e0ba Mon Sep 17 00:00:00 2001 From: Yerin Lee <91695537+lxxyxin@users.noreply.github.com> Date: Fri, 30 Aug 2024 16:19:43 +0900 Subject: [PATCH 02/12] =?UTF-8?q?feat=20:=20=EC=84=B1=EA=B3=B5=EC=BD=94?= =?UTF-8?q?=EB=93=9C=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/pickple/server/global/response/enums/SuccessCode.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/com/pickple/server/global/response/enums/SuccessCode.java b/src/main/java/com/pickple/server/global/response/enums/SuccessCode.java index e3ebc8e..815f20a 100644 --- a/src/main/java/com/pickple/server/global/response/enums/SuccessCode.java +++ b/src/main/java/com/pickple/server/global/response/enums/SuccessCode.java @@ -44,6 +44,7 @@ public enum SuccessCode { COMMENT_LIST_BY_NOTICE_GET_SUCCESS(20032, HttpStatus.OK, "공지사항에 해당하는 댓글 전체 조회 성공"), MOIM_SUBMISSION_ALL_GET_SUCCESS(20033, HttpStatus.OK, "모임 참여 신청 전체 조회 성공"), GUEST_PROFILE_UPDATE_SUCCESS(20034, HttpStatus.OK, "게스트 프로필 수정 성공"), + COMMENT_DELETE_SUCCESS(20035, HttpStatus.OK, "공지사항 댓글 삭제 성공"), // 201 Created MOIM_CREATE_SUCCESS(20100, HttpStatus.CREATED, "모임 개설 성공"), From ed51af65ceb219509436477a0ee6136790f19965 Mon Sep 17 00:00:00 2001 From: Yerin Lee <91695537+lxxyxin@users.noreply.github.com> Date: Fri, 30 Aug 2024 16:19:55 +0900 Subject: [PATCH 03/12] =?UTF-8?q?feat=20:=20controller=20=EA=B5=AC?= =?UTF-8?q?=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../server/api/comment/controller/CommentController.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main/java/com/pickple/server/api/comment/controller/CommentController.java b/src/main/java/com/pickple/server/api/comment/controller/CommentController.java index 7813596..ff62f8c 100644 --- a/src/main/java/com/pickple/server/api/comment/controller/CommentController.java +++ b/src/main/java/com/pickple/server/api/comment/controller/CommentController.java @@ -10,6 +10,7 @@ import jakarta.validation.Valid; import java.util.List; import lombok.RequiredArgsConstructor; +import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; @@ -38,4 +39,12 @@ public ApiResponseDto> getCommentListByNotice(@PathVari return ApiResponseDto.success(SuccessCode.COMMENT_LIST_BY_NOTICE_GET_SUCCESS, commentQueryService.getCommentListByNotice(noticeId)); } + + @DeleteMapping("/v2/notice/{noticeId}/comment/{commentId}") + public ApiResponseDto deleteComment(@UserId Long userId, + @PathVariable final Long noticeId, + @PathVariable final Long commentId) { + commentCommandService.deleteComment(userId, noticeId, commentId); + return ApiResponseDto.success(SuccessCode.COMMENT_DELETE_SUCCESS); + } } From 7450e1d7aa263de4dfec94bf12e203823588cc85 Mon Sep 17 00:00:00 2001 From: Yerin Lee <91695537+lxxyxin@users.noreply.github.com> Date: Fri, 30 Aug 2024 16:20:01 +0900 Subject: [PATCH 04/12] =?UTF-8?q?feat=20:=20service=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/comment/service/CommentCommandService.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/main/java/com/pickple/server/api/comment/service/CommentCommandService.java b/src/main/java/com/pickple/server/api/comment/service/CommentCommandService.java index 679652c..ef20653 100644 --- a/src/main/java/com/pickple/server/api/comment/service/CommentCommandService.java +++ b/src/main/java/com/pickple/server/api/comment/service/CommentCommandService.java @@ -7,6 +7,8 @@ import com.pickple.server.api.notice.repository.NoticeRepository; import com.pickple.server.api.user.domain.User; import com.pickple.server.api.user.repository.UserRepository; +import com.pickple.server.global.exception.CustomException; +import com.pickple.server.global.response.enums.ErrorCode; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -34,4 +36,15 @@ public void createComment(Long userId, commentRepository.save(comment); } + + public void deleteComment(Long userId, Long noticeId, Long commentId) { + Notice notice = noticeRepository.findNoticeByIdOrThrow(noticeId); + Comment comment = commentRepository.findCommentByIdOrThrow(commentId); + + if (comment.getCommenter().getId().equals(userId)) { + commentRepository.delete(comment); + } else { + throw new CustomException(ErrorCode.NOT_AUTHOR); + } + } } From e9fe0e63804ceeab424ac0b35e7d7351250ec8f8 Mon Sep 17 00:00:00 2001 From: Yerin Lee <91695537+lxxyxin@users.noreply.github.com> Date: Fri, 30 Aug 2024 16:20:09 +0900 Subject: [PATCH 05/12] =?UTF-8?q?feat=20:=20repository=20=EA=B5=AC?= =?UTF-8?q?=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/comment/repository/CommentRepository.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main/java/com/pickple/server/api/comment/repository/CommentRepository.java b/src/main/java/com/pickple/server/api/comment/repository/CommentRepository.java index 5f8b396..0190fc8 100644 --- a/src/main/java/com/pickple/server/api/comment/repository/CommentRepository.java +++ b/src/main/java/com/pickple/server/api/comment/repository/CommentRepository.java @@ -1,7 +1,10 @@ package com.pickple.server.api.comment.repository; import com.pickple.server.api.comment.domain.Comment; +import com.pickple.server.global.exception.CustomException; +import com.pickple.server.global.response.enums.ErrorCode; import java.util.List; +import java.util.Optional; import org.springframework.data.jpa.repository.JpaRepository; public interface CommentRepository extends JpaRepository { @@ -9,4 +12,11 @@ public interface CommentRepository extends JpaRepository { List findCommentsByNoticeId(Long noticeId); int countCommentByNoticeId(Long noticeId); + + Optional findCommentById(Long id); + + default Comment findCommentByIdOrThrow(Long id) { + return findCommentById(id) + .orElseThrow(() -> new CustomException(ErrorCode.COMMENT_NOT_FOUND)); + } } From 896a195aa1e6c2ba677424e92f1257562055de45 Mon Sep 17 00:00:00 2001 From: Yerin Lee <91695537+lxxyxin@users.noreply.github.com> Date: Sun, 1 Sep 2024 16:19:46 +0900 Subject: [PATCH 06/12] =?UTF-8?q?feat=20:=20=EC=BD=94=EB=93=9C=EB=A6=AC?= =?UTF-8?q?=EB=B7=B0=20=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../comment/controller/CommentControllerDocs.java | 14 ++++++++++++++ .../server/global/response/enums/SuccessCode.java | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/pickple/server/api/comment/controller/CommentControllerDocs.java b/src/main/java/com/pickple/server/api/comment/controller/CommentControllerDocs.java index aa02749..0042727 100644 --- a/src/main/java/com/pickple/server/api/comment/controller/CommentControllerDocs.java +++ b/src/main/java/com/pickple/server/api/comment/controller/CommentControllerDocs.java @@ -44,4 +44,18 @@ ApiResponseDto createComment( ApiResponseDto> getCommentListByNotice( @PathVariable Long noticeId ); + + @Operation(summary = "공지사항 댓글 삭제") + @ApiResponses( + value = { + @ApiResponse(responseCode = "20036", description = "공지사항 댓글 삭제 성공"), + @ApiResponse(responseCode = "40409", description = "존재하지 않는 공지사항입니다."), + @ApiResponse(responseCode = "40410", description = "존재하지 않는 댓글입니다.") + } + ) + ApiResponseDto deleteComment( + @UserId Long userId, + @PathVariable final Long noticeId, + @PathVariable final Long commentId + ); } diff --git a/src/main/java/com/pickple/server/global/response/enums/SuccessCode.java b/src/main/java/com/pickple/server/global/response/enums/SuccessCode.java index 815f20a..640ce90 100644 --- a/src/main/java/com/pickple/server/global/response/enums/SuccessCode.java +++ b/src/main/java/com/pickple/server/global/response/enums/SuccessCode.java @@ -44,7 +44,7 @@ public enum SuccessCode { COMMENT_LIST_BY_NOTICE_GET_SUCCESS(20032, HttpStatus.OK, "공지사항에 해당하는 댓글 전체 조회 성공"), MOIM_SUBMISSION_ALL_GET_SUCCESS(20033, HttpStatus.OK, "모임 참여 신청 전체 조회 성공"), GUEST_PROFILE_UPDATE_SUCCESS(20034, HttpStatus.OK, "게스트 프로필 수정 성공"), - COMMENT_DELETE_SUCCESS(20035, HttpStatus.OK, "공지사항 댓글 삭제 성공"), + COMMENT_DELETE_SUCCESS(20036, HttpStatus.OK, "공지사항 댓글 삭제 성공"), // 201 Created MOIM_CREATE_SUCCESS(20100, HttpStatus.CREATED, "모임 개설 성공"), From e2910ae184c81f967a4bcff6dcea9a08d9be0d8f Mon Sep 17 00:00:00 2001 From: Yerin Lee <91695537+lxxyxin@users.noreply.github.com> Date: Sun, 1 Sep 2024 16:23:24 +0900 Subject: [PATCH 07/12] =?UTF-8?q?docs=20:=20swagger=EC=97=90=20=EC=96=B4?= =?UTF-8?q?=EB=85=B8=ED=85=8C=EC=9D=B4=EC=85=98=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../server/api/comment/controller/CommentControllerDocs.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/com/pickple/server/api/comment/controller/CommentControllerDocs.java b/src/main/java/com/pickple/server/api/comment/controller/CommentControllerDocs.java index 0042727..4b2dfd5 100644 --- a/src/main/java/com/pickple/server/api/comment/controller/CommentControllerDocs.java +++ b/src/main/java/com/pickple/server/api/comment/controller/CommentControllerDocs.java @@ -54,6 +54,7 @@ ApiResponseDto> getCommentListByNotice( } ) ApiResponseDto deleteComment( + @Parameter(schema = @Schema(implementation = String.class), in = ParameterIn.PATH) @UserId Long userId, @PathVariable final Long noticeId, @PathVariable final Long commentId From 67702e600ee8d5517fad8e57596022736a33525e Mon Sep 17 00:00:00 2001 From: bo-ram-bo-ram Date: Sun, 1 Sep 2024 16:54:43 +0900 Subject: [PATCH 08/12] =?UTF-8?q?hotfix=20:=20ci=20=EC=97=90=EB=9F=AC=20?= =?UTF-8?q?=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../server/api/review/Service/ReviewQueryService.java | 5 +++-- .../server/api/review/controller/ReviewController.java | 1 + .../server/api/review/controller/ReviewControllerDocs.java | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/pickple/server/api/review/Service/ReviewQueryService.java b/src/main/java/com/pickple/server/api/review/Service/ReviewQueryService.java index 3791255..df26ed9 100644 --- a/src/main/java/com/pickple/server/api/review/Service/ReviewQueryService.java +++ b/src/main/java/com/pickple/server/api/review/Service/ReviewQueryService.java @@ -1,11 +1,12 @@ package com.pickple.server.api.review.Service; -import com.pickple.server.api.review.domain.Review; import com.pickple.server.api.moim.domain.Moim; import com.pickple.server.api.moim.repository.MoimRepository; +import com.pickple.server.api.review.domain.Review; import com.pickple.server.api.review.domain.enums.HostTag; import com.pickple.server.api.review.domain.enums.MoimTag; import com.pickple.server.api.review.dto.response.ReviewListGetByHostResponse; +import com.pickple.server.api.review.dto.response.ReviewListGetByMoimResponse; import com.pickple.server.api.review.dto.response.TagListGetResponse; import com.pickple.server.api.review.repository.ReviewRepository; import com.pickple.server.global.util.DateTimeUtil; @@ -48,7 +49,7 @@ public List getReviewListByMoim(Long moimId) { .date(DateTimeUtil.refineDateAndTime(review.getCreatedAt())) .build()) .collect(Collectors.toList()); - } + } public List getReviewListByHost(Long hostId) { List moimList = moimRepository.findMoimByHostId(hostId); diff --git a/src/main/java/com/pickple/server/api/review/controller/ReviewController.java b/src/main/java/com/pickple/server/api/review/controller/ReviewController.java index cee9fcb..24ebe8a 100644 --- a/src/main/java/com/pickple/server/api/review/controller/ReviewController.java +++ b/src/main/java/com/pickple/server/api/review/controller/ReviewController.java @@ -3,6 +3,7 @@ import com.pickple.server.api.review.Service.ReviewCommandService; import com.pickple.server.api.review.Service.ReviewQueryService; import com.pickple.server.api.review.dto.request.ReviewCreateReqeust; +import com.pickple.server.api.review.dto.response.ReviewListGetByHostResponse; import com.pickple.server.api.review.dto.response.ReviewListGetByMoimResponse; import com.pickple.server.api.review.dto.response.TagListGetResponse; import com.pickple.server.global.common.annotation.GuestId; diff --git a/src/main/java/com/pickple/server/api/review/controller/ReviewControllerDocs.java b/src/main/java/com/pickple/server/api/review/controller/ReviewControllerDocs.java index 113b601..00aee5b 100644 --- a/src/main/java/com/pickple/server/api/review/controller/ReviewControllerDocs.java +++ b/src/main/java/com/pickple/server/api/review/controller/ReviewControllerDocs.java @@ -1,6 +1,7 @@ package com.pickple.server.api.review.controller; import com.pickple.server.api.review.dto.request.ReviewCreateReqeust; +import com.pickple.server.api.review.dto.response.ReviewListGetByHostResponse; import com.pickple.server.api.review.dto.response.ReviewListGetByMoimResponse; import com.pickple.server.api.review.dto.response.TagListGetResponse; import com.pickple.server.global.common.annotation.GuestId; @@ -48,7 +49,7 @@ ApiResponseDto createReview( @Operation(summary = "모임에 해당하는 리뷰 조회") @ApiResponses( value = { - @ApiResponse(responseCode = "20038", description = "모임에 해당하는 리뷰 조회 성공"), + @ApiResponse(responseCode = "20037", description = "모임에 해당하는 리뷰 조회 성공"), @ApiResponse(responseCode = "40404", description = "존재하지 않는 모임입니다.") } ) From f694c5ae5f6f6cc496476c2103c2cdd3a346f624 Mon Sep 17 00:00:00 2001 From: boram <128011308+bo-ram-bo-ram@users.noreply.github.com> Date: Mon, 2 Sep 2024 14:01:08 +0900 Subject: [PATCH 09/12] =?UTF-8?q?docs=20:=20=EB=8C=80=ED=91=9C=20=EC=9D=B4?= =?UTF-8?q?=EB=AF=B8=EC=A7=80=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index ebc588b..6cd20d2 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,5 @@ # ❕ PICK!PLE -![픽플이미지](https://github.com/user-attachments/assets/7083d8e6-5ac2-4465-8706-b342feddb073) - +![image](https://github.com/user-attachments/assets/f21646ab-53bc-4fc3-8d3a-80df8f1ff2fb) 내가 PICK!한 바로 '그 사람'과 함께하는 클래스 모임 From 112825a0f615d716d761d3cf0c4c6e9a833a6c3b Mon Sep 17 00:00:00 2001 From: Yerin Lee <91695537+lxxyxin@users.noreply.github.com> Date: Mon, 2 Sep 2024 22:34:15 +0900 Subject: [PATCH 10/12] =?UTF-8?q?fix=20:=20=ED=95=9C=20=EC=8B=9C=EA=B0=84?= =?UTF-8?q?=EB=A7=88=EB=8B=A4=20=EC=8A=A4=EC=BC=80=EC=A4=84=EB=9F=AC=20?= =?UTF-8?q?=EB=8F=8C=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/pickple/server/api/moim/service/MoimCommandService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/pickple/server/api/moim/service/MoimCommandService.java b/src/main/java/com/pickple/server/api/moim/service/MoimCommandService.java index b18281e..fd85e9e 100644 --- a/src/main/java/com/pickple/server/api/moim/service/MoimCommandService.java +++ b/src/main/java/com/pickple/server/api/moim/service/MoimCommandService.java @@ -48,7 +48,7 @@ public MoimCreateResponse createMoim(Long hostId, MoimCreateRequest request) { } //1분마다 실행 - @Scheduled(cron = "0 0/1 * * * *", zone = "Asia/Seoul") + @Scheduled(cron = "0 0 0/1 * * *", zone = "Asia/Seoul") public void changeMoimStateOfDday() { LocalDate date = LocalDate.now(); String formattedDate = date.format(DateTimeFormatter.ofPattern("yyyy.MM.dd")); From fba310059b1fb328bdfea02052a9c73f77332609 Mon Sep 17 00:00:00 2001 From: Yerin Lee <91695537+lxxyxin@users.noreply.github.com> Date: Mon, 2 Sep 2024 22:44:44 +0900 Subject: [PATCH 11/12] =?UTF-8?q?refactor=20:=20dateformat=20=EB=A6=AC?= =?UTF-8?q?=ED=8C=A9=ED=86=A0=EB=A7=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pickple/server/api/moim/service/MoimCommandService.java | 4 ++-- src/main/java/com/pickple/server/global/util/DateUtil.java | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/pickple/server/api/moim/service/MoimCommandService.java b/src/main/java/com/pickple/server/api/moim/service/MoimCommandService.java index fd85e9e..02c5906 100644 --- a/src/main/java/com/pickple/server/api/moim/service/MoimCommandService.java +++ b/src/main/java/com/pickple/server/api/moim/service/MoimCommandService.java @@ -7,9 +7,9 @@ import com.pickple.server.api.moim.dto.request.MoimCreateRequest; import com.pickple.server.api.moim.dto.response.MoimCreateResponse; import com.pickple.server.api.moim.repository.MoimRepository; +import com.pickple.server.global.util.DateUtil; import java.time.LocalDate; import java.time.LocalTime; -import java.time.format.DateTimeFormatter; import java.util.List; import lombok.RequiredArgsConstructor; import org.springframework.scheduling.annotation.Scheduled; @@ -51,7 +51,7 @@ public MoimCreateResponse createMoim(Long hostId, MoimCreateRequest request) { @Scheduled(cron = "0 0 0/1 * * *", zone = "Asia/Seoul") public void changeMoimStateOfDday() { LocalDate date = LocalDate.now(); - String formattedDate = date.format(DateTimeFormatter.ofPattern("yyyy.MM.dd")); + String formattedDate = DateUtil.refineDate(date); List moimList = moimRepository.findByDate(formattedDate); for (Moim moim : moimList) { diff --git a/src/main/java/com/pickple/server/global/util/DateUtil.java b/src/main/java/com/pickple/server/global/util/DateUtil.java index aba0cad..ee4e483 100644 --- a/src/main/java/com/pickple/server/global/util/DateUtil.java +++ b/src/main/java/com/pickple/server/global/util/DateUtil.java @@ -1,6 +1,7 @@ package com.pickple.server.global.util; import java.time.LocalDate; +import java.time.format.DateTimeFormatter; import java.time.temporal.ChronoUnit; public class DateUtil { @@ -16,4 +17,9 @@ public static int calculateCompletedDay(LocalDate date) { int day = (int) ChronoUnit.DAYS.between(today, date); return day; } + + public static String refineDate(LocalDate localDate) { + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy.MM.dd"); + return localDate.format(formatter); + } } From e3dd5f84007551d3230948b62cb50d0877ade9f6 Mon Sep 17 00:00:00 2001 From: Yerin Lee <91695537+lxxyxin@users.noreply.github.com> Date: Mon, 2 Sep 2024 23:37:55 +0900 Subject: [PATCH 12/12] =?UTF-8?q?chore=20:=20=EC=A3=BC=EC=84=9D=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 --- .../com/pickple/server/api/moim/service/MoimCommandService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/pickple/server/api/moim/service/MoimCommandService.java b/src/main/java/com/pickple/server/api/moim/service/MoimCommandService.java index 02c5906..7b2cd13 100644 --- a/src/main/java/com/pickple/server/api/moim/service/MoimCommandService.java +++ b/src/main/java/com/pickple/server/api/moim/service/MoimCommandService.java @@ -47,7 +47,7 @@ public MoimCreateResponse createMoim(Long hostId, MoimCreateRequest request) { .build(); } - //1분마다 실행 + //정각마다 실행 @Scheduled(cron = "0 0 0/1 * * *", zone = "Asia/Seoul") public void changeMoimStateOfDday() { LocalDate date = LocalDate.now();