2021与蓝度共同重构项目,服务端
liuhaonan
2022-05-06 4f0c98099f43028d29546c7000ef48bc89282dc4
ximon-admin/src/main/java/com/sandu/ximon/admin/controller/LightController.java
@@ -72,9 +72,9 @@
            return ResponseUtil.fail("缺少对应用户权限");
        }
        CommonPage commonPage = lightReportDataService.listReportData(conditionVO.getPageNo(), conditionVO.getPageSize(), keyword, deviceCode);
        List<LightReportDataBo> lightReportDataBos = ( List<LightReportDataBo>)commonPage.getList();
        List<LightReportDataBo> lightReportDataBos = (List<LightReportDataBo>) commonPage.getList();
        if(lightReportDataBos == null){
        if (lightReportDataBos == null) {
            return ResponseUtil.success(CommonPage.restPage(new ArrayList<>()));
        }
        CommonPage commonPage1 = CommonPage.restPage(lightReportDataBos);
@@ -116,32 +116,26 @@
        return ResponseUtil.success(list);
    }
    @PostMapping("/EnergySaving")
    public ResponseVO<Object> controlEnergySaving() {
        return ResponseUtil.success(lightService.controlEnergySaving());
    }
    @PostMapping("/Energy")
    @AnonymousAccess
    public ResponseVO<Object> Energy() {
        return ResponseUtil.success(lightService.controlEnergy());
    }
//    /**
//     * 获取设备码
//     */
//    @GetMapping("/deviceCode")
//    public ResponseVO<Object> getDeviceCode(BaseConditionVO baseConditionVO) {
//        return ResponseUtil.success(lightService.listDeviceCode(baseConditionVO.getPageNo() , baseConditionVO.getPageSize()));
//    }
    @AnonymousAccess
    @PostMapping("/EnergySaving")
    public ResponseVO<Object> controlEnergySaving() {
        return ResponseUtil.success(lightService.controlEnergySaving());
    }
    /**
     * 设置功率
     */
    @PostMapping("/setPower")
    public ResponseVO<Object> setPower(@RequestBody LightPowerSettingParam lightPowerSettingParam) {
        boolean resule= lightService.setPower(lightPowerSettingParam);
        boolean resule = lightService.setPower(lightPowerSettingParam);
        return ResponseUtil.success(resule);
    }
}