package com.sckw.payment.model;

import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.Map;
import java.util.Objects;


/**
 * @author xucaiqin
 * @date 2023-09-06 18:58:51
 */
@Getter
@Setter
@Component
@ConfigurationProperties(prefix = "msg")
@RefreshScope
public class JumpUrlConfig {
    /**
     * 销售收款对账
     */
    private Map<String, JumpUrl> url = new HashMap<>();

    public Map<String, String> getMapUrl(String key) {
        JumpUrl jumpUrl = url.get(key);
        if (Objects.nonNull(jumpUrl)) {
            return new HashMap<>() {{
                put("pc", jumpUrl.getPc());
                put("app", jumpUrl.getApp());
            }};
        }
        return new HashMap<>();
    }


}
