fix: add MaxPageSize cap and remove extra blank lines in imports

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Steven 2026-03-04 19:01:22 +08:00
parent b962f0c159
commit 10adb5fd5e
4 changed files with 3 additions and 3 deletions

View file

@ -29,6 +29,9 @@ func (s *APIV1Service) ListActivities(ctx context.Context, request *v1pb.ListAct
if limit <= 0 {
limit = DefaultPageSize
}
if limit > MaxPageSize {
limit = MaxPageSize
}
limitPlusOne := limit + 1
activities, err := s.Store.ListActivities(ctx, &store.FindActivity{
Limit: &limitPlusOne,

View file

@ -5,7 +5,6 @@ import (
"fmt"
"strings"
"github.com/pkg/errors"
"google.golang.org/protobuf/encoding/protojson"

View file

@ -5,7 +5,6 @@ import (
"fmt"
"strings"
"github.com/pkg/errors"
"google.golang.org/protobuf/encoding/protojson"

View file

@ -5,7 +5,6 @@ import (
"fmt"
"strings"
"github.com/pkg/errors"
"google.golang.org/protobuf/encoding/protojson"