From 9bdad9dfc471fd7da1393902d4d9ff753de2756c Mon Sep 17 00:00:00 2001 From: xiaoqidun Date: Wed, 29 Sep 2021 15:50:34 +0800 Subject: [PATCH] =?UTF-8?q?docs(=E4=BB=A3=E7=A0=81=E6=B3=A8=E9=87=8A):=20?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=B3=A8=E9=87=8A=E4=BD=9C=E4=B8=BA=E6=96=87?= =?UTF-8?q?=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tipdw.go | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/tipdw.go b/tipdw.go index 3c2b53a..1b9bddd 100644 --- a/tipdw.go +++ b/tipdw.go @@ -11,28 +11,28 @@ import ( var client = &http.Client{Timeout: 5 * time.Second} type Body struct { - Status int `json:"status"` - Message string `json:"message"` - Result Result `json:"result"` + Status int `json:"status"` // 状态码,0为正常,其它为异常 + Message string `json:"message"` // 对status的描述 + Result Result `json:"result"` // IP定位结果 } type Result struct { - IP string `json:"ip"` - AdInfo AdInfo `json:"ad_info"` - Location Location `json:"location"` + IP string `json:"ip"` // 用于定位的IP地址 + AdInfo AdInfo `json:"ad_info"` // 定位行政区划信息 + Location Location `json:"location"` // 定位坐标 } type AdInfo struct { - Nation string `json:"nation"` - Province string `json:"province"` - City string `json:"city"` - District string `json:"district"` - Adcode int `json:"adcode"` + Nation string `json:"nation"` // 国家 + Province string `json:"province"` // 省 + City string `json:"city"` // 市 + District string `json:"district"` // 区 + Adcode int `json:"adcode"` // 行政区划代码 } type Location struct { - Lat float64 `json:"lat"` - Lng float64 `json:"lng"` + Lat float64 `json:"lat"` // 纬度 + Lng float64 `json:"lng"` // 经度 } // QueryIP 使用腾讯位置服务查询IP