feat: 代码生成

This commit is contained in:
Blizzard
2026-04-28 10:29:02 +08:00
parent 7e282b36d7
commit b343856b58
38 changed files with 2199 additions and 51 deletions
+15
View File
@@ -0,0 +1,15 @@
package codegen
// PreviewFile 预览的单个文件
type PreviewFile struct {
FilePath string `json:"filePath"` // 相对于输出目录的路径
Content string `json:"content"` // 文件内容
AlwaysOverwrite bool `json:"alwaysOverwrite,omitempty"` // 聚合文件(如 enter.go),始终覆盖
}
// GenResult 代码生成结果
type GenResult struct {
OutputDir string `json:"outputDir"` // 实际输出目录
Files []PreviewFile `json:"files"` // 生成的文件列表
Message string `json:"message"` // 生成结果说明
}