aodun.go 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. package v1
  2. import "encoding/json"
  3. type GetTokenRespone struct {
  4. Code int `json:"code"` // 操作结果代码;0成功,其他失败
  5. Msg string `json:"msg,omitempty"` // 操作结果描述或错误原因 (omitempty 表示如果字段为空则在 JSON 中忽略)
  6. RemoteIP string `json:"remote_ip,omitempty"` // 调用者 IP 地址 (omitempty)
  7. TokenType string `json:"token_type,omitempty"` // Token 类型 (omitempty)
  8. AccessToken string `json:"access_token,omitempty"` // Token 数据 (omitempty)
  9. }
  10. type IpInfo struct {
  11. FType string `json:"F_type"`
  12. FStartIp string `json:"F_startIp"`
  13. FEndIp string `json:"F_endIp"`
  14. FRemark string `json:"F_remark"`
  15. FServerIp string `json:"F_serverIp"`
  16. }
  17. type DeleteIp struct {
  18. Ids string `json:"ids"`
  19. }
  20. type IpResponse struct {
  21. Code int `json:"code"`
  22. Msg string `json:"msg,omitempty"`
  23. Data []interface{} `json:"data,omitempty"`
  24. }
  25. type DomainResponse struct {
  26. Code int `json:"err"`
  27. Msg json.RawMessage `json:"msg,omitempty"`
  28. Data string `json:"data,omitempty"`
  29. }
  30. type IpGetResponse struct {
  31. Code int `json:"code"`
  32. Msg string `json:"msg,omitempty"`
  33. Data []IpGetData `json:"data,omitempty"`
  34. }
  35. type IpGetData struct {
  36. LongIntEndIP int64 `json:"long_int_end_ip"`
  37. Remark string `json:"remark"`
  38. Index int `json:"index"`
  39. LongIntServerIP int64 `json:"long_int_server_ip"`
  40. TType int `json:"t_type"`
  41. Source string `json:"source"`
  42. IsRange bool `json:"range"` // "range" 是 Go 关键字,所以换个名字
  43. EndIP string `json:"end_ip"`
  44. ServerIP string `json:"server_ip"`
  45. StartIP string `json:"start_ip"`
  46. IpType int `json:"ip_type"`
  47. MongoID string `json:"_id"` // "_id" 不符合 Go 命名规范,换个名字
  48. ID int `json:"id"` // 这是我们最终需要的目标字段
  49. LongIntStartIP int64 `json:"long_int_start_ip"`
  50. }