package com.ruoyi.tool.domain; import com.ruoyi.common.annotation.Excel; import com.ruoyi.common.core.domain.BaseEntity; import com.ruoyi.common.utils.moonshot.vo.FileUploadResult; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; /** * 附件对象 t_unify_file * * @author ruoyi * @date 2024-02-23 */ public class TUnifyFile extends BaseEntity { private static final long serialVersionUID = 1L; /** 主键ID */ private String id; /** 文件ID */ @Excel(name = "文件ID") private String fileId; /** 文件名称 */ @Excel(name = "文件名称") private String uploadName; /** 文件类别 */ @Excel(name = "文件类别") private String uploadType; /** 文件地址 */ @Excel(name = "文件地址") private String uploadPath; /** 文件格式 */ @Excel(name = "文件格式") private String uploadFormat; /** 新文件名称 */ @Excel(name = "新文件名称") private String newUploadName; /** 状态 */ private String delFlag; /** 附件业务ID */ @Excel(name = "附件业务ID") private String fileBusinessId; /** * moonshot AI 参数 */ private String object; private String bytes; private String created_at; private String filename; private String purpose; private String status; private String status_details; /** * 附件内容 */ private String content; private String corpId; public void setId(String id) { this.id = id; } public String getId() { return id; } public void setFileId(String fileId) { this.fileId = fileId; } public String getFileId() { return fileId; } public void setUploadName(String uploadName) { this.uploadName = uploadName; } public String getUploadName() { return uploadName; } public void setUploadType(String uploadType) { this.uploadType = uploadType; } public String getUploadType() { return uploadType; } public void setUploadPath(String uploadPath) { this.uploadPath = uploadPath; } public String getUploadPath() { return uploadPath; } public void setUploadFormat(String uploadFormat) { this.uploadFormat = uploadFormat; } public String getUploadFormat() { return uploadFormat; } public void setNewUploadName(String newUploadName) { this.newUploadName = newUploadName; } public String getNewUploadName() { return newUploadName; } public void setDelFlag(String delFlag) { this.delFlag = delFlag; } public String getDelFlag() { return delFlag; } public void setFileBusinessId(String fileBusinessId) { this.fileBusinessId = fileBusinessId; } public String getFileBusinessId() { return fileBusinessId; } public String getObject() { return object; } public void setObject(String object) { this.object = object; } public String getBytes() { return bytes; } public void setBytes(String bytes) { this.bytes = bytes; } public String getCreated_at() { return created_at; } public void setCreated_at(String created_at) { this.created_at = created_at; } public String getFilename() { return filename; } public void setFilename(String filename) { this.filename = filename; } public String getPurpose() { return purpose; } public void setPurpose(String purpose) { this.purpose = purpose; } public String getStatus() { return this.status; } public void setStatus(String status) { this.status = status; } public String getStatus_details() { return status_details; } public void setStatus_details(String status_details) { this.status_details = status_details; } public String getContent() { return content; } public void setContent(String content) { this.content = content; } public String getCorpId() { return corpId; } public void setCorpId(String corpId) { this.corpId = corpId; } @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) .append("id", getId()) .append("fileId", getFileId()) .append("uploadName", getUploadName()) .append("uploadType", getUploadType()) .append("uploadPath", getUploadPath()) .append("uploadFormat", getUploadFormat()) .append("newUploadName", getNewUploadName()) .append("delFlag", getDelFlag()) .append("fileBusinessId", getFileBusinessId()) .append("createBy", getCreateBy()) .append("createTime", getCreateTime()) .append("updateBy", getUpdateBy()) .append("updateTime", getUpdateTime()) .toString(); } /** * 自定义的复制方法,忽略空值 * @param other * @param ignoreNulls */ public void copyFrom(FileUploadResult other, boolean ignoreNulls) { if (other == null) { throw new IllegalArgumentException("Other object cannot be null"); } if (ignoreNulls) { this.setFileId(other.getId() != null && StringUtils.isNotEmpty(other.getId()) ? other.getId() : this.getFileId()); this.setObject(other.getObject() != null && StringUtils.isNotEmpty(other.getObject()) ? other.getObject() : this.getObject()); this.setBytes(other.getBytes() != null && StringUtils.isNotEmpty(other.getBytes()) ? other.getBytes() : this.getBytes()); this.setCreated_at(other.getCreated_at() != null && StringUtils.isNotEmpty(other.getCreated_at()) ? other.getCreated_at() : this.getCreated_at()); this.setFilename(other.getFilename() != null && StringUtils.isNotEmpty(other.getFilename()) ? other.getFilename() : this.getFilename()); this.setPurpose(other.getPurpose() != null && StringUtils.isNotEmpty(other.getPurpose()) ? other.getPurpose() : this.getPurpose()); this.setStatus(other.getStatus() != null && StringUtils.isNotEmpty(other.getStatus()) ? other.getStatus() : this.getStatus()); this.setStatus_details(other.getStatus_details() != null && StringUtils.isNotEmpty(other.getStatus_details()) ? other.getStatus_details() : this.getStatus_details()); } else { // 如果不忽略空值,则直接复制 this.setFileId(other.getId()); this.setObject(other.getObject()); this.setBytes(other.getBytes()); this.setCreated_at(other.getCreated_at()); this.setFilename(other.getFilename()); this.setPurpose(other.getPurpose()); this.setStatus(other.getStatus()); this.setStatus_details(other.getStatus_details()); } } }