From 772a4260981af8df86ebeb273848c0376b8b9ad9 Mon Sep 17 00:00:00 2001 From: mitch Date: Sun, 18 Sep 2022 08:08:38 -0400 Subject: [PATCH] Removed unneeded call to unit-army from dataslate --- src/main/java/com/warhammer/domain/UnitArmy.java | 4 ---- .../com/warhammer/service/DataslateService.java | 8 -------- .../service/impl/DataslateServiceImpl.java | 9 --------- .../com/warhammer/web/rest/DataslateResource.java | 14 -------------- 4 files changed, 35 deletions(-) diff --git a/src/main/java/com/warhammer/domain/UnitArmy.java b/src/main/java/com/warhammer/domain/UnitArmy.java index 42297446..b01e92c5 100644 --- a/src/main/java/com/warhammer/domain/UnitArmy.java +++ b/src/main/java/com/warhammer/domain/UnitArmy.java @@ -354,10 +354,6 @@ public class UnitArmy implements Serializable { return this; } - public Army getArmy() { - return this.army; - } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/src/main/java/com/warhammer/service/DataslateService.java b/src/main/java/com/warhammer/service/DataslateService.java index 92b2a307..d28c020c 100644 --- a/src/main/java/com/warhammer/service/DataslateService.java +++ b/src/main/java/com/warhammer/service/DataslateService.java @@ -31,14 +31,6 @@ public interface DataslateService { */ List findAllByOwner(Optional ownerLogin); - /** - * Get all the Dataslates for an army - * - * @param id the id of the army - * @return List of Dataslates by army - */ - List findAllByArmy(Long id); - /** * * @param id diff --git a/src/main/java/com/warhammer/service/impl/DataslateServiceImpl.java b/src/main/java/com/warhammer/service/impl/DataslateServiceImpl.java index ed50d3ee..03c4e00b 100644 --- a/src/main/java/com/warhammer/service/impl/DataslateServiceImpl.java +++ b/src/main/java/com/warhammer/service/impl/DataslateServiceImpl.java @@ -56,15 +56,6 @@ public class DataslateServiceImpl implements DataslateService { .collect(Collectors.toCollection(LinkedList::new)); } - @Override - public List 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 @Transactional(readOnly = true) public Optional findOne(Long id) { diff --git a/src/main/java/com/warhammer/web/rest/DataslateResource.java b/src/main/java/com/warhammer/web/rest/DataslateResource.java index 85fd3127..61b88c45 100644 --- a/src/main/java/com/warhammer/web/rest/DataslateResource.java +++ b/src/main/java/com/warhammer/web/rest/DataslateResource.java @@ -6,7 +6,6 @@ import com.warhammer.service.DataslateService; import com.warhammer.service.dto.DataslateDTO; import com.warhammer.web.rest.errors.BadRequestAlertException; import io.github.jhipster.web.util.HeaderUtil; -import io.github.jhipster.web.util.ResponseUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Value; @@ -88,19 +87,6 @@ public class DataslateResource { return dataslateService.findAllByOwner(userLogin); } - /** - * {@code GET /dataslates/get-army/:id} : get all - * @param id - * @return - */ - @GetMapping("/dataslates/get-army/{id}") - public ResponseEntity> getUnitArmy(@PathVariable Long id) { - log.debug("REST request to get Dataslates for army : {}", id); - List dataslateDTO = dataslateService.findAllByArmy(id); - Optional> optionalDataslateDTOS = Optional.of(dataslateDTO); - return ResponseUtil.wrapOrNotFound(optionalDataslateDTOS); - } - @DeleteMapping("/dataslates/{id}") public ResponseEntity deleteDataslate(@PathVariable Long id) { log.debug("REST request to delete Dataslate : {}", id);