mirror of
https://github.com/usememos/memos.git
synced 2025-01-27 15:42:16 +08:00
chore: update method name
This commit is contained in:
parent
4ea78fa1a2
commit
67d2e4ebcb
6 changed files with 8 additions and 8 deletions
|
@ -25,6 +25,6 @@ func (s *Store) CreateActivity(ctx context.Context, create *Activity) (*Activity
|
|||
return s.driver.CreateActivity(ctx, create)
|
||||
}
|
||||
|
||||
func (s *Store) ListActivity(ctx context.Context, find *FindActivity) ([]*Activity, error) {
|
||||
func (s *Store) ListActivities(ctx context.Context, find *FindActivity) ([]*Activity, error) {
|
||||
return s.driver.ListActivities(ctx, find)
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ func (d *DB) CreateInbox(ctx context.Context, create *store.Inbox) (*store.Inbox
|
|||
}
|
||||
|
||||
// nolint
|
||||
func (d *DB) ListInboxes(ctx context.Context, find *store.FindInbox) ([]*store.Inbox, error) {
|
||||
func (d *DB) ListInbox(ctx context.Context, find *store.FindInbox) ([]*store.Inbox, error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ func (d *DB) CreateInbox(ctx context.Context, create *store.Inbox) (*store.Inbox
|
|||
return create, nil
|
||||
}
|
||||
|
||||
func (d *DB) ListInboxes(ctx context.Context, find *store.FindInbox) ([]*store.Inbox, error) {
|
||||
func (d *DB) ListInbox(ctx context.Context, find *store.FindInbox) ([]*store.Inbox, error) {
|
||||
where, args := []string{"1 = 1"}, []any{}
|
||||
|
||||
if find.ID != nil {
|
||||
|
|
|
@ -84,7 +84,7 @@ type Driver interface {
|
|||
|
||||
// Inbox model related methods.
|
||||
CreateInbox(ctx context.Context, create *Inbox) (*Inbox, error)
|
||||
ListInboxes(ctx context.Context, find *FindInbox) ([]*Inbox, error)
|
||||
ListInbox(ctx context.Context, find *FindInbox) ([]*Inbox, error)
|
||||
UpdateInbox(ctx context.Context, update *UpdateInbox) (*Inbox, error)
|
||||
DeleteInbox(ctx context.Context, delete *DeleteInbox) error
|
||||
}
|
||||
|
|
|
@ -44,8 +44,8 @@ func (s *Store) CreateInbox(ctx context.Context, create *Inbox) (*Inbox, error)
|
|||
return s.driver.CreateInbox(ctx, create)
|
||||
}
|
||||
|
||||
func (s *Store) ListInboxes(ctx context.Context, find *FindInbox) ([]*Inbox, error) {
|
||||
return s.driver.ListInboxes(ctx, find)
|
||||
func (s *Store) ListInbox(ctx context.Context, find *FindInbox) ([]*Inbox, error) {
|
||||
return s.driver.ListInbox(ctx, find)
|
||||
}
|
||||
|
||||
func (s *Store) UpdateInbox(ctx context.Context, update *UpdateInbox) (*Inbox, error) {
|
||||
|
|
|
@ -30,7 +30,7 @@ func TestInboxStore(t *testing.T) {
|
|||
require.NoError(t, err)
|
||||
require.NotNil(t, inbox)
|
||||
require.Equal(t, create.Message, inbox.Message)
|
||||
inboxes, err := ts.ListInboxes(ctx, &store.FindInbox{
|
||||
inboxes, err := ts.ListInbox(ctx, &store.FindInbox{
|
||||
ReceiverID: &user.ID,
|
||||
})
|
||||
require.NoError(t, err)
|
||||
|
@ -47,7 +47,7 @@ func TestInboxStore(t *testing.T) {
|
|||
ID: inbox.ID,
|
||||
})
|
||||
require.NoError(t, err)
|
||||
inboxes, err = ts.ListInboxes(ctx, &store.FindInbox{
|
||||
inboxes, err = ts.ListInbox(ctx, &store.FindInbox{
|
||||
ReceiverID: &user.ID,
|
||||
})
|
||||
require.NoError(t, err)
|
||||
|
|
Loading…
Reference in a new issue