Skip to content

Commit

Permalink
Remove all CrossOrigin annotations from InterestController (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
nikosnikolaidis authored Nov 21, 2022
1 parent 60d7036 commit 9b94763
Showing 1 changed file with 0 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,69 +38,58 @@ public class InterestController {
@Autowired
private ProjectsService projectsService;

@CrossOrigin(origins = "*")
@GetMapping(value = "/cumulativeInterest")
Collection<CumulativeInterest> getCumulativeInterestPerCommit(@RequestParam(required = true) String url, @RequestParam(required = false) String sha) {
if (Objects.isNull(sha))
return metricsService.findCumulativeInterestPerCommit(url);
return metricsService.findCumulativeInterestByCommit(url, sha);
}

@CrossOrigin(origins = "*")
@GetMapping(value = "/interestPerCommitFile")
Collection<InterestPerCommitFile> 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<InterestChange> 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<NormalizedInterest> 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<HighInterestFile> 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<ProjectReusabilityMetrics> 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<FileReusabilityMetrics> 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<FileReusabilityMetrics> 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<AnalyzedCommit> 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<Project> startInterestAnalysis(@RequestBody(required = true) AnalysisInfo info) throws IOException {
try {
Expand Down

0 comments on commit 9b94763

Please sign in to comment.