Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion backend/api-gateway/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<parent>
<groupId>com.datamate</groupId>
<artifactId>data-mate-platform</artifactId>
<artifactId>datamate</artifactId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
Expand Down
4 changes: 2 additions & 2 deletions backend/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
<modelVersion>4.0.0</modelVersion>

<groupId>com.datamate</groupId>
<artifactId>data-mate-platform</artifactId>
<artifactId>datamate</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>pom</packaging>

<name>DataMatePlatform</name>
<name>DataMate</name>
<description>一站式数据工作平台,面向模型微调与RAG检索</description>

<properties>
Expand Down
2 changes: 1 addition & 1 deletion backend/services/data-annotation-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<parent>
<groupId>com.datamate</groupId>
<artifactId>data-mate-platform</artifactId>
<artifactId>datamate</artifactId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
Expand Down
2 changes: 1 addition & 1 deletion backend/services/data-cleaning-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<parent>
<groupId>com.datamate</groupId>
<artifactId>data-mate-platform</artifactId>
<artifactId>datamate</artifactId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
Expand Down
2 changes: 1 addition & 1 deletion backend/services/data-collection-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<parent>
<groupId>com.datamate</groupId>
<artifactId>data-mate-platform</artifactId>
<artifactId>datamate</artifactId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
Expand Down
2 changes: 1 addition & 1 deletion backend/services/data-evaluation-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<parent>
<groupId>com.datamate</groupId>
<artifactId>data-mate-platform</artifactId>
<artifactId>datamate</artifactId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
Expand Down
2 changes: 1 addition & 1 deletion backend/services/data-management-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<parent>
<groupId>com.datamate</groupId>
<artifactId>data-mate-platform</artifactId>
<artifactId>datamate</artifactId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
Expand Down
2 changes: 1 addition & 1 deletion backend/services/data-synthesis-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<parent>
<groupId>com.datamate</groupId>
<artifactId>data-mate-platform</artifactId>
<artifactId>datamate</artifactId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
Expand Down
2 changes: 1 addition & 1 deletion backend/services/execution-engine-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<parent>
<groupId>com.datamate</groupId>
<artifactId>data-mate-platform</artifactId>
<artifactId>datamate</artifactId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
Expand Down
2 changes: 1 addition & 1 deletion backend/services/main-application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<parent>
<groupId>com.datamate</groupId>
<artifactId>data-mate-platform</artifactId>
<artifactId>datamate</artifactId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# 数据引擎平台 - 主应用配置
spring:
application:
name: data-mate-platform
name: datamate

# 暂时排除Spring Security自动配置(开发阶段使用)
autoconfigure:
Expand Down
2 changes: 1 addition & 1 deletion backend/services/operator-market-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<parent>
<groupId>com.datamate</groupId>
<artifactId>data-mate-platform</artifactId>
<artifactId>datamate</artifactId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
Expand Down
2 changes: 1 addition & 1 deletion backend/services/pipeline-orchestration-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<parent>
<groupId>com.datamate</groupId>
<artifactId>data-mate-platform</artifactId>
<artifactId>datamate</artifactId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
Expand Down
2 changes: 1 addition & 1 deletion backend/services/rag-indexer-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<parent>
<groupId>com.datamate</groupId>
<artifactId>data-mate-platform</artifactId>
<artifactId>datamate</artifactId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
Expand Down
2 changes: 1 addition & 1 deletion backend/services/rag-query-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<parent>
<groupId>com.datamate</groupId>
<artifactId>data-mate-platform</artifactId>
<artifactId>datamate</artifactId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
Expand Down
7 changes: 6 additions & 1 deletion backend/shared/domain-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<parent>
<groupId>com.datamate</groupId>
<artifactId>data-mate-platform</artifactId>
<artifactId>datamate</artifactId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
Expand All @@ -33,5 +33,10 @@
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
</dependency>
<dependency>
<groupId>dev.langchain4j</groupId>
<artifactId>langchain4j-open-ai</artifactId>
<version>1.8.0</version>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package com.datamate.common.infrastructure.exception;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
* 知识库错误码
*
* @author dallas
* @since 2025-10-24
*/

@Getter
@AllArgsConstructor
public enum KnowledgeBaseErrorCode implements ErrorCode {
/**
* 知识库不存在
*/
KNOWLEDGE_BASE_NOT_FOUND("knowledge.0001", "知识库不存在");

private final String code;
private final String message;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
package com.datamate.common.models.application;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.datamate.common.infrastructure.exception.BusinessAssert;
import com.datamate.common.interfaces.PagedResponse;
import com.datamate.common.models.domain.entity.ModelConfig;
import com.datamate.common.models.domain.repository.ModelConfigRepository;
import com.datamate.common.models.infrastructure.client.ModelClient;
import com.datamate.common.models.infrastructure.exception.ModelsErrorCode;
import com.datamate.common.models.interfaces.rest.dto.CreateModelRequest;
import com.datamate.common.models.interfaces.rest.dto.QueryModelRequest;
import dev.langchain4j.model.chat.ChatModel;
import jakarta.validation.Valid;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
* 模型配置应用服务类
*
* @author dallas
* @since 2025-10-27
*/
@Service
@RequiredArgsConstructor
public class ModelConfigApplicationService {
private final ModelConfigRepository modelConfigRepository;

public List<ModelConfig> getProviders() {
List<ModelConfig> providers = new ArrayList<>();
providers.add(ModelConfig.builder().provider("ModelEngine").baseUrl("http://localhost:9981").build());
providers.add(ModelConfig.builder().provider("Ollama").baseUrl("http://localhost:11434").build());
providers.add(ModelConfig.builder().provider("OpenAI").baseUrl("https://api.openai.com/v1").build());
providers.add(ModelConfig.builder().provider("DeepSeek").baseUrl("https://api.deepseek.cn/v1").build());
providers.add(ModelConfig.builder().provider("火山方舟").baseUrl("https://ark.cn-beijing.volces.com/api/v3").build());
providers.add(ModelConfig.builder().provider("阿里云百炼").baseUrl("https://dashscope.aliyuncs.com/compatible-mode/v1").build());
providers.add(ModelConfig.builder().provider("硅基流动").baseUrl("https://api.siliconflow.cn/v1").build());
providers.add(ModelConfig.builder().provider("智谱AI").baseUrl("https://open.bigmodel.cn/api/paas/v4").build());
return providers;
}

public PagedResponse<ModelConfig> getModels(QueryModelRequest queryModelRequest) {
// 从数据库查询模型配置
IPage<ModelConfig> page = modelConfigRepository.page(queryModelRequest);
return PagedResponse.of(page.getRecords(), page.getCurrent(), page.getTotal(), page.getPages());
}

public ModelConfig getModelDetail(String modelId) {
return modelConfigRepository.getById(modelId);
}

public ModelConfig createModel(CreateModelRequest modelConfig) {
ModelConfig newConfig = ModelConfig.builder()
.provider(modelConfig.getProvider())
.modelName(modelConfig.getModelName())
.type(modelConfig.getType())
.baseUrl(modelConfig.getBaseUrl())
.apiKey(modelConfig.getApiKey())
.isEnabled(true)
.build();
ModelClient.checkHealth(newConfig);
modelConfigRepository.save(newConfig);
return newConfig;
}

public ModelConfig updateModel(String modelId, @Valid CreateModelRequest updateModelRequest) {
ModelConfig modelConfig = modelConfigRepository.getById(modelId);
BusinessAssert.notNull(modelConfig, ModelsErrorCode.MODEL_CONFIG_NOT_FOUND);
modelConfig.setProvider(updateModelRequest.getProvider());
modelConfig.setModelName(updateModelRequest.getModelName());
modelConfig.setType(updateModelRequest.getType());
modelConfig.setBaseUrl(updateModelRequest.getBaseUrl());
modelConfig.setApiKey(updateModelRequest.getApiKey());
modelConfig.setIsEnabled(true);
ModelClient.checkHealth(modelConfig);
modelConfigRepository.updateById(modelConfig);
return modelConfig;
}

public void deleteModel(String modelId) {
modelConfigRepository.removeById(modelId);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
package com.datamate.common.models.domain.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.datamate.common.domain.model.base.BaseEntity;
import lombok.Builder;
import lombok.Getter;
import lombok.Setter;

/**
* 模型配置实体类
*
* @author dallas
* @since 2025-10-27
*/
@Getter
@Setter
@TableName("t_model_config")
@Builder
public class ModelConfig extends BaseEntity<String> {
/**
* 模型名称(如 qwen2)
*/
private String modelName;
/**
* 模型提供商(如 Ollama、OpenAI、DeepSeek)
*/
private String provider;
/**
* API 基础地址
*/
private String baseUrl;
/**
* API 密钥(无密钥则为空)
*/
private String apiKey;
/**
* 模型类型(如 chat、embedding)
*/
private ModelType type;
/**
* 是否启用:1-启用,0-禁用
*/
private Boolean isEnabled;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.datamate.common.models.domain.entity;

/**
* 模型类型枚举类
*
* @author dallas
* @since 2025-10-27
*/
public enum ModelType {
/**
* 语言模型
*/
CHAT,
/**
* 嵌入模型
*/
EMBEDDING
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package com.datamate.common.models.domain.repository;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.repository.IRepository;
import com.datamate.common.models.domain.entity.ModelConfig;
import com.datamate.common.models.interfaces.rest.dto.QueryModelRequest;

/**
* 模型配置仓库接口
*
* @author dallas
* @since 2025-10-27
*/
public interface ModelConfigRepository extends IRepository<ModelConfig> {
/**
* 分页查询模型配置
*
* @param queryModelRequest 分页查询参数
* @return 模型配置列表
*/
IPage<ModelConfig> page(QueryModelRequest queryModelRequest);
}
Loading