mirror of
https://github.com/Dvorinka/Primora.git
synced 2026-06-04 04:23:00 +00:00
18 lines
281 B
Go
18 lines
281 B
Go
package response
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
func Abort(c *gin.Context, status int, code, message string) {
|
|
c.AbortWithStatusJSON(status, gin.H{
|
|
"error": gin.H{
|
|
"code": code,
|
|
"message": message,
|
|
},
|
|
"status": http.StatusText(status),
|
|
})
|
|
}
|