zizi 7534bdf9b7 feat(create): generic 桥接——一句话创作无需选模板即可生成(入口归一缺省 templateId=generic)
背景:W-CLEAN 废玩法模板层后 template/list 返空,创作页「开始生成」因 canSubmit 依赖
「必须选中模板」而恒禁用;后端 @NotBlank/同源白名单/派发分支/落包一致性四道硬约束又要求
templateId 必填非空。核心思想=在入口把缺省 templateId 归一为 "generic"(恰好命中
SUPPORTED_TEMPLATE_IDS=[generic] 单一通用口径,品类区分留 prompt 层),四道约束以「恰好
generic」全部一致通过,DB 零改(template_id NOT NULL DEFAULT '' 归一后落 generic)、后端业务零改。

契约层(2):aigc.yaml AigcGenerateReqVO required 去 templateId、project.yaml
  ProjectCreateReqVO required 去 templateId,templateId 描述标注「可选,缺省 generic」。
后端层(归一 generic):
  - AigcGenerateReqVO/ProjectCreateReqVO/StudioDraftCreateReqVO 去 templateId @NotBlank +
    requiredMode REQUIRED→NOT_REQUIRED;
  - AigcTaskServiceImpl.submitGenerate 在 validateTemplateExists 前归一(validateTemplateExists 不改);
  - ProjectServiceImpl.createProject(BeanUtils.toBean 后)归一;
  - StudioServiceImpl.createDraft 原「空 templateId 抛 STUDIO_TEMPLATE_REQUIRED」改为归一 generic;
  - ProjectApi.createProject 的 templateId @Parameter required 放开(契约面一致避免 drift)。
前端 game-studio(去模板门):types.ts 两请求体 templateId 改可选;store/create.ts、api/aigc.ts
  generate 入参改可选;Create.vue canSubmit 去「必须选中模板」条件(prompt 非空即可提交)、
  onSubmit 缺省传 'generic'(空态下也能提交)。
测试校正:StudioServiceImplTest「空模板抛错」→「空模板归一 generic 透传 project」(行为变更)。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-17 04:05:39 +00:00
..

Vue 3 + TypeScript + Vite

This template should help get you started developing with Vue 3 and TypeScript in Vite. The template uses Vue 3 <script setup> SFCs, check out the script setup docs to learn more.

Learn more about the recommended Project Setup and IDE Support in the Vue Docs TypeScript Guide.