package com.bocloud.ims.entity.resource.powervc;

import com.bocloud.common.utils.DateDeserializer;
import com.bocloud.common.utils.DateSerializer;
import com.bocloud.entity.annotations.Column;
import com.bocloud.entity.annotations.PK;
import com.bocloud.entity.annotations.Table;
import com.bocloud.entity.meta.PKStrategy;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * powervc验证环境结果
 *
 * @author lkx007
 */
@Table("validate_result")
public class ValidateResult {
    @PK(value = PKStrategy.AUTO)
    private Long id; // ID
    /**
     * 平台id
     */
    @Column("vendor_id")
    private Long vendorId;
    /**
     * 被验证系统对象的名称
     * powervc返回的字段名为ip
     * <p>
     * 192.168.2.62
     * <p>
     * Server-8203:VIOS
     * <p>
     * Server-8203
     */
    @Column("system_name")
    private String system;
    /**
     * 验证结果消息
     * <p>
     * 交换机的固件级别必须为 6.4.0 或更高级别。而它当前的固件级别为 5.2.1。
     */
    @Column("msg")
    private String msg;
    /**
     * 验证结果类型
     * powervc返回的字段名为msg-id
     * <p>
     * BROCADE_FABRIC_CONFIGURATION_ERROR
     * <p>
     * MANAGEMENT_SERVER_OS_SERVICE
     */
    @Column("msg_id")
    private String msgId;
    /**
     * 当status为fail不是pass的时候，有response这个字段，用来提供解决方案的提示信息
     * powervc返回的字段名为response
     * <p>
     * 请将交换机的固件级别更新为 6.4.0 或更高级别。
     */
    @Column("solution")
    private String solution;
    /**
     * 验证成功，status为pass，显示为绿色
     * 验证失败，status为fail，显示为红色
     * 验证警告，status为warning，显示为黄色
     */
    @Column("status")
    private String status;
    /**
     * 不知道啥意思的字段
     * powervc返回的字段名为val_check_id
     * <p>
     * BROCADE_FABRIC_FIRMWARE
     */
    @Column("check_id")
    private String checkId;
    /**
     * 验证类别
     * powervc返回的字段名为group-description
     * <p>
     * SVC 存储器验证
     * <p>
     * HMC 版本验证
     */
    @Column("group_description")
    private String groupDescription;
    /**
     * 验证时间
     * <p>
     * powervc返回的字段名为stop-time
     */
    @Column("gmt_create")
    @JsonSerialize(using = DateSerializer.class)
    @JsonDeserialize(using = DateDeserializer.class)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date gmtCreate;

    public ValidateResult() {
        super();
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getSystem() {
        return system;
    }

    public void setSystem(String system) {
        this.system = system;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public String getMsgId() {
        return msgId;
    }

    public void setMsgId(String msgId) {
        this.msgId = msgId;
    }

    public String getSolution() {
        return solution;
    }

    public void setSolution(String solution) {
        this.solution = solution;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getCheckId() {
        return checkId;
    }

    public void setCheckId(String checkId) {
        this.checkId = checkId;
    }

    public String getGroupDescription() {
        return groupDescription;
    }

    public void setGroupDescription(String groupDescription) {
        this.groupDescription = groupDescription;
    }

    public Date getGmtCreate() {
        return gmtCreate;
    }

    public void setGmtCreate(Date gmtCreate) {
        this.gmtCreate = gmtCreate;
    }

    public Long getVendorId() {
        return vendorId;
    }

    public void setVendorId(Long vendorId) {
        this.vendorId = vendorId;
    }
}
