lxw
2023-11-13 3e4eb655d3358650bb23cf9832bc1a7257771c48
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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 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 = true,paramType = "form")
    public Response updateDfu(@RequestParam(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);
    }
}