cashoutrecord.go 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. package models
  2. import (
  3. cutils "github.com/mhaya/extend/utils"
  4. "github.com/mhaya/game/game_cluster/internal/constant"
  5. )
  6. type CashOutRecord struct {
  7. UserName string `json:"userName" bson:"userName"` // 用户名字
  8. NickName string `json:"nickName" bson:"nickName"` // 昵称
  9. Status int `json:"status" bson:"status"` // 0:未审核 1:审核通过 2:审核失败
  10. OpenId string `json:"openId" bson:"openId"`
  11. Amount int `json:"amount" bson:"amount"` //
  12. AfterAmount int `json:"afterAmount" bson:"after_amount"` //
  13. Type int `json:"type" bson:"type"` // 货币内型
  14. Address string `json:"address" bson:"address"` // 地址
  15. State int `json:"state" bson:"state"` //服务器是否已经处理 0 未处理 1已处理
  16. Withdrawal int `json:"withdrawal" bson:"withdrawal"` // 提现 0 :未体现 1:提现成功 2:提现中 3:提现失败 4:拒绝提现
  17. CreateAt int64 `json:"createAt" bson:"createAt"`
  18. UpdateAt int64 `json:"updateAt" bson:"updateAt"`
  19. }
  20. type UserWithdrawal struct {
  21. Id string `json:"id" bson:"_id"` // Id
  22. UserName string `json:"user_name" bson:"userName"` // 用户ID
  23. NickName string `json:"nick_name" bson:"nickName"` // 昵称
  24. Status int `json:"status" bson:"status"` // 0:未审核 1:审核通过 2:审核失败
  25. Reason string `json:"reason" bson:"reason"` // 提现原因
  26. Withdrawal int `json:"withdrawal" bson:"withdrawal"` // 提现 1:提现成功 2:提现中 3:提现失败 4:拒绝提现
  27. State int `json:"-" bson:"state"` //服务器是否已经处理 0 未处理 1已处理
  28. Amount int `json:"amount" bson:"amount"` // 提现金额
  29. AfterAmount int `json:"after_amount" bson:"after_amount"` // 提现后金额
  30. Type int `json:"type" bson:"type"` // 货币内型
  31. Address string `json:"address" bson:"address"` // 地址
  32. CreateAt int64 `json:"createAt" bson:"createAt"` // 提现时间
  33. UpdateAt int64 `json:"updateAt" bson:"updateAt"`
  34. }
  35. type ToUserWithdrawal struct {
  36. Id string `json:"id" bson:"_id"` // Id
  37. UserName string `json:"user_name" bson:"userName"` // 用户ID
  38. NickName string `json:"nick_name" bson:"nickName"` // 昵称
  39. Status int `json:"status" bson:"status"` // 0:未审核 1:审核通过 2:审核失败
  40. Reason string `json:"reason" bson:"reason"` // 提现原因
  41. Withdrawal int `json:"withdrawal" bson:"withdrawal"` // 提现 1:提现成功 2:提现中 3:提现失败 4:拒绝提现
  42. Amount float64 `json:"amount" bson:"amount"` // 提现金额
  43. State int `json:"-" bson:"state"` //服务器是否已经处理 0 未处理 1已处理
  44. AfterAmount float64 `json:"after_amount" bson:"after_amount"` // 提现后金额
  45. Type int `json:"type" bson:"type"` // 货币内型
  46. Address string `json:"address" bson:"address"` // 地址
  47. CreateAt int64 `json:"createAt" bson:"createAt"` // 提现时间
  48. UpdateAt int64 `json:"updateAt" bson:"updateAt"`
  49. }
  50. func (uw *UserWithdrawal) To() *ToUserWithdrawal {
  51. var ret = &ToUserWithdrawal{
  52. Id: uw.Id,
  53. UserName: uw.UserName,
  54. NickName: uw.NickName,
  55. Status: uw.Status,
  56. Reason: uw.Reason,
  57. Withdrawal: uw.Withdrawal,
  58. Amount: cutils.QuoInt64ByRatioToFloat64(int64(uw.Amount), constant.MoneyRatio),
  59. AfterAmount: cutils.QuoInt64ByRatioToFloat64(int64(uw.AfterAmount), constant.MoneyRatio),
  60. Type: uw.Type,
  61. Address: uw.Address,
  62. CreateAt: uw.CreateAt,
  63. UpdateAt: uw.UpdateAt,
  64. }
  65. return ret
  66. }