Commit 3832edb2 by larosa

add test py

parent 7cbe5188
Showing with 41 additions and 0 deletions
from common import request_to_jd_vc
def post_to_jd():
methodName = "jingdong.vc.item.newProduct.createV2"
token = "845ce8478b074103b9e78a769d5fa4831y2u"
app_key = "CA52430E90209F51D8F5D7B615DDE9AD"
app_secret = "c92691b2379c48de87e699c4c2f7fb32"
param = {
"pkg_info": "商品主体 * 1",
"original_place": "中国大陆",
"warranty": "无质保",
"model": "MAC12DG-PRICE-LAROSA111",
"cid1": 33556,
"brand_id": 388118,
"name": "TE connectivity 薄膜电阻 MAC12DG-PRICE-LAROSA111 100个",
"pack_type": 1,
"item_num": "27348342332",
"member_price": 100.34,
"market_price": 110.78,
"purchase_price": 90.0036,
"saler_code": "gonglingzhe1",
"purchaser_code": "gonglingzhe1",
"prop_id": "232935,232969,232953,232988", # 属性id
"prop_remark": "MAC12DG-PRICE-TEST,±0.01%,-55°C ~ 155°C,10 kOhms", # 属性数值,文本等
# "prop_vid": "", # 属性单选值id
# "prop_values": "", # 属性多选值id
"ext_id": "232650", # 拓展属性id
"ext_values": "1343768", # 拓展值id
# "ext_remark": "", # 拓展值
"main_path": "jfs/t1/249391/9/18493/7621/66e2aac1Fa7b99835/7e65af57d10c7abd.jpg", # 京东图片链接
"main_isPrimary": "1", # 是否为主图1:是 0:否
"intro_html": "<img src=https://img30.360buyimg.com/sku/jfs/t1/133800/28/25551/94742/62fef403E1a77f3a2/9b92597c0c26d1c8.jpg' /><br>", # pc商详
"intro_mobile": "<img src=https://img30.360buyimg.com/sku/jfs/t1/133800/28/25551/94742/62fef403E1a77f3a2/9b92597c0c26d1c8.jpg' /><br>", # 移动商详
}
ans = request_to_jd_vc(method_name=methodName, token=token, app_key=app_key, app_secret=app_secret, param=param)
print(ans)
if __name__ == '__main__':
post_to_jd()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment