ey-commerce-lib 1.0.12__tar.gz → 1.0.13__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of ey-commerce-lib might be problematic. Click here for more details.
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.13}/PKG-INFO +1 -1
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.13}/pyproject.toml +1 -1
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.13}/src/ey_commerce_lib/dxm/main.py +34 -0
- ey_commerce_lib-1.0.13/src/ey_commerce_lib/dxm/parser/count.py +43 -0
- ey_commerce_lib-1.0.13/src/ey_commerce_lib/takesend/config.py +26 -0
- ey_commerce_lib-1.0.13/src/ey_commerce_lib/takesend/main.py +52 -0
- ey_commerce_lib-1.0.13/tests/dxm/test_purchase.py +85 -0
- ey_commerce_lib-1.0.13/tests/kogan/__init__.py +0 -0
- ey_commerce_lib-1.0.12/tests/dxm/test_purchase.py +0 -49
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.13}/.gitignore +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.13}/.python-version +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.13}/README.md +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.13}/pytest.ini +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.13}/src/ey_commerce_lib/__init__.py +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.13}/src/ey_commerce_lib/dxm/__init__.py +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.13}/src/ey_commerce_lib/dxm/constant/__init__.py +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.13}/src/ey_commerce_lib/dxm/constant/order.py +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.13}/src/ey_commerce_lib/dxm/exception/__init__.py +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.13}/src/ey_commerce_lib/dxm/exception/common.py +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.13}/src/ey_commerce_lib/dxm/order.py +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.13}/src/ey_commerce_lib/dxm/parser/__init__.py +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.13}/src/ey_commerce_lib/dxm/parser/common.py +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.13}/src/ey_commerce_lib/dxm/parser/order.py +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.13}/src/ey_commerce_lib/dxm/parser/purchase.py +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.13}/src/ey_commerce_lib/dxm/parser/warehouse.py +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.13}/src/ey_commerce_lib/dxm/schemas/__init__.py +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.13}/src/ey_commerce_lib/dxm/schemas/common.py +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.13}/src/ey_commerce_lib/dxm/schemas/order.py +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.13}/src/ey_commerce_lib/dxm/schemas/warehouse.py +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.13}/src/ey_commerce_lib/dxm/utils/__init__.py +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.13}/src/ey_commerce_lib/dxm/utils/mark.py +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.13}/src/ey_commerce_lib/four_seller/__init__.py +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.13}/src/ey_commerce_lib/four_seller/constant/__init__.py +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.13}/src/ey_commerce_lib/four_seller/constant/response.py +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.13}/src/ey_commerce_lib/four_seller/main.py +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.13}/src/ey_commerce_lib/four_seller/parser/__init__.py +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.13}/src/ey_commerce_lib/four_seller/parser/order.py +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.13}/src/ey_commerce_lib/four_seller/schemas/__init__.py +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.13}/src/ey_commerce_lib/four_seller/schemas/query/__init__.py +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.13}/src/ey_commerce_lib/four_seller/schemas/query/order.py +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.13}/src/ey_commerce_lib/four_seller/schemas/vo/__init__.py +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.13}/src/ey_commerce_lib/four_seller/schemas/vo/order.py +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.13}/src/ey_commerce_lib/kogan/__init__.py +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.13}/src/ey_commerce_lib/kogan/main.py +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.13}/src/ey_commerce_lib/kogan/schemas/__init__.py +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.13}/src/ey_commerce_lib/kogan/schemas/query/__init__.py +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.13}/src/ey_commerce_lib/kogan/schemas/query/order.py +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.13}/src/ey_commerce_lib/kogan/schemas/query/product.py +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.13}/src/ey_commerce_lib/kogan/schemas/response/__init__.py +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.13}/src/ey_commerce_lib/kogan/schemas/response/order.py +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.13}/src/ey_commerce_lib/kogan/schemas/response/product.py +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.13}/src/ey_commerce_lib/model.py +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.13}/src/ey_commerce_lib/py.typed +0 -0
- {ey_commerce_lib-1.0.12/src/ey_commerce_lib/utils → ey_commerce_lib-1.0.13/src/ey_commerce_lib/takesend}/__init__.py +0 -0
- {ey_commerce_lib-1.0.12/tests → ey_commerce_lib-1.0.13/src/ey_commerce_lib/utils}/__init__.py +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.13}/src/ey_commerce_lib/utils/close.py +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.13}/src/ey_commerce_lib/utils/dxm.py +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.13}/src/ey_commerce_lib/utils/list_util.py +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.13}/src/ey_commerce_lib/utils/str.py +0 -0
- {ey_commerce_lib-1.0.12/tests/dxm → ey_commerce_lib-1.0.13/tests}/__init__.py +0 -0
- {ey_commerce_lib-1.0.12/tests/kogan → ey_commerce_lib-1.0.13/tests/dxm}/__init__.py +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.13}/tests/kogan/test_client.py +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.13}/uv.lock +0 -0
|
@@ -4,6 +4,7 @@ from httpx import AsyncClient, Timeout
|
|
|
4
4
|
|
|
5
5
|
from ey_commerce_lib.dxm.constant.order import DxmOrderRuleType
|
|
6
6
|
from ey_commerce_lib.dxm.parser.common import get_page_info, get_purchase_pagination_info
|
|
7
|
+
from ey_commerce_lib.dxm.parser.count import parse_count
|
|
7
8
|
from ey_commerce_lib.dxm.parser.order import list_order_base_by_html, list_order_rule, get_rule_detail, \
|
|
8
9
|
get_order_detail_by_html
|
|
9
10
|
from ey_commerce_lib.dxm.parser.purchase import list_purchasing_all, list_1688_purchase_order_number, \
|
|
@@ -631,6 +632,39 @@ class DxmClient:
|
|
|
631
632
|
raise Exception(f'添加订单标记数据失败错误原因{add_comment_res.json().get("msg")}')
|
|
632
633
|
return data
|
|
633
634
|
|
|
635
|
+
async def get_state_count_api(self):
|
|
636
|
+
"""
|
|
637
|
+
获取订单各个状态统计api
|
|
638
|
+
:return:
|
|
639
|
+
"""
|
|
640
|
+
async with self.__sem:
|
|
641
|
+
get_state_res = await self.__async_client.post('/package/getStateCount.json')
|
|
642
|
+
return get_state_res.json()
|
|
643
|
+
|
|
644
|
+
async def __stat_index(self):
|
|
645
|
+
"""
|
|
646
|
+
获取店小秘订单统计页api
|
|
647
|
+
:return:
|
|
648
|
+
"""
|
|
649
|
+
async with self.__sem:
|
|
650
|
+
params = {
|
|
651
|
+
'shopIds': 'all',
|
|
652
|
+
'isIndex': '1',
|
|
653
|
+
'currency': 'USD',
|
|
654
|
+
}
|
|
655
|
+
stat_index_res = await self.__async_client.get('/stat/order/orderPerform.htm', params=params)
|
|
656
|
+
stat_index_html = stat_index_res.text
|
|
657
|
+
|
|
658
|
+
return parse_count(stat_index_html)
|
|
659
|
+
|
|
660
|
+
async def list_order_count(self):
|
|
661
|
+
"""
|
|
662
|
+
获取店小秘订单统计
|
|
663
|
+
:return:
|
|
664
|
+
"""
|
|
665
|
+
|
|
666
|
+
return await self.__stat_index()
|
|
667
|
+
|
|
634
668
|
async def __aenter__(self):
|
|
635
669
|
return self
|
|
636
670
|
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
from lxml import html
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
def parse_count(html_content: str):
|
|
5
|
+
tree = html.fromstring(html_content)
|
|
6
|
+
data_list = tree.xpath("//tr[@class='content']")
|
|
7
|
+
result = []
|
|
8
|
+
for data in data_list:
|
|
9
|
+
date = data.xpath('./td/text()')[0].strip()
|
|
10
|
+
order_number = data.xpath('./td/text()')[1].strip()
|
|
11
|
+
# 订单总金额
|
|
12
|
+
total_amount = data.xpath('./td/text()')[2].strip()
|
|
13
|
+
# 订单手续费
|
|
14
|
+
fee = data.xpath('./td/text()')[3].strip()
|
|
15
|
+
# 物流费用
|
|
16
|
+
logistics = data.xpath('./td/text()')[4].strip()
|
|
17
|
+
# 利润
|
|
18
|
+
profit = data.xpath('./td/text()')[5].strip()
|
|
19
|
+
# 退单数量
|
|
20
|
+
return_number = data.xpath('./td/text()')[6].strip()
|
|
21
|
+
# 退单金额
|
|
22
|
+
return_amount = data.xpath('./td/text()')[7].strip()
|
|
23
|
+
# 退款率
|
|
24
|
+
return_rate = data.xpath('./td/text()')[8].strip()
|
|
25
|
+
# 成本利润
|
|
26
|
+
cost_profit = data.xpath('./td/text()')[9].strip()
|
|
27
|
+
# 销售利润
|
|
28
|
+
sale_profit = data.xpath('./td/text()')[10].strip()
|
|
29
|
+
# 添加数据
|
|
30
|
+
result.append({
|
|
31
|
+
'date': date,
|
|
32
|
+
'order_number': order_number,
|
|
33
|
+
'total_amount': total_amount,
|
|
34
|
+
'fee': fee,
|
|
35
|
+
'logistics': logistics,
|
|
36
|
+
'profit': profit,
|
|
37
|
+
'return_number': return_number,
|
|
38
|
+
'return_amount': return_amount,
|
|
39
|
+
'return_rate': return_rate,
|
|
40
|
+
'cost_profit': cost_profit,
|
|
41
|
+
'sale_profit': sale_profit
|
|
42
|
+
})
|
|
43
|
+
return result
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
LOGIN_HEADERS = {
|
|
2
|
+
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,'
|
|
3
|
+
'*/*;q=0.8,application/signed-exchange;v=b3;q=0.7',
|
|
4
|
+
'Accept-Language': 'zh-CN,zh;q=0.9',
|
|
5
|
+
'Cache-Control': 'no-cache',
|
|
6
|
+
'Connection': 'keep-alive',
|
|
7
|
+
'Content-Type': 'application/x-www-form-urlencoded',
|
|
8
|
+
'Origin': 'http://k5.takesend.com:8180',
|
|
9
|
+
'Pragma': 'no-cache',
|
|
10
|
+
'Referer': 'http://k5.takesend.com:8180/c_index.jsp',
|
|
11
|
+
'Upgrade-Insecure-Requests': '1',
|
|
12
|
+
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36',
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
EDIT_HEADERS = {
|
|
16
|
+
'Accept': 'application/json, text/javascript, */*; q=0.01',
|
|
17
|
+
'Accept-Language': 'zh-CN,zh;q=0.9',
|
|
18
|
+
'Cache-Control': 'no-cache',
|
|
19
|
+
'Connection': 'keep-alive',
|
|
20
|
+
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
|
|
21
|
+
'Origin': 'http://k5.takesend.com:8180',
|
|
22
|
+
'Pragma': 'no-cache',
|
|
23
|
+
'Referer': 'http://k5.takesend.com:8180/client/Logon?action=initMenu',
|
|
24
|
+
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36',
|
|
25
|
+
'X-Requested-With': 'XMLHttpRequest',
|
|
26
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
from httpx import AsyncClient, Timeout
|
|
2
|
+
|
|
3
|
+
from ey_commerce_lib.takesend.config import LOGIN_HEADERS, EDIT_HEADERS
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class TakeSendClient(object):
|
|
7
|
+
|
|
8
|
+
def __init__(self, username: str, password: str):
|
|
9
|
+
timeout = Timeout(connect=5.0, read=20.0, write=10.0, pool=10.0)
|
|
10
|
+
self.__async_client = AsyncClient(
|
|
11
|
+
base_url="http://k5.takesend.com:8180",
|
|
12
|
+
timeout=timeout)
|
|
13
|
+
self.__username = username
|
|
14
|
+
self.__password = password
|
|
15
|
+
|
|
16
|
+
async def login(self):
|
|
17
|
+
"""
|
|
18
|
+
自动登录
|
|
19
|
+
:return:
|
|
20
|
+
"""
|
|
21
|
+
# 1. 先访问首页更新JESSIONID
|
|
22
|
+
await self.__async_client.get("/c_index.jsp")
|
|
23
|
+
# 2.在登录
|
|
24
|
+
params = {
|
|
25
|
+
'action': 'logon'
|
|
26
|
+
}
|
|
27
|
+
data = {
|
|
28
|
+
'userid': self.__username,
|
|
29
|
+
'password': self.__password
|
|
30
|
+
}
|
|
31
|
+
await self.__async_client.post("//client/Logon", params=params, data=data, headers=LOGIN_HEADERS)
|
|
32
|
+
|
|
33
|
+
async def __client_cc_order(self, excel_data: list):
|
|
34
|
+
"""
|
|
35
|
+
修改泰嘉产品上传重量数据
|
|
36
|
+
:param excel_data:
|
|
37
|
+
:return:
|
|
38
|
+
"""
|
|
39
|
+
|
|
40
|
+
params = {
|
|
41
|
+
'action': 'updateDweight',
|
|
42
|
+
}
|
|
43
|
+
data = {
|
|
44
|
+
'excel[]': excel_data,
|
|
45
|
+
}
|
|
46
|
+
return await self.__async_client.post("/Client/CCOrder", params=params, data=data, headers=EDIT_HEADERS)
|
|
47
|
+
|
|
48
|
+
async def __aenter__(self):
|
|
49
|
+
return self
|
|
50
|
+
|
|
51
|
+
async def __aexit__(self, exc_type, exc_val, exc_tb):
|
|
52
|
+
await self.__async_client.aclose()
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import pytest
|
|
2
|
+
|
|
3
|
+
from ey_commerce_lib.dxm.constant.order import ORDER_SEARCH_APPROVAL_BASE_FORM, \
|
|
4
|
+
ORDER_SEARCH_PENDING_PROCESSING_BASE_FORM, ORDER_SEARCH_SELF_WAREHOUSE_BASE_FORM, \
|
|
5
|
+
ORDER_SEARCH_OUT_OF_STOCK_BASE_FORM
|
|
6
|
+
from ey_commerce_lib.dxm.main import DxmClient
|
|
7
|
+
from ey_commerce_lib.dxm.schemas.warehouse import WarehouseProductQuery
|
|
8
|
+
from ey_commerce_lib.dxm.utils.mark import get_custom_mark_content_list_by_data_custom_mark, \
|
|
9
|
+
generate_add_or_update_user_comment_data_by_content_list
|
|
10
|
+
from ey_commerce_lib.four_seller.main import FourSellerClient
|
|
11
|
+
from ey_commerce_lib.four_seller.schemas.query.order import FourSellerOrderQueryModel
|
|
12
|
+
from ey_commerce_lib.takesend.main import TakeSendClient
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
async def login_success(user_token: str):
|
|
16
|
+
print(f'user_token: {user_token}')
|
|
17
|
+
pass
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
@pytest.mark.asyncio
|
|
21
|
+
async def test_auto_login_4seller():
|
|
22
|
+
# user_token = await auto_login_4seller(user_name="sky@eeyoung.com", password="ey010203@@")
|
|
23
|
+
# print(user_token)
|
|
24
|
+
async with FourSellerClient(
|
|
25
|
+
user_name="xxxxx",
|
|
26
|
+
password="xxxxxx",
|
|
27
|
+
login_success_call_back=login_success,
|
|
28
|
+
user_token="xxxxxx") as four_seller_client:
|
|
29
|
+
await four_seller_client.list_history_order(FourSellerOrderQueryModel())
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
cookies = {
|
|
33
|
+
'dxm_i': 'MTAyNzg5NiFhVDB4TURJM09EazIhZjc5ZTMxMjZmN2Q3NTk5OGZlMDg4YjQzNzNlNzlmOWY',
|
|
34
|
+
'dxm_t': 'MTcxNDk2NDU4MiFkRDB4TnpFME9UWTBOVGd5IWIzZWRjYTc3YTdjYWE0MmIxMWYwNjFhOTlmMDgxZjY5',
|
|
35
|
+
'dxm_c': 'TWVOMVpiclYhWXoxTlpVNHhXbUp5VmchNmM5MmM5ODc1MDBkODVjOWJmOTFlMzdhNGJiNWI3Njk',
|
|
36
|
+
'dxm_w': 'ZDc3NWVhOTdkOTEyNGE4ZmRkODBmYzc2YmFlOGVjZjEhZHoxa056YzFaV0U1TjJRNU1USTBZVGhtWkdRNE1HWmpOelppWVdVNFpXTm1NUSFmZWZiZGZiMTEwMzhlN2M4M2MzYjZmYjAxYTcxMjViMw',
|
|
37
|
+
'dxm_s': 'aMHO7LWKAQe6NzFrV3O4cceXkBriLGNmwondOR7INWs',
|
|
38
|
+
'MYJ_MKTG_fapsc5t4tc': 'JTdCJTdE',
|
|
39
|
+
'MYJ_fapsc5t4tc': 'JTdCJTIyZGV2aWNlSWQlMjIlM0ElMjJkMGRlYzNkYi00MTNlLTQyZjktOWIxNC0xYzBhZTY4MTk4ZmIlMjIlMkMlMjJ1c2VySWQlMjIlM0ElMjIxMDI3ODk2JTIyJTJDJTIycGFyZW50SWQlMjIlM0ElMjIyNTg2MzQlMjIlMkMlMjJzZXNzaW9uSWQlMjIlM0ExNzMxMDU5MDc1MjU0JTJDJTIyb3B0T3V0JTIyJTNBZmFsc2UlMkMlMjJsYXN0RXZlbnRUaW1lJTIyJTNBMTczMTA1OTA3NTQyNCUyQyUyMmxhc3RFdmVudElkJTIyJTNBMTE2JTdE',
|
|
40
|
+
'MYJ_fapsc5t4tc': 'JTdCJTIyZGV2aWNlSWQlMjIlM0ElMjJkMGRlYzNkYi00MTNlLTQyZjktOWIxNC0xYzBhZTY4MTk4ZmIlMjIlMkMlMjJ1c2VySWQlMjIlM0ElMjIxMDI3ODk2JTIyJTJDJTIycGFyZW50SWQlMjIlM0ElMjIyNTg2MzQlMjIlMkMlMjJzZXNzaW9uSWQlMjIlM0ExNzMxMDU5MDc1MTEwJTJDJTIyb3B0T3V0JTIyJTNBZmFsc2UlMkMlMjJsYXN0RXZlbnRUaW1lJTIyJTNBMTczMTA1OTA3NTk5NiUyQyUyMmxhc3RFdmVudElkJTIyJTNBMTE2JTdE',
|
|
41
|
+
'_dxm_ad_client_id': '7AEFA0B78CE1B35075D391C5226612CED',
|
|
42
|
+
'Hm_lvt_f8001a3f3d9bf5923f780580eb550c0b': '1731459796,1731547149,1731590878,1731893161',
|
|
43
|
+
'HMACCOUNT': 'F266E8F609D8D8B1',
|
|
44
|
+
'MYJ_fapsc5t4tc': 'JTdCJTIyZGV2aWNlSWQlMjIlM0ElMjJkMGRlYzNkYi00MTNlLTQyZjktOWIxNC0xYzBhZTY4MTk4ZmIlMjIlMkMlMjJ1c2VySWQlMjIlM0ElMjIxMDI3ODk2JTIyJTJDJTIycGFyZW50SWQlMjIlM0ElMjIyNTg2MzQlMjIlMkMlMjJzZXNzaW9uSWQlMjIlM0ExNzMxOTAxNDMzMTk3JTJDJTIyb3B0T3V0JTIyJTNBZmFsc2UlMkMlMjJsYXN0RXZlbnRJZCUyMiUzQTExNiU3RA==',
|
|
45
|
+
'Hm_lpvt_f8001a3f3d9bf5923f780580eb550c0b': '1731901433',
|
|
46
|
+
'JSESSIONID': 'CD9C8372185D453012E5EEFBA64E2C9C',
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
headers = {
|
|
50
|
+
'accept': 'text/html, */*; q=0.01',
|
|
51
|
+
'accept-language': 'zh-CN,zh;q=0.9',
|
|
52
|
+
'cache-control': 'no-cache',
|
|
53
|
+
'content-type': 'application/x-www-form-urlencoded; charset=UTF-8',
|
|
54
|
+
'origin': 'https://www.dianxiaomi.com',
|
|
55
|
+
'pragma': 'no-cache',
|
|
56
|
+
'priority': 'u=1, i',
|
|
57
|
+
'referer': 'https://www.dianxiaomi.com/sys/index.htm?go=m420',
|
|
58
|
+
'sec-ch-ua': '"Google Chrome";v="131", "Chromium";v="131", "Not_A Brand";v="24"',
|
|
59
|
+
'sec-ch-ua-mobile': '?0',
|
|
60
|
+
'sec-ch-ua-platform': '"Windows"',
|
|
61
|
+
'sec-fetch-dest': 'empty',
|
|
62
|
+
'sec-fetch-mode': 'cors',
|
|
63
|
+
'sec-fetch-site': 'same-origin',
|
|
64
|
+
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36',
|
|
65
|
+
'x-requested-with': 'XMLHttpRequest',
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
@pytest.mark.asyncio
|
|
70
|
+
async def test_dxm_api():
|
|
71
|
+
async with (DxmClient(headers=headers, cookies=cookies) as dxm_client):
|
|
72
|
+
data = await dxm_client.list_order_count()
|
|
73
|
+
for item in data:
|
|
74
|
+
print(item)
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
@pytest.mark.asyncio
|
|
78
|
+
async def test_warehouse():
|
|
79
|
+
async with (DxmClient(headers=headers, cookies=cookies) as dxm_client):
|
|
80
|
+
print(await dxm_client.page_warehouse_product(WarehouseProductQuery()))
|
|
81
|
+
|
|
82
|
+
@pytest.mark.asyncio
|
|
83
|
+
async def test_tasksend_api():
|
|
84
|
+
async with (TakeSendClient(username="", password="") as tasksend_client):
|
|
85
|
+
await tasksend_client.login()
|
|
File without changes
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import pytest
|
|
2
|
-
|
|
3
|
-
from ey_commerce_lib.dxm.constant.order import ORDER_SEARCH_APPROVAL_BASE_FORM, \
|
|
4
|
-
ORDER_SEARCH_PENDING_PROCESSING_BASE_FORM, ORDER_SEARCH_SELF_WAREHOUSE_BASE_FORM, \
|
|
5
|
-
ORDER_SEARCH_OUT_OF_STOCK_BASE_FORM
|
|
6
|
-
from ey_commerce_lib.dxm.main import DxmClient
|
|
7
|
-
from ey_commerce_lib.dxm.schemas.warehouse import WarehouseProductQuery
|
|
8
|
-
from ey_commerce_lib.dxm.utils.mark import get_custom_mark_content_list_by_data_custom_mark, \
|
|
9
|
-
generate_add_or_update_user_comment_data_by_content_list
|
|
10
|
-
from ey_commerce_lib.four_seller.main import FourSellerClient
|
|
11
|
-
from ey_commerce_lib.four_seller.schemas.query.order import FourSellerOrderQueryModel
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
async def login_success(user_token: str):
|
|
15
|
-
print(f'user_token: {user_token}')
|
|
16
|
-
pass
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
@pytest.mark.asyncio
|
|
20
|
-
async def test_auto_login_4seller():
|
|
21
|
-
# user_token = await auto_login_4seller(user_name="sky@eeyoung.com", password="ey010203@@")
|
|
22
|
-
# print(user_token)
|
|
23
|
-
async with FourSellerClient(
|
|
24
|
-
user_name="xxxxx",
|
|
25
|
-
password="xxxxxx",
|
|
26
|
-
login_success_call_back=login_success,
|
|
27
|
-
user_token="xxxxxx") as four_seller_client:
|
|
28
|
-
await four_seller_client.list_history_order(FourSellerOrderQueryModel())
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
cookies = {
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
headers = {
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
@pytest.mark.asyncio
|
|
41
|
-
async def test_dxm_api():
|
|
42
|
-
async with (DxmClient(headers=headers, cookies=cookies) as dxm_client):
|
|
43
|
-
pass
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
@pytest.mark.asyncio
|
|
47
|
-
async def test_warehouse():
|
|
48
|
-
async with (DxmClient(headers=headers, cookies=cookies) as dxm_client):
|
|
49
|
-
print(await dxm_client.page_warehouse_product(WarehouseProductQuery()))
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.13}/src/ey_commerce_lib/dxm/constant/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.13}/src/ey_commerce_lib/dxm/exception/__init__.py
RENAMED
|
File without changes
|
{ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.13}/src/ey_commerce_lib/dxm/exception/common.py
RENAMED
|
File without changes
|
|
File without changes
|
{ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.13}/src/ey_commerce_lib/dxm/parser/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.13}/src/ey_commerce_lib/dxm/parser/purchase.py
RENAMED
|
File without changes
|
{ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.13}/src/ey_commerce_lib/dxm/parser/warehouse.py
RENAMED
|
File without changes
|
{ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.13}/src/ey_commerce_lib/dxm/schemas/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.13}/src/ey_commerce_lib/dxm/schemas/warehouse.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.13}/src/ey_commerce_lib/four_seller/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.13}/src/ey_commerce_lib/four_seller/parser/__init__.py
RENAMED
|
File without changes
|
{ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.13}/src/ey_commerce_lib/four_seller/parser/order.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.13}/src/ey_commerce_lib/kogan/schemas/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.13}/src/ey_commerce_lib/kogan/schemas/query/order.py
RENAMED
|
File without changes
|
{ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.13}/src/ey_commerce_lib/kogan/schemas/query/product.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ey_commerce_lib-1.0.12/tests → ey_commerce_lib-1.0.13/src/ey_commerce_lib/utils}/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|