Добавлен основные классы для сервиса авторизаци
This commit is contained in:
15
internal/handler/response.go
Normal file
15
internal/handler/response.go
Normal file
@@ -0,0 +1,15 @@
|
||||
package handler
|
||||
|
||||
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