This commit is contained in:
苏尹岚
2021-02-04 15:49:13 +08:00
parent dbeeab48ab
commit 48f4a7179c
6 changed files with 326 additions and 28 deletions

View File

@@ -17,17 +17,33 @@ func TestShopList(t *testing.T) {
func TestShopCreate(t *testing.T) {
result, err := api.ShopCreate(map[string]interface{}{
"shop_id": "123123123",
"business_form_id": "179",
"service_phone": "1111111",
"invoice_support": "2",
"package_box_price": "0",
"encrypt": "",
"category1": "",
"category2": "",
"category3": "",
"name": "测试",
"supplier_id": "2233065879",
"shop_id": "667550",
"name": "互利超市(金牛店)",
"supplier_id": "1486975681715",
"province": 32,
"city": 75,
"county": 698,
"address": "成都市金牛区二环路北一段8号",
"phone": 18980429231,
"service_phone": 18980429231,
"ivr_phone": 18048531223,
"longitude": 104.043677,
"latitude": 30.692361,
"shop_logo": "http://image.jxc4.com/image/4573e7789c647d4961f8955e3733dbd6.tem.jpg",
"coord_type": "amap",
"categorys": []map[string]int{
map[string]int{
"category1": 166,
"category2": 222,
},
},
"business_time": []map[string]string{
map[string]string{
"start": "7:00",
"end": "19:00",
},
},
"business_form_id": 1672214913,
})
if err != nil {
t.Fatal(err)
@@ -37,7 +53,7 @@ func TestShopCreate(t *testing.T) {
}
func TestShopGet(t *testing.T) {
result, err := api.ShopGet("", 32267697558) //2233065879
result, err := api.ShopGet("", 335768207) //2233065879
if err != nil {
t.Fatal(err)
} else {
@@ -53,7 +69,7 @@ func TestShopGet(t *testing.T) {
}
func TestShopAptitudeGet(t *testing.T) {
result, err := api.ShopAptitudeGet("", testShopBaiduID)
result, err := api.ShopAptitudeGet("", 335768207)
if err != nil {
t.Fatal(err)
} else {
@@ -83,7 +99,7 @@ func TestShopUpdate(t *testing.T) {
}
func TestShopBusStatusGet(t *testing.T) {
result, err := api.ShopBusStatusGet("", testShopBaiduID, PlatformFlagElm)
result, err := api.ShopBusStatusGet("", 335768207, PlatformFlagElm)
if err != nil {
t.Fatal(err)
} else {
@@ -92,7 +108,7 @@ func TestShopBusStatusGet(t *testing.T) {
}
func TestShopStatusGet(t *testing.T) {
result, err := api.ShopStatusGet("", testShopBaiduID)
result, err := api.ShopStatusGet("", 335768207)
if err != nil {
t.Fatal(err)
} else {
@@ -121,7 +137,7 @@ func TestSupplierList(t *testing.T) {
}
func TestShopOpen(t *testing.T) {
err := api.ShopOpen("", testShopBaiduID)
err := api.ShopOpen("", 335768207)
if err != nil {
t.Fatal(err)
}
@@ -147,3 +163,81 @@ func TestShopAnnouncementSet(t *testing.T) {
t.Fatal(err)
}
}
func TestShopAptitudeUpload(t *testing.T) {
err := api.ShopAptitudeUpload("", 335768207, map[string]interface{}{
"aptitude": []map[string]interface{}{
map[string]interface{}{
"type_1": 1,
"type_2": 101,
"license_number": "92510106L597085088",
"license_address": "金牛区二环路北一段8号1A-2、A-3、A-4楼",
"long_term_valid": 1,
"legal_representative_name": "张应友",
"license_name": "营业执照",
"photos": []map[string]interface{}{
map[string]interface{}{
"photo_url": "http://image.jxc4.com/image/c436338a2af4d87e30b770cfc1bb8041.jpg",
"waterprinter_url": "http://image.jxc4.com/image/c436338a2af4d87e30b770cfc1bb8041.jpg",
},
},
},
map[string]interface{}{
"type_1": 2,
"type_2": 202,
"license_number": "JY151010601049471-1",
"license_validdate": "2023-10-09",
"license_name": "食品经营许可证",
"license_address": "金牛区二环路北一段8号1A-2、A-3、A-4楼",
"legal_representative_name": "张应友",
"photos": []map[string]interface{}{
map[string]interface{}{
"photo_url": "http://image.jxc4.com/image/93d2126adfd28350385b5067e2770edf.jpg",
"waterprinter_url": "http://image.jxc4.com/image/93d2126adfd28350385b5067e2770edf.jpg",
},
},
},
map[string]interface{}{
"type_1": 3,
"type_2": 301,
"license_number": "510921196608255211",
"long_term_valid": 1,
"license_name": "身份证",
"legal_representative_name": "张应友",
"photos": []map[string]interface{}{
map[string]interface{}{
"photo_url": "http://image.jxc4.com/image/ebdaf32e771a6c050e397624c3fae369.jpg",
"waterprinter_url": "http://image.jxc4.com/image/ebdaf32e771a6c050e397624c3fae369.jpg",
},
map[string]interface{}{
"photo_url": "http://image.jxc4.com/image/75fad719d61326cedd73f17b1af6338b.jpg",
"waterprinter_url": "http://image.jxc4.com/image/75fad719d61326cedd73f17b1af6338b.jpg",
},
},
},
map[string]interface{}{
"type_1": 5,
"type_2": 501,
"photos": []map[string]interface{}{
map[string]interface{}{
"photo_url": "http://image.jxc4.com/image/53bd1275a8a9cd5898912fa78857f284.jpg",
"waterprinter_url": "http://image.jxc4.com/image/53bd1275a8a9cd5898912fa78857f284.jpg",
},
},
},
map[string]interface{}{
"type_1": 5,
"type_2": 502,
"photos": []map[string]interface{}{
map[string]interface{}{
"photo_url": "http://image.jxc4.com/image/74c371be5bf39d795cf6c02507e7ca84.jpg",
"waterprinter_url": "http://image.jxc4.com/image/74c371be5bf39d795cf6c02507e7ca84.jpg",
},
},
},
},
})
if err != nil {
t.Fatal(err)
}
}