import { startWebSocketServer, pushToMerchant, broadcastToAll } from './server';
import { bindEventToWebSocket } from './broadcast';

// 启动WebSocket系统
const startWebSocketSystem = (): void => {
  console.log('[WebSocket System] Starting WebSocket system...');
  
  // 启动WebSocket服务器
  startWebSocketServer();
  
  // 绑定事件到WebSocket推送
  bindEventToWebSocket();
  
  console.log('[WebSocket System] WebSocket system started successfully');
};

export {
  startWebSocketSystem,
  pushToMerchant,
  broadcastToAll,
  bindEventToWebSocket
};

export default {
  startWebSocketSystem,
  pushToMerchant,
  broadcastToAll,
  bindEventToWebSocket
};
