test-contract/README.md

31 lines
723 B
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.

# test-contract — 接口契约
前后端共享的接口协议文件。修改接口前先改本仓库,再同步。
## 目录
- `admin/` — 管理后台接口
- `app/` — 移动端/H5/小程序接口
- `auth/` — 登录注册接口(前后端共享)
- `open/` — 对外开放接口
## 契约模板
```markdown
## /admin/xxx/list
GET分页查询
入参:
page int 页码默认1
size int 每页条数默认10
返回:
{ code: 200, data: { list: [...], total: 100, pages: 10, current: 1, size: 10 } }
```
## 同步规则
1. 改接口 → 改本仓库对应文档 → push
2. 通知对方 `git submodule update --remote contract/`
3. 契约文件为准,不一致以契约为准