feat: add support for ListMemoOrganizer (#2367)

* Add support for ListMemoOrganizer

* fix rows not close
This commit is contained in:
Athurg Gooth
2023-10-09 21:18:47 +08:00
committed by GitHub
parent fa2bba51c1
commit 6bb6c043e5
4 changed files with 56 additions and 28 deletions

View File

@@ -2,6 +2,7 @@ package store
import (
"context"
"errors"
)
type MemoOrganizer struct {
@@ -25,7 +26,20 @@ func (s *Store) UpsertMemoOrganizer(ctx context.Context, upsert *MemoOrganizer)
}
func (s *Store) GetMemoOrganizer(ctx context.Context, find *FindMemoOrganizer) (*MemoOrganizer, error) {
return s.driver.GetMemoOrganizer(ctx, find)
list, err := s.ListMemoOrganizer(ctx, find)
if err != nil {
return nil, err
}
if len(list) == 0 {
return nil, errors.New("not found")
}
return list[0], nil
}
func (s *Store) ListMemoOrganizer(ctx context.Context, find *FindMemoOrganizer) ([]*MemoOrganizer, error) {
return s.driver.ListMemoOrganizer(ctx, find)
}
func (s *Store) DeleteMemoOrganizer(ctx context.Context, delete *DeleteMemoOrganizer) error {