[关闭]
@fuyb1986 2018-03-19T09:23:27.000000Z 字数 995 阅读 576

按名字搜索老师和学生


儿童编程

搜索学生

Method and URL Structure

Method Resource URL Authorization
GET /server/userinfo/search/ NO

Request Parameters

Name Description Default Required
page 分页 1 False
page_size 每页数量 10 False
search 关键字 True

cURL Example

  1. curl -X GET -H 'Content-Type: application/json' http://localhost/server/userinfo/search/?search=张

Response Data

Name Description
pk id
name 名字
avatar 头像
owner 用户名

Response

  1. {
  2. "count": 32,
  3. "next": null,
  4. "previous": null,
  5. "results": [{
  6. "pk": 4245,
  7. "owner": "15208113778",
  8. "name": "张宝哼哼",
  9. "avatar": "https://static1.bcjiaoyu.com/head1@3x.png",
  10. },]

搜索老师

Method and URL Structure

Method Resource URL Authorization
GET /server/userinfo/teacher/search/ NO

Request Parameters

Name Description Default Required
page 分页 1 False
page_size 每页数量 10 False
search 关键字 True

cURL Example

  1. curl -X GET -H 'Content-Type: application/json' http://localhost/server/userinfo/teacher/search/?search=张

Response Data

Name Description
pk id
name 名字
username 用户名

{
"count": 3,
"next": null,
"previous": null,
"results": [{
"pk": 7,
"name": "小赵",
"username": "18516271364"
}, {
"pk": 5,
"name": "小丽",
"username": "15201052252"
},.. ]
}

添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注