1
0
mirror of https://gitee.com/bookshelfplus/bookshelfplus synced 2025-09-01 22:53:29 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee

添加文件修改日期字段;前端列表小调整

This commit is contained in:
2022-04-15 23:33:31 +08:00
parent 3b29820f2c
commit 3dac60ced6
10 changed files with 80 additions and 20 deletions

View File

@@ -50,9 +50,6 @@ public class FileController extends BaseController {
@Autowired
FileObjectServiceImpl fileObjectService;
// @Autowired
// ScheduleTaskServiceImpl scheduleTaskService;
@ApiOperation(value = "【管理员】查询文件列表", notes = "查询文件列表")
@RequestMapping(value = "list", method = {RequestMethod.POST}, consumes = {CONTENT_TYPE_FORMED})
@ResponseBody
@@ -131,6 +128,7 @@ public class FileController extends BaseController {
// 以下为 PUT 请求必传参数
@RequestParam(value = "fileSize", required = false) Long fileSize,
// @RequestParam(value = "fileType", required = false) String fileType,
@RequestParam(value = "lastModified", required = false) Long lastModified,
@RequestParam(value = "fileSha1", required = false) String fileSha1,
@RequestParam(value = "fileExt", required = false) String fileExt,
@RequestParam(value = "fileId", required = false) Integer fileId // 关联的文件ID创建新文件则为0
@@ -168,7 +166,7 @@ public class FileController extends BaseController {
if (isExist) throw new BusinessException(BusinessErrorCode.PARAMETER_VALIDATION_ERROR, "文件已存在");
fileObjectService.uploadFile(fileId, fileName, bookSaveFolder + fileName, fileSize,
fileSha1, fileExt, fileName, FileStorageMediumEnum.QCLOUD_COS, "");
fileSha1, fileExt, fileName, FileStorageMediumEnum.QCLOUD_COS, "", lastModified);
break;
case GET:
if (!isExist) throw new BusinessException(BusinessErrorCode.PARAMETER_VALIDATION_ERROR, "文件不存在");
@@ -190,6 +188,7 @@ public class FileController extends BaseController {
/**
* 腾讯云 COS 文件上传成功回调方法
*
* @param eventStr
* @param contextStr
* @return

View File

@@ -33,6 +33,9 @@ public class FileObjectVO {
// 文件提取码
String fileShareCode;
// 文件最后修改时间戳
Long lastModified;
// 文件上传状态
String uploadStatus;

View File

@@ -100,6 +100,15 @@ public class FileObjectDO {
*/
private String fileSha1;
/**
*
* 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 field was generated by MyBatis Generator.
@@ -373,6 +382,30 @@ public class FileObjectDO {
this.fileSha1 = fileSha1 == null ? null : fileSha1.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;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column file_object_info.additional_fields

View File

@@ -107,7 +107,7 @@ public class FileObjectServiceImpl implements FileObjectService {
@Transactional
public Boolean uploadFile(Integer fileId, String fileName, String filePath, Long fileSize, String fileSHA1,
String fileExt, String fileNameWithoutExt, FileStorageMediumEnum fileStorageMediumEnum,
String bookOrigin
String bookOrigin, Long lastModified
) throws InvocationTargetException, IllegalAccessException, BusinessException {
if (fileId == 0) {
@@ -153,6 +153,7 @@ public class FileObjectServiceImpl implements FileObjectService {
fileObjectModel.setFilePath(filePath);
fileObjectModel.setFileSha1(fileSHA1);
fileObjectModel.setUploadStatus("UPLOADING");
fileObjectModel.setLastModified(lastModified);
// 其余使用默认设置
fileObjectModel.setFilePwd("");

View File

@@ -33,6 +33,9 @@ public class FileObjectModel {
// 文件提取码
String fileShareCode;
// 文件最后修改时间戳
Long lastModified;
// 文件上传状态
String uploadStatus;

View File

@@ -45,7 +45,7 @@ public interface FileObjectService {
* @throws BusinessException
*/
@Transactional
Boolean uploadFile(Integer fileId, String fileName, String filePath, Long fileSize, String fileSHA1, String fileExt, String fileNameWithoutExt, FileStorageMediumEnum fileStorageMediumEnum, String bookOrigin) throws InvocationTargetException, IllegalAccessException, BusinessException;
Boolean uploadFile(Integer fileId, String fileName, String filePath, Long fileSize, String fileSHA1, String fileExt, String fileNameWithoutExt, FileStorageMediumEnum fileStorageMediumEnum, String bookOrigin, Long lastModified) throws InvocationTargetException, IllegalAccessException, BusinessException;
/**
* 修改文件对象上传状态信息