This commit is contained in:
邹宗楠
2022-12-22 10:44:56 +08:00
parent 35ddeed751
commit ba661932bf
3 changed files with 35 additions and 2 deletions

View File

@@ -43,8 +43,8 @@ func TestPoiSave(t *testing.T) {
//}
poiParams := map[string]interface{}{}
//utils.FilterMapNilMembers(utils.Struct2FlatMap(result[0]))
poiParams["name"] = "京西果园·果切·水果捞(金碧园店)"
err := api.PoiSave("9410009", poiParams)
poiParams["address"] = "云南省楚雄彝族自治州楚雄市鹿城镇陈家槽子村小吃一条街B21号"
err := api.PoiSave("15467875", poiParams)
fmt.Println(err)
}

View File

@@ -271,6 +271,7 @@ func handleRetailBatchResultByRegexp(result interface{}) (failedFoodList []*AppF
// https://developer.waimai.meituan.com/home/myquestionDetail/6716
// 另外这个接口即使不指定operate_type为1也可能报错”商品spu名称在该店内分类中已存在“原因就是已经存在两个相同的SKU了
func (a *API) RetailInitData(trackInfo, poiCode, foodCode string, params map[string]interface{}) (err error) {
globals.SugarLogger.Debugf("===========create sku mt : %s,%s,%s,%s", trackInfo, poiCode, foodCode, utils.Format4Output(params, false))
_, err = a.AccessAPI2("retail/initdata", false, utils.MergeMaps(map[string]interface{}{
KeyAppPoiCode: poiCode,
KeyAppFoodCode: foodCode,

View File

@@ -0,0 +1,32 @@
package tiktok_api
import (
"fmt"
"git.rosy.net.cn/baseapi/utils"
"testing"
)
func TestDeleteSku(t *testing.T) {
var tiktokId = []int64{
3589392977455372474,
}
for _, v := range tiktokId {
if err := a.DeleteStoreCommodity(v); err != nil {
fmt.Println(err)
}
}
}
func TestTryCatName2Code(t *testing.T) {
code := tryCatName2Code("3039")
fmt.Println(code)
}
func tryCatName2Code(originName string) (catCodeStr string) {
if intValue := utils.Str2Int64WithDefault(originName, 0); intValue > 0 {
catCodeStr = utils.Int64ToStr(intValue)
if catCodeStr != originName {
catCodeStr = ""
}
}
return catCodeStr
}