cashoutrecord.go 3.8 KB

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