This commit is contained in:
邹宗楠
2026-04-22 11:28:21 +08:00
parent 1ad90354d4
commit ce17598e8f
6 changed files with 14 additions and 8 deletions

View File

@@ -113,7 +113,7 @@ func TestRetailDiscountList(t *testing.T) { //56 1001
// 获取美团活动 // 获取美团活动
directList, _ := api.RetailDiscountList("32235182", RetailActTypeDirectDown) // 折扣活动 directList, _ := api.RetailDiscountList("32235182", RetailActTypeDirectDown) // 折扣活动
for _, v := range directList { for _, v := range directList {
if (v.ActPrice/v.OriginalPrice)*10 >= 3.01 { if v.ActPrice/v.OriginalPrice*10 >= 3.01 {
threefoldUp++ threefoldUp++
} else { } else {
threefoldDown++ threefoldDown++
@@ -125,7 +125,7 @@ func TestRetailDiscountList(t *testing.T) { //56 1001
} }
fmt.Println(threefoldDown) fmt.Println(threefoldDown)
fmt.Println(threefoldDown) fmt.Println(threefoldUp)
} }
func TestNew(t *testing.T) { func TestNew(t *testing.T) {
@@ -266,6 +266,8 @@ func TestDeleteActSku(t *testing.T) {
} }
func TestCEA(t *testing.T) { func TestCEA(t *testing.T) {
a := []int{1, 2, 3, 4, 5}
fmt.Println(a[2:]) a := "11:%s"
fmt.Println(fmt.Sprintf(a, "1"))
} }

View File

@@ -25,7 +25,7 @@ func init() {
//api = New("4123", "df2c88338b85f830cebce2a9eab56628", "", "") //api = New("4123", "df2c88338b85f830cebce2a9eab56628", "", "")
//商超 //商超
//api = New("5873", "41c479790a76f86326f89e8048964739", "", "token_oz-C3lOxJJ1EuBW1X31LqA") //api = New("5873", "41c479790a76f86326f89e8048964739", "", "token_hgR5SlP5pmRApWkUNTRFNQ")
//cookieStr := ` //cookieStr := `
// acctId=57396785; token=0bWbK5VbK50E2BmIhIH2zHB-am_y7mB37yXHm6RLZWx4*; wmPoiId=-1; // acctId=57396785; token=0bWbK5VbK50E2BmIhIH2zHB-am_y7mB37yXHm6RLZWx4*; wmPoiId=-1;
//` //`

View File

@@ -31,7 +31,7 @@ func getTimeFromTimestamp(timeStamp int64) time.Time {
} }
func TestOrderGetOrderDetail(t *testing.T) { func TestOrderGetOrderDetail(t *testing.T) {
result, err := api.OrderGetOrderDetail(3802032442031470827, false) result, err := api.OrderGetOrderDetail(3102067553224122590, false)
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }

View File

@@ -146,8 +146,8 @@ func TestRetailCatSkuBatchDelete(t *testing.T) {
func TestBatchSetPrice(t *testing.T) { func TestBatchSetPrice(t *testing.T) {
param := make([]*SpuData, 0, 0) param := make([]*SpuData, 0, 0)
param = append(param, &SpuData{ param = append(param, &SpuData{
AppSpuCode: "6113801", AppSpuCode: "6099887",
SkuID: "6113801", SkuID: "6099887",
PurchasePrice: "0.01", PurchasePrice: "0.01",
}) })
err := api.BatchSetRestockingPrice(utils.GetUUID(), "31985068", param) err := api.BatchSetRestockingPrice(utils.GetUUID(), "31985068", param)

View File

@@ -174,6 +174,7 @@ func AccessPlatformAPIWithRetry(client *http.Client, handleRequest func() *http.
} else { } else {
bodyData, getDataErr = ioutil.ReadAll(response.Body) bodyData, getDataErr = ioutil.ReadAll(response.Body)
} }
globals.SugarLogger.Debugf("-------------%s", string(bodyData))
globals.SugarLogger.Debugf("%s", utils.Format4Output(time.Now(), false)) globals.SugarLogger.Debugf("%s", utils.Format4Output(time.Now(), false))
if getDataErr != nil { if getDataErr != nil {
baseapi.SugarLogger.Errorf("AccessPlatformAPIWithRetry:%s ioutil.ReadAll failed, url:%v, error:%v", trackInfo, request.URL, err) baseapi.SugarLogger.Errorf("AccessPlatformAPIWithRetry:%s ioutil.ReadAll failed, url:%v, error:%v", trackInfo, request.URL, err)

View File

@@ -2,6 +2,8 @@ package weixinapi
import ( import (
"encoding/json" "encoding/json"
"git.rosy.net.cn/baseapi/utils"
"git.rosy.net.cn/jx-callback/globals"
) )
//获取小程序码 //获取小程序码
@@ -15,5 +17,6 @@ func (a *API) GetUnlimited(scene, page string) (results map[string]interface{},
return results, err return results, err
} }
results, err = a.AccessAPI("wxa/getwxacodeunlimit", nil, string(bytes)) results, err = a.AccessAPI("wxa/getwxacodeunlimit", nil, string(bytes))
globals.SugarLogger.Debugf("--------GetUnlimited--:%s", utils.Format4Output(results, false))
return results, err return results, err
} }