package com.njzscloud.common.ws.config;

import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.util.unit.DataSize;

import java.time.Duration;

/**
 * websocket 配置
 */
@Getter
@Setter
@ConfigurationProperties("ws")
public class WebsocketProperties {
    /**
     * websocket 请求地址, 默认 /fdx
     */
    private String path = "/fdx";

    /**
     * 发送超时时间
     */
    private Duration asyncSendTimeout;

    /**
     * 会话超时时间, 默认 15min
     */
    private Duration maxSessionIdleTimeout = Duration.ofMinutes(15);

    /**
     * 文本消息缓存大小, 默认 2MB
     */
    private DataSize maxTextMessageBufferSize = DataSize.ofMegabytes(2);

    /**
     * 二进制消息缓存大小, 默认 2MB
     */
    private DataSize maxBinaryMessageBufferSize = DataSize.ofMegabytes(2);
}
