mirror of
https://github.com/Buriburizaem0n/nezha_domains.git
synced 2026-02-04 04:30:05 +00:00
⬆️ dashboard v0.12.26 update gorm fields tags
This commit is contained in:
@@ -1,13 +1,15 @@
|
||||
package model
|
||||
|
||||
import "time"
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
const CtxKeyAuthorizedUser = "ckau"
|
||||
|
||||
const CacheKeyOauth2State = "p:a:state"
|
||||
|
||||
type Common struct {
|
||||
ID uint64 `gorm:"primary_key"`
|
||||
ID uint64 `gorm:"primaryKey"`
|
||||
CreatedAt time.Time `sql:"index"`
|
||||
UpdatedAt time.Time
|
||||
DeletedAt *time.Time `sql:"index"`
|
||||
|
||||
@@ -11,15 +11,15 @@ import (
|
||||
|
||||
type User struct {
|
||||
Common
|
||||
Login string `gorm:"UNIQUE_INDEX" json:"login,omitempty"` // 登录名
|
||||
AvatarURL string `json:"avatar_url,omitempty"` // 头像地址
|
||||
Name string `json:"name,omitempty"` // 昵称
|
||||
Blog string `json:"blog,omitempty"` // 网站链接
|
||||
Email string `json:"email,omitempty"` // 邮箱
|
||||
Login string `gorm:"uniqueIndex" json:"login,omitempty"` // 登录名
|
||||
AvatarURL string `json:"avatar_url,omitempty"` // 头像地址
|
||||
Name string `json:"name,omitempty"` // 昵称
|
||||
Blog string `json:"blog,omitempty"` // 网站链接
|
||||
Email string `json:"email,omitempty"` // 邮箱
|
||||
Hireable bool `json:"hireable,omitempty"`
|
||||
Bio string `json:"bio,omitempty"` // 个人简介
|
||||
|
||||
Token string `gorm:"UNIQUE_INDEX" json:"-"` // 认证 Token
|
||||
Token string `gorm:"uniqueIndex" json:"-"` // 认证 Token
|
||||
TokenExpired time.Time `json:"token_expired,omitempty"` // Token 过期时间
|
||||
SuperAdmin bool `json:"super_admin,omitempty"` // 超级管理员
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user