loginLog.go 718 B

123456789101112131415161718192021222324252627282930
  1. package model
  2. type LoginLog struct {
  3. IdModel
  4. UserId uint `json:"user_id" gorm:"default:0;not null;"`
  5. Client string `json:"client"` //webadmin,webclient,app,
  6. Uuid string `json:"uuid"`
  7. Ip string `json:"ip"`
  8. Type string `json:"type"` //account,oauth
  9. Platform string `json:"platform"` //windows,linux,mac,android,ios
  10. UserTokenId uint `json:"user_token_id" gorm:"default:0;not null;"`
  11. TimeModel
  12. }
  13. const (
  14. LoginLogClientWebAdmin = "webadmin"
  15. LoginLogClientWeb = "webclient"
  16. LoginLogClientApp = "app"
  17. )
  18. const (
  19. LoginLogTypeAccount = "account"
  20. LoginLogTypeOauth = "oauth"
  21. )
  22. type LoginLogList struct {
  23. LoginLogs []*LoginLog `json:"list"`
  24. Pagination
  25. }