99import org .jspecify .annotations .NonNull ;
1010import org .slf4j .Logger ;
1111import org .springframework .web .bind .annotation .GetMapping ;
12+ import org .springframework .web .bind .annotation .RequestMapping ;
1213import org .springframework .web .bind .annotation .RequestParam ;
1314import org .springframework .web .bind .annotation .RestController ;
1415
1516@ RestController
17+ @ RequestMapping ("/api/v2" )
1618public class ApiEndpoint {
1719
1820 private final static Logger log = org .slf4j .LoggerFactory .getLogger (ApiEndpoint .class );
@@ -24,19 +26,19 @@ public ApiEndpoint(@NonNull final GitHubCache issueCache) {
2426 }
2527
2628
27- @ GetMapping ("/api/v2/ contributors" )
29+ @ GetMapping ("/contributors" )
2830 public Set <Contributor > getContributors () {
2931 log .info ("Getting contributors" );
3032 return issueCache .getContributors ();
3133 }
3234
33- @ GetMapping ("/api/v2/ contributors/count" )
35+ @ GetMapping ("/contributors/count" )
3436 public long getContributorCount () {
3537 log .info ("Getting contributors count" );
3638 return issueCache .getContributors ().size ();
3739 }
3840
39- @ GetMapping ("/api/v2/ issues" )
41+ @ GetMapping ("/issues" )
4042 public Set <Issue > getIssues (
4143 @ RequestParam (name = "isAssigned" , required = false ) Boolean isAssigned ,
4244 @ RequestParam (name = "isClosed" , required = false ) Boolean isClosed ,
@@ -58,7 +60,7 @@ public Set<Issue> getIssues(
5860 .collect (Collectors .toUnmodifiableSet ());
5961 }
6062
61- @ GetMapping ("/api/v2/ issues/count" )
63+ @ GetMapping ("/issues/count" )
6264 public long getIssuesCount (
6365 @ RequestParam (name = "isAssigned" , required = false ) Boolean isAssigned ,
6466 @ RequestParam (name = "isClosed" , required = false ) Boolean isClosed ,
@@ -68,12 +70,12 @@ public long getIssuesCount(
6870 return getIssues (isAssigned , isClosed , filteredLabels , excludedLabels , filteredLanguages ).size ();
6971 }
7072
71- @ GetMapping ("/api/v2/ repositories/stars" )
73+ @ GetMapping ("/repositories/stars" )
7274 public long getStarsCount () {
7375 return issueCache .getRepositories ().stream ().mapToLong (repo -> repo .stars ()).sum ();
7476 }
7577
76- @ GetMapping ("/api/v2/ repositories/count" )
78+ @ GetMapping ("/repositories/count" )
7779 public long getRepositoryCount () {
7880 return issueCache .getRepositories ().size ();
7981 }
0 commit comments