mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
feat: implement list memos filter
This commit is contained in:
@ -57,8 +57,10 @@ type FindMemo struct {
|
||||
ID *int32
|
||||
|
||||
// Standard fields
|
||||
RowStatus *RowStatus
|
||||
CreatorID *int32
|
||||
RowStatus *RowStatus
|
||||
CreatorID *int32
|
||||
CreatedTsAfter *int64
|
||||
CreatedTsBefore *int64
|
||||
|
||||
// Domain specific fields
|
||||
Pinned *bool
|
||||
@ -131,6 +133,12 @@ func (s *Store) ListMemos(ctx context.Context, find *FindMemo) ([]*Memo, error)
|
||||
if v := find.RowStatus; v != nil {
|
||||
where, args = append(where, "memo.row_status = ?"), append(args, *v)
|
||||
}
|
||||
if v := find.CreatedTsBefore; v != nil {
|
||||
where, args = append(where, "memo.created_ts < ?"), append(args, *v)
|
||||
}
|
||||
if v := find.CreatedTsAfter; v != nil {
|
||||
where, args = append(where, "memo.created_ts > ?"), append(args, *v)
|
||||
}
|
||||
if v := find.Pinned; v != nil {
|
||||
where = append(where, "memo_organizer.pinned = 1")
|
||||
}
|
||||
|
Reference in New Issue
Block a user