From 9b947638bcb56344b9e3eb83003f3d070f1917b9 Mon Sep 17 00:00:00 2001 From: Nikos Nikolaidis Date: Mon, 21 Nov 2022 17:37:47 +0200 Subject: [PATCH] Remove all CrossOrigin annotations from InterestController (#17) --- .../interestapi/controller/InterestController.java | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/main/java/gr/zisis/interestapi/controller/InterestController.java b/src/main/java/gr/zisis/interestapi/controller/InterestController.java index a636e07..5e446b6 100644 --- a/src/main/java/gr/zisis/interestapi/controller/InterestController.java +++ b/src/main/java/gr/zisis/interestapi/controller/InterestController.java @@ -38,7 +38,6 @@ public class InterestController { @Autowired private ProjectsService projectsService; - @CrossOrigin(origins = "*") @GetMapping(value = "/cumulativeInterest") Collection getCumulativeInterestPerCommit(@RequestParam(required = true) String url, @RequestParam(required = false) String sha) { if (Objects.isNull(sha)) @@ -46,61 +45,51 @@ Collection getCumulativeInterestPerCommit(@RequestParam(requ return metricsService.findCumulativeInterestByCommit(url, sha); } - @CrossOrigin(origins = "*") @GetMapping(value = "/interestPerCommitFile") Collection getInterestPerCommitFile(@RequestParam(required = true) String url, @RequestParam(required = true) String sha, @RequestParam(required = true) String filePath) { return metricsService.findInterestByCommitFile(url, sha, filePath); } - @CrossOrigin(origins = "*") @GetMapping(value = "/interestChange") Collection getLastCommitInterestChange(@RequestParam(required = true) String url, @RequestParam(required = true) String sha) { return metricsService.findInterestChangeByCommit(url, sha); } - @CrossOrigin(origins = "*") @GetMapping(value = "/fileInterestChange") FileInterestChange getFileInterestChange(@RequestParam(required = true) String url, @RequestParam(required = true) String sha, @RequestParam(required = true) String filePath) { return metricsService.findInterestChangeByCommitAndFile(url, sha, filePath); } - @CrossOrigin(origins = "*") @GetMapping(value = "/normalizedInterest") Collection getNormalizedInterest(@RequestParam(required = true) String url, @RequestParam(required = false) String sha) { return (Objects.isNull(sha)) ? metricsService.findNormalizedInterest(url) : metricsService.findNormalizedInterestByCommit(url, sha); } - @CrossOrigin(origins = "*") @GetMapping(value = "/highInterestFiles") Collection getHighInterestFiles(@RequestParam(required = true) String url, @RequestParam(required = true) String sha, @RequestParam(required = false) Integer limit) { return Objects.isNull(limit) ? metricsService.findHighInterestFiles(null, url, sha).getContent() : metricsService.findHighInterestFiles(PageRequest.of(0, limit), url, sha).getContent(); } - @CrossOrigin(origins = "*") @GetMapping(value = "/reusabilityMetrics") Collection getReusabilityMetrics(@RequestParam(required = true) String url, @RequestParam(required = false) Integer limit) { return Objects.isNull(limit) ? metricsService.findReusabilityMetrics(null, url).getContent() : metricsService.findReusabilityMetrics(PageRequest.of(0, limit), url).getContent(); } - @CrossOrigin(origins = "*") @GetMapping(value = "/reusabilityMetricsByCommit") Collection getReusabilityMetricsByCommit(@RequestParam(required = true) String url, @RequestParam(required = true) String sha, @RequestParam(required = false) Integer limit) { return Objects.isNull(limit) ? metricsService.findReusabilityMetrics(null, url, sha).getContent() : metricsService.findReusabilityMetrics(PageRequest.of(0, limit), url, sha).getContent(); } - @CrossOrigin(origins = "*") @GetMapping(value = "/reusabilityMetricsByCommitAndFile") Collection getReusabilityMetricsByCommitAndFile(@RequestParam(required = true) String url, @RequestParam(required = true) String sha, @RequestParam(required = true) String filePath, @RequestParam(required = false) Integer limit) { return Objects.isNull(limit) ? metricsService.findReusabilityMetrics(null, url, sha, filePath).getContent() : metricsService.findReusabilityMetrics(PageRequest.of(0, limit), url, sha, filePath).getContent(); } - @CrossOrigin(origins = "*") @GetMapping(value = "/analyzedCommits") Collection getAnalyzedCommitIds(@RequestParam(required = true) String url, @RequestParam(required = false) Integer limit) { return Objects.isNull(limit) ? metricsService.findAnalyzedCommits(null, url).getContent() : metricsService.findAnalyzedCommits(PageRequest.of(0, limit), url).getContent(); } - @CrossOrigin(origins = "*") @PostMapping(path = "/startInterestAnalysis", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) ResponseEntity startInterestAnalysis(@RequestBody(required = true) AnalysisInfo info) throws IOException { try {