diff --git a/backend/core/src/main/java/site/timecapsulearchive/core/domain/auth/service/MessageVerificationService.java b/backend/core/src/main/java/site/timecapsulearchive/core/domain/auth/service/MessageVerificationService.java index 3f9aa0324..69cd6f204 100644 --- a/backend/core/src/main/java/site/timecapsulearchive/core/domain/auth/service/MessageVerificationService.java +++ b/backend/core/src/main/java/site/timecapsulearchive/core/domain/auth/service/MessageVerificationService.java @@ -93,9 +93,9 @@ public TokenResponse validVerificationMessage( throw new CertificationNumberNotMatchException(); } - updateToVerifiedMember(memberId, plain); + final Long verifiedMemberId = updateToVerifiedMember(memberId, plain); - return tokenManager.createNewToken(memberId); + return tokenManager.createNewToken(verifiedMemberId); } private boolean isNotMatch(final String certificationNumber, @@ -103,15 +103,17 @@ private boolean isNotMatch(final String certificationNumber, return !certificationNumber.equals(findCertificationNumber); } - private void updateToVerifiedMember(final Long memberId, final byte[] plain) { + private Long updateToVerifiedMember(final Long memberId, final byte[] plain) { final MemberTemporary memberTemporary = memberTemporaryRepository.findById(memberId) .orElseThrow(MemberNotFoundException::new); memberTemporaryRepository.delete(memberTemporary); - final Member member = memberTemporary.toMember(hashEncryptionManager.encrypt(plain), + final Member verifiedMember = memberTemporary.toMember(hashEncryptionManager.encrypt(plain), aesEncryptionManager.encryptWithPrefixIV(plain)); - memberRepository.save(member); + memberRepository.save(verifiedMember); + + return verifiedMember.getId(); } } diff --git a/backend/core/src/main/java/site/timecapsulearchive/core/domain/capsule/generic_capsule/repository/CapsuleQueryRepository.java b/backend/core/src/main/java/site/timecapsulearchive/core/domain/capsule/generic_capsule/repository/CapsuleQueryRepository.java index a77cc11b3..505e9371e 100644 --- a/backend/core/src/main/java/site/timecapsulearchive/core/domain/capsule/generic_capsule/repository/CapsuleQueryRepository.java +++ b/backend/core/src/main/java/site/timecapsulearchive/core/domain/capsule/generic_capsule/repository/CapsuleQueryRepository.java @@ -56,8 +56,7 @@ public List findARCapsuleSummaryDtosByCurrentLocation .join(capsule.capsuleSkin, capsuleSkin) .join(capsule.member, member) .where(ST_Contains(mbr, capsule.point).and(capsule.member.id.eq(memberId) - .and(eqCapsuleType(capsuleType))) - .and(capsule.type.eq(CapsuleType.PUBLIC))) + .and(eqCapsuleType(capsuleType)))) .fetch(); } diff --git a/backend/core/src/main/resources/config b/backend/core/src/main/resources/config index 681c69474..4fe1e48ab 160000 --- a/backend/core/src/main/resources/config +++ b/backend/core/src/main/resources/config @@ -1 +1 @@ -Subproject commit 681c69474e3afa430e02274b5478a21375c429ee +Subproject commit 4fe1e48abbffd2db9e7662a622c12747c239c79f diff --git a/backend/core/src/test/java/site/timecapsulearchive/core/domain/capsule/generic_capsule/repository/CapsuleQueryRepositoryTest.java b/backend/core/src/test/java/site/timecapsulearchive/core/domain/capsule/generic_capsule/repository/CapsuleQueryRepositoryTest.java index d4ee5bd00..f3d6a84fd 100644 --- a/backend/core/src/test/java/site/timecapsulearchive/core/domain/capsule/generic_capsule/repository/CapsuleQueryRepositoryTest.java +++ b/backend/core/src/test/java/site/timecapsulearchive/core/domain/capsule/generic_capsule/repository/CapsuleQueryRepositoryTest.java @@ -134,6 +134,7 @@ void setup(@Autowired EntityManager entityManager) { //then SoftAssertions.assertSoftly(softly -> { + assertThat(capsules).isNotEmpty(); assertThat(capsules).allMatch(c -> c.capsuleType().equals(capsuleType)); assertThat(capsules).allMatch(c -> myCapsuleIds.contains(c.id())); assertThat(capsules).allMatch(c -> mbr.contains(c.point())); @@ -153,6 +154,7 @@ void setup(@Autowired EntityManager entityManager) { //then SoftAssertions.assertSoftly(softly -> { + assertThat(capsules).isNotEmpty(); assertThat(capsules).allMatch(c -> c.capsuleType().equals(capsuleType)); assertThat(capsules).allMatch(c -> myCapsuleIds.contains(c.id())); assertThat(capsules).allMatch(c -> mbr.contains(c.point())); @@ -172,6 +174,7 @@ void setup(@Autowired EntityManager entityManager) { //then SoftAssertions.assertSoftly(softly -> { + assertThat(capsules).isNotEmpty(); assertThat(capsules).allMatch(c -> c.capsuleType().equals(capsuleType)); assertThat(capsules).allMatch(c -> myCapsuleIds.contains(c.id())); assertThat(capsules).allMatch(c -> mbr.contains(c.point())); @@ -191,6 +194,7 @@ void setup(@Autowired EntityManager entityManager) { //then SoftAssertions.assertSoftly(softly -> { + assertThat(capsules).isNotEmpty(); assertThat(capsules).allMatch(c -> c.capsuleType().equals(capsuleType)); assertThat(capsules).allMatch(c -> myCapsuleIds.contains(c.id())); assertThat(capsules).allMatch(c -> mbr.contains(c.point())); @@ -210,6 +214,7 @@ void setup(@Autowired EntityManager entityManager) { //then SoftAssertions.assertSoftly(softly -> { + assertThat(capsules).isNotEmpty(); assertThat(capsules).allMatch( c -> c.capsuleType().equals(CapsuleType.PUBLIC) || c.capsuleType().equals(CapsuleType.SECRET) || @@ -233,6 +238,7 @@ void setup(@Autowired EntityManager entityManager) { //then SoftAssertions.assertSoftly(softly -> { + assertThat(capsules).isNotEmpty(); assertThat(capsules).allMatch( c -> c.capsuleType().equals(CapsuleType.PUBLIC) || c.capsuleType().equals(CapsuleType.SECRET) || @@ -255,6 +261,7 @@ void setup(@Autowired EntityManager entityManager) { //then SoftAssertions.assertSoftly(softly -> { + assertThat(capsules).isNotEmpty(); assertThat(capsules).allMatch(c -> friendCapsuleIds.contains(c.id())); assertThat(capsules).allMatch(c -> c.capsuleType().equals(CapsuleType.PUBLIC)); assertThat(capsules).allMatch(c -> mbr.contains(c.point())); @@ -268,11 +275,12 @@ void setup(@Autowired EntityManager entityManager) { //when List capsules = capsuleQueryRepository.findFriendsARCapsulesByCurrentLocation( - friendCapsuleIds, mbr + friendIds, mbr ); //then SoftAssertions.assertSoftly(softly -> { + assertThat(capsules).isNotEmpty(); assertThat(capsules).allMatch(c -> friendCapsuleIds.contains(c.id())); assertThat(capsules).allMatch(c -> c.capsuleType().equals(CapsuleType.PUBLIC)); assertThat(capsules).allMatch(c -> mbr.contains(c.point())); diff --git a/backend/notification/src/main/resources/config b/backend/notification/src/main/resources/config index 9ba78f7fb..8d3af3cc4 160000 --- a/backend/notification/src/main/resources/config +++ b/backend/notification/src/main/resources/config @@ -1 +1 @@ -Subproject commit 9ba78f7fb830e195236ce34d400b5a9535683e35 +Subproject commit 8d3af3cc4263c89e6f6421770e64bc9083a7ad6d