fix: list query issues

This commit is contained in:
yanghao05
2025-04-09 17:25:41 +08:00
parent 1f4c05c54a
commit 05d368ef25
6 changed files with 43 additions and 17 deletions

View File

@@ -9,7 +9,7 @@ import (
)
type ListQuery struct {
Key *string `query:"key"`
keyword *string `query:"keyword"`
}
// @provider
@@ -20,7 +20,7 @@ type posts struct{}
// @Bind pagination query
// @Bind query query
func (ctl *posts) List(ctx fiber.Ctx, pagination *requests.Pagination, query *ListQuery) (*requests.Pager, error) {
cond := models.Posts.BuildConditionWithKey(query.Key)
cond := models.Posts.BuildConditionWithKey(query.keyword)
return models.Posts.List(ctx.Context(), pagination, cond)
}