package org.wcs.starter;

import jakarta.annotation.Resource;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
import org.wcs.plugin.webHttpClient.WebHttpClient;
import org.wcs.plugin.webHttpClient.intef.IHttpRequestEvent;

/**
 * 组件注册启动类
 */
@Order(1)
@Slf4j
@Component
@RequiredArgsConstructor
public class ComponentRegisterStarter implements ApplicationRunner {

    @Resource(name = "HttpRequestRecord")
    private final IHttpRequestEvent httpRequestRecord;

    @Override
    public void run(ApplicationArguments args) throws Exception {
        WebHttpClient.registerHttpRequestEvent(httpRequestRecord); // 注册HTTP请求事件 ---- 数据记录器

    }
}
