handler

package
v0.0.0-...-6771441 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateBooking

func CreateBooking(svc *Services) echo.HandlerFunc

@Summary Create a new booking @Description Creates a new booking for the given class and member name. @Tags Bookings @Accept json @Produce json @Param body body handler.CreateBookingRequest true "Request body" @Success 201 {object} response @Failure 400 {object} response @Failure 404 {object} response @Failure 409 {object} response @Failure 422 {object} response @Failure 500 {object} response @Router /bookings [post]

func CreateClass

func CreateClass(svc *Services) echo.HandlerFunc

@Summary Create a new class @Description Creates a new class with the given name, description, start date, end date, and capacity. @Tags Classes @Accept json @Produce json @Param body body handler.CreateClassRequest true "Request body" @Success 201 {object} response @Failure 400 {object} response @Failure 422 {object} response @Failure 500 {object} response @Router /classes [post]

func New

func New(svc *Services) (*echo.Echo, error)

Types

type CreateBookingRequest

type CreateBookingRequest struct {
	MemberName string `json:"memberName" validate:"required"`
	Date       string `json:"date" validate:"required"`
	ClassID    uint64 `json:"classId" validate:"required,number"`
}

type CreateClassRequest

type CreateClassRequest struct {
	Name      string `json:"name" validate:"required"`
	StartDate string `json:"startDate" validate:"required"`
	EndDate   string `json:"endDate" validate:"required"`
	Capacity  uint   `json:"capacity" validate:"required"`
}

type Services

type Services struct {
	Config *config.Config
	Repo   *repo.Repo
}

Jump to

Keyboard shortcuts

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