Revision 56961
Added by Ioannis Diplas over 4 years ago
ValidatorController.java | ||
---|---|---|
1 | 1 |
package eu.dnetlib.repo.manager.controllers; |
2 | 2 |
|
3 | 3 |
import eu.dnetlib.api.functionality.ValidatorServiceException; |
4 |
import eu.dnetlib.domain.data.RepositoryInterface; |
|
4 | 5 |
import eu.dnetlib.domain.functionality.validator.StoredJob; |
6 |
import eu.dnetlib.repo.manager.exception.ResourceNotFoundException; |
|
7 |
import eu.dnetlib.repo.manager.service.EmailUtils; |
|
8 |
import eu.dnetlib.repo.manager.service.RepositoryService; |
|
5 | 9 |
import eu.dnetlib.repo.manager.service.ValidatorServiceImpl; |
6 | 10 |
import eu.dnetlib.repo.manager.shared.InterfaceInformation; |
7 | 11 |
import eu.dnetlib.repo.manager.shared.ValidationServiceException; |
... | ... | |
28 | 32 |
@Autowired |
29 | 33 |
private ValidatorServiceImpl validatorService; |
30 | 34 |
|
35 |
@Autowired |
|
36 |
private EmailUtils emailUtils; |
|
37 |
|
|
31 | 38 |
@RequestMapping(value = "/submitJobForValidation",method = RequestMethod.POST, |
32 | 39 |
consumes = MediaType.APPLICATION_JSON_VALUE, |
33 | 40 |
produces = MediaType.APPLICATION_JSON_VALUE) |
... | ... | |
94 | 101 |
|
95 | 102 |
@RequestMapping(value = "/getInterfaceInformation" , method = RequestMethod.GET,produces = MediaType.APPLICATION_JSON_VALUE) |
96 | 103 |
@ResponseBody |
97 |
public InterfaceInformation getInterfaceInformation(@RequestParam(value = "baseUrl", required = true) String baseUrl) throws ValidationServiceException {
|
|
104 |
public InterfaceInformation getInterfaceInformation(@RequestParam(value = "baseUrl") String baseUrl) throws ValidationServiceException { |
|
98 | 105 |
return validatorService.getInterfaceInformation(baseUrl); |
99 | 106 |
} |
100 | 107 |
|
101 | 108 |
|
109 |
@RequestMapping(value = "/complete" , method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE) |
|
110 |
@ResponseBody |
|
111 |
public void validationCompleted( |
|
112 |
@RequestParam(value = "interfaceId") String interfaceId, |
|
113 |
@RequestParam(value = "repoId") String repoId, |
|
114 |
@RequestParam(value = "jobId") String jobId, |
|
115 |
@RequestParam(value = "issuerEmail") String issuerEmail, |
|
116 |
@RequestParam(value = "isUpdate") boolean isUpdate, |
|
117 |
@RequestParam(value = "isSuccess") boolean isSuccess, |
|
118 |
@RequestParam(value = "scoreUsage") int scoreUsage, |
|
119 |
@RequestParam(value = "scoreContent") int scoreContent) throws Exception { |
|
120 |
|
|
121 |
emailUtils.sendUponJobCompletion(repoId,interfaceId,scoreUsage,scoreContent,isSuccess,isUpdate,issuerEmail, jobId); |
|
122 |
} |
|
123 |
|
|
124 |
|
|
102 | 125 |
} |
Also available in: Unified diff
fixing from & quantity values for export-to-csv functionality