package cn.axzo.workflow.core.common.event;

import lombok.extern.slf4j.Slf4j;
import org.springframework.context.ApplicationEvent;

/**
 * Api Log Event 事件对象
 *
 * @author wangli
 * @since 2024/4/3 10:35
 */
@Slf4j
public class ApiLogEvent extends ApplicationEvent {
    private String traceId;
    private String apiUrl;
    private Object requestBody;
    private Object responseBody;
    private Double takeTime;
    private String type;

    public ApiLogEvent(String traceId, String apiUrl, Object requestBody, Object responseBody, Double takeTime, String type) {
        super(apiUrl);
        this.traceId = traceId;
        this.apiUrl = apiUrl;
        this.requestBody = requestBody;
        this.responseBody = responseBody;
        this.takeTime = takeTime;
        this.type = type;
    }

    public String getTraceId() {
        return traceId;
    }

    public void setTraceId(String traceId) {
        this.traceId = traceId;
    }

    public String getApiUrl() {
        return apiUrl;
    }

    public Object getRequestBody() {
        return requestBody;
    }

    public Object getResponseBody() {
        return responseBody;
    }

    public Double getTakeTime() {
        return takeTime;
    }

    public String getType() {
        return type;
    }
}
