orm

package
v0.0.0-...-80ac902 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Author

type Author struct {
	ID   uint   `gorm:"primary_key"`
	Name string `json:"name" gorm:"not null;unique_index"`
}

func (*Author) AfterFind

func (auth *Author) AfterFind(db *gorm.DB) error

type Book

type Book struct {
	ID          uint      `gorm:"primary_key"`
	Container   Container `json:"container" gorm:"foreignKey:ContainerID"`
	ContainerID uint      `json:"-"`
	Authors     []Author  `json:"authors" gorm:"many2many:book_authors;"`
	Genres      []Genre   `json:"genres"  gorm:"many2many:book_genres;"`
	Title       string    `json:"title" gorm:"index"`
	Series      string    `json:"series,omitempty"`
	SerNo       string    `json:"ser_no,omitempty"`
	File        string    `json:"file"`
	FileSize    string    `json:"file_size"`
	LibId       string    `json:"lib_id" gorm:"index"`
	Del         string    `json:"del"`
	Ext         string    `json:"ext"`
	Date        string    `json:"date"`
	Lang        string    `json:"lang"`
	Extra1      string    `json:"extra_1,omitempty"`
	Extra2      string    `json:"extra_2,omitempty"`
	Extra3      string    `json:"extra_3,omitempty"`
	Update      bool      `json:"-" gorm:"-"`
}

func (*Book) AfterFind

func (book *Book) AfterFind(db *gorm.DB) error

func (*Book) GetFullFilename

func (book *Book) GetFullFilename() string

type Container

type Container struct {
	ID       uint   `json:"-" gorm:"primary_key"`
	FileName string `json:"file_name" gorm:"not null;unique_index"`
}

type Genre

type Genre struct {
	ID        uint   `json:"-" gorm:"primary_key"`
	GenreCode string `json:"genre_code" gorm:"not null;unique_index"`
}
type Search struct {
	Title   string   `json:"title"`
	Author  string   `json:"author"`
	Series  string   `json:"series"`
	Limit   int      `json:"limit"`
	Deleted bool     `json:"deleted"`
	Langs   []string `json:"langs"`
}

Search data model

Jump to

Keyboard shortcuts

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