ServiceInfo.java 2.04 KB
package vion.model.monitor;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Getter;
import lombok.Setter;
import vion.config.mp.JsonbTypeHandler;
import vion.dto.BaseDTO;

import java.time.LocalDateTime;

/**
 * 服务信息
 */
@Getter
@Setter
@TableName(value = "m_service", autoResultMap = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class ServiceInfo extends BaseDTO {
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 唯一标识
     */
    @TableField(value = "uid")
    private String uid;

    /**
     * 名称
     */
    @TableField(value = "name", condition = SqlCondition.LIKE)
    private String name;

    /**
     * 请求路径:http(s)://ip(:port)/path
     */
    @TableField(value = "url")
    private String url;

    /**
     * 请求方法
     */
    @TableField(value = "\"method\"")
    private String method;

    /**
     * 请求头
     */
    @TableField(value = "req_headers", typeHandler = JsonbTypeHandler.class)
    private Object reqHeaders;

    /**
     * 请求体
     */
    @TableField(value = "req_body", typeHandler = JsonbTypeHandler.class)
    private Object reqBody;

    /**
     * 响应结果(包含)
     */
    @TableField(value = "res_body")
    private String resBody;

    /**
     * 监控类型:HTTP(s)
     */
    @TableField(value = "\"type\"")
    private String type;

    /**
     * 用户名
     */
    @TableField(value = "username")
    private String username;

    /**
     * 密码
     */
    @TableField(value = "\"password\"")
    private String password;

    /**
     * 描述
     */
    @TableField(value = "description")
    private String description;

    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    @TableField(exist = false)
    private ServiceRecord serviceRecord;

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