package com.ruoyi.system.domain.webOffice;

import cn.ljserver.tool.weboffice.v3.model.FileInfo;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Builder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

import java.time.LocalDateTime;
import java.util.Date;

/**
 * webOffice附件记录对象 webOffice_fj
 * 
 * @author boman
 * @date 2024-05-20
 */
public class WebofficeFj {
    private static final long serialVersionUID = 1L;

    /** webOffice附件ID */
    private Long webofficeId;

    /** 附件id */
    private String fjId;

    /** 版本号 */
    private int version;

    /** 文件大小 */
    private Long size;

    /** 附件名称 */
    private String name;

    /** 附件地址 */
    private String url;

    /** 创建者 */
    private String createBy;

    /** 创建时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    /** 更新者 */
    private String updateBy;

    /** 更新时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;

    /** 创建者id */
    private String creatorId;

    /** 文档最后修改者 Id */
    private String modifierId;


    /** 备注 */
    private String remark;

    public Long getWebofficeId() {
        return webofficeId;
    }

    public void setWebofficeId(Long webofficeId) {
        this.webofficeId = webofficeId;
    }

    public String getFjId() {
        return fjId;
    }

    public void setFjId(String fjId) {
        this.fjId = fjId;
    }

    public int getVersion() {
        return version;
    }

    public void setVersion(int version) {
        this.version = version;
    }

    public Long getSize() {
        return size;
    }

    public void setSize(Long size) {
        this.size = size;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getCreateBy() {
        return createBy;
    }

    public void setCreateBy(String createBy) {
        this.createBy = createBy;
    }

    public LocalDateTime getCreateTime() {
        return createTime;
    }

    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }

    public String getUpdateBy() {
        return updateBy;
    }

    public void setUpdateBy(String updateBy) {
        this.updateBy = updateBy;
    }

    public LocalDateTime getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(LocalDateTime updateTime) {
        this.updateTime = updateTime;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public String getCreatorId() {
        return creatorId;
    }

    public void setCreatorId(String creatorId) {
        this.creatorId = creatorId;
    }

    public String getModifierId() {
        return modifierId;
    }

    public void setModifierId(String modifierId) {
        this.modifierId = modifierId;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("webofficeId", getWebofficeId())
            .append("fjId", getFjId())
            .append("version", getVersion())
            .append("size", getSize())
            .append("name", getName())
            .append("url", getUrl())
            .append("createBy", getCreateBy())
            .append("createTime", getCreateTime())
            .append("updateBy", getUpdateBy())
            .append("updateTime", getUpdateTime())
            .append("remark", getRemark())
            .toString();
    }

    /**
     * 转换为适用与web office的FileInfo
     */
    public FileInfo toFileInfo() {
        return FileInfo.builder()
                .id(this.fjId)
                .name(this.name)
                .version(this.version)
                .size(this.size)
                .createTime(this.createTime)
                .modifyTime(this.updateTime)
                .creatorId(this.creatorId)
                .modifierId(this.creatorId)
                .build();
    }
}
