req

package
v0.0.0-...-5789598 Latest Latest
Warning

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

Go to latest
Published: May 19, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FeatureCreateRequest

type FeatureCreateRequest struct {
	Icon         string                      `json:"icon" validate:"required,min=1,max=255"`
	Translations []FeatureTranslationRequest `json:"translations" validate:"min=1,max=3,dive,required"`
}

func (*FeatureCreateRequest) ToCommand

type FeatureDetailRequest

type FeatureDetailRequest struct {
	UUID string `param:"uuid" validate:"required,object_id"`
}

func (*FeatureDetailRequest) ToDeleteCommand

func (r *FeatureDetailRequest) ToDeleteCommand() command.FeatureDeleteCommand

func (*FeatureDetailRequest) ToDisableCommand

func (r *FeatureDetailRequest) ToDisableCommand() command.FeatureDisableCommand

func (*FeatureDetailRequest) ToEnableCommand

func (r *FeatureDetailRequest) ToEnableCommand() command.FeatureEnableCommand

func (*FeatureDetailRequest) ToQuery

type FeatureTranslationRequest

type FeatureTranslationRequest struct {
	Locale      string `json:"locale" validate:"required,min=1,max=255"`
	Title       string `json:"title" validate:"required,min=1,max=255"`
	Description string `json:"description" validate:"required,min=1,max=255"`
}

type FeatureUpdateRequest

type FeatureUpdateRequest struct {
	UUID         string
	Icon         string                      `json:"icon" validate:"required,min=1,max=255"`
	Translations []FeatureTranslationRequest `json:"translations" validate:"min=1,max=3,dive,required"`
}

func (*FeatureUpdateRequest) Load

func (*FeatureUpdateRequest) ToCommand

type PaginationRequest

type PaginationRequest struct {
	Page  *int64 `query:"page" validate:"omitempty,gt=0"`
	Limit *int64 `query:"limit" validate:"omitempty,gt=0"`
}

func (*PaginationRequest) Default

func (r *PaginationRequest) Default()

type PlaceCreateRequest

type PlaceCreateRequest struct {
	FeatureUUIDs []string                  `json:"featureUUIDs" validate:"required,min=1,max=10,dive,object_id"`
	Images       []PlaceImageRequest       `json:"images" validate:"required,min=1,max=10,dive,required"`
	Coordinates  []float64                 `json:"coordinates" validate:"required,min=2,max=2,dive,required"`
	TimeSpent    PlaceTimeSpentRequest     `json:"timeSpent" validate:"required,dive,required"`
	Translations []PlaceTranslationRequest `json:"translations" validate:"required,min=1,max=3,dive,required"`
	Restorations []PlaceRestorationRequest `json:"restorations" validate:"omitempty,min=0,max=100,dive,required"`
	IsPayed      *bool                     `json:"isPayed" validate:"required"`
	Type         string                    `` /* 174-byte string literal not displayed */
}

func (*PlaceCreateRequest) ToCommand

type PlaceDetailRequest

type PlaceDetailRequest struct {
	UUID string `param:"uuid" validate:"required,object_id"`
}

func (*PlaceDetailRequest) ToDeleteCommand

func (r *PlaceDetailRequest) ToDeleteCommand() command.PlaceDeleteCommand

func (*PlaceDetailRequest) ToDisableCommand

func (r *PlaceDetailRequest) ToDisableCommand() command.PlaceDisableCommand

func (*PlaceDetailRequest) ToEnableCommand

func (r *PlaceDetailRequest) ToEnableCommand() command.PlaceEnableCommand

func (*PlaceDetailRequest) ToQuery

type PlaceFilterRequest

type PlaceFilterRequest struct {
	Page            int64
	Limit           int64
	Query           string                       `json:"query,omitempty" validate:"omitempty,max=100"`
	Coordinates     []float64                    `json:"coordinates,omitempty" validate:"omitempty,min=2,max=2"`
	FeatureUUIDs    []string                     `json:"featureUUIDs,omitempty" validate:"omitempty,min=1,max=10,dive,object_id"`
	TimeSpent       *PlaceFilterTimeSpentRequest `json:"timeSpent,omitempty" validate:"omitempty,dive"`
	Distance        *float64                     `json:"distance,omitempty" validate:"omitempty,gt=6,lt=19"`
	IsPayed         *bool                        `json:"isPayed,omitempty" validate:"omitempty"`
	MinReview       *int16                       `json:"minReview,omitempty" validate:"omitempty,gt=0"`
	MaxReview       *int16                       `json:"maxReview,omitempty" validate:"omitempty,gt=0"`
	MinAveragePoint *float32                     `json:"minAveragePoint,omitempty" validate:"omitempty,gt=0"`
	MaxAveragePoint *float32                     `json:"maxAveragePoint,omitempty" validate:"omitempty,gt=0"`
	Type            []place.Type                 `json:"types,omitempty" validate:"omitempty,dive,required"`
	Sort            place.Sort                   `json:"sort,omitempty" validate:"omitempty,oneof=most_recent nearest"`
	Order           place.Order                  `json:"order,omitempty" validate:"omitempty,oneof=asc desc"`
}

func (*PlaceFilterRequest) LoadPagination

func (r *PlaceFilterRequest) LoadPagination(pagination *PaginationRequest) *PlaceFilterRequest

func (*PlaceFilterRequest) ToAdminQuery

func (r *PlaceFilterRequest) ToAdminQuery(locale string) query.PlaceAdminFilterQuery

func (*PlaceFilterRequest) ToQuery

func (r *PlaceFilterRequest) ToQuery(locale string) query.PlaceFilterQuery

type PlaceFilterTimeSpentRequest

type PlaceFilterTimeSpentRequest struct {
	Min int16 `json:"min" validate:"omitempty"`
	Max int16 `json:"max" validate:"omitempty"`
}

type PlaceImageRequest

type PlaceImageRequest struct {
	Url   string `json:"url" validate:"required,url"`
	Order *int16 `json:"order" validate:"required,min=0,max=200"`
}

type PlaceRestorationRequest

type PlaceRestorationRequest struct {
	StartDate string `json:"startDate" validate:"required,datetime=2006-01-02"`
	EndDate   string `json:"endDate" validate:"omitempty,datetime=2006-01-02"`
}

type PlaceTimeSpentRequest

type PlaceTimeSpentRequest struct {
	Min int16 `json:"min" validate:"required,min=0,max=2000"`
	Max int16 `json:"max" validate:"required,min=0,max=2000"`
}

func (*PlaceTimeSpentRequest) ToTimeSpent

func (r *PlaceTimeSpentRequest) ToTimeSpent() place.TimeSpent

type PlaceTranslationRequest

type PlaceTranslationRequest struct {
	Title       string                     `json:"title" validate:"required,min=1,max=255"`
	Description string                     `json:"description" validate:"required,min=1,max=255"`
	Locale      string                     `json:"locale" validate:"required,min=1,max=255"`
	Seo         PlaceTranslationSeoRequest `json:"seo" validate:"required,dive,required"`
}

type PlaceTranslationSeoRequest

type PlaceTranslationSeoRequest struct {
	Title       string `json:"title" validate:"required,min=1,max=255"`
	Description string `json:"description" validate:"required,min=1,max=255"`
	Keywords    string `json:"keywords" validate:"required,min=1,max=255"`
}

func (*PlaceTranslationSeoRequest) ToSeo

type PlaceUpdateRequest

type PlaceUpdateRequest struct {
	UUID         string
	FeatureUUIDs []string                  `json:"featureUUIDs" validate:"required,min=1,max=10,dive,object_id"`
	Images       []PlaceImageRequest       `json:"images" validate:"required,min=1,max=10,dive,required"`
	Coordinates  []float64                 `json:"coordinates" validate:"required,min=2,max=2,dive,required"`
	TimeSpent    PlaceTimeSpentRequest     `json:"timeSpent" validate:"required,dive,required"`
	Translations []PlaceTranslationRequest `json:"translations" validate:"required,min=1,max=3,dive,required"`
	Restorations []PlaceRestorationRequest `json:"restorations" validate:"omitempty,min=0,max=100,dive,required"`
	IsPayed      *bool                     `json:"isPayed" validate:"required"`
	Type         string                    `` /* 174-byte string literal not displayed */
}

func (*PlaceUpdateRequest) Load

func (*PlaceUpdateRequest) ToCommand

type PlaceViewRequest

type PlaceViewRequest struct {
	Slug string `param:"slug" validate:"required,slug"`
}

func (*PlaceViewRequest) ToQuery

func (r *PlaceViewRequest) ToQuery(locale string) query.PlaceViewQuery

type Request

type Request interface {
	FeatureDetail() *FeatureDetailRequest
	Pagination() *PaginationRequest
	FeatureCreate() *FeatureCreateRequest
	FeatureUpdate() *FeatureUpdateRequest
	PlaceDetail() *PlaceDetailRequest
	PlaceFilter() *PlaceFilterRequest
	PlaceCreate() *PlaceCreateRequest
	PlaceUpdate() *PlaceUpdateRequest
	PlaceView() *PlaceViewRequest
}

func New

func New() Request

Jump to

Keyboard shortcuts

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