Skip to content
Snippets Groups Projects

refactor(SystemPropertiesController): use local service instead of REST call...

Merged Nicolas.Rod requested to merge rodn-clean-logs into master
1 file
+ 6
6
Compare changes
  • Side-by-side
  • Inline
@@ -38,6 +38,7 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import ch.unige.solidify.business.IndexFieldAliasService;
import ch.unige.solidify.config.SolidifyProperties;
import ch.unige.solidify.controller.ControllerWithHateoasHome;
import ch.unige.solidify.model.index.FacetProperties;
@@ -46,7 +47,6 @@ import ch.unige.aou.config.AouProperties;
import ch.unige.aou.controller.AdminController;
import ch.unige.aou.model.settings.StaticPage;
import ch.unige.aou.rest.UrlPath;
import ch.unige.aou.service.rest.trusted.TrustedIndexFieldAliasRemoteResourceService;
import ch.unige.aou.service.settings.StaticPageService;
@RestController
@@ -55,7 +55,7 @@ import ch.unige.aou.service.settings.StaticPageService;
public class SystemPropertyController implements ControllerWithHateoasHome {
private final SystemProperties systemProperties;
private final TrustedIndexFieldAliasRemoteResourceService indexFieldAliasRemoteService;
private final IndexFieldAliasService indexFieldAliasService;
private final StaticPageService staticPageService;
private final String indexName;
@@ -119,9 +119,9 @@ public class SystemPropertyController implements ControllerWithHateoasHome {
}
}
public SystemPropertyController(AouProperties aouProperties, SolidifyProperties solidifyProperties,
TrustedIndexFieldAliasRemoteResourceService indexFieldAliasRemoteService, StaticPageService staticPageService) {
this.indexFieldAliasRemoteService = indexFieldAliasRemoteService;
public SystemPropertyController(AouProperties aouProperties, SolidifyProperties solidifyProperties, StaticPageService staticPageService,
IndexFieldAliasService indexFieldAliasService) {
this.indexFieldAliasService = indexFieldAliasService;
this.staticPageService = staticPageService;
this.systemProperties = new SystemProperties(aouProperties, solidifyProperties);
this.systemProperties.add(linkTo(methodOn(this.getClass()).home()).withSelfRel());
@@ -130,7 +130,7 @@ public class SystemPropertyController implements ControllerWithHateoasHome {
@GetMapping
public HttpEntity<SystemProperties> systemProperties() {
this.systemProperties.setSearchFacets(this.indexFieldAliasRemoteService.getFacetProperties(this.indexName));
this.systemProperties.setSearchFacets(this.indexFieldAliasService.getFacetProperties(this.indexName));
this.systemProperties.setStaticPages(this.staticPageService.getStaticPages());
this.systemProperties.removeLinks();
this.systemProperties.add(linkTo(this.getClass()).withSelfRel());
Loading