Skip to content

Commit 0d90029

Browse files
author
piexlMax(奇淼
committed
docs: 更新文档中字段类型描述并优化工具说明
更新多个文档和工具描述文件,统一字段类型的详细说明格式 优化菜单创建工具和API创建工具的描述,明确使用场景 补充执行计划schema中字段类型的详细说明 (cherry picked from commit d9448aa25cca717e01a00aec2c38a24da7b28f6f)
1 parent b71ad7b commit 0d90029

File tree

5 files changed

+19
-5
lines changed

5 files changed

+19
-5
lines changed

server/mcp/api_creator.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ type ApiCreator struct{}
4141
// New 创建API创建工具
4242
func (a *ApiCreator) New() mcp.Tool {
4343
return mcp.NewTool("create_api",
44-
mcp.WithDescription("创建后端API记录,用于在生成后端接口时自动创建对应的API权限记录,只要创建了API层,router下的文件产生了路径变化等,都需要调用此mcp。"),
44+
mcp.WithDescription("创建后端API记录,用于AI编辑器自动添加API接口时自动创建对应的API权限记录。注意:使用gva_auto_generate创建的包和模块会自动创建API权限,无需调用此工具。仅在AI编辑器自动添加API或router下的文件产生路径变化时使用。"),
4545
mcp.WithString("path",
4646
mcp.Required(),
4747
mcp.Description("API路径,如:/user/create"),

server/mcp/execution_plan_schema.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,20 @@ type DataSource struct {
500500
1. **PackageType**: 只能是 "plugin" 或 "package"
501501
2. **NeedCreatedPackage**: 当为true时,PackageInfo必须提供
502502
3. **NeedCreatedModules**: 当为true时,ModulesInfo必须提供
503-
4. **字段类型**: FieldType支持的类型包括:string, int, int64, float64, bool, time.Time, enum, picture, video, file, pictures, array, richtext, json等
503+
4. **字段类型**: FieldType支持的类型包括:
504+
- string(字符串)
505+
- richtext(富文本)
506+
- int(整型)
507+
- bool(布尔值)
508+
- float64(浮点型)
509+
- time.Time(时间)
510+
- enum(枚举)
511+
- picture(单图片,字符串)
512+
- pictures(多图片,json字符串)
513+
- video(视频,字符串)
514+
- file(文件,json字符串)
515+
- json(JSON)
516+
- array(数组)
504517
5. **搜索类型**: FieldSearchType支持:EQ, NE, GT, GE, LT, LE, LIKE, BETWEEN等
505518
6. **索引类型**: FieldIndexType支持:index, unique等
506519
7. **GvaModel**: 设置为true时会自动包含ID、CreatedAt、UpdatedAt、DeletedAt字段

server/mcp/gag_usage_example.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,4 +201,5 @@
201201
1. 必须先调用`confirm`来获取确认信息
202202
2.`execute`时必须提供相应的确认参数
203203
3. 确认参数的值必须是"yes"或"no"
204-
4. 如果不需要创建包或模块,则不需要提供对应的确认参数
204+
4. 如果不需要创建包或模块,则不需要提供对应的确认参数
205+
5. 字段类型支持:string(字符串),richtext(富文本),int(整型),bool(布尔值),float64(浮点型),time.Time(时间),enum(枚举),picture(单图片,字符串),pictures(多图片,json字符串),video(视频,字符串),file(文件,json字符串),json(JSON),array(数组)

server/mcp/gva_auto_generate.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ func (t *AutomationModuleAnalyzer) New() mcp.Tool {
206206
1. needCreatedPackage=true时packageInfo必需
207207
2. needCreatedModules=true时modulesInfo必需
208208
3. packageType只能是"package"或"plugin"
209-
4. 字段类型支持:string,int,int64,float64,bool,time.Time,enum,picture,video,file,pictures,array,richtext,json
209+
4. 字段类型支持:string(字符串),richtext(富文本),int(整型),bool(布尔值),float64(浮点型),time.Time(时间),enum(枚举),picture(单图片,字符串),pictures(多图片,json字符串),video(视频,字符串),file(文件,json字符串),json(JSON),array(数组)
210210
5. 搜索类型支持:=,!=,>,>=,<,<=,NOT BETWEEN/LIKE/BETWEEN/IN/NOT IN
211211
6. gvaModel=true时自动包含ID,CreatedAt,UpdatedAt,DeletedAt字段
212212
7. **重要**:当gvaModel=false时,必须有一个字段的primaryKey=true,否则会导致PrimaryField为nil错误

server/mcp/menu_creator.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ type MenuCreator struct{}
6464
// New 创建菜单创建工具
6565
func (m *MenuCreator) New() mcp.Tool {
6666
return mcp.NewTool("create_menu",
67-
mcp.WithDescription("创建前端菜单记录,用于在生成前端页面时自动创建对应的菜单项,只要前端有页面生成,都需要调用此mcp。"),
67+
mcp.WithDescription("创建前端菜单记录,用于AI编辑器自动添加前端页面时自动创建对应的菜单项。注意:使用gva_auto_generate创建的包和模块会自动创建菜单项,无需调用此工具。仅在AI编辑器自动添加前端页面时使用。"),
6868
mcp.WithNumber("parentId",
6969
mcp.Description("父菜单ID,0表示根菜单"),
7070
mcp.DefaultNumber(0),

0 commit comments

Comments
 (0)