Documentation ¶
Index ¶
- Variables
- func CreateVehicle(svc service.VehicleService) fiber.Handler
- func DeleteVehicle(svc service.VehicleService) fiber.Handler
- func GetAllVehicles(svc service.VehicleService) fiber.Handler
- func GetVehicleByID(svc service.VehicleService) fiber.Handler
- func GetVehicleByPlate(svc service.VehicleService) fiber.Handler
- func RegisterRoutes(r fiber.Router, svc service.VehicleService)
- func UpdateVehicle(svc service.VehicleService) fiber.Handler
Constants ¶
This section is empty.
Variables ¶
var ( TestVehicle = &entities.Vehicle{ ID: 1, CreatedAt: now, UpdatedAt: now, NumberPlate: "FL TBZ 123", Description: "Test description", Status: entities.VehicleStatusActive, Type: entities.VehicleTypeTrailer, } TestVehicles = []*entities.Vehicle{ TestVehicle, { ID: 2, CreatedAt: now, UpdatedAt: now, NumberPlate: "FL TBZ 3456", Description: "Test description", Status: entities.VehicleStatusNotAvailable, Type: entities.VehicleTypeTransporter, WaterCapacity: 1000.5, }, } TestVehicleRequest = &entities.VehicleCreate{ NumberPlate: "FL TBZ 123", Description: "Test description", Status: entities.VehicleStatusActive, Type: entities.VehicleTypeTrailer, WaterCapacity: 2000.5, } )
Functions ¶
func CreateVehicle ¶
func CreateVehicle(svc service.VehicleService) fiber.Handler
@Summary Create vehicle @Description Create vehicle @Id create-vehicle @Tags Vehicle @Produce json @Success 201 {object} entities.VehicleResponse @Failure 400 {object} HTTPError @Failure 401 {object} HTTPError @Failure 403 {object} HTTPError @Failure 404 {object} HTTPError @Failure 500 {object} HTTPError @Router /v1/vehicle [post] @Param body body entities.VehicleCreateRequest true "Vehicle Create Request" @Security Keycloak
func DeleteVehicle ¶
func DeleteVehicle(svc service.VehicleService) fiber.Handler
@Summary Delete vehicle @Description Delete vehicle @Id delete-vehicle @Tags Vehicle @Produce json @Success 204 @Failure 400 {object} HTTPError @Failure 401 {object} HTTPError @Failure 403 {object} HTTPError @Failure 404 {object} HTTPError @Failure 500 {object} HTTPError @Router /v1/vehicle/{id} [delete] @Param id path string true "Vehicle ID" @Security Keycloak
func GetAllVehicles ¶
func GetAllVehicles(svc service.VehicleService) fiber.Handler
@Summary Get all vehicles @Description Get all vehicles @Id get-all-vehicles @Tags Vehicle @Produce json @Success 200 {object} entities.VehicleListResponse @Failure 400 {object} HTTPError @Failure 401 {object} HTTPError @Failure 403 {object} HTTPError @Failure 404 {object} HTTPError @Failure 500 {object} HTTPError @Router /v1/vehicle [get] @Param page query string false "Page" @Param limit query string false "Limit" @Param status query string false "Status" @Security Keycloak
func GetVehicleByID ¶
func GetVehicleByID(svc service.VehicleService) fiber.Handler
@Summary Get vehicle by ID @Description Get vehicle by ID @Id get-vehicle-by-id @Tags Vehicle @Produce json @Success 200 {object} entities.VehicleResponse @Failure 400 {object} HTTPError @Failure 401 {object} HTTPError @Failure 403 {object} HTTPError @Failure 404 {object} HTTPError @Failure 500 {object} HTTPError @Router /v1/vehicle/{id} [get] @Param id path string true "Vehicle ID" @Security Keycloak
func GetVehicleByPlate ¶
func GetVehicleByPlate(svc service.VehicleService) fiber.Handler
@Summary Get vehicle by plate @Description Get vehicle by plate @Id get-vehicle-by-plate @Tags Vehicle @Produce json @Success 200 {object} entities.VehicleResponse @Failure 400 {object} HTTPError @Failure 401 {object} HTTPError @Failure 403 {object} HTTPError @Failure 404 {object} HTTPError @Failure 500 {object} HTTPError @Router /v1/vehicle/plate/{plate} [get] @Param plate path string true "Vehicle plate number" @Security Keycloak
func RegisterRoutes ¶
func RegisterRoutes(r fiber.Router, svc service.VehicleService)
func UpdateVehicle ¶
func UpdateVehicle(svc service.VehicleService) fiber.Handler
@Summary Update vehicle @Description Update vehicle @Id update-vehicle @Tags Vehicle @Produce json @Success 200 {object} entities.VehicleResponse @Failure 400 {object} HTTPError @Failure 401 {object} HTTPError @Failure 403 {object} HTTPError @Failure 404 {object} HTTPError @Failure 500 {object} HTTPError @Router /v1/vehicle/{id} [put] @Param id path string true "Vehicle ID" @Param body body entities.VehicleUpdateRequest true "Vehicle Update Request" @Security Keycloak
Types ¶
This section is empty.