- comment of RetailCatUpdate

This commit is contained in:
gazebo
2018-11-24 12:11:09 +08:00
parent 684a104a25
commit 5816c5eaee
2 changed files with 39 additions and 7 deletions

View File

@@ -5,9 +5,42 @@ import (
)
func TestOrderViewStatus(t *testing.T) {
result, err := api.OrderViewStatus(9)
result, err := api.OrderViewStatus(33762863658107006)
if err != nil {
t.Fatal(err)
}
t.Log(result)
}
func TestOrderGetOrderDetail(t *testing.T) {
result, err := api.OrderGetOrderDetail(33762863658107006, false)
if err != nil {
t.Fatal(err)
}
if len(result) == 0 {
t.Fatal("result should have value")
}
// t.Log(utils.Format4Output(result, false))
}
func TestOrderLogisticsStatus(t *testing.T) {
result, err := api.OrderLogisticsStatus(33762863658107006)
if err != nil {
t.Fatal(err)
}
if len(result) == 0 {
t.Fatal("result should have value")
}
// t.Log(utils.Format4Output(result, false))
}
func TestOrderBatchPullPhoneNumber(t *testing.T) {
result, err := api.OrderBatchPullPhoneNumber(testPoiCode, 0, 10)
if err != nil {
t.Fatal(err)
}
if len(result) == 0 {
t.Fatal("result should have value")
}
// t.Log(utils.Format4Output(result, false))
}

View File

@@ -15,12 +15,11 @@ type RetailCategoryInfo struct {
// 美团分类没有ID就以名字为唯一标识不论级别都必须不能重名
// name和originName的长度不能超过10个字符字符不是字节
// 首次创建分类时,如果secondaryName为空,会把一级(如果不存在)及二级分类创建起来,
// 如果一级分类已经存在时要创建二级分类则要求originName与name都不为空且值是一样的
// 大概逻辑是:
// 如果originName不存在,则是创建一级分类,如果secondaryName相应还要创建二级分类,此时sequence指的二级一级的sequence就没有指定了
// 如果originName存在,则指的是更新,一级分类就必须存在,如果不想改名,name填成与originName一样的即可
// todo 但这个函数好像就无法实现变更二级分类的名字及sequence
// 创建一级分类originName为空name为新分类名secondaryName为空
// 修改一级分类originName为分类名name为分类新名secondaryName为空
// 创建二级分类secondaryName为二级分类名
// 如果originName为空,同时创建一级分类,所以如果只是创建二级分类originName与name要填一样的此时sequence指的二级分类的sequence,一级分类的sequence为缺省值)
// 修改二级分类,originName为二级分类name为二级分类新名secondaryName为空
func (a *API) RetailCatUpdate(poiCode, originName, name, secondaryName string, sequence int) (err error) {
params := map[string]interface{}{
KeyAppPoiCode: poiCode,