diff --git a/core/core-backend/src/main/java/io/dataease/copilot/dao/auto/mapper/CoreCopilotConfigRepository.java b/core/core-backend/src/main/java/io/dataease/copilot/dao/auto/mapper/CoreCopilotConfigRepository.java deleted file mode 100644 index 0f60194eb5..0000000000 --- a/core/core-backend/src/main/java/io/dataease/copilot/dao/auto/mapper/CoreCopilotConfigRepository.java +++ /dev/null @@ -1,10 +0,0 @@ -package io.dataease.copilot.dao.auto.mapper; - -import io.dataease.copilot.dao.auto.entity.CoreCopilotConfig; -import org.springframework.data.jpa.repository.JpaRepository; -import org.springframework.data.jpa.repository.JpaSpecificationExecutor; - - - -public interface CoreCopilotConfigRepository extends JpaRepository, JpaSpecificationExecutor { -} diff --git a/core/core-backend/src/main/java/io/dataease/copilot/dao/auto/mapper/CoreCopilotMsgRepository.java b/core/core-backend/src/main/java/io/dataease/copilot/dao/auto/mapper/CoreCopilotMsgRepository.java deleted file mode 100644 index 8ebf83520e..0000000000 --- a/core/core-backend/src/main/java/io/dataease/copilot/dao/auto/mapper/CoreCopilotMsgRepository.java +++ /dev/null @@ -1,59 +0,0 @@ -package io.dataease.copilot.dao.auto.mapper; - -import io.dataease.copilot.dao.auto.entity.CoreCopilotMsg; -import org.springframework.data.domain.Sort; -import org.springframework.data.jpa.domain.Specification; -import org.springframework.data.jpa.repository.JpaRepository; -import org.springframework.data.jpa.repository.JpaSpecificationExecutor; -import org.springframework.transaction.annotation.Transactional; - -import java.util.List; - - -public interface CoreCopilotMsgRepository extends JpaRepository, JpaSpecificationExecutor { - - default List findByUserIdAndDatasetGroupIdOrderByCreateTimeAsc(Long userId, Long datasetGroupId) { - Specification specification = (root, query, cb) -> - cb.and( - cb.equal(root.get("userId"), userId), - cb.equal(root.get("datasetGroupId"), datasetGroupId) - ); - return findAll(specification, Sort.by(Sort.Direction.ASC, "createTime")); - } - - @Transactional - default void deleteByUserIdAndNotDatasetGroupId(Long userId, Long datasetGroupId) { - Specification specification = (root, query, cb) -> - cb.and( - cb.equal(root.get("userId"), userId), - cb.notEqual(root.get("datasetGroupId"), datasetGroupId) - ); - List messages = findAll(specification); - if (!messages.isEmpty()) { - deleteAll(messages); - } - } - - @Transactional - default void deleteByUserId(Long userId) { - Specification specification = (root, query, cb) -> cb.equal(root.get("userId"), userId); - deleteAll(findAll(specification)); - } - - default List findByUserIdOrderByCreateTimeDesc(Long userId) { - Specification specification = (root, query, cb) -> - cb.equal(root.get("userId"), userId); - return findAll(specification, Sort.by(Sort.Direction.DESC, "createTime")); - } - - default List findLastSuccessMsg(Long userId, Long datasetGroupId) { - Specification specification = (root, query, cb) -> - cb.and( - cb.equal(root.get("userId"), userId), - cb.equal(root.get("datasetGroupId"), datasetGroupId), - cb.equal(root.get("msgStatus"), 1), - cb.equal(root.get("msgType"), "api") - ); - return findAll(specification, Sort.by(Sort.Direction.DESC, "createTime")); - } -} diff --git a/core/core-backend/src/main/java/io/dataease/copilot/dao/auto/mapper/CoreCopilotTokenRepository.java b/core/core-backend/src/main/java/io/dataease/copilot/dao/auto/mapper/CoreCopilotTokenRepository.java deleted file mode 100644 index d4c278dcf5..0000000000 --- a/core/core-backend/src/main/java/io/dataease/copilot/dao/auto/mapper/CoreCopilotTokenRepository.java +++ /dev/null @@ -1,9 +0,0 @@ -package io.dataease.copilot.dao.auto.mapper; - -import io.dataease.copilot.dao.auto.entity.CoreCopilotToken; -import org.springframework.data.jpa.repository.JpaRepository; -import org.springframework.data.jpa.repository.JpaSpecificationExecutor; - - -public interface CoreCopilotTokenRepository extends JpaRepository, JpaSpecificationExecutor { -}