package com.yfd.platform.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @Date: 2024/7/24 11:26
 * @Description:
 */
@Data
@Configuration
@ConfigurationProperties(prefix = "algorithm")
public class AlgorithmManufacturerConfig {

    private List<Map<String, String>> manufacturer;

    // getters and setters
    public List<Map<String, String>> getManufacturer() {
        return this.manufacturer;
    }

    public void setManufacturer(List<Map<String, String>> manufacturer) {
        this.manufacturer = manufacturer;
    }

    public Map<String, String> getManufacturerName() {

        Map<String, String> map1 = new HashMap<>();
        for (Map<String, String> map : this.manufacturer) {
            map1.put(map.get("id"), map.get("name"));
        }
        return map1;
    }
}
