Skip to content

Commit

Permalink
feat: 新增api.md
Browse files Browse the repository at this point in the history
  • Loading branch information
nf173 committed Feb 1, 2025
1 parent 6948ad1 commit ac28f37
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 6 deletions.
5 changes: 1 addition & 4 deletions docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,7 @@ export default defineConfig({
},
{
text: "综合篇",
items: [
{ text: "字段", link: "/standard/summary/fields" },
{ text: "权限标识", link: "/standard/summary/auth-mark" },
],
items: [{ text: "接口相关", link: "/standard/summary/api" }],
},
],
},
Expand Down
56 changes: 56 additions & 0 deletions docs/standard/summary/api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# 接口相关

<tips type="warning">
请检查项目接口是否遵循以下约定,如有出入请务必修改保持一致。
</tips>

## 常用字段名约定

| 字段 | 说明 | 数据类型 | 备注 |
| ------------- | -------------- | ------------------- | ---------------------- |
| enabled | 启用状态 | `boolean` | |
| status | 记录状态 | `string` | |
| auditStatus | 审核状态 | `string` | |
| auditTime | 审核时间 | `string(date-time)` | YYYY-MM-DD HH:mm:ss |
| auditUsername | 审核人:用户名 | `string` | |
| auditRealname | 审核人:姓名 | `string` | |
| bizType | 业务类型 | `string` | 同接口区分不同业务类型 |

## 权限标识

统一用 camelCase 法命名,多个单词首字母小写

```
base:materialType:add
```

## 必填字段

接口文档中请务必标注需要**必填**的字段。

## 状态码

务必确保所有接口返回成功时,状态码为 `200`,如有特殊情况,请于接口文档单独注明。

## 错误信息

对于一些可预见的错误,请返回对应通俗易懂的错误信息,方便快速定位和排查问题。

## 响应体结构

除上传文件接口外,其他接口均返回此结构。

```json
{
/** 状态码 */
"code": 200,
/** 处理消息 */
"message": "",
/** 数据对象 */
"result": {},
/** 成功标志 */
"success": true,
/** 时间戳 */
"timestamp": 1550000000000
}
```
1 change: 0 additions & 1 deletion docs/standard/summary/auth-mark.md

This file was deleted.

1 change: 0 additions & 1 deletion docs/standard/summary/fields.md

This file was deleted.

0 comments on commit ac28f37

Please sign in to comment.