初始化

This commit is contained in:
2026-07-03 16:01:08 +08:00
parent dc90e889e1
commit b51ee98afa
37 changed files with 6282 additions and 0 deletions

31
server/model/app.go Normal file
View File

@@ -0,0 +1,31 @@
package model
import "time"
// App 开放平台应用
type App struct {
ID uint64 `json:"id" gorm:"primaryKey;autoIncrement"`
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 {
ID uint64 `json:"id" gorm:"primaryKey;autoIncrement"`
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"
}