feat: update task routing and coze handling
This commit is contained in:
+77
-3
@@ -14,6 +14,7 @@ import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.StreamUtils;
|
||||
import org.springframework.web.client.RestClient;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
@@ -370,8 +371,9 @@ public class SimilarAsinCozeClient {
|
||||
List<String> skus = rows.stream().map(row -> safeText(row.getSku())).toList();
|
||||
List<String> urls = rows.stream().map(this::primaryImageUrl).toList();
|
||||
List<List<String>> urlLists = rows.stream().map(this::imageUrls).toList();
|
||||
List<List<Map<String, Object>>> alibabaLists = rows.stream().map(this::alibabaItems).toList();
|
||||
|
||||
List<Map<String, Object>> items = buildItemObjects(asins, titles, skus, urls, urlLists);
|
||||
List<Map<String, Object>> items = buildItemObjects(asins, titles, skus, urls, urlLists, alibabaLists);
|
||||
logCozeItemsDiff(rows, items);
|
||||
Map<String, Object> parameters = new LinkedHashMap<>();
|
||||
parameters.put("items", items);
|
||||
@@ -408,22 +410,26 @@ public class SimilarAsinCozeClient {
|
||||
List<String> rowUrls = safeUrls(row.getUrls());
|
||||
String rowUrl = safeText(row.getUrl());
|
||||
Object outUrl = item.get("url");
|
||||
Object outAlibaba = item.get("alibaba");
|
||||
Object outTargetUrls = item.get("target_urls");
|
||||
int outTargetSize = (outTargetUrls instanceof List<?> list) ? list.size() : 0;
|
||||
int outAlibabaSize = (outAlibaba instanceof List<?> list) ? list.size() : 0;
|
||||
boolean urlMatch = String.valueOf(outUrl == null ? "" : outUrl).equals(rowUrl);
|
||||
boolean targetMatch = (outTargetUrls instanceof List<?> outList)
|
||||
&& outList.size() == rowUrls.size()
|
||||
&& outList.equals(rowUrls);
|
||||
log.info("[similar-asin] coze item idx={} asin={} title={} sku={} rowUrl={} rowUrlsSize={} rowUrlsHead={} rowUrlsTail={} outUrl={} outTargetSize={} outTargetHead={} outTargetTail={} urlMatch={} targetUrlsMatch={}",
|
||||
log.info("[similar-asin] coze item idx={} asin={} title={} sku={} price={} rowUrl={} rowUrlsSize={} rowUrlsHead={} rowUrlsTail={} outUrl={} outAlibabaSize={} outTargetSize={} outTargetHead={} outTargetTail={} urlMatch={} targetUrlsMatch={}",
|
||||
i,
|
||||
safeText(row.getAsin()),
|
||||
abbreviate(safeText(row.getTitle()), 80),
|
||||
safeText(row.getSku()),
|
||||
safeText(row.getPrice()),
|
||||
abbreviate(rowUrl, 200),
|
||||
rowUrls.size(),
|
||||
rowUrls.isEmpty() ? "" : abbreviate(rowUrls.get(0), 200),
|
||||
rowUrls.size() <= 1 ? "" : abbreviate(rowUrls.get(rowUrls.size() - 1), 200),
|
||||
abbreviate(String.valueOf(outUrl == null ? "" : outUrl), 200),
|
||||
outAlibabaSize,
|
||||
outTargetSize,
|
||||
(outTargetUrls instanceof List<?> headList && !headList.isEmpty())
|
||||
? abbreviate(String.valueOf(headList.get(0)), 200) : "",
|
||||
@@ -468,7 +474,8 @@ public class SimilarAsinCozeClient {
|
||||
List<String> titles,
|
||||
List<String> skus,
|
||||
List<String> urls,
|
||||
List<List<String>> urlLists) {
|
||||
List<List<String>> urlLists,
|
||||
List<List<Map<String, Object>>> alibabaLists) {
|
||||
// legacy flag:保留切回旧字段顺序 {asin, sku, url, target_urls, title} 的开关,
|
||||
// 默认 false 使用当前顺序 {asin, url, target_urls, title, sku}。
|
||||
boolean useLegacyOrder = properties.isCozeUseLegacyItemFieldOrder();
|
||||
@@ -476,16 +483,19 @@ public class SimilarAsinCozeClient {
|
||||
for (int i = 0; i < asins.size(); i++) {
|
||||
String url = urls.get(i);
|
||||
List<String> imageUrls = urlLists.get(i);
|
||||
List<Map<String, Object>> alibabaItems = alibabaLists.get(i);
|
||||
Map<String, Object> item = new LinkedHashMap<>();
|
||||
if (useLegacyOrder) {
|
||||
item.put("asin", asins.get(i));
|
||||
item.put("sku", skus.get(i));
|
||||
item.put("url", url);
|
||||
item.put("alibaba", alibabaItems);
|
||||
item.put("target_urls", imageUrls);
|
||||
item.put("title", titles.get(i));
|
||||
} else {
|
||||
item.put("asin", asins.get(i));
|
||||
item.put("url", url);
|
||||
item.put("alibaba", alibabaItems);
|
||||
item.put("target_urls", imageUrls);
|
||||
item.put("title", titles.get(i));
|
||||
item.put("sku", skus.get(i));
|
||||
@@ -726,6 +736,7 @@ public class SimilarAsinCozeClient {
|
||||
row.setSku(source.getSku());
|
||||
row.setPrice(source.getPrice());
|
||||
row.setUrls(source.getUrls());
|
||||
row.setAlibaba(source.getAlibaba());
|
||||
row.setTitle(source.getTitle());
|
||||
row.setError(source.getError());
|
||||
row.setDone(source.getDone());
|
||||
@@ -1213,6 +1224,69 @@ public class SimilarAsinCozeClient {
|
||||
return primaryUrl.isBlank() ? List.of() : List.of(primaryUrl);
|
||||
}
|
||||
|
||||
private List<Map<String, Object>> alibabaItems(SimilarAsinResultRowDto row) {
|
||||
if (row == null) {
|
||||
return List.of();
|
||||
}
|
||||
List<SimilarAsinResultRowDto.AlibabaItem> explicitItems = row.getAlibaba();
|
||||
if (explicitItems != null && !explicitItems.isEmpty()) {
|
||||
List<Map<String, Object>> result = new ArrayList<>(explicitItems.size());
|
||||
for (SimilarAsinResultRowDto.AlibabaItem source : explicitItems) {
|
||||
if (source == null) {
|
||||
continue;
|
||||
}
|
||||
String sourceUrl = safeText(source.getUrl());
|
||||
Object sourcePrice = cozePrice(source.getRawPrice());
|
||||
if (sourceUrl.isBlank() && isBlankPrice(sourcePrice)) {
|
||||
continue;
|
||||
}
|
||||
Map<String, Object> item = new LinkedHashMap<>();
|
||||
item.put("url", sourceUrl);
|
||||
item.put("price", sourcePrice);
|
||||
result.add(item);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
List<String> imageUrls = imageUrls(row);
|
||||
if (imageUrls.isEmpty()) {
|
||||
return List.of();
|
||||
}
|
||||
Object rowPrice = cozePrice(row.getPrice());
|
||||
List<Map<String, Object>> result = new ArrayList<>(imageUrls.size());
|
||||
for (String imageUrl : imageUrls) {
|
||||
Map<String, Object> item = new LinkedHashMap<>();
|
||||
item.put("url", imageUrl);
|
||||
item.put("price", rowPrice);
|
||||
result.add(item);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private Object cozePrice(Object value) {
|
||||
if (value == null) {
|
||||
return "";
|
||||
}
|
||||
if (value instanceof BigDecimal decimal) {
|
||||
return decimal.stripTrailingZeros();
|
||||
}
|
||||
if (value instanceof Number number) {
|
||||
return new BigDecimal(number.toString()).stripTrailingZeros();
|
||||
}
|
||||
String text = safeText(String.valueOf(value));
|
||||
if (text.isBlank()) {
|
||||
return "";
|
||||
}
|
||||
try {
|
||||
return new BigDecimal(text).stripTrailingZeros();
|
||||
} catch (NumberFormatException ex) {
|
||||
return text;
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isBlankPrice(Object value) {
|
||||
return value == null || value instanceof String text && text.isBlank();
|
||||
}
|
||||
|
||||
private String cozeGroupKey(SimilarAsinResultRowDto row) {
|
||||
if (row == null) {
|
||||
return "";
|
||||
|
||||
+68
-2
@@ -44,6 +44,10 @@ public class SimilarAsinResultRowDto {
|
||||
@Schema(description = "商品价格。来自 Excel 解析或 Python 回传。", example = "12.29")
|
||||
private String price;
|
||||
|
||||
@JsonAlias({"alibaba", "alibaba_items", "alibabaItems", "alibaba_products", "alibabaProducts"})
|
||||
@Schema(description = "Alibaba candidates returned by Python, each item contains url and price")
|
||||
private List<AlibabaItem> alibaba = new ArrayList<>();
|
||||
|
||||
@Schema(description = "商品主图 URL。Python 端解析的代表图。允许传字符串或数组(数组取首个非空),与 urls 互不影响。", example = "https://webstatic.aiproxy.vip/output/20260425/103322/demo.jpg")
|
||||
private String url;
|
||||
|
||||
@@ -150,7 +154,11 @@ public class SimilarAsinResultRowDto {
|
||||
|
||||
public List<String> getUrls() {
|
||||
// 直接返回 Python 回传的 urls,不再把 url 强推到首位、不去重、不截断。
|
||||
return cleanUrls(urls);
|
||||
List<String> cleaned = cleanUrls(urls);
|
||||
if (!cleaned.isEmpty()) {
|
||||
return cleaned;
|
||||
}
|
||||
return alibabaUrls();
|
||||
}
|
||||
|
||||
@JsonSetter("urls")
|
||||
@@ -169,12 +177,30 @@ public class SimilarAsinResultRowDto {
|
||||
this.urls = normalized;
|
||||
}
|
||||
|
||||
public List<AlibabaItem> getAlibaba() {
|
||||
if (alibaba == null || alibaba.isEmpty()) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
List<AlibabaItem> result = new ArrayList<>(alibaba.size());
|
||||
for (AlibabaItem item : alibaba) {
|
||||
if (item == null || item.getUrl().isBlank() && item.getPrice().isBlank()) {
|
||||
continue;
|
||||
}
|
||||
result.add(item);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public void setAlibaba(List<AlibabaItem> alibaba) {
|
||||
this.alibaba = alibaba == null ? new ArrayList<>() : new ArrayList<>(alibaba);
|
||||
}
|
||||
|
||||
public boolean hasImageUrl() {
|
||||
// url(主图)和 urls(同类商品图)任一存在即可作为可送 Coze 的素材。
|
||||
if (url != null && !url.isBlank()) {
|
||||
return true;
|
||||
}
|
||||
return !cleanUrls(urls).isEmpty();
|
||||
return !getUrls().isEmpty();
|
||||
}
|
||||
|
||||
private static void appendUrls(List<String> result, Object value) {
|
||||
@@ -227,4 +253,44 @@ public class SimilarAsinResultRowDto {
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private List<String> alibabaUrls() {
|
||||
List<AlibabaItem> items = getAlibaba();
|
||||
if (items.isEmpty()) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
List<String> result = new ArrayList<>(items.size());
|
||||
for (AlibabaItem item : items) {
|
||||
String itemUrl = item.getUrl();
|
||||
if (!itemUrl.isBlank()) {
|
||||
result.add(itemUrl);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Data
|
||||
@Schema(description = "Alibaba candidate")
|
||||
public static class AlibabaItem {
|
||||
|
||||
@JsonAlias({"url", "image_url", "imageUrl", "img_url", "imgUrl", "link"})
|
||||
@Schema(description = "Alibaba image or product URL")
|
||||
private String url;
|
||||
|
||||
@JsonAlias({"price", "浠锋牸"})
|
||||
@Schema(description = "Alibaba candidate price")
|
||||
private Object price;
|
||||
|
||||
public String getUrl() {
|
||||
return url == null ? "" : url.trim();
|
||||
}
|
||||
|
||||
public String getPrice() {
|
||||
return price == null ? "" : String.valueOf(price).trim();
|
||||
}
|
||||
|
||||
public Object getRawPrice() {
|
||||
return price;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+132
-62
@@ -9,6 +9,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.databind.node.ArrayNode;
|
||||
import com.fasterxml.jackson.databind.node.ObjectNode;
|
||||
import com.nanri.aiimage.common.exception.BusinessException;
|
||||
import com.nanri.aiimage.common.exception.TaskOwnerMismatchException;
|
||||
import com.nanri.aiimage.common.service.DistributedJobLockService;
|
||||
import com.nanri.aiimage.common.util.CozeGroupResultPropagator;
|
||||
import com.nanri.aiimage.common.util.FailedStatusRowFilter;
|
||||
@@ -205,6 +206,8 @@ public class SimilarAsinTaskService {
|
||||
"id",
|
||||
"asin",
|
||||
"国家",
|
||||
"卖家名称",
|
||||
"品牌",
|
||||
"是否有货",
|
||||
"相似度",
|
||||
"是否符合类目",
|
||||
@@ -216,9 +219,9 @@ public class SimilarAsinTaskService {
|
||||
"阿里巴巴图片2"
|
||||
);
|
||||
|
||||
private static final int IMG_COL_MAIN = 9;
|
||||
private static final int IMG_COL_PUZZLE1 = 10;
|
||||
private static final int IMG_COL_PUZZLE2 = 11;
|
||||
private static final int IMG_COL_MAIN = 11;
|
||||
private static final int IMG_COL_PUZZLE1 = 12;
|
||||
private static final int IMG_COL_PUZZLE2 = 13;
|
||||
|
||||
private final LocalFileStorageService localFileStorageService;
|
||||
private final OssStorageService ossStorageService;
|
||||
@@ -471,6 +474,7 @@ public class SimilarAsinTaskService {
|
||||
if (task == null || !MODULE_TYPE.equals(task.getModuleType()) || userId != null && !Objects.equals(userId, task.getUserId())) {
|
||||
throw new BusinessException("任务不存在");
|
||||
}
|
||||
ensureTaskOwnedByCurrentInstance(task, "activate");
|
||||
if (STATUS_SUCCESS.equals(task.getStatus()) || STATUS_FAILED.equals(task.getStatus())) {
|
||||
throw new BusinessException("任务已结束");
|
||||
}
|
||||
@@ -805,7 +809,8 @@ public class SimilarAsinTaskService {
|
||||
|
||||
public void finalizeStaleTasks() {
|
||||
if (transactionManager != null) {
|
||||
LocalDateTime threshold = LocalDateTime.now().minusMinutes(Math.max(1, properties.getStaleTimeoutMinutes()));
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
LocalDateTime threshold = now.minusMinutes(Math.max(1, properties.getStaleTimeoutMinutes()));
|
||||
long thresholdMillis = threshold.atZone(ZoneId.systemDefault()).toInstant().toEpochMilli();
|
||||
List<FileTaskEntity> tasks = listStaleFinalizeCandidates(threshold);
|
||||
for (FileTaskEntity task : tasks) {
|
||||
@@ -829,7 +834,8 @@ public class SimilarAsinTaskService {
|
||||
}
|
||||
return;
|
||||
}
|
||||
LocalDateTime threshold = LocalDateTime.now().minusMinutes(Math.max(1, properties.getStaleTimeoutMinutes()));
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
LocalDateTime threshold = now.minusMinutes(Math.max(1, properties.getStaleTimeoutMinutes()));
|
||||
long thresholdMillis = threshold.atZone(ZoneId.systemDefault()).toInstant().toEpochMilli();
|
||||
List<FileTaskEntity> tasks = listStaleFinalizeCandidates(threshold);
|
||||
for (FileTaskEntity task : tasks) {
|
||||
@@ -880,8 +886,8 @@ public class SimilarAsinTaskService {
|
||||
return fileTaskMapper.selectList(new LambdaQueryWrapper<FileTaskEntity>()
|
||||
.eq(FileTaskEntity::getModuleType, MODULE_TYPE)
|
||||
.eq(FileTaskEntity::getStatus, STATUS_RUNNING)
|
||||
.lt(FileTaskEntity::getCreatedAt, threshold)
|
||||
.orderByAsc(FileTaskEntity::getCreatedAt)
|
||||
.lt(FileTaskEntity::getUpdatedAt, threshold)
|
||||
.orderByAsc(FileTaskEntity::getUpdatedAt)
|
||||
.last("limit 200"));
|
||||
}
|
||||
|
||||
@@ -1071,22 +1077,6 @@ public class SimilarAsinTaskService {
|
||||
boolean uploadComplete = isResultSubmissionComplete(taskId);
|
||||
long pendingCozeStates = countPendingCozeStates(taskId);
|
||||
long activeAssembleJobs = taskFileJobService.countActiveAssembleJobs(taskId, MODULE_TYPE);
|
||||
if (isJavaSideProcessing(taskId)) {
|
||||
// 防止 Coze 永远 pending 时 stale-recovery 永久 defer:
|
||||
// 超过 stale-timeout-minutes × 4 仍未推进的 RUNNING 任务,强制走 finalize 链路。
|
||||
long deferCeilingMinutes = Math.max(1, properties.getStaleTimeoutMinutes()) * 4L;
|
||||
LocalDateTime updatedAt = task.getUpdatedAt();
|
||||
if (updatedAt != null
|
||||
&& Duration.between(updatedAt, LocalDateTime.now()).toMinutes() >= deferCeilingMinutes) {
|
||||
log.warn("[similar-asin] stale recovery defer ceiling exceeded, forcing finalize taskId={} updatedAt={} ceilingMinutes={} pendingCozeStates={} activeAssembleJobs={}",
|
||||
taskId, updatedAt, deferCeilingMinutes, pendingCozeStates, activeAssembleJobs);
|
||||
return false;
|
||||
}
|
||||
touchJavaSideTaskActivity(taskId);
|
||||
log.info("[similar-asin] stale recovery deferred because Java-side processing is still active taskId={} uploadComplete={} pendingCozeStates={} activeAssembleJobs={}",
|
||||
taskId, uploadComplete, pendingCozeStates, activeAssembleJobs);
|
||||
return true;
|
||||
}
|
||||
if (!hasPersistedResultRows(taskId)) {
|
||||
return false;
|
||||
}
|
||||
@@ -1095,10 +1085,10 @@ public class SimilarAsinTaskService {
|
||||
if (forcedScopes <= 0) {
|
||||
return false;
|
||||
}
|
||||
log.warn("[similar-asin] python heartbeat timed out, forcing finalize pipeline taskId={} pendingCozeStates={} activeAssembleJobs={} forcedScopes={}",
|
||||
log.warn("[similar-asin] Python 回传心跳超时,已封口上传并继续 Coze/文件收尾 taskId={} pendingCozeStates={} activeAssembleJobs={} forcedScopes={}",
|
||||
taskId, pendingCozeStates, activeAssembleJobs, forcedScopes);
|
||||
} else {
|
||||
log.warn("[similar-asin] stale running task resuming coze/file assembly after python timeout taskId={} pendingCozeStates={} activeAssembleJobs={}",
|
||||
log.warn("[similar-asin] Python 超时恢复继续推进 Coze/文件收尾 taskId={} pendingCozeStates={} activeAssembleJobs={}",
|
||||
taskId, pendingCozeStates, activeAssembleJobs);
|
||||
}
|
||||
submitCozeForSubmittedChunk(new SubmitContext(task, null, null, null, true, null));
|
||||
@@ -1272,32 +1262,48 @@ public class SimilarAsinTaskService {
|
||||
}
|
||||
|
||||
private void mergeChunkPayload(Long taskId, String scopeHash, Integer chunkIndex, List<SimilarAsinResultRowDto> rows) {
|
||||
TaskChunkEntity chunk = taskChunkMapper.selectOne(new LambdaQueryWrapper<TaskChunkEntity>()
|
||||
.eq(TaskChunkEntity::getTaskId, taskId)
|
||||
.eq(TaskChunkEntity::getModuleType, MODULE_TYPE)
|
||||
.eq(TaskChunkEntity::getScopeHash, scopeHash)
|
||||
.eq(TaskChunkEntity::getChunkIndex, chunkIndex)
|
||||
.last("limit 1"));
|
||||
if (chunk == null || rows == null || rows.isEmpty()) {
|
||||
if (rows == null || rows.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
Map<String, SimilarAsinResultRowDto> persistedRows = readChunkRows(chunk);
|
||||
for (SimilarAsinResultRowDto row : rows) {
|
||||
persistedRows.put(rowKey(row), row);
|
||||
}
|
||||
String payloadJson = writeJson(rows == null ? List.of() : rows, "结果序列化失败");
|
||||
payloadJson = writeJson(new ArrayList<>(persistedRows.values()), "相似ASIN分片载荷合并失败");
|
||||
String oldPayload = chunk.getPayloadJson();
|
||||
String storedPayload = transientPayloadStorageService.storeChunkPayloadVersioned(MODULE_TYPE, taskId, scopeHash, chunkIndex, payloadJson);
|
||||
chunk.setPayloadJson(storedPayload);
|
||||
chunk.setPayloadHash(DigestUtil.sha256Hex(payloadJson));
|
||||
chunk.setUpdatedAt(LocalDateTime.now());
|
||||
int updated = taskChunkMapper.updateById(chunk);
|
||||
if (updated <= 0) {
|
||||
int maxAttempts = 3;
|
||||
for (int attempt = 1; attempt <= maxAttempts; attempt++) {
|
||||
TaskChunkEntity chunk = taskChunkMapper.selectOne(new LambdaQueryWrapper<TaskChunkEntity>()
|
||||
.eq(TaskChunkEntity::getTaskId, taskId)
|
||||
.eq(TaskChunkEntity::getModuleType, MODULE_TYPE)
|
||||
.eq(TaskChunkEntity::getScopeHash, scopeHash)
|
||||
.eq(TaskChunkEntity::getChunkIndex, chunkIndex)
|
||||
.last("limit 1"));
|
||||
if (chunk == null) {
|
||||
return;
|
||||
}
|
||||
Map<String, SimilarAsinResultRowDto> persistedRows = readChunkRows(chunk);
|
||||
for (SimilarAsinResultRowDto row : rows) {
|
||||
persistedRows.put(rowKey(row), row);
|
||||
}
|
||||
String payloadJson = writeJson(new ArrayList<>(persistedRows.values()), "相似ASIN分片载荷合并失败");
|
||||
String oldPayload = chunk.getPayloadJson();
|
||||
String oldPayloadHash = chunk.getPayloadHash();
|
||||
String newPayloadHash = DigestUtil.sha256Hex(payloadJson);
|
||||
String storedPayload = transientPayloadStorageService.storeChunkPayloadVersioned(MODULE_TYPE, taskId, scopeHash, chunkIndex, payloadJson);
|
||||
int updated = taskChunkMapper.update(null, new LambdaUpdateWrapper<TaskChunkEntity>()
|
||||
.eq(TaskChunkEntity::getId, chunk.getId())
|
||||
.eq(TaskChunkEntity::getPayloadHash, oldPayloadHash)
|
||||
.set(TaskChunkEntity::getPayloadJson, storedPayload)
|
||||
.set(TaskChunkEntity::getPayloadHash, newPayloadHash)
|
||||
.set(TaskChunkEntity::getUpdatedAt, LocalDateTime.now()));
|
||||
if (updated > 0) {
|
||||
log.debug("[similar-asin] chunk payload replaced taskId={} scopeHash={} chunk={} oldPayload={} newPayload={} attempt={}",
|
||||
taskId, scopeHash, chunkIndex, oldPayload, storedPayload, attempt);
|
||||
transientPayloadStorageService.deleteReplacedPayloadIfNeeded(oldPayload, storedPayload);
|
||||
return;
|
||||
}
|
||||
transientPayloadStorageService.deletePayloadIfPresent(storedPayload);
|
||||
throw new IllegalStateException("相似ASIN分片载荷更新失败");
|
||||
if (attempt < maxAttempts) {
|
||||
log.warn("[similar-asin] chunk payload CAS conflict, retry merge taskId={} scopeHash={} chunk={} attempt={}/{}",
|
||||
taskId, scopeHash, chunkIndex, attempt, maxAttempts);
|
||||
}
|
||||
}
|
||||
transientPayloadStorageService.deleteReplacedPayloadIfNeeded(oldPayload, storedPayload);
|
||||
throw new IllegalStateException("相似ASIN分片载荷更新失败");
|
||||
}
|
||||
|
||||
private List<SimilarAsinResultRowDto> expandRows(List<SimilarAsinResultRowDto> rows,
|
||||
@@ -1482,7 +1488,8 @@ public class SimilarAsinTaskService {
|
||||
}
|
||||
String url = row.getUrl();
|
||||
List<String> urls = row.getUrls();
|
||||
log.info("[similar-asin] python inbound idx={} groupKey={} rowToken={} id={} asin={} country={} title={} sku={} url={} urlsSize={} urlsHead={} urlsTail={}",
|
||||
List<SimilarAsinResultRowDto.AlibabaItem> alibaba = row.getAlibaba();
|
||||
log.info("[similar-asin] python inbound idx={} groupKey={} rowToken={} id={} asin={} country={} title={} sku={} price={} url={} urlsSize={} alibabaSize={} urlsHead={} urlsTail={}",
|
||||
i,
|
||||
normalize(row.getGroupKey()),
|
||||
normalize(row.getRowToken()),
|
||||
@@ -1491,8 +1498,10 @@ public class SimilarAsinTaskService {
|
||||
normalize(row.getCountry()),
|
||||
abbreviateForLog(row.getTitle(), 80),
|
||||
normalize(row.getSku()),
|
||||
normalize(row.getPrice()),
|
||||
abbreviateForLog(url, 200),
|
||||
urls == null ? 0 : urls.size(),
|
||||
alibaba == null ? 0 : alibaba.size(),
|
||||
urls == null || urls.isEmpty() ? "" : abbreviateForLog(urls.get(0), 200),
|
||||
urls == null || urls.size() <= 1 ? "" : abbreviateForLog(urls.get(urls.size() - 1), 200));
|
||||
}
|
||||
@@ -1698,6 +1707,9 @@ public class SimilarAsinTaskService {
|
||||
int batchSize = resolveCozeBatchSize(readImgSwitch(task));
|
||||
int cozeWorkUnits = countCozeWorkUnits(chunks, batchSize);
|
||||
int totalProgressUnits = Math.max(3, cozeWorkUnits + 3);
|
||||
if (countPendingCozeStates(task.getId()) > 0) {
|
||||
finalizeTimedOutCozeStatesForTask(task.getId());
|
||||
}
|
||||
if (countPendingCozeStates(task.getId()) > 0) {
|
||||
taskFileJobService.touchRunning(job.getId());
|
||||
touchJavaSideTaskActivity(task.getId());
|
||||
@@ -2397,7 +2409,16 @@ public class SimilarAsinTaskService {
|
||||
FileTaskEntity task = taskForPoll(state.getTaskId());
|
||||
if (task != null) {
|
||||
Map<String, List<SimilarAsinParsedRowVo>> allRowsByBaseId = allRowsByBaseIdForPoll(task);
|
||||
mergeCozeRowsIntoChunk(task, context.chunkScopeHash(), context.chunkIndex(), cozeRows, allRowsByBaseId);
|
||||
try {
|
||||
mergeCozeRowsIntoChunk(task, context.chunkScopeHash(), context.chunkIndex(), cozeRows, allRowsByBaseId);
|
||||
} catch (Exception mergeEx) {
|
||||
if (failureMessage.isBlank()) {
|
||||
throw mergeEx;
|
||||
}
|
||||
log.warn("[similar-asin] coze failed result merge failed, mark state terminal anyway taskId={} stateId={} executeId={} err={}",
|
||||
state.getTaskId(), state.getId(), state.getCozeExecuteId(),
|
||||
firstNonBlank(mergeEx.getMessage(), mergeEx.getClass().getSimpleName()));
|
||||
}
|
||||
}
|
||||
}
|
||||
markCozeStateTerminal(state,
|
||||
@@ -2411,11 +2432,17 @@ public class SimilarAsinTaskService {
|
||||
FileTaskEntity task = taskForPoll(state.getTaskId());
|
||||
if (task != null) {
|
||||
Map<String, List<SimilarAsinParsedRowVo>> allRowsByBaseId = allRowsByBaseIdForPoll(task);
|
||||
mergeCozeRowsIntoChunk(task,
|
||||
context.chunkScopeHash(),
|
||||
context.chunkIndex(),
|
||||
cozeClient.markRowsFailed(batchRows, message),
|
||||
allRowsByBaseId);
|
||||
try {
|
||||
mergeCozeRowsIntoChunk(task,
|
||||
context.chunkScopeHash(),
|
||||
context.chunkIndex(),
|
||||
cozeClient.markRowsFailed(batchRows, message),
|
||||
allRowsByBaseId);
|
||||
} catch (Exception mergeEx) {
|
||||
log.warn("[similar-asin] coze timeout fallback merge failed, mark state terminal anyway taskId={} stateId={} executeId={} err={}",
|
||||
state.getTaskId(), state.getId(), state.getCozeExecuteId(),
|
||||
firstNonBlank(mergeEx.getMessage(), mergeEx.getClass().getSimpleName()));
|
||||
}
|
||||
}
|
||||
markCozeStateTerminal(state, COZE_STATUS_FAILED, message);
|
||||
maybeFinalizeCozeJob(state.getTaskId(), context);
|
||||
@@ -2427,6 +2454,45 @@ public class SimilarAsinTaskService {
|
||||
}
|
||||
}
|
||||
|
||||
private void finalizeTimedOutCozeStatesForTask(Long taskId) {
|
||||
if (taskId == null || taskId <= 0) {
|
||||
return;
|
||||
}
|
||||
List<TaskScopeStateEntity> states = taskScopeStateMapper.selectList(new LambdaQueryWrapper<TaskScopeStateEntity>()
|
||||
.eq(TaskScopeStateEntity::getTaskId, taskId)
|
||||
.eq(TaskScopeStateEntity::getModuleType, MODULE_TYPE)
|
||||
.in(TaskScopeStateEntity::getCozeStatus, List.of(COZE_STATUS_SUBMITTED, COZE_STATUS_RUNNING))
|
||||
.orderByAsc(TaskScopeStateEntity::getCozeSubmittedAt)
|
||||
.last("limit 50"));
|
||||
if (states == null || states.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
for (TaskScopeStateEntity state : states) {
|
||||
if (state == null || state.getId() == null || !isCozeStateTimedOut(state)) {
|
||||
continue;
|
||||
}
|
||||
CozeBatchContext context = readCozeBatchContext(state);
|
||||
if (context == null || context.resultId() == null) {
|
||||
markCozeStateTerminal(state, COZE_STATUS_FAILED, "Coze 批次上下文缺失");
|
||||
continue;
|
||||
}
|
||||
List<SimilarAsinResultRowDto> batchRows = readCozeBatchRows(state);
|
||||
FileTaskEntity task = taskForPoll(taskId);
|
||||
if (task != null) {
|
||||
Map<String, List<SimilarAsinParsedRowVo>> allRowsByBaseId = allRowsByBaseIdForPoll(task);
|
||||
mergeCozeRowsIntoChunk(task,
|
||||
context.chunkScopeHash(),
|
||||
context.chunkIndex(),
|
||||
cozeClient.markRowsFailed(batchRows, "Coze 异步工作流轮询超时"),
|
||||
allRowsByBaseId);
|
||||
}
|
||||
markCozeStateTerminal(state, COZE_STATUS_FAILED, "Coze 异步工作流轮询超时");
|
||||
maybeFinalizeCozeJob(taskId, context);
|
||||
log.warn("[similar-asin] 文件任务超时兜底已将 Coze pending 批次置为失败 taskId={} stateId={} jobId={}",
|
||||
taskId, state.getId(), context.jobId());
|
||||
}
|
||||
}
|
||||
|
||||
private boolean retryFailedCozeBatchState(TaskScopeStateEntity state,
|
||||
CozeBatchContext context,
|
||||
List<SimilarAsinResultRowDto> batchRows,
|
||||
@@ -2913,7 +2979,7 @@ public class SimilarAsinTaskService {
|
||||
if (CozeFailureClassifier.isThrottleLockTimeout(message)) {
|
||||
if (isCozeStateTimedOut(state)) {
|
||||
Map<String, List<SimilarAsinParsedRowVo>> allRowsByBaseId = allRowsByBaseIdForPoll(task);
|
||||
String finalMessage = "Coze pending submit timeout after waiting credentials: " + message;
|
||||
String finalMessage = "等待 Coze 提交凭证超时:" + message;
|
||||
mergeCozeRowsIntoChunk(task,
|
||||
null,
|
||||
null,
|
||||
@@ -2933,7 +2999,7 @@ public class SimilarAsinTaskService {
|
||||
Map<String, List<SimilarAsinParsedRowVo>> allRowsByBaseId = allRowsByBaseIdForPoll(task);
|
||||
String finalMessage = isCozeStateTimedOut(state)
|
||||
? message + " (timeout after " + properties.getCozePollTimeoutMillis() + "ms)"
|
||||
: message + " after " + nextAttemptCount + " submit attempts";
|
||||
: message + ",已重试提交 " + nextAttemptCount + " 次";
|
||||
mergeCozeRowsIntoChunk(task,
|
||||
null,
|
||||
null,
|
||||
@@ -3734,11 +3800,6 @@ public class SimilarAsinTaskService {
|
||||
return hasCompletedScope;
|
||||
}
|
||||
|
||||
private boolean isJavaSideProcessing(Long taskId) {
|
||||
return countPendingCozeStates(taskId) > 0
|
||||
|| taskFileJobService.countActiveAssembleJobs(taskId, MODULE_TYPE) > 0;
|
||||
}
|
||||
|
||||
private void touchJavaSideTaskActivity(Long taskId) {
|
||||
if (taskId == null || taskId <= 0) {
|
||||
return;
|
||||
@@ -3795,7 +3856,11 @@ public class SimilarAsinTaskService {
|
||||
}
|
||||
log.warn("[similar-asin] reject task operation because owner is another instance taskId={} operation={} owner={} current={}",
|
||||
task == null ? null : task.getId(), operation, owner, currentInstanceId());
|
||||
throw new BusinessException(40903, "This task is bound to another service instance");
|
||||
throw new TaskOwnerMismatchException(
|
||||
task == null ? null : task.getId(),
|
||||
operation,
|
||||
owner,
|
||||
currentInstanceId());
|
||||
}
|
||||
|
||||
private boolean isCozeStateOwnedByCurrentInstance(TaskScopeStateEntity state) {
|
||||
@@ -4461,6 +4526,8 @@ public class SimilarAsinTaskService {
|
||||
row.createCell(col++).setCellValue(firstNonBlank(parsedRow.getDisplayId(), parsedRow.getSourceId()));
|
||||
row.createCell(col++).setCellValue(firstNonBlank(parsedRow.getAsin(), ""));
|
||||
row.createCell(col++).setCellValue(firstNonBlank(parsedRow.getCountry(), ""));
|
||||
row.createCell(col++).setCellValue(readValueByHeader(parsedRow, "卖家名称", "卖家名", "卖家", "店铺名称", "店铺名", "seller name", "seller_name", "seller-name", "sellername", "store name", "shop name"));
|
||||
row.createCell(col++).setCellValue(readValueByHeader(parsedRow, "品牌", "brand"));
|
||||
row.createCell(col++).setCellValue(resultRow == null ? "" : userFacingCozeCellValue(resultRow, resultRow.getIsStock()));
|
||||
row.createCell(col++).setCellValue(resultRow == null ? "" : userFacingCozeCellValue(resultRow, resultRow.getSimilarity()));
|
||||
row.createCell(col++).setCellValue(resultRow == null ? "" : userFacingCozeCellValue(resultRow, resultRow.getIsConform()));
|
||||
@@ -5197,6 +5264,7 @@ public class SimilarAsinTaskService {
|
||||
if (task == null || !MODULE_TYPE.equals(task.getModuleType()) || userId != null && !Objects.equals(userId, task.getUserId())) {
|
||||
throw new BusinessException("任务不存在");
|
||||
}
|
||||
ensureTaskOwnedByCurrentInstance(task, "parsed payload");
|
||||
return readParsedPayload(task);
|
||||
}
|
||||
|
||||
@@ -5305,6 +5373,8 @@ public class SimilarAsinTaskService {
|
||||
log.warn("[similar-asin] read chunk payload failed taskId={} chunk={} crossInstance={} err={}",
|
||||
chunk.getTaskId(), chunk.getChunkIndex(), crossInstance, msg);
|
||||
recordChunkReadFailure(chunk, crossInstance, msg);
|
||||
throw new BusinessException("similar ASIN chunk payload read failed chunk="
|
||||
+ chunk.getChunkIndex() + ": " + msg, ex);
|
||||
}
|
||||
return rows;
|
||||
}
|
||||
|
||||
+94
-15
@@ -92,6 +92,10 @@ public class SimilarAsinImageEmbedder {
|
||||
|
||||
private static final String UA = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 "
|
||||
+ "(KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36";
|
||||
private static final String IMAGE_ACCEPT = "image/avif,image/webp,image/apng,image/svg+xml,image/*,*/*;q=0.8";
|
||||
private static final String DOWNLOAD_ACCEPT = "*/*";
|
||||
private static final String ACCEPT_LANGUAGE = "en-US,en;q=0.9,zh-CN;q=0.8,zh;q=0.7";
|
||||
private static final String AMAZON_REFERER = "https://www.amazon.com/";
|
||||
|
||||
private final int downloadTimeoutSeconds;
|
||||
private final int downloadPoolSize;
|
||||
@@ -108,9 +112,9 @@ public class SimilarAsinImageEmbedder {
|
||||
.readTimeout(Duration.ofSeconds(downloadTimeoutSeconds))
|
||||
.writeTimeout(Duration.ofSeconds(downloadTimeoutSeconds))
|
||||
.callTimeout(Duration.ofSeconds(downloadTimeoutSeconds * 2L))
|
||||
.retryOnConnectionFailure(false)
|
||||
.followRedirects(false)
|
||||
.followSslRedirects(false)
|
||||
.retryOnConnectionFailure(true)
|
||||
.followRedirects(true)
|
||||
.followSslRedirects(true)
|
||||
.dns(new SafeDns(Dns.SYSTEM))
|
||||
.build();
|
||||
this.downloadPool = Executors.newFixedThreadPool(downloadPoolSize, namedFactory("similar-asin-image-dl"));
|
||||
@@ -129,6 +133,10 @@ public class SimilarAsinImageEmbedder {
|
||||
return downloadPoolSize;
|
||||
}
|
||||
|
||||
OkHttpClient httpClient() {
|
||||
return httpClient;
|
||||
}
|
||||
|
||||
/**
|
||||
* P2-8 prefetch:assemble 阶段第一遍扫所有 url,并行预下载到 taskImageCache。
|
||||
* embed() 第二遍写入时若 cache 命中直接复用,否则回退到现在的串行下载逻辑(保持兜底)。
|
||||
@@ -174,7 +182,7 @@ public class SimilarAsinImageEmbedder {
|
||||
taskImageCache.putIfAbsent(url, thumb);
|
||||
} catch (Exception ex) {
|
||||
// 预下载失败不抛出:embed() 时同 url 会再次尝试并走原有兜底链路。
|
||||
log.debug("[similar-asin][image] prefetch-fail url={} err={}", url, ex.getMessage());
|
||||
log.debug("[similar-asin][image] prefetch-fail url={} err={}", url, errorSummary(ex));
|
||||
}
|
||||
};
|
||||
futures.add(completion.submit(task, null));
|
||||
@@ -229,7 +237,7 @@ public class SimilarAsinImageEmbedder {
|
||||
byte[] raw = downloadWithRetry(trimmed);
|
||||
return resizeImage(trimmed, raw);
|
||||
} catch (Exception ex) {
|
||||
log.debug("[similar-asin][image] prefetch-cache-fail url={} err={}", trimmed, ex.getMessage());
|
||||
log.debug("[similar-asin][image] prefetch-cache-fail url={} err={}", trimmed, errorSummary(ex));
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -273,6 +281,7 @@ public class SimilarAsinImageEmbedder {
|
||||
int colIdx,
|
||||
Row row,
|
||||
Map<String, ResizedImage> taskImageCache) {
|
||||
long startedNanos = System.nanoTime();
|
||||
try {
|
||||
ResizedImage thumb = taskImageCache.get(trimmedUrl);
|
||||
boolean cacheHit = thumb != null;
|
||||
@@ -294,11 +303,14 @@ public class SimilarAsinImageEmbedder {
|
||||
} catch (ResizeOversizeException ex) {
|
||||
log.warn("[similar-asin][image] resize-oversize url={} bytes={}", ex.url(), ex.size());
|
||||
} catch (ResizeException ex) {
|
||||
log.warn("[similar-asin][image] resize-fail url={} err={}", trimmedUrl, ex.getMessage());
|
||||
log.warn("[similar-asin][image] resize-fail url={} elapsedMs={} err={}",
|
||||
trimmedUrl, elapsedMs(startedNanos), errorSummary(ex));
|
||||
} catch (IOException | TimeoutException ex) {
|
||||
log.warn("[similar-asin][image] download-fail url={} err={}", trimmedUrl, ex.getMessage());
|
||||
log.warn("[similar-asin][image] download-fail url={} elapsedMs={} err={}",
|
||||
trimmedUrl, elapsedMs(startedNanos), errorSummary(ex));
|
||||
} catch (RuntimeException ex) {
|
||||
log.warn("[similar-asin][image] embed-fail url={} err={}", trimmedUrl, ex.getMessage());
|
||||
log.warn("[similar-asin][image] embed-fail url={} elapsedMs={} err={}",
|
||||
trimmedUrl, elapsedMs(startedNanos), errorSummary(ex));
|
||||
}
|
||||
row.createCell(colIdx).setCellValue(trimmedUrl);
|
||||
return null;
|
||||
@@ -334,10 +346,12 @@ public class SimilarAsinImageEmbedder {
|
||||
private byte[] downloadWithRetry(String url) throws IOException, TimeoutException {
|
||||
validateHttpsUrl(url);
|
||||
IOException last = null;
|
||||
TimeoutException lastTimeout = null;
|
||||
long waitSeconds = downloadTimeoutSeconds * 2L;
|
||||
for (int attempt = 0; attempt <= DOWNLOAD_MAX_RETRY; attempt++) {
|
||||
Future<byte[]> future = downloadPool.submit(() -> doFetch(url));
|
||||
try {
|
||||
return future.get(downloadTimeoutSeconds * 2L, TimeUnit.SECONDS);
|
||||
return future.get(waitSeconds, TimeUnit.SECONDS);
|
||||
} catch (java.util.concurrent.ExecutionException ee) {
|
||||
Throwable cause = ee.getCause();
|
||||
if (cause instanceof DownloadOversizeException doe) {
|
||||
@@ -345,6 +359,8 @@ public class SimilarAsinImageEmbedder {
|
||||
}
|
||||
if (cause instanceof IOException io) {
|
||||
last = io;
|
||||
lastTimeout = null;
|
||||
logRetry(url, attempt, io);
|
||||
continue;
|
||||
}
|
||||
if (cause instanceof RuntimeException re) {
|
||||
@@ -353,15 +369,31 @@ public class SimilarAsinImageEmbedder {
|
||||
throw new IOException("image download failed: " + cause.getMessage(), cause);
|
||||
} catch (java.util.concurrent.TimeoutException te) {
|
||||
future.cancel(true);
|
||||
throw te;
|
||||
TimeoutException wrapped = new TimeoutException("image download timeout after attempt "
|
||||
+ (attempt + 1) + "/" + (DOWNLOAD_MAX_RETRY + 1)
|
||||
+ ", waitSeconds=" + waitSeconds);
|
||||
wrapped.initCause(te);
|
||||
lastTimeout = wrapped;
|
||||
last = null;
|
||||
logRetry(url, attempt, wrapped);
|
||||
} catch (InterruptedException ie) {
|
||||
Thread.currentThread().interrupt();
|
||||
throw new IOException("image download interrupted", ie);
|
||||
}
|
||||
}
|
||||
if (lastTimeout != null) {
|
||||
throw lastTimeout;
|
||||
}
|
||||
throw last != null ? last : new IOException("image download failed without cause");
|
||||
}
|
||||
|
||||
private void logRetry(String url, int attempt, Exception ex) {
|
||||
if (attempt < DOWNLOAD_MAX_RETRY) {
|
||||
log.debug("[similar-asin][image] download-retry url={} nextAttempt={}/{} err={}",
|
||||
url, attempt + 2, DOWNLOAD_MAX_RETRY + 1, errorSummary(ex));
|
||||
}
|
||||
}
|
||||
|
||||
static void validateHttpsUrl(String url) {
|
||||
URI uri;
|
||||
try {
|
||||
@@ -407,11 +439,7 @@ public class SimilarAsinImageEmbedder {
|
||||
}
|
||||
|
||||
private byte[] doFetch(String url) throws IOException {
|
||||
Request req = new Request.Builder()
|
||||
.url(url)
|
||||
.header("User-Agent", UA)
|
||||
.get()
|
||||
.build();
|
||||
Request req = buildImageRequest(url);
|
||||
try (Response resp = httpClient.newCall(req).execute()) {
|
||||
if (!resp.isSuccessful()) {
|
||||
throw new IOException("http " + resp.code() + " for " + url);
|
||||
@@ -441,6 +469,57 @@ public class SimilarAsinImageEmbedder {
|
||||
}
|
||||
}
|
||||
|
||||
static Request buildImageRequest(String url) {
|
||||
Request.Builder builder = new Request.Builder()
|
||||
.url(url)
|
||||
.header("User-Agent", UA)
|
||||
.header("Accept-Language", ACCEPT_LANGUAGE)
|
||||
.header("Cache-Control", "no-cache")
|
||||
.get();
|
||||
if (isCozeSignedImageUrl(url)) {
|
||||
// Coze/TOS signed image links behave like direct file downloads.
|
||||
// A foreign Referer can be rejected, so keep this close to a browser address-bar download.
|
||||
builder.header("Accept", DOWNLOAD_ACCEPT);
|
||||
} else {
|
||||
builder.header("Accept", IMAGE_ACCEPT)
|
||||
.header("Referer", AMAZON_REFERER);
|
||||
}
|
||||
return builder.build();
|
||||
}
|
||||
|
||||
static boolean isCozeSignedImageUrl(String url) {
|
||||
try {
|
||||
URI uri = new URI(url);
|
||||
String host = uri.getHost();
|
||||
return host != null && host.toLowerCase(Locale.ROOT).endsWith("-bot-platform-tos-sign.coze.cn");
|
||||
} catch (URISyntaxException ex) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
static long elapsedMs(long startedNanos) {
|
||||
return TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - startedNanos);
|
||||
}
|
||||
|
||||
static String errorSummary(Throwable ex) {
|
||||
if (ex == null) {
|
||||
return "unknown";
|
||||
}
|
||||
StringBuilder sb = new StringBuilder(ex.getClass().getSimpleName());
|
||||
String message = ex.getMessage();
|
||||
sb.append(": ");
|
||||
sb.append(message == null || message.isBlank() ? "<empty>" : message);
|
||||
Throwable cause = ex.getCause();
|
||||
if (cause != null) {
|
||||
sb.append("; cause=").append(cause.getClass().getSimpleName());
|
||||
String causeMessage = cause.getMessage();
|
||||
if (causeMessage != null && !causeMessage.isBlank()) {
|
||||
sb.append(": ").append(causeMessage);
|
||||
}
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 等比缩放到长边 TARGET_LONG_EDGE_PX,JPEG q=0.75 输出;返回字节 + 实际像素,供调用方按图自适应单元格尺寸。
|
||||
* 出口校验字节数 ≤ MAX_THUMB_SIZE_BYTES,超限按 MAX_THUMB_SIZE → 长边 → 质量的顺序迭代降级,
|
||||
|
||||
Reference in New Issue
Block a user