1
This commit is contained in:
@@ -20,13 +20,13 @@ func init() {
|
||||
baseapi.Init(sugarLogger)
|
||||
|
||||
// 菜市
|
||||
//api = New("589", "a81eb3df418d83d6a1a4b7c572156d2f", "", "")
|
||||
api = New("589", "a81eb3df418d83d6a1a4b7c572156d2f", "", "")
|
||||
|
||||
// 果园
|
||||
//api = New("4123", "df2c88338b85f830cebce2a9eab56628", "", "")
|
||||
|
||||
//商超
|
||||
api = New("5873", "41c479790a76f86326f89e8048964739", "", "token_lfakvRM4GLSa_VLMUIZDHA")
|
||||
//api = New("5873", "41c479790a76f86326f89e8048964739", "", "token_lfakvRM4GLSa_VLMUIZDHA")
|
||||
//cookieStr := `
|
||||
// acctId=57396785; token=0bWbK5VbK50E2BmIhIH2zHB-am_y7mB37yXHm6RLZWx4*; wmPoiId=-1;
|
||||
//`
|
||||
|
||||
@@ -409,22 +409,43 @@ func TestRetailSkuStock(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestRetailSellStatus(t *testing.T) {
|
||||
result, err := api.RetailSellStatus(utils.GetUUID(), "17088914", []*BareStoreFoodInfo{
|
||||
&BareStoreFoodInfo{
|
||||
AppFoodCode: "2429611",
|
||||
Skus: []*BareStoreSkuInfo{
|
||||
&BareStoreSkuInfo{
|
||||
//SkuID: "22781",
|
||||
//Price: "18.7",
|
||||
//Stock: "0",
|
||||
},
|
||||
},
|
||||
},
|
||||
}, SellStatusOffline)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
i := 0
|
||||
for {
|
||||
// 同步商品
|
||||
fromFoodList, err1 := api.RetailListAll("21792195", i)
|
||||
if len(fromFoodList) == 0 || fromFoodList == nil {
|
||||
fmt.Println(fmt.Errorf("fromFoodList 为空 %s ,i:= %d", utils.Format4Output(err1, false), i))
|
||||
return
|
||||
}
|
||||
if len(fromFoodList) != 0 {
|
||||
for _, food := range fromFoodList {
|
||||
if strings.Contains(food.Name, "烤鸡") || strings.Contains(food.Name, "烤鸭") || strings.Contains(food.Name, "啤酒") || strings.Contains(food.Name, "雪糕") {
|
||||
_, err := api.RetailSellStatus(utils.GetUUID(), "21792195", []*BareStoreFoodInfo{
|
||||
&BareStoreFoodInfo{
|
||||
AppFoodCode: food.AppFoodCode,
|
||||
Skus: []*BareStoreSkuInfo{
|
||||
//&BareStoreSkuInfo{
|
||||
// // SkuID: "",
|
||||
// // Price: "18.7",
|
||||
// // Stock: "0",
|
||||
// //},
|
||||
},
|
||||
},
|
||||
}, SellStatusOffline)
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
i += 1
|
||||
}
|
||||
t.Log(utils.Format4Output(result, false))
|
||||
|
||||
//
|
||||
//if err != nil {
|
||||
// t.Fatal(err)
|
||||
//}
|
||||
//t.Log(utils.Format4Output(result, false))
|
||||
}
|
||||
|
||||
func TestRetailSellStatus2(t *testing.T) {
|
||||
@@ -505,7 +526,3 @@ func TestSplit(t *testing.T) {
|
||||
fmt.Println("len-======", len(cc))
|
||||
globals.SugarLogger.Debugf("cc %s", utils.Format4Output(cc, false))
|
||||
}
|
||||
|
||||
func Test22222(t *testing.T) {
|
||||
fmt.Println(32&(2|32) != 0)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user