@soszrg
2019-05-09T15:38:52.000000Z
字数 2015
阅读 330
anxin
https://anxinapi.fogcloud.io
Authorization: token 1:d79be1d657d9a8b45f6f903620e84b06cbf225e0
登出接口(token)
GET /api/v1/statistic/project/gross/
# 按月统计/api/v1/statistic/project/gross/?project_id=3&period=month&device_type=0# 按年统计/api/v1/statistic/project/gross/?project_id=3&period=year&device_type=0
| 参数 | 类型 | 必须 | 说明 | 位置 |
|---|---|---|---|---|
| project_id | int | Y | 项目id | path |
| period | string | Y | 统计类型:年 year,月 month | path |
| device_type | int | Y | 设备类型:0 电表 1 水表 | path |
返回参数
# 按月统计{"meta": {"code": 0,"message": "success"},"data": [{"date": 1,"amount": 31},{"date": 2,"amount": 28},{"date": 3,"amount": 31},{"date": 4,"amount": 30},{"date": 5,"amount": 10}]}# 按年统计{"meta": {"code": 0,"message": "success"},"data": [{"date": 2017,"amount": 365},{"date": 2018,"amount": 365},{"date": 2019,"amount": 130}]}
返回参数说明
| 参数 | 类型 | 说明 |
|---|---|---|
| date | int | 年份或月份 |
| amount | float | 总额 |
GET /api/v1/statistic/usage/master/
/api/v1/statistic/usage/master/?project_id=3&period=year&device_type=1
| 参数 | 类型 | 必须 | 说明 | 位置 |
|---|---|---|---|---|
| project_id | int | Y | 项目id | path |
| period | string | Y | 统计类型:年 year,月 month | path |
| device_type | int | Y | 设备类型:0 电表 1 水表 | path |
返回参数
# 按月统计{"meta": {"code": 0,"message": "success"},"data": [{"date": 1,"sum": 31},{"date": 2,"sum": 28},{"date": 3,"sum": 31},{"date": 4,"sum": 30},{"date": 5,"sum": 9}]}# 按年统计{"meta": {"code": 0,"message": "success"},"data": [{"date": 2017,"sum": 365},{"date": 2018,"sum": 365},{"date": 2019,"sum": 129}]}
返回参数说明
| 参数 | 类型 | 说明 |
|---|---|---|
| date | int | 年份或月份 |
| amount | float | 总额 |
GET /api/v1/statistic/usage/subs/
/api/v1/statistic/usage/subs/?project_id=3&period=year&device_type=1
| 参数 | 类型 | 必须 | 说明 | 位置 |
|---|---|---|---|---|
| project_id | int | Y | 项目id | path |
| period | string | Y | 统计类型:年 year,月 month | path |
| device_type | int | Y | 设备类型:0 电表 1 水表 | path |
返回参数
# 按月统计{"meta": {"code": 0,"message": "success"},"data": [{"date": 1,"sum": 62},{"date": 2,"sum": 56},{"date": 3,"sum": 62},{"date": 4,"sum": 60},{"date": 5,"sum": 18}]}# 按年统计{"meta": {"code": 0,"message": "success"},"data": [{"date": 2017,"sum": 1825},{"date": 2018,"sum": 1858},{"date": 2019,"sum": 682}]}
返回参数说明
| 参数 | 类型 | 说明 |
|---|---|---|
| date | int | 年份或月份 |
| amount | float | 总额 |