新增: 项目多工程系统(工程表+Git 状态查询+AI 工具)
一个项目可含多个工程(Module),每个工程是独立代码仓库, 有自己的目录、Git 地址和技术栈。单仓库项目退化:项目下 只有一个工程,用户无感工程概念。 数据层: - project_modules 表(V34 迁移):工程名/目录/Git 地址/技术栈 - ProjectModuleRepo:完整 CRUD + 按项目列表(排序) 后端接口: - 工程 CRUD:添加/更新/删除/列表 - Git 状态查询:实时跑 git 命令返回当前分支/改动文件/最近提交 (10 秒超时,无 Git 仓库返回空状态) 创建项目适配: - 新建项目时自动创建一个工程(目录=绑定路径,技术栈=探测结果) AI 工具: - list_project_modules:列出项目工程列表(AI 了解项目结构) 同时新增工程系统设计方案文档。
This commit is contained in:
@@ -464,3 +464,22 @@ pub struct KnowledgeEventRecord {
|
||||
pub context_json: Option<String>, // JSON: 因 event_type 而异
|
||||
pub timestamp: String,
|
||||
}
|
||||
|
||||
/// 工程记录(project_modules 表,项目多工程,每个工程独立代码仓库)
|
||||
///
|
||||
/// 一个项目可含多个工程(Monorepo 多仓库 / 微服务 / 前后端分离)。
|
||||
/// 每个工程有独立的目录(`path`)、Git 地址(`git_url`)、技术栈(`stack`)。
|
||||
/// Git 状态(分支/改动/提交)是实时派生的(查 git 命令),不存表。
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct ProjectModuleRecord {
|
||||
pub id: String,
|
||||
pub project_id: String,
|
||||
pub name: String,
|
||||
pub path: String,
|
||||
pub git_url: Option<String>,
|
||||
pub stack: Option<String>, // 技术栈 JSON 字符串
|
||||
pub auto_detected: bool,
|
||||
pub sort_order: i32,
|
||||
pub created_at: String,
|
||||
pub updated_at: String,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user