This commit is contained in:
邹宗楠
2023-11-20 09:36:43 +08:00
parent 7ed1aa66e9
commit 763580877a
8 changed files with 59 additions and 25 deletions

View File

@@ -1,6 +1,7 @@
package ebaiapi
import (
"fmt"
"strings"
"git.rosy.net.cn/baseapi/utils"
@@ -347,13 +348,14 @@ type ActMultiChannelQueryInfosSkuList struct {
Skuid string `json:"skuId"`
}
// 多渠道查询活动详情
// 多渠道查询活动详情(此接口成功率不达标,原因是上一个接口获取门店活动id时,把门店结束活动id查询出来了,但是此接口查询结束活动时,失效了)
func (a *API) ActMultiChannelQueryInfos(activityID, shopID string, baiduShopID int64) (actMultiChannelQueryInfosResult *ActMultiChannelQueryInfosResult, err error) {
pageSize := 100
params := a.genShopIDParams(shopID, baiduShopID, 0)
params["activity_id"] = activityID
params["page_size"] = pageSize
result, err := a.AccessAPI("act.multi.channel.queryinfos", params)
fmt.Println(err)
if err == nil {
if result.Data != nil {
utils.Map2StructByJson(result.Data.(map[string]interface{}), &actMultiChannelQueryInfosResult, false)

View File

@@ -1,6 +1,7 @@
package ebaiapi
import (
"fmt"
"testing"
"time"
@@ -103,11 +104,27 @@ func TestActMultiChannelQueryIDs(t *testing.T) {
}
//2233065924
//2233065928
//2233065934
//2233065955
//2233065956
func TestActMultiChannelQueryInfos(t *testing.T) {
result, err := api.ActMultiChannelQueryInfos("6000000418366727", "", 100000045925)
if err != nil {
t.Fatal(err)
for _, v1 := range []int64{2233065924} { // , 2233065928, 2233065934, 2233065955, 2233065956
acts, err := api.ActMultiChannelQueryIDs("", v1, "2")
fmt.Println(acts)
if err != nil {
fmt.Println(err)
}
for _, v := range acts {
_, err2 := api.ActMultiChannelQueryInfos(utils.Int64ToStr(v), "", v1)
if err2 != nil {
fmt.Println(err2)
}
//t.Log(utils.Format4Output(result, false))
}
}
t.Log(utils.Format4Output(result, false))
//_, err2 := api.ActMultiChannelQueryInfos("6000000927837760", "", 2233065924)
//fmt.Println(err2)
}

View File

@@ -169,7 +169,7 @@ func TestShopOpen(t *testing.T) {
}
func TestShopClose(t *testing.T) {
err := api.ShopClose("", testShopBaiduID)
err := api.ShopClose("", 2233065924)
if err != nil {
t.Fatal(err)
}