db.go 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. package model
  2. import (
  3. "time"
  4. )
  5. // LogTask .
  6. type LogTask struct {
  7. ID int64
  8. Name string
  9. Expect int64
  10. Success int64
  11. Failure int64
  12. State string
  13. CTime time.Time
  14. MTime time.Time
  15. }
  16. // Asset .
  17. type Asset struct {
  18. ID int64
  19. MID int64
  20. OID int64
  21. OType string
  22. Currency string
  23. Price int64
  24. State string
  25. CTime time.Time
  26. MTime time.Time
  27. }
  28. // Order .
  29. type Order struct {
  30. ID int64
  31. OrderID string
  32. MID int64
  33. Biz string
  34. Platform string
  35. OID int64
  36. OType string
  37. Fee int64
  38. RealFee int64
  39. Currency string
  40. PayID string
  41. PayReason string
  42. PayTime time.Time
  43. RefundTime time.Time
  44. State string // created 已创建, paying 支付中, paid 已支付, failed 支付失败, closed 已关闭, expired 已超时, finished 已完成(支付成功且对账成功)
  45. Version int64 // 乐观锁,每次更新,值++
  46. CTime time.Time
  47. MTime time.Time
  48. }
  49. // LogOrder .
  50. type LogOrder struct {
  51. ID int64
  52. OrderID string
  53. FromState string
  54. ToState string
  55. Desc string
  56. CTime time.Time
  57. MTime time.Time
  58. }
  59. // Bill .
  60. type Bill struct {
  61. ID int64
  62. BillID string
  63. MID int64
  64. Biz string
  65. Currency string
  66. In int64
  67. Out int64
  68. Ver int64 // 账单版本,比如 201812, 20181202
  69. Version int64 // 乐观锁,每次更新++
  70. CTime time.Time
  71. MTime time.Time
  72. }
  73. // DailyBill .
  74. type DailyBill struct {
  75. Bill
  76. MonthVer int64
  77. }
  78. // BizAccount .
  79. type BizAccount struct {
  80. ID int64
  81. Biz string
  82. Currency string
  83. Balance int64
  84. Ver int64
  85. State string
  86. CTime time.Time
  87. MTime time.Time
  88. }
  89. // UserAccount .
  90. type UserAccount struct {
  91. BizAccount
  92. MID int64
  93. }
  94. // AccountLog .
  95. type AccountLog struct {
  96. ID int64
  97. Name string
  98. AccountID int64
  99. From int64
  100. To int64
  101. Ver int64
  102. State string
  103. CTime time.Time
  104. MTime time.Time
  105. }
  106. // AggrIncomeUser .
  107. type AggrIncomeUser struct {
  108. ID int64
  109. MID int64
  110. Currency string
  111. PaySuccess int64
  112. PayError int64
  113. TotalIn int64
  114. TotalOut int64
  115. CTime time.Time
  116. MTime time.Time
  117. }
  118. // AggrIncomeUserAsset .
  119. type AggrIncomeUserAsset struct {
  120. ID int64
  121. MID int64
  122. Currency string
  123. Ver int64
  124. OID int64
  125. OType string
  126. PaySuccess int64
  127. PayError int64
  128. TotalIn int64
  129. TotalOut int64
  130. CTime time.Time
  131. MTime time.Time
  132. }
  133. // OrderBadDebt .
  134. type OrderBadDebt struct {
  135. ID int64
  136. OrderID string
  137. Type string
  138. State string
  139. CTime time.Time
  140. MTime time.Time
  141. }
  142. // LogBillDaily .
  143. type LogBillDaily struct {
  144. ID int64
  145. BillID string
  146. FromIn int64
  147. ToIn int64
  148. FromOut int64
  149. ToOut int64
  150. OrderID string
  151. CTime time.Time
  152. MTime time.Time
  153. }
  154. // LogBillMonthly .
  155. type LogBillMonthly struct {
  156. ID int64
  157. BillID string
  158. FromIn int64
  159. ToIn int64
  160. FromOut int64
  161. ToOut int64
  162. BillUserDailyID string
  163. CTime time.Time
  164. MTime time.Time
  165. }
  166. // OrderRechargeShell .
  167. type OrderRechargeShell struct {
  168. ID int64
  169. MID int64
  170. OrderID string
  171. Biz string
  172. Amount int64
  173. PayMSG string
  174. State string
  175. Ver int64
  176. CTime time.Time
  177. MTime time.Time
  178. }
  179. // OrderRechargeShellLog .
  180. type OrderRechargeShellLog struct {
  181. ID int64
  182. OrderID string
  183. FromState string
  184. ToState string
  185. Desc string
  186. BillUserMonthlyID string
  187. CTime time.Time
  188. MTime time.Time
  189. }