package org.jeecg.modules.doc.entity; import java.io.Serializable; import java.io.UnsupportedEncodingException; import java.util.Date; import java.math.BigDecimal; import cn.hutool.core.util.IdUtil; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.Data; import com.fasterxml.jackson.annotation.JsonFormat; import lombok.ToString; import org.jeecg.common.util.DateUtils; import org.jeecg.modules.doc.constant.Constant; import org.jeecg.modules.doc.vo.QiwenFile; import org.springframework.format.annotation.DateTimeFormat; import org.jeecgframework.poi.excel.annotation.Excel; import org.jeecg.common.aspect.annotation.Dict; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; /** * @Description: doc_file_path * @Author: jeecg-boot * @Date: 2022-07-04 * @Version: V1.0 */ @Data @ToString @TableName("doc_file_path") @Accessors(chain = true) @EqualsAndHashCode(callSuper = false) @ApiModel(value="doc_file_path对象", description="doc_file_path") public class DocFilePath implements Serializable { private static final long serialVersionUID = 1L; /**pathId*/ @TableId @Excel(name = "pathId", width = 15) @ApiModelProperty(value = "pathId") private String pathId; /**删除批次号*/ @Excel(name = "删除批次号", width = 15) @ApiModelProperty(value = "删除批次号") private String deleteBatchNum; /**删除标识(0-未删除,1-已删除)*/ @Excel(name = "删除标识(0-未删除,1-已删除)", width = 15) @ApiModelProperty(value = "删除标识(0-未删除,1-已删除)") private Integer deleteFlag; /**删除时间*/ @Excel(name = "删除时间", width = 15) @ApiModelProperty(value = "删除时间") private String deleteTime; /**扩展名*/ @Excel(name = "扩展名", width = 15) @ApiModelProperty(value = "扩展名") private String extendName; /**文件id*/ @Excel(name = "文件id", width = 15) @ApiModelProperty(value = "文件id") private String fileId; /**文件名*/ @Excel(name = "文件名", width = 15) @ApiModelProperty(value = "文件名") private String fileName; /**文件路径*/ @Excel(name = "文件路径", width = 15) @ApiModelProperty(value = "文件路径") private String filePath; /**是否是目录(0-否,1-是)*/ @Excel(name = "是否是目录(0-否,1-是)", width = 15) @ApiModelProperty(value = "是否是目录(0-否,1-是)") private Integer isDir; /**创建人*/ @ApiModelProperty(value = "创建人") private String createBy; /**创建时间*/ @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @ApiModelProperty(value = "创建时间") private Date createTime; /**更新人*/ @ApiModelProperty(value = "更新人") private String updateBy; /**更新时间*/ @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @ApiModelProperty(value = "更新时间") private Date updateTime; /**文件状态(0-未发布,1-已发布)*/ @Excel(name = "发布标识(0-未发布,1-已发布)", width = 15) @ApiModelProperty(value = "发布标识(0-未发布,1-已发布)") private Integer pathStatus; /**父级id*/ private String parentId; @TableField(exist = false) private Long fileSize; @TableField(exist = false) private boolean permission; public DocFilePath(){ }; public DocFilePath(String pathId) { this.pathId = pathId; }; public DocFilePath(QiwenFile qiwenFile, String fileId) { this.pathId = IdUtil.getSnowflakeNextIdStr(); this.fileId = fileId; this.filePath = qiwenFile.getParent(); this.fileName = qiwenFile.getNameNotExtend(); this.extendName = qiwenFile.getExtendName(); this.isDir = qiwenFile.isDirectory() ? Constant.IS_DIR : Constant.IS_NOT_DIR; this.updateTime = DateUtils.getDate(); this.deleteFlag = Constant.DEL_FALSE; } public DocFilePath(QiwenFile qiwenFile, String updateBy, String fileId) { this.pathId = IdUtil.getSnowflakeNextIdStr(); this.updateBy = updateBy; this.fileId = fileId; this.filePath = qiwenFile.getParent(); this.fileName = qiwenFile.getNameNotExtend(); this.extendName = qiwenFile.getExtendName(); this.isDir = qiwenFile.isDirectory() ? Constant.IS_DIR : Constant.IS_NOT_DIR; this.updateTime = DateUtils.getDate(); this.deleteFlag = Constant.DEL_FALSE; } @JsonIgnore public boolean isDirectory() { return this.isDir == Constant.IS_DIR; } @JsonIgnore public boolean isFile() { return this.isDir == Constant.IS_NOT_DIR; } }