package com.tofly.ghrq_route.module.uploadFile.domain;

import com.google.gson.annotations.SerializedName;

import java.io.Serializable;

/**
 * Created by Amu on 2017/3/13.
 */

public class UploadFileBean implements Serializable {

    /**
     * id : 9D1CC609B7144559975714141910E00D
     * sid : 100157
     * tableid : 10C309F55FEF45B28B5CD76CDE883EB7
     * tablename : tf_trouble
     * filetype : application/octet-stream
     * filenote : 隐患发现
     * filename : Upload/2017-03/a5fb6899-2751-4434-a187-ff9dcf8b4916.png
     * filelength : 126372
     * upload_time : 2017-03-10T14:20:50
     * upload_userid : 3
     * upload_username : 穆国庆
     * upload_equid : 81213AEC9FA04AC3A6D62A0681610EC0
     * upload_note : ea011e62-4b93-42c7-a664-ede0a8c7b676.png
     */

    public static final String FILE_NOTE_DANGER_PHOTO_BEFORE = "隐患发现";
    public static final String FILE_NOTE_DANGER_AUDIO_BEFORE = "隐患前音频";

    public static final String FILE_NOTE_BUILD_NOTICE_PHOTO = "gaozhishu";
    public static final String FILE_NOTE_BUILD_NOTICE_AUDIO = "gaozhishuaudio";

    public static final String FILE_TABLE_TROUBLE = "trouble_file_table";
    public static final String FILE_TABLE_BUILD_MANAGE = "build_manage_file_table";
    public static final String FILE_TABLE_BUILD_REPORT = "build_report_file_table";
    public static final String FILE_TABLE_PLAN_REPAIR = "plan_repair_file_table";

    private String id;
    private String sid;
    private String tableid;
    private String tablename;
    private String filetype;
    private String filenote;
    private String filename;
    @SerializedName(value = "filepath", alternate = "path")
    private String filepath;
    private String filelength;
    @SerializedName(value = "upload_time", alternate = "uploadTime")
    private String upload_time;
    @SerializedName(value = "upload_userid", alternate = "uploadUserid")
    private String upload_userid;
    @SerializedName(value = "upload_username", alternate = "uploadUsername")
    private String upload_username;
    @SerializedName(value = "upload_equid", alternate = "uploadEquid")
    private String upload_equid;
    @SerializedName(value = "upload_note", alternate = "uploadNote")
    private String upload_note;
    private String audiolength;

    public String getId() {
        return id;
    }

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

    public String getSid() {
        return sid;
    }

    public void setSid(String sid) {
        this.sid = sid;
    }

    public String getTableid() {
        return tableid;
    }

    public void setTableid(String tableid) {
        this.tableid = tableid;
    }

    public String getTablename() {
        return tablename;
    }

    public void setTablename(String tablename) {
        this.tablename = tablename;
    }

    public String getFiletype() {
        return filetype;
    }

    public void setFiletype(String filetype) {
        this.filetype = filetype;
    }

    public String getFilenote() {
        return filenote;
    }

    public void setFilenote(String filenote) {
        this.filenote = filenote;
    }

    public String getFilename() {
        return filename;
    }

    public void setFilename(String filename) {
        this.filename = filename;
    }

    public String getFilepath() {
        return filepath;
    }

    public void setFilepath(String filepath) {
        this.filepath = filepath;
    }

    public String getFilelength() {
        return filelength;
    }

    public void setFilelength(String filelength) {
        this.filelength = filelength;
    }

    public String getUpload_time() {
        return upload_time;
    }

    public void setUpload_time(String upload_time) {
        this.upload_time = upload_time;
    }

    public String getUpload_userid() {
        return upload_userid;
    }

    public void setUpload_userid(String upload_userid) {
        this.upload_userid = upload_userid;
    }

    public String getUpload_username() {
        return upload_username;
    }

    public void setUpload_username(String upload_username) {
        this.upload_username = upload_username;
    }

    public String getUpload_equid() {
        return upload_equid;
    }

    public void setUpload_equid(String upload_equid) {
        this.upload_equid = upload_equid;
    }

    public String getUpload_note() {
        return upload_note;
    }

    public void setUpload_note(String upload_note) {
        this.upload_note = upload_note;
    }

    public String getAudiolength() {
        return audiolength;
    }

    public void setAudiolength(String audiolength) {
        this.audiolength = audiolength;
    }

    public boolean isFileTypeAudio(){
        boolean isAudio = false;
        if (filetype != null && !filetype.isEmpty()){
            isAudio = filetype.startsWith("audio");
        }
        return isAudio;
    }

    public boolean isFileTypeImage(){
        boolean isImage = false;
        if (filetype != null && !filetype.isEmpty()){
            isImage = filetype.startsWith("image");
        }
        return isImage;
    }

}
