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

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

package models
import "time"
type TokenSalt struct {
Username string `json:"username" parse:"json"`
Typ *string `json:"typ" parse:"json"`
}
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"`
// 登录方随机生成的salt非用户salt
Salt *string `json:"salt" parse:"json"`
Code *string `json:"code" parse:"json"`
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"`
Device *string `json:"device" parse:"json"`
}
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"`
}