node_order.go 1.7 KB

12345678910111213141516171819202122232425262728293031
  1. package app
  2. // 引入关联包
  3. import (
  4. "github.com/shopspring/decimal"
  5. )
  6. type NodeOrder struct {
  7. Id int64 `json:"id" gorm:"column:id;type:bigint;comment:id;primarykey;NOT NULL"`
  8. CreatedAt int64 `json:"createdAt" gorm:"column:created_at;type:bigint;comment:创建时间"`
  9. UpdatedAt int64 `json:"updatedAt" gorm:"column:updated_at;type:bigint;comment:更新时间"`
  10. RecordId string `json:"recordId" gorm:"column:record_id;type:varchar(64);comment:奖励记录ID;index;unique:uni_node_order_record_id"`
  11. UserId int64 `json:"userId" gorm:"column:user_id;type:bigint;comment:用户ID;index"`
  12. Uid string `json:"uid" gorm:"column:uid;type:varchar(64);comment:用户交易所ID:;index"`
  13. ProductId int64 `json:"productId" gorm:"column:product_id;type:bigint;comment:产品ID"`
  14. ProductName string `json:"productName" gorm:"column:product_name;type:varchar(64);comment:产品名称"`
  15. UsdPrice decimal.Decimal `json:"usdPrice" gorm:"column:usd_price;type:decimal(25,8);comment:单价"`
  16. Quantity decimal.Decimal `json:"quantity" gorm:"column:quantity;type:decimal(25,2);comment:数量"`
  17. UsdAmount decimal.Decimal `json:"usdAmount" gorm:"column:usd_amount;type:decimal(25,8);comment:总价值"`
  18. PayState int64 `json:"payState" gorm:"column:pay_state;type:bigint;comment:支付状态:0:待支付 1: 支付成功 2: 支付失败 "`
  19. State int64 `json:"state" gorm:"column:state;type:bigint;comment:订单状态:0:未知 1:有效 2:过期失效 3:其他失效 "`
  20. Source int64 `json:"source" gorm:"column:source;type:bigint;comment:来源:0 用户购买 1: 2: 3: 4:后台购买"`
  21. }
  22. func (*NodeOrder) TableName() string {
  23. return "node_order"
  24. }
  25. func NewNodeOrder() *NodeOrder {
  26. return &NodeOrder{}
  27. }