| | |
| | | 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",required = false) MultipartFile file, @RequestParam String json){ |
| | | DevUpdateState dfu= ActionUtil.getGson().fromJson(json,DevUpdateState.class); |
| | | return service.updateDfu(file,dfu); |
| | | } |
| | | |
| | | @ApiOperation(value = "远程升级停止") |
| | | @GetMapping("stopDfu") |
| | | public Response stopDfu(@RequestParam int devId){ |
| | | return service.stopDfu(devId); |
| | | } |
| | | } |