From 783f17e9e8446c75b44a5b0e26470ae6a06925e4 Mon Sep 17 00:00:00 2001 From: hrz <1710360675@qq.com> Date: Wed, 23 Apr 2025 00:24:19 +0800 Subject: [PATCH] =?UTF-8?q?update:=E8=A1=A5=E5=85=85=E4=BF=AE=E6=94=B9=20O?= =?UTF-8?q?TA=20=E5=9B=BA=E4=BB=B6=E4=BF=A1=E6=81=AF=E6=8E=A5=E5=8F=A3=20(?= =?UTF-8?q?#940)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * update:修复server.websocket配置占用bug * update:补充修改 OTA 固件信息接口 --- .../device/controller/OTAMagController.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/main/manager-api/src/main/java/xiaozhi/modules/device/controller/OTAMagController.java b/main/manager-api/src/main/java/xiaozhi/modules/device/controller/OTAMagController.java index 18273a95..bbe0c66a 100644 --- a/main/manager-api/src/main/java/xiaozhi/modules/device/controller/OTAMagController.java +++ b/main/manager-api/src/main/java/xiaozhi/modules/device/controller/OTAMagController.java @@ -22,6 +22,7 @@ import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; @@ -109,6 +110,22 @@ public class OTAMagController { return new Result(); } + @PutMapping("/{id}") + @Operation(summary = "修改 OTA 固件信息") + @RequiresPermissions("sys:role:superAdmin") + public Result update(@PathVariable("id") String id, @RequestBody OtaEntity entity) { + if (entity == null) { + return new Result<>().error("固件信息不能为空"); + } + entity.setId(id); + try { + otaService.update(entity); + return new Result<>(); + } catch (RuntimeException e) { + return new Result<>().error(e.getMessage()); + } + } + @GetMapping("/getDownloadUrl/{id}") @Operation(summary = "获取 OTA 固件下载链接") @RequiresPermissions("sys:role:superAdmin")