Files
b2b/app/utils/response/response.go
2026-03-10 09:02:57 +01:00

19 lines
408 B
Go

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"`
}
func Make[T any](c fiber.Ctx, status int, items *T, count *int, message string) Response[T] {
c.Status(status)
return Response[T]{
Message: message,
Items: items,
Count: count,
}
}