feat(设备日志/后台配置/密钥检测): 补齐已上线未提交的设备日志与app_config,并合入检测模型解耦

三部分均已部署到双节点(当前线上 JAR 009efc3e),本次补齐仓库状态,避免"已上线未提交"
在后续最小构建比对里被误判。

- 设备日志管理:modules/devicelog + DeviceLogOssProperties(主机B 独立 MinIO,仅内网)
  + V127 device_log_file/device_log_config + admin-vue 日志管理页;客户端/麦象按 offset
  增量上报(X-Internal-Token),查询仅超管
- 后台通用配置:modules/appconfig + V128 app_config 键值表;工作台「开店流程」密码改服务端
  校验(POST /api/kd-flow/verify),改密码只需 UPDATE 该行、客户端无需重新发版
- 密钥检测模型解耦:新增 aiimage.user-secret.check-model(env AIIMAGE_USER_SECRET_CHECK_MODEL),
  默认 doubao-seed-2-0-lite-260215 —— 同系列 mini 在中继分组下无可用渠道(503 model_not_found),
  实测 lite 可路由;UserSecretModule 去掉 LlmTarget 改 resolveLlmHost,探测日志带 model=
- 前端:密钥面板「检测配置密钥」按钮不再折行;client-changelog 补 4.0.19/4.0.20/4.0.21 条目

注:application.yml 与 PropertiesConfig 同时承载上述多个部分,故未按功能拆分提交
This commit is contained in:
2026-09-15 23:53:05 +08:00
parent 06b3fc3502
commit a7f244f9c1
32 changed files with 2635 additions and 21 deletions
@@ -0,0 +1,38 @@
package com.nanri.aiimage.config;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
/**
* 设备日志对象存储配置:指向主机B 独立部署的 MinIO 实例(非业务 MinIO)。
*
* <p>日志体积大、只保留 7 天,独立实例便于单独设生命周期规则与容量管理,
* 不挤占业务桶(nanri-ai-images 等)。endpoint 为空时上报接口直接失败,
* 不做静默回退(避免日志悄悄落到其他存储上而无人知情)。
*/
@Data
@ConfigurationProperties(prefix = "aiimage.device-log-oss")
public class DeviceLogOssProperties {
private String endpoint;
private String accessKeyId;
private String accessKeySecret;
private String bucket;
/**
* 日志保留天数:查询侧按此过滤(早于今天的 N-1 天不展示),
* 对象过期由 MinIO 桶生命周期规则在部署时同步设置(两侧口径保持一致)。
*/
private Integer retentionDays;
public boolean configured() {
return endpoint != null && !endpoint.isBlank()
&& accessKeyId != null && !accessKeyId.isBlank()
&& accessKeySecret != null && !accessKeySecret.isBlank()
&& bucket != null && !bucket.isBlank();
}
public int retentionDaysOrDefault() {
return retentionDays == null || retentionDays < 1 ? 7 : retentionDays;
}
}
@@ -4,6 +4,6 @@ import org.springframework.boot.context.properties.EnableConfigurationProperties
import org.springframework.context.annotation.Configuration;
@Configuration
@EnableConfigurationProperties({OssProperties.class, TransientStorageProperties.class, StorageProperties.class, BrandProgressProperties.class, DeleteBrandProgressProperties.class, BrandCheckProperties.class, ZiniaoProperties.class, ModuleCleanupProperties.class, TaskPressureProperties.class, TaskImageCacheCleanupProperties.class, AppearancePatentProperties.class, SimilarAsinProperties.class, ImageVideoProperties.class, InstanceRoutingProperties.class, CapacityPlanProperties.class, UserSecretProperties.class, NotificationProperties.class})
@EnableConfigurationProperties({OssProperties.class, TransientStorageProperties.class, StorageProperties.class, BrandProgressProperties.class, DeleteBrandProgressProperties.class, BrandCheckProperties.class, ZiniaoProperties.class, ModuleCleanupProperties.class, TaskPressureProperties.class, TaskImageCacheCleanupProperties.class, AppearancePatentProperties.class, SimilarAsinProperties.class, ImageVideoProperties.class, InstanceRoutingProperties.class, CapacityPlanProperties.class, UserSecretProperties.class, NotificationProperties.class, DeviceLogOssProperties.class})
public class PropertiesConfig {
}
@@ -22,6 +22,13 @@ public class UserSecretProperties {
/** 单轮巡检时间预算(分钟),超时中断本轮。 */
private int checkBudgetMinutes = 20;
/**
* 检测请求使用的 LLM 模型:独立于业务任务模型(业务用 gemini-3.8-flash 等),
* 选便宜的可用模型,只验证密钥有效性与链路连通,降低每次检测与巡检的成本。
* 用 lite 而非 mini:mini 在中继分组下无可用渠道(503 model_not_found),实测 lite 可路由。
*/
private String checkModel = "doubao-seed-2-0-lite-260215";
/**
* 检测出口代理提取链接(选配):配置后检测请求优先经该代理 IP 发出,
* 代理不可用时自动回退直连;留空则全部直连。