正式加上配置京东商城
This commit is contained in:
@@ -2,6 +2,7 @@ package jdshop
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"regexp"
|
"regexp"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"git.rosy.net.cn/baseapi/platformapi/jdshopapi"
|
"git.rosy.net.cn/baseapi/platformapi/jdshopapi"
|
||||||
|
|
||||||
@@ -301,8 +302,9 @@ func buildCreateWareParam(storeSku *dao.StoreSkuSyncInfo) (createSkuParamWare *j
|
|||||||
images []*jdshopapi.CreateSkuParamImages
|
images []*jdshopapi.CreateSkuParamImages
|
||||||
// desc string
|
// desc string
|
||||||
)
|
)
|
||||||
|
name := filterSensitiveWord(storeSku.Name)
|
||||||
createSkuParamWare = &jdshopapi.CreateSkuParamWare{
|
createSkuParamWare = &jdshopapi.CreateSkuParamWare{
|
||||||
Title: storeSku.Name,
|
Title: name,
|
||||||
ShopCategorys: []int{utils.Str2Int(storeSku.VendorCatID)},
|
ShopCategorys: []int{utils.Str2Int(storeSku.VendorCatID)},
|
||||||
CategoryID: int(storeSku.VendorVendorCatID),
|
CategoryID: int(storeSku.VendorVendorCatID),
|
||||||
BrandID: jdshopapi.JxBrandId,
|
BrandID: jdshopapi.JxBrandId,
|
||||||
@@ -447,3 +449,12 @@ func uploadImg(img, name, index string) (imgURL string, err error) {
|
|||||||
}
|
}
|
||||||
return uploadResult.PictureURL, err
|
return uploadResult.PictureURL, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func filterSensitiveWord(name string) (result string) {
|
||||||
|
for _, v := range jdshopapi.SensitiveWordMap {
|
||||||
|
if strings.Contains(name, v) {
|
||||||
|
return strings.ReplaceAll(name, v, "")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return name
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user