package com.ruoyi.task.config; import lombok.Data; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.stereotype.Component; /** * 任务模块配置(前缀 {@code task})。 *

* ⚠️ 这不是主开关。任务模块的开关存在 {@code sys_config} 参数配置表里: *

 * 参数键名:task.enabled
 * 参数键值:true(启用,默认)/ false(关闭)
 * 
* 见 {@link TaskSwitch}。本类的 {@link #isEnabled()} 只作为兜底: * 当 {@code sys_config} 里没有这一行、或非 Spring 环境取不到配置服务时才会用到。 *

* 如需在 yml 中兜底(一般不必要,正常应在参数设置页维护): *

 * task:
 *   enabled: false
 * 
*/ @Data @Component @ConfigurationProperties(prefix = "task") public class TaskProperties { /** * 是否启用任务模块(默认启用)。 *

* 仅当 {@code sys_config} 中没有 {@code task.enabled} 时生效,见 {@link TaskSwitch}。 */ private boolean enabled = true; }