96 lines
2.7 KiB
Go
96 lines
2.7 KiB
Go
package model
|
|
|
|
type (
|
|
// ResponseLocationAddress ...
|
|
ResponseLocationAddress struct {
|
|
Province LocationProvince `json:"province"`
|
|
District LocationDistrict `json:"district"`
|
|
Ward LocationWard `json:"ward"`
|
|
}
|
|
|
|
// LocationProvince ...
|
|
LocationProvince struct {
|
|
ID string `json:"id"`
|
|
Name string `json:"name"`
|
|
Code int `json:"code"`
|
|
Slug string `json:"slug"`
|
|
RegionCode string `json:"regionCode"`
|
|
MainRegionCode string `json:"mainRegionCode"`
|
|
}
|
|
|
|
// LocationDistrict ...
|
|
LocationDistrict struct {
|
|
ID string `json:"id"`
|
|
Name string `json:"name"`
|
|
Code int `json:"code"`
|
|
Slug string `json:"slug"`
|
|
}
|
|
|
|
// LocationWard ...
|
|
LocationWard struct {
|
|
ID string `json:"id"`
|
|
Name string `json:"name"`
|
|
Code int `json:"code"`
|
|
Slug string `json:"slug"`
|
|
Location *GEOLocation `json:"location"`
|
|
}
|
|
|
|
// GEOLocation ...
|
|
GEOLocation struct {
|
|
Type string `bson:"type" json:"type"`
|
|
Coordinates []float64 `bson:"coordinates" json:"coordinates"`
|
|
}
|
|
|
|
// LocationProvinceResponse ...
|
|
LocationProvinceResponse struct {
|
|
Provinces []LocationProvince `json:"provinces"`
|
|
}
|
|
|
|
// LocationDistrictResponse ...
|
|
LocationDistrictResponse struct {
|
|
Districts []LocationDistrict `json:"districts"`
|
|
}
|
|
|
|
// LocationWardResponse ...
|
|
LocationWardResponse struct {
|
|
Wards []LocationWard `json:"wards"`
|
|
}
|
|
|
|
// LocationProvinceDetailResponse ...
|
|
LocationProvinceDetailResponse struct {
|
|
ID string `json:"_id"`
|
|
Name string `json:"name"`
|
|
Slug string `json:"slug"`
|
|
Code int `json:"code"`
|
|
CountryCode string `json:"countryCode"`
|
|
RegionCode string `json:"regionCode"`
|
|
MainRegionCode string `json:"mainRegionCode"`
|
|
TotalDistricts int `json:"totalDistricts"`
|
|
TotalWards int `json:"totalWards"`
|
|
}
|
|
|
|
// LocationDistrictDetailResponse ...
|
|
LocationDistrictDetailResponse struct {
|
|
ID string `json:"_id"`
|
|
Name string `json:"name"`
|
|
OldSlugs []string `json:"oldSlugs"`
|
|
Slug string `json:"slug"`
|
|
Code int `json:"code"`
|
|
ProvinceCode int `json:"provinceCode"`
|
|
Area int `json:"area"`
|
|
TotalWards int `json:"totalWards"`
|
|
}
|
|
|
|
// LocationWardDetailResponse ...
|
|
LocationWardDetailResponse struct {
|
|
ID string `json:"_id"`
|
|
Name string `json:"name"`
|
|
OldSlugs []string `json:"oldSlugs"`
|
|
Slug string `json:"slug"`
|
|
Code int `json:"code"`
|
|
DistrictCode int `json:"districtCode"`
|
|
ProvinceCode int `json:"provinceCode"`
|
|
Location *GEOLocation `json:"location"`
|
|
}
|
|
)
|