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

31 lines
846 B
Go
Raw Normal View History

2023-03-03 17:20:36 +08:00
package relation
import (
"context"
"time"
)
const (
ObjectHashModelTableName = "object_hash"
)
type ObjectHashModel struct {
Hash string `gorm:"column:hash;primary_key;size:32"`
Engine string `gorm:"column:engine;primary_key;size:16"`
Size int64 `gorm:"column:size"`
Bucket string `gorm:"column:bucket"`
Name string `gorm:"column:name"`
CreateTime time.Time `gorm:"column:create_time"`
}
func (ObjectHashModel) TableName() string {
return ObjectHashModelTableName
}
type ObjectHashModelInterface interface {
NewTx(tx any) ObjectHashModelInterface
Take(ctx context.Context, hash string, engine string) (*ObjectHashModel, error)
Create(ctx context.Context, h []*ObjectHashModel) error
2023-03-06 16:40:57 +08:00
DeleteNoCitation(ctx context.Context, engine string, num int) (list []*ObjectHashModel, err error)
2023-03-03 17:20:36 +08:00
}