dto

package
v1.5.2 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2021 License: MIT Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BookDto added in v1.5.2

type BookDto 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"`
}

BookDto defines a data transfer object for book.

func NewBookDto added in v1.5.2

func NewBookDto() *BookDto

NewBookDto is constructor.

func (*BookDto) Create added in v1.5.2

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

Create creates a book model from this DTO.

func (*BookDto) ToString added in v1.5.2

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

ToString is return string of object

func (*BookDto) Validate added in v1.5.2

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

Validate performs validation check for the each item.

type LoginDto added in v1.5.2

type LoginDto struct {
	UserName string `json:"username"`
	Password string `json:"password"`
}

LoginDto defines a data transfer object for login.

func NewLoginDto added in v1.5.2

func NewLoginDto() *LoginDto

NewLoginDto is constructor.

func (*LoginDto) ToString added in v1.5.2

func (l *LoginDto) ToString() (string, error)

ToString is return string of object

Jump to

Keyboard shortcuts

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