No changes made

This commit is contained in:
2025-04-16 12:47:04 -04:00
commit 1ed3b0c2d4
98 changed files with 8857 additions and 0 deletions

View File

@@ -0,0 +1,42 @@
package handlers
import (
"github.com/labstack/echo/v4"
"net/http"
)
const DateFormat = "2006-01-02 15:04:05"
type Response[T any] struct {
Status string `json:"status"`
Message string `json:"message,omitempty"`
Payload T `json:"payload"`
}
func BadRequest(c echo.Context, message string) error {
return c.JSON(http.StatusBadRequest, Response[string]{
Status: http.StatusText(http.StatusBadRequest),
Message: message,
})
}
func NotFound(c echo.Context, message string) error {
return c.JSON(http.StatusNotFound, Response[string]{
Status: http.StatusText(http.StatusNotFound),
Message: message,
})
}
type Manufacturer struct {
Id string `json:"id"`
Name string `json:"name"`
Url string `json:"url"`
}
type Powder struct {
Id string `json:"id"`
Name string `json:"name"`
Meta string `json:"meta"`
Photo string `json:"photo,omitempty"`
Manufacturer Manufacturer `json:"manufacturer"`
}