model

package
v0.0.0-...-3423bc7 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2021 License: MIT Imports: 2 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 {
	gorm.Model
	Title         string
	Author        string
	PublishedDate time.Time
	ImageURL      string `gorm:"column:image_url"`
	Description   string
	CreatedAt     time.Time
}

Book - represents books table

func (Book) ToDto

func (b Book) ToDto() *BookDto

ToDto - Converts Book database model to BooksDto http json response object

type BookDto

type BookDto struct {
	ID            uint   `json:"id"`
	Title         string `json:"title"`
	Author        string `json:"author"`
	PublishedDate string `json:"published_date"`
	ImageURL      string `json:"image_url"`
	Description   string `json:"description"`
}

BookDto - represents Book http response json

type BookDtos

type BookDtos []*BookDto

BookDtos - array of BookDto

type Books

type Books []*Book

Books - array of Book

func (Books) ToDto

func (bs Books) ToDto() BookDtos

ToDto - Converts Books objects to BookDtos http json response object

Jump to

Keyboard shortcuts

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