Compare commits
No commits in common. "13618db55aee18ef28c87177db5cc33b4a9f0382" and "81b0b6f912cea582c2952f4fb86a136718ce81b5" have entirely different histories.
13618db55a
...
81b0b6f912
2 changed files with 11 additions and 20 deletions
|
@ -33,8 +33,6 @@ import com.oguerreiro.resilient.domain.enumeration.DashboardComponentView;
|
|||
import com.oguerreiro.resilient.repository.DashboardComponentRepository;
|
||||
import com.oguerreiro.resilient.repository.OrganizationRepository;
|
||||
import com.oguerreiro.resilient.service.dto.DashboardComponentDTO;
|
||||
import com.oguerreiro.resilient.service.dto.DashboardComponentDetailValueDTO;
|
||||
import com.oguerreiro.resilient.service.mapper.DashboardComponentDetailValueMapper;
|
||||
import com.oguerreiro.resilient.service.mapper.DashboardComponentMapper;
|
||||
|
||||
/**
|
||||
|
@ -47,25 +45,13 @@ public class DashboardComponentService
|
|||
|
||||
private OrganizationRepository organizationRepository;
|
||||
private DashboardComponentMapper dashboardComponentMapper;
|
||||
private final DashboardComponentDetailValueMapper dashboardComponentDetailValueMapper;
|
||||
|
||||
public DashboardComponentService(DashboardComponentRepository dashboardComponentRepository,
|
||||
DashboardComponentMapper dashboardComponentMapper, OrganizationRepository organizationRepository,
|
||||
DashboardComponentDetailValueMapper dashboardComponentDetailValueMapper) {
|
||||
DashboardComponentMapper dashboardComponentMapper, OrganizationRepository organizationRepository) {
|
||||
super(DashboardComponent.class, dashboardComponentRepository, dashboardComponentMapper);
|
||||
|
||||
this.organizationRepository = organizationRepository;
|
||||
this.dashboardComponentMapper = dashboardComponentMapper;
|
||||
this.dashboardComponentDetailValueMapper = dashboardComponentDetailValueMapper;
|
||||
}
|
||||
|
||||
public Map<String, List<DashboardComponentDetailValueDTO>> buildDashboardComponentViewDTO(Long organizationId,
|
||||
Long dashboardComponentId, Long periodVersionId) {
|
||||
|
||||
Map<String, List<DashboardComponentDetailValue>> mapValues = buildDashboardComponentView(organizationId,
|
||||
dashboardComponentId, periodVersionId);
|
||||
|
||||
return this.dashboardComponentDetailValueMapper.mapToDto(mapValues);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -15,11 +15,13 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.oguerreiro.resilient.domain.DashboardComponent;
|
||||
import com.oguerreiro.resilient.domain.DashboardComponentDetailValue;
|
||||
import com.oguerreiro.resilient.domain.enumeration.DashboardComponentView;
|
||||
import com.oguerreiro.resilient.repository.DashboardComponentRepository;
|
||||
import com.oguerreiro.resilient.service.DashboardComponentService;
|
||||
import com.oguerreiro.resilient.service.dto.DashboardComponentDTO;
|
||||
import com.oguerreiro.resilient.service.dto.DashboardComponentDetailValueDTO;
|
||||
import com.oguerreiro.resilient.service.mapper.DashboardComponentDetailValueMapper;
|
||||
|
||||
/**
|
||||
* REST controller for managing {@link com.oguerreiro.resilient.domain.UnitType}.
|
||||
|
@ -30,11 +32,14 @@ public class DashboardComponentResource
|
|||
extends AbstractResilientResource<DashboardComponent, DashboardComponentDTO, Long> {
|
||||
|
||||
private static final String ENTITY_NAME = "dashboardComponent";
|
||||
private final DashboardComponentDetailValueMapper dashboardComponentDetailValueMapper;
|
||||
private final DashboardComponentService dashboardComponentService;
|
||||
|
||||
public DashboardComponentResource(DashboardComponentRepository dashboardComponentRepository,
|
||||
DashboardComponentService dashboardComponentService) {
|
||||
DashboardComponentService dashboardComponentService,
|
||||
DashboardComponentDetailValueMapper dashboardComponentDetailValueMapper) {
|
||||
super(DashboardComponent.class, dashboardComponentRepository, dashboardComponentService);
|
||||
this.dashboardComponentDetailValueMapper = dashboardComponentDetailValueMapper;
|
||||
this.dashboardComponentService = dashboardComponentService;
|
||||
}
|
||||
|
||||
|
@ -62,10 +67,10 @@ public class DashboardComponentResource
|
|||
|
||||
Optional<DashboardComponentDTO> dashboardComponentDTO = getDashboardComponentService().findOne(
|
||||
dashboardComponentId);
|
||||
Map<String, List<DashboardComponentDetailValueDTO>> values = getDashboardComponentService().buildDashboardComponentViewDTO(
|
||||
Map<String, List<DashboardComponentDetailValue>> values = getDashboardComponentService().buildDashboardComponentView(
|
||||
null, dashboardComponentId, periodVersionId);
|
||||
|
||||
return values;
|
||||
return this.dashboardComponentDetailValueMapper.mapToDto(values);
|
||||
}
|
||||
|
||||
@GetMapping("/build/{organizationId}/{dashboardComponentId}/{periodVersionId}")
|
||||
|
@ -77,10 +82,10 @@ public class DashboardComponentResource
|
|||
|
||||
Optional<DashboardComponentDTO> dashboardComponentDTO = getDashboardComponentService().findOne(
|
||||
dashboardComponentId);
|
||||
Map<String, List<DashboardComponentDetailValueDTO>> values = getDashboardComponentService().buildDashboardComponentViewDTO(
|
||||
Map<String, List<DashboardComponentDetailValue>> values = getDashboardComponentService().buildDashboardComponentView(
|
||||
organizationId, dashboardComponentId, periodVersionId);
|
||||
|
||||
return values;
|
||||
return this.dashboardComponentDetailValueMapper.mapToDto(values);
|
||||
}
|
||||
|
||||
@GetMapping("/active")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue