后台用户接口文档
后台管理
获取用户列表
GET /kuser/list/?page=[PAGE]
{ "meta": { "message": "find success", "code": 0 }, "data": { "count": 14, "next": "http://localhost:8000/kuser/list/?page=2", "previous": null, "results": [ { "id": 4, "username": "gaoyang", "password": "123456", "email": "1865666@163.com" }, { "id": 7, "username": "hello", "password": "123456", "email": "1865666@163.com" }, { "id": 8, "username": "hello1", "password": "123456", "email": "1865666@163.com" }, { "id": 10, "username": "hello221", "password": "123456", "email": "1865666@163.com" } ] }}
| 参数 |
类型 |
说明 |
| code |
整型 |
错误码;0代表正确,反之错误 |
| message |
字符串 |
请求提示 |
| count |
整型 |
数据总条数 |
| next |
字符串 |
下一页的链接 |
| previous |
字符串 |
上一页的链接 |
| results |
数组 |
数据列表 |
| id |
整型 |
主键 |
| username |
字符串 |
用户名 |
| password |
字符串(加密) |
密码 |
| email |
字符串 |
邮箱 |
每页显示10条数据
添加用户
POST /kuser/create/
{ "username":"hello", "password":"123456", "email":"1865666@163.com", "user_permission":0}
| 参数 |
类型 |
必须 |
说明 |
| username |
字符串 |
是 |
用户名 |
| password |
字符串 |
是 |
密码 |
| email |
字符串 |
是 |
邮箱 |
| user_permission |
整型 |
是 |
权限(0:超级管理员 1:管理员 2:运营 3:客服)暂定 |
{ "meta": { "message": "insert success", "code": 0 }, "data": { "id": 18, "username": "hello123", "password":"pbkdf2_sha256$240", "email": "1865666@163.com" }}
| 参数 |
类型 |
说明 |
| data |
json |
添加的用户信息 |
删除用户
DELETE /kuser/detail/[ID]
{ "meta": { "message": "delete success", "code": 0 }, "data": null}
编辑用户
PUT /kuser/detail/[ID]
{ "meta": { "message": "update success", "code": 0 }, "data": { "id": 13, "username": "hello1234", "password": "1234536", "email": "1865666@163.com" }}
| 参数 |
类型 |
说明 |
| data |
json |
编辑后的用户信息 |