diff --git a/platformapi/mtwmapi/retail.go b/platformapi/mtwmapi/retail.go index ed315dc7..1ccc48f1 100644 --- a/platformapi/mtwmapi/retail.go +++ b/platformapi/mtwmapi/retail.go @@ -99,9 +99,9 @@ type SkuInfo struct { Stock string `json:"stock"` Unit string `json:"unit"` Upc string `json:"upc"` - Weight string `json:"weight"` - //WeightForUnit string `json:"weight_for_unit"` // weight weight_for_unit 至多填写一个 - WeightUnit string `json:"weight_unit"` + //Weight string `json:"weight"` + WeightForUnit string `json:"weight_for_unit"` // weight 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 6440a2ae..1ba7b8d0 100644 --- a/platformapi/mtwmapi/retail_test.go +++ b/platformapi/mtwmapi/retail_test.go @@ -177,20 +177,49 @@ func TestErrList(t *testing.T) { func TestRetailBatchInitData(t *testing.T) { failedFoods, err := api.RetailBatchInitData(utils.GetUUID(), "19284062", []map[string]interface{}{ map[string]interface{}{ - "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}]", + "app_food_code": "1680630415808835610", + "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\":1200000132,\"attrName\":\"国产/进口\",\"setAttrId\":true,\"setAttrName\":true,\"setValueList\":true,\"valueList\":[{\"setValue\":true,\"setValueId\":true,\"value\":\"国产\",\"valueId\":1300000003}],\"valueListIterator\":[{\"$ref\":\"$[1].valueList[0]\"}],\"valueListSize\":1},{\"attrId\":1200000210,\"attrName\":\"商品类别\",\"setAttrId\":true,\"setAttrName\":true,\"setValueList\":true,\"valueList\":[{\"setValue\":true,\"setValueId\":true,\"value\":\"其他\",\"valueId\":1300000249}],\"valueListIterator\":[{\"$ref\":\"$[2].valueList[0]\"}],\"valueListSize\":1},{\"attrId\":1200000088,\"attrName\":\"品牌\",\"setAttrId\":true,\"setAttrName\":true,\"setValueList\":true,\"valueList\":[{\"setValue\":true,\"setValueId\":true,\"value\":\"豫皇星\",\"valueId\":2533451}],\"valueListIterator\":[{\"$ref\":\"$[3].valueList[0]\"}],\"valueListSize\":1}]", "description": "", "is_sold_out": 0, "min_order_count": 1, - "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", + "name": "多功能清洁膏 330g/盒", + "picture": "http://p0.meituan.net/wmproduct/1d6406c367a2f31dd1c629c10fc024d4143352.jpg,http://p0.meituan.net/wmproduct/92af919285d5720c1952462db686f8ff134176.jpg,http://p0.meituan.net/xianfu/81fa0a6f3d8c556c2ba990fac8471c24157451.jpg,http://p0.meituan.net/xianfu/89eecafad3db2dd6090f8fbb1817e10549354.jpg,http://p0.meituan.net/xianfu/8dceb0ad6317462dc0c9f2d005c2e60b48474.jpg,http://p0.meituan.net/wmproduct/69e2ceb065768ee7440d61a48c087177143299.jpg", "picture_contents": "", "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": "份", + "sequence": -100, + "skus": []map[string]interface{}{ + { + "available_times": map[string]string{ + "friday": "", + "monday": "", + "saturday": "", + "sunday": "", + "thursday": "", + "tuesday": "", + "wednesday": "", + }, + //"box_num": "", + //"box_price": "", + "isSellFlag": 1, + "ladder_box_num": "1", + "ladder_box_price": "0.0", + "limit_open_sync_stock_now": false, + "location_code": "", + "min_order_count": "1", + "price": "25.0", + "sku_id": "1680630417767739457", + "spec": "330g*1盒", + "stock": "998", + "unit": "份", + "upc": "6948385202395", + //"weight": "330", + "weight_unit": "克(g)", + "weight_for_unit": "330", + }, + }, + "tag_id": 200004920, + "unit": "份", }, }) if err != nil {