来自于data-platform的v3.1分支,2020,12.10日的commit。新增了按点位进行控制指令下发和查询的接口
zhangtong 263bc0e85c startup log upgrade | 2 jaren geleden | |
---|---|---|
dict | 3 jaren geleden | |
doc | 3 jaren geleden | |
src | 2 jaren geleden | |
.gitignore | 3 jaren geleden | |
README.md | 3 jaren geleden | |
pom.xml | 3 jaren geleden |
#打包 ##打云环境运行包
mvn package -Pprod
##打测试环境运行包
mvn package
##运行环境设置
1启动消息中间件(ActiveMq或RrabbitMq),并在config.properties中配置好;
2配置好config.properties中的数据字典源dict.source,配置好所使用的数据类型relationDb.use;
3根据config.properties中的relationDb.use配置好hbase-site.xml
#清缓存 GET方法
http://localhost:8080/data-platform/mng/clear_cache?secret=A123456
criteria内容可为空,查询全部数据。必须要有前一级筛选条件,才能填写下一集筛选条件,例如:填写space_id时必须要有building_id和floor_id
http://localhost:8080/data-platform/space/query?projectId=1101080001&secret=123
post体例子:
{
"criteria":{
"building_id": "1101080001",
"floor_id": "1",
"space_id": "101"
}
}
json中必须要有project_id、building_id、floor_id、space_id、json_data
infos的内容可任意添加
http://localhost:8080/data-platform/space/create?projectId=1101080001&secret=123
post体例子:
{
"building_id":"1101080001",
"floor_id":"0",
"space_id":"301",
"infos":{
"总体信息":{
"面积":119.4,
"空间功能区类型":323
},
"环境参数":{
"空气质量":{
"空气VOC浓度":"1007-9005",
"空气PM2.5浓度":"7206-451"
}
}
}
}
criteria中要写出严格的筛选条件,能够定位到唯一的一条数据。
http://localhost:8080/data-platform/space/update?projectId=1101080001&secret=A123456
post体例子:
{
"criteria":{
"floor_id":"3",
"building_id":"2#",
"space_id":"301"
},
"set":{
"infos":{
"总体信息":{
"面积":119.4,
"空间功能区类型":323
},
"环境参数":{
"空气质量":{
"空气VOC浓度":"1007-9005",
"空气PM2.5浓度":"7206-451"
}
}
}
}
}
所有内容均为必填,只能删除指定的一条数据
http://localhost:8080/data-platform/space/delete?projectId=1101080001&secret=123 post体例子:
{
"criteria":{
"floor_id":"3",
"building_id":"2#",
"space_id":"301"
}
}
筛选条件的最后一项只能按equipment_id 或者 equipment_category 来查询,不能同时填写两项。 criteria内容可为空,查询全部数据。
http://localhost:8080/data-platform/equipment/query?projectId=1101080001&secret=123
post体例子:
{
"criteria":{
"building_id": "1101080001",
"equipment_id": "eq10262"
}
}
或者
{
"criteria":{
"building_id": "1101080001",
"equipment_category": "空调机组"
}
}
http://localhost:8080/data-platform/equipment/create?projectId=1101080001&secret=123
post体例子:
{
"equipment_parent_category":"空调专业系统",
"equipment_category":"中央供冷系统", // sheet Name
"equipment_id":"3#",
"project_id":"1101080001",
"building_id":"1101080001",
"floor_id":"0",
"space_id":"301",
"infos":{
"名称":"中央供冷系统3#",
"控制参数":{
"冷冻泵控制模式":"变频控制",
"冷却泵控制模式":"变频控制"
}
"运行参数":{
"运行状态":{
"运行状态":{
"meter":"8918"
"func-id":"63001062"
}
}
}
}
}
http://localhost:8080/data-platform/equipment/update?projectId=1101080001&secret=123
post体例子:
{
"criteria":{
"equipment_parent_category":"空调专业系统",
"equipment_category":"中央供冷系统",
"equipment_id":"1101080001",
},
"set":{
"infos":{
"名称":"中央供热系统",
"控制参数":{
"冷冻泵控制模式":"变频控制",
"冷却泵控制模式":"变频控制"
}
}
}
}
http://localhost:8080/data-platform/equipment/delete?projectId=1101080001&secret=123
post体例子:
{
"criteria":{
"equipment_parent_category":"空调专业系统",
"equipment_category":"中央供冷系统",
"equipment_id":"3#"
}
}
http://localhost:8080/data-platform/mng/project/create?secret=A123456
{
"project_id":"1101080001",
"password":"A123456",
"infos": {
"名称": "项目1101080001",
"项目名称": "广联达二期",
"地理位置": {
"省份": "11",
"城市": "110108",
"城市发展水平": "1110"
},
"当前室外环境": {
"空气(干球)温度": {
"meter": "8003",
"func-id": 111001
},
"空气相对湿度": {
"meter": "8003",
"func-id": 112001
}
}
}
}
http://localhost:8080/data-platform/mng/project/update?secret=A123456
{
"criteria":{
"project_id":"1101080001"
},
"set":{
"infos": {
"名称": "项目1101080001",
"项目名称": "广联达二期",
"地理位置": {
"省份": "11",
"城市": "110108",
"城市发展水平": "1110"
},
"当前室外环境": {
"空气(干球)温度": {
"meter": "8003",
"func-id": 111001
},
"空气相对湿度": {
"meter": "8003",
"func-id": 112001
}
}
}
}
}
http://localhost:8080/data-platform/mng/project/delete?secret=A123456
{
"criteria":{
"project_id":"1101080001"
}
}
#building 操作
http://localhost:8080/data-platform/mng/building/create?secret=A123456 post体例子:
{
"project_id":"1#",
"building_id":"1#", //building_id可选,如果不给,系统会自动生成
"infos":{
"总体信息":{
"面积":119.4,
"空间功能区类型":323
},
"环境参数":{
"空气质量":{
"空气VOC浓度":"1007-9005",
"空气PM2.5浓度":"7206-451"
}
}
}
}
http://localhost:8080/data-platform/mng/project/update?secret=A123456
{
"criteria":{
"project_id":"1101080001",
"building_id":"1#"
},
"set":{
"infos":{
"总体信息":{
"面积":119.4,
"空间功能区类型":323
},
"环境参数":{
"空气质量":{
"空气VOC浓度":"1007-9005",
"空气PM2.5浓度":"7206-451"
}
}
}
}
}
http://localhost:8080/data-platform/mng/project/delete?secret=A123456
{
"criteria":{
"project_id":"1101080001",
"building_id":"1#"
}
}
#floor操作
http://localhost:8080/data-platform/floor/create?projectId=1101080001&secret=123 post体例子:
{
"project_id":"1#",
"building_id":"1",
"floor_id":"1", //floor_id可选,如果不给,系统会自动生成
"infos":{
"总体信息":{
"面积":119.4,
"空间功能区类型":323
},
"环境参数":{
"空气质量":{
"空气VOC浓度":"1007-9005",
"空气PM2.5浓度":"7206-451"
}
}
}
}
http://localhost:8080/data-platform/floor/update?projectId=1101080001&secret=A123456
{
"criteria":{
"building_id":"1#",
"floor_id":"1"
},
"set":{
"infos":{
"总体信息":{
"面积":119.4,
"空间功能区类型":323
},
"环境参数":{
"空气质量":{
"空气VOC浓度":"1007-9005",
"空气PM2.5浓度":"7206-451"
}
}
}
}
}
delete http://localhost:8080/data-platform/floor/delete?projectId=1101080001&secret=A123456
{
"criteria":{
"building_id":"1#",
"floor_id":"1"
}
}
http://localhost:8080/data-platform/relation/create?projectId=1101080001&secret=A123456
post例子:
{
"project_id":"1101080001",
"relation_id":4,
"relation_name":"name",
"bidirectional":true,
"relation_desc":"abcd"
}
criteria内容为空时,查询所有数据
http://localhost:8080/data-platform/relation/query?projectId=1101080001&secret=123
post例子:
{
"criteria":{
"project_id":"1101080001",
"relation_id":4
}
}
当relation_id被设备间关系表引用时,不能删除 http://localhost:8080/data-platform/relation/delete?projectId=1101080001&secret=123
post例子:
{
"criteria":{
"project_id":"1101080001",
"relation_id":4
}
}
http://localhost:8080/data-platform/relation/update?projectId=1101080001&secret=123
post例子:
{
"criteria":{
"project_id":"1101080001",
"relation_id":4
}
"set":{
//需要更新的数据
}
}
}
http://localhost:8080/data-platform/equipment/create_relation?projectId=1101080001&secret=123
post例子:
{
"project_id":"1101080001",
"building_id":"bd1",
"equipment_id":"eq1",
"relation_id":4,
"to_building_id":"bd1",
"to_equipment_id":"eq2"
}
http://localhost:8080/data-platform/equipment/query_relation?projectId=1101080001&secret=123 post例子:
{
"criteria":{}
}
可指定具体的一条数据
http://localhost:8080/data-platform/equipment/delete_relation?projectId=1101080001&secret=123
post例子:
{
"criteria":{}
}
必须包含例子中的所有信息
http://localhost:8080/data-platform/equipment/put_to?projectId=1101080001&secret=123
post例子:
{
"project_id":"1101080001",
"building_id":"bd1",
"floor_id":"1",
"space_id":"102",
"equipment_id":"eq1"
}
筛选条件可以从最下一条依次省略。例如:筛选条件设置为project_id,building_id,floor_id,可以查询该楼层的所有记录,不可省略floor_id之前的条件。
http://localhost:8080/data-platform/equipment/where?projectId=1101080001&secret=123
post例子:
{
"criteria":{
"project_id":"1101080001",
"building_id":"bd1",
"floor_id":"1",
"space_id":"102",
"equipment_id":"eq1"
}
}
筛选条件的要求同查询
http://localhost:8080/data-platform/equipment/delete_eq_from_sp?projectId=1101080001&secret=123
{
"criteria":{
"project_id":"1101080001",
"building_id":"bd1",
"floor_id":"1",
"space_id":"102",
"equipment_id":"eq1"
}
}
http://localhost:8080/data-platform/equipment/serve?projectId=1101080001&secret=123
post例子:
{
"project_id":"1101080001",
"building_id":"bd1",
"equipment_id":"eq1",
"floor_id":"1",
"space_id":"102"
}
http://localhost:8080/data-platform/equipment/where_to_serve?projectId=1101080001&secret=123
post例子:
{
"criteria":{}
}
http://localhost:8080/data-platform/equipment/delete_serve?projectId=1101080001&secret=123
post例子:
{
"criteria":{}
}
以下全为GET方法
http://localhost:8080/data-platform/dict/equipment_all
http://localhost:8080/data-platform/dict/equipment_domain
http://localhost:8080/data-platform/dict/equipment_system?domain=强电专业
http://localhost:8080/data-platform/dict/equipment_category?system=变配电系统