speccrew 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.speccrew/agents/speccrew-feature-designer.md +142 -0
- package/.speccrew/agents/speccrew-product-manager.md +61 -0
- package/.speccrew/agents/speccrew-system-designer.md +200 -0
- package/.speccrew/agents/speccrew-system-developer.md +238 -0
- package/.speccrew/agents/speccrew-task-worker.md +80 -0
- package/.speccrew/agents/speccrew-team-leader.md +92 -0
- package/.speccrew/agents/speccrew-test-manager.md +313 -0
- package/.speccrew/skills/speccrew-create-agents/SKILL.md +98 -0
- package/.speccrew/skills/speccrew-create-agents/templates/agents/designer-agent.md +54 -0
- package/.speccrew/skills/speccrew-create-agents/templates/agents/dev-agent.md +79 -0
- package/.speccrew/skills/speccrew-create-agents/templates/agents/test-agent.md +80 -0
- package/.speccrew/skills/speccrew-dev-backend/SKILL.md +205 -0
- package/.speccrew/skills/speccrew-dev-backend/templates/TASK-RECORD-TEMPLATE.md +118 -0
- package/.speccrew/skills/speccrew-dev-desktop/SKILL.md +258 -0
- package/.speccrew/skills/speccrew-dev-desktop/templates/TASK-RECORD-TEMPLATE.md +161 -0
- package/.speccrew/skills/speccrew-dev-frontend/SKILL.md +202 -0
- package/.speccrew/skills/speccrew-dev-frontend/templates/TASK-RECORD-TEMPLATE.md +115 -0
- package/.speccrew/skills/speccrew-dev-mobile/SKILL.md +200 -0
- package/.speccrew/skills/speccrew-dev-mobile/templates/TASK-RECORD-TEMPLATE.md +125 -0
- package/.speccrew/skills/speccrew-fd-api-contract/SKILL.md +73 -0
- package/.speccrew/skills/speccrew-fd-api-contract/templates/API-CONTRACT-TEMPLATE.md +96 -0
- package/.speccrew/skills/speccrew-fd-feature-design/SKILL.md +395 -0
- package/.speccrew/skills/speccrew-fd-feature-design/templates/FEATURE-SPEC-TEMPLATE.md +387 -0
- package/.speccrew/skills/speccrew-get-timestamp/SKILL.md +80 -0
- package/.speccrew/skills/speccrew-get-timestamp/scripts/get-timestamp.js +35 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-api-analyze/SKILL.md +1116 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-api-analyze/templates/FEATURE-DETAIL-TEMPLATE-FASTAPI.md +462 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-api-analyze/templates/FEATURE-DETAIL-TEMPLATE-JAVA.md +480 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-api-analyze/templates/FEATURE-DETAIL-TEMPLATE-NET.md +464 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-api-analyze/templates/FEATURE-DETAIL-TEMPLATE.md +480 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-api-analyze/templates/MODULE-OVERVIEW-TEMPLATE.md +367 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/SKILL.md +667 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/STATUS-FORMATS.md +74 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/scripts/batch-orchestrator.js +176 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/scripts/get-next-batch.js +150 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/scripts/get-pending-features.js +106 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/scripts/mark-stale.js +249 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/scripts/process-batch-results.js +848 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/scripts/update-feature-status.js +226 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-init-features/SKILL.md +264 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-init-features/examples/features.json +34 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-init-features/scripts/generate-inventory.js +867 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-init-features/scripts/test-inventory.js +26 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-module-classify/SKILL.md +165 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-module-classify/scripts/apply-module-mapping.js +208 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-module-classify/scripts/extract-module-summary.js +180 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-module-classify/scripts/reindex-modules.js +358 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-ui-analyze/SKILL.md +1055 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-ui-analyze/templates/FEATURE-DETAIL-TEMPLATE-UI-DESKTOP.md +303 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-ui-analyze/templates/FEATURE-DETAIL-TEMPLATE-UI-ELECTRON.md +327 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-ui-analyze/templates/FEATURE-DETAIL-TEMPLATE-UI-MINIAPP.md +292 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-ui-analyze/templates/FEATURE-DETAIL-TEMPLATE-UI-MOBILE.md +281 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-ui-analyze/templates/FEATURE-DETAIL-TEMPLATE-UI.md +324 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-ui-style-extract/SKILL.md +270 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-ui-style-extract/templates/COMPONENT-PATTERN-TEMPLATE.md +33 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-ui-style-extract/templates/LAYOUT-PATTERN-TEMPLATE.md +33 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-ui-style-extract/templates/PAGE-TYPE-TEMPLATE.md +33 -0
- package/.speccrew/skills/speccrew-knowledge-graph-query/SKILL.md +229 -0
- package/.speccrew/skills/speccrew-knowledge-graph-query/scripts/graph-query.js +549 -0
- package/.speccrew/skills/speccrew-knowledge-graph-write/SKILL.md +181 -0
- package/.speccrew/skills/speccrew-knowledge-graph-write/scripts/graph-write.js +651 -0
- package/.speccrew/skills/speccrew-knowledge-module-summarize/SKILL.md +305 -0
- package/.speccrew/skills/speccrew-knowledge-module-summarize/templates/MODULE-OVERVIEW-TEMPLATE.md +400 -0
- package/.speccrew/skills/speccrew-knowledge-system-summarize/SKILL.md +351 -0
- package/.speccrew/skills/speccrew-knowledge-system-summarize/templates/SYSTEM-OVERVIEW-TEMPLATE.md +294 -0
- package/.speccrew/skills/speccrew-knowledge-techs-dispatch/SKILL.md +683 -0
- package/.speccrew/skills/speccrew-knowledge-techs-dispatch/STATUS-FORMATS.md +550 -0
- package/.speccrew/skills/speccrew-knowledge-techs-dispatch/templates/techs-manifest-EXAMPLE.json +35 -0
- package/.speccrew/skills/speccrew-knowledge-techs-generate/SKILL.md +1087 -0
- package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/ARCHITECTURE-TEMPLATE.md +240 -0
- package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/COLOR-SYSTEM-TEMPLATE.md +68 -0
- package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/COMPONENT-LIBRARY-TEMPLATE.md +86 -0
- package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/CONVENTIONS-BUILD-TEMPLATE.md +466 -0
- package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/CONVENTIONS-DATA-TEMPLATE.md +432 -0
- package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/CONVENTIONS-DESIGN-TEMPLATE.md +1209 -0
- package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/CONVENTIONS-DEV-TEMPLATE.md +1433 -0
- package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/CONVENTIONS-SYSTEM-TEST-TEMPLATE.md +1052 -0
- package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/CONVENTIONS-UNIT-TEST-TEMPLATE.md +946 -0
- package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/INDEX-TEMPLATE.md +29 -0
- package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/PAGE-LAYOUTS-TEMPLATE.md +69 -0
- package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/PAGE-TYPE-SUMMARY-TEMPLATE.md +74 -0
- package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/TECH-STACK-TEMPLATE.md +232 -0
- package/.speccrew/skills/speccrew-knowledge-techs-generate-conventions/SKILL.md +628 -0
- package/.speccrew/skills/speccrew-knowledge-techs-generate-ui-style/SKILL.md +392 -0
- package/.speccrew/skills/speccrew-knowledge-techs-index/SKILL.md +489 -0
- package/.speccrew/skills/speccrew-knowledge-techs-index/templates/INDEX-TEMPLATE.md +243 -0
- package/.speccrew/skills/speccrew-knowledge-techs-init/SKILL.md +269 -0
- package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/SKILL.md +562 -0
- package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/BUSINESS-COMPONENTS-TEMPLATE.md +171 -0
- package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/COMMON-COMPONENTS-TEMPLATE.md +177 -0
- package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/COMPONENT-INDIVIDUAL-TEMPLATE.md +80 -0
- package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/COMPONENT-LIBRARY-TEMPLATE.md +118 -0
- package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/LAYOUT-INDIVIDUAL-TEMPLATE.md +97 -0
- package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/LAYOUT-PATTERNS-TEMPLATE.md +208 -0
- package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/NAVIGATION-PATTERNS-TEMPLATE.md +157 -0
- package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/PAGE-TYPE-INDIVIDUAL-TEMPLATE.md +123 -0
- package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/PAGE-TYPE-SUMMARY-TEMPLATE.md +58 -0
- package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/SPACING-TEMPLATE.md +119 -0
- package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/STYLE-SYSTEM-TEMPLATE.md +117 -0
- package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/TYPOGRAPHY-TEMPLATE.md +107 -0
- package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/UI-STYLE-GUIDE-TEMPLATE.md +171 -0
- package/.speccrew/skills/speccrew-pm-requirement-analysis/SKILL.md +434 -0
- package/.speccrew/skills/speccrew-pm-requirement-analysis/templates/BIZS-MODELING-TEMPLATE.md +332 -0
- package/.speccrew/skills/speccrew-pm-requirement-analysis/templates/PRD-TEMPLATE.md +200 -0
- package/.speccrew/skills/speccrew-pm-requirement-assess/SKILL.md +195 -0
- package/.speccrew/skills/speccrew-project-diagnosis/SKILL.md +208 -0
- package/.speccrew/skills/speccrew-project-diagnosis/templates/DIAGNOSIS-REPORT-TEMPLATE.md +202 -0
- package/.speccrew/skills/speccrew-sd-backend/SKILL.md +188 -0
- package/.speccrew/skills/speccrew-sd-backend/templates/INDEX-TEMPLATE.md +85 -0
- package/.speccrew/skills/speccrew-sd-backend/templates/SD-BACKEND-TEMPLATE.md +269 -0
- package/.speccrew/skills/speccrew-sd-desktop/SKILL.md +192 -0
- package/.speccrew/skills/speccrew-sd-desktop/templates/INDEX-TEMPLATE.md +271 -0
- package/.speccrew/skills/speccrew-sd-desktop/templates/SD-DESKTOP-TEMPLATE.md +673 -0
- package/.speccrew/skills/speccrew-sd-frontend/SKILL.md +176 -0
- package/.speccrew/skills/speccrew-sd-frontend/templates/INDEX-TEMPLATE.md +184 -0
- package/.speccrew/skills/speccrew-sd-frontend/templates/SD-FRONTEND-TEMPLATE.md +382 -0
- package/.speccrew/skills/speccrew-sd-mobile/SKILL.md +189 -0
- package/.speccrew/skills/speccrew-sd-mobile/templates/INDEX-TEMPLATE.md +219 -0
- package/.speccrew/skills/speccrew-sd-mobile/templates/SD-MOBILE-TEMPLATE.md +534 -0
- package/.speccrew/skills/speccrew-test-case-design/SKILL.md +284 -0
- package/.speccrew/skills/speccrew-test-case-design/templates/TEST-CASE-DESIGN-TEMPLATE.md +263 -0
- package/.speccrew/skills/speccrew-test-code-gen/SKILL.md +313 -0
- package/.speccrew/skills/speccrew-test-code-gen/templates/TEST-CODE-PLAN-TEMPLATE.md +180 -0
- package/.speccrew/skills/speccrew-test-execute/SKILL.md +283 -0
- package/.speccrew/skills/speccrew-test-execute/templates/BUG-REPORT-TEMPLATE.md +50 -0
- package/.speccrew/skills/speccrew-test-execute/templates/TEST-REPORT-TEMPLATE.md +57 -0
- package/.speccrew/skills/speccrew-workflow-diagnose/SKILL.md +155 -0
- package/LICENSE +21 -0
- package/README.ar.md +318 -0
- package/README.en.md +318 -0
- package/README.es.md +318 -0
- package/README.md +340 -0
- package/bin/cli.js +62 -0
- package/lib/commands/doctor.js +138 -0
- package/lib/commands/init.js +231 -0
- package/lib/commands/list.js +114 -0
- package/lib/commands/uninstall.js +117 -0
- package/lib/commands/update.js +351 -0
- package/lib/ide-adapters.js +73 -0
- package/lib/utils.js +104 -0
- package/package.json +28 -0
- package/workspace-template/docs/configs/document-templates.json +667 -0
- package/workspace-template/docs/configs/platform-mapping.json +194 -0
- package/workspace-template/docs/configs/tech-stack-mappings.json +313 -0
- package/workspace-template/docs/configs/validation-rules.json +87 -0
- package/workspace-template/docs/rules/mermaid-rule.md +114 -0
- package/workspace-template/docs/solutions/Agent/346/212/200/350/203/275/345/256/232/344/271/211+/351/234/200/346/261/202/346/226/207/346/241/243+UML/344/275/277/347/224/250/346/250/241/346/235/277/357/274/210ISA-95/345/205/255/346/256/265/345/274/217/350/236/215/345/220/210/347/211/210/357/274/211.md +586 -0
- package/workspace-template/docs/solutions/agent-knowledge-map.md +238 -0
- package/workspace-template/docs/solutions/bizs-knowledge-pipeline.md +678 -0
- package/workspace-template/docs/solutions/harness.md +410 -0
- package/workspace-template/docs/solutions/knowledge-incremental-sync-spec.md +943 -0
- package/workspace-template/docs/solutions/techs-knowledge-pipeline.md +803 -0
- package/workspace-template/docs/solutions/workspace-structure.md +318 -0
|
@@ -0,0 +1,480 @@
|
|
|
1
|
+
# Feature Detail Design Template - [Feature Name]
|
|
2
|
+
|
|
3
|
+
> **Applicable Scenario**: Detailed design for a single feature, including UI prototypes, interaction flows, and data definitions, for AI Agent generation and reading
|
|
4
|
+
> **Target Audience**: devcrew-product-manager, devcrew-solution-manager, devcrew-designer, devcrew-developer
|
|
5
|
+
> **Related Document**: [Module Overview Document](../{{module-name}}-overview.md)
|
|
6
|
+
>
|
|
7
|
+
> <!-- AI-TAG: FEATURE_DETAIL -->
|
|
8
|
+
> <!-- AI-CONTEXT: This document describes the UI, interaction, and data rules of a single feature in detail. AI should fill all placeholders when generating. -->
|
|
9
|
+
|
|
10
|
+
<cite>
|
|
11
|
+
**Files Referenced in This Document**
|
|
12
|
+
- [{Controller}.java](../../{controllerSourcePath})
|
|
13
|
+
- [{Service}.java](../../{serviceSourcePath})
|
|
14
|
+
- [{Entity}.java](../../{entitySourcePath})
|
|
15
|
+
- [{DTO}.java](../../{dtoSourcePath})
|
|
16
|
+
</cite>
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## 1. Content Overview
|
|
21
|
+
|
|
22
|
+
<!-- AI-TAG: OVERVIEW -->
|
|
23
|
+
|
|
24
|
+
### 1.1 Basic Information
|
|
25
|
+
|
|
26
|
+
| Item | Description |
|
|
27
|
+
|------|-------------|
|
|
28
|
+
| Controller Name | {Fill in controller name} |
|
|
29
|
+
| Module | {e.g., Order Management Module} |
|
|
30
|
+
| Core Function | {1-3 sentences describing core API functionality} |
|
|
31
|
+
| Base Path | {e.g., /admin-api/system/user} |
|
|
32
|
+
|
|
33
|
+
### 1.2 API Scope
|
|
34
|
+
|
|
35
|
+
This controller includes the following API endpoints:
|
|
36
|
+
- [ ] {GET /page} - {Description}
|
|
37
|
+
- [ ] {POST /create} - {Description}
|
|
38
|
+
- [ ] {PUT /update} - {Description}
|
|
39
|
+
- [ ] {DELETE /delete} - {Description}
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## 2. API Endpoint Definitions
|
|
44
|
+
|
|
45
|
+
<!-- AI-TAG: API_ENDPOINTS -->
|
|
46
|
+
<!-- AI-NOTE: Document all public API endpoints exposed by this controller -->
|
|
47
|
+
|
|
48
|
+
### 2.1 {Endpoint Name} - {HTTP Method} {API Path}
|
|
49
|
+
|
|
50
|
+
**Endpoint Information:**
|
|
51
|
+
|
|
52
|
+
| Item | Description |
|
|
53
|
+
|------|-------------|
|
|
54
|
+
| Method | {GET/POST/PUT/DELETE} |
|
|
55
|
+
| Path | {/admin-api/system/user/page} |
|
|
56
|
+
| Description | {Brief description of what this endpoint does} |
|
|
57
|
+
| Permission | {Required permission code or role} |
|
|
58
|
+
|
|
59
|
+
**Request Parameters:**
|
|
60
|
+
|
|
61
|
+
| Parameter | Type | Required | Description | Validation Rules |
|
|
62
|
+
|-----------|------|----------|-------------|------------------|
|
|
63
|
+
| {param1} | {String/Integer/Long} | {Yes/No} | {Description} | {e.g., Length 1-50, Not blank} |
|
|
64
|
+
| {param2} | {Integer} | {No} | {Description} | {e.g., Min 1, Max 100} |
|
|
65
|
+
| {pageNo} | {Integer} | {No} | {Page number} | {Default 1, Min 1} |
|
|
66
|
+
| {pageSize} | {Integer} | {No} | {Page size} | {Default 10, Max 100} |
|
|
67
|
+
|
|
68
|
+
**Response Data:**
|
|
69
|
+
|
|
70
|
+
| Field | Type | Description | Nullable |
|
|
71
|
+
|-------|------|-------------|----------|
|
|
72
|
+
| {id} | {Long} | {Record ID} | {No} |
|
|
73
|
+
| {field1} | {String} | {Description} | {Yes} |
|
|
74
|
+
| {field2} | {Integer} | {Description} | {No} |
|
|
75
|
+
| {createTime} | {DateTime} | {Creation time} | {No} |
|
|
76
|
+
|
|
77
|
+
**Response Example:**
|
|
78
|
+
|
|
79
|
+
```json
|
|
80
|
+
{
|
|
81
|
+
"code": 0,
|
|
82
|
+
"message": "success",
|
|
83
|
+
"data": {
|
|
84
|
+
"list": [
|
|
85
|
+
{
|
|
86
|
+
"id": 1,
|
|
87
|
+
"field1": "value1",
|
|
88
|
+
"field2": 100,
|
|
89
|
+
"createTime": "2024-01-01 12:00:00"
|
|
90
|
+
}
|
|
91
|
+
],
|
|
92
|
+
"total": 100
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
**Error Codes:**
|
|
98
|
+
|
|
99
|
+
| Error Code | Description | Trigger Condition |
|
|
100
|
+
|------------|-------------|-------------------|
|
|
101
|
+
| {ERR_001} | {Error description} | {When this error occurs} |
|
|
102
|
+
| {ERR_002} | {Error description} | {When this error occurs} |
|
|
103
|
+
|
|
104
|
+
**Business Flow:**
|
|
105
|
+
|
|
106
|
+
```mermaid
|
|
107
|
+
graph TB
|
|
108
|
+
Start([Request Received]) --> Auth{Permission Check}
|
|
109
|
+
|
|
110
|
+
Auth -->|No Permission| AuthError[Return 403 Forbidden]
|
|
111
|
+
AuthError --> End1([End])
|
|
112
|
+
|
|
113
|
+
Auth -->|Has Permission| Validate{Parameter Validation}
|
|
114
|
+
|
|
115
|
+
Validate -->|Invalid| ValError[Return 400 Bad Request]
|
|
116
|
+
ValError --> End1
|
|
117
|
+
|
|
118
|
+
Validate -->|Valid| Ctrl[Controller.processRequest]
|
|
119
|
+
|
|
120
|
+
Ctrl -->|Call| Svc[Service.businessMethod]
|
|
121
|
+
|
|
122
|
+
Svc -->|Validate| BizRule{Business Rules}
|
|
123
|
+
BizRule -->|Violation| BizError[Return Business Error]
|
|
124
|
+
BizError --> End1
|
|
125
|
+
|
|
126
|
+
BizRule -->|Pass| SvcLogic[Service Logic Processing]
|
|
127
|
+
SvcLogic -->|Transform Data| SvcData[Prepare Data]
|
|
128
|
+
|
|
129
|
+
SvcData -->|Call| Mapper[Mapper.insert/update/select]
|
|
130
|
+
|
|
131
|
+
Mapper -->|Execute SQL| DB[(Database)]
|
|
132
|
+
DB -->|Return Result| Mapper
|
|
133
|
+
|
|
134
|
+
Mapper -->|Return| SvcResult[Service Process Result]
|
|
135
|
+
SvcResult -->|Return| CtrlResult[Controller Assemble Response]
|
|
136
|
+
|
|
137
|
+
CtrlResult --> Success[Return 200 Success]
|
|
138
|
+
Success --> End2([End])
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
**Flow Step Description:**
|
|
142
|
+
|
|
143
|
+
| Step | Operation | Layer | Component | Input | Output | Exception Handling |
|
|
144
|
+
|------|-----------|-------|-----------|-------|--------|-------------------|
|
|
145
|
+
| 1 | Permission Check | Controller | {Controller} | Request + Token | Permission result | Return 403 |
|
|
146
|
+
| 2 | Parameter Validation | Controller | {Controller}/{DTO} | Request parameters | Validated DTO | Return 400 |
|
|
147
|
+
| 3 | Invoke Service | Controller | {Controller} | Validated DTO | Service result | - |
|
|
148
|
+
| 4 | Business Rule Check | Service | {Service} | Business data | Validation result | Return business error |
|
|
149
|
+
| 5 | Data Processing | Service | {Service} | Raw data | Processed data | - |
|
|
150
|
+
| 6 | Invoke Mapper | Service | {Service} | Processed data | Mapper result | - |
|
|
151
|
+
| 7 | SQL Execution | Mapper | {Mapper}/{Mapper XML} | SQL parameters | DB result | Return 500 |
|
|
152
|
+
| 8 | Assemble Response | Controller | {Controller} | Service result | API response | Return 200 |
|
|
153
|
+
|
|
154
|
+
**Detailed Call Chain:**
|
|
155
|
+
|
|
156
|
+
| # | Layer | Class | Method | Responsibility | Source |
|
|
157
|
+
|---|-------|-------|--------|----------------|--------|
|
|
158
|
+
| 1 | Controller | {UserController} | {createUser} | Receive request, validate params, call service | [Source](../../{controllerSourcePath}) |
|
|
159
|
+
| 2 | Service | {UserService} | {createUser} | Business validation, data processing, call mapper | [Source](../../{serviceSourcePath}) |
|
|
160
|
+
| 3 | Service | {UserService} | {validateUserName} | Check user name uniqueness | [Source](../../{serviceSourcePath}) |
|
|
161
|
+
| 4 | Mapper | {UserMapper} | {insert} | Execute INSERT SQL | [Source](../../{mapperSourcePath}) |
|
|
162
|
+
| 5 | Mapper XML | {UserMapper.xml} | {insert} | SQL: INSERT INTO user (...) VALUES (...) | [Source](../../{mapperXmlSourcePath}) |
|
|
163
|
+
|
|
164
|
+
**Database Operations:**
|
|
165
|
+
|
|
166
|
+
| Operation | Table | SQL Type | Description |
|
|
167
|
+
|-----------|-------|----------|-------------|
|
|
168
|
+
| {INSERT} | {user} | {INSERT} | {Insert new user record} |
|
|
169
|
+
| {SELECT} | {user} | {SELECT COUNT} | {Check user name exists} |
|
|
170
|
+
| {UPDATE} | {user} | {UPDATE} | {Update user status} |
|
|
171
|
+
|
|
172
|
+
**Transaction Boundaries:**
|
|
173
|
+
|
|
174
|
+
| Method | Transaction Scope | Isolation Level | Notes |
|
|
175
|
+
|--------|-------------------|-----------------|-------|
|
|
176
|
+
| {UserService.createUser} | {User + UserRole} | {READ_COMMITTED} | {Atomic operation} |
|
|
177
|
+
|
|
178
|
+
### 2.2 {Next Endpoint Name} - {HTTP Method} {API Path}
|
|
179
|
+
|
|
180
|
+
{Repeat the same structure for each API endpoint in the controller}
|
|
181
|
+
|
|
182
|
+
---
|
|
183
|
+
|
|
184
|
+
## 3. Data Field Definition
|
|
185
|
+
|
|
186
|
+
<!-- AI-TAG: DATA_DEFINITION -->
|
|
187
|
+
<!-- AI-NOTE: Data definitions are important for Solution Agent to design APIs and databases -->
|
|
188
|
+
|
|
189
|
+
### 3.1 Database Table Structure
|
|
190
|
+
|
|
191
|
+
<!-- AI-NOTE: Analyze Entity/DO class and Mapper XML to extract database table structure -->
|
|
192
|
+
|
|
193
|
+
**Table Name:** {table_name}
|
|
194
|
+
|
|
195
|
+
**Table Description:** {Description of what this table stores}
|
|
196
|
+
|
|
197
|
+
| Field Name | Field Type | DB Type | Length | Nullable | Default | Constraint | Index | Description |
|
|
198
|
+
|------------|------------|---------|--------|----------|---------|------------|-------|-------------|
|
|
199
|
+
| {id} | {Long} | {BIGINT} | {20} | {No} | {Auto increment} | {PRIMARY KEY} | {PRIMARY} | {Primary key} |
|
|
200
|
+
| {field1} | {String} | {VARCHAR} | {64} | {No} | - | {UNIQUE} | {UNIQUE} | {Unique field} |
|
|
201
|
+
| {field2} | {Integer} | {INT} | - | {Yes} | {0} | - | - | {Optional field} |
|
|
202
|
+
| {field3} | {DateTime} | {DATETIME} | - | {No} | {CURRENT_TIMESTAMP} | - | - | {Creation time} |
|
|
203
|
+
| {field4} | {Enum} | {TINYINT} | {1} | {No} | {1} | - | {INDEX} | {Status field} |
|
|
204
|
+
|
|
205
|
+
**Indexes:**
|
|
206
|
+
|
|
207
|
+
| Index Name | Index Type | Fields | Purpose |
|
|
208
|
+
|------------|------------|--------|---------|
|
|
209
|
+
| {idx_name} | {INDEX} | {field1} | {Query optimization} |
|
|
210
|
+
| {idx_status} | {INDEX} | {field4, create_time} | {Composite index for status query} |
|
|
211
|
+
|
|
212
|
+
**Relationships:**
|
|
213
|
+
|
|
214
|
+
| Related Table | Relationship | Foreign Key | Description |
|
|
215
|
+
|---------------|--------------|-------------|-------------|
|
|
216
|
+
| {related_table} | {One-to-Many} | {this_table.related_id} | {Relationship description} |
|
|
217
|
+
| {another_table} | {Many-to-One} | {this_table.parent_id} | {Relationship description} |
|
|
218
|
+
|
|
219
|
+
**Source:** [Entity](../../{entitySourcePath}) | [Mapper XML](../../{mapperXmlSourcePath})
|
|
220
|
+
|
|
221
|
+
### 3.2 Entity-Database Mapping
|
|
222
|
+
|
|
223
|
+
| Entity Field | DB Column | Type Mapping | Notes |
|
|
224
|
+
|--------------|-----------|--------------|-------|
|
|
225
|
+
| {entity.field1} | {column_name} | {String → VARCHAR(64)} | {Mapping notes} |
|
|
226
|
+
| {entity.field2} | {column_name} | {Integer → INT} | {Mapping notes} |
|
|
227
|
+
| {entity.createTime} | {create_time} | {LocalDateTime → DATETIME} | {Auto-filled} |
|
|
228
|
+
|
|
229
|
+
### 3.3 DTO/VO Definitions
|
|
230
|
+
|
|
231
|
+
**Request Parameters:**
|
|
232
|
+
|
|
233
|
+
```json
|
|
234
|
+
{
|
|
235
|
+
"{Field 1}": "{Example value}",
|
|
236
|
+
"{Field 2}": "{Example value}",
|
|
237
|
+
"{Field 3}": {Number},
|
|
238
|
+
"{Field 4}": {Enum value}
|
|
239
|
+
}
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
**Response Data:**
|
|
243
|
+
|
|
244
|
+
```json
|
|
245
|
+
{
|
|
246
|
+
"code": 0,
|
|
247
|
+
"message": "success",
|
|
248
|
+
"data": {
|
|
249
|
+
"id": "{Record ID}",
|
|
250
|
+
"{Field 1}": "{Return value}",
|
|
251
|
+
"{Field 2}": "{Return value}",
|
|
252
|
+
"createTime": "2024-01-01 12:00:00"
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
---
|
|
258
|
+
|
|
259
|
+
## 4. References
|
|
260
|
+
|
|
261
|
+
<!-- AI-TAG: REFERENCES -->
|
|
262
|
+
<!-- AI-NOTE: List all dependencies and references for this controller -->
|
|
263
|
+
|
|
264
|
+
### 4.1 Internal Services
|
|
265
|
+
|
|
266
|
+
| Service Name | Purpose | Source Path |
|
|
267
|
+
|--------------|---------|-------------|
|
|
268
|
+
| {ServiceName} | {e.g., User business logic} | [Source](../../{serviceSourcePath}) |
|
|
269
|
+
| {ServiceName} | {e.g., Permission validation} | [Source](../../{serviceSourcePath}) |
|
|
270
|
+
|
|
271
|
+
### 4.2 Data Access Layer
|
|
272
|
+
|
|
273
|
+
| Mapper/Repository | Entity | Purpose | Source Path |
|
|
274
|
+
|-------------------|--------|---------|-------------|
|
|
275
|
+
| {MapperName} | {EntityName} | {e.g., User CRUD operations} | [Source](../../{mapperSourcePath}) |
|
|
276
|
+
| {MapperName} | {EntityName} | {e.g., Role query} | [Source](../../{mapperSourcePath}) |
|
|
277
|
+
|
|
278
|
+
### 4.3 DTOs and Entities
|
|
279
|
+
|
|
280
|
+
| Class Name | Type | Purpose | Source Path |
|
|
281
|
+
|------------|------|---------|-------------|
|
|
282
|
+
| {DTOClass} | Request DTO | {e.g., Create user request} | [Source](../../{dtoSourcePath}) |
|
|
283
|
+
| {VOClass} | Response VO | {e.g., User detail response} | [Source](../../{voSourcePath}) |
|
|
284
|
+
| {EntityClass} | Entity | {e.g., User database entity} | [Source](../../{entitySourcePath}) |
|
|
285
|
+
|
|
286
|
+
### 4.4 API Consumers
|
|
287
|
+
|
|
288
|
+
<!-- AI-NOTE: List frontend pages that call this controller's APIs -->
|
|
289
|
+
|
|
290
|
+
| Page Name | Function Description | Source Path | Document Path |
|
|
291
|
+
|-----------|---------------------|-------------|---------------|
|
|
292
|
+
| {PageName} | {e.g., User management list page} | [Source](../../{pageSourcePath}) | [Doc](../../{pageDocumentPath}) |
|
|
293
|
+
| {PageName} | {e.g., User form page} | [Source](../../{pageSourcePath}) | [Doc](../../{pageDocumentPath}) |
|
|
294
|
+
|
|
295
|
+
---
|
|
296
|
+
|
|
297
|
+
## 5. Business Rule Constraints
|
|
298
|
+
|
|
299
|
+
<!-- AI-TAG: BUSINESS_RULES -->
|
|
300
|
+
|
|
301
|
+
### 5.1 Permission Rules
|
|
302
|
+
|
|
303
|
+
| API Endpoint | Permission Requirement | No Permission Response |
|
|
304
|
+
|--------------|----------------------|----------------------|
|
|
305
|
+
| {GET /page} | Have {permission code} permission | Return 403 Forbidden |
|
|
306
|
+
| {POST /create} | Have {permission code} permission | Return 403 Forbidden |
|
|
307
|
+
| {DELETE /delete} | Have {permission code} permission | Return 403 Forbidden |
|
|
308
|
+
|
|
309
|
+
### 6.2 Business Logic Rules
|
|
310
|
+
|
|
311
|
+
1. **{Rule 1}**: {e.g., User name must be unique across system}
|
|
312
|
+
2. **{Rule 2}**: {e.g., Cannot delete user with active orders}
|
|
313
|
+
3. **{Rule 3}**: {e.g., Password must be encrypted before storage}
|
|
314
|
+
4. **{Rule 4}**: {e.g., Admin user cannot be deleted}
|
|
315
|
+
|
|
316
|
+
### 5.3 Validation Rules
|
|
317
|
+
|
|
318
|
+
| Validation Scenario | Validation Rule | Error Response | Error Code |
|
|
319
|
+
|--------------------|-----------------|----------------|------------|
|
|
320
|
+
| Parameter validation | {Field} cannot be empty | Return 400 Bad Request | ERR_001 |
|
|
321
|
+
| Format validation | {Field} must match {pattern} | Return 400 Bad Request | ERR_002 |
|
|
322
|
+
| Business validation | {Business rule violation} | Return 400 Business Error | ERR_003 |
|
|
323
|
+
|
|
324
|
+
---
|
|
325
|
+
|
|
326
|
+
## 6. Dependency Analysis
|
|
327
|
+
|
|
328
|
+
<!-- AI-TAG: DEPENDENCIES -->
|
|
329
|
+
|
|
330
|
+
### 6.1 Module Dependencies
|
|
331
|
+
|
|
332
|
+
| Dependency Module | Dependency Type | Purpose | Impact Scope |
|
|
333
|
+
|-------------------|-----------------|---------|--------------|
|
|
334
|
+
| {Module A} | Strong | {Purpose description} | {Impact when unavailable} |
|
|
335
|
+
| {Module B} | Weak | {Purpose description} | {Degraded functionality} |
|
|
336
|
+
|
|
337
|
+
### 6.2 Service Dependencies
|
|
338
|
+
|
|
339
|
+
```mermaid
|
|
340
|
+
graph LR
|
|
341
|
+
A[This Feature] --> B[Dependency Service 1]
|
|
342
|
+
A --> C[Dependency Service 2]
|
|
343
|
+
B --> D[Database]
|
|
344
|
+
C --> D
|
|
345
|
+
```
|
|
346
|
+
|
|
347
|
+
**Diagram Source**
|
|
348
|
+
- [{Service}.java](../../{serviceSourcePath})
|
|
349
|
+
|
|
350
|
+
### 6.3 External Dependencies
|
|
351
|
+
|
|
352
|
+
| External System | Interface Type | Call Scenario | Degradation Strategy |
|
|
353
|
+
|-----------------|----------------|---------------|---------------------|
|
|
354
|
+
| {Payment Gateway} | REST API | {Payment processing} | {Queue and retry} |
|
|
355
|
+
| {SMS Service} | REST API | {Verification code} | {Skip and log} |
|
|
356
|
+
|
|
357
|
+
---
|
|
358
|
+
|
|
359
|
+
## 7. Performance Considerations
|
|
360
|
+
|
|
361
|
+
<!-- AI-TAG: PERFORMANCE -->
|
|
362
|
+
|
|
363
|
+
### 7.1 Performance Bottlenecks
|
|
364
|
+
|
|
365
|
+
| Scenario | Bottleneck Description | Optimization Suggestion | Priority |
|
|
366
|
+
|----------|----------------------|------------------------|----------|
|
|
367
|
+
| {List query} | {Large data volume} | {Add index, pagination} | High |
|
|
368
|
+
| {Batch operation} | {Database lock} | {Async processing} | Medium |
|
|
369
|
+
|
|
370
|
+
### 7.2 Index Suggestions
|
|
371
|
+
|
|
372
|
+
| Table Name | Index Fields | Index Type | Scenario Description |
|
|
373
|
+
|------------|--------------|------------|---------------------|
|
|
374
|
+
| {table_name} | {field1, field2} | {COMPOSITE INDEX} | {Query optimization} |
|
|
375
|
+
| {table_name} | {field3} | {INDEX} | {Filter condition} |
|
|
376
|
+
|
|
377
|
+
### 7.3 Caching Strategy
|
|
378
|
+
|
|
379
|
+
| Cache Scenario | Cache Strategy | Expiration Time | Invalidation Strategy |
|
|
380
|
+
|----------------|----------------|-----------------|----------------------|
|
|
381
|
+
| {User info} | {Redis} | {30 minutes} | {Write-through} |
|
|
382
|
+
| {Configuration} | {Local cache} | {5 minutes} | {TTL expiration} |
|
|
383
|
+
|
|
384
|
+
### 7.4 Transaction Boundaries
|
|
385
|
+
|
|
386
|
+
| Operation Scenario | Transaction Scope | Isolation Level | Timeout Setting |
|
|
387
|
+
|-------------------|-------------------|-----------------|-----------------|
|
|
388
|
+
| {Create order} | {Order + Details} | {READ_COMMITTED} | {30 seconds} |
|
|
389
|
+
| {Payment} | {Order + Payment} | {SERIALIZABLE} | {60 seconds} |
|
|
390
|
+
|
|
391
|
+
---
|
|
392
|
+
|
|
393
|
+
## 8. Troubleshooting Guide
|
|
394
|
+
|
|
395
|
+
<!-- AI-TAG: TROUBLESHOOTING -->
|
|
396
|
+
|
|
397
|
+
### 8.1 Common Issues
|
|
398
|
+
|
|
399
|
+
| Issue Symptom | Possible Cause | Troubleshooting Steps | Solution |
|
|
400
|
+
|---------------|----------------|----------------------|----------|
|
|
401
|
+
| {Query timeout} | {Missing index} | {Check execution plan} | {Add index} |
|
|
402
|
+
| {Data inconsistency} | {Transaction failure} | {Check transaction logs} | {Manual correction} |
|
|
403
|
+
| {Permission denied} | {Role not assigned} | {Check user roles} | {Assign correct role} |
|
|
404
|
+
|
|
405
|
+
### 8.2 Error Code Reference
|
|
406
|
+
|
|
407
|
+
| Error Code | Error Description | Trigger Condition | Handling Suggestion |
|
|
408
|
+
|------------|-------------------|-------------------|---------------------|
|
|
409
|
+
| ERR_001 | {Required field empty} | {Form submission} | {Check required fields} |
|
|
410
|
+
| ERR_002 | {Format validation failed} | {Data validation} | {Check data format} |
|
|
411
|
+
| ERR_003 | {Business rule violation} | {Business operation} | {Check business rules} |
|
|
412
|
+
|
|
413
|
+
### 8.3 Key Log Points
|
|
414
|
+
|
|
415
|
+
| Log Location | Log Level | Key Information | Troubleshooting Purpose |
|
|
416
|
+
|--------------|-----------|-----------------|------------------------|
|
|
417
|
+
| {Service layer} | ERROR | {Exception stack trace} | {Locate error root cause} |
|
|
418
|
+
| {Controller} | INFO | {Request parameters} | {Reproduce issue} |
|
|
419
|
+
| {Database} | DEBUG | {SQL statements} | {Performance analysis} |
|
|
420
|
+
|
|
421
|
+
---
|
|
422
|
+
|
|
423
|
+
## 9. Notes and Additional Information
|
|
424
|
+
|
|
425
|
+
<!-- AI-TAG: ADDITIONAL_NOTES -->
|
|
426
|
+
|
|
427
|
+
### 9.1 Compatibility Adaptation
|
|
428
|
+
|
|
429
|
+
- **Interface Adaptation**: Supports PC 1920×1080 resolution, responsive adaptation for 1366×768 and above
|
|
430
|
+
- **Interaction Adaptation**: Supports mouse click/Enter to trigger actions, supports keyboard Tab key to switch focus
|
|
431
|
+
|
|
432
|
+
### 9.2 Pending Confirmations
|
|
433
|
+
|
|
434
|
+
- [ ] **{Pending 1}**: {e.g., Whether product category dropdown needs to support fuzzy search}
|
|
435
|
+
- [ ] **{Pending 2}**: {e.g., Whether delete operation needs secondary confirmation}
|
|
436
|
+
|
|
437
|
+
### 9.3 Extension Notes
|
|
438
|
+
|
|
439
|
+
- This prototype is a simplified version of the core process, extended fields/features can be added in subsequent iterations
|
|
440
|
+
- ASCII wireframe prototype only expresses layout and interaction logic, visual styles (e.g., colors, fonts) should refer to product visual specifications
|
|
441
|
+
|
|
442
|
+
---
|
|
443
|
+
|
|
444
|
+
## 10. Appendix
|
|
445
|
+
|
|
446
|
+
### 10.1 Best Practices
|
|
447
|
+
|
|
448
|
+
- {Best practice 1: e.g., Use batch operations for large datasets}
|
|
449
|
+
- {Best practice 2: e.g., Implement idempotency for critical operations}
|
|
450
|
+
- {Best practice 3: e.g., Add proper logging for troubleshooting}
|
|
451
|
+
|
|
452
|
+
### 10.2 Configuration Examples
|
|
453
|
+
|
|
454
|
+
```yaml
|
|
455
|
+
# Configuration example
|
|
456
|
+
feature:
|
|
457
|
+
enabled: true
|
|
458
|
+
timeout: 30s
|
|
459
|
+
retry:
|
|
460
|
+
max_attempts: 3
|
|
461
|
+
delay: 1s
|
|
462
|
+
```
|
|
463
|
+
|
|
464
|
+
### 10.3 Related Documents
|
|
465
|
+
|
|
466
|
+
- [API Documentation](link)
|
|
467
|
+
- [Database Design](link)
|
|
468
|
+
- [Module Overview](../{module-name}-overview.md)
|
|
469
|
+
|
|
470
|
+
---
|
|
471
|
+
|
|
472
|
+
**Document Status:** 📝 Draft / 👀 In Review / ✅ Published
|
|
473
|
+
**Last Updated:** {Date}
|
|
474
|
+
**Maintainer:** {Name}
|
|
475
|
+
**Related Module Document:** [Module Overview Document](../{{module-name}}-overview.md)
|
|
476
|
+
|
|
477
|
+
**Section Source**
|
|
478
|
+
- [{Controller}.java](../../{controllerSourcePath})
|
|
479
|
+
- [{Service}.java](../../{serviceSourcePath})
|
|
480
|
+
- [{Entity}.java](../../{entitySourcePath})
|