Usage summary custom return object with PiwikInfo and MetricsInfo
This commit is contained in:
parent
8f1e214a6b
commit
9bc44f8f97
|
@ -2,6 +2,7 @@ package eu.dnetlib.repo.manager.controllers;
|
||||||
|
|
||||||
import eu.dnetlib.repo.manager.domain.BrokerSummary;
|
import eu.dnetlib.repo.manager.domain.BrokerSummary;
|
||||||
import eu.dnetlib.repo.manager.domain.RepositorySummaryInfo;
|
import eu.dnetlib.repo.manager.domain.RepositorySummaryInfo;
|
||||||
|
import eu.dnetlib.repo.manager.domain.UsageSummary;
|
||||||
import eu.dnetlib.repo.manager.service.BrokerService;
|
import eu.dnetlib.repo.manager.service.BrokerService;
|
||||||
import eu.dnetlib.repo.manager.service.DashboardService;
|
import eu.dnetlib.repo.manager.service.DashboardService;
|
||||||
import eu.dnetlib.repo.manager.service.PiWikService;
|
import eu.dnetlib.repo.manager.service.PiWikService;
|
||||||
|
@ -33,6 +34,9 @@ public class DashboardController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private BrokerService brokerService;
|
private BrokerService brokerService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private PiWikService piWikService;
|
||||||
|
|
||||||
@RequestMapping(value = "/getRepositoriesSummary/{userEmail}/{page}/{size}" , method = RequestMethod.GET,
|
@RequestMapping(value = "/getRepositoriesSummary/{userEmail}/{page}/{size}" , method = RequestMethod.GET,
|
||||||
produces = MediaType.APPLICATION_JSON_VALUE)
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
|
@ -57,9 +61,9 @@ public class DashboardController {
|
||||||
produces = MediaType.APPLICATION_JSON_VALUE)
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
@PreAuthorize("hasRole('ROLE_USER')")
|
@PreAuthorize("hasRole('ROLE_USER')")
|
||||||
public MetricsInfo getUsageSummary(
|
public UsageSummary getUsageSummary(
|
||||||
@PathVariable("repoId") String repoId) throws RepositoryServiceException {
|
@PathVariable("repoId") String repoId) throws RepositoryServiceException {
|
||||||
return repositoryService.getMetricsInfoForRepository(repoId);
|
return new UsageSummary(repositoryService.getMetricsInfoForRepository(repoId), piWikService.getPiwikSiteForRepo(repoId));
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "/brokerSummary/{email}/{ds_name}" , method = RequestMethod.GET,
|
@RequestMapping(value = "/brokerSummary/{email}/{ds_name}" , method = RequestMethod.GET,
|
||||||
|
|
|
@ -0,0 +1,39 @@
|
||||||
|
package eu.dnetlib.repo.manager.domain;
|
||||||
|
|
||||||
|
import eu.dnetlib.domain.data.PiwikInfo;
|
||||||
|
import eu.dnetlib.repo.manager.shared.MetricsInfo;
|
||||||
|
import eu.dnetlib.repo.manager.shared.broker.BrowseEntry;
|
||||||
|
import eu.dnetlib.repo.manager.shared.broker.SimpleSubscriptionDesc;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class UsageSummary {
|
||||||
|
private MetricsInfo metricsInfo;
|
||||||
|
|
||||||
|
private PiwikInfo piwikInfo;
|
||||||
|
|
||||||
|
public UsageSummary() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public UsageSummary(MetricsInfo metricsInfo, PiwikInfo piwikInfo) {
|
||||||
|
this.metricsInfo = metricsInfo;
|
||||||
|
this.piwikInfo = piwikInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MetricsInfo getMetricsInfo() {
|
||||||
|
return metricsInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMetricsInfo(MetricsInfo metricsInfo) {
|
||||||
|
this.metricsInfo = metricsInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PiwikInfo getPiwikInfo() {
|
||||||
|
return piwikInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPiwikInfo(PiwikInfo piwikInfo) {
|
||||||
|
this.piwikInfo = piwikInfo;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue