This commit is contained in:
邹宗楠
2025-07-09 15:38:19 +08:00
parent 0f6cf49c48
commit 69a65dab98
12 changed files with 104 additions and 82 deletions

View File

@@ -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;
//`

View File

@@ -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)
}