|
@@ -1,10 +1,7 @@
|
|
|
package com.usky.ems.controller.web;
|
|
package com.usky.ems.controller.web;
|
|
|
|
|
|
|
|
import com.usky.common.core.bean.ApiResult;
|
|
import com.usky.common.core.bean.ApiResult;
|
|
|
-import com.usky.common.core.bean.CommonPage;
|
|
|
|
|
-import com.usky.ems.service.EmsGatewayQueryService;
|
|
|
|
|
import com.usky.ems.service.EmsModelService;
|
|
import com.usky.ems.service.EmsModelService;
|
|
|
-import com.usky.ems.service.EmsOverviewService;
|
|
|
|
|
import com.usky.ems.service.vo.*;
|
|
import com.usky.ems.service.vo.*;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
@@ -12,64 +9,15 @@ import org.springframework.web.bind.annotation.*;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * 能源能耗系统 API
|
|
|
|
|
- *
|
|
|
|
|
- * 对应 API 文档基础路径:/prod-api/service-ems
|
|
|
|
|
- * GET /prod-api/service-ems/overview/project 获取项目信息
|
|
|
|
|
- * GET /prod-api/service-ems/overview/summary 获取项目数据概括
|
|
|
|
|
- * GET /prod-api/service-ems/model/structure/tree 获取项目层级树
|
|
|
|
|
- * GET /prod-api/service-ems/model/energy-type/list 能源类型列表
|
|
|
|
|
- * POST /prod-api/service-ems/model/building 新增建筑
|
|
|
|
|
- * PUT /prod-api/service-ems/model/building/{id} 编辑建筑
|
|
|
|
|
- * DELETE /prod-api/service-ems/model/building/{id} 删除建筑
|
|
|
|
|
- * POST /prod-api/service-ems/model/region 新增区域
|
|
|
|
|
- * PUT /prod-api/service-ems/model/region/{id} 编辑区域
|
|
|
|
|
- * DELETE /prod-api/service-ems/model/region/{id} 删除区域
|
|
|
|
|
- * POST /prod-api/service-ems/model/floor 新增楼层
|
|
|
|
|
- * PUT /prod-api/service-ems/model/floor/{id} 编辑楼层
|
|
|
|
|
- * DELETE /prod-api/service-ems/model/floor/{id} 删除楼层
|
|
|
|
|
- * POST /prod-api/service-ems/model/gateway 新增网关
|
|
|
|
|
- * PUT /prod-api/service-ems/model/gateway/{id} 编辑网关
|
|
|
|
|
- * DELETE /prod-api/service-ems/model/gateway/{id} 删除网关
|
|
|
|
|
- * POST /prod-api/service-ems/model/channel 新增通道
|
|
|
|
|
- * PUT /prod-api/service-ems/model/channel/{id} 编辑通道
|
|
|
|
|
- * DELETE /prod-api/service-ems/model/channel/{id} 删除通道
|
|
|
|
|
- * POST /prod-api/service-ems/model/device 新增设备
|
|
|
|
|
- * PUT /prod-api/service-ems/model/device/{id} 编辑设备
|
|
|
|
|
- * DELETE /prod-api/service-ems/model/device/{id} 删除设备
|
|
|
|
|
- * POST /prod-api/service-ems/model/attribute-point 新增属性点位
|
|
|
|
|
- * PUT /prod-api/service-ems/model/attribute-point/{id} 编辑属性点位
|
|
|
|
|
- * DELETE /prod-api/service-ems/model/attribute-point/{id} 删除属性点位
|
|
|
|
|
- * GET /prod-api/service-ems/device/gateway/list 网关列表(分页)
|
|
|
|
|
- * GET /prod-api/service-ems/device/gateway/{id} 网关详情
|
|
|
|
|
|
|
+ * 能源能耗 - 模型/结构模块 API(项目层级树、能源类型、建筑/区域/楼层/网关/通道/设备/属性点位 CRUD)
|
|
|
|
|
+ * 基础路径:/prod-api/service-ems
|
|
|
*/
|
|
*/
|
|
|
@RestController
|
|
@RestController
|
|
|
@RequestMapping("/prod-api/service-ems")
|
|
@RequestMapping("/prod-api/service-ems")
|
|
|
-public class EmsApiV1Controller {
|
|
|
|
|
|
|
+public class EmsModelController {
|
|
|
|
|
|
|
|
- @Autowired
|
|
|
|
|
- private EmsOverviewService emsOverviewService;
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private EmsModelService emsModelService;
|
|
private EmsModelService emsModelService;
|
|
|
- @Autowired
|
|
|
|
|
- private EmsGatewayQueryService emsGatewayQueryService;
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * 获取项目信息
|
|
|
|
|
- */
|
|
|
|
|
- @GetMapping("/overview/project")
|
|
|
|
|
- public ApiResult<EmsProjectResponse> getProject(@RequestParam(required = false) Long projectId) {
|
|
|
|
|
- return ApiResult.success(emsOverviewService.getProject(projectId));
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * 获取项目数据概括(时间维度联动)
|
|
|
|
|
- */
|
|
|
|
|
- @GetMapping("/overview/summary")
|
|
|
|
|
- public ApiResult<EmsSummaryResponse> getSummary(EmsSummaryRequest request) {
|
|
|
|
|
- return ApiResult.success(emsOverviewService.getSummary(
|
|
|
|
|
- request.getProjectId(), request.getTimeDimension(), request.getTimeValue()));
|
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 获取项目层级树(建筑、区域、楼层、网关)
|
|
* 获取项目层级树(建筑、区域、楼层、网关)
|
|
@@ -214,20 +162,4 @@ public class EmsApiV1Controller {
|
|
|
emsModelService.deleteAttributePoint(id);
|
|
emsModelService.deleteAttributePoint(id);
|
|
|
return ApiResult.success();
|
|
return ApiResult.success();
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * 网关列表(分页)
|
|
|
|
|
- */
|
|
|
|
|
- @GetMapping("/device/gateway/list")
|
|
|
|
|
- public ApiResult<CommonPage<EmsGatewayListItem>> gatewayList(EmsGatewayPageRequest request) {
|
|
|
|
|
- return ApiResult.success(emsGatewayQueryService.listGateways(request));
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * 网关详情
|
|
|
|
|
- */
|
|
|
|
|
- @GetMapping("/device/gateway/{id}")
|
|
|
|
|
- public ApiResult<EmsGatewayDetailResponse> getGateway(@PathVariable String id) {
|
|
|
|
|
- return ApiResult.success(emsGatewayQueryService.getGatewayById(id));
|
|
|
|
|
- }
|
|
|
|
|
}
|
|
}
|