This commit is contained in:
邹宗楠
2023-10-25 17:26:49 +08:00
parent e45bea08d3
commit 17d98991a8
3 changed files with 30 additions and 33 deletions

View File

@@ -27,7 +27,7 @@ func init() {
//商超
//api = New("5873", "41c479790a76f86326f89e8048964739", "", "token_nngsVP37s-HXY86xe85H7Q") //token_n4TwqCntWWuvQwAawzxC0w
api = New("5873", "41c479790a76f86326f89e8048964739", "", "token_pSieTe4mnpJjkd0gJURL3A") //token_n4TwqCntWWuvQwAawzxC0w
api = New("5873", "41c479790a76f86326f89e8048964739", "", "token_rn25Arxm_1JSvQM6CWpJzQ") //token_n4TwqCntWWuvQwAawzxC0w
//api = New("5873", "41c479790a76f86326f89e8048964739", "", "token_r36FEse6_ywebQI65FNNWA") //token_n4TwqCntWWuvQwAawzxC0w
cookieStr := `
acctId=57396785; token=0bWbK5VbK50E2BmIhIH2zHB-am_y7mB37yXHm6RLZWx4*; wmPoiId=-1;

View File

@@ -84,16 +84,24 @@ type AvailableTimesInfo struct {
}
type SkuInfo struct {
AvailableTimes *AvailableTimesInfo `json:"available_times"`
BoxNum string `json:"box_num"`
BoxPrice string `json:"box_price"`
LocationCode string `json:"location_code"`
Price string `json:"price"`
SkuID string `json:"sku_id"`
Spec string `json:"spec"`
Stock string `json:"stock"`
Upc string `json:"upc"`
Weight string `json:"weight"`
AvailableTimes *AvailableTimesInfo `json:"available_times"`
BoxNum string `json:"box_num"`
BoxPrice string `json:"box_price"`
IsSellFlag int `json:"isSellFlag"`
LadderBoxNum string `json:"ladder_box_num"`
LadderBoxPrice string `json:"ladder_box_price"`
LimitOpenSyncStockNow bool `json:"limit_open_sync_stock_now"`
LocationCode string `json:"location_code"`
MinOrderCount string `json:"min_order_count"`
Price string `json:"price"`
SkuId string `json:"sku_id"`
Spec string `json:"spec"`
Stock string `json:"stock"`
Unit string `json:"unit"`
Upc string `json:"upc"`
Weight string `json:"weight"`
WeightForUnit string `json:"weight_for_unit"`
WeightUnit string `json:"weight_unit"`
}
type AppFood struct {

View File

@@ -175,33 +175,22 @@ func TestErrList(t *testing.T) {
}
func TestRetailBatchInitData(t *testing.T) {
failedFoods, err := api.RetailBatchInitData(utils.GetUUID(), "19120530", []map[string]interface{}{
failedFoods, err := api.RetailBatchInitData(utils.GetUUID(), "19284062", []map[string]interface{}{
map[string]interface{}{
"app_food_code": 1692848899,
"category_name": "调味用品",
"common_attr_value": "[{\"attrId\":1200000094,\"attrName\":\"产地\",\"setAttrId\":true,\"setAttrName\":true,\"setValueList\":true,\"valueList\":[{\"setValue\":true,\"setValueId\":true,\"value\":\"中国\",\"valueId\":100000050}],\"valueListIterator\":[{\"$ref\":\"$[0].valueList[0]\"}],\"valueListSize\":1},{\"attrId\":1200000135,\"attrName\":\"包装方式\",\"setAttrId\":true,\"setAttrName\":true,\"setValueList\":true,\"valueList\":[{\"setValue\":true,\"setValueId\":true,\"value\":\"袋\",\"valueId\":1300004918}],\"valueListIterator\":[{\"$ref\":\"$[1].valueList[0]\"}],\"valueListSize\":1},{\"attrId\":1200000088,\"attrName\":\"品牌\",\"setAttrId\":true,\"setAttrName\":true,\"setValueList\":true,\"valueList\":[{\"setValue\":true,\"setValueId\":true,\"value\":\"吉香居\",\"valueId\":1008695}],\"valueListIterator\":[{\"$ref\":\"$[2].valueList[0]\"}],\"valueListSize\":1}]",
"app_food_code": "mtcode_1711009019361517642",
"category_name": "野营必备",
"common_attr_value": "[{\"attrId\":1200000210,\"attrName\":\"商品类别\",\"setAttrId\":true,\"setAttrName\":true,\"setValueList\":true,\"valueList\":[{\"setValue\":true,\"setValueId\":true,\"value\":\"一次性餐盒\",\"valueId\":1300013135}],\"valueListIterator\":[{\"$ref\":\"$[0].valueList[0]\"}],\"valueListSize\":1}]",
"description": "",
"is_sold_out": 0,
"min_order_count": 1,
"name": "吉香居 麻辣萝卜干泡菜 52g/袋",
"picture": "http://p0.meituan.net/retailsp/f2aec3c090c7ee952f61301848f27c09917081.jpg,http://p0.meituan.net/retailsp/c93074d623f04272b28d7b03fd2b8699852829.jpg,http://p0.meituan.net/retailsp/8d2ef2c6f92b7c48f3673a67fe420fbe111196.jpg",
"name": "一次性长方形牛皮纸快餐打包盒+塑料盖约500ml/个 散装",
"picture": "http://p0.meituan.net/shangouproductapi/c7c86e6777d877eb4b80d3f4718086b8100684.jpg,http://p0.meituan.net/shangouproductapi/7a035e97283073e9a97a440029aedc0f83704.jpg,http://p0.meituan.net/shangouproductapi/166d82f438e19236d4820dc42328eef1161691.jpg,http://p0.meituan.net/shangouproductapi/79b145ad0a79f839c9463048dfb5ec3e100543.jpg",
"picture_contents": "",
"price": 4.5,
"sequence": -117,
"skus": ` [
{
"ladder_box_num": "",
"ladder_box_price": "0.0",
"price": "4.5",
"sku_id": 1692848899,
"spec": "52g*1袋",
"stock": "9999",
"upc": "6926896703303",
"weight": "52"
}
]`,
"tag_id": 200005035,
"unit": "",
"price": 25,
"sequence": -202,
"skus": []map[string]interface{}{{"available_times": `{"friday": "","monday": "","saturday": "","sunday": "","thursday": "","tuesday": "","wednesday": ""}`, "box_num": "", "box_price": "", "location_code": "", "price": "25.0", "sku_id": "", "spec": "十套", "stock": "998", "upc": "", "weight": "100"}},
"tag_id": 200005009,
"unit": "份",
},
})
if err != nil {