package com.njcn.roma.listener;

import com.njcn.roma.client.ClientHandler;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Component;

/**
 * roma
 *
 * @author cdf
 * @date 2024/7/2
 */

@Slf4j
@Component
@RequiredArgsConstructor
public class ClientListener {

    private final ClientHandler clientHandler;

    @EventListener
    public void onApplicationEvent(ContextRefreshedEvent event) {
        log.info("启动时自动执行  @EventListener 注解方法");

        clientHandler.start();

    }
}
