lxw
2023-11-13 8a3f1891037ae295bc4fa2bb5c3ad3b21edeb09e
src/main/java/com/whyc/controller/DevUpdateStateController.java
@@ -1,11 +1,33 @@
package com.whyc.controller;
import com.whyc.pojo.DevUpdateState;
import com.whyc.pojo.Response;
import com.whyc.service.DevUpdateStateService;
import com.whyc.util.ActionUtil;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
@RequestMapping("devUpdate")
@RestController
@Api(tags = "设备升级")
public class DevUpdateStateController {
    @Autowired
    private DevUpdateStateService service;
    @ApiOperation(value = "远程升级")
    @PostMapping("updateDfu")
    @ApiImplicitParam(name = "file", value = "上传的文件", dataTypeClass = MultipartFile.class, required = false,paramType = "form")
    public Response updateDfu(@RequestPart(value = "file") MultipartFile file, @RequestParam int devId){
        return service.updateDfu(file,devId);
    }
    @ApiOperation(value = "远程升级停止")
    @GetMapping("stopDfu")
    public Response stopDfu(@RequestParam int devId){
        return service.stopDfu(devId);
    }
}