wip: jwt
This commit is contained in:
@ -2,6 +2,7 @@ package resp
|
||||
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"github.com/gofiber/fiber/v3"
|
||||
)
|
||||
|
||||
@ -42,20 +43,25 @@ func RE(c fiber.Ctx, err error) error {
|
||||
|
||||
func _r(c fiber.Ctx, r *res, args ...any) error {
|
||||
length := len(args)
|
||||
switch length {
|
||||
case 0:
|
||||
break
|
||||
case 1:
|
||||
|
||||
if length == 0 {
|
||||
goto END
|
||||
}
|
||||
|
||||
if length >= 1 {
|
||||
if msg, ok := args[0].(string); ok {
|
||||
r.Msg = msg
|
||||
} else {
|
||||
r.Data = args[0]
|
||||
}
|
||||
case 2:
|
||||
}
|
||||
|
||||
if length >= 2 {
|
||||
r.Data = args[1]
|
||||
case 3:
|
||||
}
|
||||
|
||||
if length >= 3 {
|
||||
r.Err = args[2]
|
||||
}
|
||||
END:
|
||||
|
||||
if r.Msg == "" {
|
||||
r.Msg = Msg(r.Status)
|
||||
|
Reference in New Issue
Block a user