Revision 57966
Added by Ioannis Diplas over 4 years ago
DashboardController.java | ||
---|---|---|
33 | 33 |
@Autowired |
34 | 34 |
private PiWikService piWikService; |
35 | 35 |
|
36 |
@RequestMapping(value = "/getRepositoriesSummary/{userEmail}/{page}/{size}" , method = RequestMethod.GET,
|
|
36 |
@RequestMapping(value = "/getRepositoriesSummary/{page}/{size}" , method = RequestMethod.GET, |
|
37 | 37 |
produces = MediaType.APPLICATION_JSON_VALUE) |
38 | 38 |
@ResponseBody |
39 | 39 |
@PreAuthorize("hasRole('ROLE_USER')") |
40 |
public List<RepositorySummaryInfo> getRepositoriesSummaryInfo(@PathVariable("userEmail") String userEmail,
|
|
40 |
public List<RepositorySummaryInfo> getRepositoriesSummaryInfo( |
|
41 | 41 |
@PathVariable("page") String page, |
42 | 42 |
@PathVariable("size") String size) throws JSONException { |
43 |
userEmail = ((OIDCAuthenticationToken) SecurityContextHolder.getContext().getAuthentication()).getUserInfo().getEmail(); |
|
44 |
return dashboardService.getRepositoriesSummaryInfo(userEmail, page, size); |
|
43 |
return dashboardService.getRepositoriesSummaryInfo(((OIDCAuthenticationToken) SecurityContextHolder.getContext().getAuthentication()).getUserInfo().getEmail(), page, size); |
|
45 | 44 |
} |
46 | 45 |
|
47 | 46 |
@RequestMapping(value = "/collectionMonitorSummary/{repoId}" , method = RequestMethod.GET, |
... | ... | |
80 | 79 |
return new UsageSummary(repositoryService.getMetricsInfoForRepository(repoId), piWikService.getPiwikSiteForRepo(repoId)); |
81 | 80 |
} |
82 | 81 |
|
83 |
@RequestMapping(value = "/brokerSummary/{email}/{ds_name}" , method = RequestMethod.GET,
|
|
82 |
@RequestMapping(value = "/brokerSummary/{ds_name}" , method = RequestMethod.GET, |
|
84 | 83 |
produces = MediaType.APPLICATION_JSON_VALUE) |
85 | 84 |
@ResponseBody |
86 | 85 |
@PreAuthorize("hasRole('ROLE_USER')") |
87 | 86 |
public BrokerSummary getBrokerSummary( |
88 |
@PathVariable("email") String email, |
|
89 | 87 |
@PathVariable("ds_name") String datasourceName) throws BrokerException { |
90 |
email = ((OIDCAuthenticationToken) SecurityContextHolder.getContext().getAuthentication()).getUserInfo().getEmail(); |
|
91 |
return new BrokerSummary(brokerService.getSimpleSubscriptionsOfUser(email), brokerService.getTopicsForDatasource(datasourceName)); |
|
88 |
return new BrokerSummary(brokerService.getSimpleSubscriptionsOfUser( ((OIDCAuthenticationToken) SecurityContextHolder.getContext().getAuthentication()).getUserInfo().getEmail()), brokerService.getTopicsForDatasource(datasourceName)); |
|
92 | 89 |
} |
93 | 90 |
|
94 | 91 |
|
Also available in: Unified diff
Clearing unnecessary "user" variables