diff --git a/structs/storage/scope.go b/structs/storage/scope.go index c9575cb..ddd6f6c 100644 --- a/structs/storage/scope.go +++ b/structs/storage/scope.go @@ -27,6 +27,25 @@ type PageListQuery struct { PageQuery } +func NewPageListQuery(scoper Scoper) *PageListQuery { + return &PageListQuery{Scoper: scoper} +} + +func (p *PageListQuery) SetPage(page int) *PageListQuery { + p.Page = page + return p +} + +func (p *PageListQuery) SetPageSize(pageSize int) *PageListQuery { + p.Size = pageSize + return p +} + +func (p *PageListQuery) SetScoper(scoper Scoper) *PageListQuery { + p.Scoper = scoper + return p +} + func (p *PageListQuery) Scope(db *gorm.DB) *gorm.DB { if p.Scoper != nil { db = p.Scoper.Scope(db)