diff --git a/app/.env b/app/.env index 63f4056..8e644f7 100644 --- a/app/.env +++ b/app/.env @@ -13,8 +13,9 @@ client_name=ShuFuAI # java_api_base=http://47.111.163.154:18080 -java_api_base=http://127.0.0.1:18080 -# java_api_base=http://8.136.19.173:18080 -# java_api_base=http://121.196.149.225:18080 - - +java_api_base=http://127.0.0.1:18080 +# java_api_base=http://8.136.19.173:18080 +# java_api_base=http://121.196.149.225:18080 + +debug=true + diff --git a/app/__pycache__/config.cpython-312.pyc b/app/__pycache__/config.cpython-312.pyc index 921936d..0e592c6 100644 Binary files a/app/__pycache__/config.cpython-312.pyc and b/app/__pycache__/config.cpython-312.pyc differ diff --git a/app/amazon/__pycache__/approve.cpython-312.pyc b/app/amazon/__pycache__/approve.cpython-312.pyc index d4bc9b6..1859b0c 100644 Binary files a/app/amazon/__pycache__/approve.cpython-312.pyc and b/app/amazon/__pycache__/approve.cpython-312.pyc differ diff --git a/app/amazon/__pycache__/price_match.cpython-312.pyc b/app/amazon/__pycache__/price_match.cpython-312.pyc index ec269dd..7350826 100644 Binary files a/app/amazon/__pycache__/price_match.cpython-312.pyc and b/app/amazon/__pycache__/price_match.cpython-312.pyc differ diff --git a/app/amazon/price_match.py b/app/amazon/price_match.py index 9eac6e0..66f4cea 100644 --- a/app/amazon/price_match.py +++ b/app/amazon/price_match.py @@ -1332,30 +1332,35 @@ class PriceTask: url = f"{DELETE_BRAND_API_BASE}/api/price-track/tasks/{task_id}/result" + country_aliases = {name: code for code, name in self.country_info.items()} + country_key = country_aliases.get(str(country_code).strip(), str(country_code).strip()) + + countries = {} + if asin or status: + countries[country_key] = [ + { + "shopMallName": shopMallName, + "asin": asin, + "price": status.get("currentPrice") if status.get("currentPrice") else "", + "recommendedPrice": status.get("recommendedPrice") if status.get("recommendedPrice") else "", + "minimumPrice": status.get("minimumPrice") if status.get("minimumPrice") else "", + "firstPlace": status.get("firstPlace") if status.get("firstPlace") else "", + "secondPlace": status.get("secondPlace") if status.get("secondPlace") else "", + "cartShopName": status.get("cartShopName") if status.get("cartShopName") else "", + "priceChangeStatus": "UPDATED", + "deleteSkipAsin": status.get("deleteSkipAsin", False), + "removeAsin": status.get("removeAsin") if status.get("removeAsin") else "", + # "modifyCount": "2", + "shippingFee": status.get("shippingFee") if status.get("shippingFee") else "", + "status": status.get("statu") + } + ] + payload = { "shops": [ { "shopName": shop_name, - "countries": { - "additionalProperties1": [ - { - "shopMallName": shopMallName, - "asin": asin, - "price": status.get("currentPrice") if status.get("currentPrice") else "", - "recommendedPrice": status.get("recommendedPrice") if status.get("recommendedPrice") else "", - "minimumPrice": status.get("minimumPrice") if status.get("minimumPrice") else "", - "firstPlace": status.get("firstPlace") if status.get("firstPlace") else "", - "secondPlace": status.get("secondPlace") if status.get("secondPlace") else "", - "cartShopName": status.get("cartShopName") if status.get("cartShopName") else "", - "priceChangeStatus": "UPDATED", - "deleteSkipAsin": status.get("deleteSkipAsin",False), - "removeAsin": status.get("removeAsin") if status.get("removeAsin") else "", - # "modifyCount": "2", - "shippingFee" : status.get("shippingFee") if status.get("shippingFee") else "", - "status": status.get("statu") - } - ] - }, + "countries": countries, "error": "" } ] @@ -1442,4 +1447,4 @@ if __name__ == '__main__': front_end_data, current_Price, current_shop_name, recommended_price, recommended_shipping ) - print(res) \ No newline at end of file + print(res) diff --git a/app/blueprints/__pycache__/main.cpython-312.pyc b/app/blueprints/__pycache__/main.cpython-312.pyc index 61aa0d3..fe704e0 100644 Binary files a/app/blueprints/__pycache__/main.cpython-312.pyc and b/app/blueprints/__pycache__/main.cpython-312.pyc differ diff --git a/app/config.py b/app/config.py index db6b0e8..0fbff9e 100644 --- a/app/config.py +++ b/app/config.py @@ -51,7 +51,7 @@ os.environ['OSS_ACCESS_KEY_SECRET'] = accessKeySecret os.environ['SECRET_KEY'] = "ddffc7c1d02121d9554d7b080b2511b6" -debug = False +debug = os.getenv("debug", "false").strip().lower() in ("1", "true", "yes", "on") version = "1.0.56" APP_UPDATE_URL = f"{_base_url}/api/version/latest" # 检测更新接口地址,返回 { "file_url": "...", "version": "x.x.x" } os.environ['APP_VERSION'] = version diff --git a/app/main.py b/app/main.py index be4fba7..1f0b379 100644 --- a/app/main.py +++ b/app/main.py @@ -50,8 +50,8 @@ class WindowAPI: def __init__(self, window): self._window = window self._is_maximized = False - window.events.maximized += lambda _: setattr(self, '_is_maximized', True) - window.events.restored += lambda _: setattr(self, '_is_maximized', False) + window.events.maximized += lambda *args: setattr(self, '_is_maximized', True) + window.events.restored += lambda *args: setattr(self, '_is_maximized', False) def close(self): """关闭窗口,异步执行清理逻辑"""