Эх сурвалжийг харах

Removed SelectedCensusEntryService unused methods

Andrew Grant 7 сар өмнө
parent
commit
a7a490d80b

+ 1 - 12
src/main/java/scot/carricksoftware/grants/services/census/selectedcensus/SelectedCensusEntryService.java

@@ -6,7 +6,6 @@
 package scot.carricksoftware.grants.services.census.selectedcensus;
 
 import org.springframework.stereotype.Service;
-import scot.carricksoftware.grants.commands.census.CensusEntryCommand;
 import scot.carricksoftware.grants.domains.census.CensusEntry;
 
 import java.util.List;
@@ -14,24 +13,14 @@ import java.util.List;
 @Service
 public interface SelectedCensusEntryService {
 
-    @SuppressWarnings("unused")
     CensusEntry findById(Long id);
 
-    @SuppressWarnings({"unused", "UnusedReturnValue"})
-    CensusEntry save(CensusEntry censusEntry);
-
-    @SuppressWarnings("unused")
     void deleteById(Long id);
 
-    @SuppressWarnings("unused")
     List<CensusEntry> getPagedCensusEntries(int pageNumber);
 
-    @SuppressWarnings("unused")
+
     long count();
 
-    @SuppressWarnings("unused")
-    CensusEntryCommand saveCensusEntryCommand(CensusEntryCommand censusEntryCommand);
 
-    @SuppressWarnings("unused")
-    List<CensusEntry> findAll();
 }

+ 1 - 32
src/main/java/scot/carricksoftware/grants/services/census/selectedcensus/SelectedCensusEntryServiceImpl.java

@@ -12,15 +12,10 @@ import org.springframework.data.domain.PageRequest;
 import org.springframework.data.domain.Pageable;
 import org.springframework.data.domain.Sort;
 import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-import scot.carricksoftware.grants.commands.census.CensusEntryCommand;
 import scot.carricksoftware.grants.constants.ApplicationConstants;
-import scot.carricksoftware.grants.converters.census.CensusEntryCommandConverterImpl;
-import scot.carricksoftware.grants.converters.census.CensusEntryConverterImpl;
 import scot.carricksoftware.grants.domains.census.CensusEntry;
 import scot.carricksoftware.grants.repositories.census.CensusEntryRepository;
 
-import java.util.ArrayList;
 import java.util.List;
 import java.util.Optional;
 
@@ -30,13 +25,9 @@ public class SelectedCensusEntryServiceImpl implements SelectedCensusEntryServic
 
     @SuppressWarnings({"unused"})
     private final CensusEntryRepository censusEntryRepository;
-    private final CensusEntryConverterImpl censusEntryConverterImpl;
-    private final CensusEntryCommandConverterImpl censusEntryCommandConverterImpl;
 
-    public SelectedCensusEntryServiceImpl(CensusEntryRepository censusEntryRepository, CensusEntryConverterImpl censusEntryConverterImpl, CensusEntryCommandConverterImpl censusEntryCommandConverterImpl) {
+    public SelectedCensusEntryServiceImpl(CensusEntryRepository censusEntryRepository) {
         this.censusEntryRepository = censusEntryRepository;
-        this.censusEntryConverterImpl = censusEntryConverterImpl;
-        this.censusEntryCommandConverterImpl = censusEntryCommandConverterImpl;
     }
 
     @Override
@@ -46,11 +37,6 @@ public class SelectedCensusEntryServiceImpl implements SelectedCensusEntryServic
         return censusEntry.orElse(null);
     }
 
-    @Override
-    public CensusEntry save(CensusEntry censusEntry) {
-        logger.debug("censusEntryServiceImpl::save");
-        return censusEntryRepository.save(censusEntry);
-    }
 
     @Override
     public void deleteById(Long id) {
@@ -77,22 +63,5 @@ public class SelectedCensusEntryServiceImpl implements SelectedCensusEntryServic
         return censusEntryRepository.count();
     }
 
-    @Transactional
-    @Override
-    public CensusEntryCommand saveCensusEntryCommand(CensusEntryCommand censusEntryCommand) {
-        logger.debug("censusEntryServiceImpl::saveCensusEntryCommand");
-        CensusEntry censusEntry = censusEntryCommandConverterImpl.convert(censusEntryCommand);
-        CensusEntry savedcensusEntry = censusEntryRepository.save(censusEntry);
-        return censusEntryConverterImpl.convert(savedcensusEntry);
-    }
-
-    @Override
-    public List<CensusEntry> findAll() {
-        logger.debug("censusEntryServiceImpl::findAll");
-        List<CensusEntry> result = new ArrayList<>();
-        Iterable<CensusEntry> censusEntryIterable = censusEntryRepository.findAll();
-        censusEntryIterable.forEach(result::add);
-        return result;
-    }
 
 }