Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetTimeSpans ¶
func GetTimeSpans(s Service) gin.HandlerFunc
Get all pbehavior timespans @Summary Get all pbehavior timespans @Description Get time spans of calendar event within view span; {by_date: false} adds exception spans with types, {by_date: true} merges adjacent spans if gap between sequential ones less than 24 hours @Tags pbehavior-timespans @ID pbehavior-timespans-get-all @Accept json @Produce json @Param body body TimespansRequest true "body" @Success 200 {array} timespansItemResponse @Failure 400 {object} common.ValidationErrorResponse @Router /pbehavior-timespans [post]
func ValidateExdateRequest ¶
func ValidateExdateRequest(sl validator.StructLevel)
func ValidateTimespansRequest ¶
func ValidateTimespansRequest(sl validator.StructLevel)
Types ¶
type ExdateRequest ¶
type Service ¶
type Service interface {
GetTimespans(request TimespansRequest) ([]timespansItemResponse, error)
}
func NewService ¶
func NewService(dbClient mongo.DbClient, timezoneConfigProvider config.TimezoneConfigProvider) Service
type TimespansRequest ¶
type TimespansRequest struct { StartAt types.CpsTime `json:"start_at" binding:"required" swaggertype:"integer"` EndAt *types.CpsTime `json:"end_at" swaggertype:"integer"` RRule string `json:"rrule"` Exdates []ExdateRequest `json:"exdates" binding:"dive"` Exceptions []string `json:"exceptions"` ViewFrom types.CpsTime `json:"view_from" binding:"required" swaggertype:"integer"` ViewTo types.CpsTime `json:"view_to" binding:"required" swaggertype:"integer"` ByDate bool `json:"by_date"` }
Click to show internal directories.
Click to hide internal directories.