This commit is contained in:
yuguojian 2025-05-14 18:18:34 +08:00
parent af1abd701e
commit 225efe116d
2 changed files with 155 additions and 18 deletions

View File

@ -104,18 +104,24 @@ type Regeocode struct {
} }
type AddressComponent struct { type AddressComponent struct {
BusinessAreas [][]interface{} `json:"businessAreas"` // BusinessAreas []interface{} `json:"businessAreas"`
Country string `json:"country"` Country string `json:"country"`
Province string `json:"province"` Province string `json:"province"`
Citycode string `json:"citycode"` Citycode string `json:"citycode"`
City string `json:"city"` City string `json:"city"`
Adcode string `json:"adcode"` Adcode string `json:"adcode"`
StreetNumber StreetNumber `json:"streetNumber"` StreetNumber StreetNumber `json:"streetNumber"`
Towncode string `json:"towncode"` Towncode string `json:"towncode"`
District string `json:"district"` District string `json:"district"`
Neighborhood Neighborhood `json:"neighborhood"` // Neighborhood Neighborhood `json:"neighborhood"`
Township string `json:"township"` Township string `json:"township"`
Building Building `json:"building"` // Building Building `json:"building"`
}
type BusinessArea struct {
Name string `json:"name"`
Location string `json:"location"`
Id string `json:"id"`
} }
type StreetNumber struct { type StreetNumber struct {
Number string `json:"number"` Number string `json:"number"`
@ -126,11 +132,11 @@ type StreetNumber struct {
} }
type Neighborhood struct { type Neighborhood struct {
Name []interface{} `json:"name"` Name interface{} `json:"name"`
Type []interface{} `json:"type"` Type interface{} `json:"type"`
} }
type Building struct { type Building struct {
Name []interface{} `json:"name"` Name interface{} `json:"name"`
Type []interface{} `json:"type"` Type interface{} `json:"type"`
} }

View File

@ -28,8 +28,139 @@ func TestAnNaQiGpsClient_GetGpsInfo(t *testing.T) {
Host: "https://jmgeocode.market.alicloudapi.com", Host: "https://jmgeocode.market.alicloudapi.com",
}, },
args: args{ args: args{
longitude: 109.770280, longitude: 113.419152,
latitude: 23.565979, latitude: 23.186899,
},
},
{
name: "test2",
fields: fields{
AppCode: "",
Host: "https://jmgeocode.market.alicloudapi.com",
},
args: args{
longitude: 110.165223,
latitude: 25.258515,
},
},
{
name: "test2",
fields: fields{
AppCode: "",
Host: "https://jmgeocode.market.alicloudapi.com",
},
args: args{
longitude: 115.928973,
latitude: 28.625388,
},
},
// 107.397284,40.739490
{
name: "test3",
fields: fields{
AppCode: "",
Host: "https://jmgeocode.market.alicloudapi.com",
},
args: args{
longitude: 107.397284,
latitude: 40.739490,
},
},
// 115.929015,28.625383
{
name: "test4",
fields: fields{
AppCode: "",
Host: "https://jmgeocode.market.alicloudapi.com",
},
args: args{
longitude: 115.929015,
latitude: 28.625383,
},
},
// 115.929100,28.625452
{
name: "test5",
fields: fields{
AppCode: "",
Host: "https://jmgeocode.market.alicloudapi.com",
},
args: args{
longitude: 115.929100,
latitude: 28.625452,
},
},
// 126.587051,45.739880
{
name: "test6",
fields: fields{
AppCode: "",
Host: "https://jmgeocode.market.alicloudapi.com",
},
args: args{
longitude: 126.587051,
latitude: 45.739880,
},
},
// 126.587051,45.739880
{
name: "test7",
fields: fields{
AppCode: "",
Host: "https://jmgeocode.market.alicloudapi.com",
},
args: args{
longitude: 126.595051,
latitude: 45.740537,
},
},
// 126.595051,45.740537
{
name: "test8",
fields: fields{
AppCode: "",
Host: "https://jmgeocode.market.alicloudapi.com",
},
args: args{
longitude: 125.342693,
latitude: 43.879634,
},
},
// 125.342693,43.879634
{
name: "test9",
fields: fields{
AppCode: "",
Host: "https://jmgeocode.market.alicloudapi.com",
},
args: args{
longitude: 112.485550,
latitude: 23.061314,
},
},
// 112.485550,23.061314
{
name: "test10",
fields: fields{
AppCode: "",
Host: "https://jmgeocode.market.alicloudapi.com",
},
args: args{
longitude: 115.928821,
latitude: 28.625069,
},
},
// 115.928821,28.625069
{
name: "test11",
fields: fields{
AppCode: "",
Host: "https://jmgeocode.market.alicloudapi.com",
},
args: args{
longitude: 115.928821,
latitude: 28.625069,
}, },
}, },
} }