mirror of
https://github.com/simon-ding/polaris.git
synced 2026-03-05 17:10:49 +08:00
31 lines
616 B
Go
31 lines
616 B
Go
package schema
|
|
|
|
import (
|
|
"entgo.io/ent"
|
|
"entgo.io/ent/schema/field"
|
|
)
|
|
|
|
// Blacklist holds the schema definition for the Blacklist entity.
|
|
type Blacklist struct {
|
|
ent.Schema
|
|
}
|
|
|
|
// Fields of the Blacklist.
|
|
func (Blacklist) Fields() []ent.Field {
|
|
return []ent.Field{
|
|
field.Enum("type").Values("media", "torrent"),
|
|
field.JSON("value", BlacklistValue{}).Default(BlacklistValue{}),
|
|
field.String("notes").Optional(),
|
|
}
|
|
}
|
|
|
|
// Edges of the Blacklist.
|
|
func (Blacklist) Edges() []ent.Edge {
|
|
return nil
|
|
}
|
|
|
|
type BlacklistValue struct {
|
|
TmdbID int `json:"tmdb_id"`
|
|
TorrentHash string `json:"torrent_hash"`
|
|
}
|