pbehaviortimespan

package
v0.0.0-...-9b5cd94 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetTimeSpans

func GetTimeSpans(s Service) gin.HandlerFunc

GetTimeSpans @Param body body TimespansRequest true "body" @Success 200 {array} ItemResponse

func ValidateTimespansRequest

func ValidateTimespansRequest(sl validator.StructLevel)

Types

type ItemResponse

type ItemResponse struct {
	From datetime.CpsTime `json:"from" swaggertype:"integer"`
	To   datetime.CpsTime `json:"to" swaggertype:"integer"`
	Type pbehavior.Type   `json:"type"`
}

type Service

type Service interface {
	GetTimespans(ctx context.Context, request TimespansRequest) ([]ItemResponse, error)
}

func NewService

func NewService(dbClient mongo.DbClient, timezoneConfigProvider config.TimezoneConfigProvider) Service

type TimespansRequest

type TimespansRequest struct {
	StartAt datetime.CpsTime `json:"start_at" binding:"required" swaggertype:"integer"`
	EndAt   datetime.CpsTime `json:"end_at" swaggertype:"integer"`
	RRule   string           `json:"rrule"`
	Type    string           `json:"type" binding:"required"`

	Exdates    []pbehaviorexception.ExdateRequest `json:"exdates" binding:"dive"`
	Exceptions []string                           `json:"exceptions"`

	ViewFrom datetime.CpsTime `json:"view_from" binding:"required" swaggertype:"integer"`
	ViewTo   datetime.CpsTime `json:"view_to" binding:"required" swaggertype:"integer"`
}

Jump to

Keyboard shortcuts

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