package com.ruoyi.task.config;
|
|
import lombok.Data;
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
import org.springframework.stereotype.Component;
|
|
/**
|
* 任务模块配置(前缀 {@code task})。
|
* <p>
|
* ⚠️ <b>这不是主开关</b>。任务模块的开关<b>存在 {@code sys_config} 参数配置表里</b>:
|
* <pre>
|
* 参数键名:task.enabled
|
* 参数键值:true(启用,默认)/ false(关闭)
|
* </pre>
|
* 见 {@link TaskSwitch}。本类的 {@link #isEnabled()} 只作为<b>兜底</b>:
|
* 当 {@code sys_config} 里没有这一行、或非 Spring 环境取不到配置服务时才会用到。
|
* <p>
|
* 如需在 yml 中兜底(一般不必要,正常应在参数设置页维护):
|
* <pre>
|
* task:
|
* enabled: false
|
* </pre>
|
*/
|
@Data
|
@Component
|
@ConfigurationProperties(prefix = "task")
|
public class TaskProperties {
|
|
/**
|
* 是否启用任务模块(默认启用)。
|
* <p>
|
* 仅当 {@code sys_config} 中没有 {@code task.enabled} 时生效,见 {@link TaskSwitch}。
|
*/
|
private boolean enabled = true;
|
}
|