user.go 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. package model
  2. type User struct {
  3. BaseModel
  4. Name string `json:"name"`
  5. Phone string `json:"phone"`
  6. AppID string `json:"app_id"`
  7. SecretKey string `json:"secret_key"`
  8. IpWhiteList string `json:"ip_white_list"`
  9. }
  10. func (user *User) TableName() string {
  11. return "user"
  12. }
  13. type UserAccount struct {
  14. ID int `json:"id" gorm:"primaryKey"`
  15. AppID string `json:"app_id"`
  16. Money int `json:"money"`
  17. }
  18. func (p *UserAccount) TableName() string {
  19. return "user_account"
  20. }
  21. type UserMoneyRecord struct {
  22. ID int `json:"id" gorm:"primaryKey"`
  23. AppID string `json:"app_id"`
  24. Before int `json:"before"`
  25. After int `json:"after"`
  26. TradeMoney int `json:"tarde_money"`
  27. }
  28. func (p *UserMoneyRecord) TableName() string {
  29. return "user_money_record"
  30. }
  31. type UserBuyRecord struct {
  32. ID int `json:"id" gorm:"primaryKey"`
  33. AppID string `json:"app_id"`
  34. ProductId int `json:"product_id"`
  35. UserProductId int `json:"user_product_id"`
  36. Before int `json:"before"`
  37. After int `json:"after"`
  38. TradeMoney int `json:"tarde_money"`
  39. BuyType int `json:"buy_type"`
  40. HistoryUnitPrice int `json:"history_unit_price"`
  41. }
  42. func (p *UserBuyRecord) TableName() string {
  43. return "user_buy_record"
  44. }