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 (*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 (*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.
Click to show internal directories.
Click to hide internal directories.