userfile.go 906 B

123456789101112131415161718192021
  1. package dao
  2. import "time"
  3. // UserFile 用户文件记录表
  4. type UserFile struct {
  5. ID int `gorm:"primary_key;type:int" json:"id"` //编号
  6. Operator int `gorm:"type:int" json:"operator"` //操作者id
  7. Receiver int `gorm:"type:int" json:"receiver"` //接收者id
  8. FileID int `gorm:"type:int" json:"fileid"` //文件id
  9. EffectiveDate *time.Time `gorm:"column:effectiveDate;type:datetime" json:"effectiveDate"` //阅读的有效日期
  10. OperationStatus string `gorm:"type:varchar(12)" json:"operationStatus"` //操作状态
  11. }
  12. func (*UserFile) TableName() string {
  13. return "user_file"
  14. }
  15. func (uf *UserFile) BatchUFRecords(userfile []UserFile) error {
  16. return Db.Model(&uf).Create(&userfile).Error
  17. }