| | |
| | | import com.sandu.common.domain.ResponseVO; |
| | | import com.sandu.common.execption.BusinessException; |
| | | import com.sandu.common.object.BaseConditionVO; |
| | | import com.sandu.common.security.annotation.AnonymousAccess; |
| | | import com.sandu.common.util.ResponseUtil; |
| | | import com.sandu.common.util.SpringContextHolder; |
| | | import com.sandu.ximon.admin.entity.ProgramPro; |
| | | import com.sandu.ximon.admin.param.LEDScheduleParam_xixun; |
| | | import com.sandu.ximon.admin.param.SetBrightnessParam; |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 测试 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @AnonymousAccess |
| | | @PostMapping("/test/{str}") |
| | | public ResponseVO<Object> setBrightness(@PathVariable String str) { |
| | | return ResponseUtil.success(lightemitUtils.getIsScreenOpen(str)); |
| | | } |
| | | |
| | | |
| | | /* |
| | | 设置亮度 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 获取执行中的定时 |
| | | * |
| | | * @param |
| | | * @return |
| | | */ |
| | | |
| | | @GetMapping("/getPushSchedule") |
| | | public ResponseVO<Object> getPushSchedule(@RequestBody List<Long> ids) { |
| | | if(ids.isEmpty()){ |
| | | if (ids.isEmpty()) { |
| | | throw new BusinessException("未选择LED屏"); |
| | | } |
| | | List<LedScheduleVO> list = new ArrayList<>(); |
| | | for(Long id : ids) { |
| | | for (Long id : ids) { |
| | | LedScheduleVO ledScheduleVO = scheduleService.getledschedules(id); |
| | | list.add(ledScheduleVO); |
| | | } |
| | | return ResponseUtil.success(list); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 关闭天气推送 |
| | | */ |
| | | @GetMapping("/closeWeatherPush/{id}") |
| | | public ResponseVO<Object> closeWeatherPush(@PathVariable Long id) { |
| | | if (id == null) { |
| | | throw new BusinessException("未选择LED屏"); |
| | | } |
| | | SpringContextHolder.getBean(PoleService.class).closeXiXunAirPush(id); |
| | | return ResponseUtil.success("关闭成功"); |
| | | } |
| | | |
| | | /** |
| | | * 清屏操作 |
| | | */ |
| | | @GetMapping("/clearScreen") |
| | | public ResponseVO<Object> clearScreen(@RequestBody List<Long> ids) { |
| | | List<PoleLightemitEntity> list = poleLightemitService.listByIds(ids); |
| | | if (ids.isEmpty() && list.isEmpty()) { |
| | | throw new BusinessException("未选择LED屏"); |
| | | } |
| | | for (PoleLightemitEntity playerId : list) { |
| | | lightemitUtils.clear(playerId.getLightemitControlCode()); |
| | | } |
| | | return ResponseUtil.success("清屏成功"); |
| | | } |
| | | } |