Add method to calculate extended version of stakeholders if something goes wrong.
This commit is contained in:
parent
009ab187b3
commit
c753d2f45a
|
@ -16,6 +16,7 @@ import org.springframework.scheduling.annotation.EnableScheduling;
|
|||
@SpringBootApplication(scanBasePackages = {"eu.dnetlib.irishmonitorservice"})
|
||||
@PropertySources({
|
||||
@PropertySource("classpath:admintoolslibrary.properties"),
|
||||
@PropertySource("classpath:authorization.properties"),
|
||||
@PropertySource("classpath:authentication.properties"),
|
||||
@PropertySource("classpath:monitorservice.properties"),
|
||||
@PropertySource("classpath:irishmonitorservice.properties"),
|
||||
|
|
|
@ -5,6 +5,7 @@ import eu.dnetlib.irishmonitorservice.entities.StakeholderExtended;
|
|||
import eu.dnetlib.irishmonitorservice.services.StakeholderExtendedService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
|
@ -29,4 +30,11 @@ public class StakeholderExtendedController {
|
|||
public ResponseEntity<StakeholderExtended> getStakeholder(@PathVariable String stakeholderId) throws UnsupportedEncodingException {
|
||||
return ResponseEntity.ok(this.service.getStakeholderExtended(stakeholderId));
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/calculate", method = RequestMethod.GET)
|
||||
@PreAuthorize("hasAuthority(@AuthorizationService.PORTAL_ADMIN)")
|
||||
public ResponseEntity<Void> calculate() {
|
||||
this.service.calculate();
|
||||
return ResponseEntity.noContent().build();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -67,4 +67,8 @@ public class StakeholderExtendedService {
|
|||
}
|
||||
return stakeholders;
|
||||
}
|
||||
|
||||
public void calculate() {
|
||||
this.cacheService.clearCache();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue