Files
foka-ci/docs/requirements/0001-Fix-Response-structure.md
2026-01-11 16:39:59 +08:00

34 lines
683 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.
# 标准化响应结构
1. 需要标准化接口响应的结构,修改后端接口中不符合规范的代码。
2. 前端接口类型定义需要与后端接口响应结构保持一致。
## 响应示例
- 列表分页响应
```json
{
"code": 0, // 响应状态码0 表示成功,其他值表示失败
"message": "success", // 响应消息
"data": { // 响应数据
"list": [], // 列表数据
"page": 1, // 当前页码
"pageSize": 10, // 每页显示数量
"total": 10 // 总数量
},
"timestamp": "12346579" // 响应时间戳
}
```
- 其他响应
```json
{
"code": 0,
"message": "success",
"data": {},
"timestamp": "12346579"
}
```