Files
open-im-server/pkg/common/db/table/relation/object_info.go
T

30 lines
750 B
Go
Raw Normal View History

2023-03-03 17:20:36 +08:00
package relation
import (
"context"
"time"
)
const (
ObjectInfoModelTableName = "object_info"
)
type ObjectInfoModel struct {
2023-03-29 10:15:21 +08:00
Name string `gorm:"column:name;primary_key"`
Hash string `gorm:"column:hash"`
ContentType string `gorm:"column:content_type"`
ValidTime *time.Time `gorm:"column:valid_time"`
CreateTime time.Time `gorm:"column:create_time"`
2023-03-03 17:20:36 +08:00
}
func (ObjectInfoModel) TableName() string {
return ObjectInfoModelTableName
}
type ObjectInfoModelInterface interface {
NewTx(tx any) ObjectInfoModelInterface
SetObject(ctx context.Context, obj *ObjectInfoModel) error
Take(ctx context.Context, name string) (*ObjectInfoModel, error)
2023-03-06 16:40:57 +08:00
DeleteExpiration(ctx context.Context, expiration time.Time) error
2023-03-03 17:20:36 +08:00
}