Przeglądaj źródła

refactor: 移除商品信息示例和亚马逊爬虫中的备注字段

- 在商品信息示例中,移除了 `remark` 字段,以简化数据结构
- 在亚马逊爬虫中,移除了与 `remark` 相关的逻辑,确保代码整洁
- 该更改旨在提高代码可读性,符合单一职责原则
master
lizhuang 1 miesiąc temu
rodzic
commit
1e55ab31b6

+ 1
- 2
examples/productInfoExample.js Wyświetl plik

@@ -73,7 +73,7 @@ async function saveProductInfo(goods, productInfo) {
console.log(
`开始保存商品信息: ${goods.goodsSkuSn} - ${new Date().toLocaleString()}`
);
const { title, price, sku, remark, screenshotUrl } = productInfo[0];
const { title, price, sku, screenshotUrl } = productInfo[0];
const res = await axios.post(
serverClient.baseURL +
"/system/operationWarnresult/receiveLatestGoodsInfo",
@@ -82,7 +82,6 @@ async function saveProductInfo(goods, productInfo) {
price: price.toString(),
sku,
url: goods.goodsSkuUrl,
remark,
screenshotUrl: screenshotUrl,
}
);

+ 1
- 2
src/services/crawlers/amazon/AmazonCrawler.js Wyświetl plik

@@ -306,8 +306,7 @@ class AmazonCrawler extends BaseCrawler {
title,
price: price ? price.toLocaleString() : null,
sku: asin,
url,
remark: couponValue > 0 ? `Original Price: JP¥${priceText} Coupon Price: JP¥${couponValue}` : null
url
};
}, { selectors: this.selectors, couponValue });


Ładowanie…
Anuluj
Zapisz