Skip to content

Commit b6fb784

Browse files
authored
update:补充修改 OTA 固件信息接口 (xinnan-tech#940)
* update:修复server.websocket配置占用bug * update:补充修改 OTA 固件信息接口
1 parent 0ce387d commit b6fb784

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

main/manager-api/src/main/java/xiaozhi/modules/device/controller/OTAMagController.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import org.springframework.web.bind.annotation.GetMapping;
2323
import org.springframework.web.bind.annotation.PathVariable;
2424
import org.springframework.web.bind.annotation.PostMapping;
25+
import org.springframework.web.bind.annotation.PutMapping;
2526
import org.springframework.web.bind.annotation.RequestBody;
2627
import org.springframework.web.bind.annotation.RequestMapping;
2728
import org.springframework.web.bind.annotation.RequestParam;
@@ -109,6 +110,22 @@ public Result<Void> delete(@PathVariable("id") String[] ids) {
109110
return new Result<Void>();
110111
}
111112

113+
@PutMapping("/{id}")
114+
@Operation(summary = "修改 OTA 固件信息")
115+
@RequiresPermissions("sys:role:superAdmin")
116+
public Result<?> update(@PathVariable("id") String id, @RequestBody OtaEntity entity) {
117+
if (entity == null) {
118+
return new Result<>().error("固件信息不能为空");
119+
}
120+
entity.setId(id);
121+
try {
122+
otaService.update(entity);
123+
return new Result<>();
124+
} catch (RuntimeException e) {
125+
return new Result<>().error(e.getMessage());
126+
}
127+
}
128+
112129
@GetMapping("/getDownloadUrl/{id}")
113130
@Operation(summary = "获取 OTA 固件下载链接")
114131
@RequiresPermissions("sys:role:superAdmin")

0 commit comments

Comments
 (0)