From 96fc06b1fea476789ade08a238111614b6583c60 Mon Sep 17 00:00:00 2001 From: zwt13703 Date: Sun, 5 Jul 2026 17:30:17 +0800 Subject: [PATCH] =?UTF-8?q?init:=20test-contract=20=E5=A5=91=E7=BA=A6?= =?UTF-8?q?=E4=BB=93=E5=BA=93=E5=88=9D=E5=A7=8B=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 30 ++++++++++++++++++++++++++++++ admin/status-map.md | 8 ++++++++ 2 files changed, 38 insertions(+) create mode 100644 README.md create mode 100644 admin/status-map.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..23a647d --- /dev/null +++ b/README.md @@ -0,0 +1,30 @@ +# 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. 契约文件为准,不一致以契约为准 diff --git a/admin/status-map.md b/admin/status-map.md new file mode 100644 index 0000000..0e69dcd --- /dev/null +++ b/admin/status-map.md @@ -0,0 +1,8 @@ +# 状态值映射表 + +> 前后端状态值统一约定。修改此处 = 修改协议,必须同步两端。 + +| 含义 | 后端值 | 前端显示 | 前端 CSS 类 | +|------|--------|----------|------------| +| 启用 | 1 | 启用 | success | +| 禁用 | 0 | 禁用 | danger |