Files
base/internal/repository/postgres/cache/model.go
2026-04-10 18:25:21 +03:30

31 lines
480 B
Go

package cache
import (
"time"
"gorm.io/datatypes"
)
type KVModel struct {
Key string `gorm:"primaryKey"`
Value datatypes.JSON
ExpiresAt *time.Time
CreatedAt time.Time
}
func (KVModel) TableName() string {
return "cache_kv"
}
type HashModel struct {
Key string `gorm:"primaryKey"`
Field string `gorm:"primaryKey"`
Value datatypes.JSON
CreatedAt time.Time
ExpiresAt *time.Time
}
func (HashModel) TableName() string {
return "cache_hash"
}