#打包 ##打云环境运行包 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 # 使用chrome的postman插件模拟发送post方法。 # 空间操作 * **查询** 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" } } } } } * **更新** criteria中要写出严格的筛选条件,能够定位到唯一的一条数据。更新时会将原来的数据清除,然后放入set的内容。set中写入需要更新的数据和保持不变的数据。 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#" } } # project操作 * 创建 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 } } } } * update 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 } } } } } * delete 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" } } } } * update 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" } } } } } * delete 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" } } } } * update 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" } } ## 设备服务空间 * **插入**(serve) 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=变配电系统