淘鲜达白底图上传

This commit is contained in:
邹宗楠
2023-10-10 16:26:36 +08:00
parent 9f7fe7d80a
commit 1a63d683bb
4 changed files with 0 additions and 14 deletions

View File

@@ -4,7 +4,6 @@ import (
"encoding/json"
"errors"
"fmt"
"git.rosy.net.cn/jx-callback/globals"
"strings"
"time"
"unicode"
@@ -306,7 +305,6 @@ func (p *PurchaseHandler) createOrUpdateStoreSkus(ctx *jxcontext.Context, storeI
param.Name = checkNameLenght(param.Name)
// 暂时只考虑修改白底图,提高效率.其余图片不做修改
globals.SugarLogger.Debugf("==========storeSku %s", utils.Format4Output(storeSku, false))
img, descImg, whiteImg, err := GetTiktokImgList(api, utils.Int2Str(storeSku.StoreID), storeSku.SkuID, storeSku.DescImg, storeSku.Img, []string{storeSku.Img2, storeSku.Img3, storeSku.Img4, storeSku.Img5})
if err != nil {
failedList = putils.GetErrMsg2FailedSingleList(storeSkuList, err, storeID, model.VendorChineseNames[model.VendorIDDD], syncType)
@@ -951,10 +949,7 @@ func GetTiktokImgList(api *tiktokShop.API, storeId string, skuId int, detailImg,
whiteTiktok = tiktokImg[0]
localTiktokObj.Img = whiteTiktok
}
globals.SugarLogger.Debugf("===========tiktokImg := %s", utils.Format4Output(tiktokImg, false))
switch len(tiktokImg) {
case 1:
localTiktokObj.Img2 = tiktokImg[0]
case 2:
localTiktokObj.Img2 = tiktokImg[0]
localTiktokObj.Img3 = tiktokImg[1]
@@ -969,7 +964,6 @@ func GetTiktokImgList(api *tiktokShop.API, storeId string, skuId int, detailImg,
localTiktokObj.Img5 = tiktokImg[3]
}
globals.SugarLogger.Debugf("===========localTiktokObj := %s", utils.Format4Output(localTiktokObj, false))
dao.CreateEntity(dao.GetDB(), localTiktokObj)
return strings.Join(tiktokImg, "|"), detailTiktok, whiteTiktok, nil
}