@soszrg
2019-03-25T08:39:10.000000Z
字数 6220
阅读 290
anxin
http://121.40.214.215:8000
Authorization: token 1:d79be1d657d9a8b45f6f903620e84b06cbf225e0
登出接口(token)
接口地址
GET /api/v1/projects/
请求示例
GET /api/v1/projects/?page=1&page_size=10{}
请求参数说明
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| page | int | N | 页码 |
| page_size | int | N | 每页条目数 |
返回参数
{"meta":{"message":"info list","code":0},"data":{"count":13,"page_size":10,"next":true,"previous":null,"results":[{"id":19,"creator":{"id":1,"username":"zrg"},"owner":{"id":1,"username":"zhang"},"created_at":"2018-11-21T15:10:45","updated_at":"2018-11-21T15:55:25","name":"银海华庭","province":"湖北省","province_code":"123456","city":"武汉市","city_code":"123456","district":"武昌区","district_code":"123456","detail_address":"八一路2145号"}]}}
返回参数说明
| 参数 | 类型 | 说明 |
|---|---|---|
| id | int | 项目id |
| creator | json | 创建人 |
| owner | json | 项目方 |
| province | string | 省份 |
| province_code | string | 省份代码 |
| city | string | 城市 |
| city_code | string | 城市代码 |
| district | string | 区 |
| district_code | string | 区代码 |
| detail_address | string | 详细地址 |
| updated_at | string | 更新时间 |
| created_at | string | 创建时间 |
接口地址
POST /api/v1/projects/
请求示例
POST /api/v1/projects/{"name":"银海华庭","owner_id":1,"province":"湖北省","province_code":"123456","city":"武汉市","city_code":"123456","district":"武昌区","district_code":"123456","detail_address":"八一路501号"}
请求参数说明
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| name | string | Y | 项目名 |
| owner_id | int | Y | 项目方 |
| province | string | 省份 | |
| province_code | string | 省份代码 | |
| city | string | 城市 | |
| city_code | string | 城市代码 | |
| district | string | 区 | |
| district_code | string | 区代码 | |
| detail_address | string | 详细地址 |
返回参数
{"meta":{"code":0,"message":"create ok"},"data":{"id":21,"creator":{"id":1,"username":"zrg"},"owner":{"id":1,"username":"zrg"},"created_at":"2018-11-21T17:24:14","updated_at":"2018-11-21T17:24:14","name":"银行华庭","province":"湖北省","province_code":"123456","city":"武汉市","city_code":"123456","district":"武昌区","district_code":"123456","detail_address":"八一路501号"}}
返回参数说明
| 参数 | 类型 | 说明 |
|---|---|---|
| id | int | 项目id |
接口地址
GET /api/v1/projects/[id]/
请求示例
GET /api/v1/projects/15/{}
请求参数说明
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| id | int | Y | 项目id |
返回参数
{"meta":{"code":0,"message":"distributor info"},"data":{"id":21,"creator":{"id":1,"username":"zrg"},"owner":{"id":1,"username":"zrg"},"created_at":"2018-11-21T17:24:14","updated_at":"2018-11-21T17:24:14","name":"银海华庭","province":"湖北省","province_code":"123456","city":"武汉市","city_code":"123456","district":"武昌区","district_code":"123456","detail_address":"八一路路501号"}}
返回参数说明
略
接口地址
PUT /api/v1/projects/[15]/
请求示例
PUT /api/v1/projects/{"name":"银海华庭","owner_id":1,"province":"湖北省","province_code":"123456","city":"武汉市","city_code":"123456","district":"武昌区","district_code":"123456","detail_address":"八一路501号"}
请求参数说明
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| name | string | Y | 项目名 |
| owner_id | int | Y | 项目方 |
| province | string | 省份 | |
| province_code | string | 省份代码 | |
| city | string | 城市 | |
| city_code | string | 城市代码 | |
| district | string | 区 | |
| district_code | string | 区代码 | |
| detail_address | string | 详细地址 |
返回参数
{"meta":{"code":0,"message":"create ok"},"data":{"id":21,"creator":{"id":1,"username":"zrg"},"owner":{"id":1,"username":"zrg"},"created_at":"2018-11-21T17:24:14","updated_at":"2018-11-21T17:24:14","name":"银行华庭","province":"湖北省","province_code":"123456","city":"武汉市","city_code":"123456","district":"武昌区","district_code":"123456","detail_address":"八一路501号"}}
返回参数说明
| 参数 | 类型 | 说明 |
|---|---|---|
| id | int | 项目id |
接口地址
DELETE /api/v1/projects/[id]/
请求示例
DELETE /api/v1/projects/15/{}
请求参数说明
无
返回参数
{"meta":{"code":0,"message":"delete[15:zzzzz] ok"},"data":{}}
返回参数说明
无
接口地址
GET /api/v1/projects/houses/
请求示例
GET /api/v1/projects/houses/?page=1&page_size=10&project_id=10{}
请求参数说明
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| page | int | N | 页码 |
| page_size | int | N | 每页条目数 |
| project_id | int | Y | 项目id |
返回参数
{"meta":{"message":"info list","code":0},"data":{"count":2,"page_size":10,"next":null,"previous":null,"results":[{"id":14,"creator":{"id":1,"username":"zrg"},"installer":{"id":6,"username":"zzzz"},"created_at":"2018-11-22T21:36:27","project_id":10,"area":"绿地新丰苑","building":"5号","floor":"10层","house":"1001","room":"主卧","status":0},{"id":13,"creator":{"id":1,"username":"zrg"},"installer":{"id":6,"username":"zzzz"},"created_at":"2018-11-22T21:36:26","project_id":10,"area":"绿地新丰苑","building":"5号","floor":"10层","house":"1002","room":"主卧","status":0}]}}
返回参数说明
| 参数 | 类型 | 说明 |
|---|---|---|
| id | int | 房间id |
| creator | json | 创建人 |
| installer | json | 安装工 |
| project_id | int | 项目id |
| area | string | 小区/商场/学校等 |
| building | string | 幢 |
| floor | string | 层 |
| house | string | 室 |
| room | string | 房间 |
| status | string | 安装状态:0 未安装 1 已安装 |
接口地址
POST /api/v1/projects/houses/
请求示例
POST /api/v1/projects/houses/{"project_id":10,"installer_id":6,"area":"丰庄新村","building":"5号","floor":"10层","house":"1室","room":"主卧"}
请求参数说明
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| project_id | int | Y | 项目id |
| installer_id | int | N | 安装工id |
| area | string | Y | 小区 |
| building | string | N | 幢 |
| floor | string | N | 层 |
| house | string | N | 室 |
| room | string | N | 房间 |
返回参数
{"meta":{"code":0,"message":"create ok"},"data":{"id":15,"creator":{"id":1,"username":"zrg"},"installer":{"id":6,"username":"zzzz"},"created_at":"2018-11-22T21:46:20","project_id":10,"area":"丰庄新村","building":"5号","floor":"10层","house":"1室","room":"主卧","status":0}}
返回参数说明
| 参数 | 类型 | 说明 |
|---|---|---|
| id | int | 房间id |
| status | int | 安装状态 |
接口地址
GET /api/v1/projects/houses/[id]/
请求示例
GET /api/v1/projects/houses/15/{}
请求参数说明
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| id | int | Y | 房间id |
返回参数
{"meta":{"code":0,"message":"house info"},"data":{"id":15,"creator":{"id":1,"username":"zrg"},"installer":{"id":6,"username":"zzzz"},"created_at":"2018-11-22T21:46:20","project_id":10,"area":"丰庄新村","building":"5号","floor":"10层","house":"1室","room":"主卧","status":0}}
返回参数说明
略
接口地址
PUT /api/v1/projects/houses/[15]/
请求示例
PUT /api/v1/projects/houses/15/{"project_id":10,"installer_id":6,"area":"丰庄新村","building":"5号","floor":"10层","house":"1室","room":"主卧"}
请求参数说明
略
返回参数
{"meta":{"code":0,"message":"create ok"},"data":{"id":15,"creator":{"id":1,"username":"zrg"},"installer":{"id":6,"username":"zzzz"},"created_at":"2018-11-22T21:46:20","project_id":10,"area":"丰庄新村","building":"5号","floor":"10层","house":"1室","room":"主卧","status":0}}
返回参数说明
| 参数 | 类型 | 说明 |
|---|---|---|
| id | int | 项目id |
接口地址
DELETE /api/v1/projects/[id]/
请求示例
DELETE /api/v1/projects/houses/15/{}
请求参数说明
无
返回参数
{"meta":{"code":0,"message":"delete[15] ok"},"data":{}}
返回参数说明
无
接口地址
GET /api/v1/engineering/
请求示例
GET /api/v1/engineering/{}
请求参数说明
| 参数 | 类型 | 必须 | 说明 | 位置 |
|---|
返回参数
{"meta": {"code": 0,"message": "engineer list"},"data": [{"id": 77,"username": "anxin_test1"},{"id": 80,"username": "sakai1"}]}
返回参数说明
| 参数 | 类型 | 说明 |
|---|---|---|
| id | int | 安装人id |
| username | string | 用户名 |
接口地址
PUT /api/v1/projects/houses/{house_id}/installer/
请求示例
PUT /api/v1/projects/houses/326/installer/{"installer_id": 80}
请求参数说明
| 参数 | 类型 | 必须 | 说明 | 位置 |
|---|---|---|---|---|
| house_id | int | Y | 房间id | path |
| installer_id | int | Y | 安装人id | body |
返回参数
{"meta": {"code": 0,"message": "ok"},"data": {}}
返回参数说明
| 参数 | 类型 | 说明 |
|---|