dbmodels

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Book

type Book struct {
	Id              uuid.UUID      `gorm:"column:id;primaryKey;type:uuid" json:"id"`
	Name            string         `gorm:"column:name" json:"name"`
	Author          string         `gorm:"column:author" json:"author"`
	Pages           int            `gorm:"column:pages" json:"pages"`
	Isbn            string         `gorm:"column:isbn" json:"isbn"`
	PublicationDate time.Time      `gorm:"column:publication_date" json:"publicationDate"`
	CreatedAt       time.Time      `gorm:"column:created_at" json:"createdAt"`
	UpdatedAt       time.Time      `gorm:"column:updated_at" json:"updatedAt"`
	DeletedAt       gorm.DeletedAt `gorm:"column:deleted_at" json:"deletedAt"`

	BookFormats []BookFormat `json:"bookFormats,omitempty"`
}

func (Book) TableName

func (Book) TableName() string

type BookFormat

type BookFormat struct {
	Id         uuid.UUID      `gorm:"column:id;primaryKey;type:uuid" json:"id"`
	BookId     uuid.UUID      `gorm:"column:book_id;type:uuid" json:"bookId"`
	FormatId   uuid.UUID      `gorm:"column:format_id;type:uuid" json:"formatId"`
	ProviderId uuid.UUID      `gorm:"column:provider_id;type:uuid" json:"providerId"`
	CreatedAt  time.Time      `gorm:"column:created_at" json:"createdAt"`
	UpdatedAt  time.Time      `gorm:"column:updated_at" json:"updatedAt"`
	DeletedAt  gorm.DeletedAt `gorm:"column:deleted_at" json:"deletedAt"`

	Book     Book     `gorm:"foreignKey:BookId" json:"book,omitempty"`
	Format   Format   `gorm:"foreignKey:FormatId" json:"format,omitempty"`
	Provider Provider `gorm:"foreignKey:ProviderId" json:"provider,omitempty"`

	BookPages []BookPage `json:"bookPages,omitempty"`
}

func (BookFormat) TableName

func (BookFormat) TableName() string

type BookPage

type BookPage struct {
	Id           uuid.UUID      `gorm:"column:id;primaryKey;type:uuid" json:"id"`
	Content      string         `gorm:"column:content" json:"content"`
	PageNumber   int            `gorm:"column:page_number" json:"pageNumber"`
	BookFormatId uuid.UUID      `gorm:"column:book_format_id;type:uuid" json:"bookFormatId"`
	CreatedAt    time.Time      `gorm:"column:created_at" json:"createdAt"`
	UpdatedAt    time.Time      `gorm:"column:updated_at" json:"updatedAt"`
	DeletedAt    gorm.DeletedAt `gorm:"column:deleted_at" json:"deletedAt"`

	BookFormat BookFormat `gorm:"foreignKey:BookFormatId" json:"bookFormat,omitempty"`
}

func (BookPage) TableName

func (BookPage) TableName() string

type Format

type Format struct {
	Id        uuid.UUID      `gorm:"column:id;primaryKey;type:uuid" json:"id"`
	Name      string         `gorm:"column:name" json:"name"`
	CreatedAt time.Time      `gorm:"column:created_at" json:"createdAt"`
	UpdatedAt time.Time      `gorm:"column:updated_at" json:"updatedAt"`
	DeletedAt gorm.DeletedAt `gorm:"column:deleted_at" json:"deletedAt"`

	BookFormats []BookFormat `json:"bookFormats,omitempty"`
}

func (Format) TableName

func (Format) TableName() string

type Provider

type Provider struct {
	Id        uuid.UUID      `gorm:"column:id;primaryKey;type:uuid" json:"id"`
	Name      string         `gorm:"column:name" json:"name"`
	Email     string         `gorm:"column:email" json:"email"`
	CreatedAt time.Time      `gorm:"column:created_at" json:"createdAt"`
	UpdatedAt time.Time      `gorm:"column:updated_at" json:"updatedAt"`
	DeletedAt gorm.DeletedAt `gorm:"column:deleted_at" json:"deletedAt"`

	BookFormats []BookFormat `json:"bookFormats,omitempty"`
}

func (Provider) TableName

func (Provider) TableName() string

Jump to

Keyboard shortcuts

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