多平台账号批量注册系统,支持 OpenAI / Grok / Kiro / Gemini 平台的全自动注册。 Features: - 用户名/密码注册登录(首个用户自动管理员) - JWT 认证 + bcrypt 密码加密 - 积分系统与多用户管理 - HuggingFace Space 弹性 Worker 节点管理 - Cloudflare Worker 负载均衡 - 实时日志推送(SSE/WebSocket) - 管理后台(用户管理、系统设置、代理池、卡池) Tech Stack: Go 1.25 / Gin / GORM / PostgreSQL / Vue 3 / Vite / TailwindCSS
22 lines
878 B
Go
22 lines
878 B
Go
package model
|
||
|
||
import "time"
|
||
|
||
// Notification 系统通知(UserID=0 表示广播)
|
||
type Notification struct {
|
||
ID uint `gorm:"primaryKey" json:"id"`
|
||
UserID uint `gorm:"not null;index" json:"user_id"` // 0 = 广播给所有用户
|
||
Title string `gorm:"size:200;not null" json:"title"`
|
||
Content string `gorm:"type:text;not null" json:"content"`
|
||
IsRead bool `gorm:"default:false;index" json:"is_read"` // 仅用于个人通知(user_id>0)
|
||
CreatedBy uint `json:"created_by"`
|
||
CreatedAt time.Time `gorm:"autoCreateTime;index" json:"created_at"`
|
||
}
|
||
|
||
// NotificationRead 广播通知的用户已读记录
|
||
type NotificationRead struct {
|
||
NotificationID uint `gorm:"primaryKey" json:"notification_id"`
|
||
UserID uint `gorm:"primaryKey" json:"user_id"`
|
||
ReadAt time.Time `gorm:"autoCreateTime" json:"read_at"`
|
||
}
|