package com.ruoyi.publicity.config;
|
|
import lombok.Data;
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
import org.springframework.stereotype.Component;
|
|
/**
|
* 宣教模块的 yml 配置(<b>仅作兜底,不是主开关</b>)。
|
*
|
* <h3>⚠️ 主开关不在这里</h3>
|
* 主开关是 {@code sys_config} 参数配置表里的 {@code publicity.enabled},
|
* 由 {@link PublicitySwitch} <b>运行时热读</b>(进程内 10 秒缓存,改完最多 10 秒生效)。
|
* 本类只在「sys_config 里没有那一行」或「非 Spring 环境取不到配置服务」时兜底。
|
*
|
* <h3>为什么默认 true</h3>
|
* 入院宣教本身还受 {@code sys_config: in.helibrary.switch == "2"} 控制、
|
* 药品宣教还受站点 {@code active == "sltd"} 控制,所以本开关默认 true 不会导致
|
* "不该发宣教的地方突然发宣教";要整体关掉请把 {@code publicity.enabled} 设为 false。
|
*/
|
@Data
|
@Component
|
@ConfigurationProperties(prefix = "publicity")
|
public class PublicityProperties {
|
|
/**
|
* yml 兜底开关(默认 true)
|
*/
|
private boolean enabled = true;
|
}
|