package cn.estsh.i3plus.pojo.softswitch.bean;

import cn.estsh.i3plus.pojo.base.bean.BaseBean;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.Api;
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;
import javax.persistence.Transient;
import java.util.List;

/**
 * @Description : 适配认证
 * @Reference :
 * @Author : yunhao
 * @CreateDate : 2019-08-13 9:21
 * @Modify:
 */
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name = "BS_SSL_KEY")
@Api(value = "适配认证", description = "适配认证")
public class BsSslKey extends BaseBean {

    private static final long serialVersionUID = 3934205467948800784L;
    @Column(name = "KEY_NAME")
    @ApiParam(value = "证书名称")
    private String keyName;

    @Column(name = "VERIFICATION_METHOD_ID")
    @ApiParam(value = "认证方式(枚举)")
    private Integer verificationMethodId;

    @Column(name = "VERIFICATION_URL")
    @ApiParam(value = "认证url")
    private String verificationUrl;

    //CommonEnumUtil.HTTP_METHOD_TYPE
    @Column(name = "REQUEST_METHOD_ID")
    @ApiParam(value = "请求方式id")
    private Integer requestMethodId;

    @Column(name = "KEY_TYPE_ID")
    @ApiParam(value = "证书类型枚举")
    private Integer keyTypeId;

    @Column(name = "KEY_FILE_ID")
    @ApiParam(value = "证书文件id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long keyFileId;

    @Column(name = "KEY_FILE_PATH")
    @ApiParam(value = "证书文件路径")
    private String keyFilePath;

    @Column(name = "KEY_FILE_NAME")
    @ApiParam(value = "证书文件名称")
    private String keyFileName;

    @Column(name = "KEY_CONTENT")
    @ApiParam(value = "秘钥内容")
    private String keyContent;

    @Column(name = "KEY_DESCRIPTION")
    @ApiParam(value = "证书描述")
    private String keyDescription;

    @Column(name = "KEY_USER_NAME")
    @ApiParam(value = "证书账号")
    private String keyUserName;

    @Column(name = "KEY_PASSWORD")
    @ApiParam(value = "证书密码")
    private String keyPassword;

    @Transient
    @ApiParam(value = "证书参数集合")
    private List<BsSslKeyParam> bsSslKeyParamList;

}

