package com.huimv.video.dhicc.test.utils;

public class HttpConfigInfo {

    /** 平台服务IP或域名 */
    protected String host;
    /** 配置config */
    protected boolean isEnableHttpTest = false;
    /**https访问端口 默认443*/
    protected String httpsPort = "443";
    /**http访问端口 默认83，前提运维平台需要开启http调试模式*/
    protected String httpPort = "83";

    public HttpConfigInfo(String host, boolean isEnableHttpTest, String httpsPort, String httpPort){
        this(host);
        this.isEnableHttpTest = isEnableHttpTest;
        this.httpsPort = httpsPort == null?"443":httpsPort;
        this.httpPort = httpPort == null?"83":httpPort;
    }

    public HttpConfigInfo(String host){
        this.host = host;
    }

    public HttpConfigInfo(){}

    public boolean isEnableHttpTest() {
        return isEnableHttpTest;
    }

    public void setEnableHttpTest(boolean enableHttpTest) {
        isEnableHttpTest = enableHttpTest;
    }

    public String getHttpsPort() {
        return httpsPort;
    }

    public void setHttpsPort(String httpsPort) {
        this.httpsPort = httpsPort;
    }

    public String getHttpPort() {
        return httpPort;
    }

    public void setHttpPort(String httpPort) {
        this.httpPort = httpPort;
    }

    public String getHost() {
        return host;
    }

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

    public String getPrefixUrl(){
        if(!isEnableHttpTest){
            return "https://" + host + ":" + httpsPort;
        }else{
            return "http://" + host + ":" + httpPort;
        }
    }
}
