update authorized.go, database.go, middleware.go, project.go, response.go, role.go, service.go
This commit is contained in:
1 parent
53257427c9
commit
b6133df436
7 files changed
+226
No files matched your search
@@ -0,0 +1,15 @@
|
||||
package util
|
||||
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
type error struct {
|
||||
Message string `json:"message"`
|
||||
}
|
||||
|
||||
func NewErrorResponse(c *gin.Context, statusCode int, message string) {
|
||||
logrus.Error(message)
|
||||
c.AbortWithStatusJSON(statusCode, error{Message: message})
|
||||
}
|
||||
Reference in new issue
Block a user