package com.shkpr.service.aimodelpower.commproperties; import lombok.Getter; import lombok.Setter; import lombok.ToString; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.context.annotation.Configuration; import java.util.List; import java.util.Map; import java.util.stream.Collectors; /** * 采集属性 * * @author 欧阳劲驰 * @since 1.0.4 */ @ConfigurationProperties("collect") @Configuration @Getter @Setter @ToString public class CollectProperties { /** * 最大水量 */ private Double maxWater = 20000d; /** * 最小水量 */ private Double minWater = -20000d; /** * 关闭标签 */ private List closeTags; /** * 自供标签 */ private List supplySelfTags; /** * 供入标签 */ private List supplyInTags; /** * 供出标签 */ private List supplyOutTags; public Map> getSupplySelfTagsMap() { return supplySelfTags.stream().collect(Collectors.toMap(CollectProperties.CollectTagAttr::getName, CollectProperties.CollectTagAttr::getValues)); } public Map> getSupplyInTagsMap() { return supplyInTags.stream().collect(Collectors.toMap(CollectProperties.CollectTagAttr::getName, CollectProperties.CollectTagAttr::getValues)); } public Map> getSupplyOutTagsMap() { return supplyOutTags.stream().collect(Collectors.toMap(CollectProperties.CollectTagAttr::getName, CollectProperties.CollectTagAttr::getValues)); } /** * 采集标签 */ @Getter @Setter public static class CollectTagAttr { /** * 名称 */ private String name; /** * 值 */ private List values; } }