This commit is contained in:
邹宗楠
2025-09-28 14:02:26 +08:00
parent 2a43a68a46
commit 8440c44564
6 changed files with 39 additions and 13 deletions

View File

@@ -26,7 +26,7 @@ func init() {
//api = New("4123", "df2c88338b85f830cebce2a9eab56628", "", "")
//商超
//api = New("5873", "41c479790a76f86326f89e8048964739", "", "token_nld07Y5m8rEQZJMMrvZGmA")
//api = New("5873", "41c479790a76f86326f89e8048964739", "", "token_iJ_KO9kgFiaodJguyydKxg")
//cookieStr := `
// acctId=57396785; token=0bWbK5VbK50E2BmIhIH2zHB-am_y7mB37yXHm6RLZWx4*; wmPoiId=-1;
//`

View File

@@ -455,13 +455,13 @@ func (a *API) RetailSkuDelete(trackInfo, poiCode, foodCode, skuID string) (err e
return err
}
//category/attr/list 根据末级类目id获取类目属性列表
// CategoryAttrList 根据末级类目id获取类目属性列表
//https://open-shangou.meituan.com/home/docDetail/386
func (a *API) CategoryAttrList(tag_id int64) (categoryAttrListResult []*CategoryAttrListResult, err error) {
func (a *API) CategoryAttrList(tagId int64) (categoryAttrListResult []*CategoryAttrListResult, err error) {
result, err := a.AccessAPI("gw/category/attr/list", true, map[string]interface{}{
"tag_id": tag_id,
"tag_id": tagId,
})
if err == nil {
if err == nil && result != nil {
utils.Map2StructByJson(result.(map[string]interface{})["general_attrs"], &categoryAttrListResult, false)
}
return categoryAttrListResult, err

View File

@@ -361,7 +361,7 @@ func TestRetailSellStatus2(t *testing.T) {
//根据分类id查询属性列表
func TestCategoryAttrList(t *testing.T) {
//result, err := api.CategoryAttrList(200002680)
result, err := api.CategoryAttrList(200001746)
result, err := api.CategoryAttrList(400000717)
if err != nil {
t.Fatal(err)
}
@@ -394,7 +394,7 @@ func TestRetailRecommendTag(t *testing.T) {
// 删除商品
func TestRetailDelete(t *testing.T) {
poiCode := "16193110"
poiCode := "29913311"
i := 0
count := 0
@@ -443,18 +443,18 @@ func TestRetailCatList(t *testing.T) {
// 测试删除门店分类列表
func TestDeleteCat(t *testing.T) {
result, err := api.RetailCatList("26589198")
result, err := api.RetailCatList("29913311")
fmt.Println(result, err)
for _, v := range result {
if v.Children != nil {
for _, v2 := range v.Children {
err = api.RetailCatDelete("26589198", "", v2.Name, 1)
err = api.RetailCatDelete("29913311", "", v2.Name, 1)
if err != nil {
t.Fatal(err)
}
}
} else {
err = api.RetailCatDelete("26589198", "", v.Name, 1)
err = api.RetailCatDelete("29913311", "", v.Name, 1)
if err != nil {
t.Fatal(err)
}