package quant.rich.emoney.entity.config;

import java.net.Proxy;
import java.time.LocalDateTime;
import java.util.Objects;

import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.Validate;
import org.springframework.beans.factory.annotation.Autowired;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.node.ObjectNode;

import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import lombok.AccessLevel;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
import lombok.extern.slf4j.Slf4j;
import quant.rich.emoney.entity.config.DeviceInfoConfig.DeviceInfo;
import quant.rich.emoney.interceptor.EnumOptionsInterceptor.EnumOptions;
import quant.rich.emoney.interfaces.ConfigInfo;
import quant.rich.emoney.interfaces.IConfig;
import quant.rich.emoney.interfaces.ValidEmoneyRequestConfig;
import quant.rich.emoney.patch.okhttp.PatchOkHttp;
import quant.rich.emoney.util.EncryptUtils;
import quant.rich.emoney.util.SpringContextHolder;
import quant.rich.emoney.util.TextUtils;

/**
 * 独立出来一个代理设置的原因是后续可能需要做一个代理池，这样的话独立配置比较适合后续扩展
 */
@Data
@Accessors(chain = true)
@Slf4j
@ValidEmoneyRequestConfig
@ConfigInfo(field = "proxy", name = "代理设置", initDefault = true)
public class ProxyConfig implements IConfig<ProxyConfig> {
    
    /**
     * 代理类型
     */
    @EnumOptions("ProxyTypeEnum")
    private Proxy.Type proxyType = Proxy.Type.DIRECT;
    
    /**
     * 代理主机
     */
    private String proxyHost = "";
    
    /**
     * 代理端口
     */
    private Integer proxyPort = 0;
    
    /**
     * 是否忽略 HTTPS 证书校验
     */
    private Boolean ignoreHttpsVerification = false;
    
    public void afterBeanInit() {
        
    }
    
    
    public ProxyConfig() {}
    
    
}
