1
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
product_addV2_response "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/product_addV2/response"
|
product_addV2_response "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/product_addV2/response"
|
||||||
|
"git.rosy.net.cn/jx-callback/globals"
|
||||||
beego "github.com/astaxie/beego/server/web"
|
beego "github.com/astaxie/beego/server/web"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
@@ -979,7 +980,10 @@ func BatchGetChannelCategoryMapping() error {
|
|||||||
if err := dao.GetRows(db, &data, sql, nil); err != nil {
|
if err := dao.GetRows(db, &data, sql, nil); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
if len(data) == 0 {
|
||||||
|
return fmt.Errorf("未查询到数据")
|
||||||
|
}
|
||||||
|
globals.SugarLogger.Debugf("--------len := %d", len(data))
|
||||||
count := len(data) / 50
|
count := len(data) / 50
|
||||||
if len(data)%50 != 0 {
|
if len(data)%50 != 0 {
|
||||||
count = count + 1
|
count = count + 1
|
||||||
@@ -993,6 +997,7 @@ func BatchGetChannelCategoryMapping() error {
|
|||||||
}
|
}
|
||||||
api := getAPI("260477060", 0, "")
|
api := getAPI("260477060", 0, "")
|
||||||
for i := 1; i <= count; i++ {
|
for i := 1; i <= count; i++ {
|
||||||
|
globals.SugarLogger.Debugf("--------i := %d", i)
|
||||||
cats := make(map[int64]int64, 50)
|
cats := make(map[int64]int64, 50)
|
||||||
if i == count {
|
if i == count {
|
||||||
cats, _ = api.BatchGetChannelCategoryMapping(categoryList[(i-1)*50:])
|
cats, _ = api.BatchGetChannelCategoryMapping(categoryList[(i-1)*50:])
|
||||||
|
|||||||
Reference in New Issue
Block a user