From 62aad15c18cafef961c59df666e328396c4f79c8 Mon Sep 17 00:00:00 2001 From: HyeonjaeKwon Date: Fri, 6 Oct 2023 17:32:50 +0900 Subject: [PATCH 01/45] =?UTF-8?q?feat:=20=ED=94=BC=EB=93=9C=20=EB=A3=A8?= =?UTF-8?q?=ED=8A=B8=20=EB=8C=93=EA=B8=80=20=EC=9E=91=EC=84=B1=EC=8B=9C=20?= =?UTF-8?q?=ED=94=BC=EB=93=9C=EC=9D=98=20=EC=9E=91=EC=84=B1=EC=9E=90?= =?UTF-8?q?=EC=97=90=EA=B2=8C=20=EC=83=88=EB=A1=9C=EC=9A=B4=20=EB=8C=93?= =?UTF-8?q?=EA=B8=80=20=EC=95=8C=EB=A6=BC=20=EA=B8=B0=EB=8A=A5=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 #690 --- .../application/CommentCommandService.java | 10 +++- .../CommentNotificationEvent.java | 16 +++++++ .../event_publisher/EventPublisher.java | 12 ++++- ...entCommandServiceEventIntegrationTest.java | 38 +++++++++++++++ .../event_publisher/EventPublisherTest.java | 47 +++++++++++++++++-- 5 files changed, 115 insertions(+), 8 deletions(-) diff --git a/backend/emm-sale/src/main/java/com/emmsale/comment/application/CommentCommandService.java b/backend/emm-sale/src/main/java/com/emmsale/comment/application/CommentCommandService.java index 6433a234a..4e90d4d0d 100644 --- a/backend/emm-sale/src/main/java/com/emmsale/comment/application/CommentCommandService.java +++ b/backend/emm-sale/src/main/java/com/emmsale/comment/application/CommentCommandService.java @@ -50,11 +50,19 @@ public CommentResponse create( final Comment savedComment = commentRepository.save(comment); - eventPublisher.publish(savedComment, member); + publishEvent(savedComment, feed); return CommentResponse.from(savedComment); } + private void publishEvent(final Comment comment, final Feed feed) { + if (comment.getParent().isPresent()) { + eventPublisher.publish(comment); + return; + } + eventPublisher.publish(comment, feed.getWriter()); + } + private Comment findSavedComment(final Long commentId) { return commentRepository.findById(commentId) .orElseThrow(() -> new CommentException(NOT_FOUND_COMMENT)); diff --git a/backend/emm-sale/src/main/java/com/emmsale/event_publisher/CommentNotificationEvent.java b/backend/emm-sale/src/main/java/com/emmsale/event_publisher/CommentNotificationEvent.java index 7ab31dd44..41e71db9b 100644 --- a/backend/emm-sale/src/main/java/com/emmsale/event_publisher/CommentNotificationEvent.java +++ b/backend/emm-sale/src/main/java/com/emmsale/event_publisher/CommentNotificationEvent.java @@ -47,4 +47,20 @@ public static CommentNotificationEvent of(final Comment comment, final Comment t trigger.getParentIdOrSelfId() ); } + + public static CommentNotificationEvent of(final Comment comment, final Member receiver) { + final Member sender = comment.getMember(); + + return new CommentNotificationEvent( + receiver.getId(), + comment.getId(), + LocalDateTime.now(), + UPDATE_NOTIFICATION_COMMENT_TYPE, + comment.getContent(), + sender.getName(), + sender.getImageUrl(), + comment.getFeed().getId(), + comment.getParentIdOrSelfId() + ); + } } diff --git a/backend/emm-sale/src/main/java/com/emmsale/event_publisher/EventPublisher.java b/backend/emm-sale/src/main/java/com/emmsale/event_publisher/EventPublisher.java index 741117877..2c78eb6d7 100644 --- a/backend/emm-sale/src/main/java/com/emmsale/event_publisher/EventPublisher.java +++ b/backend/emm-sale/src/main/java/com/emmsale/event_publisher/EventPublisher.java @@ -25,9 +25,11 @@ public class EventPublisher { private final MemberRepository memberRepository; private final CommentRepository commentRepository; - public void publish(final Comment trigger, final Member loginMember) { + public void publish(final Comment trigger) { + final Member sender = trigger.getMember(); + final Set notificationCommentCandidates = trigger.getParent() - .map(parent -> findRelatedCommentsExcludingLoginMember(loginMember, parent)) + .map(parent -> findRelatedCommentsExcludingLoginMember(sender, parent)) .orElse(Collections.emptySet()); notificationCommentCandidates.stream() @@ -35,6 +37,12 @@ public void publish(final Comment trigger, final Member loginMember) { .forEach(applicationEventPublisher::publishEvent); } + public void publish(final Comment comment, final Member receiver) { + if (comment.isNotOwner(receiver.getId())) { + applicationEventPublisher.publishEvent(CommentNotificationEvent.of(comment, receiver)); + } + } + private Set findRelatedCommentsExcludingLoginMember( final Member loginMember, final Comment parent diff --git a/backend/emm-sale/src/test/java/com/emmsale/comment/application/CommentCommandServiceEventIntegrationTest.java b/backend/emm-sale/src/test/java/com/emmsale/comment/application/CommentCommandServiceEventIntegrationTest.java index ca257f068..5ca68d53b 100644 --- a/backend/emm-sale/src/test/java/com/emmsale/comment/application/CommentCommandServiceEventIntegrationTest.java +++ b/backend/emm-sale/src/test/java/com/emmsale/comment/application/CommentCommandServiceEventIntegrationTest.java @@ -98,4 +98,42 @@ void test_publish_comment_error_firebase() throws Exception { () -> assertEquals(1, notificationRepository.findAll().size()) ); } + + @Test + @DisplayName("publish(Comment, Member) : 피드에 최상위 부모 댓글이 달리면 피드의 작성자에게 알림이 발송된다.") + void test_publish_comment_to_feed_writer() { + //given + final CommentAddRequest 부모_댓글 = new CommentAddRequest("내용1", feed.getId(), null); + + doNothing().when(firebaseCloudMessageClient).sendMessageTo(any(Notification.class), anyLong()); + + //when + commentCommandService.create(부모_댓글, 댓글_작성자1); + + //then + assertAll( + () -> verify(firebaseCloudMessageClient, times(1)) + .sendMessageTo(any(Notification.class), anyLong()), + () -> assertEquals(1, notificationRepository.findAll().size()) + ); + } + + @Test + @DisplayName("publish(Comment, Member) : 피드에 최상위 부모 댓글 작성자와 피드 작성자가 동일할 경우 알림을 발행하지 않는다.") + void test_do_not_publish_if_comment_writer_equals_feed_writer() { + //given + final CommentAddRequest 부모_댓글 = new CommentAddRequest("내용1", feed.getId(), null); + + doNothing().when(firebaseCloudMessageClient).sendMessageTo(any(Notification.class), anyLong()); + + //when + commentCommandService.create(부모_댓글, feed.getWriter()); + + //then + assertAll( + () -> verify(firebaseCloudMessageClient, times(0)) + .sendMessageTo(any(Notification.class), anyLong()), + () -> assertEquals(0, notificationRepository.findAll().size()) + ); + } } diff --git a/backend/emm-sale/src/test/java/com/emmsale/event_publisher/EventPublisherTest.java b/backend/emm-sale/src/test/java/com/emmsale/event_publisher/EventPublisherTest.java index 01622e6d1..5cb32927c 100644 --- a/backend/emm-sale/src/test/java/com/emmsale/event_publisher/EventPublisherTest.java +++ b/backend/emm-sale/src/test/java/com/emmsale/event_publisher/EventPublisherTest.java @@ -187,7 +187,7 @@ void test_publish_comment_parent_children() throws Exception { Comment.createChild(feed, 부모_댓글, 로그인_사용자, "내용4")); //when - eventPublisher.publish(알림_트리거_댓글, 로그인_사용자); + eventPublisher.publish(알림_트리거_댓글); //then verify(applicationEventPublisher, times(2)) @@ -212,7 +212,7 @@ void test_publish_comment_parent_children_not_notification() throws Exception { ); //when - eventPublisher.publish(알림_트리거_댓글, 댓글_작성자1); + eventPublisher.publish(알림_트리거_댓글); //then verify(applicationEventPublisher, times(0)) @@ -231,7 +231,7 @@ void test_publish_root_comment_no_notification() throws Exception { ); //when - eventPublisher.publish(알림_트리거_댓글, 댓글_작성자1); + eventPublisher.publish(알림_트리거_댓글); //then verify(applicationEventPublisher, times(0)) @@ -266,7 +266,7 @@ void test_publish_comment_not_notification_deletedComment() throws Exception { ); //when - eventPublisher.publish(알림_트리거_댓글, 로그인_사용자); + eventPublisher.publish(알림_트리거_댓글); //then verify(applicationEventPublisher, times(1)) @@ -301,7 +301,7 @@ void test_publish_comment_not_notification_deletedComment2() throws Exception { ); //when - eventPublisher.publish(알림_트리거_댓글, 로그인_사용자); + eventPublisher.publish(알림_트리거_댓글); //then verify(applicationEventPublisher, times(2)) @@ -337,4 +337,41 @@ void publishMessageEvent() { .usingRecursiveComparison() .isEqualTo(expectedEvent); } + + @Test + @DisplayName("publish(Comment, Member) : 피드에 ROOT 댓글이 작성되면 피드의 작성자에게 알림이 발송된다.") + void test_publish_to_feed_writer_when_root_comment_created() throws Exception { + //given + final Member 댓글_작성자1 = memberRepository.findById(1L).get(); + eventRepository.save(event); + feedRepository.save(feed); + final Comment 알림_트리거_댓글 = commentRepository.save( + Comment.createRoot(feed, 댓글_작성자1, "내용1") + ); + + //when + eventPublisher.publish(알림_트리거_댓글, feed.getWriter()); + + //then + verify(applicationEventPublisher, times(1)) + .publishEvent(any(NotificationEvent.class)); + } + + @Test + @DisplayName("publish(Comment, Member) : 피드 작성자와 피드의 ROOT 댓글 작성자가 동일할 경우 알림을 발송하지 않는다.") + void test_do_not_publish_notification_if_comment_writer_equals_feed_writer() throws Exception { + //given + eventRepository.save(event); + feedRepository.save(feed); + final Comment 알림_트리거_댓글 = commentRepository.save( + Comment.createRoot(feed, feed.getWriter(), "내용1") + ); + + //when + eventPublisher.publish(알림_트리거_댓글, feed.getWriter()); + + //then + verify(applicationEventPublisher, times(0)) + .publishEvent(any(EventNotificationEvent.class)); + } } From 9bbfe91c114eea2fadc9fb7ba99a6b4446c05023 Mon Sep 17 00:00:00 2001 From: hong-sile Date: Tue, 10 Oct 2023 15:40:51 +0900 Subject: [PATCH 02/45] =?UTF-8?q?fix:=20mutlipart=EC=97=90=20RequestPart?= =?UTF-8?q?=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #702 --- .../src/main/java/com/emmsale/member/api/MemberApi.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/emm-sale/src/main/java/com/emmsale/member/api/MemberApi.java b/backend/emm-sale/src/main/java/com/emmsale/member/api/MemberApi.java index 87e3243ad..abd757bbc 100644 --- a/backend/emm-sale/src/main/java/com/emmsale/member/api/MemberApi.java +++ b/backend/emm-sale/src/main/java/com/emmsale/member/api/MemberApi.java @@ -23,6 +23,7 @@ import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.multipart.MultipartFile; @@ -101,7 +102,7 @@ public ResponseEntity deleteMember( @PatchMapping("/members/{memberId}/profile") public ResponseEntity updateProfile( @PathVariable final Long memberId, - final MultipartFile image, + @RequestPart final MultipartFile image, final Member member ) { final String imageUrl = memberUpdateService.updateMemberProfile(image, memberId, member); From 9bb3190aca47d637fdb6683f45cddea37d33925a Mon Sep 17 00:00:00 2001 From: hong-sile Date: Tue, 10 Oct 2023 16:19:31 +0900 Subject: [PATCH 03/45] =?UTF-8?q?feat:=20=EC=84=9C=EB=B8=8C=EB=AA=A8?= =?UTF-8?q?=EB=93=88=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #702 --- backend/emm-sale/src/main/resources/kerdy-submodule | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/emm-sale/src/main/resources/kerdy-submodule b/backend/emm-sale/src/main/resources/kerdy-submodule index 31641131c..201498016 160000 --- a/backend/emm-sale/src/main/resources/kerdy-submodule +++ b/backend/emm-sale/src/main/resources/kerdy-submodule @@ -1 +1 @@ -Subproject commit 31641131cf5c6c28654418fd8ba2f110140a3e68 +Subproject commit 201498016c6f27f34972c92cf1699252e294033b From 3c01c5614fbeeac4b73f08be9bea2eb8e9f4a106 Mon Sep 17 00:00:00 2001 From: hong-sile Date: Tue, 10 Oct 2023 16:20:13 +0900 Subject: [PATCH 04/45] =?UTF-8?q?fix:=20bucket=EC=9D=B4=20=EC=95=84?= =?UTF-8?q?=EB=8B=8C=20cloudFront=EC=9D=98=20prefix=EB=A5=BC=20=EB=B6=99?= =?UTF-8?q?=EC=9D=B4=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 #702 --- .../java/com/emmsale/image/application/S3Client.java | 10 ++++++++-- .../com/emmsale/image/application/S3ClientTest.java | 5 +++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/backend/emm-sale/src/main/java/com/emmsale/image/application/S3Client.java b/backend/emm-sale/src/main/java/com/emmsale/image/application/S3Client.java index c42ad3bf5..84a97db2a 100644 --- a/backend/emm-sale/src/main/java/com/emmsale/image/application/S3Client.java +++ b/backend/emm-sale/src/main/java/com/emmsale/image/application/S3Client.java @@ -27,10 +27,16 @@ public class S3Client { private final String bucket; private final AmazonS3 amazonS3; + private final String cloudFrontPrefix; - public S3Client(@Value("${cloud.aws.s3.bucket}") final String bucket, final AmazonS3 amazonS3) { + public S3Client( + @Value("${cloud.aws.s3.bucket}") final String bucket, + @Value("${cloud.aws.cloudfront-prefix}") final String cloudFrontPrefix, + final AmazonS3 amazonS3 + ) { this.bucket = bucket; this.amazonS3 = amazonS3; + this.cloudFrontPrefix = cloudFrontPrefix; } public List uploadImages(final List multipartFiles) { @@ -88,6 +94,6 @@ public String convertImageUrl(final String imageName) { } public String convertImageName(final String imageUrl) { - return imageUrl.split(bucket + URL_DELIMITER, 2)[1]; + return imageUrl.split(cloudFrontPrefix + URL_DELIMITER, 2)[1]; } } diff --git a/backend/emm-sale/src/test/java/com/emmsale/image/application/S3ClientTest.java b/backend/emm-sale/src/test/java/com/emmsale/image/application/S3ClientTest.java index cf4a8c7d4..5ee6abd32 100644 --- a/backend/emm-sale/src/test/java/com/emmsale/image/application/S3ClientTest.java +++ b/backend/emm-sale/src/test/java/com/emmsale/image/application/S3ClientTest.java @@ -27,6 +27,7 @@ class S3ClientTest { private static final String TEST_BUCKET = "Test"; + private static final String CLOUD_FRONT_PREFIX = "cloudFrontPrefix"; private S3Client s3Client; private AmazonS3 mockingAmazonS3; @@ -34,7 +35,7 @@ class S3ClientTest { @BeforeEach void setUp() { mockingAmazonS3 = mock(AmazonS3.class); - s3Client = new S3Client(TEST_BUCKET, mockingAmazonS3); + s3Client = new S3Client(TEST_BUCKET, CLOUD_FRONT_PREFIX, mockingAmazonS3); } @Test @@ -103,7 +104,7 @@ void convertImageUrl() { @Test @DisplayName("convertImageName(): 이미지 이름을 imageName로 바꾼다.") void convertImageName() { - final String imageUrl = "Test/image.png"; + final String imageUrl = CLOUD_FRONT_PREFIX + "/image.png"; final String expected = "image.png"; final String actual = s3Client.convertImageName(imageUrl); From 7e929f18de74b51fa8a7775ed4075ef390441caa Mon Sep 17 00:00:00 2001 From: hong-sile Date: Tue, 10 Oct 2023 16:30:47 +0900 Subject: [PATCH 05/45] =?UTF-8?q?fix:=20=EC=9D=B4=EB=AF=B8=EC=A7=80URL?= =?UTF-8?q?=EB=A1=9C=20=EB=B0=94=EA=BF=80=20=EB=96=84=20cloudFrontPrefix?= =?UTF-8?q?=EB=A5=BC=20=EB=B6=99=EC=9D=B4=EB=8F=84=EB=A1=9D=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #702 --- .../java/com/emmsale/event/application/EventServiceTest.java | 1 - 1 file changed, 1 deletion(-) diff --git a/backend/emm-sale/src/test/java/com/emmsale/event/application/EventServiceTest.java b/backend/emm-sale/src/test/java/com/emmsale/event/application/EventServiceTest.java index 57d0e030a..09c8db074 100644 --- a/backend/emm-sale/src/test/java/com/emmsale/event/application/EventServiceTest.java +++ b/backend/emm-sale/src/test/java/com/emmsale/event/application/EventServiceTest.java @@ -90,7 +90,6 @@ class EventServiceTest extends ServiceIntegrationTestHelper { private static final EventResponse 구름톤 = new EventResponse(null, "구름톤", null, null, null, null, List.of(), null, EventMode.ONLINE.getValue(), PaymentType.PAID.getValue()); - private static final LocalDate TODAY = LocalDate.of(2023, 7, 21); @Autowired private EventService eventService; From c720024cbd3a3abcceca1d9108cc626ed94bd4fb Mon Sep 17 00:00:00 2001 From: hong-sile Date: Tue, 10 Oct 2023 16:34:45 +0900 Subject: [PATCH 06/45] =?UTF-8?q?fix:=20=EC=9D=B4=EB=AF=B8=EC=A7=80URL?= =?UTF-8?q?=EB=A1=9C=20=EB=B0=94=EA=BF=80=20=EB=96=84=20cloudFrontPrefix?= =?UTF-8?q?=EB=A5=BC=20=EB=B6=99=EC=9D=B4=EB=8F=84=EB=A1=9D=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #702 --- .../src/main/java/com/emmsale/image/application/S3Client.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/emm-sale/src/main/java/com/emmsale/image/application/S3Client.java b/backend/emm-sale/src/main/java/com/emmsale/image/application/S3Client.java index 84a97db2a..3ceb06e5f 100644 --- a/backend/emm-sale/src/main/java/com/emmsale/image/application/S3Client.java +++ b/backend/emm-sale/src/main/java/com/emmsale/image/application/S3Client.java @@ -90,7 +90,7 @@ public void deleteImages(final List fileNames) { } public String convertImageUrl(final String imageName) { - return String.join(URL_DELIMITER, bucket, imageName); + return String.join(URL_DELIMITER, cloudFrontPrefix, imageName); } public String convertImageName(final String imageUrl) { From 6a75fbbab78f013a103159ac5e24ce546fe338e0 Mon Sep 17 00:00:00 2001 From: hong-sile Date: Tue, 10 Oct 2023 16:41:15 +0900 Subject: [PATCH 07/45] =?UTF-8?q?test:=20=ED=85=8C=EC=8A=A4=ED=8A=B8=20?= =?UTF-8?q?=EC=98=A4=EB=A5=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #702 --- .../test/java/com/emmsale/image/application/S3ClientTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/emm-sale/src/test/java/com/emmsale/image/application/S3ClientTest.java b/backend/emm-sale/src/test/java/com/emmsale/image/application/S3ClientTest.java index 5ee6abd32..81d3ec22b 100644 --- a/backend/emm-sale/src/test/java/com/emmsale/image/application/S3ClientTest.java +++ b/backend/emm-sale/src/test/java/com/emmsale/image/application/S3ClientTest.java @@ -93,7 +93,7 @@ void deleteImages_success() { @DisplayName("convertImageUrl(): 이미지 이름을 imageUrl로 바꾼다.") void convertImageUrl() { final String imageName = "image.png"; - final String expected = "Test/image.png"; + final String expected = CLOUD_FRONT_PREFIX + "/image.png"; final String actual = s3Client.convertImageUrl(imageName); From 3f7f8900534b7a393ce5248dfa1fb5623b777fdc Mon Sep 17 00:00:00 2001 From: amaran-th Date: Tue, 10 Oct 2023 17:47:19 +0900 Subject: [PATCH 08/45] =?UTF-8?q?feat:=20=ED=96=89=EC=82=AC=20=EB=AA=A9?= =?UTF-8?q?=EB=A1=9D=20=EC=A1=B0=ED=9A=8C=20API=EC=9D=98=20=EC=B9=B4?= =?UTF-8?q?=ED=85=8C=EA=B3=A0=EB=A6=AC=EB=A5=BC=20Optional=20=EC=A1=B0?= =?UTF-8?q?=EA=B1=B4=EC=9C=BC=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #704 --- .../java/com/emmsale/event/api/EventApi.java | 2 +- .../event/application/EventService.java | 16 ++++++++-- .../event/application/EventServiceTest.java | 30 +++++++++++++++---- 3 files changed, 39 insertions(+), 9 deletions(-) diff --git a/backend/emm-sale/src/main/java/com/emmsale/event/api/EventApi.java b/backend/emm-sale/src/main/java/com/emmsale/event/api/EventApi.java index ddfffd5fe..2b2887acd 100644 --- a/backend/emm-sale/src/main/java/com/emmsale/event/api/EventApi.java +++ b/backend/emm-sale/src/main/java/com/emmsale/event/api/EventApi.java @@ -39,7 +39,7 @@ public ResponseEntity findEventById(@PathVariable final Lon @GetMapping public ResponseEntity> findEvents( - @RequestParam final EventType category, + @RequestParam(required = false) final EventType category, @RequestParam(name = "start_date", required = false) final String startDate, @RequestParam(name = "end_date", required = false) final String endDate, @RequestParam(required = false) final List tags, diff --git a/backend/emm-sale/src/main/java/com/emmsale/event/application/EventService.java b/backend/emm-sale/src/main/java/com/emmsale/event/application/EventService.java index 1395d849c..9046f580c 100644 --- a/backend/emm-sale/src/main/java/com/emmsale/event/application/EventService.java +++ b/backend/emm-sale/src/main/java/com/emmsale/event/application/EventService.java @@ -94,8 +94,8 @@ private List extractInformationImages(final List imageUrls) { public List findEvents(final EventType category, final LocalDate nowDate, final String startDate, final String endDate, final List tagNames, final List statuses, final String keyword) { - Specification spec = Specification.where(filterByCategory(category)); - + Specification spec = (root, query, criteriaBuilder) -> null; + spec = filterByCategoryIfExist(category, spec); spec = filterByTagIfExist(tagNames, spec); spec = filterByDateIfExist(startDate, endDate, spec); spec = filterByKeywordIfExist(keyword, spec); @@ -108,6 +108,18 @@ public List findEvents(final EventType category, return filterByStatuses(statuses, eventsForEventStatus, makeImageUrlPerEventId(events)); } + private Specification filterByCategoryIfExist(final EventType category, + Specification spec) { + if (isExistCategory(category)) { + spec = spec.and(filterByCategory(category)); + } + return spec; + } + + private boolean isExistCategory(final EventType category) { + return category != null; + } + private Specification filterByTagIfExist(final List tagNames, Specification spec) { if (isExistTagNames(tagNames)) { diff --git a/backend/emm-sale/src/test/java/com/emmsale/event/application/EventServiceTest.java b/backend/emm-sale/src/test/java/com/emmsale/event/application/EventServiceTest.java index 57d0e030a..cc0866882 100644 --- a/backend/emm-sale/src/test/java/com/emmsale/event/application/EventServiceTest.java +++ b/backend/emm-sale/src/test/java/com/emmsale/event/application/EventServiceTest.java @@ -242,6 +242,24 @@ void fail_EventNotFoundException() { @DisplayName("findEvents() : 행사 목록 조회") class findEvents { + @Test + @DisplayName("2023년 7월 21일에 행사를 조회하면, 모든 행사 목록을 조회할 수 있다.") + void findEvents_all() { + // given + final List expectedEvents = List.of(인프콘_2023, 웹_컨퍼런스, 구름톤, AI_컨퍼런스, 모바일_컨퍼런스, + 안드로이드_컨퍼런스, AI_아이디어_공모전); + + // when + final List actualEvents = eventService.findEvents(null, TODAY, + null, null, null, null, null); + + // then + assertThat(actualEvents) + .usingRecursiveComparison() + .comparingOnlyFields("name", "status", "applyStatus", "imageUrl") + .isEqualTo(expectedEvents); + } + @Test @DisplayName("2023년 7월 21일에 컨퍼런스 행사를 조회하면, 해당 카테고리에 해당하는 모든 행사 목록을 조회할 수 있다.") void findEvents_CONFERENCE() { @@ -521,11 +539,11 @@ class SearchEvent { @DisplayName("2023년 7월 21일에 컨퍼런스 행사를 조회할 때, 검색어가 공백인 경우 해당 카테고리에 해당하는 모든 행사 목록을 조회할 수 있다.") void findEvents_blank_search(final String keyword) { // given - final List expectedEvents = List.of(인프콘_2023, 웹_컨퍼런스, AI_컨퍼런스, 모바일_컨퍼런스, - 안드로이드_컨퍼런스); + final List expectedEvents = List.of(인프콘_2023, 웹_컨퍼런스, 구름톤, AI_컨퍼런스, 모바일_컨퍼런스, + 안드로이드_컨퍼런스, AI_아이디어_공모전); // when - final List actualEvents = eventService.findEvents(EventType.CONFERENCE, + final List actualEvents = eventService.findEvents(null, TODAY, null, null, null, null, keyword); @@ -545,7 +563,7 @@ void findEvents_search() { 안드로이드_컨퍼런스); // when - final List actualEvents = eventService.findEvents(EventType.CONFERENCE, + final List actualEvents = eventService.findEvents(null, TODAY, null, null, null, null, keyword); // then @@ -563,7 +581,7 @@ void findEvents_multiple_tokens_search() { final List expectedEvents = List.of(모바일_컨퍼런스); // when - final List actualEvents = eventService.findEvents(EventType.CONFERENCE, + final List actualEvents = eventService.findEvents(null, TODAY, null, null, null, null, keyword); // then @@ -581,7 +599,7 @@ void findEvents_status_filter_and_search() { final List expectedEvents = List.of(인프콘_2023); // when - final List actualEvents = eventService.findEvents(EventType.CONFERENCE, + final List actualEvents = eventService.findEvents(null, TODAY, null, null, null, List.of(IN_PROGRESS), keyword); From ac3d54f8b3af94c1810df201bb6a562761e9e49a Mon Sep 17 00:00:00 2001 From: amaran-th Date: Tue, 10 Oct 2023 17:51:09 +0900 Subject: [PATCH 09/45] =?UTF-8?q?test:=20=EB=AC=B8=EC=84=9C=ED=99=94=20?= =?UTF-8?q?=ED=85=8C=EC=8A=A4=ED=8A=B8=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #704 --- .../src/documentTest/java/com/emmsale/EventApiTest.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/emm-sale/src/documentTest/java/com/emmsale/EventApiTest.java b/backend/emm-sale/src/documentTest/java/com/emmsale/EventApiTest.java index 95786f384..ed2ca2a05 100644 --- a/backend/emm-sale/src/documentTest/java/com/emmsale/EventApiTest.java +++ b/backend/emm-sale/src/documentTest/java/com/emmsale/EventApiTest.java @@ -109,8 +109,8 @@ void findEvent() throws Exception { void findEvents() throws Exception { // given final RequestParametersSnippet requestParameters = requestParameters( - RequestDocumentation.parameterWithName("category") - .description("행사 카테고리(CONFERENCE, COMPETITION)"), + RequestDocumentation.parameterWithName("category").optional() + .description("행사 카테고리(CONFERENCE, COMPETITION)(option)"), RequestDocumentation.parameterWithName("start_date") .description("필터링하려는 기간의 시작일(yyyy:mm:dd)(option)") .optional(), @@ -223,7 +223,7 @@ void updateEventTest() throws Exception { request.getLocation(), tags.stream().map(TagRequest::getName).collect(Collectors.toList()), "image1.jpg", request.getType().toString(), - List.of("imageUrl1", "imageUrl2"), "행사기관", "유료","온라인"); + List.of("imageUrl1", "imageUrl2"), "행사기관", "유료", "온라인"); Mockito.when(eventService.updateEvent(eq(eventId), any(EventDetailRequest.class), any())) .thenReturn(response); @@ -325,7 +325,7 @@ void addEventTest() throws Exception { request.getLocation(), tags.stream().map(TagRequest::getName).collect(Collectors.toList()), "image1.jpg", request.getType().toString(), - List.of("imageUrl1", "imageUrl2"), "행사기관", "무료","오프라인"); + List.of("imageUrl1", "imageUrl2"), "행사기관", "무료", "오프라인"); Mockito.when(eventService.addEvent(any(EventDetailRequest.class), any())) .thenReturn(response); From f9b5bbe49d08fea9fa1d265b2ffd9a4e31760786 Mon Sep 17 00:00:00 2001 From: hong-sile Date: Wed, 11 Oct 2023 12:50:28 +0900 Subject: [PATCH 10/45] =?UTF-8?q?feat:=20=EC=9D=B4=EB=AF=B8=EC=A7=80=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD=ED=95=A0=20=EA=B8=B0=EB=8A=A5=20=EB=B0=98?= =?UTF-8?q?=ED=99=98=EA=B0=92=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #708 --- .../src/documentTest/java/com/emmsale/MemberApiTest.java | 5 +++-- .../src/main/java/com/emmsale/member/api/MemberApi.java | 8 +++++--- .../emmsale/member/application/MemberUpdateService.java | 6 ++++-- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/backend/emm-sale/src/documentTest/java/com/emmsale/MemberApiTest.java b/backend/emm-sale/src/documentTest/java/com/emmsale/MemberApiTest.java index 0875c101c..ea596c11d 100644 --- a/backend/emm-sale/src/documentTest/java/com/emmsale/MemberApiTest.java +++ b/backend/emm-sale/src/documentTest/java/com/emmsale/MemberApiTest.java @@ -22,6 +22,7 @@ import com.emmsale.member.application.dto.MemberActivityInitialRequest; import com.emmsale.member.application.dto.MemberActivityResponse; import com.emmsale.member.application.dto.MemberActivityResponses; +import com.emmsale.member.application.dto.MemberImageResponse; import com.emmsale.member.application.dto.MemberProfileResponse; import com.emmsale.member.application.dto.OpenProfileUrlRequest; import com.emmsale.member.domain.Member; @@ -266,14 +267,14 @@ void deleteMemberTest() throws Exception { @DisplayName("멤버 프로필을 변경할 수 있다.") void updateProfile() throws Exception { //given - final String imageUrl = "http://imageUrl.png"; + final MemberImageResponse memberImageResponse = new MemberImageResponse("http://imageUrl.png"); final Long memberId = 1L; final String accessToken = "access_token"; final MockMultipartHttpServletRequestBuilder builder = createUpdateProfileBuilder(memberId); when(memberUpdateService.updateMemberProfile (any(MultipartFile.class), anyLong(), any(Member.class))) - .thenReturn(imageUrl); + .thenReturn(memberImageResponse); //when mockMvc.perform(builder diff --git a/backend/emm-sale/src/main/java/com/emmsale/member/api/MemberApi.java b/backend/emm-sale/src/main/java/com/emmsale/member/api/MemberApi.java index abd757bbc..15b465d2d 100644 --- a/backend/emm-sale/src/main/java/com/emmsale/member/api/MemberApi.java +++ b/backend/emm-sale/src/main/java/com/emmsale/member/api/MemberApi.java @@ -7,6 +7,7 @@ import com.emmsale.member.application.dto.MemberActivityAddRequest; import com.emmsale.member.application.dto.MemberActivityInitialRequest; import com.emmsale.member.application.dto.MemberActivityResponses; +import com.emmsale.member.application.dto.MemberImageResponse; import com.emmsale.member.application.dto.MemberProfileResponse; import com.emmsale.member.application.dto.OpenProfileUrlRequest; import com.emmsale.member.domain.Member; @@ -100,12 +101,13 @@ public ResponseEntity deleteMember( } @PatchMapping("/members/{memberId}/profile") - public ResponseEntity updateProfile( + public ResponseEntity updateProfile( @PathVariable final Long memberId, @RequestPart final MultipartFile image, final Member member ) { - final String imageUrl = memberUpdateService.updateMemberProfile(image, memberId, member); - return ResponseEntity.ok(imageUrl); + final MemberImageResponse memberImageResponse + = memberUpdateService.updateMemberProfile(image, memberId, member); + return ResponseEntity.ok(memberImageResponse); } } diff --git a/backend/emm-sale/src/main/java/com/emmsale/member/application/MemberUpdateService.java b/backend/emm-sale/src/main/java/com/emmsale/member/application/MemberUpdateService.java index 603ca02cb..5668771c6 100644 --- a/backend/emm-sale/src/main/java/com/emmsale/member/application/MemberUpdateService.java +++ b/backend/emm-sale/src/main/java/com/emmsale/member/application/MemberUpdateService.java @@ -2,6 +2,8 @@ import com.emmsale.image.application.S3Client; import com.emmsale.member.application.dto.DescriptionRequest; +import com.emmsale.member.application.dto.MemberImageResponse; +import com.emmsale.member.application.dto.MemberProfileResponse; import com.emmsale.member.application.dto.OpenProfileUrlRequest; import com.emmsale.member.domain.Member; import com.emmsale.member.domain.MemberRepository; @@ -48,7 +50,7 @@ public void deleteMember(final Member member, final Long memberId) { memberRepository.deleteById(memberId); } - public String updateMemberProfile( + public MemberImageResponse updateMemberProfile( final MultipartFile image, final Long memberId, final Member member @@ -66,6 +68,6 @@ public String updateMemberProfile( final String imageUrl = s3Client.convertImageUrl(imageName); member.updateProfile(imageUrl); - return imageUrl; + return new MemberImageResponse(imageUrl); } } From 5992b5cf55a6dc0a45a3e0890e47d62f9b4fa0ac Mon Sep 17 00:00:00 2001 From: hong-sile Date: Wed, 11 Oct 2023 12:53:38 +0900 Subject: [PATCH 11/45] =?UTF-8?q?feat:=20=EB=B9=A0=EC=A7=84=20dto=20?= =?UTF-8?q?=EC=BB=A4=EB=B0=8B=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #708 --- .../member/application/dto/MemberImageResponse.java | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 backend/emm-sale/src/main/java/com/emmsale/member/application/dto/MemberImageResponse.java diff --git a/backend/emm-sale/src/main/java/com/emmsale/member/application/dto/MemberImageResponse.java b/backend/emm-sale/src/main/java/com/emmsale/member/application/dto/MemberImageResponse.java new file mode 100644 index 000000000..4a6ccce1b --- /dev/null +++ b/backend/emm-sale/src/main/java/com/emmsale/member/application/dto/MemberImageResponse.java @@ -0,0 +1,11 @@ +package com.emmsale.member.application.dto; + +import lombok.Getter; +import lombok.RequiredArgsConstructor; + +@RequiredArgsConstructor +@Getter +public class MemberImageResponse { + + private final String imageUrl; +} From f02d484e900d3ff6b54ca1f64c5da8cb86783a14 Mon Sep 17 00:00:00 2001 From: amaran-th Date: Mon, 16 Oct 2023 17:13:24 +0900 Subject: [PATCH 12/45] =?UTF-8?q?fix:=20=ED=96=89=EC=82=AC=20=EB=AA=A9?= =?UTF-8?q?=EB=A1=9D=20=EC=A0=95=EB=A0=AC=20=EA=B8=B0=EC=A4=80=EC=97=90=20?= =?UTF-8?q?=EC=8B=9C=EA=B0=84=EA=B9=8C=EC=A7=80=20=ED=8F=AC=ED=95=A8?= =?UTF-8?q?=ED=95=98=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 - LocalDate를 LocalDateTime으로 수정 #726 --- .../src/documentTest/java/com/emmsale/EventApiTest.java | 3 +-- .../src/main/java/com/emmsale/event/api/EventApi.java | 3 ++- .../java/com/emmsale/event/application/EventService.java | 4 ++-- .../src/main/java/com/emmsale/event/domain/EventPeriod.java | 6 +++--- .../com/emmsale/scrap/application/ScrapQueryService.java | 5 +++-- .../com/emmsale/event/application/EventServiceTest.java | 2 +- 6 files changed, 12 insertions(+), 11 deletions(-) diff --git a/backend/emm-sale/src/documentTest/java/com/emmsale/EventApiTest.java b/backend/emm-sale/src/documentTest/java/com/emmsale/EventApiTest.java index ed2ca2a05..b9ea40906 100644 --- a/backend/emm-sale/src/documentTest/java/com/emmsale/EventApiTest.java +++ b/backend/emm-sale/src/documentTest/java/com/emmsale/EventApiTest.java @@ -23,7 +23,6 @@ import com.emmsale.tag.TagFixture; import com.emmsale.tag.application.dto.TagRequest; import java.nio.charset.StandardCharsets; -import java.time.LocalDate; import java.time.LocalDateTime; import java.util.HashMap; import java.util.List; @@ -171,7 +170,7 @@ void findEvents() throws Exception { ); Mockito.when(eventService.findEvents(any(EventType.class), - any(LocalDate.class), eq("2023-07-01"), + any(LocalDateTime.class), eq("2023-07-01"), eq("2023-07-31"), eq(null), any(), eq("컨퍼"))).thenReturn(eventResponses); diff --git a/backend/emm-sale/src/main/java/com/emmsale/event/api/EventApi.java b/backend/emm-sale/src/main/java/com/emmsale/event/api/EventApi.java index 2b2887acd..5ecd44ee0 100644 --- a/backend/emm-sale/src/main/java/com/emmsale/event/api/EventApi.java +++ b/backend/emm-sale/src/main/java/com/emmsale/event/api/EventApi.java @@ -7,6 +7,7 @@ import com.emmsale.event.domain.EventStatus; import com.emmsale.event.domain.EventType; import java.time.LocalDate; +import java.time.LocalDateTime; import java.util.List; import javax.validation.Valid; import lombok.RequiredArgsConstructor; @@ -46,7 +47,7 @@ public ResponseEntity> findEvents( @RequestParam(required = false) final List statuses, @RequestParam(required = false) final String keyword) { return ResponseEntity.ok( - eventService.findEvents(category, LocalDate.now(), startDate, endDate, tags, statuses, + eventService.findEvents(category, LocalDateTime.now(), startDate, endDate, tags, statuses, keyword)); } diff --git a/backend/emm-sale/src/main/java/com/emmsale/event/application/EventService.java b/backend/emm-sale/src/main/java/com/emmsale/event/application/EventService.java index 9046f580c..71170200b 100644 --- a/backend/emm-sale/src/main/java/com/emmsale/event/application/EventService.java +++ b/backend/emm-sale/src/main/java/com/emmsale/event/application/EventService.java @@ -92,7 +92,7 @@ private List extractInformationImages(final List imageUrls) { @Transactional(readOnly = true) public List findEvents(final EventType category, - final LocalDate nowDate, final String startDate, final String endDate, + final LocalDateTime nowDate, final String startDate, final String endDate, final List tagNames, final List statuses, final String keyword) { Specification spec = (root, query, criteriaBuilder) -> null; spec = filterByCategoryIfExist(category, spec); @@ -210,7 +210,7 @@ private boolean isExistKeyword(final String keyword) { return keyword != null && !keyword.isBlank(); } - private EnumMap> groupByEventStatus(final LocalDate nowDate, + private EnumMap> groupByEventStatus(final LocalDateTime nowDate, final List events) { return events.stream() .sorted(comparing(event -> event.getEventPeriod().getStartDate())) diff --git a/backend/emm-sale/src/main/java/com/emmsale/event/domain/EventPeriod.java b/backend/emm-sale/src/main/java/com/emmsale/event/domain/EventPeriod.java index 72f76076a..61917a6d5 100644 --- a/backend/emm-sale/src/main/java/com/emmsale/event/domain/EventPeriod.java +++ b/backend/emm-sale/src/main/java/com/emmsale/event/domain/EventPeriod.java @@ -56,11 +56,11 @@ private void validateApplyDateTimes(final LocalDateTime applyStartDateTime, } } - public EventStatus calculateEventStatus(final LocalDate now) { - if (now.isBefore(startDate.toLocalDate())) { + public EventStatus calculateEventStatus(final LocalDateTime now) { + if (now.isBefore(startDate)) { return EventStatus.UPCOMING; } - if (now.isAfter(endDate.toLocalDate())) { + if (now.isAfter(endDate)) { return EventStatus.ENDED; } return EventStatus.IN_PROGRESS; diff --git a/backend/emm-sale/src/main/java/com/emmsale/scrap/application/ScrapQueryService.java b/backend/emm-sale/src/main/java/com/emmsale/scrap/application/ScrapQueryService.java index 0cf5a3f78..9aa878962 100644 --- a/backend/emm-sale/src/main/java/com/emmsale/scrap/application/ScrapQueryService.java +++ b/backend/emm-sale/src/main/java/com/emmsale/scrap/application/ScrapQueryService.java @@ -10,7 +10,7 @@ import com.emmsale.member.domain.Member; import com.emmsale.scrap.domain.Scrap; import com.emmsale.scrap.domain.ScrapRepository; -import java.time.LocalDate; +import java.time.LocalDateTime; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -35,7 +35,8 @@ public List findAllScraps(final Member member) { .collect(Collectors.toList()); final Map> eventGroupByStatus = scrappedEvents.stream() - .collect(groupingBy(event -> event.getEventPeriod().calculateEventStatus(LocalDate.now()))); + .collect( + groupingBy(event -> event.getEventPeriod().calculateEventStatus(LocalDateTime.now()))); return EventResponse.mergeEventResponses(eventGroupByStatus, makeImageUrlPerEventId(scrappedEvents)); diff --git a/backend/emm-sale/src/test/java/com/emmsale/event/application/EventServiceTest.java b/backend/emm-sale/src/test/java/com/emmsale/event/application/EventServiceTest.java index b22b7ce23..5ba3f7257 100644 --- a/backend/emm-sale/src/test/java/com/emmsale/event/application/EventServiceTest.java +++ b/backend/emm-sale/src/test/java/com/emmsale/event/application/EventServiceTest.java @@ -90,7 +90,7 @@ class EventServiceTest extends ServiceIntegrationTestHelper { private static final EventResponse 구름톤 = new EventResponse(null, "구름톤", null, null, null, null, List.of(), null, EventMode.ONLINE.getValue(), PaymentType.PAID.getValue()); - private static final LocalDate TODAY = LocalDate.of(2023, 7, 21); + private static final LocalDateTime TODAY = LocalDateTime.of(2023, 7, 21, 0, 0); @Autowired private EventService eventService; @Autowired From c8a2437eb3976da4314d65909a38f1a83f5799db Mon Sep 17 00:00:00 2001 From: amaran-th Date: Mon, 16 Oct 2023 17:14:09 +0900 Subject: [PATCH 13/45] =?UTF-8?q?test:=20=ED=96=89=EC=82=AC=20=EC=A7=84?= =?UTF-8?q?=ED=96=89=20=EC=83=81=ED=83=9C=20=EA=B3=84=EC=82=B0=20=EB=A1=9C?= =?UTF-8?q?=EC=A7=81=20=ED=85=8C=EC=8A=A4=ED=8A=B8=20=EC=BC=80=EC=9D=B4?= =?UTF-8?q?=EC=8A=A4=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #726 --- .../src/test/java/com/emmsale/event/domain/EventTest.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/backend/emm-sale/src/test/java/com/emmsale/event/domain/EventTest.java b/backend/emm-sale/src/test/java/com/emmsale/event/domain/EventTest.java index 7c5053ac0..3a37d0990 100644 --- a/backend/emm-sale/src/test/java/com/emmsale/event/domain/EventTest.java +++ b/backend/emm-sale/src/test/java/com/emmsale/event/domain/EventTest.java @@ -31,10 +31,12 @@ class EventTest { @ParameterizedTest - @CsvSource(value = {"2023-03-01,UPCOMING", "2023-07-25,IN_PROGRESS", - "2023-08-01,ENDED"}, delimiter = ',') + @CsvSource(value = {"2023-03-01T00:00:00,UPCOMING", "2023-07-25T00:00:00,IN_PROGRESS", + "2023-08-01T00:00:00,ENDED", "2023-07-22T12:00:00,IN_PROGRESS", + "2023-07-22T12:00:01,IN_PROGRESS", "2023-07-30T12:00:00,IN_PROGRESS", + "2023-07-30T12:00:01,ENDED"}, delimiter = ',') @DisplayName("현재 날짜가 주어지면 행사의 진행 상태를 계산한다.") - void calculateEventStatus(LocalDate input, EventStatus expected) { + void calculateEventStatus(LocalDateTime input, EventStatus expected) { // given, when EventStatus actual = EventFixture.AI_컨퍼런스().getEventPeriod().calculateEventStatus(input); From 896734acc162e50090f2286b22c63f974b27900b Mon Sep 17 00:00:00 2001 From: amaran-th Date: Mon, 16 Oct 2023 17:35:11 +0900 Subject: [PATCH 14/45] =?UTF-8?q?refactor:=20=EC=82=AC=EC=9A=A9=EB=90=98?= =?UTF-8?q?=EC=A7=80=20=EC=95=8A=EB=8A=94=20=EB=A1=9C=EC=A7=81=20deprecate?= =?UTF-8?q?d?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #726 --- .../main/java/com/emmsale/event/domain/EventPeriod.java | 9 ++++++--- .../test/java/com/emmsale/event/domain/EventTest.java | 2 ++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/backend/emm-sale/src/main/java/com/emmsale/event/domain/EventPeriod.java b/backend/emm-sale/src/main/java/com/emmsale/event/domain/EventPeriod.java index 61917a6d5..79acf04e7 100644 --- a/backend/emm-sale/src/main/java/com/emmsale/event/domain/EventPeriod.java +++ b/backend/emm-sale/src/main/java/com/emmsale/event/domain/EventPeriod.java @@ -66,20 +66,23 @@ public EventStatus calculateEventStatus(final LocalDateTime now) { return EventStatus.IN_PROGRESS; } + @Deprecated public int calculateRemainingDays(final LocalDate today) { return java.time.Period.between(today, startDate.toLocalDate()).getDays(); } - public EventStatus calculateEventApplyStatus(final LocalDate now) { - if (now.isBefore(applyStartDate.toLocalDate())) { + @Deprecated + public EventStatus calculateEventApplyStatus(final LocalDateTime now) { + if (now.isBefore(applyStartDate)) { return EventStatus.UPCOMING; } - if (now.isAfter(applyEndDate.toLocalDate())) { + if (now.isAfter(applyEndDate)) { return EventStatus.ENDED; } return EventStatus.IN_PROGRESS; } + @Deprecated public int calculateApplyRemainingDays(final LocalDate today) { return java.time.Period.between(today, applyStartDate.toLocalDate()).getDays(); } diff --git a/backend/emm-sale/src/test/java/com/emmsale/event/domain/EventTest.java b/backend/emm-sale/src/test/java/com/emmsale/event/domain/EventTest.java index 3a37d0990..1a60329d6 100644 --- a/backend/emm-sale/src/test/java/com/emmsale/event/domain/EventTest.java +++ b/backend/emm-sale/src/test/java/com/emmsale/event/domain/EventTest.java @@ -275,6 +275,7 @@ void updateEvent_fail_SUBSCRIPTION_START_AFTER_EVENT_START() { exception.exceptionType()); } + @Deprecated @Test @DisplayName("현재날짜로부터 남은 날짜를 계산할 수 있다.") void calculateRemainingDay() { @@ -290,6 +291,7 @@ void calculateRemainingDay() { .isEqualTo(5); } + @Deprecated @Test @DisplayName("현재날짜로부터 신청 시작일까지 남은 날짜를 계산할 수 있다.") void calculateApplyRemainingDay() { From f775ac619ce3a9fbe049a112e30b87319c5d5070 Mon Sep 17 00:00:00 2001 From: amaran-th Date: Tue, 17 Oct 2023 15:02:25 +0900 Subject: [PATCH 15/45] =?UTF-8?q?refactor:=20nowDate=EB=A5=BC=20nowDateTim?= =?UTF-8?q?e=EC=9C=BC=EB=A1=9C=20=EC=9D=B4=EB=A6=84=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #726 --- .../java/com/emmsale/event/application/EventService.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/emm-sale/src/main/java/com/emmsale/event/application/EventService.java b/backend/emm-sale/src/main/java/com/emmsale/event/application/EventService.java index 71170200b..8c67d38e1 100644 --- a/backend/emm-sale/src/main/java/com/emmsale/event/application/EventService.java +++ b/backend/emm-sale/src/main/java/com/emmsale/event/application/EventService.java @@ -92,7 +92,7 @@ private List extractInformationImages(final List imageUrls) { @Transactional(readOnly = true) public List findEvents(final EventType category, - final LocalDateTime nowDate, final String startDate, final String endDate, + final LocalDateTime nowDateTime, final String startDate, final String endDate, final List tagNames, final List statuses, final String keyword) { Specification spec = (root, query, criteriaBuilder) -> null; spec = filterByCategoryIfExist(category, spec); @@ -103,7 +103,7 @@ public List findEvents(final EventType category, final List events = eventRepository.findAll(spec); final EnumMap> eventsForEventStatus - = groupByEventStatus(nowDate, events); + = groupByEventStatus(nowDateTime, events); return filterByStatuses(statuses, eventsForEventStatus, makeImageUrlPerEventId(events)); } @@ -210,12 +210,12 @@ private boolean isExistKeyword(final String keyword) { return keyword != null && !keyword.isBlank(); } - private EnumMap> groupByEventStatus(final LocalDateTime nowDate, + private EnumMap> groupByEventStatus(final LocalDateTime nowDateTime, final List events) { return events.stream() .sorted(comparing(event -> event.getEventPeriod().getStartDate())) .collect( - groupingBy(event -> event.getEventPeriod().calculateEventStatus(nowDate), + groupingBy(event -> event.getEventPeriod().calculateEventStatus(nowDateTime), () -> new EnumMap<>(EventStatus.class), toList()) ); } From e44b40567e913225bdfdb0b78ea7d22e53711355 Mon Sep 17 00:00:00 2001 From: hong-sile Date: Tue, 17 Oct 2023 15:41:29 +0900 Subject: [PATCH 16/45] =?UTF-8?q?feat:=20date=EB=A5=BC=20timstamp=EC=97=90?= =?UTF-8?q?=20=EC=B4=88=EA=B8=B0=ED=99=94=ED=95=98=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/backend-dev-deploy.yml | 152 ++++++++++++----------- 1 file changed, 79 insertions(+), 73 deletions(-) diff --git a/.github/workflows/backend-dev-deploy.yml b/.github/workflows/backend-dev-deploy.yml index f17fa1c93..0c54c097f 100644 --- a/.github/workflows/backend-dev-deploy.yml +++ b/.github/workflows/backend-dev-deploy.yml @@ -3,6 +3,9 @@ name: Kerdy Backend Dev Server CI/CD on: workflow_dispatch: +env: + TIMESTAMP: date +%s + jobs: build: name: 빌드 @@ -10,80 +13,83 @@ jobs: defaults: run: working-directory: backend/emm-sale - services: - mysql: - image: mysql:8.0.28 - env: - MYSQL_USER: user - MYSQL_PASSWORD: password - MYSQL_ROOT_PASSWORD: 1234 - MYSQL_DATABASE: kerdy - ports: - - 3306:3306 - options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 + # services: + # mysql: + # image: mysql:8.0.28 + # env: + # MYSQL_USER: user + # MYSQL_PASSWORD: password + # MYSQL_ROOT_PASSWORD: 1234 + # MYSQL_DATABASE: kerdy + # ports: + # - 3306:3306 + # options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 steps: - - name: workflow_dispatch에서 지정한 branch로 checkout - uses: actions/checkout@v3 - with: - token: ${{ secrets.SUBMODULE_TOKEN }} - submodules: true - - - name: JDK 11로 설정 - uses: actions/setup-java@v3 - with: - java-version: 11 - distribution: 'corretto' - - - name: Gradle에 실행 권한 부여 - run: chmod +x gradlew - - - name: Actions/Caches에 Gradle 라이브러리 캐싱 - id: cache-gradle - uses: actions/cache@v3 - with: - path: ~/.gradle/caches - key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} - restore-keys: ${{ runner.os }}-gradle- - # RestDocs의 index.html 업데이트 반영을 위해 2번 build하도록 함 - - name: gradle 빌드 - run: ./gradlew build && ./gradlew build + # - name: workflow_dispatch에서 지정한 branch로 checkout + # uses: actions/checkout@v3 + # with: + # token: ${{ secrets.SUBMODULE_TOKEN }} + # submodules: true - - name: 도커 빌더 생성 및 부팅 - uses: docker/setup-buildx-action@v2 - - - name: 도커 허브에 로그인 - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: 도커 이미지 빌드 및 푸시 - uses: docker/build-push-action@v4 - with: - context: backend/emm-sale - file: backend/emm-sale/Dockerfile-dev - platforms: linux/arm64/v8 - push: true - tags: ${{ secrets.DOCKERHUB_USERNAME }}/kerdy-dev:latest - - deploy: - needs: build - name: 배포 - runs-on: [ self-hosted, label-dev ] - steps: - - name: 도커 실행 - run: | - docker stop kerdy && docker rm kerdy && docker rmi -f ${{ secrets.DOCKERHUB_USERNAME }}/kerdy-dev - docker run -d -p 8080:8080 --name kerdy -e TZ=Asia/Seoul --network host ${{ secrets.DOCKERHUB_USERNAME }}/kerdy-dev + # - name: JDK 11로 설정 + # uses: actions/setup-java@v3 + # with: + # java-version: 11 + # distribution: 'corretto' + # + # - name: Gradle에 실행 권한 부여 + # run: chmod +x gradlew - - name: 슬랙 메시지 보내기 - uses: 8398a7/action-slack@v3 - with: - mention: 'here' - if_mention: failure - status: ${{ job.status }} - fields: workflow,job,commit,message,ref,author,took - env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - if: always() + - name: echo timestamp + run: echo $TIMESTAMP +# +# - name: Actions/Caches에 Gradle 라이브러리 캐싱 +# id: cache-gradle +# uses: actions/cache@v3 +# with: +# path: ~/.gradle/caches +# key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} +# restore-keys: ${{ runner.os }}-gradle- +# # RestDocs의 index.html 업데이트 반영을 위해 2번 build하도록 함 +# - name: gradle 빌드 +# run: ./gradlew build && ./gradlew build +# +# - name: 도커 빌더 생성 및 부팅 +# uses: docker/setup-buildx-action@v2 +# +# - name: 도커 허브에 로그인 +# uses: docker/login-action@v2 +# with: +# username: ${{ secrets.DOCKERHUB_USERNAME }} +# password: ${{ secrets.DOCKERHUB_TOKEN }} +# +# - name: 도커 이미지 빌드 및 푸시 +# uses: docker/build-push-action@v4 +# with: +# context: backend/emm-sale +# file: backend/emm-sale/Dockerfile-dev +# platforms: linux/arm64/v8 +# push: true +# tags: ${{ secrets.DOCKERHUB_USERNAME }}/kerdy-dev:latest +# +# deploy: +# needs: build +# name: 배포 +# runs-on: [ self-hosted, label-dev ] +# steps: +# - name: 도커 실행 +# run: | +# docker stop kerdy && docker rm kerdy && docker rmi -f ${{ secrets.DOCKERHUB_USERNAME }}/kerdy-dev +# docker run -d -p 8080:8080 --name kerdy -e TZ=Asia/Seoul --network host ${{ secrets.DOCKERHUB_USERNAME }}/kerdy-dev +# +# - name: 슬랙 메시지 보내기 +# uses: 8398a7/action-slack@v3 +# with: +# mention: 'here' +# if_mention: failure +# status: ${{ job.status }} +# fields: workflow,job,commit,message,ref,author,took +# env: +# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} +# if: always() From 26bb21399f17f5b4aaf804e7cb1a3185540dcf07 Mon Sep 17 00:00:00 2001 From: hong-sile Date: Tue, 17 Oct 2023 15:45:35 +0900 Subject: [PATCH 17/45] =?UTF-8?q?test:=20github=20=ED=83=80=EC=9E=84?= =?UTF-8?q?=EC=8A=A4=ED=83=AC=ED=94=84=20=ED=85=8C=EC=8A=A4=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/backend-dev-deploy.yml | 79 ++++++++++++------------ 1 file changed, 40 insertions(+), 39 deletions(-) diff --git a/.github/workflows/backend-dev-deploy.yml b/.github/workflows/backend-dev-deploy.yml index 0c54c097f..e89f0281a 100644 --- a/.github/workflows/backend-dev-deploy.yml +++ b/.github/workflows/backend-dev-deploy.yml @@ -3,9 +3,6 @@ name: Kerdy Backend Dev Server CI/CD on: workflow_dispatch: -env: - TIMESTAMP: date +%s - jobs: build: name: 빌드 @@ -41,43 +38,47 @@ jobs: # - name: Gradle에 실행 권한 부여 # run: chmod +x gradlew + - name: Get current UNIX timestamp + run: echo "CURRENT_TIMESTAMP=$(date +%s)" >> $GITHUB_ENV + - name: Print timestamp + run: echo $CURRENT_TIMESTAMP + # + # - name: Actions/Caches에 Gradle 라이브러리 캐싱 + # id: cache-gradle + # uses: actions/cache@v3 + # with: + # path: ~/.gradle/caches + # key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} + # restore-keys: ${{ runner.os }}-gradle- + # # RestDocs의 index.html 업데이트 반영을 위해 2번 build하도록 함 + # - name: gradle 빌드 + # run: ./gradlew build && ./gradlew build + # + # - name: 도커 빌더 생성 및 부팅 + # uses: docker/setup-buildx-action@v2 + # + # - name: 도커 허브에 로그인 + # uses: docker/login-action@v2 + # with: + # username: ${{ secrets.DOCKERHUB_USERNAME }} + # password: ${{ secrets.DOCKERHUB_TOKEN }} + # + # - name: 도커 이미지 빌드 및 푸시 + # uses: docker/build-push-action@v4 + # with: + # context: backend/emm-sale + # file: backend/emm-sale/Dockerfile-dev + # platforms: linux/arm64/v8 + # push: true + # tags: ${{ secrets.DOCKERHUB_USERNAME }}/kerdy-dev:latest + # + deploy: + needs: build + name: 배포 + runs-on: [ self-hosted, label-dev ] + steps: - name: echo timestamp - run: echo $TIMESTAMP -# -# - name: Actions/Caches에 Gradle 라이브러리 캐싱 -# id: cache-gradle -# uses: actions/cache@v3 -# with: -# path: ~/.gradle/caches -# key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} -# restore-keys: ${{ runner.os }}-gradle- -# # RestDocs의 index.html 업데이트 반영을 위해 2번 build하도록 함 -# - name: gradle 빌드 -# run: ./gradlew build && ./gradlew build -# -# - name: 도커 빌더 생성 및 부팅 -# uses: docker/setup-buildx-action@v2 -# -# - name: 도커 허브에 로그인 -# uses: docker/login-action@v2 -# with: -# username: ${{ secrets.DOCKERHUB_USERNAME }} -# password: ${{ secrets.DOCKERHUB_TOKEN }} -# -# - name: 도커 이미지 빌드 및 푸시 -# uses: docker/build-push-action@v4 -# with: -# context: backend/emm-sale -# file: backend/emm-sale/Dockerfile-dev -# platforms: linux/arm64/v8 -# push: true -# tags: ${{ secrets.DOCKERHUB_USERNAME }}/kerdy-dev:latest -# -# deploy: -# needs: build -# name: 배포 -# runs-on: [ self-hosted, label-dev ] -# steps: + run: echo $CURRENT_TIMESTAMP # - name: 도커 실행 # run: | # docker stop kerdy && docker rm kerdy && docker rmi -f ${{ secrets.DOCKERHUB_USERNAME }}/kerdy-dev From 52b21c5b22f465691f32a4ddb85650c2a13267e9 Mon Sep 17 00:00:00 2001 From: HyeonjaeKwon Date: Tue, 17 Oct 2023 15:49:35 +0900 Subject: [PATCH 18/45] =?UTF-8?q?chore:=20timestamp=20=20=ED=99=98?= =?UTF-8?q?=EA=B2=BD=EB=B3=80=EC=88=98=20set?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/backend-dev-deploy.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/backend-dev-deploy.yml b/.github/workflows/backend-dev-deploy.yml index e89f0281a..aeaeed628 100644 --- a/.github/workflows/backend-dev-deploy.yml +++ b/.github/workflows/backend-dev-deploy.yml @@ -3,6 +3,9 @@ name: Kerdy Backend Dev Server CI/CD on: workflow_dispatch: +env: + TIMESTAMP: $(date +%s) + jobs: build: name: 빌드 @@ -38,10 +41,8 @@ jobs: # - name: Gradle에 실행 권한 부여 # run: chmod +x gradlew - - name: Get current UNIX timestamp - run: echo "CURRENT_TIMESTAMP=$(date +%s)" >> $GITHUB_ENV - - name: Print timestamp - run: echo $CURRENT_TIMESTAMP + - name: echo timestamp + run: echo $TIMESTAMP # # - name: Actions/Caches에 Gradle 라이브러리 캐싱 # id: cache-gradle @@ -78,7 +79,8 @@ jobs: runs-on: [ self-hosted, label-dev ] steps: - name: echo timestamp - run: echo $CURRENT_TIMESTAMP + run: echo $TIMESTAMP + # - name: 도커 실행 # run: | # docker stop kerdy && docker rm kerdy && docker rmi -f ${{ secrets.DOCKERHUB_USERNAME }}/kerdy-dev From 59f3eb28905b91d108c8731fd54b5b7e5e3056c5 Mon Sep 17 00:00:00 2001 From: hong-sile Date: Tue, 17 Oct 2023 15:51:23 +0900 Subject: [PATCH 19/45] =?UTF-8?q?test:=20github=20actions=20checkout=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/backend-dev-deploy.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/backend-dev-deploy.yml b/.github/workflows/backend-dev-deploy.yml index aeaeed628..6eb860092 100644 --- a/.github/workflows/backend-dev-deploy.yml +++ b/.github/workflows/backend-dev-deploy.yml @@ -3,9 +3,6 @@ name: Kerdy Backend Dev Server CI/CD on: workflow_dispatch: -env: - TIMESTAMP: $(date +%s) - jobs: build: name: 빌드 @@ -41,8 +38,12 @@ jobs: # - name: Gradle에 실행 권한 부여 # run: chmod +x gradlew - - name: echo timestamp - run: echo $TIMESTAMP + - name: Get current UNIX timestamp + uses: actions/checkout@v3 + run: echo "CURRENT_TIMESTAMP=$(date +%s)" >> $GITHUB_ENV + + - name: Print timestamp + run: echo $CURRENT_TIMESTAMP # # - name: Actions/Caches에 Gradle 라이브러리 캐싱 # id: cache-gradle @@ -79,8 +80,7 @@ jobs: runs-on: [ self-hosted, label-dev ] steps: - name: echo timestamp - run: echo $TIMESTAMP - + run: echo $CURRENT_TIMESTAMP # - name: 도커 실행 # run: | # docker stop kerdy && docker rm kerdy && docker rmi -f ${{ secrets.DOCKERHUB_USERNAME }}/kerdy-dev From 24c919f2d461f7e8b5c3fe5fa79777b44bd208c8 Mon Sep 17 00:00:00 2001 From: hong-sile Date: Tue, 17 Oct 2023 15:53:38 +0900 Subject: [PATCH 20/45] =?UTF-8?q?test:=20github=20actions=20checkout=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/backend-dev-deploy.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/backend-dev-deploy.yml b/.github/workflows/backend-dev-deploy.yml index 6eb860092..9de75bd13 100644 --- a/.github/workflows/backend-dev-deploy.yml +++ b/.github/workflows/backend-dev-deploy.yml @@ -37,9 +37,10 @@ jobs: # # - name: Gradle에 실행 권한 부여 # run: chmod +x gradlew + - name: workflow_dispatch에서 지정한 branch로 checkout + uses: actions/checkout@v3 - name: Get current UNIX timestamp - uses: actions/checkout@v3 run: echo "CURRENT_TIMESTAMP=$(date +%s)" >> $GITHUB_ENV - name: Print timestamp From bd3614340ef21424befa0bd607309472edcbebc7 Mon Sep 17 00:00:00 2001 From: hong-sile Date: Tue, 17 Oct 2023 15:57:12 +0900 Subject: [PATCH 21/45] =?UTF-8?q?test:=20output=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/backend-dev-deploy.yml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/backend-dev-deploy.yml b/.github/workflows/backend-dev-deploy.yml index 9de75bd13..6141d2189 100644 --- a/.github/workflows/backend-dev-deploy.yml +++ b/.github/workflows/backend-dev-deploy.yml @@ -3,6 +3,9 @@ name: Kerdy Backend Dev Server CI/CD on: workflow_dispatch: +env: + timestamp: + jobs: build: name: 빌드 @@ -41,10 +44,13 @@ jobs: uses: actions/checkout@v3 - name: Get current UNIX timestamp - run: echo "CURRENT_TIMESTAMP=$(date +%s)" >> $GITHUB_ENV - - - name: Print timestamp - run: echo $CURRENT_TIMESTAMP + id: timestamp + run: echo “CURRENT_TIMESTAMP=$(date +%s)” >> $GITHUB_ENV + - name: Set timestamp as output + id: output_timestamp + run: echo “::set-output name=timestamp::$CURRENT_TIMESTAMP” + outputs: + current_timestamp: ${{ steps.output_timestamp.outputs.timestamp }} # # - name: Actions/Caches에 Gradle 라이브러리 캐싱 # id: cache-gradle @@ -80,8 +86,8 @@ jobs: name: 배포 runs-on: [ self-hosted, label-dev ] steps: - - name: echo timestamp - run: echo $CURRENT_TIMESTAMP + - name: Echo timestamp from build job + run: echo ${{ needs.build.outputs.current_timestamp }} # - name: 도커 실행 # run: | # docker stop kerdy && docker rm kerdy && docker rmi -f ${{ secrets.DOCKERHUB_USERNAME }}/kerdy-dev From c900b82212dad535ea4d80737131fed9706ac249 Mon Sep 17 00:00:00 2001 From: hong-sile Date: Tue, 17 Oct 2023 15:59:04 +0900 Subject: [PATCH 22/45] =?UTF-8?q?test:=20output=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/backend-dev-deploy.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/backend-dev-deploy.yml b/.github/workflows/backend-dev-deploy.yml index 6141d2189..480da95fc 100644 --- a/.github/workflows/backend-dev-deploy.yml +++ b/.github/workflows/backend-dev-deploy.yml @@ -3,9 +3,6 @@ name: Kerdy Backend Dev Server CI/CD on: workflow_dispatch: -env: - timestamp: - jobs: build: name: 빌드 From cff525e4a185a11100ebe9c156be4e801a104fe0 Mon Sep 17 00:00:00 2001 From: hong-sile Date: Tue, 17 Oct 2023 16:02:13 +0900 Subject: [PATCH 23/45] =?UTF-8?q?test:=20output=20=EC=B6=94=EA=B0=80=20->?= =?UTF-8?q?=20gpt=20v2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/backend-dev-deploy.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/backend-dev-deploy.yml b/.github/workflows/backend-dev-deploy.yml index 480da95fc..e9c099fce 100644 --- a/.github/workflows/backend-dev-deploy.yml +++ b/.github/workflows/backend-dev-deploy.yml @@ -40,14 +40,14 @@ jobs: - name: workflow_dispatch에서 지정한 branch로 checkout uses: actions/checkout@v3 - - name: Get current UNIX timestamp + - name: Get and set current UNIX timestamp id: timestamp - run: echo “CURRENT_TIMESTAMP=$(date +%s)” >> $GITHUB_ENV - - name: Set timestamp as output - id: output_timestamp - run: echo “::set-output name=timestamp::$CURRENT_TIMESTAMP” + run: | + CURRENT_TIMESTAMP=$(date +%s) + echo “CURRENT_TIMESTAMP=$CURRENT_TIMESTAMP” >> $GITHUB_ENV + echo “::set-output name=timestamp::$CURRENT_TIMESTAMP” outputs: - current_timestamp: ${{ steps.output_timestamp.outputs.timestamp }} + current_timestamp: ${{ steps.timestamp.outputs.timestamp }} # # - name: Actions/Caches에 Gradle 라이브러리 캐싱 # id: cache-gradle From f07c5836f27de118e7679738727a5631721d7f9f Mon Sep 17 00:00:00 2001 From: hong-sile Date: Tue, 17 Oct 2023 16:07:58 +0900 Subject: [PATCH 24/45] =?UTF-8?q?test:=20artifact=EB=A5=BC=20=EC=82=AC?= =?UTF-8?q?=EC=9A=A9=ED=95=98=EB=8F=84=EB=A1=9D=20=EC=82=AC=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/backend-dev-deploy.yml | 28 ++++++++++++++++-------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/.github/workflows/backend-dev-deploy.yml b/.github/workflows/backend-dev-deploy.yml index e9c099fce..b953ee5cc 100644 --- a/.github/workflows/backend-dev-deploy.yml +++ b/.github/workflows/backend-dev-deploy.yml @@ -40,14 +40,17 @@ jobs: - name: workflow_dispatch에서 지정한 branch로 checkout uses: actions/checkout@v3 - - name: Get and set current UNIX timestamp - id: timestamp + - name: Create Timestamp File run: | - CURRENT_TIMESTAMP=$(date +%s) - echo “CURRENT_TIMESTAMP=$CURRENT_TIMESTAMP” >> $GITHUB_ENV - echo “::set-output name=timestamp::$CURRENT_TIMESTAMP” - outputs: - current_timestamp: ${{ steps.timestamp.outputs.timestamp }} + CURRENT_TIMESTAMP=$(date +"%Y-%m-%d %H:%M:%S") + echo "$CURRENT_TIMESTAMP" > timestamp.txt + + - name: Upload Timestamp Artifact + uses: actions/upload-artifact@v2 + with: + name: timestamp-artifact + path: timestamp.txt + # # - name: Actions/Caches에 Gradle 라이브러리 캐싱 # id: cache-gradle @@ -83,8 +86,15 @@ jobs: name: 배포 runs-on: [ self-hosted, label-dev ] steps: - - name: Echo timestamp from build job - run: echo ${{ needs.build.outputs.current_timestamp }} + - name: Download Timestamp Artifact + uses: actions/download-artifact@v2 + with: + name: timestamp-artifact + path: timestamp-artifact + - name: Read Timestamp + run: | + TIMESTAMP_CONTENT=$(cat timestamp-artifact/timestamp.txt) + echo "Timestamp Content: $TIMESTAMP_CONTENT" # - name: 도커 실행 # run: | # docker stop kerdy && docker rm kerdy && docker rmi -f ${{ secrets.DOCKERHUB_USERNAME }}/kerdy-dev From bb5ea50ffb232388fda8d7a139fa81bd6f0dc3e3 Mon Sep 17 00:00:00 2001 From: hong-sile Date: Tue, 17 Oct 2023 16:09:25 +0900 Subject: [PATCH 25/45] =?UTF-8?q?test:=20artifact=EB=A5=BC=20=EC=82=AC?= =?UTF-8?q?=EC=9A=A9=ED=95=98=EB=8F=84=EB=A1=9D=20=EC=82=AC=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/backend-dev-deploy.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/backend-dev-deploy.yml b/.github/workflows/backend-dev-deploy.yml index b953ee5cc..0248b9a56 100644 --- a/.github/workflows/backend-dev-deploy.yml +++ b/.github/workflows/backend-dev-deploy.yml @@ -43,13 +43,13 @@ jobs: - name: Create Timestamp File run: | CURRENT_TIMESTAMP=$(date +"%Y-%m-%d %H:%M:%S") - echo "$CURRENT_TIMESTAMP" > timestamp.txt + echo "$CURRENT_TIMESTAMP" > /timestamp.txt - name: Upload Timestamp Artifact uses: actions/upload-artifact@v2 with: name: timestamp-artifact - path: timestamp.txt + path: /timestamp.txt # # - name: Actions/Caches에 Gradle 라이브러리 캐싱 From 758be947a630661d811eb57012c9a5d819a76da2 Mon Sep 17 00:00:00 2001 From: hong-sile Date: Tue, 17 Oct 2023 16:10:29 +0900 Subject: [PATCH 26/45] =?UTF-8?q?test:=20artifact=EB=A5=BC=20=EC=82=AC?= =?UTF-8?q?=EC=9A=A9=ED=95=98=EB=8F=84=EB=A1=9D=20=EC=82=AC=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/backend-dev-deploy.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/backend-dev-deploy.yml b/.github/workflows/backend-dev-deploy.yml index 0248b9a56..30a7d8fa1 100644 --- a/.github/workflows/backend-dev-deploy.yml +++ b/.github/workflows/backend-dev-deploy.yml @@ -43,13 +43,13 @@ jobs: - name: Create Timestamp File run: | CURRENT_TIMESTAMP=$(date +"%Y-%m-%d %H:%M:%S") - echo "$CURRENT_TIMESTAMP" > /timestamp.txt + echo "$CURRENT_TIMESTAMP" > ./timestamp.txt - name: Upload Timestamp Artifact uses: actions/upload-artifact@v2 with: name: timestamp-artifact - path: /timestamp.txt + path: ./timestamp.txt # # - name: Actions/Caches에 Gradle 라이브러리 캐싱 From 785a2bd785f1d8665fa0e6ec40577f0dfba0a69e Mon Sep 17 00:00:00 2001 From: hong-sile Date: Tue, 17 Oct 2023 16:12:24 +0900 Subject: [PATCH 27/45] =?UTF-8?q?test:=20output=20=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/backend-dev-deploy.yml | 58 ++++++++++-------------- 1 file changed, 23 insertions(+), 35 deletions(-) diff --git a/.github/workflows/backend-dev-deploy.yml b/.github/workflows/backend-dev-deploy.yml index 30a7d8fa1..49ffddcdd 100644 --- a/.github/workflows/backend-dev-deploy.yml +++ b/.github/workflows/backend-dev-deploy.yml @@ -22,34 +22,29 @@ jobs: # - 3306:3306 # options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 - steps: - # - name: workflow_dispatch에서 지정한 branch로 checkout - # uses: actions/checkout@v3 - # with: - # token: ${{ secrets.SUBMODULE_TOKEN }} - # submodules: true - - # - name: JDK 11로 설정 - # uses: actions/setup-java@v3 - # with: - # java-version: 11 - # distribution: 'corretto' - # - # - name: Gradle에 실행 권한 부여 - # run: chmod +x gradlew - - name: workflow_dispatch에서 지정한 branch로 checkout - uses: actions/checkout@v3 + # steps: + # - name: workflow_dispatch에서 지정한 branch로 checkout + # uses: actions/checkout@v3 + # with: + # token: ${{ secrets.SUBMODULE_TOKEN }} + # submodules: true - - name: Create Timestamp File - run: | - CURRENT_TIMESTAMP=$(date +"%Y-%m-%d %H:%M:%S") - echo "$CURRENT_TIMESTAMP" > ./timestamp.txt + # - name: JDK 11로 설정 + # uses: actions/setup-java@v3 + # with: + # java-version: 11 + # distribution: 'corretto' + # + # - name: Gradle에 실행 권한 부여 + # run: chmod +x gradlew + outputs: + current_timestamp: ${{ steps.timestamp.outputs.timestamp }} - - name: Upload Timestamp Artifact - uses: actions/upload-artifact@v2 - with: - name: timestamp-artifact - path: ./timestamp.txt + steps: + # ... (기타 스텝들) + - name: Get and set current UNIX timestamp + id: timestamp + run: echo “::set-output name=timestamp::$(date +%s)” # # - name: Actions/Caches에 Gradle 라이브러리 캐싱 @@ -86,15 +81,8 @@ jobs: name: 배포 runs-on: [ self-hosted, label-dev ] steps: - - name: Download Timestamp Artifact - uses: actions/download-artifact@v2 - with: - name: timestamp-artifact - path: timestamp-artifact - - name: Read Timestamp - run: | - TIMESTAMP_CONTENT=$(cat timestamp-artifact/timestamp.txt) - echo "Timestamp Content: $TIMESTAMP_CONTENT" + - name: Echo timestamp from build job + run: echo ${{ needs.build.outputs.current_timestamp }} # - name: 도커 실행 # run: | # docker stop kerdy && docker rm kerdy && docker rmi -f ${{ secrets.DOCKERHUB_USERNAME }}/kerdy-dev From 9346874f5bc2808054be6570bf4ef95d8fe1144b Mon Sep 17 00:00:00 2001 From: hong-sile Date: Tue, 17 Oct 2023 16:14:29 +0900 Subject: [PATCH 28/45] =?UTF-8?q?test:=20output=20=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/backend-dev-deploy.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/backend-dev-deploy.yml b/.github/workflows/backend-dev-deploy.yml index 49ffddcdd..f1318231d 100644 --- a/.github/workflows/backend-dev-deploy.yml +++ b/.github/workflows/backend-dev-deploy.yml @@ -41,6 +41,8 @@ jobs: current_timestamp: ${{ steps.timestamp.outputs.timestamp }} steps: + - name: workflow_dispatch에서 지정한 branch로 checkout + uses: actions/checkout@v3 # ... (기타 스텝들) - name: Get and set current UNIX timestamp id: timestamp From 2683bc126c75fb024665be83d814f9c38dcb6922 Mon Sep 17 00:00:00 2001 From: hong-sile Date: Tue, 17 Oct 2023 16:17:57 +0900 Subject: [PATCH 29/45] =?UTF-8?q?test:=20output=20=EC=84=A4=EC=A0=95=20-?= =?UTF-8?q?=20=EA=B3=B5=EC=8B=9D=EB=AC=B8=EC=84=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/backend-dev-deploy.yml | 67 +++++++++++------------- 1 file changed, 30 insertions(+), 37 deletions(-) diff --git a/.github/workflows/backend-dev-deploy.yml b/.github/workflows/backend-dev-deploy.yml index f1318231d..6f5687fd1 100644 --- a/.github/workflows/backend-dev-deploy.yml +++ b/.github/workflows/backend-dev-deploy.yml @@ -10,45 +10,37 @@ jobs: defaults: run: working-directory: backend/emm-sale - # services: - # mysql: - # image: mysql:8.0.28 - # env: - # MYSQL_USER: user - # MYSQL_PASSWORD: password - # MYSQL_ROOT_PASSWORD: 1234 - # MYSQL_DATABASE: kerdy - # ports: - # - 3306:3306 - # options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 + # services: + # mysql: + # image: mysql:8.0.28 + # env: + # MYSQL_USER: user + # MYSQL_PASSWORD: password + # MYSQL_ROOT_PASSWORD: 1234 + # MYSQL_DATABASE: kerdy + # ports: + # - 3306:3306 + # options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 - # steps: - # - name: workflow_dispatch에서 지정한 branch로 checkout - # uses: actions/checkout@v3 - # with: - # token: ${{ secrets.SUBMODULE_TOKEN }} - # submodules: true + # - name: workflow_dispatch에서 지정한 branch로 checkout + # uses: actions/checkout@v3 + # with: + # token: ${{ secrets.SUBMODULE_TOKEN }} + # submodules: true - # - name: JDK 11로 설정 - # uses: actions/setup-java@v3 - # with: - # java-version: 11 - # distribution: 'corretto' - # - # - name: Gradle에 실행 권한 부여 - # run: chmod +x gradlew + # - name: JDK 11로 설정 + # uses: actions/setup-java@v3 + # with: + # java-version: 11 + # distribution: 'corretto' + # + # - name: Gradle에 실행 권한 부여 + # run: chmod +x gradlew outputs: - current_timestamp: ${{ steps.timestamp.outputs.timestamp }} - + output1: ${{ steps.step1.outputs.test }} steps: - - name: workflow_dispatch에서 지정한 branch로 checkout - uses: actions/checkout@v3 - # ... (기타 스텝들) - - name: Get and set current UNIX timestamp - id: timestamp - run: echo “::set-output name=timestamp::$(date +%s)” - - # + - id: step1 + run: echo "test=hello" >> "$GITHUB_OUTPUT" # - name: Actions/Caches에 Gradle 라이브러리 캐싱 # id: cache-gradle # uses: actions/cache@v3 @@ -83,8 +75,9 @@ jobs: name: 배포 runs-on: [ self-hosted, label-dev ] steps: - - name: Echo timestamp from build job - run: echo ${{ needs.build.outputs.current_timestamp }} + - env: + OUTPUT1: ${{needs.job1.outputs.output1}} + run: echo "$OUTPUT1" # - name: 도커 실행 # run: | # docker stop kerdy && docker rm kerdy && docker rmi -f ${{ secrets.DOCKERHUB_USERNAME }}/kerdy-dev From cc3b8d16256be363d6485c71b9a6097f092a9344 Mon Sep 17 00:00:00 2001 From: hong-sile Date: Tue, 17 Oct 2023 16:20:29 +0900 Subject: [PATCH 30/45] =?UTF-8?q?test:=20output=20=EC=84=A4=EC=A0=95=20-?= =?UTF-8?q?=20=EA=B3=B5=EC=8B=9D=EB=AC=B8=EC=84=9C=202?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/backend-dev-deploy.yml | 77 ++---------------------- 1 file changed, 6 insertions(+), 71 deletions(-) diff --git a/.github/workflows/backend-dev-deploy.yml b/.github/workflows/backend-dev-deploy.yml index 6f5687fd1..6aa99497f 100644 --- a/.github/workflows/backend-dev-deploy.yml +++ b/.github/workflows/backend-dev-deploy.yml @@ -10,66 +10,15 @@ jobs: defaults: run: working-directory: backend/emm-sale - # services: - # mysql: - # image: mysql:8.0.28 - # env: - # MYSQL_USER: user - # MYSQL_PASSWORD: password - # MYSQL_ROOT_PASSWORD: 1234 - # MYSQL_DATABASE: kerdy - # ports: - # - 3306:3306 - # options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 - - # - name: workflow_dispatch에서 지정한 branch로 checkout - # uses: actions/checkout@v3 - # with: - # token: ${{ secrets.SUBMODULE_TOKEN }} - # submodules: true - - # - name: JDK 11로 설정 - # uses: actions/setup-java@v3 - # with: - # java-version: 11 - # distribution: 'corretto' - # - # - name: Gradle에 실행 권한 부여 - # run: chmod +x gradlew outputs: output1: ${{ steps.step1.outputs.test }} + output2: ${{ steps.step2.outputs.test }} steps: - id: step1 run: echo "test=hello" >> "$GITHUB_OUTPUT" - # - name: Actions/Caches에 Gradle 라이브러리 캐싱 - # id: cache-gradle - # uses: actions/cache@v3 - # with: - # path: ~/.gradle/caches - # key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} - # restore-keys: ${{ runner.os }}-gradle- - # # RestDocs의 index.html 업데이트 반영을 위해 2번 build하도록 함 - # - name: gradle 빌드 - # run: ./gradlew build && ./gradlew build - # - # - name: 도커 빌더 생성 및 부팅 - # uses: docker/setup-buildx-action@v2 - # - # - name: 도커 허브에 로그인 - # uses: docker/login-action@v2 - # with: - # username: ${{ secrets.DOCKERHUB_USERNAME }} - # password: ${{ secrets.DOCKERHUB_TOKEN }} - # - # - name: 도커 이미지 빌드 및 푸시 - # uses: docker/build-push-action@v4 - # with: - # context: backend/emm-sale - # file: backend/emm-sale/Dockerfile-dev - # platforms: linux/arm64/v8 - # push: true - # tags: ${{ secrets.DOCKERHUB_USERNAME }}/kerdy-dev:latest - # + - id: step2 + run: echo "test=world" >> "$GITHUB_OUTPUT" + deploy: needs: build name: 배포 @@ -77,19 +26,5 @@ jobs: steps: - env: OUTPUT1: ${{needs.job1.outputs.output1}} - run: echo "$OUTPUT1" -# - name: 도커 실행 -# run: | -# docker stop kerdy && docker rm kerdy && docker rmi -f ${{ secrets.DOCKERHUB_USERNAME }}/kerdy-dev -# docker run -d -p 8080:8080 --name kerdy -e TZ=Asia/Seoul --network host ${{ secrets.DOCKERHUB_USERNAME }}/kerdy-dev -# -# - name: 슬랙 메시지 보내기 -# uses: 8398a7/action-slack@v3 -# with: -# mention: 'here' -# if_mention: failure -# status: ${{ job.status }} -# fields: workflow,job,commit,message,ref,author,took -# env: -# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} -# if: always() + OUTPUT2: ${{needs.job1.outputs.output2}} + run: echo "$OUTPUT1 $OUTPUT2" From 518d3053d9788c86408ecf38c89b54d486892e1c Mon Sep 17 00:00:00 2001 From: hong-sile Date: Tue, 17 Oct 2023 16:21:44 +0900 Subject: [PATCH 31/45] =?UTF-8?q?test:=20output=20=EC=84=A4=EC=A0=95=20-?= =?UTF-8?q?=20=EA=B3=B5=EC=8B=9D=EB=AC=B8=EC=84=9C=203?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/backend-dev-deploy.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/backend-dev-deploy.yml b/.github/workflows/backend-dev-deploy.yml index 6aa99497f..5d1f466b8 100644 --- a/.github/workflows/backend-dev-deploy.yml +++ b/.github/workflows/backend-dev-deploy.yml @@ -14,6 +14,8 @@ jobs: output1: ${{ steps.step1.outputs.test }} output2: ${{ steps.step2.outputs.test }} steps: + - name: workflow_dispatch에서 지정한 branch로 checkout + uses: actions/checkout@v3 - id: step1 run: echo "test=hello" >> "$GITHUB_OUTPUT" - id: step2 From 02b582120fb26973eea708b49f971820411fb342 Mon Sep 17 00:00:00 2001 From: hong-sile Date: Tue, 17 Oct 2023 16:23:43 +0900 Subject: [PATCH 32/45] test: set output --- .github/workflows/backend-dev-deploy.yml | 90 +++++++++++++++++++++--- 1 file changed, 80 insertions(+), 10 deletions(-) diff --git a/.github/workflows/backend-dev-deploy.yml b/.github/workflows/backend-dev-deploy.yml index 5d1f466b8..a40e1b051 100644 --- a/.github/workflows/backend-dev-deploy.yml +++ b/.github/workflows/backend-dev-deploy.yml @@ -10,23 +10,93 @@ jobs: defaults: run: working-directory: backend/emm-sale + # services: + # mysql: + # image: mysql:8.0.28 + # env: + # MYSQL_USER: user + # MYSQL_PASSWORD: password + # MYSQL_ROOT_PASSWORD: 1234 + # MYSQL_DATABASE: kerdy + # ports: + # - 3306:3306 + # options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 + + # steps: + # - name: workflow_dispatch에서 지정한 branch로 checkout + # uses: actions/checkout@v3 + # with: + # token: ${{ secrets.SUBMODULE_TOKEN }} + # submodules: true + + # - name: JDK 11로 설정 + # uses: actions/setup-java@v3 + # with: + # java-version: 11 + # distribution: 'corretto' + # + # - name: Gradle에 실행 권한 부여 + # run: chmod +x gradlew outputs: - output1: ${{ steps.step1.outputs.test }} - output2: ${{ steps.step2.outputs.test }} + current_timestamp: ${{ steps.timestamp.outputs.timestamp }} + steps: - name: workflow_dispatch에서 지정한 branch로 checkout uses: actions/checkout@v3 - - id: step1 - run: echo "test=hello" >> "$GITHUB_OUTPUT" - - id: step2 - run: echo "test=world" >> "$GITHUB_OUTPUT" + # ... (기타 스텝들) + - name: Get and set current UNIX timestamp + id: timestamp + run: echo "::set-output name=timestamp::$(date +%s)" + # + # - name: Actions/Caches에 Gradle 라이브러리 캐싱 + # id: cache-gradle + # uses: actions/cache@v3 + # with: + # path: ~/.gradle/caches + # key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} + # restore-keys: ${{ runner.os }}-gradle- + # # RestDocs의 index.html 업데이트 반영을 위해 2번 build하도록 함 + # - name: gradle 빌드 + # run: ./gradlew build && ./gradlew build + # + # - name: 도커 빌더 생성 및 부팅 + # uses: docker/setup-buildx-action@v2 + # + # - name: 도커 허브에 로그인 + # uses: docker/login-action@v2 + # with: + # username: ${{ secrets.DOCKERHUB_USERNAME }} + # password: ${{ secrets.DOCKERHUB_TOKEN }} + # + # - name: 도커 이미지 빌드 및 푸시 + # uses: docker/build-push-action@v4 + # with: + # context: backend/emm-sale + # file: backend/emm-sale/Dockerfile-dev + # platforms: linux/arm64/v8 + # push: true + # tags: ${{ secrets.DOCKERHUB_USERNAME }}/kerdy-dev:latest + # deploy: needs: build name: 배포 runs-on: [ self-hosted, label-dev ] steps: - - env: - OUTPUT1: ${{needs.job1.outputs.output1}} - OUTPUT2: ${{needs.job1.outputs.output2}} - run: echo "$OUTPUT1 $OUTPUT2" + - name: Echo timestamp from build job + run: echo ${{ needs.build.outputs.current_timestamp }} +# - name: 도커 실행 +# run: | +# docker stop kerdy && docker rm kerdy && docker rmi -f ${{ secrets.DOCKERHUB_USERNAME }}/kerdy-dev +# docker run -d -p 8080:8080 --name kerdy -e TZ=Asia/Seoul --network host ${{ secrets.DOCKERHUB_USERNAME }}/kerdy-dev +# +# - name: 슬랙 메시지 보내기 +# uses: 8398a7/action-slack@v3 +# with: +# mention: 'here' +# if_mention: failure +# status: ${{ job.status }} +# fields: workflow,job,commit,message,ref,author,took +# env: +# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} +# if: always() From ecbfa220c02a0e2c55daac6b462462e854038b74 Mon Sep 17 00:00:00 2001 From: hong-sile Date: Tue, 17 Oct 2023 16:25:19 +0900 Subject: [PATCH 33/45] =?UTF-8?q?test:=20set=20output=20=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/backend-dev-deploy.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/backend-dev-deploy.yml b/.github/workflows/backend-dev-deploy.yml index a40e1b051..c1ae17b34 100644 --- a/.github/workflows/backend-dev-deploy.yml +++ b/.github/workflows/backend-dev-deploy.yml @@ -47,6 +47,8 @@ jobs: - name: Get and set current UNIX timestamp id: timestamp run: echo "::set-output name=timestamp::$(date +%s)" + - name: Echo timestamp from build job + run: echo ${{ needs.build.outputs.current_timestamp }} # # - name: Actions/Caches에 Gradle 라이브러리 캐싱 From 1a876682b37edf9d5c38ff874e1972665bbb8e69 Mon Sep 17 00:00:00 2001 From: hong-sile Date: Tue, 17 Oct 2023 16:28:31 +0900 Subject: [PATCH 34/45] =?UTF-8?q?test:=20set=20output=20=EC=84=A4=EC=A0=95?= =?UTF-8?q?=20-=20=ED=85=8C=EC=8A=A4=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/backend-dev-deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/backend-dev-deploy.yml b/.github/workflows/backend-dev-deploy.yml index c1ae17b34..fb0d34df2 100644 --- a/.github/workflows/backend-dev-deploy.yml +++ b/.github/workflows/backend-dev-deploy.yml @@ -48,7 +48,7 @@ jobs: id: timestamp run: echo "::set-output name=timestamp::$(date +%s)" - name: Echo timestamp from build job - run: echo ${{ needs.build.outputs.current_timestamp }} + run: echo ${{ steps.timestamp.outputs.timestamp }} # # - name: Actions/Caches에 Gradle 라이브러리 캐싱 From ee11daf47c134c606239a2f505a0d5f38afa8056 Mon Sep 17 00:00:00 2001 From: hong-sile Date: Tue, 17 Oct 2023 16:36:41 +0900 Subject: [PATCH 35/45] =?UTF-8?q?test:=20docker=20timstamp=20=EB=B6=99?= =?UTF-8?q?=EC=97=AC=EC=84=9C=20=EB=B0=B0=ED=8F=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/backend-dev-deploy.yml | 148 +++++++++++------------ 1 file changed, 71 insertions(+), 77 deletions(-) diff --git a/.github/workflows/backend-dev-deploy.yml b/.github/workflows/backend-dev-deploy.yml index fb0d34df2..3f1ccfcc6 100644 --- a/.github/workflows/backend-dev-deploy.yml +++ b/.github/workflows/backend-dev-deploy.yml @@ -10,95 +10,89 @@ jobs: defaults: run: working-directory: backend/emm-sale - # services: - # mysql: - # image: mysql:8.0.28 - # env: - # MYSQL_USER: user - # MYSQL_PASSWORD: password - # MYSQL_ROOT_PASSWORD: 1234 - # MYSQL_DATABASE: kerdy - # ports: - # - 3306:3306 - # options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 - - # steps: - # - name: workflow_dispatch에서 지정한 branch로 checkout - # uses: actions/checkout@v3 - # with: - # token: ${{ secrets.SUBMODULE_TOKEN }} - # submodules: true - - # - name: JDK 11로 설정 - # uses: actions/setup-java@v3 - # with: - # java-version: 11 - # distribution: 'corretto' - # - # - name: Gradle에 실행 권한 부여 - # run: chmod +x gradlew + services: + mysql: + image: mysql:8.0.28 + env: + MYSQL_USER: user + MYSQL_PASSWORD: password + MYSQL_ROOT_PASSWORD: 1234 + MYSQL_DATABASE: kerdy + ports: + - 3306:3306 + options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 outputs: current_timestamp: ${{ steps.timestamp.outputs.timestamp }} steps: - name: workflow_dispatch에서 지정한 branch로 checkout uses: actions/checkout@v3 - # ... (기타 스텝들) - - name: Get and set current UNIX timestamp + with: + token: ${{ secrets.SUBMODULE_TOKEN }} + submodules: true + + - name: unix 타임스탬프 얻기 id: timestamp run: echo "::set-output name=timestamp::$(date +%s)" - - name: Echo timestamp from build job + + - name: unix 타임스탬프 확인하기 run: echo ${{ steps.timestamp.outputs.timestamp }} - # - # - name: Actions/Caches에 Gradle 라이브러리 캐싱 - # id: cache-gradle - # uses: actions/cache@v3 - # with: - # path: ~/.gradle/caches - # key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} - # restore-keys: ${{ runner.os }}-gradle- - # # RestDocs의 index.html 업데이트 반영을 위해 2번 build하도록 함 - # - name: gradle 빌드 - # run: ./gradlew build && ./gradlew build - # - # - name: 도커 빌더 생성 및 부팅 - # uses: docker/setup-buildx-action@v2 - # - # - name: 도커 허브에 로그인 - # uses: docker/login-action@v2 - # with: - # username: ${{ secrets.DOCKERHUB_USERNAME }} - # password: ${{ secrets.DOCKERHUB_TOKEN }} - # - # - name: 도커 이미지 빌드 및 푸시 - # uses: docker/build-push-action@v4 - # with: - # context: backend/emm-sale - # file: backend/emm-sale/Dockerfile-dev - # platforms: linux/arm64/v8 - # push: true - # tags: ${{ secrets.DOCKERHUB_USERNAME }}/kerdy-dev:latest - # + - name: JDK 11로 설정 + uses: actions/setup-java@v3 + with: + java-version: 11 + distribution: 'corretto' + + - name: Gradle에 실행 권한 부여 + run: chmod +x gradlew + + - name: Actions/Caches에 Gradle 라이브러리 캐싱 + id: cache-gradle + uses: actions/cache@v3 + with: + path: ~/.gradle/caches + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} + restore-keys: ${{ runner.os }}-gradle- + # RestDocs의 index.html 업데이트 반영을 위해 2번 build하도록 함 + - name: gradle 빌드 + run: ./gradlew build && ./gradlew build + + - name: 도커 빌더 생성 및 부팅 + uses: docker/setup-buildx-action@v2 + + - name: 도커 허브에 로그인 + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: 도커 이미지 빌드 및 푸시 + uses: docker/build-push-action@v4 + with: + context: backend/emm-sale + file: backend/emm-sale/Dockerfile-dev + platforms: linux/arm64/v8 + push: true + tags: ${{ secrets.DOCKERHUB_USERNAME }}/kerdy-dev:${{ steps.timestamp.outputs.timestamp }} + deploy: needs: build name: 배포 runs-on: [ self-hosted, label-dev ] steps: - - name: Echo timestamp from build job - run: echo ${{ needs.build.outputs.current_timestamp }} -# - name: 도커 실행 -# run: | -# docker stop kerdy && docker rm kerdy && docker rmi -f ${{ secrets.DOCKERHUB_USERNAME }}/kerdy-dev -# docker run -d -p 8080:8080 --name kerdy -e TZ=Asia/Seoul --network host ${{ secrets.DOCKERHUB_USERNAME }}/kerdy-dev -# -# - name: 슬랙 메시지 보내기 -# uses: 8398a7/action-slack@v3 -# with: -# mention: 'here' -# if_mention: failure -# status: ${{ job.status }} -# fields: workflow,job,commit,message,ref,author,took -# env: -# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} -# if: always() + - name: 도커 실행 + run: | +# docker stop kerdy && docker rm kerdy && docker rmi -f ${{ secrets.DOCKERHUB_USERNAME }}/kerdy-dev:${{ needs.build.outputs.current_timestamp }} + docker run -d -p 8081:8080 --name kerdy -e TZ=Asia/Seoul --network host ${{ secrets.DOCKERHUB_USERNAME }}/kerdy-dev:${{ needs.build.outputs.current_timestamp }} + + - name: 슬랙 메시지 보내기 + uses: 8398a7/action-slack@v3 + with: + mention: 'here' + if_mention: failure + status: ${{ job.status }} + fields: workflow,job,commit,message,ref,author,took + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + if: always() From 4ee14ae6c305b85c9bfdfce2813b5a2712bc51a4 Mon Sep 17 00:00:00 2001 From: hong-sile Date: Tue, 17 Oct 2023 16:38:12 +0900 Subject: [PATCH 36/45] =?UTF-8?q?test:=20docker=20timstamp=20=EB=B6=99?= =?UTF-8?q?=EC=97=AC=EC=84=9C=20=EB=B0=B0=ED=8F=AC=20v2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/backend-dev-deploy.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/backend-dev-deploy.yml b/.github/workflows/backend-dev-deploy.yml index 3f1ccfcc6..02e7898f2 100644 --- a/.github/workflows/backend-dev-deploy.yml +++ b/.github/workflows/backend-dev-deploy.yml @@ -82,8 +82,8 @@ jobs: runs-on: [ self-hosted, label-dev ] steps: - name: 도커 실행 - run: | -# docker stop kerdy && docker rm kerdy && docker rmi -f ${{ secrets.DOCKERHUB_USERNAME }}/kerdy-dev:${{ needs.build.outputs.current_timestamp }} + run: + # docker stop kerdy && docker rm kerdy && docker rmi -f ${{ secrets.DOCKERHUB_USERNAME }}/kerdy-dev:${{ needs.build.outputs.current_timestamp }} docker run -d -p 8081:8080 --name kerdy -e TZ=Asia/Seoul --network host ${{ secrets.DOCKERHUB_USERNAME }}/kerdy-dev:${{ needs.build.outputs.current_timestamp }} - name: 슬랙 메시지 보내기 From a3066e681f64363c14269e9af0d3c68dc24450e7 Mon Sep 17 00:00:00 2001 From: hong-sile Date: Tue, 17 Oct 2023 19:33:37 +0900 Subject: [PATCH 37/45] =?UTF-8?q?feat:=20=EB=8D=B0=EB=B8=8C=20=EB=B0=B0?= =?UTF-8?q?=ED=8F=AC=ED=8C=8C=EC=9D=BC=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/backend-dev-deploy.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/backend-dev-deploy.yml b/.github/workflows/backend-dev-deploy.yml index 02e7898f2..fdacb2c46 100644 --- a/.github/workflows/backend-dev-deploy.yml +++ b/.github/workflows/backend-dev-deploy.yml @@ -83,8 +83,7 @@ jobs: steps: - name: 도커 실행 run: - # docker stop kerdy && docker rm kerdy && docker rmi -f ${{ secrets.DOCKERHUB_USERNAME }}/kerdy-dev:${{ needs.build.outputs.current_timestamp }} - docker run -d -p 8081:8080 --name kerdy -e TZ=Asia/Seoul --network host ${{ secrets.DOCKERHUB_USERNAME }}/kerdy-dev:${{ needs.build.outputs.current_timestamp }} + sudo /home/ubuntu/deploy.sh ${{ secrets.DOCKERHUB_USERNAME }} ${{ needs.build.outputs.current_timestamp }} - name: 슬랙 메시지 보내기 uses: 8398a7/action-slack@v3 From 0b5de7e73e6ab1a2748dc7ff739b423b10fc50c4 Mon Sep 17 00:00:00 2001 From: hong-sile Date: Tue, 17 Oct 2023 19:35:43 +0900 Subject: [PATCH 38/45] =?UTF-8?q?feat:=20prod=20=EC=9B=8C=ED=81=AC?= =?UTF-8?q?=ED=94=8C=EB=A1=9C=EC=9A=B0=20=EC=8A=A4=ED=81=AC=EB=A6=BD?= =?UTF-8?q?=ED=8A=B8=20=EC=9E=91=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/backend-prod-deploy.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/backend-prod-deploy.yml b/.github/workflows/backend-prod-deploy.yml index 1239600c9..24bb1b1b6 100644 --- a/.github/workflows/backend-prod-deploy.yml +++ b/.github/workflows/backend-prod-deploy.yml @@ -29,6 +29,13 @@ jobs: token: ${{ secrets.SUBMODULE_TOKEN }} submodules: true + - name: unix 타임스탬프 얻기 + id: timestamp + run: echo "::set-output name=timestamp::$(date +%s)" + + - name: unix 타임스탬프 확인하기 + run: echo ${{ steps.timestamp.outputs.timestamp }} + - name: firebase key 생성 run: | echo "${{ secrets.FIREBASE_KEY }}" > firebase-kerdy.json @@ -80,9 +87,8 @@ jobs: runs-on: [ self-hosted, label-prod ] steps: - name: 도커 실행 - run: | - docker stop kerdy && docker rm kerdy && docker rmi -f ${{ secrets.DOCKERHUB_USERNAME }}/kerdy - docker run -d -p 8080:8080 -v /home/ubuntu/logs/:/logs/ -e TZ=Asia/Seoul --name kerdy ${{ secrets.DOCKERHUB_USERNAME }}/kerdy + run: + sudo /home/ubuntu/deploy.sh ${{ secrets.DOCKERHUB_USERNAME }} ${{ needs.build.outputs.current_timestamp }} - name: 슬랙 메시지 보내기 uses: 8398a7/action-slack@v3 From d632f88671d1bd792ae38ed483660f77fad5284d Mon Sep 17 00:00:00 2001 From: hong-sile Date: Tue, 17 Oct 2023 19:49:37 +0900 Subject: [PATCH 39/45] =?UTF-8?q?fix:=20=EB=B2=84=EC=A0=84=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/backend-prod-deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/backend-prod-deploy.yml b/.github/workflows/backend-prod-deploy.yml index 24bb1b1b6..4066f09ad 100644 --- a/.github/workflows/backend-prod-deploy.yml +++ b/.github/workflows/backend-prod-deploy.yml @@ -79,7 +79,7 @@ jobs: file: backend/emm-sale/Dockerfile-prod platforms: linux/arm64/v8 push: true - tags: ${{ secrets.DOCKERHUB_USERNAME }}/kerdy:latest + tags: ${{ secrets.DOCKERHUB_USERNAME }}/kerdy:${{ steps.timestamp.outputs.timestamp }} deploy: needs: build From 4f2934508aa740b0176695aca7c728bd08a62974 Mon Sep 17 00:00:00 2001 From: hong-sile Date: Tue, 17 Oct 2023 20:21:39 +0900 Subject: [PATCH 40/45] =?UTF-8?q?fix:=20=EC=98=A4=EB=A5=98=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/backend-prod-deploy.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/backend-prod-deploy.yml b/.github/workflows/backend-prod-deploy.yml index 4066f09ad..384e98bb8 100644 --- a/.github/workflows/backend-prod-deploy.yml +++ b/.github/workflows/backend-prod-deploy.yml @@ -21,7 +21,8 @@ jobs: ports: - 3306:3306 options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 - + outputs: + current_timestamp: ${{ steps.timestamp.outputs.timestamp }} steps: - name: workflow_dispatch에서 지정한 branch로 checkout uses: actions/checkout@v3 From 98adf1c7c340b244a225933b9420f76b1819bad7 Mon Sep 17 00:00:00 2001 From: hong-sile Date: Mon, 30 Oct 2023 15:06:16 +0900 Subject: [PATCH 41/45] =?UTF-8?q?feat:=20=EB=B9=A0=EC=A7=84=20cloudFront-p?= =?UTF-8?q?refix=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/emm-sale/src/main/resources/application.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/emm-sale/src/main/resources/application.yml b/backend/emm-sale/src/main/resources/application.yml index 85c40f7fa..652a9a99e 100644 --- a/backend/emm-sale/src/main/resources/application.yml +++ b/backend/emm-sale/src/main/resources/application.yml @@ -63,6 +63,7 @@ cloud: static: ap-northeast-2 stack: auto: false + cloudfront-prefix: empty-url --- @@ -79,4 +80,3 @@ spring: import: classpath:kerdy-submodule/application-prod.yml activate: on-profile: prod - From 56a614388ccc8c9f20f8c2fd2a8bb7fd83bd2d30 Mon Sep 17 00:00:00 2001 From: hong-sile Date: Mon, 30 Oct 2023 15:06:44 +0900 Subject: [PATCH 42/45] =?UTF-8?q?refactor:=20Activity=20=EC=B6=94=EA=B0=80?= =?UTF-8?q?=ED=95=A0=20=EB=95=8C=20=EB=B0=98=ED=99=98=EA=B0=92=20=EB=A6=AC?= =?UTF-8?q?=ED=8C=A9=ED=84=B0=EB=A7=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/emmsale/ActivityApiTest.java | 75 ++++++++++--------- .../com/emmsale/activity/api/ActivityApi.java | 9 ++- .../application/ActivityCommandService.java | 6 +- .../ActivityCommandServiceTest.java | 19 +++-- 4 files changed, 60 insertions(+), 49 deletions(-) diff --git a/backend/emm-sale/src/documentTest/java/com/emmsale/ActivityApiTest.java b/backend/emm-sale/src/documentTest/java/com/emmsale/ActivityApiTest.java index 8706deef9..19182b093 100644 --- a/backend/emm-sale/src/documentTest/java/com/emmsale/ActivityApiTest.java +++ b/backend/emm-sale/src/documentTest/java/com/emmsale/ActivityApiTest.java @@ -12,6 +12,7 @@ import com.emmsale.activity.api.ActivityApi; import com.emmsale.activity.application.dto.ActivityAddRequest; import com.emmsale.activity.application.dto.ActivityResponse; +import com.emmsale.activity.application.dto.ActivityResponseRefactor; import com.emmsale.activity.application.dto.ActivityResponses; import com.emmsale.activity.domain.ActivityType; import java.util.List; @@ -36,33 +37,33 @@ class ActivityApiTest extends MockMvcTestHelper { void findAll() throws Exception { // given final ResponseFieldsSnippet responseFields = PayloadDocumentation.responseFields( - PayloadDocumentation.fieldWithPath("[].activityType").type(JsonFieldType.STRING) - .description("activity 분류"), - PayloadDocumentation.fieldWithPath("[].activityResponses[].id").type(JsonFieldType.NUMBER) - .description("activity id"), - PayloadDocumentation.fieldWithPath("[].activityResponses[].name").type(JsonFieldType.STRING) - .description("activity 이름") + PayloadDocumentation.fieldWithPath("[].activityType").type(JsonFieldType.STRING) + .description("activity 분류"), + PayloadDocumentation.fieldWithPath("[].activityResponses[].id").type(JsonFieldType.NUMBER) + .description("activity id"), + PayloadDocumentation.fieldWithPath("[].activityResponses[].name").type(JsonFieldType.STRING) + .description("activity 이름") ); final List activityResponses = List.of( - new ActivityResponses("동아리", - List.of( - new ActivityResponse(1L, "YAPP"), - new ActivityResponse(2L, "DND"), - new ActivityResponse(3L, "nexters") - )), - new ActivityResponses("컨퍼런스", - List.of( - new ActivityResponse(4L, "인프콘") - )), - new ActivityResponses("교육", - List.of( - new ActivityResponse(5L, "우아한테크코스") - )), - new ActivityResponses("직무", - List.of( - new ActivityResponse(6L, "Backend") - )) + new ActivityResponses("동아리", + List.of( + new ActivityResponse(1L, "YAPP"), + new ActivityResponse(2L, "DND"), + new ActivityResponse(3L, "nexters") + )), + new ActivityResponses("컨퍼런스", + List.of( + new ActivityResponse(4L, "인프콘") + )), + new ActivityResponses("교육", + List.of( + new ActivityResponse(5L, "우아한테크코스") + )), + new ActivityResponses("직무", + List.of( + new ActivityResponse(6L, "Backend") + )) ); Mockito.when(activityQueryService.findAll()).thenReturn(activityResponses); @@ -70,8 +71,8 @@ void findAll() throws Exception { // when & then mockMvc.perform(MockMvcRequestBuilders.get("/activities")) - .andExpect(MockMvcResultMatchers.status().isOk()) - .andDo(MockMvcRestDocumentation.document("find-all-activities", responseFields)); + .andExpect(MockMvcResultMatchers.status().isOk()) + .andDo(MockMvcRestDocumentation.document("find-all-activities", responseFields)); } @Test @@ -79,25 +80,29 @@ void findAll() throws Exception { void addTag() throws Exception { //given final RequestFieldsSnippet requestFields = requestFields( - fieldWithPath("activityType").type(JsonFieldType.STRING).description("활동 유형"), - fieldWithPath("name").type(JsonFieldType.STRING).description("활동 이름") + fieldWithPath("activityType").type(JsonFieldType.STRING).description("활동 유형"), + fieldWithPath("name").type(JsonFieldType.STRING).description("활동 이름") ); final ActivityAddRequest request = new ActivityAddRequest(ActivityType.CLUB, "DND"); - final ActivityResponse response = new ActivityResponse(3L, "DND"); + final ActivityResponseRefactor response = new ActivityResponseRefactor(3L, + ActivityType.CLUB.getValue(), + "DND" + ); when(activityCommandService.addActivity(any(ActivityAddRequest.class))).thenReturn(response); final ResponseFieldsSnippet responseFields = responseFields( - fieldWithPath("id").type(JsonFieldType.NUMBER).description("활동 식별자"), - fieldWithPath("name").type(JsonFieldType.STRING).description("활동 이름") + fieldWithPath("id").type(JsonFieldType.NUMBER).description("활동 식별자"), + fieldWithPath("activityType").type(JsonFieldType.STRING).description("활동 종류"), + fieldWithPath("name").type(JsonFieldType.STRING).description("활동 이름") ); //when & then mockMvc.perform(post("/activities") - .contentType(MediaType.APPLICATION_JSON) - .content(objectMapper.writeValueAsString(request))) - .andExpect(status().isCreated()) - .andDo(document("add-activity", requestFields, responseFields)); + .contentType(MediaType.APPLICATION_JSON) + .content(objectMapper.writeValueAsString(request))) + .andExpect(status().isCreated()) + .andDo(document("add-activity", requestFields, responseFields)); } } diff --git a/backend/emm-sale/src/main/java/com/emmsale/activity/api/ActivityApi.java b/backend/emm-sale/src/main/java/com/emmsale/activity/api/ActivityApi.java index c1c60dc2c..17b4fc931 100644 --- a/backend/emm-sale/src/main/java/com/emmsale/activity/api/ActivityApi.java +++ b/backend/emm-sale/src/main/java/com/emmsale/activity/api/ActivityApi.java @@ -3,7 +3,7 @@ import com.emmsale.activity.application.ActivityCommandService; import com.emmsale.activity.application.ActivityQueryService; import com.emmsale.activity.application.dto.ActivityAddRequest; -import com.emmsale.activity.application.dto.ActivityResponse; +import com.emmsale.activity.application.dto.ActivityResponseRefactor; import com.emmsale.activity.application.dto.ActivityResponses; import java.util.List; import lombok.RequiredArgsConstructor; @@ -29,9 +29,10 @@ public ResponseEntity> findAll() { } @PostMapping - public ResponseEntity create( - @RequestBody final ActivityAddRequest request) { + public ResponseEntity create( + @RequestBody final ActivityAddRequest request + ) { return ResponseEntity.status(HttpStatus.CREATED) - .body(activityCommandService.addActivity(request)); + .body(activityCommandService.addActivity(request)); } } diff --git a/backend/emm-sale/src/main/java/com/emmsale/activity/application/ActivityCommandService.java b/backend/emm-sale/src/main/java/com/emmsale/activity/application/ActivityCommandService.java index e5b6585fa..2e49e9ea1 100644 --- a/backend/emm-sale/src/main/java/com/emmsale/activity/application/ActivityCommandService.java +++ b/backend/emm-sale/src/main/java/com/emmsale/activity/application/ActivityCommandService.java @@ -1,7 +1,7 @@ package com.emmsale.activity.application; import com.emmsale.activity.application.dto.ActivityAddRequest; -import com.emmsale.activity.application.dto.ActivityResponse; +import com.emmsale.activity.application.dto.ActivityResponseRefactor; import com.emmsale.activity.domain.Activity; import com.emmsale.activity.domain.ActivityRepository; import com.emmsale.activity.exception.ActivityException; @@ -17,11 +17,11 @@ public class ActivityCommandService { private final ActivityRepository activityRepository; - public ActivityResponse addActivity(final ActivityAddRequest request) { + public ActivityResponseRefactor addActivity(final ActivityAddRequest request) { final String name = request.getName(); validateAlreadyExist(name); final Activity activity = new Activity(request.getActivityType(), name); - return ActivityResponse.from(activityRepository.save(activity)); + return ActivityResponseRefactor.from(activityRepository.save(activity)); } private void validateAlreadyExist(final String name) { diff --git a/backend/emm-sale/src/test/java/com/emmsale/activity/application/ActivityCommandServiceTest.java b/backend/emm-sale/src/test/java/com/emmsale/activity/application/ActivityCommandServiceTest.java index c702b26d9..9c86887ba 100644 --- a/backend/emm-sale/src/test/java/com/emmsale/activity/application/ActivityCommandServiceTest.java +++ b/backend/emm-sale/src/test/java/com/emmsale/activity/application/ActivityCommandServiceTest.java @@ -4,7 +4,7 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy; import com.emmsale.activity.application.dto.ActivityAddRequest; -import com.emmsale.activity.application.dto.ActivityResponse; +import com.emmsale.activity.application.dto.ActivityResponseRefactor; import com.emmsale.activity.domain.ActivityType; import com.emmsale.activity.exception.ActivityException; import com.emmsale.activity.exception.ActivityExceptionType; @@ -25,15 +25,20 @@ void findActivity() { //given final String activityName = "DDD"; final ActivityAddRequest request = new ActivityAddRequest(ActivityType.CLUB, activityName); - final ActivityResponse expected = new ActivityResponse(7L, activityName); + final ActivityResponseRefactor expected = new ActivityResponseRefactor( + 7L, + ActivityType.CLUB.getValue(), + activityName + ); //when - final ActivityResponse actual = activityCommandService.addActivity(request); + final ActivityResponseRefactor actual + = activityCommandService.addActivity(request); //then assertThat(actual) - .usingRecursiveComparison() - .isEqualTo(expected); + .usingRecursiveComparison() + .isEqualTo(expected); } @Test @@ -49,7 +54,7 @@ void findActivity_duplicate_fail() { //then assertThatThrownBy(actual) - .isInstanceOf(ActivityException.class) - .hasMessage(ActivityExceptionType.ALEADY_EXIST_ACTIVITY.errorMessage()); + .isInstanceOf(ActivityException.class) + .hasMessage(ActivityExceptionType.ALEADY_EXIST_ACTIVITY.errorMessage()); } } From 2ad95760b85b287f3e784ce580f803dfdc3a91f9 Mon Sep 17 00:00:00 2001 From: hong-sile Date: Mon, 30 Oct 2023 15:18:33 +0900 Subject: [PATCH 43/45] =?UTF-8?q?feat:=20Activity=20=EC=A1=B0=ED=9A=8C?= =?UTF-8?q?=ED=95=A0=20=EB=95=8C=20=EB=B0=98=ED=99=98=EA=B0=92=20=EB=A6=AC?= =?UTF-8?q?=ED=8C=A9=ED=84=B0=EB=A7=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/emmsale/ActivityApiTest.java | 42 ++++++------------ .../com/emmsale/activity/api/ActivityApi.java | 7 ++- .../application/ActivityCommandService.java | 6 +-- .../application/ActivityQueryService.java | 35 +++------------ .../application/dto/ActivityResponse.java | 26 ++++++++--- .../application/dto/ActivityResponses.java | 16 ------- .../ActivityCommandServiceTest.java | 6 +-- .../application/ActivityQueryServiceTest.java | 43 ++++++------------- 8 files changed, 58 insertions(+), 123 deletions(-) delete mode 100644 backend/emm-sale/src/main/java/com/emmsale/activity/application/dto/ActivityResponses.java diff --git a/backend/emm-sale/src/documentTest/java/com/emmsale/ActivityApiTest.java b/backend/emm-sale/src/documentTest/java/com/emmsale/ActivityApiTest.java index 19182b093..6d1d83fe4 100644 --- a/backend/emm-sale/src/documentTest/java/com/emmsale/ActivityApiTest.java +++ b/backend/emm-sale/src/documentTest/java/com/emmsale/ActivityApiTest.java @@ -12,8 +12,6 @@ import com.emmsale.activity.api.ActivityApi; import com.emmsale.activity.application.dto.ActivityAddRequest; import com.emmsale.activity.application.dto.ActivityResponse; -import com.emmsale.activity.application.dto.ActivityResponseRefactor; -import com.emmsale.activity.application.dto.ActivityResponses; import com.emmsale.activity.domain.ActivityType; import java.util.List; import org.junit.jupiter.api.DisplayName; @@ -37,39 +35,23 @@ class ActivityApiTest extends MockMvcTestHelper { void findAll() throws Exception { // given final ResponseFieldsSnippet responseFields = PayloadDocumentation.responseFields( - PayloadDocumentation.fieldWithPath("[].activityType").type(JsonFieldType.STRING) - .description("activity 분류"), - PayloadDocumentation.fieldWithPath("[].activityResponses[].id").type(JsonFieldType.NUMBER) - .description("activity id"), - PayloadDocumentation.fieldWithPath("[].activityResponses[].name").type(JsonFieldType.STRING) - .description("activity 이름") + fieldWithPath("[].id").type(JsonFieldType.NUMBER).description("activity id"), + fieldWithPath("[].activityType").type(JsonFieldType.STRING).description("activity 분류"), + fieldWithPath("[].name").type(JsonFieldType.STRING).description("activity 이름") ); - final List activityResponses = List.of( - new ActivityResponses("동아리", - List.of( - new ActivityResponse(1L, "YAPP"), - new ActivityResponse(2L, "DND"), - new ActivityResponse(3L, "nexters") - )), - new ActivityResponses("컨퍼런스", - List.of( - new ActivityResponse(4L, "인프콘") - )), - new ActivityResponses("교육", - List.of( - new ActivityResponse(5L, "우아한테크코스") - )), - new ActivityResponses("직무", - List.of( - new ActivityResponse(6L, "Backend") - )) + final List expected = List.of( + new ActivityResponse(1L, "동아리", "YAPP"), + new ActivityResponse(2L, "동아리", "DND"), + new ActivityResponse(3L, "동아리", "nexters"), + new ActivityResponse(4L, "컨퍼런스", "인프콘"), + new ActivityResponse(5L, "교육", "우아한테크코스"), + new ActivityResponse(6L, "직무", "Backend") ); - Mockito.when(activityQueryService.findAll()).thenReturn(activityResponses); + Mockito.when(activityQueryService.findAll()).thenReturn(expected); // when & then - mockMvc.perform(MockMvcRequestBuilders.get("/activities")) .andExpect(MockMvcResultMatchers.status().isOk()) .andDo(MockMvcRestDocumentation.document("find-all-activities", responseFields)); @@ -85,7 +67,7 @@ void addTag() throws Exception { ); final ActivityAddRequest request = new ActivityAddRequest(ActivityType.CLUB, "DND"); - final ActivityResponseRefactor response = new ActivityResponseRefactor(3L, + final ActivityResponse response = new ActivityResponse(3L, ActivityType.CLUB.getValue(), "DND" ); diff --git a/backend/emm-sale/src/main/java/com/emmsale/activity/api/ActivityApi.java b/backend/emm-sale/src/main/java/com/emmsale/activity/api/ActivityApi.java index 17b4fc931..ed2e74e79 100644 --- a/backend/emm-sale/src/main/java/com/emmsale/activity/api/ActivityApi.java +++ b/backend/emm-sale/src/main/java/com/emmsale/activity/api/ActivityApi.java @@ -3,8 +3,7 @@ import com.emmsale.activity.application.ActivityCommandService; import com.emmsale.activity.application.ActivityQueryService; import com.emmsale.activity.application.dto.ActivityAddRequest; -import com.emmsale.activity.application.dto.ActivityResponseRefactor; -import com.emmsale.activity.application.dto.ActivityResponses; +import com.emmsale.activity.application.dto.ActivityResponse; import java.util.List; import lombok.RequiredArgsConstructor; import org.springframework.http.HttpStatus; @@ -24,12 +23,12 @@ public class ActivityApi { private final ActivityCommandService activityCommandService; @GetMapping - public ResponseEntity> findAll() { + public ResponseEntity> findAll() { return ResponseEntity.ok(activityQueryService.findAll()); } @PostMapping - public ResponseEntity create( + public ResponseEntity create( @RequestBody final ActivityAddRequest request ) { return ResponseEntity.status(HttpStatus.CREATED) diff --git a/backend/emm-sale/src/main/java/com/emmsale/activity/application/ActivityCommandService.java b/backend/emm-sale/src/main/java/com/emmsale/activity/application/ActivityCommandService.java index 2e49e9ea1..e5b6585fa 100644 --- a/backend/emm-sale/src/main/java/com/emmsale/activity/application/ActivityCommandService.java +++ b/backend/emm-sale/src/main/java/com/emmsale/activity/application/ActivityCommandService.java @@ -1,7 +1,7 @@ package com.emmsale.activity.application; import com.emmsale.activity.application.dto.ActivityAddRequest; -import com.emmsale.activity.application.dto.ActivityResponseRefactor; +import com.emmsale.activity.application.dto.ActivityResponse; import com.emmsale.activity.domain.Activity; import com.emmsale.activity.domain.ActivityRepository; import com.emmsale.activity.exception.ActivityException; @@ -17,11 +17,11 @@ public class ActivityCommandService { private final ActivityRepository activityRepository; - public ActivityResponseRefactor addActivity(final ActivityAddRequest request) { + public ActivityResponse addActivity(final ActivityAddRequest request) { final String name = request.getName(); validateAlreadyExist(name); final Activity activity = new Activity(request.getActivityType(), name); - return ActivityResponseRefactor.from(activityRepository.save(activity)); + return ActivityResponse.from(activityRepository.save(activity)); } private void validateAlreadyExist(final String name) { diff --git a/backend/emm-sale/src/main/java/com/emmsale/activity/application/ActivityQueryService.java b/backend/emm-sale/src/main/java/com/emmsale/activity/application/ActivityQueryService.java index 2ab6c9989..22ae2eff7 100644 --- a/backend/emm-sale/src/main/java/com/emmsale/activity/application/ActivityQueryService.java +++ b/backend/emm-sale/src/main/java/com/emmsale/activity/application/ActivityQueryService.java @@ -1,18 +1,10 @@ package com.emmsale.activity.application; -import static java.util.Comparator.comparing; -import static java.util.stream.Collectors.groupingBy; -import static java.util.stream.Collectors.toList; +import static java.util.stream.Collectors.toUnmodifiableList; import com.emmsale.activity.application.dto.ActivityResponse; -import com.emmsale.activity.application.dto.ActivityResponses; -import com.emmsale.activity.domain.Activity; import com.emmsale.activity.domain.ActivityRepository; -import com.emmsale.activity.domain.ActivityType; -import java.util.ArrayList; -import java.util.EnumMap; import java.util.List; -import java.util.Map.Entry; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -24,25 +16,10 @@ public class ActivityQueryService { private final ActivityRepository activityRepository; - public List findAll() { - final EnumMap> groupByActivityType = activityRepository.findAll() - .stream() - .sorted(comparing(activity -> activity.getName().toLowerCase())) - .collect( - groupingBy(Activity::getActivityType, () -> new EnumMap<>(ActivityType.class), toList()) - ); - - final List responses = new ArrayList<>(); - - for (final Entry> entry : groupByActivityType.entrySet()) { - final List activityResponse = entry.getValue() - .stream() - .map(it -> new ActivityResponse(it.getId(), it.getName())) - .collect(toList()); - - responses.add(new ActivityResponses(entry.getKey().getValue(), activityResponse)); - } - - return responses; + public List findAll() { + return activityRepository.findAll() + .stream() + .map(ActivityResponse::from) + .collect(toUnmodifiableList()); } } diff --git a/backend/emm-sale/src/main/java/com/emmsale/activity/application/dto/ActivityResponse.java b/backend/emm-sale/src/main/java/com/emmsale/activity/application/dto/ActivityResponse.java index 39af1dcf9..e101a9421 100644 --- a/backend/emm-sale/src/main/java/com/emmsale/activity/application/dto/ActivityResponse.java +++ b/backend/emm-sale/src/main/java/com/emmsale/activity/application/dto/ActivityResponse.java @@ -1,20 +1,32 @@ package com.emmsale.activity.application.dto; import com.emmsale.activity.domain.Activity; -import lombok.Getter; +import lombok.RequiredArgsConstructor; -@Getter +@RequiredArgsConstructor public class ActivityResponse { private final Long id; + private final String activityType; private final String name; - public ActivityResponse(final Long id, final String name) { - this.id = id; - this.name = name; + public static ActivityResponse from(final Activity activity) { + return new ActivityResponse( + activity.getId(), + activity.getActivityType().getValue(), + activity.getName() + ); } - public static ActivityResponse from(final Activity activity) { - return new ActivityResponse(activity.getId(), activity.getName()); + public Long getId() { + return id; + } + + public String getActivityType() { + return activityType; + } + + public String getName() { + return name; } } diff --git a/backend/emm-sale/src/main/java/com/emmsale/activity/application/dto/ActivityResponses.java b/backend/emm-sale/src/main/java/com/emmsale/activity/application/dto/ActivityResponses.java deleted file mode 100644 index e7adc1a9c..000000000 --- a/backend/emm-sale/src/main/java/com/emmsale/activity/application/dto/ActivityResponses.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.emmsale.activity.application.dto; - -import java.util.List; -import lombok.Getter; - -@Getter -public class ActivityResponses { - - private final String activityType; - private final List activityResponses; - - public ActivityResponses(final String activityType, final List activityResponses) { - this.activityType = activityType; - this.activityResponses = activityResponses; - } -} diff --git a/backend/emm-sale/src/test/java/com/emmsale/activity/application/ActivityCommandServiceTest.java b/backend/emm-sale/src/test/java/com/emmsale/activity/application/ActivityCommandServiceTest.java index 9c86887ba..b71f3117b 100644 --- a/backend/emm-sale/src/test/java/com/emmsale/activity/application/ActivityCommandServiceTest.java +++ b/backend/emm-sale/src/test/java/com/emmsale/activity/application/ActivityCommandServiceTest.java @@ -4,7 +4,7 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy; import com.emmsale.activity.application.dto.ActivityAddRequest; -import com.emmsale.activity.application.dto.ActivityResponseRefactor; +import com.emmsale.activity.application.dto.ActivityResponse; import com.emmsale.activity.domain.ActivityType; import com.emmsale.activity.exception.ActivityException; import com.emmsale.activity.exception.ActivityExceptionType; @@ -25,14 +25,14 @@ void findActivity() { //given final String activityName = "DDD"; final ActivityAddRequest request = new ActivityAddRequest(ActivityType.CLUB, activityName); - final ActivityResponseRefactor expected = new ActivityResponseRefactor( + final ActivityResponse expected = new ActivityResponse( 7L, ActivityType.CLUB.getValue(), activityName ); //when - final ActivityResponseRefactor actual + final ActivityResponse actual = activityCommandService.addActivity(request); //then diff --git a/backend/emm-sale/src/test/java/com/emmsale/activity/application/ActivityQueryServiceTest.java b/backend/emm-sale/src/test/java/com/emmsale/activity/application/ActivityQueryServiceTest.java index c262de4b0..291ba7887 100644 --- a/backend/emm-sale/src/test/java/com/emmsale/activity/application/ActivityQueryServiceTest.java +++ b/backend/emm-sale/src/test/java/com/emmsale/activity/application/ActivityQueryServiceTest.java @@ -1,14 +1,10 @@ package com.emmsale.activity.application; import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.jupiter.api.Assertions.assertAll; import com.emmsale.activity.application.dto.ActivityResponse; -import com.emmsale.activity.application.dto.ActivityResponses; -import com.emmsale.activity.domain.ActivityType; import com.emmsale.helper.ServiceIntegrationTestHelper; import java.util.List; -import java.util.stream.Collectors; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; @@ -18,40 +14,25 @@ class ActivityQueryServiceTest extends ServiceIntegrationTestHelper { @Autowired private ActivityQueryService activityQueryService; - @Test @DisplayName("존재하고 있는 Activity를 전체 조회할 수 있다.") - void findAll() throws Exception { + void findAll() { //given - final List expectedActivities = List.of( - ActivityType.CLUB.getValue(), - ActivityType.CONFERENCE.getValue(), - ActivityType.JOB.getValue(), - ActivityType.EDUCATION.getValue() - ); - - final List expectedActivityNames = List.of( - "YAPP", "DND", - "nexters", "인프콘", - "우아한테크코스", "Backend" + final List expected = List.of( + new ActivityResponse(1L, "동아리", "YAPP"), + new ActivityResponse(2L, "동아리", "DND"), + new ActivityResponse(3L, "동아리", "nexters"), + new ActivityResponse(4L, "컨퍼런스", "인프콘"), + new ActivityResponse(5L, "교육", "우아한테크코스"), + new ActivityResponse(6L, "직무", "Backend") ); //when - List activityResponses = activityQueryService.findAll(); + final List actual = activityQueryService.findAll(); //then - final List actualActivityNames = activityResponses.stream() - .flatMap(it -> it.getActivityResponses().stream()) - .map(ActivityResponse::getName) - .collect(Collectors.toList()); - - assertAll( - () -> assertThat(activityResponses).hasSize(4), - () -> assertThat(activityResponses) - .extracting("activityType") - .containsExactlyInAnyOrderElementsOf(expectedActivities), - () -> assertThat(expectedActivityNames) - .containsExactlyInAnyOrderElementsOf(actualActivityNames) - ); + assertThat(actual) + .usingRecursiveComparison() + .isEqualTo(expected); } } From d69fe822ae45ed4c0dd9fa00208b04b463e269bc Mon Sep 17 00:00:00 2001 From: HyeonjaeKwon Date: Wed, 1 Nov 2023 17:44:10 +0900 Subject: [PATCH 44/45] =?UTF-8?q?refactor:=20=EC=84=9C=EB=B9=84=EC=8A=A4?= =?UTF-8?q?=20=EC=86=8C=EA=B0=9C=EA=B8=80=20=EC=97=85=EB=8D=B0=EC=9D=B4?= =?UTF-8?q?=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 106 +++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 94 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 20b1f6481..f7632af65 100644 --- a/README.md +++ b/README.md @@ -1,24 +1,108 @@ # 📄 서비스 소개 -### 여러분은 IT 컨퍼런스나 해커톤, 대회에 참여할 때 주로 어떤 목적을 가지고 참여하시나요? +## 이런 적 있지 않나요? -아마도 유익한 강연을 듣기 위해서일 수도 있고, 같은 관심사를 가진 동료 개발자들과 교류하려는 의도일 수도 있습니다. 하지만 이러한 행사에 참여하기 위해 동료를 찾거나 행사의 질에 대한 리뷰를 알아보려면 많은 노력이 필요했을 겁니다. 이런 고민을 해결하고자 **커디(KerDy)**가 탄생했습니다. +### **평소 IT 행사 정보를 찾아보기 어렵지 않으셨나요?** -커디는 개발자들의 특별한 인연을 만들어낼 수 있는 모바일 앱 서비스로써, 행사에 참여하려는 동료를 찾거나 행사의 리뷰를 확인하고 싶을 때 직접적인 도움을 줍니다. 커디의 주요 기능은 다음과 같습니다. +

+drawing +

+ +IT 업계의 능력있는 사람들이 모여 지식을 공유하고, 네트워킹하며 지식의 뿌리를 넓힐 수 있는 컨퍼런스 +자신의 역량을 시험하고 경험을 넓힐 수 있는 귀중한 기회인 공모전과 대회 +여러분은 컨퍼런스나 대회를 찾을 때 어떻게 찾으시나요? + +어쩌다가 생각나서 행사 모음 사이트를 검색하거나 지인에게 건너 듣진 않으신가요? + +이런 IT 행사 정보를 간편하게 한 데 모아볼 수 있다면 좋지 않을까요? + +### **여러분의 관심사와 맞지 않는 행사가 너무 많지 않나요?** + +

+drawing +

+ +사실, 이런 행사 정보를 모아둔 사이트는 이미 여럿 존재하고 있습니다. + +하지만 막상 사이트를 둘러보면, 수많은 행사 중 자신의 관심 분야와 맞는 행사의 개수는 손에 꼽습니다. + +> _백엔드, 프론트엔드, 안드로이드, 정보보안, AI, 빅데이터…_ + +그렇다고 사이트에 매일 접속해서 자신이 관심있는 분야의 행사가 올라왔는지 확인하는 것은 귀찮고 번거로운 작업입니다. + +그냥 자신이 관심있는 분야의 행사 정보만 골라 볼 수 있다면 좋지 않을까요? + +### **행사를 함께할 친구를 찾기 힘들지 않았나요?** + +

+drawing +

+ +가고 싶은 행사가 생겼어도, 컨퍼런스를 가려고 하니 막상 컨퍼런스를 혼자 가기가 두렵진 않으셨나요? + +혹은 팀으로 참여하는 대회 팀원을 구하는 데 어려움을 겪은 적이 있지 않았나요? + +하나의 플랫폼에서 행사에 함께 참여할 사람을 구할 수 있다면 좋지 않을까요? + +그런 여러분을 위해 Kerdy 서비스를 출시하게 되었습니다! ## ✨ 핵심 기능 -**1. 오프라인 네트워킹 활성화** +### 1. 행사 필터링 & 스크랩 + +| ![](https://velog.velcdn.com/images/kerdy-official/post/10c013bf-0e44-4a5b-8e4b-fb494e8dcbd0/image.png) | ![](https://velog.velcdn.com/images/kerdy-official/post/0fb37480-65bc-40aa-b4b0-b0ecb8befd13/image.png) | ![](https://velog.velcdn.com/images/kerdy-official/post/02c7c3d0-2dde-4ea1-a3b4-8664773805ff/image.png) | +| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | + +원하는 행사, 쉽게 필터링하고 찾아보세요! + +커디는 관심 분야별로 행사를 필터링할 수 있습니다. + +만약 관심있는 행사가 있다면 스크랩 해보시는건 어떠신가요? + +관심있는 행사는 스크랩해서 언제든지 다시 확인해보세요! + +### 2. 관심 태그를 설정해 알람을 받아보세요! + +| ![](https://velog.velcdn.com/images/kerdy-official/post/c82091e5-b2ae-4ff0-9457-cdcb560229ca/image.png) | ![](https://velog.velcdn.com/images/kerdy-official/post/c681ce12-73ea-4c77-b540-6c8223116a85/image.png) | +| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | + +
+관심 태그 설정을 통해 원하는 분야의 행사 알림을 쉽게 받아볼 수 있어요. +
+
+ +| ![](https://velog.velcdn.com/images/kerdy-official/post/cd47070e-5fda-41b6-91d6-2985b87b234b/image.png) | ![](https://velog.velcdn.com/images/kerdy-official/post/39b28b61-624b-4857-81ee-e3c55d5bc348/image.png) | +| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | + +알림 보관함을 통해 나에게 온 알림을 모아볼 수 있어요! + +### 3. 행사에 같이가요! + +| ![](https://velog.velcdn.com/images/kerdy-official/post/439361f4-076a-4b0c-b32e-1f236e90874a/image.png) | ![](https://velog.velcdn.com/images/kerdy-official/post/eb500827-3deb-40d8-a020-44542f443140/image.png) | +| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | + +
+상대방의 활동 이력과 관심사를 확인하고 마음이 맞으면 `함께하기 요청` 을 시도해보세요. +
+
+ +| ![](https://velog.velcdn.com/images/kerdy-official/post/0431e0bb-40f5-404a-b560-7c96309e1965/image.png) | ![](https://velog.velcdn.com/images/kerdy-official/post/0a8de7ee-99d6-4cbb-9282-bf9b073c15f2/image.png) | +| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | + +약간의 채팅을 통해 상대방이 어떤 사람인지 알아보고, 만나고자 하는 시간과 장소를 정해보세요! + +간단한 소통만으로 `행사에 대한 두려움` 을 조금은 덜어냈네요! -커디를 통해 원하는 행사에 함께 참여하고 싶은 동료를 쉽게 찾을 수 있습니다. 요청을 보내고 상대방이 수락하면, 카카오톡 오픈 프로필로 연결되어 행사 참여에 관한 대화를 이어나갈 수 있습니다. +### 4. 행사 게시판을 통해 의견을 공유하세요! -**2. IT 행사 정보 제공** +| ![](https://velog.velcdn.com/images/kerdy-official/post/7b0a19da-8adf-4995-8183-ede78039657f/image.png) | ![](https://velog.velcdn.com/images/kerdy-official/post/1594c6c2-4085-45cf-977f-fa1b4f893d5e/image.png) | ![](https://velog.velcdn.com/images/kerdy-official/post/dd995906-1ac5-4142-a978-4a67dd6f94b7/image.png) | +| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | -커디에서는 다양한 IT 행사의 정보를 한눈에 볼 수 있습니다. 관심 있는 행사의 태그를 설정하면 관련 행사 정보의 업데이트 알림을 받을 수 있습니다. +커디의 행사 상세정보 페이지는 더욱 풍부한 상호작용과 소통을 위해 게시판 기능을 제공하고 있습니다. -**3. 커뮤니티** +이 기능을 통해 참가자 간의 소통을 쉽게 할 수 있고, 다양한 정보를 공유하고 토론할 수 있어요. -행사에 관한 후기나 의견을 자유롭게 공유할 수 있는 댓글 커뮤니티 기능을 제공합니다. 행사에 참여한 후기나 궁금한 점을 나누어보세요. +게시판 탭에서 행사에 대한 후기, QNA 등 자유롭게 이야기를 나눠 보세요! ## 🌈 기대 효과 @@ -34,10 +118,8 @@ 지금 바로 커디를 통해 특별한 인연과 유익한 행사 정보를 얻어보세요! -# 설치 URL -[Google PlayStore 설치 URL](https://play.google.com/store/apps/details?id=com.emmsale&hl=ko-KR) +# 팀원 소개 -# 팀 구성 ### Android From 3cf11bc41fee0f136e5fbb74a200fc564ca75df0 Mon Sep 17 00:00:00 2001 From: HyeonjaeKwon Date: Tue, 7 Nov 2023 16:31:21 +0900 Subject: [PATCH 45/45] =?UTF-8?q?docs:=20=EA=B8=B0=EB=8C=80=ED=9A=A8?= =?UTF-8?q?=EA=B3=BC=20=EC=A0=9C=EA=B1=B0=20=EB=B0=8F=20=EB=AC=B8=EB=8B=A8?= =?UTF-8?q?=20=EC=82=AC=EC=9D=B4=20=EC=A4=84=EB=B0=94=EA=BF=88=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index f7632af65..dbc81da17 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,8 @@ IT 업계의 능력있는 사람들이 모여 지식을 공유하고, 네트워 이런 IT 행사 정보를 간편하게 한 데 모아볼 수 있다면 좋지 않을까요? +
+ ### **여러분의 관심사와 맞지 않는 행사가 너무 많지 않나요?**

@@ -32,6 +34,8 @@ IT 업계의 능력있는 사람들이 모여 지식을 공유하고, 네트워 그냥 자신이 관심있는 분야의 행사 정보만 골라 볼 수 있다면 좋지 않을까요? +
+ ### **행사를 함께할 친구를 찾기 힘들지 않았나요?**

@@ -46,6 +50,8 @@ IT 업계의 능력있는 사람들이 모여 지식을 공유하고, 네트워 그런 여러분을 위해 Kerdy 서비스를 출시하게 되었습니다! +
+ ## ✨ 핵심 기능 ### 1. 행사 필터링 & 스크랩 @@ -61,6 +67,8 @@ IT 업계의 능력있는 사람들이 모여 지식을 공유하고, 네트워 관심있는 행사는 스크랩해서 언제든지 다시 확인해보세요! +
+ ### 2. 관심 태그를 설정해 알람을 받아보세요! | ![](https://velog.velcdn.com/images/kerdy-official/post/c82091e5-b2ae-4ff0-9457-cdcb560229ca/image.png) | ![](https://velog.velcdn.com/images/kerdy-official/post/c681ce12-73ea-4c77-b540-6c8223116a85/image.png) | @@ -76,6 +84,8 @@ IT 업계의 능력있는 사람들이 모여 지식을 공유하고, 네트워 알림 보관함을 통해 나에게 온 알림을 모아볼 수 있어요! +
+ ### 3. 행사에 같이가요! | ![](https://velog.velcdn.com/images/kerdy-official/post/439361f4-076a-4b0c-b32e-1f236e90874a/image.png) | ![](https://velog.velcdn.com/images/kerdy-official/post/eb500827-3deb-40d8-a020-44542f443140/image.png) | @@ -104,20 +114,6 @@ IT 업계의 능력있는 사람들이 모여 지식을 공유하고, 네트워 게시판 탭에서 행사에 대한 후기, QNA 등 자유롭게 이야기를 나눠 보세요! -## 🌈 기대 효과 - -그럼 커디를 통해 어떤 변화를 가져올 수 있을까요? - -첫째, **행사 참여의 장벽을 낮춥니다.** 주변에 같은 관심사를 가진 동료가 없어도 커디를 통해 쉽게 동료를 찾을 수 있습니다. - -둘째, **행사의 질을 향상시킵니다.** 다양한 참여자들의 리뷰와 의견을 통해 더 나은 행사를 기획하고 개선할 수 있습니다. - -셋째, **활발한 행사 참여를 도모합니다.** 개발자들이 관심 있어 할 IT 행사 정보를 한 데 모아 제공함으로써, 많은 개발자들이 유익한 경험을 할 수 있도록 토대를 마련합니다. - -커디는 단순한 정보 제공 서비스가 아닙니다. 사용자들 간의 연결과 커뮤니케이션을 중심으로 한 서비스로써 개발자 커뮤니티의 활성화에 기여하고자 합니다. - -지금 바로 커디를 통해 특별한 인연과 유익한 행사 정보를 얻어보세요! - # 팀원 소개 ### Android