code refactor

This commit is contained in:
Daniel Goc
2026-03-17 10:55:17 +01:00
parent 0da596826e
commit a0dcb56fda
8 changed files with 187 additions and 177 deletions

View File

@@ -1,15 +1,12 @@
package response
import "github.com/gofiber/fiber/v3"
type Response[T any] struct {
Message string `json:"message,omitempty"`
Items *T `json:"items,omitempty"`
Count *int `json:"count,omitempty"`
Message string `json:"message"`
Items *T `json:"items"`
Count int `json:"count"`
}
func Make[T any](c fiber.Ctx, status int, items *T, count *int, message string) Response[T] {
c.Status(status)
func Make[T any](items *T, count int, message string) Response[T] {
return Response[T]{
Message: message,
Items: items,