Files

32 lines
926 B
Go
Raw Permalink Normal View History

2026-07-03 16:01:08 +08:00
package model
import "time"
// App 开放平台应用
type App struct {
2026-07-18 10:52:32 +08:00
ID uint64 `json:"id" gorm:"primaryKey"`
2026-07-03 16:01:08 +08:00
AppID string `json:"app_id" gorm:"uniqueIndex;size:64;not null"`
AppSecret string `json:"-" gorm:"size:128;not null"`
AppName string `json:"app_name" gorm:"size:128;not null"`
Status int8 `json:"status" gorm:"default:1"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
func (App) TableName() string {
return "fs_app"
}
// AppUser 应用授权用户
// 只有绑定的用户才能通过该应用进行SSO登录
type AppUser struct {
2026-07-18 10:52:32 +08:00
ID uint64 `json:"id" gorm:"primaryKey"`
2026-07-03 16:01:08 +08:00
AppID uint64 `json:"app_id" gorm:"index;not null"` // 应用ID
UserID uint64 `json:"user_id" gorm:"index;not null"` // 用户ID
CreatedAt time.Time `json:"created_at"`
}
func (AppUser) TableName() string {
return "fs_app_user"
}