Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
canifa_note
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vũ Hoàng Anh
canifa_note
Commits
67d2e4eb
Commit
67d2e4eb
authored
Oct 27, 2023
by
Steven
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: update method name
parent
4ea78fa1
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
8 additions
and
8 deletions
+8
-8
activity.go
store/activity.go
+1
-1
inbox.go
store/db/mysql/inbox.go
+1
-1
inbox.go
store/db/sqlite/inbox.go
+1
-1
driver.go
store/driver.go
+1
-1
inbox.go
store/inbox.go
+2
-2
inbox_test.go
test/store/inbox_test.go
+2
-2
No files found.
store/activity.go
View file @
67d2e4eb
...
...
@@ -25,6 +25,6 @@ func (s *Store) CreateActivity(ctx context.Context, create *Activity) (*Activity
return
s
.
driver
.
CreateActivity
(
ctx
,
create
)
}
func
(
s
*
Store
)
ListActivit
y
(
ctx
context
.
Context
,
find
*
FindActivity
)
([]
*
Activity
,
error
)
{
func
(
s
*
Store
)
ListActivit
ies
(
ctx
context
.
Context
,
find
*
FindActivity
)
([]
*
Activity
,
error
)
{
return
s
.
driver
.
ListActivities
(
ctx
,
find
)
}
store/db/mysql/inbox.go
View file @
67d2e4eb
...
...
@@ -12,7 +12,7 @@ func (d *DB) CreateInbox(ctx context.Context, create *store.Inbox) (*store.Inbox
}
// nolint
func
(
d
*
DB
)
ListInbox
es
(
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
}
...
...
store/db/sqlite/inbox.go
View file @
67d2e4eb
...
...
@@ -36,7 +36,7 @@ func (d *DB) CreateInbox(ctx context.Context, create *store.Inbox) (*store.Inbox
return
create
,
nil
}
func
(
d
*
DB
)
ListInbox
es
(
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
{
...
...
store/driver.go
View file @
67d2e4eb
...
...
@@ -84,7 +84,7 @@ type Driver interface {
// Inbox model related methods.
CreateInbox
(
ctx
context
.
Context
,
create
*
Inbox
)
(
*
Inbox
,
error
)
ListInbox
es
(
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
}
store/inbox.go
View file @
67d2e4eb
...
...
@@ -44,8 +44,8 @@ func (s *Store) CreateInbox(ctx context.Context, create *Inbox) (*Inbox, error)
return
s
.
driver
.
CreateInbox
(
ctx
,
create
)
}
func
(
s
*
Store
)
ListInbox
es
(
ctx
context
.
Context
,
find
*
FindInbox
)
([]
*
Inbox
,
error
)
{
return
s
.
driver
.
ListInbox
es
(
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
)
{
...
...
test/store/inbox_test.go
View file @
67d2e4eb
...
...
@@ -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
.
ListInbox
es
(
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
.
ListInbox
es
(
ctx
,
&
store
.
FindInbox
{
inboxes
,
err
=
ts
.
ListInbox
(
ctx
,
&
store
.
FindInbox
{
ReceiverID
:
&
user
.
ID
,
})
require
.
NoError
(
t
,
err
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment