package com.njzscloud.supervisory.config;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;
import org.springframework.boot.context.properties.ConfigurationProperties;

@Getter
@Setter
@ToString
@Accessors(chain = true)
@ConfigurationProperties("app.jike")
public class JikeProperties {
    /**
     * 应用ID
     */
    private String appId;
    /**
     * 应用密钥
     */
    private String secretKey;
    /**
     * 沙箱环境地址
     */
    private String sandboxUrl = "https://open-api.test.jkwlw.com.cn";
    /**
     * 生产环境地址
     */
    private String prodUrl = "https://open-api.jkwlw.com.cn";
    /**
     * 是否使用沙箱环境
     */
    private Boolean sandbox = true;

    public String getEndpoint() {
        return Boolean.TRUE.equals(sandbox) ? sandboxUrl : prodUrl;
    }
}
