package com.fzm.mall.customer.service;

import com.fzm.mall.customer.service.websocket.WebSocketMsgServer;
import com.fzm.mall.customer.service.websocket.WebSocketServer;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.ApplicationPidFileWriter;
import org.springframework.context.ConfigurableApplicationContext;

@SpringBootApplication
public class MallCustomerServiceApplication {

    public static void main(String[] args) {
        SpringApplication springApplication = new SpringApplication(MallCustomerServiceApplication.class);
        springApplication.addListeners(new ApplicationPidFileWriter());
        ConfigurableApplicationContext applicationContext = springApplication.run(args);
        WebSocketServer.setApplicationContext(applicationContext);
        WebSocketMsgServer.setApplicationContext(applicationContext);
    }

}
