首次提交:初始化项目代码

This commit is contained in:
sunct
2026-07-31 15:24:14 +08:00
commit 8d3c97bd01
73 changed files with 11720 additions and 0 deletions
@@ -0,0 +1,36 @@
package entity
import (
"time"
"gorm.io/gorm"
)
type DeletedFile struct {
ID uint `json:"id" gorm:"primaryKey;comment:删除记录ID"`
UserID uint `json:"user_id" gorm:"comment:用户ID"`
UserCode string `json:"user_code" gorm:"index;size:8;comment:用户码"`
FileKey string `json:"file_key" gorm:"size:500;comment:文件存储键"`
FileName string `json:"file_name" gorm:"size:255;comment:文件名"`
Size int64 `json:"size" gorm:"comment:文件大小(字节)"`
DeletedAt time.Time `json:"deleted_at" gorm:"comment:删除时间"`
RemovedAt gorm.DeletedAt `json:"-" gorm:"comment:物理删除时间"`
}
func (DeletedFile) TableName() string {
return "deleted_files"
}
func (DeletedFile) TableComment() string {
return "回收站文件表"
}
func NewDeletedFile(userID uint, userCode, fileKey, fileName string, size int64) *DeletedFile {
return &DeletedFile{
UserID: userID,
UserCode: userCode,
FileKey: fileKey,
FileName: fileName,
Size: size,
}
}