model

package
v0.0.0-...-be294a2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 8, 2021 License: MIT Imports: 6 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Migration

func Migration()

Migration - core models

Types

type Episode

type Episode struct {
	config.Base
	Title           string         `gorm:"column:title" json:"title"`
	Slug            string         `gorm:"column:slug" json:"slug"`
	Season          int            `gorm:"column:season" json:"season"`
	Episode         int            `gorm:"column:episode" json:"episode"`
	AudioURL        string         `gorm:"column:audio_url" json:"audio_url"`
	PodcastID       *uint          `gorm:"column:podcast_id" json:"podcast_id"`
	Podcast         *Podcast       `json:"podcast"`
	Description     postgres.Jsonb `gorm:"column:description" json:"description" swaggertype:"primitive,string"`
	HTMLDescription string         `gorm:"column:html_description" json:"html_description,omitempty"`
	PublishedDate   *time.Time     `gorm:"column:published_date" json:"published_date" sql:"DEFAULT:NULL"`
	MediumID        *uint          `gorm:"column:medium_id;default:NULL" json:"medium_id"`
	Medium          *model.Medium  `json:"medium"`
	MetaFields      postgres.Jsonb `gorm:"column:meta_fields" json:"meta_fields" swaggertype:"primitive,string"`
	SpaceID         uint           `gorm:"column:space_id" json:"space_id"`
	Space           *model.Space   `json:"space,omitempty"`
}

Episode model

func (*Episode) BeforeCreate

func (episode *Episode) BeforeCreate(tx *gorm.DB) error

BeforeCreate hook

func (*Episode) BeforeSave

func (episode *Episode) BeforeSave(tx *gorm.DB) (e error)

BeforeSave - validation for medium & podcast

type EpisodeAuthor

type EpisodeAuthor struct {
	config.Base
	AuthorID  uint `gorm:"column:author_id" json:"author_id"`
	EpisodeID uint `gorm:"column:episode_id" json:"episode_id"`
}

EpisodeAuthor model

type Podcast

type Podcast struct {
	config.Base
	Title             string           `gorm:"column:title" json:"title"`
	Slug              string           `gorm:"column:slug" json:"slug"`
	Description       postgres.Jsonb   `gorm:"column:description" json:"description" swaggertype:"primitive,string"`
	HTMLDescription   string           `gorm:"column:html_description" json:"html_description,omitempty"`
	Language          string           `gorm:"column:language" json:"language"`
	Categories        []model.Category `gorm:"many2many:podcast_categories;" json:"categories"`
	PrimaryCategoryID *uint            `gorm:"column:primary_category_id;default:NULL" json:"primary_category_id" sql:"DEFAULT:NULL"`
	PrimaryCategory   *model.Category  `gorm:"foreignKey:primary_category_id" json:"primary_category"`
	MediumID          *uint            `gorm:"column:medium_id;default:NULL" json:"medium_id"`
	Medium            *model.Medium    `json:"medium"`
	HeaderCode        string           `gorm:"column:header_code" json:"header_code"`
	FooterCode        string           `gorm:"column:footer_code" json:"footer_code"`
	MetaFields        postgres.Jsonb   `gorm:"column:meta_fields" json:"meta_fields" swaggertype:"primitive,string"`
	SpaceID           uint             `gorm:"column:space_id" json:"space_id"`
	Space             *model.Space     `json:"space,omitempty"`
}

Podcast model

func (*Podcast) BeforeCreate

func (podcast *Podcast) BeforeCreate(tx *gorm.DB) error

BeforeCreate hook

func (*Podcast) BeforeSave

func (podcast *Podcast) BeforeSave(tx *gorm.DB) (e error)

BeforeSave - validation for medium

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL