forked from baron/baron-sso
18 lines
568 B
Go
18 lines
568 B
Go
package middleware
|
|
|
|
import (
|
|
"baron-sso-backend/internal/response"
|
|
|
|
"github.com/gofiber/fiber/v2"
|
|
)
|
|
|
|
// errorJSON은 legacy error 필드를 유지하면서 status 기반 code를 함께 반환합니다.
|
|
func errorJSON(c *fiber.Ctx, status int, message string) error {
|
|
return response.Error(c, status, response.StatusCode(status), message)
|
|
}
|
|
|
|
// errorJSONCode는 상태코드 매핑과 다른 명시 코드가 필요할 때 사용합니다.
|
|
func errorJSONCode(c *fiber.Ctx, status int, code, message string) error {
|
|
return response.Error(c, status, code, message)
|
|
}
|