mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-06 15:46:37 +08:00
prettier
This commit is contained in:
@@ -41,4 +41,4 @@ func NamedIDParam(c *gin.Context, name string) (uint, bool) {
|
||||
return 0, false
|
||||
}
|
||||
return uint(id64), true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,4 +31,4 @@ func AbortBadRequestOnError(c *gin.Context, err error) bool {
|
||||
}
|
||||
response.AbortBadRequest(c, err.Error())
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,4 +14,4 @@ import (
|
||||
// the same gate: user.IsAdmin for session users, token_admin for Access Token callers.
|
||||
func AdminMiddlewares() []gin.HandlerFunc {
|
||||
return []gin.HandlerFunc{oauth.LoginRequired(), admin.LoginAdminRequired()}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -155,4 +155,4 @@ func TestAdminRequiredAdminWithTokenAdmin(t *testing.T) {
|
||||
assert.Equal(t, http.StatusOK, rec.Code)
|
||||
resp := decodeResponse(t, rec)
|
||||
assert.Empty(t, resp.ErrorMsg)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,4 +16,4 @@ func RegisterCollection(route *gin.RouterGroup, method string, handlers ...gin.H
|
||||
if !strings.HasSuffix(route.BasePath(), "/") {
|
||||
route.Handle(method, "", handlers...)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user