package com.sdtool.common.entity.site;

import com.sdtool.common.entity.base.BaseEntity;
import com.sdtool.common.tdoc.ApiPlace;
import com.sweetfish.util.Comment;
import org.rex.db.RColumn;

/**
 * Created by jlutt on 2020-07-31
 * ERP通用文件
 * @author jlutt
 */
public class ERPUploadFile extends BaseEntity {

    @Comment("id自增")
    @RColumn("id")
    private long id;

    @Comment("上传人")
    @RColumn("iduser")
    private long idUser;

    @Comment("上传人")
    @RColumn("username")
    private String userName;

    @Comment("文件类型 0设计 1公文")
    @RColumn("filekind")
    @ApiPlace("/upload/erpFile")
    private int fileKind;

    @Comment("文件名")
    @RColumn("srcfilename")
    private String srcFileName;

    @Comment("文件描述")
    @RColumn("filedescription")
    @ApiPlace("/upload/erpFile")
    private String fileDescription;

    @Comment("下载地址")
    @RColumn("downloadurl")
    private String downloadUrl;

    public ERPUploadFile() {
    }

    private ERPUploadFile(Builder builder) {
        setIdUser(builder.idUser);
        setUserName(builder.userName);
        setFileKind(builder.fileKind);
        setSrcFileName(builder.srcFileName);
        setFileDescription(builder.fileDescription);
        setDownloadUrl(builder.downloadUrl);
    }

    public static Builder newBuilder() {
        return new Builder();
    }


    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public long getIdUser() {
        return idUser;
    }

    public void setIdUser(long idUser) {
        this.idUser = idUser;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public int getFileKind() {
        return fileKind;
    }

    public void setFileKind(int fileKind) {
        this.fileKind = fileKind;
    }

    public String getSrcFileName() {
        return srcFileName;
    }

    public void setSrcFileName(String srcFileName) {
        this.srcFileName = srcFileName;
    }

    public String getDownloadUrl() {
        return downloadUrl;
    }

    public void setDownloadUrl(String downloadUrl) {
        this.downloadUrl = downloadUrl;
    }

    public String getFileDescription() {
        return fileDescription;
    }

    public void setFileDescription(String fileDescription) {
        this.fileDescription = fileDescription;
    }

    public static final class Builder {
        private long idUser;
        private String userName;
        private int fileKind;
        private String srcFileName;
        private String fileDescription;
        private String downloadUrl;

        private Builder() {
        }

        public Builder idUser(long val) {
            idUser = val;
            return this;
        }

        public Builder userName(String val) {
            userName = val;
            return this;
        }

        public Builder fileKind(int val) {
            fileKind = val;
            return this;
        }

        public Builder srcFileName(String val) {
            srcFileName = val;
            return this;
        }

        public Builder fileDescription(String val) {
            fileDescription = val;
            return this;
        }

        public Builder downloadUrl(String val) {
            downloadUrl = val;
            return this;
        }

        public ERPUploadFile build() {
            return new ERPUploadFile(this);
        }
    }
}
