book_repository_v1

package
v0.0.0-...-bee458a Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(db *gorm.DB, rdsPool *redis.Pool) irepository.BookRepository

Types

type Book

type Book struct {
	Id           int        `gorm:"primary_key;column:id"`
	Title        string     `gorm:"column:title"`
	ReleasedYear int        `gorm:"column:released_year"`
	CreatedAt    *time.Time `gorm:"column:created_at"`
	UpdatedAt    *time.Time `gorm:"column:updated_at"`
}

func (Book) FromBookEntity

func (Book) FromBookEntity(e *entity.Book) *Book

func (*Book) ToBookEntity

func (b *Book) ToBookEntity(rating float64) *entity.Book

type BookWithRating

type BookWithRating struct {
	Book
	Rating float64 `gorm:"column:rating"`
}

func (*BookWithRating) ToBookEntity

func (b *BookWithRating) ToBookEntity() *entity.Book

Jump to

Keyboard shortcuts

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