接口调用
This commit is contained in:
parent
ee8587d014
commit
7f2c4af11f
|
|
@ -1,39 +0,0 @@
|
|||
package com.securitycontrol.system.api.domain.background;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author lit@epsoft.com.cn
|
||||
* @version 1.0
|
||||
* @Description 统一文件下载vo
|
||||
* @date Apr 8, 2022
|
||||
*/
|
||||
@Data
|
||||
public class FileExportVo {
|
||||
|
||||
private String fileId;
|
||||
|
||||
private String fileName;
|
||||
|
||||
private String contentType;
|
||||
|
||||
private String suffix;
|
||||
|
||||
private long fileSize;
|
||||
|
||||
@JsonIgnore
|
||||
private byte[] data;
|
||||
|
||||
public FileExportVo(MongoFile mongoFile) {
|
||||
BeanUtil.copyProperties(mongoFile, this);
|
||||
if (Objects.nonNull(mongoFile.getContent())) {
|
||||
this.data = mongoFile.getContent().getData();
|
||||
}
|
||||
this.fileId = mongoFile.getId();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,71 +0,0 @@
|
|||
package com.securitycontrol.system.api.domain.background;
|
||||
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import org.bson.types.Binary;
|
||||
import org.springframework.data.annotation.Id;
|
||||
import org.springframework.data.mongodb.core.mapping.Document;
|
||||
|
||||
/**
|
||||
* @author coisini
|
||||
* @version 1.0
|
||||
* @Description MongoDB文件实体
|
||||
* @date Apr 17, 2022
|
||||
*/
|
||||
@Document
|
||||
@Builder
|
||||
@Data
|
||||
public class MongoFile {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@Id
|
||||
public String id;
|
||||
|
||||
/**
|
||||
* 文件名称
|
||||
*/
|
||||
public String fileName;
|
||||
|
||||
/**
|
||||
* 文件大小
|
||||
*/
|
||||
public long fileSize;
|
||||
|
||||
/**
|
||||
* 上传时间
|
||||
*/
|
||||
public String uploadDate;
|
||||
|
||||
/**
|
||||
* MD5值
|
||||
*/
|
||||
public String md5;
|
||||
|
||||
/**
|
||||
* 文件内容
|
||||
*/
|
||||
private Binary content;
|
||||
|
||||
/**
|
||||
* 文件类型
|
||||
*/
|
||||
public String contentType;
|
||||
|
||||
/**
|
||||
* 文件后缀名
|
||||
*/
|
||||
public String suffix;
|
||||
|
||||
/**
|
||||
* 文件描述
|
||||
*/
|
||||
public String description;
|
||||
|
||||
/**
|
||||
* 大文件管理GridFS的ID
|
||||
*/
|
||||
private String gridFsId;
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue