代码审查修复: - 前端页面统一使用 dateFormatter 格式化日期 - API 文件添加分页参数类型定义 - 移除未使用的 Dayjs 导入 前端类型完善: - RiskAssessmentPageParams 危险评估分页参数 - ScorePageParams 计分考核分页参数 - ConsumptionPageParams 消费记录分页参数 新增评估模块前端: - assessment API 接口定义 - assessment/record 评估记录列表页面
138 lines
4.7 KiB
Markdown
138 lines
4.7 KiB
Markdown
---
|
||
description: ruoyi-app-scaffold
|
||
---
|
||
```mermaid
|
||
flowchart TD
|
||
start_node_default([Start])
|
||
ask_basic_info{AskUserQuestion:<br/>请输入新应用的基本信息:模块英文名(如:system)、模块中文名(如:系统管理)、表名(如:system_user)、以及应用描述}
|
||
create_structure[create-structure]
|
||
configure_dependencies[configure-dependencies]
|
||
create_database[create-database]
|
||
ask_execute_method{AskUserQuestion:<br/>数据库脚本已生成。请选择执行方式:}
|
||
if_execute_choice{If/Else:<br/>Conditional Branch}
|
||
execute_sql[[MCP: mysql_write_query]]
|
||
show_script[数据库脚本已生成完成!]
|
||
implement_backend[implement-backend]
|
||
ask_frontend{AskUserQuestion:<br/>是否需要创建前端代码?}
|
||
implement_frontend[implement-frontend]
|
||
skip_frontend[前端代码创建已跳过。]
|
||
end_node_default([End])
|
||
|
||
start_node_default --> ask_basic_info
|
||
ask_basic_info --> create_structure
|
||
create_structure --> configure_dependencies
|
||
configure_dependencies --> create_database
|
||
create_database --> ask_execute_method
|
||
ask_execute_method --> if_execute_choice
|
||
if_execute_choice -->|Direct Execute| execute_sql
|
||
if_execute_choice -->|Show Script| show_script
|
||
execute_sql --> implement_backend
|
||
show_script --> implement_backend
|
||
implement_backend --> ask_frontend
|
||
ask_frontend -->|是| implement_frontend
|
||
ask_frontend -->|否| skip_frontend
|
||
implement_frontend --> end_node_default
|
||
skip_frontend --> end_node_default
|
||
```
|
||
|
||
## Workflow Execution Guide
|
||
|
||
Follow the Mermaid flowchart above to execute the workflow. Each node type has specific execution methods as described below.
|
||
|
||
### Execution Methods by Node Type
|
||
|
||
- **Rectangle nodes**: Execute Sub-Agents using the Task tool
|
||
- **Diamond nodes (AskUserQuestion:...)**: Use the AskUserQuestion tool to prompt the user and branch based on their response
|
||
- **Diamond nodes (Branch/Switch:...)**: Automatically branch based on the results of previous processing (see details section)
|
||
- **Rectangle nodes (Prompt nodes)**: Execute the prompts described in the details section below
|
||
|
||
## MCP Tool Nodes
|
||
|
||
#### execute_sql(mysql_write_query)
|
||
|
||
**Description**: Execute SQL script to create database tables
|
||
|
||
**MCP Server**: mysql
|
||
|
||
**Tool Name**: mysql_write_query
|
||
|
||
**Validation Status**: valid
|
||
|
||
**Configured Parameters**:
|
||
|
||
- `query` (string): /* SQL script from create-database step will be inserted here */
|
||
|
||
**Available Parameters**:
|
||
|
||
- `query` (string) (required): SQL query to execute (CREATE TABLE or ALTER TABLE statements)
|
||
|
||
This node invokes an MCP (Model Context Protocol) tool. When executing this workflow, use the configured parameters to call the tool via the MCP server.
|
||
|
||
### Prompt Node Details
|
||
|
||
#### show_script(数据库脚本已生成完成!)
|
||
|
||
```
|
||
数据库脚本已生成完成!
|
||
|
||
执行步骤:
|
||
1. 打开生成的 SQL 脚本文件:resources/sql/{模块名}.sql
|
||
2. 连接到目标数据库
|
||
3. 执行脚本创建表和菜单权限
|
||
|
||
生成的脚本包含:
|
||
- 主表创建语句
|
||
- 菜单权限 SQL
|
||
- 初始化数据(如有需要)
|
||
|
||
请确保数据库连接信息正确后执行脚本。
|
||
```
|
||
|
||
#### skip_frontend(前端代码创建已跳过。)
|
||
|
||
```
|
||
前端代码创建已跳过。
|
||
|
||
后端代码已创建完成,您可以在以下位置找到代码:
|
||
- 后端:cn.iocoder.yudao.module.{模块名}
|
||
- 数据库脚本:resources/sql/{模块名}.sql
|
||
|
||
请手动执行数据库脚本,然后启动项目测试后端接口。
|
||
```
|
||
|
||
### AskUserQuestion Node Details
|
||
|
||
#### ask_basic_info(请输入新应用的基本信息:模块英文名(如:system)、模块中文名(如:系统管理)、表名(如:system_user)、以及应用描述)
|
||
|
||
**Selection mode:** Single Select (branches based on the selected option)
|
||
|
||
**Options:**
|
||
- **继续创建**: 确认信息并开始创建应用
|
||
- **取消**: 取消本次创建
|
||
|
||
#### ask_execute_method(数据库脚本已生成。请选择执行方式:)
|
||
|
||
**Selection mode:** Single Select (branches based on the selected option)
|
||
|
||
**Options:**
|
||
- **直接执行**: 使用 MySQL MCP 直接在数据库中执行脚本(推荐用于开发环境)
|
||
- **查看脚本**: 只生成脚本,手动执行(推荐用于生产环境)
|
||
|
||
#### ask_frontend(是否需要创建前端代码?)
|
||
|
||
**Selection mode:** Single Select (branches based on the selected option)
|
||
|
||
**Options:**
|
||
- **是**: 创建前端页面和 API
|
||
- **否**: 跳过前端创建
|
||
|
||
### If/Else Node Details
|
||
|
||
#### if_execute_choice(Binary Branch (True/False))
|
||
|
||
**Branch conditions:**
|
||
- **Direct Execute**: User selected direct execution
|
||
- **Show Script**: User selected to view script only
|
||
|
||
**Execution method**: Evaluate the results of the previous processing and automatically select the appropriate branch based on the conditions above.
|