| | |
| | | private PermissionConfig permissionConfig; |
| | | |
| | | |
| | | @AnonymousAccess |
| | | @PostMapping("/add") |
| | | public ResponseVO<Object> addRemoteUpdateFile(@RequestBody @Validated RemoteUpdateParam param) { |
| | | if (!permissionConfig.check(MenuEnum.REMOTE_UPDATE_FILE_ADD.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | boolean flag = remoteUpdateService.addRemoteUpdateFile(param.getFilename(), param.getFileType() |
| | | , param.getSoftwareVersion(), param.getHardwareVersion(), param.getAliAddress(), param.getFileLength()); |
| | | return ResponseUtil.success(flag); |
| | | } |
| | | |
| | | @AnonymousAccess |
| | | @GetMapping("/getRemoteFileList") |
| | | public ResponseVO<Object> getRemoteFileList() { |
| | | if (!permissionConfig.check(MenuEnum.REMOTE_UPDATE_FILE_LIST.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | return ResponseUtil.success(remoteUpdateService.getRemoteFileList()); |
| | | } |
| | | |
| | | @GetMapping("/getRemoteUpdateTypeList") |
| | | public ResponseVO<Object> getRemoteUpdateTypeList() { |
| | | if (!permissionConfig.check(MenuEnum.REMOTE_UPDATE_TYPE_LIST.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | return ResponseUtil.success(remoteUpdateService.getRemoteUpdateTypeList()); |
| | | } |
| | | |
| | |
| | | * |
| | | * @return |
| | | */ |
| | | //TODO |
| | | @AnonymousAccess |
| | | @PostMapping("/StartRemoteUpdate") |
| | | public ResponseVO<Object> startRemoteUpdate(@RequestBody @Validated RemotePrarm remotePrarm) { |
| | | // if (!permissionConfig.check(MenuEnum.MENU_LIST.getCode())) { |
| | | // return ResponseUtil.fail("缺少对应用户权限"); |
| | | // } |
| | | if (!permissionConfig.check(MenuEnum.REMOTE_UPDATE_START.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | String orderType; |
| | | boolean UpdateFlag = false; |
| | | |
| | |
| | | * @param remotePrarm |
| | | * @return |
| | | */ |
| | | @AnonymousAccess |
| | | @PostMapping("/searchUpdateResult") |
| | | public ResponseVO<Object> searchUpdateResult(@RequestBody RemotePrarm remotePrarm) { |
| | | if (!permissionConfig.check(MenuEnum.REMOTE_UPDATE_VERSION.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | if (remotePrarm.getMac() == null || remotePrarm.getDeviceType() == null) { |
| | | throw new BusinessException("缺少相关参数!"); |
| | | } |
| | |
| | | * @param remotePrarm |
| | | * @return |
| | | */ |
| | | @AnonymousAccess |
| | | @PostMapping("/stopUpdate") |
| | | public ResponseVO<Object> stopUpdate(@RequestBody RemotePrarm remotePrarm) { |
| | | if (!permissionConfig.check(MenuEnum.REMOTE_UPDATE_STOP.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | if (remotePrarm.getMac() == null || remotePrarm.getDeviceType() == null) { |
| | | throw new BusinessException("缺少相关参数!"); |
| | | } |