package org.framework.lazy.cloud.network.heartbeat.server.init;

import lombok.extern.slf4j.Slf4j;
import org.framework.lazy.cloud.network.heartbeat.server.standalone.application.LazyInternalNetworkServerPermeateServerMappingApplication;
import org.springframework.boot.CommandLineRunner;
import org.springframework.context.annotation.Configuration;

/**
 * 初始化服务端内网渗透socket
 */
@Slf4j
@Configuration
public class InitServerPermeateSocket implements CommandLineRunner {
    private final LazyInternalNetworkServerPermeateServerMappingApplication lazyInternalNetworkServerPermeateServerMappingApplication;

    public InitServerPermeateSocket(LazyInternalNetworkServerPermeateServerMappingApplication lazyInternalNetworkServerPermeateServerMappingApplication) {
        this.lazyInternalNetworkServerPermeateServerMappingApplication = lazyInternalNetworkServerPermeateServerMappingApplication;
    }

    @Override
    public void run(String... args) throws Exception {
        try {
            lazyInternalNetworkServerPermeateServerMappingApplication.initPermeateSocket();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
