CategorizeLabel/docs/AICoding_prompt/XXX模块架构设计.md
2025-10-15 17:19:26 +08:00

137 lines
2.1 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

## XXX子模块架构设计
## 1 模块概述
### 1. 1 功能描述
功能:
输入:
输出:
### 1.2 interfaces.py
def func1(X: x) -> Y:
"""
func1功能描述
Args:
X: 参数x
Returns:
Y: 输出y
"""
pass
## 2 架构设计:interfaces.py
### 2.1模块分类
使用mermaid展示仅展示可以被外部调用的方法和属性。
```mermaid
classDiagram
class BankAccount {
%% 属性
String owner
int balance
%% 方法
deposit(amount)
withdraw(amount) bool
}
```
### 2.2 各类功能
#### 2.2.1 xxx类
def func1(X: x) -> Y:
"""
func1功能描述
Args:
X: 参数x
Returns:
Y: 输出y
"""
pass
## 3 services.py
使用流程图介绍基本算法
```mermaid
graph LR
step1-->step2
```
## 4. models.py
```
class xxData(BaseModel):
"""xx数据"""
x: List =
y: List(Y) = Field(..., description="y")
```
## 5. core
### 5.1 xxx类
#### 5.1.1 xxx函数
1. 使用流程图介绍基本算法。
```mermaid
graph LR
step1-->step2
```
2. 使用函数调用图介绍基本函数调用关系。
```mermaid
graph TD
%% --- 节点定义 ---
%% 语法: nodeId["函数名\n---\n功能: 描述\n输入: 参数\n输出: 返回值"]
func1["
func1
---
功能: 系统入口,处理用户请求
输入: UserRequest
输出: ApiResponse
"]
func2["
func2
---
功能: 验证输入数据的合法性
输入: UserRequest
输出: boolean (true/false)
"]
func3["
func3
---
功能: 从数据库查询用户信息
输入: userId
输出: UserData
"]
func4["
func4
---
功能: 生成并返回响应
输入: UserData, status
输出: ApiResponse
"]
%% --- 调用关系定义 ---
%% 语法: 调用者 --> 被调用者
func1 --> func2
func1 --> func3
func1 --> func4
```