refactor(brand-check): 归属用户读取下沉为 SecretUsageContext.currentUserId()
上一笔在 AppearancePatentLlmClient 里就地取上下文(+6 行),把那支已进超长点名 台账的文件从 1465 顶到 1471,可读棘轮按对象判红。改为未入册的 SecretUsageContext 提供一个静态访问器(含「无上下文就不该打上游」的口径),调用点回到一行——该文件 现在 1464 行,比基线还短一行。AP/品牌相关 273 例全绿,test-compile 零错误。
This commit is contained in:
+1
-7
@@ -1042,13 +1042,7 @@ public class AppearancePatentLlmClient {
|
||||
BrandCheckClient.BrandCheckBatchResult[] byRowIndex =
|
||||
new BrandCheckClient.BrandCheckBatchResult[results.size()];
|
||||
if (!pending.isEmpty()) {
|
||||
// 品牌检查用的代理=这批结果归属那个用户自己的提取链接(16890 不再兜底平台 key)。
|
||||
// 取不到任务上下文就是无人归属,此时不去打上游:上游要么用别人的套餐、要么裸 IP 被拒,
|
||||
// 两种都把一次配置缺失变成一笔算不清的账。
|
||||
SecretUsageContext.Context usage = SecretUsageContext.current();
|
||||
Long ownerUserId = usage == null ? null : usage.userId();
|
||||
List<BrandCheckClient.BrandCheckBatchResult> batch =
|
||||
brandCheckClient.checkTitleTexts(titles, "Terms", ownerUserId);
|
||||
List<BrandCheckClient.BrandCheckBatchResult> batch = brandCheckClient.checkTitleTexts(titles, "Terms", SecretUsageContext.currentUserId());
|
||||
for (int k = 0; k < pending.size(); k++) {
|
||||
byRowIndex[pending.get(k)] = batch.get(k);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user