package com.shzg.project.worn.websocket.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * WebSocket 配置属性
 */
@Data
@Component
@ConfigurationProperties(prefix = "websocket")
public class WebSocketProperties {

    /**
     * 连接数限制
     */
    private MaxConnections maxConnections = new MaxConnections();

    @Data
    public static class MaxConnections {

        /**
         * 单用户最大连接数
         */
        private int user = 5;

        /**
         * 单IP最大连接数
         */
        private int ip = 10;

        /**
         * 全局最大连接数
         */
        private int global = 1000;
    }
}