dto

package
v0.0.0-...-358e048 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2022 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 AuthorResponse

type AuthorResponse struct {
	ID        string    `json:"id"`
	Name      string    `json:"name,omitempty"`
	Bio       string    `json:"bio,omitempty"`
	CreatedAt time.Time `json:"createdAt,omitempty"`
	UpdatedAt time.Time `json:"updatedAt,omitempty"`
}

type CreateAuthorDto

type CreateAuthorDto struct {
	ID       uuid.UUID `json:"id" validate:"required"`
	Name     string    `json:"name" validate:"required,gte=0,lte=255"`
	Bio      string    `json:"bio" validate:"required,gte=0,lte=5000"`
	Birthday time.Time `json:"birthday" validate:"required" time_format:"2006-01-02" time_utc:"1"`
}

type CreateAuthorResponseDto

type CreateAuthorResponseDto struct {
	ID uuid.UUID `json:"id" validate:"required"`
}

type CreateProductDto

type CreateProductDto struct {
	ProductID   uuid.UUID `json:"productId" validate:"required"`
	Name        string    `json:"name" validate:"required,gte=0,lte=255"`
	Description string    `json:"description" validate:"required,gte=0,lte=5000"`
	Price       float64   `json:"price" validate:"required,gte=0"`
}

type CreateProductResponseDto

type CreateProductResponseDto struct {
	ProductID uuid.UUID `json:"productId" validate:"required"`
}

type ProductResponse

type ProductResponse struct {
	ProductID   string    `json:"productId"`
	Name        string    `json:"name,omitempty"`
	Description string    `json:"description,omitempty"`
	Price       float64   `json:"price,omitempty"`
	CreatedAt   time.Time `json:"createdAt,omitempty"`
	UpdatedAt   time.Time `json:"updatedAt,omitempty"`
}

func ProductResponseFromGrpc

func ProductResponseFromGrpc(product *readerService.Product) *ProductResponse

type ProductsListResponse

type ProductsListResponse struct {
	TotalCount int64              `json:"totalCount" bson:"totalCount"`
	TotalPages int64              `json:"totalPages" bson:"totalPages"`
	Page       int64              `json:"page" bson:"page"`
	Size       int64              `json:"size" bson:"size"`
	HasMore    bool               `json:"hasMore" bson:"hasMore"`
	Products   []*ProductResponse `json:"products" bson:"products"`
}

func ProductsListResponseFromGrpc

func ProductsListResponseFromGrpc(listResponse *readerService.SearchRes) *ProductsListResponse

type UpdateProductDto

type UpdateProductDto struct {
	ProductID   uuid.UUID `json:"productId" validate:"required,gte=0,lte=255"`
	Name        string    `json:"name" validate:"required,gte=0,lte=255"`
	Description string    `json:"description" validate:"required,gte=0,lte=5000"`
	Price       float64   `json:"price" validate:"required,gte=0"`
}

Jump to

Keyboard shortcuts

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