package com.brframework.webapppatch.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.brframework.commoncms.annatotion.column.SelectColumn;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.*;
import java.time.LocalDateTime;

/**
 * 热更新分支
 *
 * @author xu
 * @date 2019/11/14 10:23
 */
@Entity
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@ApiModel
@Table(name = "sys_patch_branch")
public class PatchBranch {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @ApiModelProperty(value = "id", required = true, example = "1")
    Long id;

    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "创建时间", required = true, example = "2019-04-24 16:23:19")
    @Column(updatable = false)
    LocalDateTime createDate;

    @ApiModelProperty(value = "操作系统", required = true, example = "Android,IOS")
    @SelectColumn(options = {"Android,Android", "IOS,IOS"})
    String os;

    @ApiModelProperty(value = "分支名", required = true, example = "新分支")
    String branchName;

    @ApiModelProperty(value = "分支描述", required = true, example = "这个分支新的功能准备的")
    String branchDetail;

    @ApiModelProperty(value = "基础包更新时间", required = true, example = "2019-04-24 16:23:19")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    LocalDateTime basePackageUpdateDate;

    @ApiModelProperty(value = "基础包下载地址", required = true, example = "http://...")
    String basePackageUrl;

    @ApiModelProperty(value = "基础包大小", required = true, example = "1234654")
    Long basePackageSize;

}
