initial commit. Cloned timetracker repository
This commit is contained in:
18
app/utils/response/response.go
Normal file
18
app/utils/response/response.go
Normal file
@@ -0,0 +1,18 @@
|
||||
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,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user