diff --git a/models/sd_projects.json b/models/sd_projects.json index aba1219..431101e 100644 --- a/models/sd_projects.json +++ b/models/sd_projects.json @@ -15,7 +15,7 @@ {"name": "tech_stack", "title": "技术栈配置(JSON)", "type": "text"}, {"name": "repo_url", "title": "主仓库地址", "type": "str", "length": 500}, {"name": "workspace_dir", "title": "项目工作目录", "type": "str", "length": 500}, - {"name": "pipeline_id", "title": "关联Pipeline定义ID", "type": "str", "length": 32}, + {"name": "pipeline_id", "title": "关联Pipeline定义ID", "type": "str", "length": 32, "default": "'sdlc_general'"}, {"name": "status", "title": "项目状态", "type": "str", "length": 20, "nullable": "no", "default": "'draft'"}, {"name": "org_id", "title": "组织ID", "type": "str", "length": 32, "nullable": "no", "default": "'0'"}, {"name": "created_by", "title": "创建人", "type": "str", "length": 32}, diff --git a/wwwroot/api/cockpit_project_picker.dspy b/wwwroot/api/cockpit_project_picker.dspy index 81c685a..c82fe99 100644 --- a/wwwroot/api/cockpit_project_picker.dspy +++ b/wwwroot/api/cockpit_project_picker.dspy @@ -5,7 +5,7 @@ dbname = get_module_dbname('pipeline-sdlc') async with DBPools().sqlorContext(dbname) as sor: recs = await sor.sqlExe( - "SELECT id, name FROM sd_projects ORDER BY name", + "SELECT id, name FROM sd_projects WHERE pipeline_id='sdlc_general' ORDER BY name", {} ) diff --git a/wwwroot/api/get_project_options.dspy b/wwwroot/api/get_project_options.dspy index 52107a9..191a412 100644 --- a/wwwroot/api/get_project_options.dspy +++ b/wwwroot/api/get_project_options.dspy @@ -1,7 +1,7 @@ result = [] try: async with get_sor_context(request._run_ns, 'pipeline') as sor: - rows = await sor.sqlExe("select id as project_id, name as project_id_text from sd_projects order by name", {}) + rows = await sor.sqlExe("select id as project_id, name as project_id_text from sd_projects where pipeline_id='sdlc_general' order by name", {}) result = list(rows) return json.dumps(result, ensure_ascii=False) except Exception as e: diff --git a/wwwroot/api/sd_project_create.dspy b/wwwroot/api/sd_project_create.dspy index 9fb82d3..0b09277 100644 --- a/wwwroot/api/sd_project_create.dspy +++ b/wwwroot/api/sd_project_create.dspy @@ -10,7 +10,7 @@ data = { 'project_type': params_kw.get('project_type', ''), 'tech_stack': params_kw.get('tech_stack', ''), 'repo_url': params_kw.get('repo_url', ''), - 'pipeline_id': params_kw.get('pipeline_id', ''), + 'pipeline_id': params_kw.get('pipeline_id', '') or 'sdlc_general', 'status': params_kw.get('status', ''), 'org_id': org_id, 'created_at': curDateString(),