api rpc third

This commit is contained in:
withchao
2023-03-03 17:20:36 +08:00
parent 6150419842
commit e93425c574
25 changed files with 1412 additions and 1066 deletions
@@ -0,0 +1,27 @@
package relation
import (
"context"
"time"
)
const (
ObjectInfoModelTableName = "object_info"
)
type ObjectInfoModel struct {
Name string `gorm:"column:name;primary_key"`
Hash string `gorm:"column:hash"`
ExpirationTime *time.Time `gorm:"column:expiration_time"`
CreateTime time.Time `gorm:"column:create_time"`
}
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)
}