feat: add Go backend compatibility service scaffold

This commit is contained in:
sagit
2026-02-06 10:42:48 +00:00
parent f5a40bf530
commit 0f37017760
22 changed files with 2063 additions and 0 deletions
@@ -0,0 +1,19 @@
package middleware
import (
"fmt"
"net/http"
"go-backend/internal/http/response"
)
func Recover(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
defer func() {
if rec := recover(); rec != nil {
response.WriteJSON(w, response.Err(-2, fmt.Sprint(rec)))
}
}()
next.ServeHTTP(w, r)
})
}