Files
SaveAny-Bot/database/model.go
Ryan 62e4a08e28 Merge pull request #204 from Rain-kl/feat/save-strategy
新增功能: 重名文件时选择保存策略 - 重命名,覆盖,跳过
2026-05-20 16:11:00 +08:00

44 lines
731 B
Go

package database
import (
"gorm.io/gorm"
)
type User struct {
gorm.Model
ChatID int64 `gorm:"uniqueIndex;not null"`
Silent bool
DefaultStorage string
DefaultDir uint // Dir.ID
Dirs []Dir
ApplyRule bool
Rules []Rule
WatchChats []WatchChat
FilenameStrategy string
FilenameTemplate string
ConflictStrategy string
}
type WatchChat struct {
gorm.Model
UserID uint // User's database ID (not chat ID)
ChatID int64
Filter string
}
type Dir struct {
gorm.Model
UserID uint
StorageName string
Path string
}
type Rule struct {
gorm.Model
UserID uint
Type string
Data string
StorageName string
DirPath string
}