Skip to content

Commit c0ce821

Browse files
author
piexlMax(奇淼
committed
feat(mcp): 添加GAG工具用户确认流程和自动字典创建功能
实现三步工作流程:分析、确认、执行 新增自动字典创建功能,当字段使用字典类型时自动检查并创建字典 添加用户确认机制,确保创建操作前获得用户明确确认
1 parent bff82d5 commit c0ce821

File tree

2 files changed

+530
-10
lines changed

2 files changed

+530
-10
lines changed

server/mcp/gag_usage_example.md

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
# GAG工具使用示例 - 带用户确认流程
2+
3+
## 新的工作流程
4+
5+
现在GAG工具支持三步工作流程:
6+
1. `analyze` - 分析现有模块信息
7+
2. `confirm` - 请求用户确认创建计划
8+
3. `execute` - 执行创建操作(需要用户确认)
9+
10+
## 使用示例
11+
12+
### 第一步:分析
13+
```json
14+
{
15+
"action": "analyze",
16+
"requirement": "创建一个图书管理功能"
17+
}
18+
```
19+
20+
### 第二步:确认
21+
```json
22+
{
23+
"action": "confirm",
24+
"executionPlan": {
25+
"packageName": "library",
26+
"moduleName": "Book",
27+
"packageType": "package",
28+
"needCreatedPackage": true,
29+
"needCreatedModules": true,
30+
"packageInfo": {
31+
"desc": "图书管理包",
32+
"label": "图书管理",
33+
"template": "package",
34+
"packageName": "library"
35+
},
36+
"modulesInfo": {
37+
"package": "library",
38+
"tableName": "library_books",
39+
"businessDB": "",
40+
"structName": "Book",
41+
"packageName": "library",
42+
"description": "图书信息",
43+
"abbreviation": "book",
44+
"humpPackageName": "Library",
45+
"gvaModel": true,
46+
"autoMigrate": true,
47+
"autoCreateResource": true,
48+
"autoCreateApiToSql": true,
49+
"autoCreateMenuToSql": true,
50+
"autoCreateBtnAuth": true,
51+
"onlyTemplate": false,
52+
"isTree": false,
53+
"treeJson": "",
54+
"isAdd": false,
55+
"generateWeb": true,
56+
"generateServer": true,
57+
"fields": [
58+
{
59+
"fieldName": "title",
60+
"fieldDesc": "书名",
61+
"fieldType": "string",
62+
"fieldJson": "title",
63+
"dataTypeLong": "255",
64+
"comment": "书名",
65+
"columnName": "title",
66+
"fieldSearchType": "LIKE",
67+
"fieldSearchHide": false,
68+
"dictType": "",
69+
"form": true,
70+
"table": true,
71+
"desc": true,
72+
"excel": true,
73+
"require": true,
74+
"defaultValue": "",
75+
"errorText": "请输入书名",
76+
"clearable": true,
77+
"sort": false,
78+
"primaryKey": false,
79+
"dataSource": {},
80+
"checkDataSource": false,
81+
"fieldIndexType": ""
82+
}
83+
]
84+
}
85+
}
86+
}
87+
```
88+
89+
### 第三步:执行(需要确认参数)
90+
```json
91+
{
92+
"action": "execute",
93+
"executionPlan": {
94+
// ... 同上面的executionPlan
95+
},
96+
"packageConfirm": "yes", // 确认创建包
97+
"modulesConfirm": "yes" // 确认创建模块
98+
}
99+
```
100+
101+
## 确认参数说明
102+
103+
- `packageConfirm`: 当`needCreatedPackage`为true时必需
104+
- "yes": 确认创建包
105+
- "no": 取消创建包(停止后续处理)
106+
107+
- `modulesConfirm`: 当`needCreatedModules`为true时必需
108+
- "yes": 确认创建模块
109+
- "no": 取消创建模块(停止后续处理)
110+
111+
## 取消操作的行为
112+
113+
1. 如果用户在`packageConfirm`中选择"no",系统将停止所有后续处理
114+
2. 如果用户在`modulesConfirm`中选择"no",系统将停止模块创建
115+
3. 任何取消操作都会返回相应的取消消息,不会执行任何创建操作
116+
117+
## 注意事项
118+
119+
1. 必须先调用`confirm`来获取确认信息
120+
2.`execute`时必须提供相应的确认参数
121+
3. 确认参数的值必须是"yes"或"no"
122+
4. 如果不需要创建包或模块,则不需要提供对应的确认参数

0 commit comments

Comments
 (0)