package cn.meowrain.aioj.backend.aiservice.config;

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

/**
 * gRPC 客户端配置属性
 */
@Component
@ConfigurationProperties(prefix = "grpc.client")
public class GrpcClientProperties {

    /**
     * gRPC 服务器地址
     */
    private String host = "localhost";

    /**
     * gRPC 服务器端口
     */
    private int port = 50051;

    /**
     * 连接超时时间（秒）
     */
    private int timeout = 10;

    /**
     * 是否启用 TLS
     */
    private boolean tlsEnabled = false;

    /**
     * 最大消息大小（字节）
     */
    private int maxMessageSize = 10 * 1024 * 1024; // 10MB

    public String getHost() {
        return host;
    }

    public void setHost(String host) {
        this.host = host;
    }

    public int getPort() {
        return port;
    }

    public void setPort(int port) {
        this.port = port;
    }

    public int getTimeout() {
        return timeout;
    }

    public void setTimeout(int timeout) {
        this.timeout = timeout;
    }

    public boolean isTlsEnabled() {
        return tlsEnabled;
    }

    public void setTlsEnabled(boolean tlsEnabled) {
        this.tlsEnabled = tlsEnabled;
    }

    public int getMaxMessageSize() {
        return maxMessageSize;
    }

    public void setMaxMessageSize(int maxMessageSize) {
        this.maxMessageSize = maxMessageSize;
    }
}
