package cn.reghao.tnb.data.app.model;

import lombok.Data;
import org.springframework.data.mongodb.core.mapping.Document;

import java.time.LocalDateTime;
import java.util.Map;

/**
 * @author reghao
 * @date 2024-11-20 16:40:24
 */
@Data
@Document("GatewayLog")
public class GatewayLog {
    private String requestId;
    private String targetRoute;
    private String targetService;
    private String requestUrl;
    private String requestMethod;
    private Map<String, String> requestHeaders;
    private String requestBody;
    private LocalDateTime requestTime;
    private String remoteAddr;
    private int remotePort;
    private int statusCode;
    private Map<String, String> responseHeaders;
    private String responseBody;
    private LocalDateTime responseTime;
    // ms
    private long executeTime;

    public GatewayLog() {
        this.remoteAddr = "";
        this.remotePort = 0;
    }
}
