aodun.go 2.0 KB

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