|
@@ -1,12 +1,24 @@
|
|
package cc.iotkit.manager.controller;
|
|
package cc.iotkit.manager.controller;
|
|
|
|
|
|
|
|
+import cc.iotkit.common.api.PageRequest;
|
|
|
|
+import cc.iotkit.common.api.Paging;
|
|
|
|
+import cc.iotkit.common.api.Request;
|
|
import cc.iotkit.manager.service.OtaService;
|
|
import cc.iotkit.manager.service.OtaService;
|
|
|
|
+import cc.iotkit.model.ota.DeviceOta;
|
|
|
|
+import cc.iotkit.model.ota.OtaPackage;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
|
+import org.springframework.web.bind.annotation.PostMapping;
|
|
|
|
+import org.springframework.web.bind.annotation.RequestBody;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
+import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
|
|
+import javax.validation.Valid;
|
|
|
|
+import java.io.InputStream;
|
|
|
|
|
|
/**
|
|
/**
|
|
* @Author: 石恒
|
|
* @Author: 石恒
|
|
@@ -22,7 +34,7 @@ public class OtaController {
|
|
@Resource
|
|
@Resource
|
|
private OtaService otaService;
|
|
private OtaService otaService;
|
|
|
|
|
|
- /*@ApiOperation("升级包上传")
|
|
|
|
|
|
+ @ApiOperation("升级包上传")
|
|
@PostMapping("/package/upload")
|
|
@PostMapping("/package/upload")
|
|
public String packageUpload(MultipartFile file) throws Exception {
|
|
public String packageUpload(MultipartFile file) throws Exception {
|
|
if (!file.isEmpty()) {
|
|
if (!file.isEmpty()) {
|
|
@@ -49,7 +61,7 @@ public class OtaController {
|
|
@ApiOperation("升级包列表")
|
|
@ApiOperation("升级包列表")
|
|
@PostMapping("/package/getList")
|
|
@PostMapping("/package/getList")
|
|
public Paging<OtaPackage> packageList(@RequestBody @Valid PageRequest<Void> request) {
|
|
public Paging<OtaPackage> packageList(@RequestBody @Valid PageRequest<Void> request) {
|
|
- return otaService.getOtaPackagePageList(request.getPageNo(), request.getPageSize());
|
|
|
|
|
|
+ return null;
|
|
}
|
|
}
|
|
|
|
|
|
@ApiOperation("设备获取升级包")
|
|
@ApiOperation("设备获取升级包")
|
|
@@ -57,5 +69,5 @@ public class OtaController {
|
|
public void deviceUpgrade(@RequestBody Request<DeviceOta> deviceOtaRequest) {
|
|
public void deviceUpgrade(@RequestBody Request<DeviceOta> deviceOtaRequest) {
|
|
DeviceOta deviceOta = deviceOtaRequest.getData();
|
|
DeviceOta deviceOta = deviceOtaRequest.getData();
|
|
otaService.findByVersionGreaterThan(deviceOta.getCurrentVersion(), deviceOta.getDeviceId());
|
|
otaService.findByVersionGreaterThan(deviceOta.getCurrentVersion(), deviceOta.getDeviceId());
|
|
- }*/
|
|
|
|
|
|
+ }
|
|
}
|
|
}
|