Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddNewCarInput ¶
type AddNewCarInput struct {
RegNumber []string `json:"regNumber"`
}
type AddNewCarResponse ¶
type CarHandler ¶
type CarHandler struct {
// contains filtered or unexported fields
}
func NewCarHandler ¶
func NewCarHandler(carInfoService carInfoService, carService carService, ownerService ownerService) *CarHandler
func (*CarHandler) AddNewCar ¶
func (h *CarHandler) AddNewCar(log *slog.Logger) http.HandlerFunc
AddNewCar @Summary Add new cars @Tags cars @Description Add new cars by registration numbers @ID add-new-cars @Accept json @Produce json @Param input body AddNewCarInput true "registration numbers" @Success 200 {object} AddNewCarResponse @Failure 400 {object} response.Response @Failure 500 {object} response.Response @Router /cars [post]
func (*CarHandler) DeleteCar ¶
func (h *CarHandler) DeleteCar(log *slog.Logger) http.HandlerFunc
DeleteCar @Summary Delete car @Tags cars @Description Delete car by registration number @ID delete-car @Accept json @Produce json @Param regNumber path string true "registration number" @Success 200 {object} response.Response @Failure 400 {object} response.Response @Failure 500 {object} response.Response @Router /cars/{regNumber} [delete]
func (*CarHandler) GetCars ¶
func (h *CarHandler) GetCars(log *slog.Logger) http.HandlerFunc
GetCars @Summary Get cars @Tags cars @Description Get cars with filtration or pagination @ID get-cars @Accept json @Produce json @Param limit query int false "limit" @Param offset query int false "offset" @Param mark query string false "car mark" @Param ownerName query string false "car owner name" @Param ownerSurname query string false "car owner surname" @Param model query string false "car model" @Param year query int false "car year" @Success 200 {object} GetCarsResponse @Failure 400 {object} response.Response @Failure 500 {object} response.Response @Router /cars [get]
func (*CarHandler) UpdateCar ¶
func (h *CarHandler) UpdateCar(log *slog.Logger) http.HandlerFunc
UpdateCar @Summary Update car @Tags cars @Description Update car by registration number @ID update-car @Accept json @Produce json @Param regNumber path string true "registration number" @Param input body UpdateCarInput true "car info" @Success 200 {object} response.Response @Failure 400 {object} response.Response @Failure 500 {object} response.Response @Router /cars/{regNumber} [put]