diff --git a/src/main/java/com/fisa/pg/controller/AdminApiKeyController.java b/src/main/java/com/fisa/pg/controller/AdminController.java similarity index 59% rename from src/main/java/com/fisa/pg/controller/AdminApiKeyController.java rename to src/main/java/com/fisa/pg/controller/AdminController.java index 33765ce..2f8f534 100644 --- a/src/main/java/com/fisa/pg/controller/AdminApiKeyController.java +++ b/src/main/java/com/fisa/pg/controller/AdminController.java @@ -2,7 +2,9 @@ import com.fisa.pg.dto.response.ApiKeyResponseDto; import com.fisa.pg.dto.response.BaseResponse; +import com.fisa.pg.dto.response.WebhookResponseDto; import com.fisa.pg.service.ApiKeyService; +import com.fisa.pg.service.WebhookService; import lombok.RequiredArgsConstructor; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; @@ -12,19 +14,20 @@ import org.springframework.web.bind.annotation.RestController; /** - * 관리자용 API 키 관리 컨트롤러 + * 관리자 전용 컨트롤러 *
- * 이 컨트롤러는 관리자에게 모든 가맹점의 API 키를 조회할 수 있는 엔드포인트를 제공합니다. - * 관리자 인증이 필요한 API이며, 가맹점 별 API 키 발급 및 관리 현황을 모니터링하는 용도로 사용됩니다. + * 이 컨트롤러는 관리자 전용 API를 제공합니다. *
*/ @RestController @RequiredArgsConstructor -@RequestMapping("/api/admin/api-keys") -public class AdminApiKeyController { +@RequestMapping("/api/admin") +public class AdminController { private final ApiKeyService apiKeyService; + private final WebhookService webhookService; + /** * 전체 API 키 목록 페이징 조회 API * @@ -32,12 +35,21 @@ public class AdminApiKeyController { * @return 페이징된 API 키 목록과 함께 200 OK 응답 * @throws IllegalArgumentException 페이징 파라미터가 유효하지 않은 경우 발생 */ - @GetMapping - public ResponseEntity- * 이 컨트롤러는 가맹점에게 자신의 API 키를 생성, 조회 및 비활성화할 수 있는 엔드포인트를 제공합니다. - * 가맹점은 인증된 상태에서만 이 API를 사용할 수 있으며, 자신의 API 키만 관리할 수 있습니다. - * API 키는 가맹점이 PG 시스템과 연동하기 위해 필요한 인증 수단입니다. + * 가맹점은 인증된 상태에서만 이 API를 사용할 수 있습니다. *
*/ @Slf4j @RestController @RequiredArgsConstructor -@RequestMapping("/api/merchants/api-keys") -public class MerchantApiKeyController { +@RequestMapping("/api/merchants") +public class MerchantController { private final ApiKeyService apiKeyService; + private final WebhookService webhookService; + /** * 가맹점용 API 키 발급 엔드포인트 *
@@ -47,7 +51,7 @@ public class MerchantApiKeyController {
* @return 생성된 API 키 정보와 함께 201 Created 응답
* @throws jakarta.validation.ConstraintViolationException 요청 데이터 유효성 검증 실패 시
*/
- @PostMapping
+ @PostMapping("/api-keys")
public ResponseEntity
+ * 가맹점의 웹훅을 생성합니다.
+ *
+ * @param merchant 웹훅을 생성할 가맹점
+ * @param requestDto 웹훅 요청 DTO
+ * @return 웹훅 응답 DTO
+ */
+ @PostMapping("/webhook")
+ public ResponseEntity
+ * 가맹점의 웹훅 설정 정보를 조회합니다.
+ *
+ * @param merchant 로그인한 가맹점
+ * @return 웹훅 응답 DTO
+ */
+ @GetMapping("/webhook")
+ public ResponseEntity
- * 가맹점의 웹훅을 생성하는 API를 제공합니다.
- */
-@RestController
-@RequestMapping("/api/merchant")
-@RequiredArgsConstructor
-public class MerchantWebhookController {
-
- private final WebhookService webhookService;
-
- /**
- * 가맹점 웹훅 생성 API
- *
- * 가맹점의 웹훅을 생성합니다.
- *
- * @param merchant 웹훅을 생성할 가맹점
- * @param requestDto 웹훅 요청 DTO
- * @return 웹훅 응답 DTO
- */
- @PostMapping("/webhook")
- public ResponseEntity
- * 가맹점의 웹훅 설정 정보를 조회합니다.
- *
- * @param merchant 로그인한 가맹점
- * @return 웹훅 응답 DTO
- */
- @GetMapping("/webhook")
- public ResponseEntity