springBoot yml文件书写规范

# 自定义数据上报信息
xx:
  factory:
      name: XXXX
# 报警类型集合
  typeAlarms:
    -   alarm-num: 20
        alarm-type: XXXX
    -   alarm-num: 18
        alarm-type: XXXX
    -   alarm-num: 10
        alarm-type: XXXX
    -   alarm-num: 8
        alarm-type: 其他
# 铁雄配置信息
  xx:
  # 车间报警类型信息
    workShopAlarms:
      -   alarm-num: 21
          work-shop: XXXX
      -   alarm-num: 18
          work-shop: XXXX
      -   alarm-num: 3
          work-shop: XXXX
      -   alarm-num: 16
          work-shop: XXXX
      -   alarm-num: 5
          work-shop: XXXX
      -   alarm-num: 13
          work-shop: XXXX
      -   alarm-num: 10
          work-shop: XXXX
      -   alarm-num: 9
          work-shop: XXXX
  # 机组信息
    machine1s:
      -   name: XXXX
          frequency: null
          frequency-unit: null
          pressure: 0.01
          pressure-unit: Pa
          flow: 0
          flow-unit: NM3/H
          state: 停机
          runtime: 17.5
          runtime-unit: 天
      -   name: XXXX
          frequency: 42.4
          frequency-unit: HZ
          pressure: 0.39
          pressure-unit: Pa
          flow: 4730
          flow-unit: NM3/H
          state: 运行
          runtime: 12.5
          runtime-unit: 天
      -   name: XXXX
          frequency: 46.4
          frequency-unit: HZ
          pressure: 0.00
          pressure-unit: Pa
          flow: 0
          flow-unit: NM3/H
          state: 停机
          runtime: 8.2
          runtime-unit: 天
      -   name: XXXX
          frequency: 41.4
          frequency-unit: HZ
          pressure: 0.39
          pressure-unit: Pa
          flow: 9532
          flow-unit: NM3/H
          state: 运行
          runtime: 3.2
          runtime-unit: 天
      -   name: XXXX
          frequency: null
          frequency-unit: null
          pressure: 0.38
          pressure-unit: Pa
          flow: 4800
          flow-unit: NM3/H
          state: 停机
          runtime: 20.4
          runtime-unit: 天
      -   name: XXXX
          frequency: null
          frequency-unit: null
          pressure: 0.01
          pressure-unit: Pa
          flow: 0
          flow-unit: NM3/H
          state: 停机
          runtime: 7.5
          runtime-unit: 天

注意问题如下:

a.数据的级别以空格为准,上级比下级对象的属性要多偶数倍空格,如空2格、4格等等。

b.数据结构是list的,要用“-”,再空三格,在配置属性

c.支持驼峰命名方式

你可能感兴趣的:(java杂谈)