package models import ( "bytes" "log/slog" "time" appbsky "github.com/bluesky-social/indigo/api/bsky" "github.com/bluesky-social/indigo/atproto/syntax" ) type GraphListblock struct { ID string `gorm:"primaryKey"` CreatedAt string Subject string AutoCreatedAt time.Time `gorm:"autoCreateTime"` AutoUpdatedAt time.Time `gorm:"autoUpdateTime"` } func NewGraphListblock(uri syntax.ATURI, rec []byte) *GraphListblock { var out appbsky.GraphListblock if err := out.UnmarshalCBOR(bytes.NewReader(rec)); err != nil { slog.Error("could not unmarshal graph listblock CBOR", "err", err) return nil } return &GraphListblock{ ID: string(uri), CreatedAt: out.CreatedAt, Subject: out.Subject, } }