File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
main/manager-api/src/main/java/xiaozhi/modules/device/controller Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change 2222import org .springframework .web .bind .annotation .GetMapping ;
2323import org .springframework .web .bind .annotation .PathVariable ;
2424import org .springframework .web .bind .annotation .PostMapping ;
25+ import org .springframework .web .bind .annotation .PutMapping ;
2526import org .springframework .web .bind .annotation .RequestBody ;
2627import org .springframework .web .bind .annotation .RequestMapping ;
2728import 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" )
You can’t perform that action at this time.
0 commit comments