package com.crunii.micro.domain.entity.main;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.util.Date;

/**
 * @author qiaolin
 * @version 1.0
 * @date 2023/6/3 11:24
 */
@Entity
@Table(name = "ycq_obs_file")
@DynamicInsert
@DynamicUpdate
@Getter
@Setter
@ToString
@EqualsAndHashCode(of= {"id"})
@GenericGenerator(name = "idGenerator", strategy = "com.crunii.micro.core.distributed.DistributedSnowFlakeId")
@ApiModel(description = "华为云OBS表")
public class YcqObsFile {

    @Id
    @GeneratedValue(generator = "idGenerator")
    @Column(name = "id")
    @ApiModelProperty(value = "主键")
    private Long id;

    @Column(name = "bucket_name")
    @ApiModelProperty(value = "组织编码")
    private String bucketName;

    @Column(name = "object_key")
    @ApiModelProperty(value = "对象key")
    private String objectKey;

    @Column(name = "file_name")
    @ApiModelProperty(value = "文件名称")
    private String fileName;

    @Column(name = "create_time")
    @ApiModelProperty(value = "创建时间")
    private Date createTime;

    //@Column(name = "object_url")
    //@ApiModelProperty(value = "对象url")
    //private String objectUrl;

    @Column(name = "state")
    @ApiModelProperty(value = "1有效0失效")
    private Integer state;

    @Column(name = "type")
    @ApiModelProperty(value = "文件类型")
    private String type;

    @Column(name = "file_size")
    @ApiModelProperty(value = "文件大小")
    private String fileSize;

    @Column(name = "width")
    @ApiModelProperty(value = "图片宽度")
    private Integer width;

    @Column(name = "height")
    @ApiModelProperty(value = "图片高度")
    private Integer height;

    @Column(name = "is_pic")
    @ApiModelProperty(value = "服务编码")
    private Integer isPic;

    @Column(name = "service_code")
    @ApiModelProperty(value = "服务编码")
    private String serviceCode;

    @Column(name = "service_id")
    @ApiModelProperty(value = "服务ID")
    private Long serviceId;

    @Column(name = "compress_object_key")
    @ApiModelProperty(value = "缩略图对象key")
    private String compressObjectKey;

    @Column(name = "compress_status")
    @ApiModelProperty(value = "压缩状态")
    private Integer compressStatus;
}
