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

去掉文件和文件对象最后修改时间字段

This commit is contained in:
2022-04-23 10:58:47 +08:00
parent 7c452b851d
commit eda6165b2c
14 changed files with 17 additions and 130 deletions

View File

@@ -186,7 +186,6 @@ public class FileController extends BaseController {
FileVO fileVO = new FileVO();
BeanUtils.copyProperties(fileModel, fileVO);
fileVO.setFileCreateAt(fileModel.getFileCreateAt().getTime());
fileVO.setFileModifiedAt(fileModel.getFileModifiedAt().getTime());
return fileVO;
}
}

View File

@@ -26,7 +26,4 @@ public class FileObjectVO {
// 文件提取码
String fileShareCode;
// 文件最后修改时间戳
Long lastModified;
}

View File

@@ -37,7 +37,4 @@ public class FileVO {
// 文件创建时间
long fileCreateAt;
// 文件修改时间
long fileModifiedAt;
}

View File

@@ -102,15 +102,6 @@ public class FileDO {
*/
private Date fileCreateAt;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column file_info.file_modified_at
*
* @mbg.generated
*/
private Date fileModifiedAt;
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column file_info.id
@@ -374,28 +365,4 @@ public class FileDO {
public void setFileCreateAt(Date fileCreateAt) {
this.fileCreateAt = fileCreateAt;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column file_info.file_modified_at
*
* @return the value of file_info.file_modified_at
*
* @mbg.generated
*/
public Date getFileModifiedAt() {
return fileModifiedAt;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column file_info.file_modified_at
*
* @param fileModifiedAt the value for file_info.file_modified_at
*
* @mbg.generated
*/
public void setFileModifiedAt(Date fileModifiedAt) {
this.fileModifiedAt = fileModifiedAt;
}
}

View File

@@ -64,15 +64,6 @@ public class FileObjectDO {
*/
private String fileShareCode;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column file_object_info.last_modified
*
* @mbg.generated
*/
private Long lastModified;
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column file_object_info.id
@@ -240,28 +231,4 @@ public class FileObjectDO {
public void setFileShareCode(String fileShareCode) {
this.fileShareCode = fileShareCode == null ? null : fileShareCode.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column file_object_info.last_modified
*
* @return the value of file_object_info.last_modified
*
* @mbg.generated
*/
public Long getLastModified() {
return lastModified;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column file_object_info.last_modified
*
* @param lastModified the value for file_object_info.last_modified
*
* @mbg.generated
*/
public void setLastModified(Long lastModified) {
this.lastModified = lastModified;
}
}

View File

@@ -156,13 +156,13 @@ public class FileObjectServiceImpl implements FileObjectService {
fileModel.setWatermark(false);
fileModel.setAdvertising(false);
// 获取时间戳为 0 的时间 1970-01-01
Calendar calendar = Calendar.getInstance();
calendar.setTimeInMillis(0);
Date time = calendar.getTime();
calendar.setTimeInMillis(lastModified);
fileModel.setFileCreateAt(calendar.getTime());
fileModel.setFileCreateAt(time);
fileModel.setFileModifiedAt(time);
// 获取时间戳为 0 的时间 1970-01-01 08:00:00
// calendar.setTimeInMillis(0);
// Date time = calendar.getTime();
Boolean isSuccess = fileService.addFile(fileModel);
if (!isSuccess) {
@@ -178,7 +178,6 @@ public class FileObjectServiceImpl implements FileObjectService {
fileObjectModel.setStorageMedium(fileStorageMediumEnum.getStorageMediumName());
fileObjectModel.setFilePath(filePath);
fileObjectModel.setUploadStatus("UPLOADING");
fileObjectModel.setLastModified(lastModified);
// 其余使用默认设置
fileObjectModel.setFilePwd("");

View File

@@ -39,7 +39,4 @@ public class FileModel {
// 文件创建时间
Date fileCreateAt;
// 文件修改时间
Date fileModifiedAt;
}

View File

@@ -26,7 +26,4 @@ public class FileObjectModel {
// 文件提取码
String fileShareCode;
// 文件最后修改时间戳
Long lastModified;
}

View File

@@ -17,7 +17,6 @@
<result column="advertising" jdbcType="BIT" property="advertising" />
<result column="source" jdbcType="VARCHAR" property="source" />
<result column="file_create_at" jdbcType="TIMESTAMP" property="fileCreateAt" />
<result column="file_modified_at" jdbcType="TIMESTAMP" property="fileModifiedAt" />
</resultMap>
<sql id="Base_Column_List">
<!--
@@ -25,7 +24,7 @@
This element is automatically generated by MyBatis Generator, do not modify.
-->
id, book_id, file_name, file_ext, file_size, file_sha1, number_of_pages, watermark,
advertising, `source`, file_create_at, file_modified_at
advertising, `source`, file_create_at
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
<!--
@@ -53,13 +52,11 @@
insert into file_info (id, book_id, file_name,
file_ext, file_size, file_sha1,
number_of_pages, watermark, advertising,
`source`, file_create_at, file_modified_at
)
`source`, file_create_at)
values (#{id,jdbcType=INTEGER}, #{bookId,jdbcType=INTEGER}, #{fileName,jdbcType=VARCHAR},
#{fileExt,jdbcType=VARCHAR}, #{fileSize,jdbcType=BIGINT}, #{fileSha1,jdbcType=VARCHAR},
#{numberOfPages,jdbcType=INTEGER}, #{watermark,jdbcType=BIT}, #{advertising,jdbcType=BIT},
#{source,jdbcType=VARCHAR}, #{fileCreateAt,jdbcType=TIMESTAMP}, #{fileModifiedAt,jdbcType=TIMESTAMP}
)
#{source,jdbcType=VARCHAR}, #{fileCreateAt,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="plus.bookshelf.Dao.DO.FileDO">
<!--
@@ -101,9 +98,6 @@
<if test="fileCreateAt != null">
file_create_at,
</if>
<if test="fileModifiedAt != null">
file_modified_at,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
@@ -139,9 +133,6 @@
<if test="fileCreateAt != null">
#{fileCreateAt,jdbcType=TIMESTAMP},
</if>
<if test="fileModifiedAt != null">
#{fileModifiedAt,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="plus.bookshelf.Dao.DO.FileDO">
@@ -181,9 +172,6 @@
<if test="fileCreateAt != null">
file_create_at = #{fileCreateAt,jdbcType=TIMESTAMP},
</if>
<if test="fileModifiedAt != null">
file_modified_at = #{fileModifiedAt,jdbcType=TIMESTAMP},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
@@ -202,8 +190,7 @@
watermark = #{watermark,jdbcType=BIT},
advertising = #{advertising,jdbcType=BIT},
`source` = #{source,jdbcType=VARCHAR},
file_create_at = #{fileCreateAt,jdbcType=TIMESTAMP},
file_modified_at = #{fileModifiedAt,jdbcType=TIMESTAMP}
file_create_at = #{fileCreateAt,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=INTEGER}
</update>
<select id="selectAvailableByBookId" resultMap="BaseResultMap">

View File

@@ -13,15 +13,13 @@
<result column="file_path" jdbcType="VARCHAR" property="filePath" />
<result column="file_pwd" jdbcType="VARCHAR" property="filePwd" />
<result column="file_share_code" jdbcType="VARCHAR" property="fileShareCode" />
<result column="last_modified" jdbcType="BIGINT" property="lastModified" />
</resultMap>
<sql id="Base_Column_List">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
id, file_id, upload_status, storage_medium, file_path, file_pwd, file_share_code,
last_modified
id, file_id, upload_status, storage_medium, file_path, file_pwd, file_share_code
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
<!--
@@ -48,10 +46,10 @@
-->
insert into file_object_info (id, file_id, upload_status,
storage_medium, file_path, file_pwd,
file_share_code, last_modified)
file_share_code)
values (#{id,jdbcType=INTEGER}, #{fileId,jdbcType=INTEGER}, #{uploadStatus,jdbcType=VARCHAR},
#{storageMedium,jdbcType=VARCHAR}, #{filePath,jdbcType=VARCHAR}, #{filePwd,jdbcType=VARCHAR},
#{fileShareCode,jdbcType=VARCHAR}, #{lastModified,jdbcType=BIGINT})
#{fileShareCode,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="plus.bookshelf.Dao.DO.FileObjectDO">
<!--
@@ -81,9 +79,6 @@
<if test="fileShareCode != null">
file_share_code,
</if>
<if test="lastModified != null">
last_modified,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
@@ -107,9 +102,6 @@
<if test="fileShareCode != null">
#{fileShareCode,jdbcType=VARCHAR},
</if>
<if test="lastModified != null">
#{lastModified,jdbcType=BIGINT},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="plus.bookshelf.Dao.DO.FileObjectDO">
@@ -137,9 +129,6 @@
<if test="fileShareCode != null">
file_share_code = #{fileShareCode,jdbcType=VARCHAR},
</if>
<if test="lastModified != null">
last_modified = #{lastModified,jdbcType=BIGINT},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
@@ -154,8 +143,7 @@
storage_medium = #{storageMedium,jdbcType=VARCHAR},
file_path = #{filePath,jdbcType=VARCHAR},
file_pwd = #{filePwd,jdbcType=VARCHAR},
file_share_code = #{fileShareCode,jdbcType=VARCHAR},
last_modified = #{lastModified,jdbcType=BIGINT}
file_share_code = #{fileShareCode,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
<select id="selectAll" resultMap="BaseResultMap">