Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterRoutes ¶
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func NewHandler ¶
func NewHandler(logger *zap.Logger, tsClient *timescaledb.Client) *Handler
func (*Handler) GetAlerts ¶
GetAlerts returns alerts based on water level thresholds @Summary Get alerts @Description Retrieve alerts based on configurable thresholds for a specific device. Organization is resolved from X-Organization header or hostname (e.g., {org}.localhost) @Tags alerts @Accept json @Produce json @Param device_id query string true "Device ID" @Param category query string true "Alert category (e.g., water_level)" @Param start_date query string true "Start date (YYYY-MM-DD format)" @Param end_date query string true "End date (YYYY-MM-DD format)" @Param caution_threshold query number false "Caution threshold value" @Param warning_threshold query number false "Warning threshold value" @Param critical_threshold query number false "Critical threshold value" @Param limit query int false "Number of results per page (default 20)" @Param offset query int false "Number of results to skip (default 0)" @Success 200 {object} common.PaginatedResponse @Failure 400 {object} map[string]string "Invalid request parameters" @Failure 500 {object} map[string]string "Internal server error" @Router /telemetry/v1/alerts [get]