be add edit delete user group

This commit is contained in:
Sas Andy
2024-05-14 15:34:40 +07:00
parent 5dce26caeb
commit 64ac3a5b7b
5 changed files with 245 additions and 1 deletions

21
utils/getjsonreq.utils.go Normal file
View File

@@ -0,0 +1,21 @@
package utils
import (
"encoding/json"
"github.com/labstack/echo/v4"
"github.com/labstack/gommon/log"
)
func GetJSONRawBody(c echo.Context) map[string]interface{} {
jsonBody := make(map[string]interface{})
err := json.NewDecoder(c.Request().Body).Decode(&jsonBody)
if err != nil {
log.Error("empty json body")
return nil
}
return jsonBody
}