package model import ( "time" ) type User struct { BaseModel Name string `json:"name" form:"name" binding:"required"` Phone string `json:"phone" form:"phone"` AppID string `json:"app_id"` SecretKey string `json:"secret_key"` IpWhiteList string `json:"ip_white_list" form:"ip_white_list"` } func (user *User) TableName() string { return "user" } type UserAccount struct { ID int `json:"id" gorm:"primaryKey"` AppID string `json:"app_id"` Money int `json:"money"` } func (p *UserAccount) TableName() string { return "user_account" } type UserMoneyRecord struct { ID int `json:"id" gorm:"primaryKey"` AppID string `json:"app_id"` Before int `json:"before"` After int `json:"after"` TradeMoney int `json:"tarde_money"` CreateAt time.Time `json:"-" gorm:"autoCreateTime"` } func (p *UserMoneyRecord) TableName() string { return "user_money_record" } type UserBuyRecord struct { ID int `json:"id" gorm:"primaryKey"` AppID string `json:"app_id"` ProductId int `json:"product_id"` UserProductId int `json:"user_product_id"` Before int `json:"before"` After int `json:"after"` TradeMoney int `json:"tarde_money"` BuyType int `json:"buy_type"` HistoryUnitPrice int `json:"history_unit_price"` CreateAt time.Time `json:"-" gorm:"autoCreateTime"` } func (p *UserBuyRecord) TableName() string { return "user_buy_record" }