Documentation
¶
Index ¶
- Constants
- type Client
- func (c *Client) ConfigApiGormFun(apiClientFun golog.ApiGormFun)
- func (c *Client) GeocoderAddress(ctx context.Context, address string, notMustParams ...gorequest.Params) (*GeocoderAddressResult, error)
- func (c *Client) GeocoderLocation(ctx context.Context, location string, notMustParams ...gorequest.Params) (*GeocoderLocationResult, error)
- func (c *Client) Ip(ctx context.Context, ip string, notMustParams ...gorequest.Params) (*IpResult, error)
- func (c *Client) WsDistrictV1Getchildren(ctx context.Context, id string, notMustParams ...gorequest.Params) (*WsDistrictV1GetchildrenResult, error)
- func (c *Client) WsDistrictV1List(ctx context.Context, notMustParams ...gorequest.Params) (*WsDistrictV1ListResult, error)
- type GeocoderAddressResponse
- type GeocoderAddressResult
- type GeocoderLocationResponse
- type GeocoderLocationResult
- type IpResponse
- type IpResult
- type WsDistrictV1GetchildrenResponse
- type WsDistrictV1GetchildrenResult
- type WsDistrictV1ListResponse
- type WsDistrictV1ListResult
Constants ¶
View Source
const (
LogTable = "qq"
)
View Source
const (
Version = "1.0.2"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client 实例
func (*Client) ConfigApiGormFun ¶
func (c *Client) ConfigApiGormFun(apiClientFun golog.ApiGormFun)
ConfigApiGormFun 接口日志配置
func (*Client) GeocoderAddress ¶
func (c *Client) GeocoderAddress(ctx context.Context, address string, notMustParams ...gorequest.Params) (*GeocoderAddressResult, error)
GeocoderAddress 地址解析(地址转坐标) https://lbs.qq.com/service/webService/webServiceGuide/webServiceGeocoder
func (*Client) GeocoderLocation ¶
func (c *Client) GeocoderLocation(ctx context.Context, location string, notMustParams ...gorequest.Params) (*GeocoderLocationResult, error)
GeocoderLocation 逆地址解析(坐标位置描述) https://lbs.qq.com/service/webService/webServiceGuide/webServiceGcoder
func (*Client) Ip ¶
func (c *Client) Ip(ctx context.Context, ip string, notMustParams ...gorequest.Params) (*IpResult, error)
Ip IP定位 https://lbs.qq.com/service/webService/webServiceGuide/webServiceIp
func (*Client) WsDistrictV1Getchildren ¶
func (c *Client) WsDistrictV1Getchildren(ctx context.Context, id string, notMustParams ...gorequest.Params) (*WsDistrictV1GetchildrenResult, error)
WsDistrictV1Getchildren 获取下级行政区划 https://lbs.qq.com/service/webService/webServiceGuide/webServiceDistrict#3
func (*Client) WsDistrictV1List ¶
func (c *Client) WsDistrictV1List(ctx context.Context, notMustParams ...gorequest.Params) (*WsDistrictV1ListResult, error)
WsDistrictV1List 获取省市区列表 https://lbs.qq.com/service/webService/webServiceGuide/webServiceDistrict#2
type GeocoderAddressResponse ¶
type GeocoderAddressResponse struct {
Status int `json:"status"`
Message string `json:"message"`
Result struct {
Title string `json:"title"`
Location struct {
Lng float64 `json:"lng"`
Lat float64 `json:"lat"`
} `json:"location"`
AdInfo struct {
Adcode string `json:"adcode"`
} `json:"ad_info"`
AddressComponents struct {
Province string `json:"province"`
City string `json:"city"`
District string `json:"district"`
Street string `json:"street"`
StreetNumber string `json:"street_number"`
} `json:"address_components"`
Similarity float64 `json:"similarity"`
Deviation int `json:"deviation"`
Reliability int `json:"reliability"`
Level int `json:"level"`
} `json:"result"`
}
type GeocoderAddressResult ¶
type GeocoderAddressResult struct {
Result GeocoderAddressResponse // 结果
Body []byte // 内容
Http gorequest.Response // 请求
}
type GeocoderLocationResponse ¶
type GeocoderLocationResponse struct {
Status int `json:"status"`
Message string `json:"message"`
RequestId string `json:"request_id"`
Result struct {
Location struct {
Lat float64 `json:"lat"`
Lng float64 `json:"lng"`
} `json:"location"`
Address string `json:"address"`
FormattedAddresses struct {
Recommend string `json:"recommend"`
Rough string `json:"rough"`
} `json:"formatted_addresses"`
AddressComponent struct {
Nation string `json:"nation"`
Province string `json:"province"`
City string `json:"city"`
District string `json:"district"`
Street string `json:"street"`
StreetNumber string `json:"street_number"`
} `json:"address_component"`
AdInfo struct {
NationCode string `json:"nation_code"`
Adcode string `json:"adcode"`
PhoneAreaCode string `json:"phone_area_code"`
CityCode string `json:"city_code"`
Name string `json:"name"`
Location struct {
Lat float64 `json:"lat"`
Lng float64 `json:"lng"`
} `json:"location"`
Nation string `json:"nation"`
Province string `json:"province"`
City string `json:"city"`
District string `json:"district"`
} `json:"ad_info"`
AddressReference struct {
BusinessArea struct {
Id string `json:"id"`
Title string `json:"title"`
Location struct {
Lat float64 `json:"lat"`
Lng float64 `json:"lng"`
} `json:"location"`
Distance int `json:"_distance"`
DirDesc string `json:"_dir_desc"`
} `json:"business_area"`
FamousArea struct {
Id string `json:"id"`
Title string `json:"title"`
Location struct {
Lat float64 `json:"lat"`
Lng float64 `json:"lng"`
} `json:"location"`
Distance int `json:"_distance"`
DirDesc string `json:"_dir_desc"`
} `json:"famous_area"`
Crossroad struct {
Id string `json:"id"`
Title string `json:"title"`
Location struct {
Lat float64 `json:"lat"`
Lng float64 `json:"lng"`
} `json:"location"`
Distance float64 `json:"_distance"`
DirDesc string `json:"_dir_desc"`
} `json:"crossroad"`
Town struct {
Id string `json:"id"`
Title string `json:"title"`
Location struct {
Lat float64 `json:"lat"`
Lng float64 `json:"lng"`
} `json:"location"`
Distance int `json:"_distance"`
DirDesc string `json:"_dir_desc"`
} `json:"town"`
StreetNumber struct {
Id string `json:"id"`
Title string `json:"title"`
Location struct {
Lat float64 `json:"lat"`
Lng float64 `json:"lng"`
} `json:"location"`
Distance float64 `json:"_distance"`
DirDesc string `json:"_dir_desc"`
} `json:"street_number"`
Street struct {
Id string `json:"id"`
Title string `json:"title"`
Location struct {
Lat float64 `json:"lat"`
Lng float64 `json:"lng"`
} `json:"location"`
Distance float64 `json:"_distance"`
DirDesc string `json:"_dir_desc"`
} `json:"street"`
LandmarkL2 struct {
Id string `json:"id"`
Title string `json:"title"`
Location struct {
Lat float64 `json:"lat"`
Lng float64 `json:"lng"`
} `json:"location"`
Distance int `json:"_distance"`
DirDesc string `json:"_dir_desc"`
} `json:"landmark_l2"`
} `json:"address_reference"`
PoiCount int `json:"poi_count"`
Pois []struct {
Id string `json:"id"`
Title string `json:"title"`
Address string `json:"address"`
Category string `json:"category"`
Location struct {
Lat float64 `json:"lat"`
Lng float64 `json:"lng"`
} `json:"location"`
AdInfo struct {
Adcode string `json:"adcode"`
Province string `json:"province"`
City string `json:"city"`
District string `json:"district"`
} `json:"ad_info"`
Distance float64 `json:"_distance"`
DirDesc string `json:"_dir_desc,omitempty"`
} `json:"pois"`
} `json:"result"`
}
type GeocoderLocationResult ¶
type GeocoderLocationResult struct {
Result GeocoderLocationResponse // 结果
Body []byte // 内容
Http gorequest.Response // 请求
}
type IpResponse ¶
type IpResponse struct {
Status int `json:"status"` // 状态码,0为正常,其它为异常
Message string `json:"message"` // 对status的描述
RequestId string `json:"request_id"`
Result struct {
Ip string `json:"ip"` // 用于定位的IP地址
Location struct {
Lat float64 `json:"lat"` // 纬度
Lng float64 `json:"lng"` // 经度
} `json:"location"` // 定位坐标。注:IP定位服务精确到市级,该位置为IP地址所属的行政区划政府坐标
AdInfo struct {
Nation string `json:"nation"` // 国家
Province string `json:"province"` // 国家代码(ISO3166标准3位数字码)
City string `json:"city"` // 省
District string `json:"district"` // 市
Adcode int64 `json:"adcode"` // 区
NationCode int64 `json:"nation_code"` // 行政区划代码
} `json:"ad_info"` // 定位行政区划信息
} `json:"result"` // IP定位结果
}
type IpResult ¶
type IpResult struct {
Result IpResponse // 结果
Body []byte // 内容
Http gorequest.Response // 请求
}
type WsDistrictV1GetchildrenResponse ¶
type WsDistrictV1GetchildrenResponse struct {
Status int `json:"status"` // 状态码
Message string `json:"message"` // 状态说明
DataVersion string `json:"data_version"` // 行政区划数据版本,便于您判断更新
Result [][]struct {
Id string `json:"id"` // 行政区划唯一标识(adcode)
Name string `json:"name"` // 简称,如“内蒙古”
Fullname string `json:"fullname"` // 全称,如“内蒙古自治区”
Pinyin []string `json:"pinyin"` // 行政区划拼音,每一下标为一个字的全拼
Location struct {
Lat float64 `json:"lat"` // 纬度
Lng float64 `json:"lng"` // 经度
} `json:"location"`
} `json:"result"`
}
type WsDistrictV1GetchildrenResult ¶
type WsDistrictV1GetchildrenResult struct {
Result WsDistrictV1GetchildrenResponse // 结果
Body []byte // 内容
Http gorequest.Response // 请求
}
type WsDistrictV1ListResponse ¶
type WsDistrictV1ListResponse struct {
Status int `json:"status"` // 状态码
Message string `json:"message"` // 状态说明
DataVersion string `json:"data_version"` // 行政区划数据版本,便于您判断更新
Result [][]struct {
Id string `json:"id"` // 行政区划唯一标识(adcode)
Name string `json:"name,omitempty"` // 简称,如“内蒙古”
Fullname string `json:"fullname"` // 全称,如“内蒙古自治区”
Pinyin []string `json:"pinyin,omitempty"` // 行政区划拼音,每一下标为一个字的全拼
Location struct {
Lat float64 `json:"lat"` // 纬度
Lng float64 `json:"lng"` // 经度
} `json:"location"` // 经纬度
Cidx []int `json:"cidx,omitempty"`
} `json:"result"`
}
type WsDistrictV1ListResult ¶
type WsDistrictV1ListResult struct {
Result WsDistrictV1ListResponse // 结果
Body []byte // 内容
Http gorequest.Response // 请求
}
Click to show internal directories.
Click to hide internal directories.