package com.ruoyi.satisfaction.config;
|
|
import lombok.Data;
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
import org.springframework.stereotype.Component;
|
|
/**
|
* 满意度模块配置(前缀 {@code satisfaction})。
|
* <p>
|
* ⚠️ <b>这不是主开关</b>。满意度模块的开关<b>存在 {@code sys_config} 参数配置表里</b>:
|
* <pre>
|
* 参数键名:satisfaction.enabled
|
* 参数键值:true(启用,默认)/ false(关闭)
|
* </pre>
|
* 见 {@link SatisfactionSwitch}。本类的 {@link #isEnabled()} 只作为<b>兜底</b>:
|
* 当 {@code sys_config} 里没有这一行、或非 Spring 环境取不到配置服务时才会用到。
|
* <p>
|
* 如需在 yml 中兜底(一般不必要,正常应在参数设置页维护):
|
* <pre>
|
* satisfaction:
|
* enabled: false
|
* </pre>
|
* <p>
|
* <b>关闭后的行为</b>:
|
* <ul>
|
* <li>本模块的 <b>17 个满意度端点</b>({@code /smartor/satisfaction/**}、
|
* {@code /smartor/serviceSubtaskDetail} 下的 5 个、{@code /smartor/trace/getSatisfactionExceptConfigQuestion})
|
* 仍会注册,但请求会在进入方法前被
|
* {@link SatisfactionAvailabilityInterceptor} 拦下并抛出
|
* {@code ServiceException("满意度功能未启用…")} —— 调用方拿到的是
|
* <b>明确的业务错误提示</b>,而不是 404,便于区分"模块被关闭"与"地址写错";</li>
|
* <li>{@code com.ruoyi.satisfaction.api.SatisfactionFacade} 仍然存在,
|
* 其它模块(随访导出、随访统计、登录链路)通过它取数时会拿到安全空值/全零,
|
* <b>不影响调用方启动与主流程</b>;</li>
|
* <li>随访、问卷、电话等其它业务完全不受影响(拦截器只挂在上述 17 个路径上)。</li>
|
* </ul>
|
*/
|
@Data
|
@Component
|
@ConfigurationProperties(prefix = "satisfaction")
|
public class SatisfactionProperties {
|
|
/**
|
* 是否启用满意度模块(默认启用)。
|
* <p>
|
* 仅当 {@code sys_config} 中没有 {@code satisfaction.enabled} 时生效,见 {@link SatisfactionSwitch}。
|
*/
|
private boolean enabled = true;
|
}
|