| | |
| | | // 获取验证对象和方法 |
| | | PreventRepeatAdapter adapter = (PreventRepeatAdapter)applicationContext.getBean(prAnnotation.value()); |
| | | // 验证暴力请求 |
| | | if(prAnnotation.limit() > 0 && prAnnotation.lockTime() > 0 && adapter.massive(request, prAnnotation.limit(), prAnnotation.lockTime())) { |
| | | if(prAnnotation.limit() > 0 && prAnnotation.lockTime() > 0 |
| | | && adapter.massive(request, prAnnotation.limit(), prAnnotation.lockTime())) { |
| | | log.warn("Eva Intercept a massive request,url:{}", request.getRequestURI()); |
| | | response.setHeader("content-type", "application/json;charset=UTF-8"); |
| | | ApiResponse apiResponse = ApiResponse.failed(ResponseStatus.MASSIVE_REQUEST); |
| | |
| | | @GetMapping("/timer/device/getAscDeviceStatus") |
| | | ApiResponse getAscDeviceStatus() ; |
| | | @ApiOperation("【访客系统】设置全部LED屏显内容为默认内容") |
| | | @GetMapping("/timer/device/setAllLedDefualtContent") |
| | | ApiResponse setAllLedDefualtContent() ; |
| | | @GetMapping("/timer/device/allLedDefualtContent") |
| | | ApiResponse allLedDefualtContent(); |
| | | @ApiOperation("【访客系统】定时备份数据库") |
| | | @GetMapping("/timer/db/backupDatabase") |
| | | ApiResponse backupDatabase() ; |
| | |
| | | return ApiResponse.success("开启定时查询设备状态成功"); |
| | | } |
| | | @ApiOperation("更新全部LED屏显内容为默认内容") |
| | | @GetMapping("/setAllLedDefualtContent") |
| | | public ApiResponse setAllLedDefualtContent() { |
| | | deviceService.setAllLedDefualtContent(); |
| | | @GetMapping("/allLedDefualtContent") |
| | | public ApiResponse allLedDefualtContent() { |
| | | deviceService.allLedDefualtContent(); |
| | | return ApiResponse.success("更新全部LED屏显内容为默认内容"); |
| | | } |
| | | |
| | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.test.annotation.Repeat; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | |
| | | |
| | | @ApiOperation(value = "PC端访客记录提交", notes = "访客提交") |
| | | @PostMapping("/createFk") |
| | | @PreventRepeat(interval = 2000) |
| | | public ApiResponse createFk(@RequestBody Visits visits) { |
| | | visits.setSourceType(Constants.ZERO); |
| | | return ApiResponse.success("查询成功", visitsService.createFk(visits,false,Constants.ONE)); |
| | |
| | | long count(Device device); |
| | | |
| | | void setLedContent(TransparentChannelSingleRequest body); |
| | | void setAllLedDefualtContent(); |
| | | void allLedDefualtContent(); |
| | | } |
| | |
| | | } |
| | | } |
| | | @Override |
| | | public void setAllLedDefualtContent() { |
| | | public void allLedDefualtContent() { |
| | | log.error( "屏幕内容设置=======================开始========" ); |
| | | int speed = 13; |
| | | try { |
| | | speed = Integer.parseInt(systemDictDataBiz.queryByCode(Constants.HK_PARAM,Constants.LED_CONTENT_SPEED).getCode()); |
| | |
| | | return; |
| | | } |
| | | for(PlatformDevice device :list){ |
| | | try { |
| | | String content = device.getLedContent(); |
| | | if(StringUtils.isBlank(content)){ |
| | | continue; |
| | | } |
| | | PlatformBroadcastLog log1 = HkSyncPushServiceImpl.dealLedContentBiz(device.getPlatformId(),device.getHkNo(),device.getName(),content,speed,1); |
| | | PlatformBroadcastLog log1 = HkSyncPushServiceImpl.dealLedContentBiz(0,device.getHkNo(),device.getName(),content,speed,1); |
| | | platformBroadcastLogMapper.insert(log1); |
| | | if(log1.getHkStatus() == null || !Constants.equalsInteger(log1.getHkStatus(), Constants.TWO)){ |
| | | log.error( "对不起,屏幕内容设置失败"+(log1!=null?log1.getHkInfo():"")); |
| | | } |
| | | }catch (Exception e){ |
| | | log.error( "对不起,屏幕内容设置异常"+ device.getName()); |
| | | } |
| | | |
| | | } |
| | | log.error( "屏幕内容设置=======================结束========" ); |
| | | } |
| | | } |