fix: ota上传回显

V0.5.x
regan 2023-07-10 20:49:44 +08:00
parent da5d8ef4dc
commit 70a6d9b058
2 changed files with 5 additions and 3 deletions

View File

@ -1,7 +1,6 @@
package cc.iotkit.manager.dto.vo.ota; package cc.iotkit.manager.dto.vo.ota;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import io.github.linpeilie.annotations.AutoMapper;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import lombok.Data; import lombok.Data;
@ -15,9 +14,10 @@ import java.io.Serializable;
@Data @Data
@ExcelIgnoreUnannotated @ExcelIgnoreUnannotated
@ApiModel(value = "OtaPackageUploadVo") @ApiModel(value = "OtaPackageUploadVo")
@AutoMapper(target = OtaPackageUploadVo.class)
public class OtaPackageUploadVo implements Serializable { public class OtaPackageUploadVo implements Serializable {
private String url; private String url;
private Long size; private Long size;
private String md5; private String md5;
private Long ossId;
private String originalName;
} }

View File

@ -65,13 +65,15 @@ public class OtaService {
oss.setFileName(uploadResult.getFilename()); oss.setFileName(uploadResult.getFilename());
oss.setOriginalName(originalFileName); oss.setOriginalName(originalFileName);
oss.setService(storage.getConfigKey()); oss.setService(storage.getConfigKey());
sysOssData.save(oss); oss = sysOssData.save(oss);
String md5 = md5OfFile(file); String md5 = md5OfFile(file);
OtaPackageUploadVo otaPackageUploadVo = new OtaPackageUploadVo(); OtaPackageUploadVo otaPackageUploadVo = new OtaPackageUploadVo();
otaPackageUploadVo.setUrl(uploadResult.getUrl()); otaPackageUploadVo.setUrl(uploadResult.getUrl());
otaPackageUploadVo.setSize(file.getSize()); otaPackageUploadVo.setSize(file.getSize());
otaPackageUploadVo.setMd5(md5); otaPackageUploadVo.setMd5(md5);
otaPackageUploadVo.setOriginalName(originalFileName);
otaPackageUploadVo.setOssId(oss.getId());
return otaPackageUploadVo; return otaPackageUploadVo;
} }