handlers

package
v0.0.0-...-7d93bc8 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error struct {
	Message string `json:"message"`
}

type MeasurementHandler

type MeasurementHandler struct {
	MeasurementDB      database.MeasurementInterface
	MeasurementStorage storage.MeasurementStorageInterface
	Gemini             gemini.GeminiInterface
}

func (*MeasurementHandler) CreateMeasurement

func (h *MeasurementHandler) CreateMeasurement(w http.ResponseWriter, r *http.Request)

Create measurement godoc @Summary Create measurement @Description Create measurement @Tags measurements @Accept json @Produce json @Param request body dto.CreateMeasurementInput true "measurement request" @Success 201 {object} entity.Measurement @Failure 400 {object} Error @Failure 500 {object} Error @Router /measurements [post] @Security ApiKeyAuth

func (*MeasurementHandler) DeleteMeasurement

func (h *MeasurementHandler) DeleteMeasurement(w http.ResponseWriter, r *http.Request)

Delete measurement godoc @Summary Delete a measurement @Description Delete a measurement @Tags measurements @Accept json @Produce json @Param id path string true "measurement ID" Format(uuid) @Success 200 {object} entity.Measurement @Failure 400 {object} Error @Failure 404 {object} Error @Failure 500 {object} Error @Router /measurements/{id} [delete] @Security ApiKeyAuth

func (*MeasurementHandler) GetMeasurement

func (h *MeasurementHandler) GetMeasurement(w http.ResponseWriter, r *http.Request)

Get measurement godoc @Summary Get a measurement @Description Get a measurement @Tags measurements @Accept json @Produce json @Param id path string true "measurement ID" Format(uuid) @Success 200 {object} entity.Measurement @Failure 400 {object} Error @Failure 404 {object} Error @Router /measurements/{id} [get] @Security ApiKeyAuth

func (*MeasurementHandler) GetMeasurementImage

func (h *MeasurementHandler) GetMeasurementImage(w http.ResponseWriter, r *http.Request)

Get measurement image godoc @Summary Get a measurement image @Description Get a measurement image @Tags measurements @Accept json @Produce json @Param id path string true "measurement ID" Format(uuid) @Success 200 {file} image @Failure 400 {object} Error @Failure 404 {object} Error @Router /measurements/{id}/image [get] @Security ApiKeyAuth

func (*MeasurementHandler) GetMeasurements

func (h *MeasurementHandler) GetMeasurements(w http.ResponseWriter, r *http.Request)

List measurements godoc @Summary List measurements @Description Get all measurements @Tags measurements @Accept json @Produce json @Param page query string false "page number" @Param limit query string false "records limit" @Success 200 {array} entity.Measurement @Failure 400 {object} Error @Failure 500 {object} Error @Router /measurements [get] @Security ApiKeyAuth

func (*MeasurementHandler) UpdateMeasurement

func (h *MeasurementHandler) UpdateMeasurement(w http.ResponseWriter, r *http.Request)

Update measurement godoc @Summary Update a measurement @Description Update a measurement @Tags measurements @Accept json @Produce json @Param id path string true "product ID" Format(uuid) @Param request body dto.CreateMeasurementInput true "measurement request" @Success 200 {object} entity.Measurement @Failure 400 {object} Error @Failure 404 {object} Error @Failure 500 {object} Error @Router /measurements/{id} [put] @Security ApiKeyAuth

type UserHandler

type UserHandler struct {
	UserDB database.UserInterface
}

func NewUserHandler

func NewUserHandler(userDB database.UserInterface) *UserHandler

func (*UserHandler) CreateUser

func (h *UserHandler) CreateUser(w http.ResponseWriter, r *http.Request)

Create user godoc @Summary Create user @Description Create user @Tags users @Accept json @Produce json @Param request body dto.CreateUserInput true "user request" @Success 201 {object} entity.User @Failure 400 {object} Error @Failure 500 {object} Error @Router /users [post]

func (*UserHandler) GetToken

func (h *UserHandler) GetToken(w http.ResponseWriter, r *http.Request)

Get token godoc @Summary Get a user token @Description Get a user token @Tags users @Accept json @Produce json @Param request body dto.GetTokenInput true "user credentials" @Success 200 {object} dto.GetTokenOutput @Failure 400 {object} Error @Failure 401 {object} Error @Router /users/token [post]

Jump to

Keyboard shortcuts

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