code refactor
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user