From aadd6ee837ac4e70c71102fbde42307415147c00 Mon Sep 17 00:00:00 2001 From: junjun Date: Fri, 5 Sep 2025 15:51:36 +0800 Subject: [PATCH] =?UTF-8?q?fix(copilot):=20=E5=88=A0=E9=99=A4copilot?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/CoreCopilotConfigRepository.java | 10 ---- .../auto/mapper/CoreCopilotMsgRepository.java | 59 ------------------- .../mapper/CoreCopilotTokenRepository.java | 9 --- 3 files changed, 78 deletions(-) delete mode 100644 core/core-backend/src/main/java/io/dataease/copilot/dao/auto/mapper/CoreCopilotConfigRepository.java delete mode 100644 core/core-backend/src/main/java/io/dataease/copilot/dao/auto/mapper/CoreCopilotMsgRepository.java delete mode 100644 core/core-backend/src/main/java/io/dataease/copilot/dao/auto/mapper/CoreCopilotTokenRepository.java 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 { -}