package com.usky.issue.domain;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDateTime;

/**
 * 云平台配置
 *
 * @author fyc
 * @date 2026-05-21
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("issue_cloud_config")
public class IssueCloudConfig extends CloudAuditEntity {

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /** 云平台地址 */
    private String cloudAddress;

    /** AES-256-GCM加密后的凭证密钥 */
    private String credentialKey;

    /** 0禁用 1启用 */
    private Integer status;

    /** 0未知 1成功 2失败 */
    private Integer connectionStatus;

    // @Version
    private Integer version;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime lastTestTime;

    @TableField(exist = false)
    private String token;
}
