oauth2.go 416 B

123456789101112131415161718
  1. package models
  2. import "time"
  3. // OT: Oauth2 Type
  4. const (
  5. OT_GITHUB = iota + 1
  6. OT_GOOGLE
  7. OT_TWITTER
  8. )
  9. type Oauth2 struct {
  10. Uid int64 `xorm:"pk"` // userId
  11. Type int `xorm:"pk unique(oauth)"` // twitter,github,google...
  12. Identity string `xorm:"pk unique(oauth)"` // id..
  13. Token string `xorm:"VARCHAR(200) not null"`
  14. RefreshTime time.Time `xorm:"created"`
  15. }