1
This commit is contained in:
@@ -26,7 +26,7 @@ func init() {
|
||||
//api = New("4123", "df2c88338b85f830cebce2a9eab56628", "", "")
|
||||
|
||||
//商超
|
||||
api = New("5873", "41c479790a76f86326f89e8048964739", "", "token_undlKEMX3aUii5A7JjVD8g") //token_n4TwqCntWWuvQwAawzxC0w
|
||||
api = New("5873", "41c479790a76f86326f89e8048964739", "", "token_tpzEJ-tqm6pxzVtD_t5L0g") //token_n4TwqCntWWuvQwAawzxC0w
|
||||
cookieStr := `
|
||||
acctId=57396785; token=0bWbK5VbK50E2BmIhIH2zHB-am_y7mB37yXHm6RLZWx4*; wmPoiId=-1;
|
||||
`
|
||||
|
||||
@@ -231,19 +231,39 @@ func TestBatchSetPrice(t *testing.T) {
|
||||
fmt.Println(err)
|
||||
}
|
||||
func TestRetailDelete(t *testing.T) {
|
||||
poiCode := "19696163"
|
||||
foodList, err1 := api.RetailListAll(poiCode, 0)
|
||||
if err1 != nil {
|
||||
globals.SugarLogger.Debugf("====err1 := %v", err1)
|
||||
return
|
||||
}
|
||||
globals.SugarLogger.Debugf("foods :%s", utils.Format4Output(foodList, false))
|
||||
return
|
||||
poiCode := "20802261"
|
||||
|
||||
//err := api.RetailDelete(utils.GetUUID(), testPoiCode, "32427")
|
||||
//if err != nil {
|
||||
// t.Fatal(err)
|
||||
//}
|
||||
i := 0
|
||||
for {
|
||||
// 同步商品
|
||||
fromFoodList, err1 := api.RetailListAll(poiCode, i)
|
||||
if len(fromFoodList) == 0 || fromFoodList == nil {
|
||||
fmt.Println(fmt.Errorf("fromFoodList 为空 %s ,i:= %d", utils.Format4Output(err1, false), i))
|
||||
return
|
||||
}
|
||||
|
||||
stockList := make([]*BareStoreFoodInfo, 0, 100)
|
||||
for _, fl := range fromFoodList {
|
||||
stockList = append(stockList, &BareStoreFoodInfo{
|
||||
AppFoodCode: fl.AppFoodCode,
|
||||
Skus: []*BareStoreSkuInfo{
|
||||
&BareStoreSkuInfo{
|
||||
SkuID: fl.AppFoodCode,
|
||||
Stock: "999999",
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
i++
|
||||
|
||||
result, err := api.RetailSkuStock(utils.GetUUID(), testPoiCode, stockList)
|
||||
globals.SugarLogger.Debugf("===result :-%s", utils.Format4Output(result, false))
|
||||
globals.SugarLogger.Debugf("===result :-%v", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestMap(t *testing.T) {
|
||||
fmt.Println(16&4 != 0)
|
||||
}
|
||||
|
||||
func TestRetailDat(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user