mirror of
https://github.com/lejianwen/rustdesk-api.git
synced 2026-02-23 21:00:46 +00:00
add oauth loginlog & fix bugs
This commit is contained in:
23
model/loginLog.go
Normal file
23
model/loginLog.go
Normal file
@@ -0,0 +1,23 @@
|
||||
package model
|
||||
|
||||
type LoginLog struct {
|
||||
IdModel
|
||||
UserId uint `json:"user_id"`
|
||||
Client string `json:"client"` //webadmin,webclient,app,
|
||||
Uuid string `json:"uuid"`
|
||||
Ip string `json:"ip"`
|
||||
Type string `json:"type"` //account,oauth
|
||||
Platform string `json:"platform"` //windows,linux,mac,android,ios
|
||||
|
||||
TimeModel
|
||||
}
|
||||
|
||||
const (
|
||||
LoginLogTypeAccount = "account"
|
||||
LoginLogTypeOauth = "oauth"
|
||||
)
|
||||
|
||||
type LoginLogList struct {
|
||||
LoginLogs []*LoginLog `json:"list"`
|
||||
Pagination
|
||||
}
|
||||
22
model/oauth.go
Normal file
22
model/oauth.go
Normal file
@@ -0,0 +1,22 @@
|
||||
package model
|
||||
|
||||
type Oauth struct {
|
||||
IdModel
|
||||
Op string `json:"op"`
|
||||
ClientId string `json:"client_id"`
|
||||
ClientSecret string `json:"client_secret"`
|
||||
RedirectUrl string `json:"redirect_url"`
|
||||
AutoRegister *bool `json:"auto_register"`
|
||||
TimeModel
|
||||
}
|
||||
|
||||
const (
|
||||
OauthTypeGithub = "github"
|
||||
OauthTypeGoogle = "google"
|
||||
OauthTypeWebauth = "webauth"
|
||||
)
|
||||
|
||||
type OauthList struct {
|
||||
Oauths []*Oauth `json:"list"`
|
||||
Pagination
|
||||
}
|
||||
12
model/userThird.go
Normal file
12
model/userThird.go
Normal file
@@ -0,0 +1,12 @@
|
||||
package model
|
||||
|
||||
type UserThird struct {
|
||||
IdModel
|
||||
UserId uint `json:"user_id" gorm:"not null;index"`
|
||||
OpenId string `json:"open_id" gorm:"not null;index"`
|
||||
UnionId string `json:"union_id" gorm:"not null;"`
|
||||
ThirdType string `json:"third_type" gorm:"not null;"`
|
||||
ThirdEmail string `json:"third_email"`
|
||||
ThirdName string `json:"third_name"`
|
||||
TimeModel
|
||||
}
|
||||
Reference in New Issue
Block a user