refactored view package

This commit is contained in:
2026-02-09 19:30:47 +11:00
parent fa3b8e3982
commit 0b3301f921
47 changed files with 653 additions and 490 deletions

View File

@@ -26,6 +26,18 @@ type Filter struct {
Value any
}
type ListFilter struct {
filters []Filter
}
func NewListFilter() *ListFilter {
return &ListFilter{[]Filter{}}
}
func (f *ListFilter) Add(field string, value any) {
f.filters = append(f.filters, Filter{field, value})
}
func GetList[T any](tx bun.Tx, pageOpts, defaults *PageOpts) *listgetter[T] {
l := &listgetter[T]{
items: new([]*T),