dto

package
v1.6.7 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2021 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 ChgBookDto

type ChgBookDto struct {
	ID         uint   `validate:"required" json:"id"`
	Title      string `validate:"required,gte=3,lt=50" json:"title"`
	Isbn       string `validate:"required,gte=10,lt=20" json:"isbn"`
	CategoryID uint   `json:"categoryId"`
	FormatID   uint   `json:"formatId"`
}

ChgBookDto defines a data transfer object for changes or updates.

func NewChgBookDto

func NewChgBookDto() *ChgBookDto

NewChgBookDto is constructor.

func (*ChgBookDto) ToString

func (b *ChgBookDto) ToString() (string, error)

ToString is return string of object

func (*ChgBookDto) Validate

func (b *ChgBookDto) Validate() map[string]string

Validate performs validation check for the each item.

type RegBookDto

type RegBookDto struct {
	Title      string `validate:"required,min=3,max=50" json:"title"`
	Isbn       string `validate:"required,min=10,max=20" json:"isbn"`
	CategoryID uint   `json:"categoryId"`
	FormatID   uint   `json:"formatId"`
}

RegBookDto defines a data transfer object for register.

func NewRegBookDto

func NewRegBookDto() *RegBookDto

NewRegBookDto is constructor.

func (*RegBookDto) Create

func (b *RegBookDto) Create() *model.Book

Create creates a book model from this DTO.

func (*RegBookDto) ToString

func (b *RegBookDto) ToString() (string, error)

ToString is return string of object

func (*RegBookDto) Validate

func (b *RegBookDto) Validate() map[string]string

Validate performs validation check for the each item.

Jump to

Keyboard shortcuts

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