mirror of
https://gitee.com/bookshelfplus/bookshelfplus
synced 2025-09-01 22:53:29 +08:00
hashSha1统一修改为fileSha1;文件管理列表添加状态显示;前端传递参数微调
This commit is contained in:
@@ -55,7 +55,7 @@
|
||||
广告: `${element.advertising}`,
|
||||
来源: `<span class="overflow-omit" style="font-size: 10px;">${element.bookOrigin}</span>`,
|
||||
大小: `${element.fileSize}`,
|
||||
"哈希(双击全选)": `<span class="overflow-omit" style="font-size: 10px;">${element.hashSha1}</span>`,
|
||||
"哈希(双击全选)": `<span class="overflow-omit" style="font-size: 10px;">${element.fileSha1}</span>`,
|
||||
时间: `<span class="overflow-omit" style="font-size: 12px; line-height: 1.2em; display: block;"><nobr>
|
||||
创建: ${new Date(element.fileCreateAt).toLocaleString()}<br>
|
||||
修改: ${new Date(element.fileModifiedAt).toLocaleString()}
|
||||
|
@@ -1,3 +1,10 @@
|
||||
<style>
|
||||
/* 限制 哈希 列的宽度 */
|
||||
tr>*:nth-child(7),
|
||||
td>*:nth-child(7) {
|
||||
max-width: 100px;
|
||||
}
|
||||
</style>
|
||||
<p>
|
||||
<a href="<%= pageUrl %>../">返回上一级</a>
|
||||
|
||||
@@ -28,18 +35,25 @@
|
||||
ID: ${element.fileId}
|
||||
<a href="<%= pageUrl %>../detail?id=${element.bookId}">查看</a>
|
||||
</span>`,
|
||||
文件路径: `${element.filePath}`,
|
||||
文件密码: `${element.filePwd}`,
|
||||
提取码: `${element.fileShareCode}`,
|
||||
文件名: `${element.fileName}`,
|
||||
格式: `${element.fileType}`,
|
||||
密码: `<span class="overflow-omit" style="font-size: 12px; line-height: 1.2em; display: block;"><nobr>
|
||||
文件密码: ${element.filePwd}<br>
|
||||
提取码: ${element.fileShareCode}
|
||||
</nobr></span>`,
|
||||
// 文件密码: `${element.filePwd}`,
|
||||
// 提取码: `${element.fileShareCode}`,
|
||||
存储介质: `${element.storageMediumType}`,
|
||||
// 时间: `<span class="overflow-omit" style="font-size: 12px; line-height: 1.2em; display: block;"><nobr>
|
||||
// 创建: ${new Date(element.fileCreateAt).toLocaleString()}<br>
|
||||
// 修改: ${new Date(element.fileModifiedAt).toLocaleString()}
|
||||
// </nobr></span>`,
|
||||
管理: `<span class="overflow-omit" style="margin: 0 auto;">
|
||||
"哈希(双击全选)": `<span class="overflow-omit" style="font-size: 10px;">${element.fileSha1}</span>`,
|
||||
状态: `${(element.uploadStatus ? element.uploadStatus : "<span style='color: grey; font-weight: bold;'>未知</span>")
|
||||
.replace("SUCCESS", "<span style='color: green; font-weight: bold;'>成功</span>")
|
||||
.replace("UPLOADING", "<span style='color: orange; font-weight: bold;'>正在上传</span>")
|
||||
.replace("TERMINATED", "<span style='color: red; font-weight: bold;'>上传失败</span>")}`,
|
||||
管理: `<span span class= "overflow-omit" style = "margin: 0 auto;" >
|
||||
<a href="javascript:refreshFileObjectStatus(${element.id});">刷新状态</a>
|
||||
<a href="<%= pageUrl %>../object-detail?id=${element.id}">修改</a>
|
||||
<a href="javascript:deleteBook(${element.id});">删除</a>
|
||||
</span>`,
|
||||
</span > `,
|
||||
})
|
||||
});
|
||||
if (renderData.length == 0) {
|
||||
@@ -55,7 +69,7 @@
|
||||
renderTable({ data: renderData, tableId: tableElementId, renderTableHead: true });
|
||||
}
|
||||
} else {
|
||||
alert(`出错啦!${data.errMsg} (错误码: ${data.errCode}) `);
|
||||
alert(`出错啦!${data.errMsg}(错误码: ${data.errCode}) `);
|
||||
}
|
||||
}).catch(function (error) {
|
||||
console.log(error);
|
||||
|
@@ -353,7 +353,7 @@
|
||||
expireMinute: 30,
|
||||
fileName: fileInfo.fileNameWithoutExt,
|
||||
fileSize: fileInfo.fileSize,
|
||||
fileType: fileInfo.fileType,
|
||||
// fileType: fileInfo.fileType,
|
||||
fileSha1: fileInfo.fileSha1,
|
||||
fileExt: fileInfo.fileExt,
|
||||
fileId: $("#fileAssociator").val() // 关联的文件ID,创建新文件则为0
|
||||
|
@@ -11,7 +11,7 @@
|
||||
Target Server Version : 50726
|
||||
File Encoding : 65001
|
||||
|
||||
Date: 15/04/2022 16:42:13
|
||||
Date: 15/04/2022 22:07:58
|
||||
*/
|
||||
|
||||
SET NAMES utf8mb4;
|
||||
@@ -171,7 +171,7 @@ CREATE TABLE `file_object_info` (
|
||||
`file_pwd` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
|
||||
`file_share_code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
|
||||
`upload_status` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '上传状态(上传成功 SUCCESS,正在上传 UPLOADING,上传终止 TERMINATED)',
|
||||
`file_sha1` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '文件SHA1哈希',
|
||||
`hash_sha1` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '文件SHA1哈希',
|
||||
`additional_fields` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC;
|
||||
|
@@ -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
|
||||
|
@@ -37,7 +37,7 @@ public class FileObjectVO {
|
||||
String uploadStatus;
|
||||
|
||||
// 文件哈希 - SHA1
|
||||
String hashSha1;
|
||||
String fileSha1;
|
||||
|
||||
// 附加字段(JSON存储)
|
||||
String additionalFields;
|
||||
|
@@ -42,5 +42,5 @@ public class FileVO {
|
||||
long fileSize;
|
||||
|
||||
// 文件哈希 - SHA1
|
||||
String hashSha1;
|
||||
String fileSha1;
|
||||
}
|
||||
|
@@ -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();
|
||||
}
|
||||
}
|
@@ -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");
|
||||
|
||||
// 其余使用默认设置
|
||||
|
@@ -44,5 +44,5 @@ public class FileModel {
|
||||
long fileSize;
|
||||
|
||||
// 文件哈希 - SHA1
|
||||
String hashSha1;
|
||||
String fileSha1;
|
||||
}
|
||||
|
@@ -37,7 +37,7 @@ public class FileObjectModel {
|
||||
String uploadStatus;
|
||||
|
||||
// 文件哈希 - SHA1
|
||||
String hashSha1;
|
||||
String fileSha1;
|
||||
|
||||
// 附加字段(JSON存储)
|
||||
String additionalFields;
|
||||
|
@@ -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">
|
||||
|
Reference in New Issue
Block a user