银豹api增加分类

This commit is contained in:
苏尹岚
2020-03-25 12:02:28 +08:00
parent 37c792a067
commit ff4bfb0edf
5 changed files with 249 additions and 7 deletions

View File

@@ -0,0 +1,55 @@
package yinbaoapi
import (
"testing"
"git.rosy.net.cn/baseapi/utils"
)
func TestCreateCategoryUid(t *testing.T) {
result, err := api.CreateCategoryUid()
if err != nil {
t.Fatal(err)
}
t.Log(utils.Format4Output(result, false))
}
func TestLoadSubStoresByUserIdDDLJson(t *testing.T) {
result, err := api.LoadSubStoresByUserIdDDLJson()
if err != nil {
t.Fatal(err)
}
t.Log(utils.Format4Output(result, false))
}
func TestAddNewCategory(t *testing.T) {
_, err := api.AddNewCategory(MainStoreVendorOrgCode, "测试2", "测试分类2")
if err != nil {
t.Fatal(err)
}
// t.Log(utils.Format4Output(result, false))
}
func TestUpdateCategory(t *testing.T) {
err := api.UpdateCategory(MainStoreVendorOrgCode, "1585030864115972859", "叶菜3", "蔬菜")
if err != nil {
t.Fatal(err)
}
// t.Log(utils.Format4Output(result, false))
}
func TestDeleteCategory(t *testing.T) {
err := api.DeleteCategory(MainStoreVendorOrgCode, []string{"1585030864115972859"})
if err != nil {
t.Fatal(err)
}
// t.Log(utils.Format4Output(result, false))
}
func TestLoadCategorysWithOption(t *testing.T) {
result, err := api.LoadCategorysWithOption(MainStoreVendorOrgCode)
if err != nil {
t.Fatal(err)
}
t.Log(utils.Format4Output(result, false))
}