dto

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ItemBlog

type ItemBlog struct {
	ID          primitive.ObjectID `json:"_id" binding:"required" validate:"required"`
	Title       string             `json:"title" validate:"required,min=3,max=500"`
	Description string             `json:"description" validate:"required,min=3,max=2000"`
	Slug        string             `json:"slug" validate:"required,min=3,max=200"`
	ImgURL      *string            `json:"imgUrl,omitempty" validate:"omitempty,uri,max=200"`
	Score       float64            `json:"score," validate:"required,min=0,max=1"`
	Tags        []string           `json:"tags" validate:"required,dive,uppercase"`
}

func EmptyItemBlog

func EmptyItemBlog() *ItemBlog

func NewItemBlog

func NewItemBlog(blog *model.Blog) (*ItemBlog, error)

func (*ItemBlog) GetValue

func (d *ItemBlog) GetValue() *ItemBlog

func (*ItemBlog) ValidateErrors

func (b *ItemBlog) ValidateErrors(errs validator.ValidationErrors) ([]string, error)

type Tag

type Tag struct {
	Tag string `uri:"tag" validate:"required,uppercase"`
}

func EmptyTag

func EmptyTag() *Tag

func (*Tag) GetValue

func (d *Tag) GetValue() *Tag

func (*Tag) ValidateErrors

func (b *Tag) ValidateErrors(errs validator.ValidationErrors) ([]string, error)

Jump to

Keyboard shortcuts

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