Removed unneeded call to unit-army from dataslate
This commit is contained in:
parent
e9e8016249
commit
772a426098
@ -354,10 +354,6 @@ public class UnitArmy implements Serializable {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Army getArmy() {
|
|
||||||
return this.army;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o) {
|
if (this == o) {
|
||||||
|
@ -31,14 +31,6 @@ public interface DataslateService {
|
|||||||
*/
|
*/
|
||||||
List<Dataslate> findAllByOwner(Optional <String> ownerLogin);
|
List<Dataslate> findAllByOwner(Optional <String> ownerLogin);
|
||||||
|
|
||||||
/**
|
|
||||||
* Get all the Dataslates for an army
|
|
||||||
*
|
|
||||||
* @param id the id of the army
|
|
||||||
* @return List of Dataslates by army
|
|
||||||
*/
|
|
||||||
List<DataslateDTO> findAllByArmy(Long id);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param id
|
* @param id
|
||||||
|
@ -56,15 +56,6 @@ public class DataslateServiceImpl implements DataslateService {
|
|||||||
.collect(Collectors.toCollection(LinkedList::new));
|
.collect(Collectors.toCollection(LinkedList::new));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<DataslateDTO> findAllByArmy(Long id) {
|
|
||||||
log.debug("Request to get all Dataslates by Army : " + id);
|
|
||||||
return dataslateRepository.findAll().stream()
|
|
||||||
.map(dataslateMapper::toDto)
|
|
||||||
.filter(dataslateDTO -> dataslateDTO.getUnitArmy().getArmy().getId().equals(id))
|
|
||||||
.collect(Collectors.toCollection(LinkedList::new));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(readOnly = true)
|
@Transactional(readOnly = true)
|
||||||
public Optional<DataslateDTO> findOne(Long id) {
|
public Optional<DataslateDTO> findOne(Long id) {
|
||||||
|
@ -6,7 +6,6 @@ import com.warhammer.service.DataslateService;
|
|||||||
import com.warhammer.service.dto.DataslateDTO;
|
import com.warhammer.service.dto.DataslateDTO;
|
||||||
import com.warhammer.web.rest.errors.BadRequestAlertException;
|
import com.warhammer.web.rest.errors.BadRequestAlertException;
|
||||||
import io.github.jhipster.web.util.HeaderUtil;
|
import io.github.jhipster.web.util.HeaderUtil;
|
||||||
import io.github.jhipster.web.util.ResponseUtil;
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
@ -88,19 +87,6 @@ public class DataslateResource {
|
|||||||
return dataslateService.findAllByOwner(userLogin);
|
return dataslateService.findAllByOwner(userLogin);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* {@code GET /dataslates/get-army/:id} : get all
|
|
||||||
* @param id
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@GetMapping("/dataslates/get-army/{id}")
|
|
||||||
public ResponseEntity<List<DataslateDTO>> getUnitArmy(@PathVariable Long id) {
|
|
||||||
log.debug("REST request to get Dataslates for army : {}", id);
|
|
||||||
List<DataslateDTO> dataslateDTO = dataslateService.findAllByArmy(id);
|
|
||||||
Optional<List<DataslateDTO>> optionalDataslateDTOS = Optional.of(dataslateDTO);
|
|
||||||
return ResponseUtil.wrapOrNotFound(optionalDataslateDTOS);
|
|
||||||
}
|
|
||||||
|
|
||||||
@DeleteMapping("/dataslates/{id}")
|
@DeleteMapping("/dataslates/{id}")
|
||||||
public ResponseEntity<Void> deleteDataslate(@PathVariable Long id) {
|
public ResponseEntity<Void> deleteDataslate(@PathVariable Long id) {
|
||||||
log.debug("REST request to delete Dataslate : {}", id);
|
log.debug("REST request to delete Dataslate : {}", id);
|
||||||
|
Loading…
Reference in New Issue
Block a user