package cn.estsh.i3plus.pojo.mdm.bean.busi;

import cn.estsh.i3plus.pojo.base.bean.BaseBean;
import cn.estsh.i3plus.pojo.base.enumutil.MdmEnumUtil;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiParam;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

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

/**
 * @Description :
 * @Reference :
 * @Author : yunhao
 * @CreateDate : 2021-03-29 17:37
 * @Modify:
 **/
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name = "MDM_DATA_SUBSCRIBE_DETAIL")
@ApiModel("数据订阅明细")
public class MdmDataSubscribeDetail extends BaseBean {

    private static final long serialVersionUID = -741233265567034262L;

    @Column(name = "DATA_SUBSCRIBE_ID")
    @ApiParam("数据订阅id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long dataSubscribeId;

    @Column(name = "APP_ID")
    @ApiParam("应用id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long appId;

    @Column(name = "APP_TYPE")
    @ApiParam("应用类型")
    private Integer appType;

    public int getAppTypeVal() {
        return appType == null ? MdmEnumUtil.MDM_SYNC_APP_TYPE.INTERNAL.getValue() : appType;
    }

    @Column(name = "APP_NAME")
    @ApiParam("应用名称")
    private String appName;
}
