mt sku
This commit is contained in:
@@ -20,6 +20,14 @@ const (
|
||||
const (
|
||||
SellStatusOnline = 0 // 上架
|
||||
SellStatusOffline = 1 // 下架
|
||||
|
||||
SpecialAttrBrand = "1200000088" //属性id,取值范围仅支持两个:1200000088-品牌, 1200000094-产地
|
||||
SpecialAttrProducer = "1200000094"
|
||||
|
||||
TypeCategory = 1 //1-类目,2-类目属性 不传默认1
|
||||
TypeCategoryAttr = 2
|
||||
|
||||
NeedYes = "1" //1-必传,2-非必传
|
||||
)
|
||||
|
||||
const ( // {"attrId":1200000275,"attrName":"是否有机","valueList":[{"valueId":1300005199,"value":"非有机"}]},
|
||||
@@ -445,12 +453,12 @@ type CategoryAttrValueListResult struct {
|
||||
|
||||
//category/attr/value/list 查询特殊属性的属性值列表
|
||||
//https://open-shangou.meituan.com/home/docDetail/387
|
||||
func (a *API) CategoryAttrValueList(attr_id int64, keyword string, page_num, page_size int) (categoryAttrValueListResult []*CategoryAttrValueListResult, err error) {
|
||||
func (a *API) CategoryAttrValueList(attr_id int64, keyword string) (categoryAttrValueListResult []*CategoryAttrValueListResult, err error) {
|
||||
result, err := a.AccessAPI("gw/category/attr/value/list", true, map[string]interface{}{
|
||||
"attr_id": attr_id,
|
||||
"keyword": keyword,
|
||||
"page_num": page_num,
|
||||
"page_size": page_size,
|
||||
"page_num": 1,
|
||||
"page_size": 20,
|
||||
})
|
||||
if err == nil {
|
||||
utils.Map2StructByJson(result, &categoryAttrValueListResult, false)
|
||||
@@ -458,6 +466,39 @@ func (a *API) CategoryAttrValueList(attr_id int64, keyword string, page_num, pag
|
||||
return categoryAttrValueListResult, err
|
||||
}
|
||||
|
||||
type RetailRecommendTagResp struct {
|
||||
UpcCode string `json:"upc_code"` //条形码编号 如类目匹配失败,返回null
|
||||
Name string `json:"name"` //商品名称 如类目匹配失败,返回null
|
||||
TagID int `json:"tag_id"` //美团内部类目id
|
||||
GeneralAttrs []GeneralAttrs
|
||||
}
|
||||
|
||||
type GeneralAttrs struct {
|
||||
AttrID string `json:"attr_id"` //属性id
|
||||
AttrName string `json:"attr_name"` //属性名称
|
||||
ValueList []ValueList
|
||||
}
|
||||
type ValueList struct {
|
||||
ValueID string `json:"value_id"` //属性值id
|
||||
Value string `json:"value"` //属性值
|
||||
}
|
||||
|
||||
// RetailRecommendTag 根据商品UPC或商品名称或类目ID查询平台推荐类目及类目属性信息
|
||||
func (a *API) RetailRecommendTag(name, appPoiCode string, tagID, tagType int) (retVal *RetailRecommendTagResp, err error) {
|
||||
result, err := a.AccessAPI("retail/recommend/tag", true, map[string]interface{}{
|
||||
"name": name,
|
||||
"app_poi_code": appPoiCode,
|
||||
"tag_id": tagID,
|
||||
"type": tagType,
|
||||
})
|
||||
if err == nil {
|
||||
if err = utils.Map2StructByJson(result, &retVal, false); err == nil {
|
||||
return retVal, nil
|
||||
}
|
||||
}
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// 就是厂商商品类别
|
||||
func (a *API) RetailGetSpTagIds() (tagIds []*RetailTag, err error) {
|
||||
result, err := a.AccessAPI("retail/getSpTagIds", true, nil)
|
||||
|
||||
Reference in New Issue
Block a user