|
@@ -3,12 +3,15 @@ package com.hfln.portal.application.controller.web;
|
|
|
import cn.hfln.framework.catchlog.CatchAndLog;
|
|
|
import cn.hfln.framework.dto.ApiResult;
|
|
|
import com.hfln.portal.common.dto.data.device.DeviceDTO;
|
|
|
+import com.hfln.portal.common.dto.data.oss.OtaFileDTO;
|
|
|
import com.hfln.portal.common.request.device.DeviceListQueryReq;
|
|
|
import com.hfln.portal.common.request.device.WebUpdateDeviceParams;
|
|
|
import com.hfln.portal.common.request.web.DeviceAddParam;
|
|
|
+import com.hfln.portal.common.request.web.UpdateOTAParams;
|
|
|
import com.hfln.portal.common.vo.PageRecord;
|
|
|
import com.hfln.portal.common.vo.UploadRes;
|
|
|
import com.hfln.portal.domain.gateway.DeviceGateway;
|
|
|
+import com.hfln.portal.domain.gateway.PubGateway;
|
|
|
import com.hfln.portal.domain.gateway.WebGateway;
|
|
|
import io.swagger.v3.oas.annotations.Operation;
|
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
@@ -19,6 +22,7 @@ import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
import javax.validation.Valid;
|
|
|
import java.io.IOException;
|
|
|
+import java.util.List;
|
|
|
|
|
|
@RestController
|
|
|
@CatchAndLog
|
|
@@ -33,6 +37,9 @@ public class WebDeviceController {
|
|
|
@Autowired
|
|
|
private DeviceGateway DeviceGateway;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private PubGateway pubGateway;
|
|
|
+
|
|
|
@PostMapping("/uploadDev")
|
|
|
@Operation(summary = "excel上传设备信息")
|
|
|
public ApiResult<UploadRes> uploadDev(@Valid @RequestParam MultipartFile file) throws IOException {
|
|
@@ -63,4 +70,17 @@ public class WebDeviceController {
|
|
|
public ApiResult<Boolean> webUpdateDevice(@Valid @RequestBody WebUpdateDeviceParams Params) {
|
|
|
return ApiResult.success(DeviceGateway.webUpdateDevice(Params));
|
|
|
}
|
|
|
+
|
|
|
+ @GetMapping("/OTA/query")
|
|
|
+ @Operation(summary = "OTA升级固件列表查询")
|
|
|
+ public ApiResult<List<OtaFileDTO>> queryOtaFiles() {
|
|
|
+ return ApiResult.success(pubGateway.queryOtaFiles());
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping("/OTA/update")
|
|
|
+ @Operation(summary = "设备OTA升级")
|
|
|
+ public ApiResult<Void> updateOTA(@RequestBody @Valid UpdateOTAParams params) {
|
|
|
+ pubGateway.updateOTA(params);
|
|
|
+ return ApiResult.success();
|
|
|
+ }
|
|
|
}
|