19 lines
408 B
Go
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,
|
|
}
|
|
}
|