| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- 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<String> closeTags;
- /**
- * 自供标签
- */
- private List<CollectTagAttr> supplySelfTags;
- /**
- * 供入标签
- */
- private List<CollectTagAttr> supplyInTags;
- /**
- * 供出标签
- */
- private List<CollectTagAttr> supplyOutTags;
- public Map<String, List<String>> getSupplySelfTagsMap() {
- return supplySelfTags.stream().collect(Collectors.toMap(CollectProperties.CollectTagAttr::getName, CollectProperties.CollectTagAttr::getValues));
- }
- public Map<String, List<String>> getSupplyInTagsMap() {
- return supplyInTags.stream().collect(Collectors.toMap(CollectProperties.CollectTagAttr::getName, CollectProperties.CollectTagAttr::getValues));
- }
- public Map<String, List<String>> getSupplyOutTagsMap() {
- return supplyOutTags.stream().collect(Collectors.toMap(CollectProperties.CollectTagAttr::getName, CollectProperties.CollectTagAttr::getValues));
- }
- /**
- * 采集标签
- */
- @Getter
- @Setter
- public static class CollectTagAttr {
- /**
- * 名称
- */
- private String name;
- /**
- * 值
- */
- private List<String> values;
- }
- }
|