diff --git a/platformapi/mtwmapi/mtwmapi_test.go b/platformapi/mtwmapi/mtwmapi_test.go index f022b87b..2c8bd9da 100644 --- a/platformapi/mtwmapi/mtwmapi_test.go +++ b/platformapi/mtwmapi/mtwmapi_test.go @@ -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; diff --git a/platformapi/mtwmapi/retail.go b/platformapi/mtwmapi/retail.go index 1f13586c..b732b3c6 100644 --- a/platformapi/mtwmapi/retail.go +++ b/platformapi/mtwmapi/retail.go @@ -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 { diff --git a/platformapi/mtwmapi/retail_test.go b/platformapi/mtwmapi/retail_test.go index 3decab5f..6440a2ae 100644 --- a/platformapi/mtwmapi/retail_test.go +++ b/platformapi/mtwmapi/retail_test.go @@ -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 {