-
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.
* [�Feat] Hexagonal architecture #129 (#131) * 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으로 이동 * [Fix] FirebaseSubscribeService의 토큰 검증 로직 변경 (#133) verifyIdToken의 경우 클라이언트 측에서 별도의 ID 토큰을 생성하여 전달해주어야 하기 때문에 일단 기존의 방식으로 변경한다 * fix(NoticeQueryApiV2#getNotices): 학과공지 조회에서 important필드 결여로 인한 문제 해결 완료 (#135) * [Feat] Api docs v2 #125 (#136) * setting: Swagger 의존성 추가 * feat: API 문서화 완료 * setting: Swagger, TestContainer 버전 변경 * setting: SpringBoot version migration from 2.5.5 to 2.7.18 * feat: 문서화에서 제외할 Controller들에게 Hidden 추가 * setting: 사용하지 않는 gradle의 과정 제거
- Loading branch information
1 parent
c2b35e9
commit 738fdbe
Showing
218 changed files
with
3,339 additions
and
14,783 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
69 changes: 69 additions & 0 deletions
69
src/main/java/com/kustacks/kuring/admin/adapter/in/web/AdminCommandApiV2.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,69 @@ | ||
package com.kustacks.kuring.admin.adapter.in.web; | ||
|
||
import static com.kustacks.kuring.common.dto.ResponseCodeAndMessages.ADMIN_REAL_NOTICE_CREATE_SUCCESS; | ||
import static com.kustacks.kuring.common.dto.ResponseCodeAndMessages.ADMIN_TEST_NOTICE_CREATE_SUCCESS; | ||
|
||
import com.kustacks.kuring.admin.adapter.in.web.dto.RealNotificationRequest; | ||
import com.kustacks.kuring.admin.adapter.in.web.dto.TestNotificationRequest; | ||
import com.kustacks.kuring.admin.application.port.in.AdminCommandUseCase; | ||
import com.kustacks.kuring.admin.application.port.in.dto.RealNotificationCommand; | ||
import com.kustacks.kuring.admin.domain.AdminRole; | ||
import com.kustacks.kuring.auth.authorization.AuthenticationPrincipal; | ||
import com.kustacks.kuring.auth.context.Authentication; | ||
import com.kustacks.kuring.auth.secured.Secured; | ||
import com.kustacks.kuring.common.dto.BaseResponse; | ||
import io.swagger.v3.oas.annotations.Hidden; | ||
import io.swagger.v3.oas.annotations.Operation; | ||
import io.swagger.v3.oas.annotations.security.SecurityRequirement; | ||
import io.swagger.v3.oas.annotations.tags.Tag; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.http.MediaType; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.validation.annotation.Validated; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.PostMapping; | ||
import org.springframework.web.bind.annotation.RequestBody; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
@Tag(name = "Admin-Command", description = "관리자가 주체가 되는 정보 수정") | ||
@Validated | ||
@RestController | ||
@RequiredArgsConstructor | ||
@RequestMapping(value = "/api/v2/admin", produces = MediaType.APPLICATION_JSON_VALUE) | ||
public class AdminCommandApiV2 { | ||
|
||
private final AdminCommandUseCase adminCommandUseCase; | ||
|
||
@Operation(summary = "테스트 공지 전송", description = "테스트 공지를 전송합니다, 실제 운영시 사용하지 않습니다") | ||
@SecurityRequirement(name = "JWT") | ||
@Secured(AdminRole.ROLE_ROOT) | ||
@PostMapping("/notices/dev") | ||
public ResponseEntity<BaseResponse<String>> createTestNotice( | ||
@RequestBody TestNotificationRequest request | ||
) { | ||
adminCommandUseCase.createTestNotice(request.toCommand()); | ||
return ResponseEntity.ok().body(new BaseResponse<>(ADMIN_TEST_NOTICE_CREATE_SUCCESS, null)); | ||
} | ||
|
||
@Operation(summary = "전체 공지 전송", description = "전체 공지를 전송합니다, 실제 운영시 사용합니다") | ||
@SecurityRequirement(name = "JWT") | ||
@Secured(AdminRole.ROLE_ROOT) | ||
@PostMapping("/notices/prod") | ||
public ResponseEntity<BaseResponse<String>> createRealNotice( | ||
@RequestBody RealNotificationRequest request, | ||
@AuthenticationPrincipal Authentication authentication | ||
) { | ||
RealNotificationCommand command = request.toCommandWithAuthentication(authentication); | ||
adminCommandUseCase.createRealNoticeForAllUser(command); | ||
return ResponseEntity.ok().body(new BaseResponse<>(ADMIN_REAL_NOTICE_CREATE_SUCCESS, null)); | ||
} | ||
|
||
@Hidden | ||
@Secured(AdminRole.ROLE_ROOT) | ||
@GetMapping("/subscribe/all") | ||
public ResponseEntity<Void> subscribe() { | ||
adminCommandUseCase.subscribeAllUserSameTopic(); | ||
return ResponseEntity.ok().build(); | ||
} | ||
} |
Oops, something went wrong.