1
0
mirror of https://gitee.com/bookshelfplus/bookshelfplus synced 2025-10-02 22:15:15 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee

hashSha1统一修改为fileSha1;文件管理列表添加状态显示;前端传递参数微调

This commit is contained in:
2022-04-15 22:38:16 +08:00
parent 9e11207438
commit 7f5fd3e70f
12 changed files with 56 additions and 42 deletions

View File

@@ -130,7 +130,7 @@ public class FileController extends BaseController {
// 以下为 PUT 请求必传参数
@RequestParam(value = "fileSize", required = false) Long fileSize,
@RequestParam(value = "fileType", required = false) String fileType,
// @RequestParam(value = "fileType", required = false) String fileType,
@RequestParam(value = "fileSha1", required = false) String fileSha1,
@RequestParam(value = "fileExt", required = false) String fileExt,
@RequestParam(value = "fileId", required = false) Integer fileId // 关联的文件ID创建新文件则为0

View File

@@ -37,7 +37,7 @@ public class FileObjectVO {
String uploadStatus;
// 文件哈希 - SHA1
String hashSha1;
String fileSha1;
// 附加字段(JSON存储)
String additionalFields;

View File

@@ -42,5 +42,5 @@ public class FileVO {
long fileSize;
// 文件哈希 - SHA1
String hashSha1;
String fileSha1;
}

View File

@@ -114,11 +114,11 @@ public class FileDO {
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column file_info.hash_sha1
* This field corresponds to the database column file_info.file_sha1
*
* @mbg.generated
*/
private String hashSha1;
private String fileSha1;
/**
* This method was generated by MyBatis Generator.
@@ -410,25 +410,25 @@ public class FileDO {
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column file_info.hash_sha1
* This method returns the value of the database column file_info.file_sha1
*
* @return the value of file_info.hash_sha1
* @return the value of file_info.file_sha1
*
* @mbg.generated
*/
public String getHashSha1() {
return hashSha1;
public String getFileSha1() {
return fileSha1;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column file_info.hash_sha1
* This method sets the value of the database column file_info.file_sha1
*
* @param hashSha1 the value for file_info.hash_sha1
* @param fileSha1 the value for file_info.file_sha1
*
* @mbg.generated
*/
public void setHashSha1(String hashSha1) {
this.hashSha1 = hashSha1 == null ? null : hashSha1.trim();
public void setFileSha1(String fileSha1) {
this.fileSha1 = fileSha1 == null ? null : fileSha1.trim();
}
}

View File

@@ -116,7 +116,7 @@ public class FileObjectServiceImpl implements FileObjectService {
fileModel.setFileName(fileName);
fileModel.setFileSize(fileSize);
fileModel.setHashSha1(fileSHA1);
fileModel.setFileSha1(fileSHA1);
fileModel.setFileFormat(fileExt);
fileModel.setFileDisplayName(fileNameWithoutExt);
fileModel.setBookOrigin(bookOrigin);
@@ -151,7 +151,7 @@ public class FileObjectServiceImpl implements FileObjectService {
fileObjectModel.setFileType(fileExt);
fileObjectModel.setStorageMediumType(fileStorageMediumEnum.getStorageMediumName());
fileObjectModel.setFilePath(filePath);
fileObjectModel.setHashSha1(fileSHA1);
fileObjectModel.setFileSha1(fileSHA1);
fileObjectModel.setUploadStatus("UPLOADING");
// 其余使用默认设置

View File

@@ -44,5 +44,5 @@ public class FileModel {
long fileSize;
// 文件哈希 - SHA1
String hashSha1;
String fileSha1;
}

View File

@@ -37,7 +37,7 @@ public class FileObjectModel {
String uploadStatus;
// 文件哈希 - SHA1
String hashSha1;
String fileSha1;
// 附加字段(JSON存储)
String additionalFields;

View File

@@ -18,7 +18,7 @@
<result column="file_create_at" jdbcType="TIMESTAMP" property="fileCreateAt" />
<result column="file_modified_at" jdbcType="TIMESTAMP" property="fileModifiedAt" />
<result column="file_size" jdbcType="BIGINT" property="fileSize" />
<result column="hash_sha1" jdbcType="VARCHAR" property="hashSha1" />
<result column="file_sha1" jdbcType="VARCHAR" property="fileSha1" />
</resultMap>
<sql id="Base_Column_List">
<!--
@@ -26,7 +26,7 @@
This element is automatically generated by MyBatis Generator, do not modify.
-->
id, book_id, file_display_name, file_name, file_format, number_of_pages, watermark,
advertising, book_origin, file_create_at, file_modified_at, file_size, hash_sha1
advertising, book_origin, file_create_at, file_modified_at, file_size, file_sha1
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
<!--
@@ -55,12 +55,12 @@
file_name, file_format, number_of_pages,
watermark, advertising, book_origin,
file_create_at, file_modified_at, file_size,
hash_sha1)
file_sha1)
values (#{id,jdbcType=INTEGER}, #{bookId,jdbcType=INTEGER}, #{fileDisplayName,jdbcType=VARCHAR},
#{fileName,jdbcType=VARCHAR}, #{fileFormat,jdbcType=VARCHAR}, #{numberOfPages,jdbcType=INTEGER},
#{watermark,jdbcType=BIT}, #{advertising,jdbcType=BIT}, #{bookOrigin,jdbcType=VARCHAR},
#{fileCreateAt,jdbcType=TIMESTAMP}, #{fileModifiedAt,jdbcType=TIMESTAMP}, #{fileSize,jdbcType=BIGINT},
#{hashSha1,jdbcType=VARCHAR})
#{fileSha1,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="plus.bookshelf.Dao.DO.FileDO">
<!--
@@ -105,8 +105,8 @@
<if test="fileSize != null">
file_size,
</if>
<if test="hashSha1 != null">
hash_sha1,
<if test="fileSha1 != null">
file_sha1,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
@@ -146,8 +146,8 @@
<if test="fileSize != null">
#{fileSize,jdbcType=BIGINT},
</if>
<if test="hashSha1 != null">
#{hashSha1,jdbcType=VARCHAR},
<if test="fileSha1 != null">
#{fileSha1,jdbcType=VARCHAR},
</if>
</trim>
</insert>
@@ -191,8 +191,8 @@
<if test="fileSize != null">
file_size = #{fileSize,jdbcType=BIGINT},
</if>
<if test="hashSha1 != null">
hash_sha1 = #{hashSha1,jdbcType=VARCHAR},
<if test="fileSha1 != null">
file_sha1 = #{fileSha1,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
@@ -214,7 +214,7 @@
file_create_at = #{fileCreateAt,jdbcType=TIMESTAMP},
file_modified_at = #{fileModifiedAt,jdbcType=TIMESTAMP},
file_size = #{fileSize,jdbcType=BIGINT},
hash_sha1 = #{hashSha1,jdbcType=VARCHAR}
file_sha1 = #{fileSha1,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
<select id="selectAll" resultMap="BaseResultMap">