From e8ecaefb927ef4a83aa713f4c0ebd9c81aa17a6d Mon Sep 17 00:00:00 2001 From: geek Date: Thu, 28 Jun 2018 17:45:32 +0900 Subject: [PATCH] email token duplication check --- .../meta/dao/MetaCollectionItemDAO.java | 1 + .../meta/dao/MetaCrawlerContainerDAO.java | 9 ++++++ .../meta/dao/MetaCrawlerMappingDAO.java | 5 ++++ .../meta/dao/MetaDisplayItemMappingDAO.java | 5 ++++ .../module/meta/dao/MetaItemUnitDAO.java | 1 + .../CentralMetaCollectionItemService.java | 23 ++++++++++++--- .../CentralMetaCrawlerContainerService.java | 18 ++++++++++++ .../CentralMetaCrawlerMappingService.java | 15 ++++++++++ .../CentralMetaDisplayItemMappingService.java | 28 +++++++++++++++++-- .../CentralMetaDisplayItemService.java | 15 ++++++++-- .../service/CentralMetaItemUnitService.java | 17 ++++++++++- 11 files changed, 127 insertions(+), 10 deletions(-) create mode 100644 src/main/java/com/loafle/overflow/central/module/meta/dao/MetaCrawlerContainerDAO.java create mode 100644 src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaCrawlerContainerService.java diff --git a/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaCollectionItemDAO.java b/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaCollectionItemDAO.java index a3de5a7..cb9862f 100644 --- a/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaCollectionItemDAO.java +++ b/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaCollectionItemDAO.java @@ -10,4 +10,5 @@ import org.springframework.stereotype.Repository; */ @Repository public interface MetaCollectionItemDAO extends JpaRepository { + MetaCollectionItem findByKey(String key); } diff --git a/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaCrawlerContainerDAO.java b/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaCrawlerContainerDAO.java new file mode 100644 index 0000000..54ebe46 --- /dev/null +++ b/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaCrawlerContainerDAO.java @@ -0,0 +1,9 @@ +package com.loafle.overflow.central.module.meta.dao; + +import com.loafle.overflow.model.meta.MetaCrawlerContainer; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.stereotype.Repository; + +@Repository +public interface MetaCrawlerContainerDAO extends JpaRepository { +} diff --git a/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaCrawlerMappingDAO.java b/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaCrawlerMappingDAO.java index 2d862e5..a0e6fd7 100644 --- a/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaCrawlerMappingDAO.java +++ b/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaCrawlerMappingDAO.java @@ -4,9 +4,14 @@ import com.loafle.overflow.model.meta.MetaCrawlerMapping; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; +import java.util.List; + /** * Created by insanity on 17. 6. 23. */ @Repository public interface MetaCrawlerMappingDAO extends JpaRepository { + List findAllByMetaTargetTypeId(Integer targetTypeID); + + List findAllByMetaTargetTypeKey(String targetTypeKey); } diff --git a/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaDisplayItemMappingDAO.java b/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaDisplayItemMappingDAO.java index 392512b..99fd533 100644 --- a/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaDisplayItemMappingDAO.java +++ b/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaDisplayItemMappingDAO.java @@ -5,10 +5,15 @@ import org.springframework.stereotype.Repository; import com.loafle.overflow.model.meta.MetaDisplayItemMapping; +import java.util.List; + /** * Created by insanity on 17. 11. 7. */ @Repository public interface MetaDisplayItemMappingDAO extends JpaRepository { + List findAllByMetaCrawlerMappingId(Long metaCrawlerMappingID); + + List findAllByMetaDisplayItemId(Long metaDisplayItemID); } diff --git a/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaItemUnitDAO.java b/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaItemUnitDAO.java index 2379339..2e76572 100644 --- a/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaItemUnitDAO.java +++ b/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaItemUnitDAO.java @@ -10,4 +10,5 @@ import org.springframework.stereotype.Repository; @Repository public interface MetaItemUnitDAO extends JpaRepository { + MetaItemUnit findByKey(String key); } diff --git a/src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaCollectionItemService.java b/src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaCollectionItemService.java index f4fd68e..65d0c06 100644 --- a/src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaCollectionItemService.java +++ b/src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaCollectionItemService.java @@ -1,8 +1,10 @@ package com.loafle.overflow.central.module.meta.service; +import com.loafle.overflow.central.module.meta.dao.MetaCollectionItemDAO; import com.loafle.overflow.core.exception.OverflowException; import com.loafle.overflow.model.meta.MetaCollectionItem; import com.loafle.overflow.service.central.meta.MetaCollectionItemService; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; @@ -13,9 +15,22 @@ import java.util.List; @Service("MetaCollectionItemService") public class CentralMetaCollectionItemService implements MetaCollectionItemService { - @Override - public List readAll() throws OverflowException { - return null; - } + @Autowired + MetaCollectionItemDAO metaCollectionItemDAO; + + @Override + public List readAll() throws OverflowException { + return this.metaCollectionItemDAO.findAll(); + } + + @Override + public MetaCollectionItem readByKey(String key) throws OverflowException { + return this.metaCollectionItemDAO.findByKey(key); + } + + @Override + public MetaCollectionItem readByID(Integer id) throws OverflowException { + return this.metaCollectionItemDAO.getOne(id); + } } diff --git a/src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaCrawlerContainerService.java b/src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaCrawlerContainerService.java new file mode 100644 index 0000000..5798a8c --- /dev/null +++ b/src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaCrawlerContainerService.java @@ -0,0 +1,18 @@ +package com.loafle.overflow.central.module.meta.service; + +import com.loafle.overflow.central.module.meta.dao.MetaCrawlerContainerDAO; +import com.loafle.overflow.core.exception.OverflowException; +import com.loafle.overflow.model.meta.MetaCrawlerContainer; +import com.loafle.overflow.service.central.meta.MetaCrawlerContainerService; +import org.springframework.beans.factory.annotation.Autowired; + +public class CentralMetaCrawlerContainerService implements MetaCrawlerContainerService { + + @Autowired + private MetaCrawlerContainerDAO metaCrawlerContainerDAO; + + @Override + public MetaCrawlerContainer regist(MetaCrawlerContainer metaCrawlerContainer) throws OverflowException { + return this.metaCrawlerContainerDAO.save(metaCrawlerContainer); + } +} diff --git a/src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaCrawlerMappingService.java b/src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaCrawlerMappingService.java index 82fc6c3..8a24f91 100644 --- a/src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaCrawlerMappingService.java +++ b/src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaCrawlerMappingService.java @@ -23,4 +23,19 @@ public class CentralMetaCrawlerMappingService implements MetaCrawlerMappingServi public List readAll() throws OverflowException { return this.metaCrawlerMappingDAO.findAll(); } + + @Override + public List readAllByMetaTargetTypeID(Integer targetTypeID) throws OverflowException { + return this.metaCrawlerMappingDAO.findAllByMetaTargetTypeId(targetTypeID); + } + + @Override + public List readAllByMetaTargetTypeKey(String targetTypeKey) throws OverflowException { + return this.metaCrawlerMappingDAO.findAllByMetaTargetTypeKey(targetTypeKey); + } + + @Override + public MetaCrawlerMapping regist(MetaCrawlerMapping metaCrawlerMapping) throws OverflowException { + return this.metaCrawlerMappingDAO.save(metaCrawlerMapping); + } } diff --git a/src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaDisplayItemMappingService.java b/src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaDisplayItemMappingService.java index 0e7827e..d9713e9 100644 --- a/src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaDisplayItemMappingService.java +++ b/src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaDisplayItemMappingService.java @@ -1,21 +1,45 @@ package com.loafle.overflow.central.module.meta.service; +import com.loafle.overflow.central.module.meta.dao.MetaDisplayItemMappingDAO; import com.loafle.overflow.core.exception.OverflowException; import com.loafle.overflow.model.meta.MetaDisplayItemMapping; import com.loafle.overflow.service.central.meta.MetaDisplayItemMappingService; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.List; + /** * Created by insanity on 17. 11. 7. */ @Service("MetaDisplayItemMappingService") public class CentralMetaDisplayItemMappingService implements MetaDisplayItemMappingService { - // @Autowired - // private MetaSensorDisplayMappingDAO mappingDAO; + @Autowired + private MetaDisplayItemMappingDAO metaDisplayItemMappingDAO; @Override public MetaDisplayItemMapping regist(MetaDisplayItemMapping metaDisplayItemMapping) throws OverflowException { + return this.metaDisplayItemMappingDAO.save(metaDisplayItemMapping); + } + + @Override + public List readAllByMetaDisplayItemID(Long metaDisplayItemID) throws OverflowException { + return this.metaDisplayItemMappingDAO.findAllByMetaDisplayItemId(metaDisplayItemID); + } + + @Override + public List readAllByMetaCrawlerMappingID(Long metaCrawlerMappingID) throws OverflowException { + return this.metaDisplayItemMappingDAO.findAllByMetaCrawlerMappingId(metaCrawlerMappingID); + } + + @Override + public MetaDisplayItemMapping read(Long ID) throws OverflowException { return null; } + + @Override + public List readAll() throws OverflowException { + return this.metaDisplayItemMappingDAO.findAll(); + } } diff --git a/src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaDisplayItemService.java b/src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaDisplayItemService.java index 3e5387b..d5f1194 100644 --- a/src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaDisplayItemService.java +++ b/src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaDisplayItemService.java @@ -1,25 +1,34 @@ package com.loafle.overflow.central.module.meta.service; +import com.loafle.overflow.central.module.meta.dao.MetaDisplayItemDAO; import com.loafle.overflow.core.exception.OverflowException; import com.loafle.overflow.model.meta.MetaDisplayItem; import com.loafle.overflow.service.central.meta.MetaDisplayItemService; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.List; + /** * Created by insanity on 17. 9. 20. */ @Service("MetaDisplayItemService") public class CentralMetaDisplayItemService implements MetaDisplayItemService { - // @Autowired - // private MetaSensorDisplayItemDAO metaSensorDisplayItemDAO; + @Autowired + private MetaDisplayItemDAO metaDisplayItemDAO; @Override public MetaDisplayItem regist(MetaDisplayItem metaDisplayItem) throws OverflowException { - return null; + return this.metaDisplayItemDAO.save(metaDisplayItem); } @Override public MetaDisplayItem read(Long id) throws OverflowException { return null; } + + @Override + public List readAll() throws OverflowException { + return this.metaDisplayItemDAO.findAll(); + } } diff --git a/src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaItemUnitService.java b/src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaItemUnitService.java index 3e45aae..534895f 100644 --- a/src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaItemUnitService.java +++ b/src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaItemUnitService.java @@ -1,9 +1,11 @@ package com.loafle.overflow.central.module.meta.service; +import com.loafle.overflow.central.module.meta.dao.MetaItemUnitDAO; import com.loafle.overflow.core.exception.OverflowException; import com.loafle.overflow.model.meta.MetaItemUnit; import com.loafle.overflow.service.central.meta.MetaItemUnitService; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; /** @@ -13,8 +15,21 @@ import org.springframework.stereotype.Service; @Service("MetaSensorItemUnitService") public class CentralMetaItemUnitService implements MetaItemUnitService { + @Autowired + MetaItemUnitDAO metaItemUnitDAO; + @Override public MetaItemUnit regist(MetaItemUnit metaItemUnit) throws OverflowException { - return null; + return this.metaItemUnitDAO.save(metaItemUnit); } + + @Override + public MetaItemUnit read(Short ID) throws OverflowException { + return null; + } + + @Override + public MetaItemUnit readByKey(String key) throws OverflowException { + return this.metaItemUnitDAO.findByKey(key); + } }