From c1988970a92e122ebc3efc74db5434060911addb Mon Sep 17 00:00:00 2001 From: adongare Date: Mon, 5 Aug 2024 09:54:21 -0400 Subject: [PATCH] MAT-7060 deleted admin controller --- .../controllers/AdminController.java | 36 ------------------- 1 file changed, 36 deletions(-) delete mode 100644 src/main/java/gov/cms/madie/cqllibraryservice/controllers/AdminController.java diff --git a/src/main/java/gov/cms/madie/cqllibraryservice/controllers/AdminController.java b/src/main/java/gov/cms/madie/cqllibraryservice/controllers/AdminController.java deleted file mode 100644 index 478c028..0000000 --- a/src/main/java/gov/cms/madie/cqllibraryservice/controllers/AdminController.java +++ /dev/null @@ -1,36 +0,0 @@ -package gov.cms.madie.cqllibraryservice.controllers; - -import gov.cms.madie.cqllibraryservice.dto.LibraryUsage; -import gov.cms.madie.cqllibraryservice.services.CqlLibraryService; -import jakarta.servlet.http.HttpServletRequest; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -import java.util.List; - -@Slf4j -@RestController -@RequestMapping("/admin") -@RequiredArgsConstructor -public class AdminController { - private final CqlLibraryService cqlLibraryService; - - @GetMapping( - value = "/library-usage", - produces = {MediaType.APPLICATION_JSON_VALUE}) - @PreAuthorize("#request.getHeader('api-key') == #apiKey") - public ResponseEntity> getLibraryUsage( - HttpServletRequest request, - @RequestParam("libraryName") String libraryName, - @Value("${lambda-api-key}") String apiKey) { - return ResponseEntity.badRequest().body(cqlLibraryService.findLibraryUsage(libraryName)); - } -}