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
052216c4
Commit
052216c4
authored
Oct 26, 2023
by
Steven
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: fix list activities typo
parent
e5978a70
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
6 additions
and
6 deletions
+6
-6
copydb.go
cmd/copydb.go
+1
-1
activity.go
store/activity.go
+1
-1
activity.go
store/db/mysql/activity.go
+2
-2
activity.go
store/db/sqlite/activity.go
+1
-1
driver.go
store/driver.go
+1
-1
No files found.
cmd/copydb.go
View file @
052216c4
...
@@ -108,7 +108,7 @@ func copydb(fromProfile, toProfile *_profile.Profile) error {
...
@@ -108,7 +108,7 @@ func copydb(fromProfile, toProfile *_profile.Profile) error {
func
copyActivity
(
ctx
context
.
Context
,
fromDriver
,
toDriver
store
.
Driver
)
error
{
func
copyActivity
(
ctx
context
.
Context
,
fromDriver
,
toDriver
store
.
Driver
)
error
{
println
(
"Copying Activity..."
)
println
(
"Copying Activity..."
)
list
,
err
:=
fromDriver
.
ListActivit
y
(
ctx
,
&
store
.
FindActivity
{})
list
,
err
:=
fromDriver
.
ListActivit
ies
(
ctx
,
&
store
.
FindActivity
{})
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
}
}
...
...
store/activity.go
View file @
052216c4
...
@@ -26,5 +26,5 @@ func (s *Store) CreateActivity(ctx context.Context, create *Activity) (*Activity
...
@@ -26,5 +26,5 @@ func (s *Store) CreateActivity(ctx context.Context, create *Activity) (*Activity
}
}
func
(
s
*
Store
)
ListActivity
(
ctx
context
.
Context
,
find
*
FindActivity
)
([]
*
Activity
,
error
)
{
func
(
s
*
Store
)
ListActivity
(
ctx
context
.
Context
,
find
*
FindActivity
)
([]
*
Activity
,
error
)
{
return
s
.
driver
.
ListActivit
y
(
ctx
,
find
)
return
s
.
driver
.
ListActivit
ies
(
ctx
,
find
)
}
}
store/db/mysql/activity.go
View file @
052216c4
...
@@ -39,7 +39,7 @@ func (d *DB) CreateActivity(ctx context.Context, create *store.Activity) (*store
...
@@ -39,7 +39,7 @@ func (d *DB) CreateActivity(ctx context.Context, create *store.Activity) (*store
id32
:=
int32
(
id
)
id32
:=
int32
(
id
)
list
,
err
:=
d
.
ListActivit
y
(
ctx
,
&
store
.
FindActivity
{
ID
:
&
id32
})
list
,
err
:=
d
.
ListActivit
ies
(
ctx
,
&
store
.
FindActivity
{
ID
:
&
id32
})
if
err
!=
nil
||
len
(
list
)
==
0
{
if
err
!=
nil
||
len
(
list
)
==
0
{
return
nil
,
errors
.
Wrap
(
err
,
"failed to find activity"
)
return
nil
,
errors
.
Wrap
(
err
,
"failed to find activity"
)
}
}
...
@@ -47,7 +47,7 @@ func (d *DB) CreateActivity(ctx context.Context, create *store.Activity) (*store
...
@@ -47,7 +47,7 @@ func (d *DB) CreateActivity(ctx context.Context, create *store.Activity) (*store
return
list
[
0
],
nil
return
list
[
0
],
nil
}
}
func
(
d
*
DB
)
ListActivit
y
(
ctx
context
.
Context
,
find
*
store
.
FindActivity
)
([]
*
store
.
Activity
,
error
)
{
func
(
d
*
DB
)
ListActivit
ies
(
ctx
context
.
Context
,
find
*
store
.
FindActivity
)
([]
*
store
.
Activity
,
error
)
{
where
,
args
:=
[]
string
{
"1 = 1"
},
[]
any
{}
where
,
args
:=
[]
string
{
"1 = 1"
},
[]
any
{}
if
find
.
ID
!=
nil
{
if
find
.
ID
!=
nil
{
...
...
store/db/sqlite/activity.go
View file @
052216c4
...
@@ -35,7 +35,7 @@ func (d *DB) CreateActivity(ctx context.Context, create *store.Activity) (*store
...
@@ -35,7 +35,7 @@ func (d *DB) CreateActivity(ctx context.Context, create *store.Activity) (*store
return
create
,
nil
return
create
,
nil
}
}
func
(
d
*
DB
)
ListActivit
y
(
ctx
context
.
Context
,
find
*
store
.
FindActivity
)
([]
*
store
.
Activity
,
error
)
{
func
(
d
*
DB
)
ListActivit
ies
(
ctx
context
.
Context
,
find
*
store
.
FindActivity
)
([]
*
store
.
Activity
,
error
)
{
where
,
args
:=
[]
string
{
"1 = 1"
},
[]
any
{}
where
,
args
:=
[]
string
{
"1 = 1"
},
[]
any
{}
if
find
.
ID
!=
nil
{
if
find
.
ID
!=
nil
{
...
...
store/driver.go
View file @
052216c4
...
@@ -22,7 +22,7 @@ type Driver interface {
...
@@ -22,7 +22,7 @@ type Driver interface {
// Activity model related methods.
// Activity model related methods.
CreateActivity
(
ctx
context
.
Context
,
create
*
Activity
)
(
*
Activity
,
error
)
CreateActivity
(
ctx
context
.
Context
,
create
*
Activity
)
(
*
Activity
,
error
)
ListActivit
y
(
ctx
context
.
Context
,
find
*
FindActivity
)
([]
*
Activity
,
error
)
ListActivit
ies
(
ctx
context
.
Context
,
find
*
FindActivity
)
([]
*
Activity
,
error
)
// Resource model related methods.
// Resource model related methods.
CreateResource
(
ctx
context
.
Context
,
create
*
Resource
)
(
*
Resource
,
error
)
CreateResource
(
ctx
context
.
Context
,
create
*
Resource
)
(
*
Resource
,
error
)
...
...
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