This commit is contained in:
ryan
2026-07-13 15:08:40 +08:00
parent 08e8eea932
commit 1eff7878a1
441 changed files with 26491 additions and 18405 deletions
+1 -1
View File
@@ -41,4 +41,4 @@ func NamedIDParam(c *gin.Context, name string) (uint, bool) {
return 0, false
}
return uint(id64), true
}
}
+1 -1
View File
@@ -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)
}
}
+1 -1
View File
@@ -16,4 +16,4 @@ func RegisterCollection(route *gin.RouterGroup, method string, handlers ...gin.H
if !strings.HasSuffix(route.BasePath(), "/") {
route.Handle(method, "", handlers...)
}
}
}