model.go 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. package model
  2. import (
  3. "encoding/json"
  4. "math"
  5. )
  6. // 各种状态枚举
  7. const (
  8. OrderStatePaid = "paid"
  9. OrderStateSettled = "settled"
  10. OrderStateBadDebt = "bad_debt"
  11. OrderStateRefundFinished = "ref_finished"
  12. OrderStateSettledRefunded = "st_refunded"
  13. BizAsset = "asset"
  14. CurrencyBP = "bp"
  15. StateRunning = "running"
  16. StateValid = "valid"
  17. AccountStateIncome = "income"
  18. AccountStateWithdraw = "withdraw"
  19. AccountStateProfit = "profit"
  20. AccountStateLoss = "fill_loss"
  21. PayCheckOrderStateING = "WAIT_RECONCILIATION"
  22. PayCheckOrderStateSuccess = "RECONCILIATION_SUCCESS"
  23. PayCheckOrderStateFail = "RECONCILIATION_FAIL"
  24. DefaultUserSetting = math.MaxInt32
  25. )
  26. // Message binlog databus msg.
  27. type Message struct {
  28. Action string `json:"action"`
  29. Table string `json:"table"`
  30. New json.RawMessage `json:"new"`
  31. Old json.RawMessage `json:"old"`
  32. }
  33. // BinlogOrderUser .
  34. type BinlogOrderUser struct {
  35. OrderID string `json:"order_id"`
  36. }
  37. // BinlogAsset .
  38. type BinlogAsset struct {
  39. OID int64 `json:"oid"`
  40. OType string `json:"otype"`
  41. Currency string `json:"currency"`
  42. }
  43. // BinlogAssetRelation .
  44. type BinlogAssetRelation struct {
  45. OID int64 `json:"oid"`
  46. OType string `json:"otype"`
  47. MID int64 `json:"mid"`
  48. }
  49. // PayCheckRefundOrder .
  50. type PayCheckRefundOrder struct {
  51. Elements []*PayCheckRefundOrderEle `json:"batchRefundBillVOS"`
  52. TXID string `json:"txId"`
  53. }
  54. // PayCheckRefundOrderEle .
  55. type PayCheckRefundOrderEle struct {
  56. RefundNO string `json:"refundNo"`
  57. RefundAmount int64 `json:"refundAmount"`
  58. CustomerRefundID string `json:"customerRefundId"`
  59. RecoStatusDesc string `json:"recoStatusDesc"`
  60. TXID string `json:"txId"`
  61. }
  62. // PayCheckOrder .
  63. type PayCheckOrder struct {
  64. PayChannelOrderNo string `json:"payChannelOrderNo"` //第三方支付渠道支付流水号
  65. TxID string `json:"txId"`
  66. BankAmount int64 `json:"bankAmount"` // 订单支付金额
  67. PayTime int64 `json:"payTime"` // 订单支付时间,毫秒值
  68. RecoStatusDesc string `json:"recoStatusDesc"` // 对账状态 WAIT_RECONCILIATION(对账中),RECONCILIATION_SUCCESS(对账成功),RECONCILIATION_FAIL(对账失败)
  69. }
  70. // PayQuery .
  71. type PayQuery struct {
  72. Orders []*PayOrder `json:"orders"`
  73. }
  74. // PayOrder .
  75. type PayOrder struct {
  76. TXID int64 `json:"txId"`
  77. OrderID string `json:"orderId"`
  78. PayStatus string `json:"payStatus"`
  79. PayStatusDesc string `json:"payStatusDesc"`
  80. FailReason string `json:"failReason"`
  81. }