@soszrg
2019-11-30T15:05:16.000000Z
字数 5769
阅读 319
anxin
https://api.anxhome.cn
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 | Y | 省份 |
| province_code | string | Y | 省份代码 |
| city | string | Y | 城市 |
| city_code | string | Y | 城市代码 |
| district | string | Y | 区 |
| district_code | string | Y | 区代码 |
| detail_address | string | Y | 详细地址 |
返回参数
{"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,"operator_id":1,"province":"湖北省","province_code":"123456","city":"武汉市","city_code":"123456","district":"武昌区","district_code":"123456","detail_address":"八一路501号"}
请求参数说明
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| name | string | Y | 项目名 |
| owner_id | int | Y | 项目方id |
| operator_id | int | Y | 运营/物业id |
| province | string | Y | 省份 |
| province_code | string | Y | 省份代码 |
| city | string | Y | 城市 |
| city_code | string | Y | 城市代码 |
| district | string | Y | 区 |
| district_code | string | Y | 区代码 |
| detail_address | string | Y | 详细地址 |
返回参数
{"meta":{"code":0,"message":"create ok"},"data":{"id":21,"creator":{"id":1,"username":"zrg"},"owner":{"id":1,"username":"zrg"},"operator":{"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":{}}
返回参数说明
无
POST /api/v1/projects/house/batch/
请求示例
Content-Type:application/json{"project_id":2,"area":"白色小区","floor":[1,2],"house":[1,2],"building":[1,2],"room":[1,"A",2],"installer_id":61}
请求参数说明
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| project_id | int | Y | 项目id |
| area | char | Y | 小区 |
| building | list | Y | 楼幢信息,比如要建A和B幢就传入["A","B"] |
| floor | list | Y | 楼层信息,同上 |
| house | list | Y | 房屋信息,同上 |
| room | list | N | 房间信息,同上 |
| installer_id | int | N | 安装工人用户ID |
返回示例
{"meta": {"code": 0,"message": "ok"},"data": {}}
POST /api/v1/projects/house/single/
请求示例
Content-Type:application/json{"project_id":2,"area":"白色小区","floor":2"house":2,"building":1,"room":[1,2],"installer_id":61}
请求参数说明
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| project_id | int | Y | 项目id |
| area | string | Y | 小区 |
| building | string | Y | 楼幢信息 |
| floor | string | Y | 楼层信息,同上 |
| house | strng | Y | 房屋信息,同上 |
| room | list | N | 房间信息,同上 |
| installer_id | int | N | 安装工人用户ID |
返回示例
{"meta": {"code": 0,"message": "ok"},"data": {}}
POST /api/v1/projects/room/
请求示例
Content-Type:application/json{"project_id":2,"area":"白色小区","floor":2"house":2,"building":1,"room":2,"installer_id":61}
请求参数说明
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| project_id | int | Y | 项目id |
| area | string | Y | 小区 |
| building | string | Y | 楼幢信息 |
| floor | string | Y | 楼层信息,同上 |
| house | strng | Y | 房屋信息,同上 |
| room | string | Y | 房间信息,同上 |
| installer_id | int | N | 安装工人用户ID |
返回示例
{"meta": {"code": 0,"message": "ok"},"data": {}}
GET /api/v1/projects/[project_id]/config/
请求示例
GET /api/v1/projects/3/config/{}
请求参数说明
| 参数 | 类型 | 必须 | 说明 | 位置 |
|---|---|---|---|---|
| project_id | int | Y | 项目id | path |
返回示例
{"meta": {"code": 0,"message": "success"},"data": {"id": 3,"project_id": 3,"app_can_open_wm": false,"app_can_open_em": true,"em_operator_code": "0000","em_operator_pwd": "0000","em_baud_rate": "2400","ext": {"botelv": "3600"},"updated_at": "2019-05-14T16:50:28"}}
返回参数说明
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| em_operator_code | string | Y | 电表操作者代码 |
| em_operator_pwd | string | Y | 电表操作者密码 |
| em_baud_rate | string | Y | 电表波特率 |
| app_can_open_wm | bool | Y | app是否能开关水表 |
| app_can_open_em | bool | Y | app是否能开关电表 |
| ext | json | Y | 扩展字段 |
PUT /api/v1/projects/[project_id]/config/
请求示例
PUT /api/v1/projects/3/config/{"app_can_open_wm": false,"app_can_open_em": true,"em_operator_code": "0000","em_operator_pwd": "0000","em_baud_rate": "2400","ext": {"baud_rate":"3600"}}
请求参数说明
| 参数 | 类型 | 必须 | 说明 | 位置 |
|---|---|---|---|---|
| project_id | int | Y | 项目id | path |
| em_operator_code | string | N | 电表操作者代码 | body |
| em_operator_pwd | string | N | 电表操作者密码 | body |
| em_baud_rate | string | N | 电表波特率 | body |
| app_can_open_wm | bool | Y | app是否能开关水表 | body |
| app_can_open_em | bool | Y | app是否能开关电表 | body |
| ext | json | Y | 扩展字段 | body |
返回示例
{"meta": {"code": 0,"message": "success"},"data": {"id": 3,"project_id": 3,"app_can_open_wm": false,"app_can_open_em": true,"em_operator_code": "0000","em_operator_pwd": "0000","em_baud_rate": "2400","ext": {"botelv": "3600"},"updated_at": "2019-05-14T16:50:28"}}
返回参数说明
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| em_operator_code | string | Y | 电表操作者代码 |
| em_operator_pwd | string | Y | 电表操作者密码 |
| em_baud_rate | string | Y | 电表波特率 |
| app_can_open_wm | bool | Y | app是否能开关水表 |
| app_can_open_em | bool | Y | app是否能开关电表 |
| ext | json | Y | 扩展字段 |