fix(api): 限制公开接口分页结果窗口 (#45)

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
fu500f
2026-10-31 00:54:37 +00:00
co-authored by Devin AI
parent 36f9c95fa7
commit 124f14b509
5 changed files with 77 additions and 6 deletions
+13
View File
@@ -116,6 +116,19 @@ func TestSearchProducts(t *testing.T) {
}
}
func TestPaginationResultWindowBoundary(t *testing.T) {
h, _ := newTestHandler(t)
for _, path := range []string{
"/api/" + APIVersion + "/products/search?page=100&size=100",
"/api/" + APIVersion + "/brands?page=100&size=100",
} {
rec := doGET(t, h, path)
if rec.Code != http.StatusOK {
t.Fatalf("%s: status = %d, body = %s", path, rec.Code, rec.Body.String())
}
}
}
func TestSearchFuzzyAndFilters(t *testing.T) {
h, _ := newTestHandler(t)
ctx := context.Background()