You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
OneAuth/oa/models/token.gen.go

44 lines
1.4 KiB
Go

2 months ago
package models
import "time"
type TokenSalt struct {
2 months ago
Username string `json:"username" parse:"json"`
Typ *string `json:"typ" parse:"json"`
2 months ago
}
2 months ago
type TokenPost struct {
UserID string `json:"user_id" gorm:"index;type:varchar(32)" parse:"json"`
// 两种获取token方式一种用refreshtoken换取apptoken(应用登录)一种用密码加密code换refreshtoken (oa登录)
Refresh *string `json:"refresh" parse:"json"`
2 months ago
// 登录方随机生成的salt非用户salt
Salt *string `json:"salt" parse:"json"`
Code *string `json:"code" parse:"json"`
2 months ago
AppID *string `json:"app_id" gorm:"index;type:varchar(32)" parse:"json"`
ExpiredAt *time.Time `json:"expired_at" parse:"json"`
OverPerm *string `json:"over_perm" parse:"json"`
2 months ago
Device *string `json:"device" parse:"json"`
2 months ago
}
2 months ago
type TokenGet struct {
ID string `json:"id" gorm:"primaryKey;type:varchar(32)" parse:"path@token_id"`
}
type TokenPatch struct {
ID string `json:"id" gorm:"primaryKey;type:varchar(32)" parse:"path@token_id"`
ExpiredAt *time.Time `json:"expired_at" parse:"json"`
OverPerm *string `json:"over_perm" parse:"json"`
}
type TokenDelete struct {
ID string `json:"id" gorm:"primaryKey;type:varchar(32)" parse:"path@token_id"`
}
type TokenList struct {
UserID string `json:"user_id" gorm:"index;type:varchar(32)" parse:"json"`
AppID string `json:"app_id" gorm:"index;type:varchar(32)" parse:"json"`
}