API接口文档
未分类
API接口请求规则
{ "Content-Type": "application/json", "Authorization": "Token 1234567890"}备注: 1234567890 为 access_token 的值
账号体系
获取Token
POST /admin/auth/access_token/
| 参数 |
类型 |
必填 |
说明 |
| area |
string |
否 |
手机区号 |
| account |
string |
是 |
手机或邮箱 |
| password |
string |
是 |
密码 |
| 参数 |
类型 |
必有 |
说明 |
| access_token |
string |
是 |
用于请求Header中的Token值 |
| refresh_token |
string |
是 |
用于刷新Token信息 |
| expires_at |
string |
是 |
access_token有效截止时间 |
| expires_in |
string |
是 |
access_token有效时间,单位:秒 |
{ "code": 0, "message": "success", "data": { "access_token": "lRnCFDxpK6PhpT44YaaLMwHmvI97GCIQvxazlNSQC4XxjDBCAV", "refresh_token": "aQ4XO33CSez6aSXEaiptgD10NzbWMu42xh3Wvb3YI2pgpD1raD", "expires_at": "2019-05-29 18:22:30", "expires_in": 604800 }}
刷新Token
POST /admin/auth/refresh_token/
| 参数 |
类型 |
必填 |
说明 |
| refresh_token |
string |
是 |
刷新Token |
| 参数 |
类型 |
必有 |
说明 |
| access_token |
string |
是 |
用于请求Header中的Token值 |
| refresh_token |
string |
是 |
用于刷新Token信息 |
| expires_at |
string |
是 |
access_token有效截止时间 |
| expires_in |
string |
是 |
access_token有效时间,单位:秒 |
{ "code": 0, "message": "success", "data": { "access_token": "lRnCFDxpK6PhpT44YaaLMwHmvI97GCIQvxazlNSQC4XxjDBCAV", "refresh_token": "aQ4XO33CSez6aSXEaiptgD10NzbWMu42xh3Wvb3YI2pgpD1raD", "expires_at": "2019-05-29 18:22:30", "expires_in": 604800 }}
销毁Token
POST /admin/auth/destroy_token/
{ "code": 0, "message": "success", "data": {}}
获取个人信息
GET /admin/personal/info/
| 参数 |
类型 |
必有 |
说明 |
| logo |
string |
是 |
logo地址 |
| id |
int |
是 |
用户ID |
| area |
string |
是 |
手机区号 |
| phone |
string |
是 |
手机号 |
| email |
string |
是 |
邮箱 |
| role |
int |
是 |
用户角色,0:普通用户 |
| role_name |
string |
是 |
角色名称 |
| username |
string |
是 |
用户名 |
| is_active |
bool |
是 |
是否已激活 |
| created_at |
string |
是 |
创建时间 |
| updated_at |
string |
是 |
更新时间 |
| nickname |
string |
是 |
昵称 |
| avatar |
string |
是 |
头像地址 |
| gender |
int |
是 |
性别,0:女,1:男,2:保密 |
| birthday |
string |
是 |
生日日期,如:2019-02-22 |
| address |
string |
是 |
地址 |
| last_login_ip |
string |
是 |
最后登陆IP |
| last_login_time |
string |
是 |
最后登陆时间 |
{ "code": 0, "message": "success", "data": { "id": 8, "logo": "http://127.0.0.1/logo.png", "area": "86", "phone": "18656660930", "email": "", "open_id": "HuTfdXc8mENtNULFPBVt233cN2gzZ9lKqAcoUKed", "role": 0, "username": "18656660930", "is_active": true, "app_id": "", "created_at": "2019-05-22 18:20:45", "updated_at": "2019-05-22 18:20:45", "nickname": "", "avatar": "", "gender": 2, "birthday": "", "address": "", "permissions": [ "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "10-1", "10-2", "11", "11-1", "11-2", "11-3" ] }}
编辑个人信息
PUT /admin/personal/info/
| 参数 |
类型 |
必填 |
说明 |
| nickname |
string |
否 |
昵称 |
| avatar |
string |
否 |
头像地址 |
| gender |
int |
否 |
性别:0女,1男,2保密 |
| birthday |
string |
否 |
生日: 格式要求示例(1991-03-08) |
| address |
string |
否 |
住址 |
| 参数 |
类型 |
必有 |
说明 |
| id |
int |
是 |
用户ID |
| area |
string |
是 |
手机区号 |
| phone |
string |
是 |
手机号 |
| email |
string |
是 |
邮箱 |
| role |
int |
是 |
用户角色,0:普通用户 |
| username |
string |
是 |
用户名 |
| is_active |
bool |
是 |
是否已激活 |
| created_at |
string |
是 |
创建时间 |
| updated_at |
string |
是 |
更新时间 |
| nickname |
string |
是 |
昵称 |
| avatar |
string |
是 |
头像地址 |
| gender |
int |
是 |
性别,0:女,1:男,2:保密 |
| birthday |
string |
是 |
生日日期,如:2019-02-22 |
| address |
string |
是 |
地址 |
{ "code": 0, "message": "success", "data": { "id": 8, "area": "86", "phone": "18656660930", "email": "", "open_id": "HuTfdXc8mENtNULFPBVt233cN2gzZ9lKqAcoUKed", "role": 0, "username": "18656660930", "is_active": true, "app_id": "", "created_at": "2019-05-22 18:20:45", "updated_at": "2019-05-22 18:20:45", "nickname": "", "avatar": "", "gender": 2, "birthday": "", "address": "" }}
FAQ服务
添加FAQ
POST /admin/faq/
| 参数 |
类型 |
必填 |
说明 |
| title |
string |
是 |
标题 |
| content |
string |
是 |
内容 |
| category |
string |
否 |
类型 |
| external_link |
string |
否 |
外链 |
| 参数 |
类型 |
必有 |
说明 |
| id |
int |
是 |
faq信息id |
| title |
string |
是 |
标题 |
| content |
string |
是 |
内容 |
| category |
string |
是 |
类型 |
| external_link |
string |
是 |
外链 |
| created_at |
string |
是 |
创建时间 |
| updated_at |
string |
是 |
更新时间 |
| app_id |
string |
是 |
厂商标识 |
{ "code": 0, "message": "success", "data": { "id": 2, "app_id": "", "created_at": "2019-05-23 18:17:16", "updated_at": "2019-05-23 18:17:16", "title": "标题", "content": "内容", "category": "", "external_link": "" }}
编辑FAQ
PUT /admin/faq/{id}/
| 参数 |
类型 |
必填 |
说明 |
| id |
int |
是 |
faq信息id |
| title |
string |
是 |
标题 |
| content |
string |
是 |
内容 |
| category |
string |
否 |
类型 |
| external_link |
string |
否 |
外链 |
| 参数 |
类型 |
必有 |
说明 |
| id |
int |
是 |
faq信息id |
| title |
string |
是 |
标题 |
| content |
string |
是 |
内容 |
| category |
string |
是 |
类型 |
| external_link |
string |
是 |
外链 |
| created_at |
string |
是 |
创建时间 |
| updated_at |
string |
是 |
更新时间 |
| app_id |
string |
是 |
厂商标识 |
{ "code": 0, "message": "success", "data": { "id": 2, "app_id": "", "created_at": "2019-05-23 18:17:16", "updated_at": "2019-05-23 18:17:16", "title": "标题", "content": "内容", "category": "", "external_link": "" }}
删除FAQ
DELETE /admin/faq/{id}/
| 参数 |
类型 |
必填 |
说明 |
| id |
int |
是 |
faq信息id |
{ "code": 0, "message": "success", "data": {}}
获取FAQ详情
GET /admin/faq/{id}/
| 参数 |
类型 |
必填 |
说明 |
| id |
int |
是 |
faq信息id |
| 参数 |
类型 |
必有 |
说明 |
| id |
int |
是 |
faq信息id |
| title |
string |
是 |
标题 |
| content |
string |
是 |
内容 |
| category |
string |
是 |
类型 |
| external_link |
string |
是 |
外链 |
| created_at |
string |
是 |
创建时间 |
| updated_at |
string |
是 |
更新时间 |
| app_id |
string |
是 |
厂商标识 |
{ "code": 0, "message": "success", "data": { "id": 2, "app_id": "", "created_at": "2019-05-23 18:17:16", "updated_at": "2019-05-23 18:17:16", "title": "标题", "content": "内容", "category": "", "external_link": "" }}
获取FAQ列表
GET /admin/faq/
| 参数 |
类型 |
必有 |
说明 |
| id |
int |
是 |
faq信息id |
| title |
string |
是 |
标题 |
| content |
string |
是 |
内容 |
| category |
string |
是 |
类型 |
| external_link |
string |
是 |
外链 |
| created_at |
string |
是 |
创建时间 |
| updated_at |
string |
是 |
更新时间 |
| app_id |
string |
是 |
厂商标识 |
{ "code": 0, "message": "success", "data": { "total": 1, "pages": 1, "current_page": 1, "page_size": 20, "data": [ { "id": 2, "app_id": "", "created_at": "2019-05-23 18:17:16", "updated_at": "2019-05-23 18:17:16", "title": "标题", "content": "内容", "category": "", "external_link": "" } ] }}
意见反馈
添加反馈类型
POST /admin/feedback_category/
| 参数 |
类型 |
必填 |
说明 |
| name |
string |
是 |
名称 |
| description |
string |
否 |
描述 |
| 参数 |
类型 |
必有 |
说明 |
| id |
int |
是 |
反馈类型id |
| name |
string |
是 |
反馈类型名称 |
| description |
string |
是 |
反馈类型描述 |
| created_at |
string |
是 |
创建时间 |
| updated_at |
string |
是 |
更新时间 |
| app_id |
string |
是 |
厂商标识 |
{ "code": 0, "message": "success", "data": { "id": 2, "app_id": "", "created_at": "2019-05-24 11:28:43", "updated_at": "2019-05-24 11:28:43", "name": "设备", "description": "其他" }}
编辑反馈类型
PUT /admin/feedback_category/{id}/
| 参数 |
类型 |
必填 |
说明 |
| id |
int |
是 |
反馈类型id |
| name |
string |
是 |
名称 |
| description |
string |
否 |
描述 |
| 参数 |
类型 |
必有 |
说明 |
| id |
int |
是 |
反馈类型id |
| name |
string |
是 |
反馈类型名称 |
| description |
string |
是 |
反馈类型描述 |
| created_at |
string |
是 |
创建时间 |
| updated_at |
string |
是 |
更新时间 |
| app_id |
string |
是 |
厂商标识 |
{ "code": 0, "message": "success", "data": { "id": 2, "app_id": "", "created_at": "2019-05-24 11:28:43", "updated_at": "2019-05-24 11:28:43", "name": "设备", "description": "其他" }}
删除反馈类型
DELETE /admin/feedback_category/{id}/
| 参数 |
类型 |
必填 |
说明 |
| id |
int |
是 |
反馈类型id |
{ "code": 0, "message": "success", "data": {}}
获取反馈类型详情
GET /admin/feedback_category/{id}/
| 参数 |
类型 |
必填 |
说明 |
| id |
int |
是 |
反馈类型id |
| 参数 |
类型 |
必有 |
说明 |
| id |
int |
是 |
反馈类型id |
| name |
string |
是 |
反馈类型名称 |
| description |
string |
是 |
反馈类型描述 |
| created_at |
string |
是 |
创建时间 |
| updated_at |
string |
是 |
更新时间 |
| app_id |
string |
是 |
厂商标识 |
{ "code": 0, "message": "success", "data": { "id": 2, "app_id": "", "created_at": "2019-05-24 11:28:43", "updated_at": "2019-05-24 11:28:43", "name": "设备", "description": "其他" }}
获取反馈类型列表
GET /admin/feedback_category/
{ "Content-Type": "application/json; charset=utf-8", "Authorization": "Token xxxxxx"}
| 参数 |
类型 |
必填 |
说明 |
| page_no |
int |
否 |
分页数:默认1 |
| page_size |
int |
否 |
数据量:默认20 |
| 参数 |
类型 |
必有 |
说明 |
| id |
int |
是 |
反馈类型id |
| name |
string |
是 |
反馈类型名称 |
| description |
string |
是 |
反馈类型描述 |
| created_at |
string |
是 |
创建时间 |
| updated_at |
string |
是 |
更新时间 |
| app_id |
string |
是 |
厂商标识 |
{ "code": 0, "message": "success", "data": { "total": 1, "pages": 1, "current_page": 1, "page_size": 20, "data": [ { "id": 1, "app_id": "", "created_at": "2019-05-24 11:28:08", "updated_at": "2019-05-24 11:30:57", "name": "app", "description": "app" } ] }}
获取意见反馈列表
GET /admin/feedback/
| 参数 |
类型 |
必填 |
说明 |
| page_no |
int |
否 |
分页数:默认1 |
| page_size |
int |
否 |
数据量:默认20 |
| start_time |
int |
否 |
起始时间戳 |
| end_time |
int |
否 |
结束时间戳 |
| username |
string |
否 |
用户名 |
| 参数 |
类型 |
必有 |
说明 |
| id |
int |
是 |
反馈类型id |
| name |
string |
是 |
反馈类型名称 |
| description |
string |
是 |
反馈类型描述 |
| created_at |
string |
是 |
创建时间 |
| updated_at |
string |
是 |
更新时间 |
| app_id |
string |
是 |
厂商标识 |
{ "code": 0, "message": "success", "data": { "total": 2, "pages": 1, "current_page": 1, "page_size": 20, "data": [ { "id": 3, "app_id": "", "created_at": "2019-05-24 11:48:47", "updated_at": "2019-05-24 11:48:47", "feedback_content": "反馈内容", "feedback_status": 0, "feedback_category_id": 1, "contact_phone": "18656660930", "user_id": 2, "username": "admin" }, { "id": 2, "app_id": "", "created_at": "2019-05-24 11:47:43", "updated_at": "2019-05-24 11:47:43", "feedback_content": "反馈内容", "feedback_status": 1, "feedback_category_id": 1, "contact_phone": "18656660930", "user_id": 2, "username": "admin" } ] }}
删除意见反馈
DELETE /admin/feedback/{id}/
| 参数 |
类型 |
必填 |
说明 |
| id |
int |
是 |
反馈意见id |
{ "code": 0, "message": "success", "data": {}}
获取意见反馈回复内容
GET /admin/feedback/reply/{feedback_id}/
| 参数 |
类型 |
必填 |
说明 |
| feedback_id |
int |
是 |
反馈意见id |
| 参数 |
类型 |
必有 |
说明 |
| id |
string |
是 |
反馈类型id |
| reply_content |
string |
是 |
回复内容 |
| is_read |
bool |
是 |
是否已读 |
| created_at |
string |
是 |
创建时间 |
| updated_at |
string |
是 |
更新时间 |
| app_id |
string |
是 |
厂商标识 |
{ "code": 0, "message": "success", "data": { "id": 2, "app_id": "", "created_at": "2019-05-24 14:02:44", "updated_at": "2019-05-24 14:02:44", "reply_content": "回复内容", "manager_id": 2, "feedback_id": 3, "is_read": false }}
在线文档
创建在线文档
POST /admin/document/
| 参数 |
类型 |
必填 |
说明 |
| doc_name |
string |
是 |
文档名称 |
| doc_content |
string |
是 |
文档内容 |
| path_name |
string |
是 |
路径名称 |
| 参数 |
类型 |
必有 |
说明 |
| id |
int |
是 |
文档id |
| created_at |
string |
是 |
创建时间 |
| updated_at |
string |
是 |
更新时间 |
| app_id |
string |
是 |
厂商标识 |
| doc_name |
string |
是 |
文档名称 |
| doc_content |
string |
是 |
文档内容 |
| doc_url |
string |
是 |
文档地址 |
{ "code": 0, "message": "success", "data": { "id": 1, "path_name": "1", "app_id": "", "created_at": "2019-08-27 16:14:46", "updated_at": "2019-08-27 16:14:46", "doc_name": "使用说明书", "doc_content": "**************", "doc_url": "http://39.105.60.207:8101/document/1" }}
获取文档列表
GET /admin/document/
| 参数 |
类型 |
必填 |
说明 |
| page_no |
int |
否 |
分页数:默认1 |
| page_size |
int |
否 |
数据量:默认20 |
| 参数 |
类型 |
必有 |
说明 |
| id |
int |
是 |
文档id |
| created_at |
string |
是 |
创建时间 |
| updated_at |
string |
是 |
更新时间 |
| app_id |
string |
是 |
厂商标识 |
| doc_name |
string |
是 |
文档名称 |
| doc_content |
string |
是 |
文档内容 |
| doc_url |
string |
是 |
文档地址 |
{ "code": 0, "message": "success", "data": { "total": 1, "pages": 1, "current_page": 1, "page_size": 20, "data": [ { "id": 1, "path_name": "1", "app_id": "", "created_at": "2019-08-27 16:14:46", "updated_at": "2019-08-27 16:14:46", "doc_name": "使用说明书", "doc_content": "**************", "doc_url": "http://39.105.60.207:8101/document/1" } ] }}
编辑在线文档
PUT /admin/document/[id]/
| 参数 |
类型 |
必填 |
说明 |
| id |
int |
是 |
文档id |
| doc_name |
string |
是 |
文档名称 |
| doc_content |
string |
是 |
文档内容 |
| path_name |
string |
是 |
路径名称 |
| 参数 |
类型 |
必有 |
说明 |
| id |
int |
是 |
文档id |
| created_at |
string |
是 |
创建时间 |
| updated_at |
string |
是 |
更新时间 |
| app_id |
string |
是 |
厂商标识 |
| doc_name |
string |
是 |
文档名称 |
| doc_content |
string |
是 |
文档内容 |
| doc_url |
string |
是 |
文档地址 |
{ "code": 0, "message": "success", "data": { "id": 1, "path_name": "1", "app_id": "", "created_at": "2019-08-27 16:14:46", "updated_at": "2019-08-27 16:14:46", "doc_name": "使用说明书", "doc_content": "**************", "doc_url": "http://39.105.60.207:8101/document/1" }}
编辑在线文档
DELETE /admin/document/[id]/
| 参数 |
类型 |
必填 |
说明 |
| id |
int |
是 |
文档id |
| 参数 |
类型 |
必有 |
说明 |
| id |
int |
是 |
文档id |
| created_at |
string |
是 |
创建时间 |
| updated_at |
string |
是 |
更新时间 |
| app_id |
string |
是 |
厂商标识 |
| doc_name |
string |
是 |
文档名称 |
| doc_content |
string |
是 |
文档内容 |
| doc_url |
string |
是 |
文档地址 |
{ "code": 0, "message": "success", "data": {}}
在线文档详情
GET /admin/document/[id]/
| 参数 |
类型 |
必填 |
说明 |
| id |
int |
是 |
文档id |
| 参数 |
类型 |
必有 |
说明 |
| id |
int |
是 |
文档id |
| created_at |
string |
是 |
创建时间 |
| updated_at |
string |
是 |
更新时间 |
| app_id |
string |
是 |
厂商标识 |
| doc_name |
string |
是 |
文档名称 |
| doc_content |
string |
是 |
文档内容 |
| doc_url |
string |
是 |
文档地址 |
{ "code": 0, "message": "success", "data": { "id": 1, "path_name": "1", "app_id": "", "created_at": "2019-08-27 16:14:46", "updated_at": "2019-08-27 16:14:46", "doc_name": "使用说明书", "doc_content": "**************", "doc_url": "http://39.105.60.207:8101/document/1" }}
角色管理
获取角色配置清单
GET /admin/config/roles/
| 参数 |
类型 |
必有 |
说明 |
| title |
string |
是 |
菜单名称 |
| key |
string |
是 |
菜单唯一标识 |
{ "code": 0, "message": "success", "data": { "roles": [ { "title": "系统管理", "key": "1", "children": [ { "title": "账号管理", "key": "1-1" }, { "title": "角色管理", "key": "1-2" }, { "title": "日志管理", "key": "1-3" } ] }, { "title": "配置管理", "key": "2", "children": [ { "title": "在线文档", "key": "2-1" }, { "title": "FAQ", "key": "1-2" } ] }, { "title": "MQTT服务", "key": "3", "children": [ { "title": "产品管理", "key": "3-1" }, { "title": "设备管理", "key": "3-2" } ] } ] }}
获取角色列表
GET /admin/role/
| 参数 |
类型 |
必填 |
说明 |
| page_no |
int |
否 |
分页数:默认1 |
| page_size |
int |
否 |
数据量:默认20 |
| 参数 |
类型 |
必有 |
说明 |
| id |
string |
是 |
数据id |
| created_at |
string |
是 |
创建时间 |
| updated_at |
string |
是 |
设备名称 |
| role_name |
string |
是 |
角色名称 |
| role_permissions |
list |
是 |
角色权限 |
{ "code": 0, "message": "success", "data": { "id": 1, "role_permissions": [ "1-1", "2-2" ], "app_id": "", "created_at": "2019-09-01 14:28:56", "updated_at": "2019-09-01 15:04:22", "role_name": "技术人员" }}
创建角色
POST /admin/role/
| 参数 |
类型 |
必填 |
说明 |
| role_name |
string |
是 |
角色名称 |
| role_permissions |
list |
是 |
角色权限, 参考角色配置清单,选中的children中的key列表 |
| 参数 |
类型 |
必有 |
说明 |
| id |
string |
是 |
数据id |
| created_at |
string |
是 |
创建时间 |
| updated_at |
string |
是 |
设备名称 |
| role_name |
string |
是 |
角色名称 |
| role_permissions |
list |
是 |
角色权限 |
{ "role_name": "技术人员", "role_permissions": ['1-1', '2-2']}
{ "code": 0, "message": "success", "data": { "id": 1, "role_permissions": [ "1-1", "2-2" ], "app_id": "", "created_at": "2019-09-01 14:28:56", "updated_at": "2019-09-01 14:28:56", "role_name": "技术人员" }}
获取角色详情
GET /admin/role/[id]/
| 参数 |
类型 |
必有 |
说明 |
| id |
string |
是 |
数据id |
| created_at |
string |
是 |
创建时间 |
| updated_at |
string |
是 |
设备名称 |
| role_name |
string |
是 |
角色名称 |
| role_permissions |
list |
是 |
角色权限 |
{ "code": 0, "message": "success", "data": { "id": 1, "role_permissions": [ "1-1", "2-2" ], "app_id": "", "created_at": "2019-09-01 14:28:56", "updated_at": "2019-09-01 14:28:56", "role_name": "技术人员" }}
编辑角色
PUT /admin/role/[id]/
| 参数 |
类型 |
必填 |
说明 |
| role_name |
string |
是 |
角色名称 |
| role_permissions |
list |
是 |
角色权限, 参考角色配置清单,选中的children中的key列表 |
| 参数 |
类型 |
必有 |
说明 |
| id |
string |
是 |
数据id |
| created_at |
string |
是 |
创建时间 |
| updated_at |
string |
是 |
设备名称 |
| role_name |
string |
是 |
角色名称 |
| role_permissions |
list |
是 |
角色权限 |
{ "role_name": "技术人员", "role_permissions": ['1-1', '2-2']}
{ "code": 0, "message": "success", "data": { "id": 1, "role_permissions": [ "1-1", "2-2" ], "app_id": "", "created_at": "2019-09-01 14:28:56", "updated_at": "2019-09-01 14:28:56", "role_name": "技术人员" }}
删除角色
DELETE /admin/role/[id]/
| 参数 |
类型 |
必填 |
说明 |
| id |
string |
是 |
角色id |
{ "code": 0, "message": "success", "data": {}}
公司管理
添加公司
POST /admin/app/
| 参数 |
类型 |
必填 |
说明 |
| company |
string |
是 |
公司名称 |
| address |
string |
是 |
公司地址 |
| contact_name |
string |
是 |
联系人 |
| phone |
string |
是 |
电话 |
| email |
string |
否 |
邮箱 |
| password |
string |
否 |
密码 |
| logo |
string |
否 |
logo |
| 参数 |
类型 |
必有 |
说明 |
| id |
int |
是 |
公司信息id |
| company |
string |
是 |
公司名称 |
| address |
string |
是 |
公司地址 |
| contact_name |
string |
是 |
联系人 |
| phone |
string |
是 |
电话 |
| email |
string |
是 |
邮箱 |
| app_id |
string |
是 |
公司信息标识符 |
| created_at |
string |
是 |
创建时间 |
| updated_at |
string |
是 |
更新时间 |
| logo |
string |
是 |
logo |
{ "code": 0, "message": "success", "data": { "id": 3, "app_id": "5d73209e228c90634547aaf5", "created_at": "2019-09-07 11:14:38", "updated_at": "2019-09-07 11:14:38", "company": "上海xxxx科技有限公司", "contact_name": "xxx", "address": "", "phone": "18656660932", "email": "" }}
获取公司列表
GET /admin/app/
| 参数 |
类型 |
必填 |
说明 |
| page_no |
int |
否 |
分页数:默认1 |
| page_size |
int |
否 |
数据量:默认20 |
| company |
string |
否 |
公司名称 |
| 参数 |
类型 |
必有 |
说明 |
| id |
int |
是 |
公司信息id |
| company |
string |
是 |
公司名称 |
| address |
string |
是 |
公司地址 |
| contact_name |
string |
是 |
联系人 |
| phone |
string |
是 |
电话 |
| email |
string |
是 |
邮箱 |
| app_id |
string |
是 |
公司信息标识符 |
| created_at |
string |
是 |
创建时间 |
| updated_at |
string |
是 |
更新时间 |
{ "code": 0, "message": "success", "data": { "total": 2, "pages": 1, "current_page": 1, "page_size": 20, "data": [ { "id": 3, "app_id": "5d73209e228c90634547aaf5", "created_at": "2019-09-07 11:14:38", "updated_at": "2019-09-07 11:14:38", "company": "上海xxx", "contact_name": "xxx", "address": "", "phone": "1865666xxxx", "email": "" }, { "id": 2, "app_id": "5d73205d228c90634547aaf4", "created_at": "2019-09-07 11:13:33", "updated_at": "2019-09-07 11:13:33", "company": "上海xxxx科技有限公司", "contact_name": "xxx", "address": "", "phone": "18656660931", "email": "" } ] }}
编辑公司
PUT /admin/app/[id]/
| 参数 |
类型 |
必填 |
说明 |
| company |
string |
是 |
公司名称 |
| contact_name |
string |
是 |
联系人 |
| phone |
string |
是 |
电话 |
| email |
string |
否 |
邮箱 |
| password |
string |
否 |
密码 |
| logo |
string |
否 |
logo |
| 参数 |
类型 |
必有 |
说明 |
| id |
int |
是 |
公司信息id |
| company |
string |
是 |
公司名称 |
| address |
string |
是 |
公司地址 |
| contact_name |
string |
是 |
联系人 |
| phone |
string |
是 |
电话 |
| email |
string |
是 |
邮箱 |
| app_id |
string |
是 |
公司信息标识符 |
| created_at |
string |
是 |
创建时间 |
| updated_at |
string |
是 |
更新时间 |
{ "code": 0, "message": "success", "data": { "id": 3, "app_id": "5d73209e228c90634547aaf5", "created_at": "2019-09-07 11:14:38", "updated_at": "2019-09-07 11:14:38", "company": "上海xxxx科技有限公司", "contact_name": "高杨", "address": "", "phone": "18656660932", "email": "" }}
获取公司详情
GET /admin/app/[id]/
| 参数 |
类型 |
必填 |
说明 |
| id |
int |
是 |
公司信息id |
| 参数 |
类型 |
必有 |
说明 |
| id |
int |
是 |
公司信息id |
| company |
string |
是 |
公司名称 |
| address |
string |
是 |
公司地址 |
| contact_name |
string |
是 |
联系人 |
| phone |
string |
是 |
电话 |
| email |
string |
是 |
邮箱 |
| app_id |
string |
是 |
公司信息标识符 |
| created_at |
string |
是 |
创建时间 |
| updated_at |
string |
是 |
更新时间 |
{ "code": 0, "message": "success", "data": { "id": 3, "app_id": "5d73209e228c90634547aaf5", "created_at": "2019-09-07 11:14:38", "updated_at": "2019-09-07 11:14:38", "company": "上海xxxx科技有限公司", "contact_name": "高杨", "address": "", "phone": "18656660932", "email": "" }}
获取公司详情
DELETE /admin/app/[id]/
| 参数 |
类型 |
必填 |
说明 |
| id |
int |
是 |
公司信息id |
{ "code": 0, "message": "success", "data": {}}
产品管理
添加产品
POST /admin/product/
| 参数 |
类型 |
必填 |
说明 |
| product_name |
string |
是 |
产品名称 |
| 参数 |
类型 |
必有 |
说明 |
| product_name |
string |
是 |
产品名称 |
| product_key |
string |
是 |
产品标识符 |
| product_secret |
string |
是 |
产品秘钥 |
| created |
string |
是 |
创建时间 |
{ "code": 0, "message": "success", "data": { "_id": "5d7609dfe1508d2dfb31c91c", "product_name": "小系统", "product_key": "bOZVf6DNvE", "product_secret": "JvSTO0JQz3oBVIWMFwSU7lK8Eo2vmpsA", "created": "2019-09-09 16:14:23" }}
获取产品列表
GET /admin/product/
| 参数 |
类型 |
必有 |
说明 |
| product_name |
string |
是 |
产品名称 |
| product_key |
string |
是 |
产品标识符 |
| product_secret |
string |
是 |
产品秘钥 |
| created |
string |
是 |
创建时间 |
| all_device_count |
int |
是 |
所有设备数量 |
| online_device_count |
int |
是 |
在线设备数量 |
{ "code": 0, "message": "success", "data": { "total": 2, "pages": 1, "current_page": 1, "page_size": 20, "data": [ { "_id": "5d6f719ecb25ac82f5103fc9", "product_name": "test", "product_key": "hnbSRfI21N", "product_secret": "WJ1HHwVhixisjyeCR5hGTH6iVk1gele2", "created": "2019-09-04 16:11:10" }, { "_id": "5d7609dfe1508d2dfb31c91c", "product_name": "小系统", "product_key": "bOZVf6DNvE", "product_secret": "JvSTO0JQz3oBVIWMFwSU7lK8Eo2vmpsA", "created": "2019-09-09 16:14:23" } ] }}
获取产品详情
GET /admin/product/[product_key]/
| 参数 |
类型 |
必填 |
说明 |
| product_key |
string |
是 |
产品标识符 |
| 参数 |
类型 |
必有 |
说明 |
| product_name |
string |
是 |
产品名称 |
| product_key |
string |
是 |
产品标识符 |
| product_secret |
string |
是 |
产品秘钥 |
| created |
string |
是 |
创建时间 |
{ "code": 0, "message": "success", "data": { "_id": "5d7609dfe1508d2dfb31c91c", "product_name": "小系统", "product_key": "bOZVf6DNvE", "product_secret": "JvSTO0JQz3oBVIWMFwSU7lK8Eo2vmpsA", "created": "2019-09-09 16:14:23" }}
编辑产品详情
PUT /admin/product/[product_key]/
| 参数 |
类型 |
必填 |
说明 |
| product_key |
string |
是 |
产品标识符 |
| product_name |
string |
是 |
产品名称 |
| 参数 |
类型 |
必有 |
说明 |
| product_name |
string |
是 |
产品名称 |
| product_key |
string |
是 |
产品标识符 |
| product_secret |
string |
是 |
产品秘钥 |
| created |
string |
是 |
创建时间 |
{ "code": 0, "message": "success", "data": { "_id": "5d7609dfe1508d2dfb31c91c", "product_name": "小系统", "product_key": "bOZVf6DNvE", "product_secret": "JvSTO0JQz3oBVIWMFwSU7lK8Eo2vmpsA", "created": "2019-09-09 16:14:23" }}
删除产品
DELETE /admin/product/[product_key]/
| 参数 |
类型 |
必填 |
说明 |
| product_key |
string |
是 |
产品标识符 |
{ "code": 0, "message": "success", "data": {}}
电站管理
电价/充放电策略列表
GET /admin/strategy/
{ "code": 0, "message": "success", "data": { "charge_discharge": [ { "_id": "5dc4de33972397c218d0b054", "name": "测试" } ], "power_price": [ { "_id": "5dc12eedb37d13ebc87c04fe", "name": "xxxxxx" }, { "_id": "5dc3df554366fea9299cd5a6", "name": "111" }, { "_id": "5dc3dfad85454b369f9cd278", "name": "11" } ] }}
添加电站
POST /admin/device/
| 参数 |
类型 |
必填 |
说明 |
| device_name |
string |
是 |
电站名称 |
| device_address |
string |
是 |
电站地址 |
| installed_power |
string |
是 |
装机功率(单位MW) |
| installed_capacity |
string |
是 |
装机容量(MWh) |
| voltage_level |
string |
是 |
电压等级(kV) |
| operation_time |
string |
是 |
投运时间 |
| contact_name |
string |
是 |
联系人 |
| contact_phone |
string |
是 |
联系电话 |
| app_id |
string |
是 |
公司信息app_id标识符 |
| address_province |
string |
是 |
省份 |
| address_city |
string |
是 |
市区 |
| sn |
string |
是 |
设备序列号 |
| pack_num |
int |
是 |
pack数量 |
| cell_num |
int |
是 |
cell数量 |
| power_price_id |
string |
是 |
电价策略_id |
| charge_discharge_id |
string |
是 |
充放电策略_id |
| inverter_sn |
string |
否 |
逆变器序列号 |
| inverter_power |
string |
否 |
逆变器功率 |
| number_4g |
string |
否 |
4G手机号 |
| remarks |
string |
否 |
备注 |
{ "code": 0, "message": "success", "data": { "app_id": "5d7330d4a0aa8b5f8630c52d", "device_name": "test", "device_address": "xxxx", "contact_name": "jerry", "contact_phone": "18656660930", "installed_power": 100, "installed_capacity": 100, "voltage_level": 4, "company": "xxxxxxx" "operation_time": "2019-09-07 10:00:00", "product_key": "hnbSRfI21N", "device_key": "5d7335cc10671a7ef6880ed2", "device_secret": "cs47vvrWX8VgECwoeNrBJLwsO0rQsqKK", "_id": "5d7335cc10671a7ef6880ed3", "created": "2019-09-07 12:45:00", "sn": "xxxxxx" }}
获取电站列表
GET /admin/device/
| 参数 |
类型 |
必填 |
说明 |
| page_no |
int |
否 |
分页数:默认1 |
| page_size |
int |
否 |
数据量:默认20 |
| device_name |
string |
否 |
电站名称 |
| company |
string |
否 |
所属企业 |
| app_id |
string |
否 |
公司标识 |
| open_id |
string |
否 |
用户标识 |
| 参数 |
类型 |
必有 |
说明 |
| device_name |
string |
是 |
电站名称 |
| device_address |
string |
是 |
电站地址 |
| installed_power |
string |
是 |
装机功率(单位MW) |
| installed_capacity |
string |
是 |
装机容量(MWh) |
| voltage_level |
string |
是 |
电压等级(kV) |
| operation_time |
string |
是 |
投运时间 |
| contact_name |
string |
是 |
联系人 |
| contact_phone |
string |
是 |
联系电话 |
| company |
string |
是 |
所属企业 |
| power_price_id |
string |
是 |
电价策略_id |
| charge_discharge_id |
string |
是 |
充放电策略_id |
| number_4g |
string |
是 |
4G手机号 |
| inverter_sn |
string |
是 |
逆变器序列号 |
| inverter_power |
string |
是 |
逆变器功率 |
{ "code": 0, "message": "success", "data": { "total": 13, "pages": 1, "current_page": 1, "page_size": 20, "data": [ { "_id": "5d7335cc10671a7ef6880ed3", "app_id": "5d7330d4a0aa8b5f8630c52d", "device_name": "test", "device_address": "xxxx", "contact_name": "jerry", "contact_phone": "18656660930", "installed_power": 100, "installed_capacity": 100, "voltage_level": 4, "company": "xxxxxxx" "operation_time": "2019-09-07 10:00:00", "product_key": "hnbSRfI21N", "device_key": "5d7335cc10671a7ef6880ed2", "device_secret": "cs47vvrWX8VgECwoeNrBJLwsO0rQsqKK", "created": "2019-09-07 12:45:00" } ] }}
获取电站下拉筛选列表
GET /admin/device/select/list/
| 参数 |
类型 |
必填 |
说明 |
| page_no |
int |
否 |
分页数:默认1 |
| page_size |
int |
否 |
数据量:默认20 |
| device_name |
string |
否 |
电站名称 |
| company |
string |
否 |
所属企业 |
| app_id |
string |
否 |
公司标识 |
| open_id |
string |
否 |
用户标识 |
| 参数 |
类型 |
必有 |
说明 |
| device_name |
string |
是 |
电站名称 |
| device_address |
string |
是 |
电站地址 |
| installed_power |
string |
是 |
装机功率(单位MW) |
| installed_capacity |
string |
是 |
装机容量(MWh) |
| voltage_level |
string |
是 |
电压等级(kV) |
| operation_time |
string |
是 |
投运时间 |
| contact_name |
string |
是 |
联系人 |
| contact_phone |
string |
是 |
联系电话 |
{ "code": 0, "message": "success", "data": { "data": [ { "_id": "5d7335cc10671a7ef6880ed3", "app_id": "5d7330d4a0aa8b5f8630c52d", "device_name": "test", "device_address": "xxxx", "contact_name": "jerry", "contact_phone": "18656660930", "installed_power": 100, "installed_capacity": 100, "voltage_level": 4, "operation_time": "2019-09-07 10:00:00", "product_key": "hnbSRfI21N", "device_key": "5d7335cc10671a7ef6880ed2", "device_secret": "cs47vvrWX8VgECwoeNrBJLwsO0rQsqKK", "created": "2019-09-07 12:45:00" } ] }}
编辑电站详情
PUT /admin/device/[device_key]/
| 参数 |
类型 |
必填 |
说明 |
| device_key |
string |
是 |
电站标识 |
| device_name |
string |
是 |
电站名称 |
| device_address |
string |
是 |
电站地址 |
| installed_power |
string |
是 |
装机功率(单位MW) |
| installed_capacity |
string |
是 |
装机容量(MWh) |
| voltage_level |
string |
是 |
电压等级(kV) |
| operation_time |
string |
是 |
投运时间 |
| contact_name |
string |
是 |
联系人 |
| contact_phone |
string |
是 |
联系电话 |
| app_id |
string |
是 |
公司信息app_id标识符 |
| sn |
string |
是 |
设备序列号 |
| pack_num |
int |
是 |
pack数量 |
| cell_num |
int |
是 |
cell数量 |
| power_price_id |
string |
是 |
电价策略_id |
| charge_discharge_id |
string |
是 |
充放电策略_id |
| number_4g |
string |
否 |
4G手机号 |
| inverter_sn |
string |
否 |
逆变器序列号 |
| inverter_power |
string |
否 |
逆变器功率 |
| remarks |
string |
否 |
备注 |
{ "code": 0, "message": "success", "data": { "app_id": "5d7330d4a0aa8b5f8630c52d", "device_name": "test", "device_address": "xxxx", "contact_name": "jerry", "contact_phone": "18656660930", "installed_power": 100, "installed_capacity": 100, "voltage_level": 4, "company": "xxxxxxx" "operation_time": "2019-09-07 10:00:00", "product_key": "hnbSRfI21N", "device_key": "5d7335cc10671a7ef6880ed2", "device_secret": "cs47vvrWX8VgECwoeNrBJLwsO0rQsqKK", "_id": "5d7335cc10671a7ef6880ed3", "created": "2019-09-07 12:45:00" }}
获取电站详情
GET /admin/device/[device_key]/
| 参数 |
类型 |
必填 |
说明 |
| device_key |
string |
是 |
电站标识 |
| 参数 |
类型 |
必有 |
说明 |
| device_name |
string |
是 |
电站名称 |
| device_address |
string |
是 |
电站地址 |
| installed_power |
string |
是 |
装机功率(单位MW) |
| installed_capacity |
string |
是 |
装机容量(MWh) |
| voltage_level |
string |
是 |
电压等级(kV) |
| operation_time |
string |
是 |
投运时间 |
| contact_name |
string |
是 |
联系人 |
| contact_phone |
string |
是 |
联系电话 |
| company |
string |
是 |
所属企业 |
| warning_count |
int |
是 |
今日新增故障数量 |
| yesterday_income |
float |
是 |
昨日收益 |
| this_month_income |
float |
是 |
本月收益 |
| all_income |
float |
是 |
累计收益 |
| SOC |
int |
是 |
SOC百分比 |
| TDisEnergy |
int |
是 |
累计放电量 |
| TChgEnergy |
int |
是 |
累计充电量 |
| AvailableDischargeEnergy |
int |
是 |
可用放电量 |
| AvailableChargeEnergy |
int |
是 |
可用充电量 |
{ "code": 0, "message": "success", "data": { "_id": "5d8b35c4a0d168685f7a66b7", "app_id": "5d8ef2f8beba9b969c6a2e7e", "product_key": "eXvrimn2mr", "device_name": "测试电站1", "address_province": "山东省", "address_city": "青岛市", "device_address": "金沙江路2222号", "contact_name": "jerry", "contact_phone": "18656660930", "installed_power": 100, "installed_capacity": 100, "voltage_level": 3, "operation_time": "2019-09-26 17:39:13", "device_key": "5d8b35c4a0d168685f7a66b6", "device_secret": "qpr6bBgSUjHwODUIvAUqIwLxIjHK2cEL", "status": 0, "created": "2019-09-25 17:39:16", "company": "上海创好智能科技有限公司", "warning_count": 0, "yesterday_income": 0, "this_month_income": 0, "all_income": 0, "SOC": 0, "TDisEnergy": 0, "TChgEnergy": 0, "AvailableDischargeEnergy": 0, "AvailableChargeEnergy": 0 }}
删除电站
DELETE /admin/device/[device_key]/
| 参数 |
类型 |
必填 |
说明 |
| device_key |
string |
是 |
电站标识 |
{ "code": 0, "message": "success", "data": {}}
电站监测
GET /admin/device/monitor/[device_key]/
| 参数 |
类型 |
必填 |
说明 |
| device_key |
string |
是 |
电站标识 |
| 参数 |
类型 |
必有 |
说明 |
| SOC |
int |
是 |
SOC |
| TDisEnergy |
int |
是 |
累计放电量 |
| TChgEnergy |
string |
是 |
累计充电量 |
| AvailableDischargeEnergy |
int |
是 |
可用放电量 |
| AvailableChargeEnergy |
int |
是 |
可用充电量 |
| TodayDischargeEnergy |
int |
是 |
今日放电量 |
| TodayChargeEnergy |
int |
是 |
今日充电量 |
| efficiency |
int |
是 |
电站效率 |
| yesterday_income |
float |
是 |
昨日收益 |
| all_income |
float |
是 |
累计收益 |
{ "code": 0, "message": "success", "data": { "SOC": 0, "TDisEnergy": 0, "TChgEnergy": 0, "AvailableDischargeEnergy": 0, "AvailableChargeEnergy": 0, "TodayDischargeEnergy": 0, "TodayChargeEnergy": 0, "efficiency": 0, "yesterday_income": 0, "all_income": 0 }}
绑定电站
POST /admin/bind/device/
| 参数 |
类型 |
必填 |
说明 |
| open_id |
string |
是 |
用户标识符 |
| sn |
string |
是 |
设备序列号 |
{ "code": 0, "message": "success", "data": {}}
历史数据下拉属性选择
GET /admin/history/attributes/
{ "code": 0, "message": "success", "data": { "Voltage": "电池电压", "Current": "电池电流", "Power": "电池功率", "SOC": "电池SOC", "VolLow": "电池包中最低电压", "VolLowID": "最低电压模块ID", "VolHigh": "电池包中最高电压", "VolHighID": "最高电压模块ID", "TemperLow": "电池包中最低温度", "TemperHigh": "电池包中最高温度", "PTotalPEnergy": "当前正向有功总电能", "PJPEnergy": "当前正向有功尖电能", "PFPEnergy": "当前正向有功峰电能", "PPPEnergy": "当前正向有功平电能", "PGPEnergy": "当前正向有功谷电能", "RTotalPEnergy": "当前反向有功总电能", "RJPEnergy": "当前反向有功尖电能", "RFPEnergy": "当前反向有功峰电能", "RPPEnergy": "当前反向有功平电能", "RGPEnergy": "当前反向有功谷电能", "DC1Current": "DC1电流", "DC1Voltage": "DC1电压", "DC2Current": "DC2电流", "DC2Voltage": "DC2电压", "VRgrid": "R相电网电压", "IRgrid": "R相电网电流", "FRgrid": "R相电网频率", "VSgrid": "S相电网电压", "ISgrid": "S相电网电流", "FSgrid": "S相电网频率", "VTgrid": "T相电网电压", "ITgrid": "T相电网电流", "FTgrid": "T相电网频率", "Temper": "温度", "Pgrid": "电网功率", "Pload": "负载功率", "Pdc": "功率", "FedGridEnergy": "逆变器馈网电量", "SupplyGridEnergy": "电网取电量", "LoadEnergy": "负载用电量" }}
历史数据曲线
GET /admin/history/attributes/chart/
| 参数 |
类型 |
必填 |
说明 |
| start_time |
int |
是 |
开始时间戳(单位:秒) |
| end_time |
int |
是 |
结束时间戳(单位:秒) |
| device_key |
string |
是 |
电站标识 |
| param_1 |
string |
否 |
电站属性 |
| param_2 |
string |
否 |
电站属性 |
{ "code": 0, "message": "success", "data": { "name_1": "当前正向有功尖电能", "name_2": "", "charts": [ { "value_1": 122, "value_2": 0, "date_time": "2019-09-27 15:18" }, { "value_1": 122, "value_2": 0, "date_time": "2019-09-27 15:18" }, { "value_1": 122, "value_2": 0, "date_time": "2019-09-27 15:19" } ] }}
账号管理
获取账号列表
GET /admin/manager/
| 参数 |
类型 |
必填 |
说明 |
| page_no |
int |
否 |
分页数:默认1 |
| page_size |
int |
否 |
数据量:默认20 |
| username |
string |
否 |
用户名 |
| phone |
string |
否 |
手机号 |
| 参数 |
类型 |
必有 |
说明 |
| username |
string |
是 |
用户名 |
| phone |
string |
是 |
手机号 |
| real_name |
string |
是 |
真实姓名) |
| created_at |
string |
是 |
创建时间) |
| last_login_ip |
string |
是 |
最后登陆IP |
| last_login_time |
string |
是 |
最后登陆时间 |
| role |
int |
是 |
角色ID |
| role_name |
string |
是 |
角色名称 |
{ "code": 0, "message": "success", "data": { "total": 1, "pages": 1, "current_page": 1, "page_size": 20, "data": [ { "id": 1, "username": "admin", "phone": "18656660930", "email": "", "real_name": "", "avatar": "", "is_superuser": 1, "created_at": "2019-09-07 11:04:55", "last_login_ip": "", "last_login_time": "2019-09-11 16:42:08", "role_name": "超级管理员", "role": 1 } ] }}
添加账号
POST /admin/manager/
| 参数 |
类型 |
必填 |
说明 |
| username |
string |
是 |
用户名 |
| phone |
string |
是 |
手机号 |
| real_name |
string |
是 |
真实姓名) |
| password |
string |
否 |
密码,默认:88888888 |
| role |
string |
是 |
角色ID |
{ "code": 0, "message": "success", "data": {}}
编辑账号
PUT /admin/manager/[id]/
| 参数 |
类型 |
必填 |
说明 |
| id |
int |
是 |
用户ID |
| username |
string |
是 |
用户名 |
| phone |
string |
是 |
手机号 |
| real_name |
string |
是 |
真实姓名) |
| password |
string |
否 |
密码,默认:88888888 |
| role |
string |
是 |
角色ID |
{ "code": 0, "message": "success", "data": {}}
删除账号
DELETE /admin/manager/[id]/
| 参数 |
类型 |
必填 |
说明 |
| id |
int |
是 |
用户ID |
{ "code": 0, "message": "success", "data": {}}
获取账号详情
GET /admin/manager/[id]/
| 参数 |
类型 |
必填 |
说明 |
| id |
int |
是 |
用户ID |
| 参数 |
类型 |
必有 |
说明 |
| id |
int |
是 |
用户ID |
| area |
string |
是 |
手机区号 |
| phone |
string |
是 |
手机号 |
| email |
string |
是 |
邮箱 |
| role |
int |
是 |
角色ID |
| role_name |
string |
是 |
角色名称 |
| username |
string |
是 |
用户名 |
| is_active |
bool |
是 |
是否已激活 |
| created_at |
string |
是 |
创建时间 |
| updated_at |
string |
是 |
更新时间 |
| nickname |
string |
是 |
昵称 |
| avatar |
string |
是 |
头像地址 |
| gender |
int |
是 |
性别,0:女,1:男,2:保密 |
| birthday |
string |
是 |
生日日期,如:2019-02-22 |
| address |
string |
是 |
地址 |
| last_login_ip |
string |
是 |
最后登陆IP |
| last_login_time |
string |
是 |
最后登陆时间 |
{ "code": 0, "message": "success", "data": { "id": 5, "username": "13917709594", "phone": "13917709594", "email": "", "real_name": "", "avatar": "", "is_superuser": 1, "created_at": "2019-09-07 12:23:48", "last_login_ip": "", "last_login_time": "2019-09-11 16:42:08.954072", "role_name": "超级管理员", "role": 1 }}
告警记录
获取记录列表
GET /admin/warning/
| 参数 |
类型 |
必填 |
说明 |
| page_no |
int |
否 |
分页数:默认1 |
| page_size |
int |
否 |
数据量:默认20 |
| code |
string |
否 |
告警码 |
| level |
string |
否 |
告警等级 |
| start_time |
int |
否 |
查询开始时间戳 |
| end_time |
int |
否 |
查询结束时间戳 |
| sn |
string |
否 |
设备序列号 |
| 参数 |
类型 |
必有 |
说明 |
| code |
string |
是 |
告警码 |
| level |
string |
是 |
告警等级 |
| time |
string |
是 |
告警发生时间 |
| zh_desc |
string |
是 |
告警中文描述 |
| en_desc |
string |
是 |
告警英文描述 |
{ "code": 0, "message": "success", "data": { "total": 3, "pages": 1, "current_page": 1, "page_size": 20, "data": [ { "_id": "5d81c43b964709a2d225f923", "msg_type": "event", "sn": "1234567890", "identifier": "warning", "items": { "code": "E01", "level": 1, "time": "2019-09-17T20:00:00", "GRID_STA": "1", "PCS_STA:": "2", "BAT_STA": "4", "en_desc": "DciOutRangeWarning", "zh_desc": "DCI超出范围告警" }, "product_key": "hnbSRfI21N", "device_key": "5d7355b6ff828faf31256eed", "created": "2019-09-18 13:44:27" }, { "_id": "5d81c43b964709a2d225f924", "msg_type": "event", "sn": "1234567890", "identifier": "warning", "items": { "code": "E01", "level": 1, "time": "2019-09-17T20:00:00", "GRID_STA": "1", "PCS_STA:": "2", "BAT_STA": "4", "en_desc": "DciOutRangeWarning", "zh_desc": "DCI超出范围告警" }, "product_key": "hnbSRfI21N", "device_key": "5d7355b6ff828faf31256eed", "created": "2019-09-18 13:44:27" }, { "_id": "5d81c43b964709a2d225f925", "msg_type": "event", "sn": "1234567890", "identifier": "warning", "items": { "code": "E01", "level": 1, "time": "2019-09-17T20:00:00", "GRID_STA": "1", "PCS_STA:": "2", "BAT_STA": "4", "en_desc": "DciOutRangeWarning", "zh_desc": "DCI超出范围告警" }, "product_key": "hnbSRfI21N", "device_key": "5d7355b6ff828faf31256eed", "created": "2019-09-18 13:44:27" } ] }}
位置分布
获取位置分布数量
GET /admin/address/statistics/
| 参数 |
类型 |
必有 |
说明 |
| count |
int |
是 |
电站数量 |
| city |
string |
是 |
城市 |
| location |
json |
是 |
经纬度 |
{ "code": 0, "message": "success", "data": { "address": [ { "count": 1, "city": "北京市", "location": {"lng": 0, "lat": 0} } ] }}
电价策略
添加电价策略
POST /admin/power/price/
| 参数 |
类型 |
必填 |
说明 |
| device_key |
string |
是 |
设备标识 |
| start_time |
int |
是 |
开始时间戳 |
| end_time |
int |
是 |
结束时间戳 |
| a |
json |
是 |
尖时段信息 |
| b |
json |
是 |
峰时段信息 |
| c |
json |
是 |
平时段信息 |
| d |
json |
是 |
谷时段信息 |
{ "code": 0, "message": "success", "data": { "start_time": "2019-09-22 09:53:47", "end_time": "2019-09-23 13:40:27", "device_key": "5d85b6f4540cd75be16e8a8b", "a": { "timer": [ [ "01:00", "05:00" ], [ "05:00", "08:00" ] ], "price": 1 }, "b": { "timer": [], "price": 0 }, "c": { "timer": [], "price": 0 }, "d": { "timer": [], "price": 0 }, "status": false, "_id": "5d86dded262d6d953b031fac", "created": "2019-09-22 10:35:25" }}
获取电价列表
GET /admin/power/price/
| 参数 |
类型 |
必填 |
说明 |
| device_key |
string |
是 |
设备标识 |
{ "code": 0, "message": "success", "data": { "prices": [ { "_id": "5d86de71554565d92f031fad", "start_time": "2019-09-22T09:53:47", "end_time": "2019-09-23T13:40:27", "device_key": "5d85b6f4540cd75be16e8a8b", "a": { "timer": [ [ "01:00", "05:00" ], [ "05:00", "08:00" ] ], "price": 1 }, "b": { "timer": [], "price": 0 }, "c": { "timer": [], "price": 0 }, "d": { "timer": [], "price": 0 }, "status": false, "created": "2019-09-22T10:37:37.976000" } ] }}
添加电价策略(新)
POST /admin/power/price/new/
| 参数 |
类型 |
必填 |
说明 |
| name |
string |
是 |
电价策略名称 |
| start_time |
string |
是 |
开始日期,格式如:09-01 |
| end_time |
string |
是 |
开始日期,格式如:11-01 |
| a |
json |
是 |
尖时段信息 |
| b |
json |
是 |
峰时段信息 |
| c |
json |
是 |
平时段信息 |
| d |
json |
是 |
谷时段信息 |
{ "name": "xxxxxx", "configs": [ { "start_time": "09-01", "end_time": "10-01", "a": { "timer": [["01:00", "05:00"], ["05:00", "08:00"]], "price": 1.0 }, "b": { "timer": [], "price": 0 }, "c": { "timer": [], "price": 0 }, "d": { "timer": [], "price": 0 } } ] }
获取电价列表(新)
GET /admin/power/price/new/
| 参数 |
类型 |
必填 |
说明 |
| page_no |
int |
否 |
分页数:默认1 |
| page_size |
int |
否 |
数据量:默认20 |
{ "code": 0, "message": "success", "data": { "total": 1, "pages": 1, "current_page": 1, "page_size": 20, "data": [ { "_id": "5dc12a6d35731de7351f5514", "name": "xxxxxx", "configs": [ { "start_time": "09-01", "end_time": "10-01", "a": { "timer": [ [ "01:00", "05:00" ], [ "05:00", "08:00" ] ], "price": 1 }, "b": { "timer": [], "price": 0 }, "c": { "timer": [], "price": 0 }, "d": { "timer": [], "price": 0 } } ], "created": "2019-11-05 15:53:17" } ] }}
编辑电价策略(新)
PUT /admin/power/price/new/[_id]/
| 参数 |
类型 |
必填 |
说明 |
| name |
string |
是 |
电价策略名称 |
| start_time |
string |
是 |
开始日期,格式如:09-01 |
| end_time |
string |
是 |
开始日期,格式如:11-01 |
| a |
json |
是 |
尖时段信息 |
| b |
json |
是 |
峰时段信息 |
| c |
json |
是 |
平时段信息 |
| d |
json |
是 |
谷时段信息 |
{ "name": "xxxxxx", "configs": [ { "start_time": "09-01", "end_time": "10-01", "a": { "timer": [["01:00", "05:00"], ["05:00", "08:00"]], "price": 1.0 }, "b": { "timer": [], "price": 0 }, "c": { "timer": [], "price": 0 }, "d": { "timer": [], "price": 0 } } ] }
{ "code": 0, "message": "success", "data": { "name": "xxxxxx", "configs": [ { "start_time": "09-01", "end_time": "10-01", "a": { "timer": [ [ "01:00", "05:00" ], [ "05:00", "08:00" ] ], "price": 1 }, "b": { "timer": [], "price": 0 }, "c": { "timer": [], "price": 0 }, "d": { "timer": [], "price": 0 } } ], "_id": "5dc12a6d35731de7351f5514", "created": "2019-11-05 15:53:17" }}
电价策略详情(新)
GET /admin/power/price/new/[_id]/
{ "code": 0, "message": "success", "data": { "name": "xxxxxx", "configs": [ { "start_time": "09-01", "end_time": "10-01", "a": { "timer": [ [ "01:00", "05:00" ], [ "05:00", "08:00" ] ], "price": 1 }, "b": { "timer": [], "price": 0 }, "c": { "timer": [], "price": 0 }, "d": { "timer": [], "price": 0 } } ], "_id": "5dc12a6d35731de7351f5514", "created": "2019-11-05 15:53:17" }}
充放电策略
获取充放电策略
GET /admin/charge_discharge/[device_key]/
| 参数 |
类型 |
必有 |
说明 |
| timer |
list |
是 |
时段 |
| power |
int |
是 |
功率 |
| action |
int |
是 |
动作:1充电,0放电 |
{ "code": 0, "message": "success", "data": { "_id": "5d86eca0132480bfb3db926f", "device_key": "5d85b6f4540cd75be16e8a8b", "strategy": [ { "timer": [ "01:00", "05:00" ], "power": 25, "action": 1 }, { "timer": [ "05:00", "10:00" ], "power": 20, "action": 0 } ], "created": "2019-09-22 11:38:08" }}
编辑充放电策略
PUT /admin/charge_discharge/[device_key]/
| 参数 |
类型 |
必填 |
说明 |
| strategy |
list |
是 |
策略信息 |
| start_time |
int |
是 |
生效时间戳 |
{ "code": 0, "message": "success", "data": {}}
添加充放电策略(新)
POST /admin/charge_discharge/1/new/
| 参数 |
类型 |
必填 |
说明 |
| name |
string |
是 |
策略名称 |
| start_time |
string |
是 |
开始日期,格式如:09-01 |
| end_time |
string |
是 |
开始日期,格式如:11-01 |
| a |
json |
是 |
充电信息 |
| b |
json |
是 |
放电信息 |
| c |
json |
是 |
待机信息 |
{ "name": "xxxxxx", "configs": [ { "start_time": "09-01", "end_time": "10-01", "a": { "timer": [["01:00", "05:00"], ["05:00", "08:00"]], "power": 1.0 }, "b": { "timer": [], "power": 0 }, "c": { "timer": [], "power": 0 } } ] }
获取充放电列表(新)
GET /admin/charge_discharge/1/new/
| 参数 |
类型 |
必填 |
说明 |
| page_no |
int |
否 |
分页数:默认1 |
| page_size |
int |
否 |
数据量:默认20 |
{ "code": 0, "message": "success", "data": { "total": 1, "pages": 1, "current_page": 1, "page_size": 20, "data": [ { "_id": "5dc12a6d35731de7351f5514", "name": "xxxxxx", "configs": [ { "start_time": "09-01", "end_time": "10-01", "a": { "timer": [ [ "01:00", "05:00" ], [ "05:00", "08:00" ] ], "price": 1 }, "b": { "timer": [], "price": 0 }, "c": { "timer": [], "price": 0 } } ], "created": "2019-11-05 15:53:17" } ] }}
编辑充放电策略(新)
PUT /admin/charge_discharge/new/[_id]/
| 参数 |
类型 |
必填 |
说明 |
| name |
string |
是 |
电价策略名称 |
| start_time |
string |
是 |
开始日期,格式如:09-01 |
| end_time |
string |
是 |
开始日期,格式如:11-01 |
| a |
json |
是 |
充电信息 |
| b |
json |
是 |
放电信息 |
| c |
json |
是 |
待机信息 |
{ "name": "xxxxxx", "configs": [ { "start_time": "09-01", "end_time": "10-01", "a": { "timer": [["01:00", "05:00"], ["05:00", "08:00"]], "power": 1.0 }, "b": { "timer": [], "power": 0 }, "c": { "timer": [], "power": 0 } } ] }
{ "code": 0, "message": "success", "data": { "name": "xxxxxx", "configs": [ { "start_time": "09-01", "end_time": "10-01", "a": { "timer": [ [ "01:00", "05:00" ], [ "05:00", "08:00" ] ], "power": 1 }, "b": { "timer": [], "power": 0 }, "c": { "timer": [], "power": 0 } } ], "_id": "5dc12a6d35731de7351f5514", "created": "2019-11-05 15:53:17" }}
充放电策略详情(新)
GET /admin/charge_discharge/new/[_id]/
{ "code": 0, "message": "success", "data": { "name": "xxxxxx", "configs": [ { "start_time": "09-01", "end_time": "10-01", "a": { "timer": [ [ "01:00", "05:00" ], [ "05:00", "08:00" ] ], "power": 1 }, "b": { "timer": [], "power": 0 }, "c": { "timer": [], "power": 0 } } ], "_id": "5dc12a6d35731de7351f5514", "created": "2019-11-05 15:53:17" }}
数据统计
首页数据统计
GET /admin/dashboard/
| 参数 |
类型 |
必有 |
说明 |
| product_percent |
list |
是 |
产品占比 |
| device_status_percent |
list |
是 |
设备状态占比 |
| count |
int |
是 |
数量 |
| product_key |
string |
是 |
产品标识 |
| product_name |
string |
是 |
产品名称 |
| status |
int |
是 |
设备状态:0离线1运行2故障3检修 |
| installed_power |
int |
是 |
总装机功率 |
| installed_capacity |
int |
是 |
总装机容量 |
| yesterday_income |
int |
是 |
昨日收益 |
| this_month_income |
int |
是 |
本月收益 |
| all_income |
int |
是 |
累计收益 |
{ "code": 0, "message": "success", "data": { "product_percent": [ { "count": 2, "product_key": "eXvrimn2mr", "product_name": "小系统" } ], "device_status_percent": [ { "count": 2, "status": 0 } ], "device_attributes": { "installed_power": 110, "installed_capacity": 110 }, "device_income": { "yesterday_income": 0, "this_month_income": 0, "all_income": 0 } }}
电站效率/充放电量统计(最近N日/月的数据)
GET /admin/statistics/efficiency/
| 参数 |
类型 |
必填 |
说明 |
| category |
int |
是 |
类型:日(day)月(month) |
| size |
int |
是 |
获取的数据的数量 |
| device_key |
string |
否 |
电站标识 |
| 参数 |
类型 |
必有 |
说明 |
| DischargeEnergy |
int |
是 |
累计放电量 |
| ChargeEnergy |
int |
是 |
累计充电量 |
| efficiency |
float |
是 |
电站效率 |
| date_time |
string |
是 |
日期 |
{ "code": 0, "message": "success", "data": { "statistics": [ { "DischargeEnergy": 0, "ChargeEnergy": 0, "efficiency": 0, "date_time": "2019-10-01" }, { "DischargeEnergy": 0, "ChargeEnergy": 0, "efficiency": 0, "date_time": "2019-10-02" }, { "DischargeEnergy": 0, "ChargeEnergy": 0, "efficiency": 0, "date_time": "2019-10-03" }, { "DischargeEnergy": 0, "ChargeEnergy": 0, "efficiency": 0, "date_time": "2019-10-04" }, { "DischargeEnergy": 0, "ChargeEnergy": 0, "efficiency": 0, "date_time": "2019-10-05" }, { "DischargeEnergy": 0, "ChargeEnergy": 0, "efficiency": 0, "date_time": "2019-10-06" }, { "DischargeEnergy": 0, "ChargeEnergy": 0, "efficiency": 0, "date_time": "2019-10-07" }, { "DischargeEnergy": 0, "ChargeEnergy": 0, "efficiency": 0, "date_time": "2019-10-08" }, { "DischargeEnergy": 0, "ChargeEnergy": 0, "efficiency": 0, "date_time": "2019-10-09" } ] }}
电站效率/充放电量统计(自定义时间的数据)
GET /admin/statistics/efficiency_by_time_line/
| 参数 |
类型 |
必填 |
说明 |
| start_time |
int |
是 |
开始时间戳(单位:秒) |
| end_time |
int |
是 |
结束时间戳() |
| device_key |
string |
否 |
电站标识 |
| 参数 |
类型 |
必有 |
说明 |
| DischargeEnergy |
int |
是 |
累计放电量 |
| ChargeEnergy |
int |
是 |
累计充电量 |
| efficiency |
float |
是 |
电站效率 |
| date_time |
string |
是 |
日期 |
{ "code": 0, "message": "success", "data": { "statistics": [ { "DischargeEnergy": 0, "ChargeEnergy": 0, "efficiency": 0, "date_time": "2019-10-01" }, { "DischargeEnergy": 0, "ChargeEnergy": 0, "efficiency": 0, "date_time": "2019-10-02" }, { "DischargeEnergy": 0, "ChargeEnergy": 0, "efficiency": 0, "date_time": "2019-10-03" }, { "DischargeEnergy": 0, "ChargeEnergy": 0, "efficiency": 0, "date_time": "2019-10-04" }, { "DischargeEnergy": 0, "ChargeEnergy": 0, "efficiency": 0, "date_time": "2019-10-05" }, { "DischargeEnergy": 0, "ChargeEnergy": 0, "efficiency": 0, "date_time": "2019-10-06" }, { "DischargeEnergy": 0, "ChargeEnergy": 0, "efficiency": 0, "date_time": "2019-10-07" }, { "DischargeEnergy": 0, "ChargeEnergy": 0, "efficiency": 0, "date_time": "2019-10-08" }, { "DischargeEnergy": 0, "ChargeEnergy": 0, "efficiency": 0, "date_time": "2019-10-09" } ] }}
收益统计(最近N日/月的数据)
GET /admin/statistics/income/
| 参数 |
类型 |
必填 |
说明 |
| category |
int |
是 |
类型:日(day)月(month) |
| size |
int |
是 |
获取的数据的数量 |
| device_key |
string |
否 |
电站标识 |
| 参数 |
类型 |
必有 |
说明 |
| income |
float |
是 |
收益(单位:元) |
| date_time |
string |
是 |
日期 |
| JPIncome |
float |
是 |
尖收益(单位:元) |
| FPIncome |
float |
是 |
峰收益(单位:元) |
| PPIncome |
float |
是 |
平收益(单位:元) |
| GPIncome |
float |
是 |
谷收益(单位:元) |
{ "code": 0, "message": "success", "data": { "statistics": [ { "income": 0, 'JPIncome': 0, 'FPIncome': 0, 'PPIncome': 0, 'GPIncome': 0, "date_time": "2019-10-01" }, { "income": 0, 'JPIncome': 0, 'FPIncome': 0, 'PPIncome': 0, 'GPIncome': 0, "date_time": "2019-10-02" }, { "income": 0, 'JPIncome': 0, 'FPIncome': 0, 'PPIncome': 0, 'GPIncome': 0, "date_time": "2019-10-03" }, { "income": 0, "date_time": "2019-10-04" }, { "income": 0, "date_time": "2019-10-05" }, { "income": 0, 'JPIncome': 0, 'FPIncome': 0, 'PPIncome': 0, 'GPIncome': 0, "date_time": "2019-10-06" }, { "income": 0, "date_time": "2019-10-07" }, { "income": 0, 'JPIncome': 0, 'FPIncome': 0, 'PPIncome': 0, 'GPIncome': 0, "date_time": "2019-10-08" }, { "income": 0, 'JPIncome': 0, 'FPIncome': 0, 'PPIncome': 0, 'GPIncome': 0, "date_time": "2019-10-09" }, { "income": 0, 'JPIncome': 0, 'FPIncome': 0, 'PPIncome': 0, 'GPIncome': 0, "date_time": "2019-10-10" } ] }}
收益统计(自定义时间的数据)
GET /admin/statistics/income_by_time_line/
| 参数 |
类型 |
必填 |
说明 |
| start_time |
int |
是 |
开始时间戳(单位:秒) |
| end_time |
int |
是 |
结束时间戳() |
| device_key |
string |
否 |
电站标识 |
| 参数 |
类型 |
必有 |
说明 |
| income |
float |
是 |
收益(单位:元) |
| date_time |
string |
是 |
日期 |
| JPIncome |
float |
是 |
尖收益(单位:元) |
| FPIncome |
float |
是 |
峰收益(单位:元) |
| PPIncome |
float |
是 |
平收益(单位:元) |
| GPIncome |
float |
是 |
谷收益(单位:元) |
{ "code": 0, "message": "success", "data": { "statistics": [ { "income": 0, 'JPIncome': 0, 'FPIncome': 0, 'PPIncome': 0, 'GPIncome': 0, "date_time": "2019-10-01" }, { "income": 0, 'JPIncome': 0, 'FPIncome': 0, 'PPIncome': 0, 'GPIncome': 0, "date_time": "2019-10-02" }, { "income": 0, "date_time": "2019-10-03" }, { "income": 0, 'JPIncome': 0, 'FPIncome': 0, 'PPIncome': 0, 'GPIncome': 0, "date_time": "2019-10-04" }, { "income": 0, 'JPIncome': 0, 'FPIncome': 0, 'PPIncome': 0, 'GPIncome': 0, "date_time": "2019-10-05" }, { "income": 0, 'JPIncome': 0, 'FPIncome': 0, 'PPIncome': 0, 'GPIncome': 0, "date_time": "2019-10-06" }, { "income": 0, 'JPIncome': 0, 'FPIncome': 0, 'PPIncome': 0, 'GPIncome': 0, "date_time": "2019-10-07" }, { "income": 0, 'JPIncome': 0, 'FPIncome': 0, 'PPIncome': 0, 'GPIncome': 0, "date_time": "2019-10-08" }, { "income": 0, 'JPIncome': 0, 'FPIncome': 0, 'PPIncome': 0, 'GPIncome': 0, "date_time": "2019-10-09" }, { "income": 0, 'JPIncome': 0, 'FPIncome': 0, 'PPIncome': 0, 'GPIncome': 0, "date_time": "2019-10-10" } ] }}
电网/负荷/充放电功率曲线图(最近N日/月的数据)
GET /admin/statistics/power/chart/
| 参数 |
类型 |
必填 |
说明 |
| category |
int |
是 |
类型:日(day)月(month) |
| size |
int |
是 |
获取的数据的数量 |
| device_key |
string |
否 |
电站标识 |
| 参数 |
类型 |
必有 |
说明 |
| Pgrid |
float |
是 |
电网功率 |
| Pload |
float |
是 |
负荷功率 |
| Pdc |
float |
是 |
充放电功率 |
{ "code": 0, "message": "success", "data": { "statistics": [ { "date_time": "2019-11-01", "Pgrid": 60900, "Pload": 29877, "Pdc": 2862078 }, { "date_time": "2019-11-02", "Pgrid": 40500, "Pload": 40500, "Pdc": 28155 }, { "Pgrid": 0, "Pload": 0, "Pdc": 0, "date_time": "2019-11-03" }, { "Pgrid": 0, "Pload": 0, "Pdc": 0, "date_time": "2019-11-04" }, { "Pgrid": 0, "Pload": 0, "Pdc": 0, "date_time": "2019-11-05" }, { "date_time": "2019-11-06", "Pgrid": 0, "Pload": 0, "Pdc": 0 }, { "date_time": "2019-11-07", "Pgrid": 42450, "Pload": 7823, "Pdc": 32663 }, { "date_time": "2019-11-08", "Pgrid": 94950, "Pload": 62121, "Pdc": 32478 }, { "date_time": "2019-11-09", "Pgrid": 53550, "Pload": 19342, "Pdc": 32594 }, { "date_time": "2019-11-10", "Pgrid": 160500, "Pload": 160500, "Pdc": 232 } ] }}
电网/负荷/充放电功率曲线图(自定义时间的数据)
GET /admin/statistics/power/chart_by_time_line/
| 参数 |
类型 |
必填 |
说明 |
| start_time |
int |
是 |
开始时间戳(单位:秒) |
| end_time |
int |
是 |
结束时间戳() |
| device_key |
string |
否 |
电站标识 |
| 参数 |
类型 |
必有 |
说明 |
| Pgrid |
float |
是 |
电网功率 |
| Pload |
float |
是 |
负荷功率 |
| Pdc |
float |
是 |
充放电功率 |
{ "code": 0, "message": "success", "data": { "statistics": [ { "date_time": "2019-11-01", "Pgrid": 60900, "Pload": 29877, "Pdc": 2862078 }, { "date_time": "2019-11-02", "Pgrid": 40500, "Pload": 40500, "Pdc": 28155 }, { "Pgrid": 0, "Pload": 0, "Pdc": 0, "date_time": "2019-11-03" }, { "Pgrid": 0, "Pload": 0, "Pdc": 0, "date_time": "2019-11-04" }, { "Pgrid": 0, "Pload": 0, "Pdc": 0, "date_time": "2019-11-05" }, { "date_time": "2019-11-06", "Pgrid": 0, "Pload": 0, "Pdc": 0 }, { "date_time": "2019-11-07", "Pgrid": 42450, "Pload": 7823, "Pdc": 32663 }, { "date_time": "2019-11-08", "Pgrid": 94950, "Pload": 62121, "Pdc": 32478 }, { "date_time": "2019-11-09", "Pgrid": 53550, "Pload": 19342, "Pdc": 32594 }, { "date_time": "2019-11-10", "Pgrid": 160500, "Pload": 160500, "Pdc": 232 } ] }}
获取实时功率
GET /admin/statistics/power/
{ "code": 0, "message": "success", "data": { "power": 0 }}
获取收益电站排名
GET /admin/statistics/income_ranking/
{ "code": 0, "message": "success", "data": { "statistics": [ { "income": 0, "device_key": "5d9c34b897427bd1333638cc", "device_name": "何勤" }, { "income": 0, "device_key": "5da01b82891de0440d6c1e37", "device_name": "测试电站3" } ] }}
推送配置
获取推送配置
GET /admin/push/config/[app_id]/
| 参数 |
类型 |
必有 |
说明 |
| app_id |
string |
是 |
公司唯一标识 |
| name |
string |
是 |
姓名 |
| phone |
list |
是 |
手机号 |
| E01 |
string |
是 |
故障码 |
| des |
list |
是 |
英文描述和中文描述 |
{ "code": 0, "message": "success", "data": { "sms": [ { "name": "jerry", "phone": "18888888888" } ], "warning_codes": { "E01": { "desc": [ "DciOutRangeWarning", "DCI超出范围告警" ], "switch": true }, "E02": { "desc": [ "ConsistentWarning", "一致告警" ], "switch": false }, "E03": { "desc": [ "ConsistentGfciWarning", "GFCI永久性故障" ], "switch": false }, "E04": { "desc": [ "CurrSensorDeviceWarning", "电流传感器装置告警" ], "switch": false }, "E05": { "desc": [ "InvOverCurrWarning", "逆变过流告警" ], "switch": false }, "E06": { "desc": [ "GfciCurrWarning", "GFCI电流告警" ], "switch": false }, "E07": { "desc": [ "GfciDeviceWarning", "GFCI装置告警" ], "switch": false }, "E08": { "desc": [ "IsolationWarning", "绝缘告警" ], "switch": false }, "E09": { "desc": [ "RelayWarning", "继电器告警" ], "switch": false }, "E10": { "desc": [ "GridVoltWarning", "市电电压告警" ], "switch": false }, "E11": { "desc": [ "GridFreqWarning", "市电频率告警" ], "switch": false }, "E12": { "desc": [ "MeterAbnormalWarning", "电表异常告警" ], "switch": false }, "E13": { "desc": [ "NoUtilityWarning", "市电异常告警" ], "switch": false }, "E14": { "desc": [ "PvOverVoltWarning", "PV过压告警" ], "switch": false }, "E15": { "desc": [ "InternalComWarning", "内部通讯告警" ], "switch": false }, "E16": { "desc": [ "PvOverTempWarning", "PV过温告警" ], "switch": false }, "E17": { "desc": [ "ConsistentVoltWarning", "电压永久性故障" ], "switch": false }, "E18": { "desc": [ "ConsistentDciWarning", "DCI永久性故障" ], "switch": false }, "E20": { "desc": [ "BusSoftTimeoutWarning", "母线软启超时" ], "switch": false }, "E21": { "desc": [ "InvSoftTimeoutWarning", "逆变软启超时" ], "switch": false }, "E22": { "desc": [ "BusLowWarning", "母线电压过低告警" ], "switch": false }, "E23": { "desc": [ "BusHighWarning", "母线电压过高告警" ], "switch": false }, "E24": { "desc": [ "ConsistentFreqWarning", "频率永久性故障" ], "switch": false }, "E25": { "desc": [ "PvBoostOverCurrWarning", "PV侧升压过流告警" ], "switch": false }, "E26": { "desc": [ "BatOverVoltWarning", "电池过压告警" ], "switch": false }, "E28": { "desc": [ "BatBoostOverCurrWarning", "电池侧升压过流告警" ], "switch": false }, "E29": { "desc": [ "PvFanLockWarning", "PV风扇锁告警" ], "switch": false }, "E30": { "desc": [ "BatFanLockWarning", "电池风扇锁告警" ], "switch": false }, "E31": { "desc": [ "Reserved", "预留" ], "switch": false }, "E32": { "desc": [ "Reserved", "预留" ], "switch": false }, "E33": { "desc": [ "Reserved", "预留" ], "switch": false }, "E34": { "desc": [ "Reserved", "预留" ], "switch": false }, "E35": { "desc": [ "Reserved", "预留" ], "switch": false }, "E36": { "desc": [ "Reserved", "预留" ], "switch": false }, "E37": { "desc": [ "Reserved", "预留" ], "switch": false }, "E38": { "desc": [ "Reserved", "预留" ], "switch": false }, "E39": { "desc": [ "Reserved", "预留" ], "switch": false }, "E40": { "desc": [ "Reserved", "预留" ], "switch": false }, "E41": { "desc": [ "BatcommunicationFailure", "电池侧通讯故障" ], "switch": false }, "E42": { "desc": [ "MetercommunicationFailure", "电表通讯故障" ], "switch": false }, "E43": { "desc": [ "BMScommunication failure", "电池bms通讯故障" ], "switch": false }, "E44": { "desc": [ "Reserved", "预留" ], "switch": false }, "E45": { "desc": [ "TotalOverVolFirstFault", "总压过压一级故障" ], "switch": false }, "E46": { "desc": [ "TotalOverVolSecondFault", "总压过压二级故障" ], "switch": false }, "E47": { "desc": [ "TotalOverVolThirdFault", "总压过压三级故障" ], "switch": false }, "E48": { "desc": [ "TotalUnderVolFirstFault", "总压欠压一级故障" ], "switch": false }, "E49": { "desc": [ "TotalUnderVolSecondFault", "总压欠压二级故障" ], "switch": false }, "E50": { "desc": [ "TotalUnderVolThirdFault", "总压欠压三级故障" ], "switch": false }, "E51": { "desc": [ "DischargeOverCurFirstFault", "放电过流一级故障" ], "switch": false }, "E52": { "desc": [ "DischargeOverCurSecondFault", "放电过流二级故障" ], "switch": false }, "E53": { "desc": [ "DischargeOverCurThirdFault", "放电过流三级故障" ], "switch": false }, "E54": { "desc": [ "ChargeOverCurFirstFault", "充电过流一级故障" ], "switch": false }, "E55": { "desc": [ "ChargeOverCurSecondFault", "充电过流二级故障" ], "switch": false }, "E56": { "desc": [ "ChargeOverCurThirdFault", "充电过流三级故障" ], "switch": false }, "E57": { "desc": [ "CellOverVolFirstFault", "单体过压一级故障" ], "switch": false }, "E58": { "desc": [ "CellOverVolSecondFault", "单体过压二级故障" ], "switch": false }, "E59": { "desc": [ "CellOverVolThirdFault", "单体过压三级故障" ], "switch": false }, "E60": { "desc": [ "CellUnderVolFirstFault", "单体欠压一级故障" ], "switch": false }, "E61": { "desc": [ "CellUnderVolSecondFault", "单体欠压二级故障" ], "switch": false }, "E62": { "desc": [ "CellUnderVolThirdFault", "单体欠压三级故障" ], "switch": false }, "E63": { "desc": [ "CellDifferFirstFault", "压差过大一级故障" ], "switch": false }, "E64": { "desc": [ "CellDifferSecondFault", "压差过大二级故障" ], "switch": false }, "E65": { "desc": [ "CellDifferThirdFault", "压差过大三级故障" ], "switch": false }, "E66": { "desc": [ "TempHighFirstFault", "温度过高一级故障" ], "switch": false }, "E67": { "desc": [ "TempHighSecondFault", "温度过高二级故障" ], "switch": false }, "E68": { "desc": [ "TempHighThirdFault", "温度过高三级故障" ], "switch": false }, "E69": { "desc": [ "TempLowFirstFault", "温度过低一级故障" ], "switch": false }, "E70": { "desc": [ "TempLowSecondFault", "温度过低二级故障" ], "switch": false }, "E71": { "desc": [ "TempLowThirdFault", "温度过低三级故障" ], "switch": false }, "E72": { "desc": [ "TempDifferFirstFault", "温差过大一级故障" ], "switch": false }, "E73": { "desc": [ "TempDifferSecondFault", "温差过大二级故障" ], "switch": false }, "E74": { "desc": [ "TempDifferThirdFault", "温差过大三级故障" ], "switch": false }, "E75": { "desc": [ "SOCLowFirstFault", "SOC过低一级故障" ], "switch": false }, "E76": { "desc": [ "SOCLowSecondFault", "SOC过低二级故障" ], "switch": false }, "E77": { "desc": [ "SOCLowThirdFault", "SOC过低三级故障" ], "switch": false }, "E78": { "desc": [ "InsulationLowFirstFault", "绝缘过低一级故障" ], "switch": false }, "E79": { "desc": [ "InsulationLowSecondFault", "绝缘过低二级故障" ], "switch": false }, "E80": { "desc": [ "InsulationLowThirdFault", "绝缘过低三级故障" ], "switch": false }, "E81": { "desc": [ "CurCollFirstFault", "电流采集一级故障" ], "switch": false }, "E82": { "desc": [ "CurCollSecondFault", "电流采集二级故障" ], "switch": false }, "E83": { "desc": [ "CurCollThirdFault", "电流采集三级故障" ], "switch": false }, "E84": { "desc": [ "TotalVolCollFirstFault", "总压采集一级故障" ], "switch": false }, "E85": { "desc": [ "TotalVolCollSecondFault", "总压采集二级故障" ], "switch": false }, "E86": { "desc": [ "TotalVolCollThirdFault", "总压采集三级故障" ], "switch": false }, "E87": { "desc": [ "CellVolCollFirstFault", "单体电压采集一级故障" ], "switch": false }, "E88": { "desc": [ "CellVolCollSecondFault", "单体电压采集二级故障" ], "switch": false }, "E89": { "desc": [ "CellVolCollThirdFault", "单体电压采集三级故障" ], "switch": false }, "E90": { "desc": [ "TempCollFirstFault", "电池温度采集一级故障" ], "switch": false }, "E91": { "desc": [ "TempCollSecondFault", "电池温度采集二级故障" ], "switch": false }, "E92": { "desc": [ "TempCollThirdFault", "电池温度采集三级故障" ], "switch": false }, "E93": { "desc": [ "TotalPositiveRelayStuckFault", "总正继电器粘连故障" ], "switch": false }, "E94": { "desc": [ "TotalPositiveRelayOpenCircuitFault", "总正继电器断路故障" ], "switch": false }, "E95": { "desc": [ "TotalNegativeRelayStuckFault", "总负继电器粘连故障" ], "switch": false }, "E96": { "desc": [ "TotalNegativeRelayOpenCircuitFault", "总负继电器断路故障" ], "switch": false }, "E97": { "desc": [ "InternalCommunicationFault", "内部通讯故障" ], "switch": false }, "E98": { "desc": [ "SmokeAlarm", "烟感报警" ], "switch": false }, "E99": { "desc": [ "SmokeAlarmCommunicationFault", "烟感报警器通讯故障" ], "switch": false }, "E100": { "desc": [ "MeteringMeterCommunicationFault", "计量电表通讯故障" ], "switch": false }, "E101": { "desc": [ "ComDspCommunicationFault", "通讯板和逆变器通讯故障" ], "switch": false }, "E102": { "desc": [ "Reserved", "预留" ], "switch": false }, "E103": { "desc": [ "Reserved", "预留" ], "switch": false }, "E104": { "desc": [ "Reserved", "预留" ], "switch": false }, "E105": { "desc": [ "Reserved", "预留" ], "switch": false }, "E106": { "desc": [ "Reserved", "预留" ], "switch": false }, "E107": { "desc": [ "Reserved", "预留" ], "switch": false }, "E108": { "desc": [ "Reserved", "预留" ], "switch": false }, "E109": { "desc": [ "Reserved", "预留" ], "switch": false }, "E110": { "desc": [ "Reserved", "预留" ], "switch": false } } }}
推送配置
PUT /admin/push/config/[app_id]/
| 参数 |
类型 |
必有 |
说明 |
| app_id |
string |
是 |
公司唯一标识 |
| sms |
list |
是 |
姓名和手机号 |
| warning_codes |
list |
是 |
设置开启的故障码 |
{ "sms": [ {"name": "jerry", "phone": "18888888888"} ], "warning_codes": ["E01", "E01"]}
{ "code": 0, "message": "success", "data": {}}
调度管理
调度使能列表
GET /admin/dispatch/
{ "code": 0, "message": "success", "data": {}}
添加调度使能
POST /admin/dispatch/
| 参数 |
类型 |
必有 |
说明 |
| device_key |
string |
是 |
设备唯一标识 |
| power |
int |
是 |
功率 |
{ "code": 0, "message": "success", "data": {}}
添加调度使能
PUT /admin/dispatch/[device_key]/
| 参数 |
类型 |
必有 |
说明 |
| device_key |
string |
是 |
设备唯一标识 |
| power |
int |
是 |
功率 |
{ "code": 0, "message": "success", "data": {}}
删除调度使能
DELETE /admin/dispatch/[device_key]/
{ "code": 0, "message": "success", "data": {}}
数据报表
逆变器数据列表
GET /admin/report/form/[device_key]/
| 参数 |
类型 |
必有 |
说明 |
| device_key |
string |
是 |
设备唯一标识 |
| category |
string |
否 |
类型:month , day |
| start_time |
int |
否 |
开始时间戳,单位:秒 |
{ "code": 0, "message": "success", "data": { "total": 2, "pages": 1, "current_page": 1, "page_size": 20, "data": [{ "DC1Voltage": 0, "DC1Current": 0, "DC2Voltage": 0, "DC2Current": 0, "IRgrid": 0, "ISgrid": 0, "ITgrid": 0, "VRgrid": 0, "VSgrid": 0, "VTgrid": 0, "Pdc": 0, "Pgrid": 0, "TodayChargeEnergy": 3.0, "TChgEnergy": 3.0, "FedGridEnergy": 0, "SupplyGridEnergy": 0, "SOC": 0, "CellvolHighest": 0, "CellvolLowest": 0, "CelltempHighest": 0, "CelltempLowest": 0, "updated": "2019-10-27 15:03:43" }, { "DC1Voltage": 0, "DC1Current": 0, "DC2Voltage": 0, "DC2Current": 0, "IRgrid": 0, "ISgrid": 0, "ITgrid": 0, "VRgrid": 0, "VSgrid": 0, "VTgrid": 0, "Pdc": 0, "Pgrid": 0, "TodayChargeEnergy": 3.0, "TChgEnergy": 3.0, "FedGridEnergy": 0, "SupplyGridEnergy": 0, "SOC": 0, "CellvolHighest": 0, "CellvolLowest": 0, "CelltempHighest": 0, "CelltempLowest": 0, "updated": "2019-10-27 15:03:14" }] }}
逆变器数据CSV下载文件地址
GET /admin/report/form/csv/[device_key]/
| 参数 |
类型 |
必有 |
说明 |
| device_key |
string |
是 |
设备唯一标识 |
| category |
string |
否 |
类型:month , day |
| start_time |
int |
否 |
开始时间戳,单位:秒 |
{ "code": 0, "message": "success", "data": { "path": "http://47.101.71.76/public/csv/20191028120050556134.csv" }}
单体电压数据CSV下载文件地址
GET /admin/report/form/cell_vol/csv/[device_key]/
| 参数 |
类型 |
必有 |
说明 |
| device_key |
string |
是 |
设备唯一标识 |
| category |
string |
否 |
类型:month , day |
| start_time |
int |
否 |
开始时间戳,单位:秒 |
{ "code": 0, "message": "success", "data": { "path": "http://47.101.71.76/public/csv/20191028120050556134.csv" }}
单体温度数据CSV下载文件地址
GET /admin/report/form/cell_temp/csv/[device_key]/
| 参数 |
类型 |
必有 |
说明 |
| device_key |
string |
是 |
设备唯一标识 |
| category |
string |
否 |
类型:month , day |
| start_time |
int |
否 |
开始时间戳,单位:秒 |
{ "code": 0, "message": "success", "data": { "path": "http://47.101.71.76/public/csv/20191028120050556134.csv" }}
运营分析数据列表
GET /admin/report/form/operate/[device_key]/
| 参数 |
类型 |
必有 |
说明 |
| device_key |
string |
是 |
设备唯一标识 |
| category |
string |
否 |
类型:month , day |
| start_time |
int |
否 |
开始时间戳,单位:秒 |
| 参数 |
类型 |
必有 |
说明 |
| DischargeEnergy |
int |
是 |
累计放电量 |
| ChargeEnergy |
int |
是 |
累计充电量 |
| efficiency |
float |
是 |
电站效率 |
| income |
float |
是 |
电站收益 |
| date_time |
string |
是 |
日期 |
{ "code": 0, "message": "success", "data": { "total": 30, "pages": 2, "current_page": 1, "page_size": 20, "data": [ { "income": 0, "date_time": "2019-10-05", "DischargeEnergy": 0, "ChargeEnergy": 0, "efficiency": 0 }, { "income": 0, "date_time": "2019-10-06", "DischargeEnergy": 0, "ChargeEnergy": 0, "efficiency": 0 }, { "income": 0, "date_time": "2019-10-07", "DischargeEnergy": 0, "ChargeEnergy": 0, "efficiency": 0 }, { "income": 0, "date_time": "2019-10-08", "DischargeEnergy": 0, "ChargeEnergy": 0, "efficiency": 0 }, { "income": 0, "date_time": "2019-10-09", "DischargeEnergy": 0, "ChargeEnergy": 0, "efficiency": 0 }, { "income": 0, "date_time": "2019-10-10", "DischargeEnergy": 0, "ChargeEnergy": 0, "efficiency": 0 }, { "income": 0, "date_time": "2019-10-11", "DischargeEnergy": 0, "ChargeEnergy": 0, "efficiency": 0 }, { "income": 0, "date_time": "2019-10-12", "DischargeEnergy": 0, "ChargeEnergy": 0, "efficiency": 0 }, { "income": 0, "date_time": "2019-10-13", "DischargeEnergy": 0, "ChargeEnergy": 0, "efficiency": 0 }, { "income": 0, "date_time": "2019-10-14", "DischargeEnergy": 0, "ChargeEnergy": 0, "efficiency": 0 }, { "income": 0, "date_time": "2019-10-15", "DischargeEnergy": 0, "ChargeEnergy": 0, "efficiency": 0 }, { "income": 0, "date_time": "2019-10-16", "DischargeEnergy": 0, "ChargeEnergy": 0, "efficiency": 0 }, { "income": 0, "date_time": "2019-10-17", "DischargeEnergy": 0, "ChargeEnergy": 0, "efficiency": 0 }, { "income": 0, "date_time": "2019-10-18", "DischargeEnergy": 0, "ChargeEnergy": 0, "efficiency": 0 }, { "income": 0, "date_time": "2019-10-19", "DischargeEnergy": 0, "ChargeEnergy": 0, "efficiency": 0 }, { "income": 0, "date_time": "2019-10-20", "DischargeEnergy": 0, "ChargeEnergy": 0, "efficiency": 0 }, { "income": 0, "date_time": "2019-10-21", "DischargeEnergy": 0, "ChargeEnergy": 0, "efficiency": 0 }, { "income": 0, "date_time": "2019-10-22", "DischargeEnergy": 0, "ChargeEnergy": 0, "efficiency": 0 }, { "income": 0, "date_time": "2019-10-23", "DischargeEnergy": 0, "ChargeEnergy": 0, "efficiency": 0 }, { "income": 0, "date_time": "2019-10-24", "DischargeEnergy": 0, "ChargeEnergy": 0, "efficiency": 0 } ] }}
运营分析数据CSV下载文件地址
GET /admin/report/form/operate/csv/[device_key]/
| 参数 |
类型 |
必有 |
说明 |
| device_key |
string |
是 |
设备唯一标识 |
| category |
string |
否 |
类型:month , day |
| start_time |
int |
否 |
开始时间戳,单位:秒 |
{ "code": 0, "message": "success", "data": { "path": "http://47.101.71.76/public/csv/20191103094735234816.csv" }}
电池运维簇列表
GET /admin/report/form/cluster/[device_key]/
| 参数 |
类型 |
必有 |
说明 |
| device_key |
string |
是 |
设备唯一标识 |
{ "code": 0, "message": "success", "data": { "cluster": [ { "key": 1, "name": "第1簇" } ] }}
电池运维数据列表和图标数据
GET /admin/report/form/cell/[device_key]/
| 参数 |
类型 |
必有 |
说明 |
| device_key |
string |
是 |
设备唯一标识 |
| cluster |
int |
是 |
电池簇对应的 key |
| time1 |
int |
是 |
时间点(一) |
| time2 |
int |
是 |
时间点(二) |
{ "code": 0, "message": "success", "data": { "headers": [ { "0": "" }, { "1": "pack1" }, { "2": "pack2" } ], "data": [ [ { "0": 1, "1": 0, "2": 0 }, { "0": 2, "1": 0, "2": 0 }, { "0": "max", "1": 0, "2": 0 }, { "0": "min", "1": 0, "2": 0 }, { "0": "avg", "1": 0, "2": 0 } ], [ { "0": 1, "1": 0, "2": 0 }, { "0": 2, "1": 0, "2": 0 }, { "0": "max", "1": 0, "2": 0 }, { "0": "min", "1": 0, "2": 0 }, { "0": "avg", "1": 0, "2": 0 } ] ], "chart": [ [ { "pack": 1, "max": 0, "min": 0, "avg": 0 }, { "pack": 2, "max": 0, "min": 0, "avg": 0 } ], [ { "pack": 1, "max": 0, "min": 0, "avg": 0 }, { "pack": 2, "max": 0, "min": 0, "avg": 0 } ] ] }}
电池运维数据CSV下载文件地址
GET /admin/report/form/cell/csv/[device_key]/
| 参数 |
类型 |
必有 |
说明 |
| device_key |
string |
是 |
设备唯一标识 |
| cluster |
int |
是 |
电池簇对应的 key |
| time1 |
int |
是 |
时间点(一) |
| time2 |
int |
是 |
时间点(二) |
{ "code": 0, "message": "success", "data": { "path": "http://47.101.71.76/public/csv/20191103112924299922.csv" }}
历史数据导出
GET /admin/history/attributes/export/
| 参数 |
类型 |
必填 |
说明 |
| start_time |
int |
是 |
开始时间戳(单位:秒) |
| end_time |
int |
是 |
结束时间戳(单位:秒) |
| device_key |
string |
是 |
电站标识 |
| param_1 |
string |
否 |
电站属性 |
| param_2 |
string |
否 |
电站属性 |
{ "code": 0, "message": "success", "data": { "path": "http://47.101.71.76/public/csv/20191103112924299922.csv" }}
集装箱电站ips
GET /admin/device/ips/[device_key]/
| 参数 |
类型 |
必填 |
说明 |
| device_key |
string |
是 |
电站标识 |
{ "code": 0, "message": "success", "data": { "ips": [] }}
文件上传
文件上传
POST /admin/upload/
| 参数 |
类型 |
必填 |
说明 |
| file_name |
文件 |
是 |
文件名称 |
{ "code": 0, "message": "success", "data": { "file_path": "http://127.0.0.1/logo.png" }}