From e39380c75d31ffff5274beb62afad362e21fa7c6 Mon Sep 17 00:00:00 2001 From: twoosky Date: Fri, 10 Nov 2023 13:20:12 +0900 Subject: [PATCH 1/3] =?UTF-8?q?fix:=20apply=20=EC=83=9D=EC=84=B1=20?= =?UTF-8?q?=EC=8B=9C=20=EC=9D=B4=EB=B2=A4=ED=8A=B8=EC=97=90=20captainId=20?= =?UTF-8?q?=EB=84=98=EA=B2=A8=EC=A3=BC=EB=8F=84=EB=A1=9D=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 --- .../java/com/gloddy/server/apply/application/ApplyService.java | 2 +- .../java/com/gloddy/server/apply/event/ApplyCreateEvent.java | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/gloddy/server/apply/application/ApplyService.java b/src/main/java/com/gloddy/server/apply/application/ApplyService.java index 9076af15..61665b70 100644 --- a/src/main/java/com/gloddy/server/apply/application/ApplyService.java +++ b/src/main/java/com/gloddy/server/apply/application/ApplyService.java @@ -40,7 +40,7 @@ public ApplyResponse.Create createApply(Long userId, Long groupId, ApplyRequest. Apply apply = applyCommandHandler.save( group.createApply(user, request.getIntroduce(), request.getReason()) ); - applyEventProducer.produceEvent(new ApplyCreateEvent(userId, groupId)); + applyEventProducer.produceEvent(new ApplyCreateEvent(group.getCaptainId(), groupId, userId)); return new ApplyResponse.Create(apply.getId()); } diff --git a/src/main/java/com/gloddy/server/apply/event/ApplyCreateEvent.java b/src/main/java/com/gloddy/server/apply/event/ApplyCreateEvent.java index 8dbf9776..4366894c 100644 --- a/src/main/java/com/gloddy/server/apply/event/ApplyCreateEvent.java +++ b/src/main/java/com/gloddy/server/apply/event/ApplyCreateEvent.java @@ -10,6 +10,7 @@ @AllArgsConstructor @Getter public class ApplyCreateEvent implements Event { - private Long userId; + private Long captainId; private Long groupId; + private Long applyUserId; } From 3214fbf66f88512d37528ae859a86857c677830d Mon Sep 17 00:00:00 2001 From: twoosky Date: Fri, 10 Nov 2023 13:20:56 +0900 Subject: [PATCH 2/3] =?UTF-8?q?fix:=20apply=20group=EC=9D=98=20userId?= =?UTF-8?q?=EB=A5=BC=20captainId=EB=A1=9C=20=EB=B3=80=EC=88=98=EB=AA=85=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gloddy/server/apply/event/ApplyStatusUpdateEvent.java | 4 ++-- .../messaging/adapter/apply/mapper/ApplyEventMapper.java | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/gloddy/server/apply/event/ApplyStatusUpdateEvent.java b/src/main/java/com/gloddy/server/apply/event/ApplyStatusUpdateEvent.java index 8e19a223..7091bae5 100644 --- a/src/main/java/com/gloddy/server/apply/event/ApplyStatusUpdateEvent.java +++ b/src/main/java/com/gloddy/server/apply/event/ApplyStatusUpdateEvent.java @@ -11,8 +11,8 @@ @NoArgsConstructor(access = AccessLevel.PROTECTED) @AllArgsConstructor public class ApplyStatusUpdateEvent implements Event { - private Long userId; - private Long applyGroupId; + private Long captainId; + private Long groupId; private Long applyUserId; private Status status; } diff --git a/src/main/java/com/gloddy/server/messaging/adapter/apply/mapper/ApplyEventMapper.java b/src/main/java/com/gloddy/server/messaging/adapter/apply/mapper/ApplyEventMapper.java index 994cd3c2..f965c7ee 100644 --- a/src/main/java/com/gloddy/server/messaging/adapter/apply/mapper/ApplyEventMapper.java +++ b/src/main/java/com/gloddy/server/messaging/adapter/apply/mapper/ApplyEventMapper.java @@ -10,17 +10,17 @@ public class ApplyEventMapper { public static ApplyAdapterEvent mapToApplyAdapterEventFrom(ApplyCreateEvent applyCreateEvent) { return new ApplyAdapterEvent( - applyCreateEvent.getUserId(), + applyCreateEvent.getCaptainId(), applyCreateEvent.getGroupId(), - applyCreateEvent.getUserId(), + applyCreateEvent.getApplyUserId(), ApplyEventType.APPLY_CREATE ); } public static ApplyAdapterEvent mapToApplyAdapterEventFrom(ApplyStatusUpdateEvent applyStatusUpdateEvent) { return new ApplyAdapterEvent( - applyStatusUpdateEvent.getUserId(), - applyStatusUpdateEvent.getApplyGroupId(), + applyStatusUpdateEvent.getCaptainId(), + applyStatusUpdateEvent.getGroupId(), applyStatusUpdateEvent.getApplyUserId(), getApplyEventType(applyStatusUpdateEvent.getStatus()) ); From 395dd82deb376d01e90eb1bfe44475b2076e29ca Mon Sep 17 00:00:00 2001 From: twoosky Date: Fri, 10 Nov 2023 13:21:14 +0900 Subject: [PATCH 3/3] =?UTF-8?q?feat:=20group=EC=9D=98=20captainId=20?= =?UTF-8?q?=EB=B0=98=ED=99=98=20=EB=A9=94=EC=86=8C=EB=93=9C=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 --- src/main/java/com/gloddy/server/group/domain/Group.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/com/gloddy/server/group/domain/Group.java b/src/main/java/com/gloddy/server/group/domain/Group.java index f0eb1c8c..f9c503eb 100644 --- a/src/main/java/com/gloddy/server/group/domain/Group.java +++ b/src/main/java/com/gloddy/server/group/domain/Group.java @@ -98,6 +98,10 @@ public int getMemberCount() { return this.groupMemberVOs.getSize(); } + public Long getCaptainId() { + return this.captain.getId(); + } + public Apply createApply(User applier, String introduce, String reason) { return Apply.builder() .user(applier)