Files
shanxia2.0/docs/crm-migration/plan-template/04-api-spec.md
T
2026-06-01 08:21:21 +08:00

81 lines
1.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
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.
# 模块迁移方案 — 04 后端 API 接口规格
> **模板说明**:逐一描述每个 API 接口的 URL、参数、响应、业务逻辑。
> **参考范例**:`docs/客户管理及公海池迁移方案.md` 第四章
> **后端规范**:`docs/crm-migration/ref-database-rules.md`、`docs/crm-migration/ref-lessons-learned.md`
---
## X.1 [实体名] CRUD
### X.1.1 列表查询
| 项目 | 内容 |
|------|------|
| URL | `/web/crm/{module}/list` |
| 方法 | POST |
| 认证 | require_admin_or_super_admin |
**请求参数**:
| 字段 | 类型 | 必填 | 说明 |
|------|------|------|------|
| page | int | 是 | 页码 |
| pageSize | int | 是 | 每页条数 |
| keyword | string | 否 | 关键字搜索 |
**业务逻辑**(从 Java 源码提炼):
1. [步骤1]
2. [步骤2]
**Java 源码位置**:`shanxia/crm/backend/.../XxxController.java` → `listXxx` 方法
---
### X.1.2 新增
| 项目 | 内容 |
|------|------|
| URL | `/web/crm/{module}/add` |
| 方法 | POST |
**请求参数**:
| 字段 | 类型 | 必填 | 校验 | 说明 |
|------|------|------|------|------|
| [字段] | [类型] | 是 | required | [说明] |
**业务逻辑**:
1. [步骤1 — 编号生成?唯一校验?冗余字段写入?]
2. [步骤2]
**Java 源码位置**:`...`
---
### X.1.3 编辑
[同上结构]
### X.1.4 删除
[同上结构]
### X.1.5 详情
[同上结构]
---
<!-- 重复以上结构为每个实体和特殊接口 -->
## API 清单汇总
| # | URL | 方法 | 说明 | Java源码位置 |
|---|-----|------|------|-------------|
| 1 | /web/crm/{module}/list | POST | 列表 | ... |
| 2 | /web/crm/{module}/add | POST | 新增 | ... |
| ... | ... | ... | ... | ... |