package com.sptg.repeater.vo;

import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.util.Map;

/**
 * 将配置文件中配置的每一个属性的值映射到CommonValues类
 * @ConfigurationProperties 告诉springboot 将本类中的值与配置文件中的值绑定
 * prefix = "person" 配置文件下的那个属性下的
 * 只有这个组件是容器中的组件才能使用@Component
 */
@Data
@Component
//@ConfigurationProperties(prefix = "common-value")
public class CommonValues {

    @Value("${common-value.dh.url}")
    private String dhUrl;

    @Value("${common-value.dh.online}")
    private String dhOnline;

    @Value("${common-value.dh.open_door}")
    private String openDoor;

    @Value("${common-value.dh.add_open_door_card}")
    private String addOpenDoorCard;

    @Value("${common-value.dh.add_open_door_card_batch}")
    private String addOpenDoorCardBatch;

    @Value("${common-value.dh.del_open_door_card}")
    private String delOpenDoorCard;

    @Value("${common-value.dh.open_door_log}")
    private String openDoorLog;

    @Value("${common-value.dh.add_open_door_card_batch_again}")
    private String addOpenDoorCardBatchAgain;

    @Value("${common-value.dh.format_data}")
    private String formatData;

    @Value("${common-value.lz.url}")
    private String lzUrl;

    @Value("${common-value.lz.callback}")
    private String lzCallback;

    @Value("${common-value.lz.uploadOpenDoorLog}")
    private String uploadOpenDoorLog;

    @Value("${common-value.lz.heartbeat}")
    private String heartbeat;



    public String getDhUrl() {
        return dhUrl;
    }

    public String getDhOnline() {
        return dhOnline;
    }

    public String getOpenDoor() { return openDoor; }

    public String getAddOpenDoorCard() {  return addOpenDoorCard; }

    public String getAddOpenDoorCardBatch() { return addOpenDoorCardBatch; }

    public String getDelOpenDoorCard() { return delOpenDoorCard; }

    public String getOpenDoorLog() { return openDoorLog; }

    public String getLzUrl() { return lzUrl; }

    public String getLzCallback() { return lzCallback; }

    public String getLzUploadOpenDoorLog(){ return uploadOpenDoorLog;}

    public String getAddOpenDoorCardBatchAgain() { return addOpenDoorCardBatchAgain; }

    public String getFormatData(){
        return formatData;
    }
}
