aa
This commit is contained in:
@@ -42,7 +42,7 @@ func (a *API) CommonShopCategories(parentID, level int) (cityList []*CatInfo, er
|
||||
}
|
||||
|
||||
func (a *API) CommonBusinessCategories(parentID int) (cityList []*CatInfo, err error) {
|
||||
result, err := a.AccessAPI("common.businesscategories", utils.Params2Map("category_id", parentID))
|
||||
result, err := a.AccessAPI("common.businesscategories", nil)
|
||||
if err == nil {
|
||||
err = utils.Map2StructByJson(result.Data, &cityList, true)
|
||||
}
|
||||
|
||||
@@ -25,7 +25,24 @@ func TestCommonShopCategoriesGet(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestCommonShopCategories(t *testing.T) {
|
||||
result, err := api.CommonShopCategories(166, 2)
|
||||
/*
|
||||
{
|
||||
"category1": "厨房生鲜",
|
||||
"category2": "蔬菜"
|
||||
},
|
||||
{
|
||||
"category1": "水果",
|
||||
"category2": "水果店"
|
||||
},
|
||||
{
|
||||
"category1": "厨房生鲜",
|
||||
"category2": "肉类"
|
||||
},
|
||||
{
|
||||
"category1": "厨房生鲜",
|
||||
"category2": "水产"
|
||||
} */
|
||||
result, err := api.CommonShopCategories(277, 2)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
} else {
|
||||
@@ -34,7 +51,7 @@ func TestCommonShopCategories(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestCommonBusinessCategories(t *testing.T) {
|
||||
result, err := api.CommonBusinessCategories(166)
|
||||
result, err := api.CommonBusinessCategories(0)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
} else {
|
||||
|
||||
@@ -18,18 +18,18 @@ func TestShopList(t *testing.T) {
|
||||
func TestShopCreate(t *testing.T) {
|
||||
result, err := api.ShopCreate(map[string]interface{}{
|
||||
"shop_id": "667550",
|
||||
"name": "互利超市(金牛店)",
|
||||
"name": "互利超市(金牛区店)",
|
||||
"supplier_id": "1486975681715",
|
||||
"province": 32,
|
||||
"city": 75,
|
||||
"county": 698,
|
||||
"address": "成都市金牛区二环路北一段8号",
|
||||
"phone": 18980429231,
|
||||
"service_phone": 18980429231,
|
||||
"ivr_phone": 18048531223,
|
||||
"phone": 18160030913, // 18980429231,
|
||||
"service_phone": 18160030913, //18980429231,
|
||||
"ivr_phone": 18160030913, //18048531223,
|
||||
"longitude": 104.043677,
|
||||
"latitude": 30.692361,
|
||||
"shop_logo": "http://image.jxc4.com/image/4573e7789c647d4961f8955e3733dbd6.tem.jpg",
|
||||
"shop_logo": "https://image-star.elemecdn.com/pb/dab294b0d3e9fa4b5fa63007ff02d06e98",
|
||||
"coord_type": "amap",
|
||||
"categorys": []map[string]int{
|
||||
map[string]int{
|
||||
@@ -53,7 +53,7 @@ func TestShopCreate(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestShopGet(t *testing.T) {
|
||||
result, err := api.ShopGet("", 335768207) //2233065879
|
||||
result, err := api.ShopGet("", 2267237821) //2233065879 ,22267134648
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
} else {
|
||||
|
||||
@@ -25,7 +25,7 @@ func TestSkuBrandList(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestPictureUpload(t *testing.T) {
|
||||
result, err := api.PictureUpload("https://www.jxcs.net/emoji/ceshi2.gif", nil)
|
||||
result, err := api.PictureUpload("http://image.jxc4.com/image/212c268d26f6237e33ba269d24e2f76b.jpg", nil)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user