package cn.superdesk.uniorder.openapicall.thirdpart.szhtxx.electronicInvoice.config;


//# szhtxx.electronicInvoice 测试环境
//openapi.call.thirdpart.szhtxx.electronicInvoice.baseUrl=https://eitest.szhtxx.com/dzfpTest/
//openapi.call.thirdpart.szhtxx.electronicInvoice.accessToken=1031530698uNeAnogkN8kkbppABrnF+Q==
//openapi.call.thirdpart.szhtxx.electronicInvoice.accessKeyId=440301999999980
//openapi.call.thirdpart.szhtxx.electronicInvoice.accessKeySecret=

import cn.superdesk.uniorder.openapicall.thirdpart.szhtxx.electronicInvoice.dto.env.SzhtxxElectronicInvoiceConstant;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Description: Refresh 采用本地配置文件
 * @Author: linjinyu
 * @CreateDate: 2022/3/25 1:20 下午
 * @UpdateUser: linjinyu
 * @UpdateDate: 2022/3/25 1:20 下午
 * @UpdateRemark: 修改内容
 * @Version: 1.0
 */
@Slf4j
@Configuration
@ConditionalOnProperty(prefix = "openapi.call.thirdpart.szhtxx.electronicInvoice", name = "enabled", havingValue = "true")
public class SzhtxxElectronicInvoiceScopeConifg {

    @Value("${openapi.call.thirdpart.szhtxx.electronicInvoice.enabled}")
    private Boolean enabled;
    @Value("${openapi.call.thirdpart.szhtxx.electronicInvoice.baseUrl}")
    private String  baseUrl;
    @Value("${openapi.call.thirdpart.szhtxx.electronicInvoice.accessToken}")
    private String  accessToken;
    @Value("${openapi.call.thirdpart.szhtxx.electronicInvoice.accessKeyId}")
    private String  accessKeyId;
    @Value("${openapi.call.thirdpart.szhtxx.electronicInvoice.accessKeySecret}")
    private String  accessKeySecret;

    @Bean
    public SzhtxxElectronicInvoiceConstant szhtxxElectronicInvoiceConstyant() {
        return SzhtxxElectronicInvoiceConstant.builder()
                .enabled(enabled)
                .baseUrl(baseUrl)
                .accessKeyId(accessKeyId)
                .accessKeySecret(accessKeySecret)
                .accessToken(accessToken)
                .build();
    }

}
