package com.zcloud.zcGbsServicer.service;

import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import java.util.List;

@Data
@Component
public class HstVideoPlatformProperties {

    @Value("${video.platform.hst.api-base-url:https://5uw.haoshitong.com:28443}")
    private String apiBaseUrl;

    @Value("${video.platform.hst.web-base-url:https://5uw.haoshitong.com:28443}")
    private String webBaseUrl;

    @Value("${video.platform.hst.client-id:}")
    private String clientId;

    @Value("${video.platform.hst.client-secret:}")
    private String clientSecret;

    @Value("${video.platform.hst.key:}")
    private String key;

    @Value("${video.platform.hst.secret:}")
    private String secret;

    @Value("${video.platform.hst.algorithm:SHA256}")
    private String algorithm;

    @Value("${video.platform.hst.default-room-code:DEFAULT_DUTY_ROOM}")
    private String defaultRoomCode;

    @Value("${video.platform.hst.default-room-no:20708}")
    private String defaultRoomNo;

    @Value("${video.platform.hst.default-user-password:}")
    private String defaultUserPassword;

    @Value("${video.platform.hst.fire-user-prefix:xfbj}")
    private String fireUserPrefix;

    @Value("${video.platform.hst.default-depart-id:1}")
    private String defaultDepartId;

    @Value("${video.platform.hst.client-port:1089}")
    private String clientPort;

    @Value("${video.platform.hst.connect-timeout-ms:10000}")
    private Integer connectTimeoutMs;

    @Value("${video.platform.hst.read-timeout-ms:15000}")
    private Integer readTimeoutMs;

    @Value("#{'${video.platform.hst.test-accounts:xfbj00,xfbj01,xfbj02,xfbj03,xfbj04,xfbj05,xfbj06,xfbj07,xfbj08,xfbj09}'.split(',')}")
    private List<String> testAccounts;

    public String getAuthKey() {
        return org.springframework.util.StringUtils.hasText(key) ? key : clientId;
    }

    public String getAuthSecret() {
        return org.springframework.util.StringUtils.hasText(secret) ? secret : clientSecret;
    }
}
