diff --git a/nex-be/src/main/java/com/unisinsight/project/controller/FileChunkController.java b/nex-be/src/main/java/com/unisinsight/project/controller/FileChunkController.java index ce610a9..daea750 100644 --- a/nex-be/src/main/java/com/unisinsight/project/controller/FileChunkController.java +++ b/nex-be/src/main/java/com/unisinsight/project/controller/FileChunkController.java @@ -82,8 +82,11 @@ public class FileChunkController { @ApiImplicitParam(name = "file_id", value = "文件唯一标识符", required = true, dataType = "String", paramType = "query"), @ApiImplicitParam(name = "shard_index", value = "当前分片编号(从1开始)", required = true, dataType = "int", paramType = "query"), @ApiImplicitParam(name = "shard_total", value = "总分片数", required = true, dataType = "int", paramType = "query"), - @ApiImplicitParam(name = "file_name", value = "原始文件名", required = true, dataType = "String", paramType = "query"), - @ApiImplicitParam(name = "file_size", value = "文件总大小", required = true, dataType = "long", paramType = "query") + @ApiImplicitParam(name = "file_name", value = "镜像原始文件名", required = true, dataType = "String", paramType = "query"), + @ApiImplicitParam(name = "file_size", value = "文件总大小", required = true, dataType = "long", paramType = "query"), + @ApiImplicitParam(name = "image_name", value = "镜像名称", required = true, dataType = "String", paramType = "query"), + @ApiImplicitParam(name = "image_version", value = "镜像版本", required = true, dataType = "String", paramType = "query"), + @ApiImplicitParam(name = "os_version", value = "操作系统", required = true, dataType = "String", paramType = "query") }) @ApiResponses({ @ApiResponse(code = 200, message = "上传成功"), @@ -97,8 +100,11 @@ public class FileChunkController { @RequestParam("shard_index") int chunkNumber, @RequestParam("shard_total") int totalChunks, @RequestParam("file_name") String fileName, - @RequestParam("file_size") long totalSize) { - + @RequestParam("image_name") String imageName, + @RequestParam("file_size") long totalSize, + @RequestParam("image_version") String imageVersion, + @RequestParam("os_version") String osVersion + ) { Map response = new HashMap<>(); try { @@ -151,7 +157,10 @@ public class FileChunkController { fileUploadMap.remove(fileId); Image image = new Image(); - image.setImageName(fileName); + image.setImageName(imageName); + image.setImageFileName(fileName); + image.setImageVersion(imageVersion); + image.setOsVersion(osVersion); image.setStoragePath(String.valueOf(finalFilePath)); image.setImageStatus(1); int insert = imageMapper.insert(image); diff --git a/nex-be/src/main/java/com/unisinsight/project/entity/dao/Image.java b/nex-be/src/main/java/com/unisinsight/project/entity/dao/Image.java index 24a5af9..684dd59 100644 --- a/nex-be/src/main/java/com/unisinsight/project/entity/dao/Image.java +++ b/nex-be/src/main/java/com/unisinsight/project/entity/dao/Image.java @@ -1,6 +1,8 @@ package com.unisinsight.project.entity.dao; import com.baomidou.mybatisplus.annotation.*; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.io.Serializable; @@ -12,77 +14,97 @@ import java.util.Date; */ @TableName(value ="image") @Data +@ApiModel("镜像相关信息") public class Image implements Serializable { /** * ID */ @TableId(value = "id",type = IdType.AUTO) + @ApiModelProperty("id") private Long id; /** * 镜像名 */ @TableField(value = "image_name") + @ApiModelProperty("镜像名称") private String imageName; + /** + * 镜像源文件名称 + */ + @TableField(value = "image_file_name") + @ApiModelProperty("镜像源文件名称") + private String imageFileName; + /** * 镜像类型:1:VHD 2:VHDX 3:QCOW2 */ @TableField(value = "image_type") + @ApiModelProperty("镜像类型:1:VHD 2:VHDX 3:QCOW2") private Integer imageType; /** * 镜像状态: 1-成功,2-失败,3-做种中 */ @TableField(value = "image_status") + @ApiModelProperty("镜像状态: 1-成功,2-失败,3-做种中") private Integer imageStatus; /** * 镜像版本 */ @TableField(value = "image_version") + @ApiModelProperty("镜像版本") private String imageVersion; /** * 操作系统 */ @TableField(value = "os_version") + @ApiModelProperty("操作系统") private String osVersion; /** * BT路径 */ @TableField(value = "bt_path") + @ApiModelProperty("BT路径") private String btPath; /** * 镜像存储路径 */ @TableField(value = "storage_path") + @ApiModelProperty("镜像存储路径") private String storagePath; /** * 创建时间 */ @TableField(value = "create_time", fill = FieldFill.INSERT) + @ApiModelProperty("创建时间") private Date createTime; /** * 创建人 */ @TableField(value = "create_user") + @ApiModelProperty("创建人") private String createUser; /** * 更新时间 */ @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE) + @ApiModelProperty("更新时间") private Date updateTime; /** * 更新人 */ @TableField(value = "update_user") + @ApiModelProperty("更新人") private String updateUser; /** @@ -90,12 +112,14 @@ public class Image implements Serializable { */ @TableLogic @TableField(value = "deleted") + @ApiModelProperty("是否删除:0-否,1-删除") private Integer deleted; /** * 描述 */ @TableField(value = "description") + @ApiModelProperty("描述") private String description; @TableField(exist = false) diff --git a/nex-be/src/main/java/com/unisinsight/project/entity/res/ImageRes.java b/nex-be/src/main/java/com/unisinsight/project/entity/res/ImageRes.java index 58d8930..c613eb2 100644 --- a/nex-be/src/main/java/com/unisinsight/project/entity/res/ImageRes.java +++ b/nex-be/src/main/java/com/unisinsight/project/entity/res/ImageRes.java @@ -1,6 +1,7 @@ package com.unisinsight.project.entity.res; +import com.baomidou.mybatisplus.annotation.TableField; import com.fasterxml.jackson.annotation.JsonProperty; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -26,10 +27,17 @@ public class ImageRes implements Serializable { /** * 镜像名 */ - @ApiModelProperty("镜像名") + @ApiModelProperty("镜像名称") @JsonProperty("image_name") private String imageName; + /** + * 镜像源文件名称 + */ + @JsonProperty(value = "image_file_name") + @ApiModelProperty("镜像源文件名称") + private String imageFileName; + /** * 镜像类型 */ diff --git a/nex-be/src/main/resources/mappers/ImageMapper.xml b/nex-be/src/main/resources/mappers/ImageMapper.xml index 5829efc..18f98c9 100644 --- a/nex-be/src/main/resources/mappers/ImageMapper.xml +++ b/nex-be/src/main/resources/mappers/ImageMapper.xml @@ -7,6 +7,7 @@ + @@ -22,7 +23,7 @@ - id,image_name,image_type,image_status,image_version,os_version, + id,image_name,image_file_name,image_type,image_status,image_version,os_version, bt_path,storage_path,create_time,create_user,update_time, update_user,deleted,description