feat 错误码
This commit is contained in:
@@ -35,13 +35,13 @@ func JsonBadRequest(c *gin.Context) {
|
||||
}
|
||||
|
||||
func JsonMethodNotAllowed(c *gin.Context) {
|
||||
c.JSON(http.StatusMethodNotAllowed, Error(NewCode(Failed.Code(), "Method Not Allowed")))
|
||||
c.JSON(http.StatusMethodNotAllowed, Error(MethodNotAllowed))
|
||||
}
|
||||
|
||||
func JsonNotFound(c *gin.Context) {
|
||||
c.JSON(http.StatusNotFound, Error(NewCode(Failed.Code(), "Endpoint Not Found")))
|
||||
c.JSON(http.StatusNotFound, Error(NotFound))
|
||||
}
|
||||
|
||||
func AbortUnauthorized(c *gin.Context) {
|
||||
c.AbortWithStatusJSON(http.StatusUnauthorized, Error(NewCode(Failed.Code(), "Invalid Authorization")))
|
||||
func JsonUnauthorized(c *gin.Context) {
|
||||
c.JSON(http.StatusUnauthorized, Error(TokenInvalid))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user