feat: 外观专利改直连 LLM(DeepSeek/Gemini)、无效ASIN菜单更名 BRAND_DB、紫鸟店铺索引场景化
Build Backend JAR / build (push) Has been cancelled

- AppearancePatent:Coze 工作流切换为 llm-host 直连模型(title/appearance 双模型、行并发、重试),配置键迁移并保留旧环境变量兜底
- InvalidAsinDataMapper 补充按值+品牌唯一键查询
- ZiniaoShopIndexService 新增店铺分类/索引场景
- V98:无效ASIN菜单 rename 补充 BRAND_DB;docs 架构优化规划
- 配套单测更新
This commit is contained in:
2026-08-31 17:02:59 +08:00
parent 14a41e64f1
commit c8cd851b2f
20 changed files with 1291 additions and 2338 deletions
@@ -3,36 +3,39 @@ package com.nanri.aiimage.config;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import java.util.ArrayList;
import java.util.List;
@Data
@ConfigurationProperties(prefix = "aiimage.appearance-patent")
public class AppearancePatentProperties {
private String cozeBaseUrl = "https://api.coze.cn";
private String cozeWorkflowPath = "/v1/workflow/run";
private String cozeWorkflowHistoryPath = "/v1/workflows/{workflow_id}/run_histories/{execute_id}";
private String cozeWorkflowId = "7632683471312355338";
private String cozeToken = "";
private List<CozeCredential> cozeCredentials = new ArrayList<>();
private int cozeCredentialStripeSize = 5;
private int cozeBatchSize = 10;
private int cozeConnectTimeoutMillis = 10000;
private int cozeReadTimeoutMillis = 60000;
private int cozePollIntervalMillis = 30000;
private int cozePollTimeoutMillis = 600000;
/**
* LLM APIOpenAI 兼容 /v1/chat/completions)地址
*/
private String llmHost = "https://ai.t8star.org";
/**
* 商标关键词提取模型
*/
private String titleModel = "deepseek-v4-flash";
/**
* 外观检测模型(视觉)
*/
private String appearanceModel = "gemini-3.7-flash";
private int llmMaxTokens = 64000;
private int llmConnectTimeoutMillis = 10000;
private int llmReadTimeoutMillis = 180000;
private int llmBatchSize = 10;
/**
* 批内行级并发数,默认等于批量大小
*/
private int llmRowConcurrency = 10;
/**
* 每行每个 LLM 请求的重试次数(含首次)
*/
private int llmRetryTimes = 3;
private int staleTimeoutMinutes = 30;
private String staleFinalizeCron = "0 */2 * * * *";
/**
* 末尾不足一批的数据等待该时长后强制提交 Coze
* 末尾不足一批的数据等待该时长后强制提交检测
* Python 回传超时后会直接封口;这个配置处理 Python 慢回传但仍未超时的零头批次。
*/
private int cozeFlushPendingMinutes = 1;
@Data
public static class CozeCredential {
private String name;
private String workflowId;
private String token;
}
private int flushPendingMinutes = 1;
}
@@ -199,6 +199,38 @@ public class SimilarAsinProperties {
*/
private long cozeSubmitLockRetryDelayMillis = 500L;
/**
* 货源查询直连 LLM 模式开关(默认 true:新任务与存量 PENDING 批次都走直连 LLM
* 不再经过 Coze)。false 时回退到原 Coze 工作流链路(轮询/重试状态机保留)。
*/
private boolean directLlmEnabled = true;
/** 直连 LLM 的 base urlOpenAI 兼容 /v1/chat/completions)。 */
private String llmHost = "https://ai.t8star.org";
/** 直连 LLM 的 Bearer token;前端未传 api_key 时兜底使用。 */
private String llmApiKey = "";
/** 类目匹配(一级/二级)使用的小模型。 */
private String llmCategoryModel = "gemini-3.5-flash-lite";
/** 合规检查(is_conform/reason/category)使用的小模型。 */
private String llmConformModel = "gemini-3.5-flash-lite";
/** 图片相似度对比(主图 vs 拼接图)使用的模型。 */
private String llmImageCompareModel = "gemini-3.7-flash";
private int llmMaxTokens = 64000;
private int llmConnectTimeoutMillis = 10000;
private int llmReadTimeoutMillis = 180000;
private int llmRetryTimes = 3;
/** 批内行级并发上限:每行最多 2 次图片对比 + 1 次合规 + 3 次类目匹配。 */
private int llmRowConcurrency = 5;
/** 拼接图/主图下载超时(秒),慢源图片较多时放大该值。 */
private int llmImageDownloadTimeoutSeconds = 10;
@Data
public static class CozeCredential {
private String name;