package com.qmth.themis.business.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.qmth.themis.business.base.BaseEntity;
import com.qmth.themis.business.enums.ClientVersionTypeEnum;
import com.qmth.themis.business.util.UidUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

/**
 * @Description: 客户端版本
 * @Param:
 * @return:
 * @Author: wangliang
 * @Date: 2020/6/25
 */
@ApiModel(value = "t_b_client_version", description = "客户端版本")
public class TBClientVersion extends BaseEntity {

    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "机构id")
    private Long orgId;

    @ApiModelProperty(value = "版本名")
    @TableField(value = "name")
    private String name;

    @ApiModelProperty(value = "版本号")
    @TableField(value = "value")
    private Integer value;

    @ApiModelProperty(value = "版本详情链接")
    @TableField(value = "url")
    private String url;

    @ApiModelProperty(value = "版本描述")
    @TableField(value = "description")
    private String description;

    @ApiModelProperty(value = "是否启用，0：停用，1：启用")
    @TableField(value = "enable")
    private Integer enable = 1;

    @ApiModelProperty(value = "类型，ONLINE：线上，UPLOAD：客户端上传")
    private ClientVersionTypeEnum type;

    public TBClientVersion() {

    }

    public TBClientVersion(Long orgId, String url, String description, ClientVersionTypeEnum type) {
        setId(UidUtil.nextId());
        this.orgId = orgId;
        this.url = url;
        this.description = description;
        this.name = description;
        this.type = type;
        this.value = 1;
        setCreateTime(System.currentTimeMillis());
    }

    public Long getOrgId() {
        return orgId;
    }

    public void setOrgId(Long orgId) {
        this.orgId = orgId;
    }

    public ClientVersionTypeEnum getType() {
        return type;
    }

    public void setType(ClientVersionTypeEnum type) {
        this.type = type;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getValue() {
        return value;
    }

    public void setValue(Integer value) {
        this.value = value;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getDescription() {
        return description;
    }

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

    public Integer getEnable() {
        return enable;
    }

    public void setEnable(Integer enable) {
        this.enable = enable;
    }
}
