package com.ssyf.ws.constants;

/**
 * WebSocket常量定义
 */
public class WebSocketConstants {
    
    // Session属性键
    public static final String SESSION_ATTR_USER_ID = "userId";
    public static final String SESSION_ATTR_USERNAME = "username";
    public static final String SESSION_ATTR_AUTHENTICATED = "authenticated";
    public static final String SESSION_ATTR_LOGIN_TIME = "loginTime";
    
    // Redis键前缀
    public static final String REDIS_USER_SESSION_PREFIX = "ws:user:session:";
    public static final String REDIS_USER_STATUS_PREFIX = "ws:user:status:";
    public static final String REDIS_MESSAGE_QUEUE_PREFIX = "ws:message:queue:";
    
    // 心跳配置
    public static final long HEARTBEAT_INTERVAL = 30000L; // 30秒
    public static final long HEARTBEAT_TIMEOUT = 90000L; // 90秒
    
    // 消息配置
    public static final int MAX_MESSAGE_SIZE = 8192; // 8KB

    //token
    public static final String TOKEN_KEY = "token";
    
    private WebSocketConstants() {
        // 常量类，防止实例化
    }
}