package org.xyzh.workcase.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

/**
 * @description Jitsi Meet 配置属性类
 * @filename JitsiProperties.java
 * @author claude
 * @copyright xyzh
 * @since 2025-12-27
 */
@Configuration
@ConfigurationProperties(prefix = "jitsi")
public class JitsiProperties {

    /**
     * 应用配置
     */
    private App app = new App();

    /**
     * 服务器配置
     */
    private Server server = new Server();

    /**
     * Token配置
     */
    private Token token = new Token();

    public App getApp() {
        return app;
    }

    public void setApp(App app) {
        this.app = app;
    }

    public Server getServer() {
        return server;
    }

    public void setServer(Server server) {
        this.server = server;
    }

    public Token getToken() {
        return token;
    }

    public void setToken(Token token) {
        this.token = token;
    }

    /**
     * 应用配置
     */
    public static class App {
        /**
         * 应用ID（必须与Docker配置中的JWT_APP_ID一致）
         */
        private String id = "urbanLifeline";

        /**
         * JWT密钥（必须与Docker配置中的JWT_APP_SECRET一致）
         */
        private String secret = "your-secret-key-change-in-production";

        public String getId() {
            return id;
        }

        public void setId(String id) {
            this.id = id;
        }

        public String getSecret() {
            return secret;
        }

        public void setSecret(String secret) {
            this.secret = secret;
        }
    }

    /**
     * 服务器配置
     */
    public static class Server {
        /**
         * Jitsi Meet服务器地址
         */
        private String url = "https://meet.jit.si";

        public String getUrl() {
            return url;
        }

        public void setUrl(String url) {
            this.url = url;
        }
    }

    /**
     * Token配置
     */
    public static class Token {
        /**
         * JWT Token有效期（毫秒）- 默认2小时
         */
        private Long expiration = 7200000L;

        public Long getExpiration() {
            return expiration;
        }

        public void setExpiration(Long expiration) {
            this.expiration = expiration;
        }
    }
}
