package com.zhangmeng.model.entity;

import com.zhangmeng.model.base.baseEntity.BaseEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * @author zhengmeng
 * @version 1.0
 * @date 2021年1月7日17:44:40
 */
@NoArgsConstructor
@Data
@AllArgsConstructor
@Entity
@EqualsAndHashCode(callSuper = false)
@Table(name = "file_info")
public class FileInfo extends BaseEntity<Long> {

    /**
     * 存储类型
     */

    public enum StorageType{
        LocalStorage("本地"),
        FastDFS("fastDFS");

        /**
         * 描述
         */
        private String description;

        private StorageType(String description) {
            this.description = description;
        }

        public String getDesc() {
            return description;
        }

        public void setDesc(String description) {
            this.description = description;
        }
    }

    /**
     * 上传的类型
     */
    public enum UploadType {

        images("图片"),
        video("视频"),
        audio("视频");

        /**
         * 描述
         */
        private String description;

        private UploadType(String description) {
            this.description = description;
        }

        public String getDesc() {
            return description;
        }

        public void setDesc(String description) {
            this.description = description;
        }
    }

    /**
     * 文件的格式
     */
    public enum FileType {
        jpeg("图片"),
        jpg("图片"),
        png("图片"),
        bmp("图片"),
        gif("图片"),
        svg("图片"),
        mp4("视频"),
        avi("视频"),
        flv("视频");
        /**
         * 描述
         */
        private String description;

        private FileType(String description) {
            this.description = description;
        }

        public String getDesc() {
            return description;
        }

        public void setDesc(String description) {
            this.description = description;
        }
    }

    private UploadType uploadType;//上传类型

    private StorageType storageType;

    private String path;//上传的路径

    private String fullPath;//上传的真实全路径

    private Integer imageWidth;//上传图片的宽度

    private Integer imageHeight;//上传图片的高度

    private String videoImages;//视频的封面

    private Integer videoImagesWidth;//视频封面的宽

    private Integer videoImagesHeight;//视频封面的高

    private Long duration;//时长

    private String fileTypeString;//文件格式字符传

    private FileType fileType;

    private Long size;//文件的大小

    private String fileSize;//文件大小

    private String md5;//md5

    private String originalFileName;

    private String name;

    private String ext;//文件扩展名

    private String author;//文件创建作者

    private Long user_id;

    private Long image_info_expand_id;
}
