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")