user.go 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. package model
  2. import "time"
  3. /* code 结构体 */
  4. type CodeData struct {
  5. Code string `form:"code" binding:"required"`
  6. Gid string `form:"gid" binding:"required"`
  7. Pf string `form:"pf" binding:"required"`
  8. Secret string `form:"secret"`
  9. }
  10. type Users struct {
  11. ID int `json:"id" gorm:"not null;"`
  12. OpenId string `json:"openId" gorm:"not null;column:openId;"`
  13. Pf string `json:"pf" gorm:"not null;"`
  14. UserId int `json:"userId" gorm:"not null;column:userId;"`
  15. CreatedAt time.Time `json:"createdAt" gorm:"column:createdAt;"`
  16. UpdatedAt time.Time `json:"updatedAt" gorm:"column:updatedAt;"`
  17. }
  18. type User struct {
  19. ID int `json:"id" gorm:"not null;"`
  20. Pf string `json:"pf" gorm:"not null;"`
  21. Gid string `json:"gid" gorm:"not null;"`
  22. UserId int `json:"userId" gorm:"not null;column:userId;"`
  23. CreatedAt time.Time `json:"createdAt" gorm:"column:createdAt;"`
  24. }
  25. type UserLogin struct {
  26. ID int `json:"id" gorm:"not null;"`
  27. Pf string `json:"pf" gorm:"not null;"`
  28. Gid string `json:"gid" gorm:"not null;"`
  29. UserId int `json:"userId" gorm:"not null;column:userId;"`
  30. LoginTime time.Time `json:"loginTime" gorm:"column:loginTime;"`
  31. }
  32. type UserOnline struct {
  33. ID int `json:"id" gorm:"not null;"`
  34. Pf string `json:"pf" gorm:"not null;"`
  35. Gid string `json:"gid" gorm:"not null;"`
  36. Type int `json:"type" gorm:"not null;"`
  37. UserId int `json:"userId" gorm:"not null;column:userId;"`
  38. LogTime time.Time `json:"logTime" gorm:"column:logTime;"`
  39. }