Browse Source

修改体验版地址

jiapu 2 months ago
parent
commit
9c345a1336

+ 0 - 137
cfc-backend/src/test/java/com/etotem/cfc/service/DifySyncServiceTest.java

@@ -1,137 +0,0 @@
-package com.etotem.cfc.service;
-
-import com.etotem.cfc.entity.DanKnowledgeBase;
-import com.etotem.cfc.entity.ProductDimensionConfig;
-import com.etotem.cfc.mapper.ProductDimensionConfigMapper;
-import org.junit.jupiter.api.Test;
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.boot.test.mock.mockito.MockBean;
-import org.springframework.test.util.ReflectionTestUtils;
-
-import javax.annotation.Resource;
-import java.util.*;
-
-import static org.junit.jupiter.api.Assertions.*;
-import static org.mockito.ArgumentMatchers.*;
-import static org.mockito.Mockito.*;
-
-@SpringBootTest
-public class DifySyncServiceTest {
-
-    @Resource
-    private DifySyncService difySyncService;
-
-    @MockBean
-    private ProductDimensionConfigMapper productDimensionConfigMapper;
-
-    @Test
-    void syncToDify_skips_whenDimensionCodesEmpty() {
-        DanKnowledgeBase knowledge = new DanKnowledgeBase();
-        knowledge.setTitle("测试");
-        knowledge.setContent("内容");
-
-        difySyncService.syncToDify(knowledge, Collections.emptyList());
-        difySyncService.syncToDify(knowledge, null);
-
-        verify(productDimensionConfigMapper, never()).selectOne(any());
-    }
-
-    @Test
-    void syncToDify_skips_whenNoConfigFound() {
-        ReflectionTestUtils.setField(difySyncService, "difyBaseUrl", "http://localhost");
-        ReflectionTestUtils.setField(difySyncService, "difyApiKey", "test-key");
-
-        DanKnowledgeBase knowledge = new DanKnowledgeBase();
-        knowledge.setTitle("测试知识点");
-        knowledge.setContent("测试内容");
-
-        when(productDimensionConfigMapper.selectOne(any()))
-            .thenReturn(null);
-
-        difySyncService.syncToDify(knowledge, Arrays.asList("growth", "sleep"));
-
-        verify(productDimensionConfigMapper, times(2)).selectOne(any());
-    }
-
-    @Test
-    void syncToDify_skips_whenDifyDatasetIdNull() {
-        ReflectionTestUtils.setField(difySyncService, "difyBaseUrl", "http://localhost");
-        ReflectionTestUtils.setField(difySyncService, "difyApiKey", "test-key");
-
-        DanKnowledgeBase knowledge = new DanKnowledgeBase();
-        knowledge.setTitle("测试");
-        knowledge.setContent("内容");
-
-        ProductDimensionConfig config = new ProductDimensionConfig();
-        config.setId(1L);
-        config.setDimensionCode("growth");
-        config.setDifyDatasetId(null);
-
-        when(productDimensionConfigMapper.selectOne(any())).thenReturn(config);
-
-        difySyncService.syncToDify(knowledge, Arrays.asList("growth"));
-
-        verify(productDimensionConfigMapper, times(1)).selectOne(any());
-    }
-
-    @Test
-    void syncToDify_skips_whenDifyDatasetIdEmpty() {
-        ReflectionTestUtils.setField(difySyncService, "difyBaseUrl", "http://localhost");
-        ReflectionTestUtils.setField(difySyncService, "difyApiKey", "test-key");
-
-        DanKnowledgeBase knowledge = new DanKnowledgeBase();
-        knowledge.setTitle("测试");
-        knowledge.setContent("内容");
-
-        ProductDimensionConfig config = new ProductDimensionConfig();
-        config.setId(1L);
-        config.setDimensionCode("growth");
-        config.setDifyDatasetId("");
-
-        when(productDimensionConfigMapper.selectOne(any())).thenReturn(config);
-
-        difySyncService.syncToDify(knowledge, Arrays.asList("growth"));
-
-        verify(productDimensionConfigMapper, times(1)).selectOne(any());
-    }
-
-    @Test
-    void removeFromDify_skips_whenDatasetIdNull() {
-        ReflectionTestUtils.setField(difySyncService, "difyBaseUrl", "http://localhost");
-        ReflectionTestUtils.setField(difySyncService, "difyApiKey", "test-key");
-
-        difySyncService.removeFromDify(100L, null);
-        difySyncService.removeFromDify(100L, "");
-
-        verify(productDimensionConfigMapper, never()).selectOne(any());
-    }
-
-    @Test
-    void syncToDify_onlyProcessesConfiguredDimensions() {
-        ReflectionTestUtils.setField(difySyncService, "difyBaseUrl", "http://localhost");
-        ReflectionTestUtils.setField(difySyncService, "difyApiKey", "test-key");
-
-        DanKnowledgeBase knowledge = new DanKnowledgeBase();
-        knowledge.setTitle("测试");
-        knowledge.setContent("内容");
-
-        ProductDimensionConfig growthConfig = new ProductDimensionConfig();
-        growthConfig.setDimensionCode("growth");
-        growthConfig.setDifyDatasetId("dataset-growth-123");
-
-        ProductDimensionConfig noConfig = new ProductDimensionConfig();
-        noConfig.setDimensionCode("sleep");
-        noConfig.setDifyDatasetId(null);
-
-        when(productDimensionConfigMapper.selectOne(
-            argThat(q -> "growth".equals(q.getSqlSegment()))))
-            .thenReturn(growthConfig);
-        when(productDimensionConfigMapper.selectOne(
-            argThat(q -> "sleep".equals(q.getSqlSegment()))))
-            .thenReturn(noConfig);
-
-        difySyncService.syncToDify(knowledge, Arrays.asList("growth", "sleep"));
-
-        verify(productDimensionConfigMapper, times(2)).selectOne(any());
-    }
-}

+ 1 - 1
cfc-frontend/config.js

@@ -23,7 +23,7 @@ try {
         API_BASE_URL = 'http://192.168.1.57:9082'
         API_BASE_URL = 'http://192.168.1.57:9082'
         break
         break
       case 'trial':
       case 'trial':
-        API_BASE_URL = 'https://cfc.etotem.com.cn'
+        API_BASE_URL = 'http://cfc.iwintrue.com'
         break
         break
       case 'release':
       case 'release':
         API_BASE_URL = 'https://cfc.etotem.com.cn'
         API_BASE_URL = 'https://cfc.etotem.com.cn'