-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* setting(archUnit): 아키텍처 테스팅 의존성 추가 * test(HexagonalArchitecture): User의 HexagonalArchitecture 검증 * refactor: User 도메인 헥사고날 아키텍처로 전환 * feat: 헥사고날 애너테이션 적용 * refactor: API가 포트에 의존하도록 변경 * refactor: UseCase의 구현체들이 Port에 의존하도록 리팩토링 * test: Notice의 HexagonalArchitecture 검증 * refactor: Notice 도메인 헥사고날 아키텍처로 전환 * test: Admin의 HexagonalArchitecture 검증 * refactor(NoticeUpdateSupport): NoticeUpdateSupport 일부 로직 수정 * refactor: Admin 도메인 헥사고날 아키텍처로 전환 * refactor: 필요없는 설정파일 삭제 * test: Staff의 HexagonalArchitecture 검증 * refactor: Staff 도메인 헥사고날 아키텍처로 전환 * feat: User 도메인의 Firebase 로직을 Event로 처리하도록 구현 * feat: User-Token을 preHandler로 검증하도록 변경 * feat(MessageUserEventListener): Token Validation 리스너 제거 * feat(FirebaseService): 비즈니스 로직이 port에 의존하도록 리팩토링 * feat(FirebaseWithAdminUseCase): 어드민의 공지 전송 작업을 이벤트로 구현 * refactor: 기존의 단일 FirebaseService 를 구독과 공지 전송 2개의 서비스로 분리한다 * refactor(DependencyRuleTests): 기존 아키텍처 검증에서 event 페키지 추가 검증하도록 구현 * fix: QueryDsl이 사용하는 dto의 경로 재설정 * chore: 테스트 서식 지정자 제거와 주석 제거 * docs(README): 문서 업데이트 * refactor(ServerProperties): 공통으로 사용중인 서버의 환경변수를 Common 패키지 하부로 이동 * refactor(FirebaseExceptionHandler): exception handler의 페키지를 adapter.out으로 이동
- Loading branch information
1 parent
c2b35e9
commit f5f2faa
Showing
194 changed files
with
3,150 additions
and
1,654 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
src/main/java/com/kustacks/kuring/admin/adapter/in/web/dto/RealNotificationRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package com.kustacks.kuring.admin.adapter.in.web.dto; | ||
|
||
import com.kustacks.kuring.admin.application.port.in.dto.RealNotificationCommand; | ||
import com.kustacks.kuring.auth.context.Authentication; | ||
|
||
public record RealNotificationRequest( | ||
String title, | ||
String body, | ||
String url, | ||
String adminPassword | ||
) { | ||
public RealNotificationCommand toCommandWithAuthentication(Authentication authentication) { | ||
return new RealNotificationCommand(title, body, url, adminPassword, authentication); | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
src/main/java/com/kustacks/kuring/admin/adapter/in/web/dto/TestNotificationRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package com.kustacks.kuring.admin.adapter.in.web.dto; | ||
|
||
import com.kustacks.kuring.admin.application.port.in.dto.TestNotificationCommand; | ||
|
||
public record TestNotificationRequest( | ||
String category, | ||
String subject, | ||
String articleId | ||
) { | ||
|
||
public TestNotificationCommand toCommand() { | ||
return new TestNotificationCommand(category, subject, articleId); | ||
} | ||
} |
40 changes: 40 additions & 0 deletions
40
src/main/java/com/kustacks/kuring/admin/adapter/out/event/AdminFirebaseMessageAdapter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package com.kustacks.kuring.admin.adapter.out.event; | ||
|
||
import com.kustacks.kuring.admin.application.port.out.AdminEventPort; | ||
import com.kustacks.kuring.common.domain.Events; | ||
import com.kustacks.kuring.message.adapter.in.event.dto.AdminNotificationEvent; | ||
import com.kustacks.kuring.message.adapter.in.event.dto.AdminTestNotificationEvent; | ||
import com.kustacks.kuring.message.application.service.exception.FirebaseMessageSendException; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.stereotype.Component; | ||
|
||
@Component | ||
@RequiredArgsConstructor | ||
public class AdminFirebaseMessageAdapter implements AdminEventPort { | ||
|
||
@Override | ||
public void sendNotificationByAdmin(String title, String body, String url) { | ||
Events.raise(new AdminNotificationEvent(title, body, url)); | ||
} | ||
|
||
@Override | ||
public void sendTestNotificationByAdmin( | ||
String articleId, | ||
String postedDate, | ||
String categoryName, | ||
String subject, | ||
String korName, | ||
String url | ||
) throws FirebaseMessageSendException { | ||
Events.raise( | ||
AdminTestNotificationEvent.builder() | ||
.articleId(articleId) | ||
.postedDate(postedDate) | ||
.category(categoryName) | ||
.subject(subject) | ||
.categoryKorName(korName) | ||
.baseUrl(url) | ||
.build() | ||
); | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
src/main/java/com/kustacks/kuring/admin/adapter/out/persistence/AdminPersistenceAdapter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package com.kustacks.kuring.admin.adapter.out.persistence; | ||
|
||
import com.kustacks.kuring.admin.application.port.out.AdminCommandPort; | ||
import com.kustacks.kuring.admin.domain.Admin; | ||
import com.kustacks.kuring.admin.application.port.out.AdminQueryPort; | ||
import com.kustacks.kuring.common.annotation.PersistenceAdapter; | ||
import lombok.RequiredArgsConstructor; | ||
|
||
import java.util.Optional; | ||
|
||
@PersistenceAdapter | ||
@RequiredArgsConstructor | ||
public class AdminPersistenceAdapter implements AdminQueryPort, AdminCommandPort { | ||
|
||
private final AdminRepository adminRepository; | ||
|
||
@Override | ||
public Optional<Admin> findByLoginId(String loginId) { | ||
return adminRepository.findByLoginId(loginId); | ||
} | ||
|
||
@Override | ||
public void save(Admin admin) { | ||
this.adminRepository.save(admin); | ||
} | ||
} |
3 changes: 2 additions & 1 deletion
3
.../kuring/admin/domain/AdminRepository.java → ...pter/out/persistence/AdminRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
src/main/java/com/kustacks/kuring/admin/application/port/in/AdminCommandUseCase.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package com.kustacks.kuring.admin.application.port.in; | ||
|
||
import com.kustacks.kuring.admin.application.port.in.dto.RealNotificationCommand; | ||
import com.kustacks.kuring.admin.application.port.in.dto.TestNotificationCommand; | ||
|
||
public interface AdminCommandUseCase { | ||
void createTestNotice(TestNotificationCommand command); | ||
void createRealNoticeForAllUser(RealNotificationCommand command); | ||
void subscribeAllUserSameTopic(); | ||
} |
9 changes: 9 additions & 0 deletions
9
src/main/java/com/kustacks/kuring/admin/application/port/in/AdminQueryUseCase.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package com.kustacks.kuring.admin.application.port.in; | ||
|
||
import com.kustacks.kuring.user.application.port.in.dto.AdminFeedbacksResult; | ||
|
||
import java.util.List; | ||
|
||
public interface AdminQueryUseCase { | ||
List<AdminFeedbacksResult> lookupFeedbacks(int page, int size); | ||
} |
15 changes: 15 additions & 0 deletions
15
src/main/java/com/kustacks/kuring/admin/application/port/in/dto/RealNotificationCommand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package com.kustacks.kuring.admin.application.port.in.dto; | ||
|
||
import com.kustacks.kuring.auth.context.Authentication; | ||
|
||
public record RealNotificationCommand( | ||
String title, | ||
String body, | ||
String url, | ||
String adminPassword, | ||
Authentication authentication | ||
) { | ||
public String getStringPrincipal() { | ||
return String.valueOf(this.authentication.getPrincipal()); | ||
} | ||
} |
Oops, something went wrong.