feat(backend): implement HTTP response utility functions for standardized error and success handling

This commit is contained in:
keven1024
2025-04-30 13:55:04 +08:00
parent 7ea1d04133
commit 1dc349ef31

View File

@@ -8,8 +8,7 @@ import (
)
func HTTPErrorHandler(c echo.Context, err error, options ...HTTPBaseResponseProps) error {
statusCode := http.StatusInternalServerError
return HTTPBaseHandler(c, WithMessage(err.Error()), WithCode(statusCode))
return HTTPBaseHandler(c, WithMessage(err.Error()), WithCode(http.StatusBadRequest))
}
type HTTPBaseResponse struct {