qq

package
v1.0.215 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 11, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LogTable = "qq"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client 实例

func NewClient

func NewClient(config *ClientConfig) (*Client, error)

NewClient 创建实例化

func (*Client) ConfigSLogClientFun added in v1.0.162

func (c *Client) ConfigSLogClientFun(apiSLogFun golog.ApiSLogFun)

ConfigSLogClientFun 日志配置

func (*Client) DefaultHttp added in v1.0.177

func (c *Client) DefaultHttp()

DefaultHttp 默认请求

func (*Client) GeocoderAddress added in v1.0.130

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 added in v1.0.130

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) GetKey

func (c *Client) GetKey() string

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) SetHttp added in v1.0.177

func (c *Client) SetHttp(app *gorequest.App)

SetHttp 配置请求

type ClientConfig

type ClientConfig struct {
	Key string
}

ClientConfig 实例配置

type GeocoderAddressResponse added in v1.0.130

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 added in v1.0.130

type GeocoderAddressResult struct {
	Result GeocoderAddressResponse // 结果
	Body   []byte                  // 内容
	Http   gorequest.Response      // 请求
}

type GeocoderLocationResponse added in v1.0.130

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 added in v1.0.130

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     int    `json:"adcode"`      // 区
			NationCode int    `json:"nation_code"` // 行政区划代码

		} `json:"ad_info"` // 定位行政区划信息
	} `json:"result"` // IP定位结果
}

type IpResult

type IpResult struct {
	Result IpResponse         // 结果
	Body   []byte             // 内容
	Http   gorequest.Response // 请求
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL