responses.go 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. package v1
  2. import (
  3. "strconv"
  4. )
  5. type ResponseMeDonates struct {
  6. TotalAmount int64 `json:"totalAmount"`
  7. TotalCount int64 `json:"totalCount"`
  8. }
  9. type ResponseMe struct {
  10. Success bool `json:"success"`
  11. Message string `json:"message"`
  12. NickName string `json:"nickname"`
  13. PubID string `json:"pubId"`
  14. Page string `json:"page"`
  15. IsActive bool `json:"isActive"`
  16. IsPublic bool `json:"isPublic"`
  17. Donates ResponseMeDonates `json:"donates"`
  18. CreatedAt string `json:"createdAt"`
  19. }
  20. // -----------------------------------------------------------------------------
  21. type ResponseDonatesContent struct {
  22. PubID string `json:"pubId"`
  23. ClientName string `json:"clientName"`
  24. Message string `json:"message"`
  25. Amount string `json:"amount"`
  26. Currency string `json:"currency"`
  27. Goal string `json:"goal"`
  28. IsPublished bool `json:"isPublished"`
  29. CreatedAt string `json:"createdAt"`
  30. }
  31. func (r ResponseDonatesContent) AmountInt64() int64 {
  32. var result int64
  33. var err error
  34. if result, err = strconv.ParseInt(r.Amount, 10, 64); err != nil {
  35. result = 0
  36. }
  37. return result
  38. }
  39. type ResponseDonates struct {
  40. Success bool `json:"success"`
  41. Message string `json:"message"`
  42. Content []ResponseDonatesContent `json:"content"`
  43. Page int64 `json:"page"`
  44. Size int64 `json:"size"`
  45. Pages int64 `json:"pages"`
  46. First bool `json:"first"`
  47. Last bool `json:"last"`
  48. Total int64 `json:"total"`
  49. }
  50. // -----------------------------------------------------------------------------
  51. type ResponseClientsClients struct {
  52. ClientName string `json:"clientName"`
  53. TotalAmount int64 `json:"totalAmount"`
  54. }
  55. type ResponseClients struct {
  56. Success bool `json:"success"`
  57. Message string `json:"message"`
  58. Clients []ResponseClientsClients `json:"clients"`
  59. }