This commit is contained in:
邹宗楠
2025-07-31 17:00:25 +08:00
parent 67bb7bcfb4
commit 30006b40be
3 changed files with 29 additions and 19 deletions

View File

@@ -27,10 +27,20 @@ func TestRetailCatUpdate(t *testing.T) {
// 测试获取门店分类列表
func TestRetailCatList(t *testing.T) {
result, err := api.RetailCatList("5943132")
result, err := api.RetailCatList("28657115")
if err != nil {
t.Fatal(err)
}
fmt.Println("parent name code level")
for k1, v1 := range result {
fmt.Println(k1-k1, fmt.Sprintf("0 %s %s %d", v1.Name, v1.Code, v1.Level))
if v1.Children != nil {
for k2, v2 := range v1.Children {
time.Sleep(200 * time.Microsecond)
fmt.Println(k2-k2, fmt.Sprintf("%s %s %s %d", v1.Code, v2.Name, v2.Code, v2.Level))
}
}
}
t.Log(utils.Format4Output(result, false))
}