package com.mes.job.config;
|
|
import lombok.Data;
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
import org.springframework.stereotype.Component;
|
|
import java.util.Map;
|
|
/**
|
* @author huang
|
* @since 2025/10/31
|
*/
|
@Component
|
@ConfigurationProperties(prefix = "plc.address")
|
@Data
|
public class PlcAddressYmlConfig {
|
|
/**
|
* key:项目标识(比如YML中的 "vertical")
|
* value:该项目的所有PLC配置(对应YML中 "vertical" 下的所有字段)
|
*/
|
private Map<String, PlcAddressItem> projects;
|
|
/**
|
* 单个项目的配置项(对应YML中 "projects" 下某个项目的子配置)
|
* 字段名必须和YML中的配置项完全一致(大小写敏感)
|
*/
|
@Data
|
public static class PlcAddressItem {
|
private String dbArea; // 对应YML中的 dbArea
|
private Integer beginIndex; // 对应YML中的 beginIndex
|
private String plcIp; // 对应YML中的 plcIp
|
private String plcType; // 对应YML中的 plcType
|
private Map<String, Integer> addressMapping; // 对应YML中的 addressMapping(嵌套Map)
|
}
|
}
|