From 97e179ffd06d23c3bd8e8aa47020f05ca2aec3a9 Mon Sep 17 00:00:00 2001 From: GaBaljaintheroom Date: Wed, 19 Jun 2024 22:22:29 +0900 Subject: [PATCH 1/4] =?UTF-8?q?refact=20:=20=EA=B7=B8=EB=A3=B9=20=EC=B4=88?= =?UTF-8?q?=EB=8C=80=20=EC=95=8C=EB=A6=BC=20=EB=A7=A4=EA=B0=9C=EB=B3=80?= =?UTF-8?q?=EC=88=98=20=EC=88=9C=EC=84=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/infra/queue/data/dto/GroupInviteNotificationDto.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/core/src/main/java/site/timecapsulearchive/core/infra/queue/data/dto/GroupInviteNotificationDto.java b/backend/core/src/main/java/site/timecapsulearchive/core/infra/queue/data/dto/GroupInviteNotificationDto.java index 8e4c14d47..5ac2a14a2 100644 --- a/backend/core/src/main/java/site/timecapsulearchive/core/infra/queue/data/dto/GroupInviteNotificationDto.java +++ b/backend/core/src/main/java/site/timecapsulearchive/core/infra/queue/data/dto/GroupInviteNotificationDto.java @@ -15,8 +15,8 @@ public record GroupInviteNotificationDto( ) { public static GroupInviteNotificationDto createOf( - final String groupProfileUrl, final String ownerNickname, + final String groupProfileUrl, final List targetIds ) { From 05f08905454909ba0991cd9f5b940267694ff8b1 Mon Sep 17 00:00:00 2001 From: GaBaljaintheroom Date: Wed, 19 Jun 2024 22:57:55 +0900 Subject: [PATCH 2/4] =?UTF-8?q?refact=20:=20presigned=20=EB=B3=80=ED=99=98?= =?UTF-8?q?=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/infra/queue/manager/SocialNotificationManager.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/backend/core/src/main/java/site/timecapsulearchive/core/infra/queue/manager/SocialNotificationManager.java b/backend/core/src/main/java/site/timecapsulearchive/core/infra/queue/manager/SocialNotificationManager.java index cfe9d436a..3eb9b11f5 100644 --- a/backend/core/src/main/java/site/timecapsulearchive/core/infra/queue/manager/SocialNotificationManager.java +++ b/backend/core/src/main/java/site/timecapsulearchive/core/infra/queue/manager/SocialNotificationManager.java @@ -74,12 +74,10 @@ public void sendGroupInviteMessage( final String groupProfileUrl, final List targetIds ) { - String preSignedUrl = s3PreSignedUrlManager.getS3PreSignedUrlForGet(groupProfileUrl); - basicRabbitTemplate.convertAndSend( RabbitmqComponentConstants.GROUP_INVITE_NOTIFICATION_EXCHANGE.getSuccessComponent(), RabbitmqComponentConstants.GROUP_INVITE_NOTIFICATION_QUEUE.getSuccessComponent(), - GroupInviteNotificationDto.createOf(ownerNickname, preSignedUrl, targetIds) + GroupInviteNotificationDto.createOf(ownerNickname, groupProfileUrl, targetIds) ); } From 0d49e93354f5d7d347a93edbb4178ec53a2cc7b9 Mon Sep 17 00:00:00 2001 From: hong seokho Date: Wed, 19 Jun 2024 23:01:44 +0900 Subject: [PATCH 3/4] =?UTF-8?q?fix=20:=20=EC=82=AC=EC=9A=A9=EC=9E=90?= =?UTF-8?q?=EA=B0=80=20=EC=86=8D=ED=95=9C=20=EA=B7=B8=EB=A3=B9=20=EC=BA=A1?= =?UTF-8?q?=EC=8A=90=20=EC=A1=B0=ED=9A=8C=ED=95=98=EB=8F=84=EB=A1=9D=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../capsule/CapsuleQueryRepositoryImpl.java | 29 ++++++++++++++++--- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/backend/core/src/main/java/site/timecapsulearchive/core/domain/capsule/generic_capsule/repository/capsule/CapsuleQueryRepositoryImpl.java b/backend/core/src/main/java/site/timecapsulearchive/core/domain/capsule/generic_capsule/repository/capsule/CapsuleQueryRepositoryImpl.java index 2e4301ecb..d03d89a55 100644 --- a/backend/core/src/main/java/site/timecapsulearchive/core/domain/capsule/generic_capsule/repository/capsule/CapsuleQueryRepositoryImpl.java +++ b/backend/core/src/main/java/site/timecapsulearchive/core/domain/capsule/generic_capsule/repository/capsule/CapsuleQueryRepositoryImpl.java @@ -3,11 +3,13 @@ import static site.timecapsulearchive.core.domain.capsule.entity.QCapsule.capsule; import static site.timecapsulearchive.core.domain.capsuleskin.entity.QCapsuleSkin.capsuleSkin; import static site.timecapsulearchive.core.domain.member.entity.QMember.member; +import static site.timecapsulearchive.core.domain.member_group.entity.QMemberGroup.memberGroup; import com.querydsl.core.types.Projections; import com.querydsl.core.types.dsl.BooleanExpression; import com.querydsl.core.types.dsl.ComparablePath; import com.querydsl.core.types.dsl.Expressions; +import com.querydsl.jpa.impl.JPAQuery; import com.querydsl.jpa.impl.JPAQueryFactory; import java.util.List; import java.util.Optional; @@ -41,7 +43,7 @@ public List findARCapsuleSummaryDtosByCurrentLocation final Polygon mbr, final CapsuleType capsuleType ) { - return jpaQueryFactory + JPAQuery dynamicQuery = jpaQueryFactory .select( Projections.constructor( NearbyARCapsuleSummaryDto.class, @@ -57,7 +59,11 @@ public List findARCapsuleSummaryDtosByCurrentLocation ) .from(capsule) .join(capsule.capsuleSkin, capsuleSkin) - .join(capsule.member, member) + .join(capsule.member, member); + + joinMemberGroupForGroupCapsule(memberId, capsuleType, dynamicQuery); + + return dynamicQuery .where(ST_Contains(mbr, capsule.point).and(capsuleFilter(capsuleType, memberId))) .fetch(); } @@ -66,6 +72,7 @@ private BooleanExpression capsuleFilter(CapsuleType capsuleType, Long memberId) return switch (capsuleType) { case ALL -> capsule.member.id.eq(memberId); case TREASURE -> capsule.type.eq(capsuleType); + case GROUP -> capsule.type.eq(CapsuleType.GROUP); default -> capsule.type.eq(capsuleType).and(capsule.member.id.eq(memberId)); }; } @@ -84,7 +91,7 @@ public List findCapsuleSummaryDtosByCurrentLocationAndC final Polygon mbr, final CapsuleType capsuleType ) { - return jpaQueryFactory + JPAQuery dynamicQuery = jpaQueryFactory .select( Projections.constructor( NearbyCapsuleSummaryDto.class, @@ -95,11 +102,25 @@ public List findCapsuleSummaryDtosByCurrentLocationAndC ) .from(capsule) .join(capsule.capsuleSkin, capsuleSkin) - .join(capsule.member, member) + .join(capsule.member, member); + + joinMemberGroupForGroupCapsule(memberId, capsuleType, dynamicQuery); + + return dynamicQuery .where(ST_Contains(mbr, capsule.point).and(capsuleFilter(capsuleType, memberId))) .fetch(); } + private void joinMemberGroupForGroupCapsule(Long memberId, CapsuleType capsuleType, + JPAQuery dynamicQuery) { + if (capsuleType.equals(CapsuleType.GROUP)) { + dynamicQuery + .join(memberGroup).on(memberGroup.member.id.eq(capsule.member.id) + .and(memberGroup.member.id.eq(memberId)) + ); + } + } + /** * 지도에서 사용자의 친구들의 캡슐을 찾기 위해 현재 위치에서 범위 내의 사용자의 친구가 만든 캡슐을 조회한다. * From b5f94b69b45c2613f47987778b5587a4e7423fad Mon Sep 17 00:00:00 2001 From: GaBaljaintheroom Date: Wed, 19 Jun 2024 23:37:23 +0900 Subject: [PATCH 4/4] =?UTF-8?q?refact=20:=20=EC=BA=A1=EC=8A=90=20=EC=8A=A4?= =?UTF-8?q?=ED=82=A8=20=EC=A0=80=EC=9E=A5=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/domain/capsuleskin/entity/CapsuleSkin.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/core/src/main/java/site/timecapsulearchive/core/domain/capsuleskin/entity/CapsuleSkin.java b/backend/core/src/main/java/site/timecapsulearchive/core/domain/capsuleskin/entity/CapsuleSkin.java index e924d45ad..820c9b849 100644 --- a/backend/core/src/main/java/site/timecapsulearchive/core/domain/capsuleskin/entity/CapsuleSkin.java +++ b/backend/core/src/main/java/site/timecapsulearchive/core/domain/capsuleskin/entity/CapsuleSkin.java @@ -58,8 +58,8 @@ private CapsuleSkin(String skinName, String imageUrl, Motion motionName, Member } private CapsuleSkin(String skinName, String imageUrl, Member member) { - this.skinName = - this.imageUrl = imageUrl; + this.skinName = skinName; + this.imageUrl = imageUrl; this.member = member; }