diff --git a/docs/protocol.md b/docs/protocol.md index dd894bf7f2bc7220cff9caeca25c6c3986f54bdd..3b2f2ec31c3b9c6fe1aec1cebda1d515b61a1758 100644 --- a/docs/protocol.md +++ b/docs/protocol.md @@ -71,3 +71,67 @@ ## PilotGo server http API 协议 +### 部门管理 API +#### 新增部门 +描述:向部门管理树中添加新的部门 +请求方法:POST +url:/machinemanager/adddepart +请求参数: +类型:json(form) +字段描述: +|名称|类型|说明|是否必须|备注| +|-|-|-|-|-| +|PID|string|上一级部门ID|y|| +|ParentDepart|string|上一级部门名称|y|| +|Depart|string|部门名称|y|| + +示例: +```json +{ + "code": 200, + "data": null, + "msg": "部门信息入库成功" +} +``` +#### 部门信息 +描述:获取全部部门信息 +请求方法:GET +url:/machinemanager/departinfo +请求参数:无 + + +响应结果: +类型:json +字段: +|名称|类型|说明|是否必须|备注| +|-|-|-|-|-| +|label|string|部门名称|y|| +|id|int|部门id|y|| +|pid|int|上级部门id|y|| +|children|[]MachineNode|下一级部门节点|y|| + +示例: +```json +{ + "code": 200, + "data": { + "label": "xx", + "id": 1, + "pid": 0, + "children": [ + { + "label": "", + "id": 2, + "pid": 1, + "children": null + }, + { + "label": "xx", + "id": 3, + "pid": 1, + "children": null + } + ] + } +} +``` \ No newline at end of file