Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cache
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
Odysseus
cache
Commits
087a30df
Commit
087a30df
authored
Jan 26, 2024
by
vicotor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug for query data from db
parent
2b1ce93d
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
9 deletions
+9
-9
cache_test.go
cachedata/cache_test.go
+2
-2
taskType.go
model/taskType.go
+2
-2
user.go
model/user.go
+1
-1
userLevel.go
model/userLevel.go
+2
-2
userLevelTaskType.go
model/userLevelTaskType.go
+2
-2
No files found.
cachedata/cache_test.go
View file @
087a30df
...
@@ -31,8 +31,8 @@ func newCache() *CacheData {
...
@@ -31,8 +31,8 @@ func newCache() *CacheData {
func
TestCacheData_Query
(
t
*
testing
.
T
)
{
func
TestCacheData_Query
(
t
*
testing
.
T
)
{
cache
:=
newCache
()
cache
:=
newCache
()
testPath
:=
""
testPath
:=
"
/start/docker
"
testUid
:=
int64
(
1
)
testUid
:=
int64
(
1
7
)
task
,
err
:=
cache
.
Query
(
testPath
,
testUid
)
task
,
err
:=
cache
.
Query
(
testPath
,
testUid
)
if
err
!=
nil
{
if
err
!=
nil
{
...
...
model/taskType.go
View file @
087a30df
...
@@ -63,7 +63,7 @@ func (repo *taskTypeRepositoryImpl) GetListByFilter(filters ...interface{}) []*T
...
@@ -63,7 +63,7 @@ func (repo *taskTypeRepositoryImpl) GetListByFilter(filters ...interface{}) []*T
func
(
repo
*
taskTypeRepositoryImpl
)
GetById
(
id
int64
)
(
*
TaskType
,
error
)
{
func
(
repo
*
taskTypeRepositoryImpl
)
GetById
(
id
int64
)
(
*
TaskType
,
error
)
{
taskType
:=
TaskType
{
ID
:
id
}
taskType
:=
TaskType
{
ID
:
id
}
err
:=
repo
.
o
.
Read
(
&
taskType
)
err
:=
repo
.
o
.
Read
(
&
taskType
,
"id"
)
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
}
}
...
@@ -72,7 +72,7 @@ func (repo *taskTypeRepositoryImpl) GetById(id int64) (*TaskType, error) {
...
@@ -72,7 +72,7 @@ func (repo *taskTypeRepositoryImpl) GetById(id int64) (*TaskType, error) {
func
(
repo
*
taskTypeRepositoryImpl
)
GetByApiPath
(
path
string
)
(
*
TaskType
,
error
)
{
func
(
repo
*
taskTypeRepositoryImpl
)
GetByApiPath
(
path
string
)
(
*
TaskType
,
error
)
{
taskType
:=
TaskType
{
ApiPath
:
path
}
taskType
:=
TaskType
{
ApiPath
:
path
}
err
:=
repo
.
o
.
Read
(
&
taskType
)
err
:=
repo
.
o
.
Read
(
&
taskType
,
"api_path"
)
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
}
}
...
...
model/user.go
View file @
087a30df
...
@@ -72,7 +72,7 @@ func (repo *userRepositoryImpl) GetListByFilter(filters ...interface{}) []*User
...
@@ -72,7 +72,7 @@ func (repo *userRepositoryImpl) GetListByFilter(filters ...interface{}) []*User
func
(
repo
*
userRepositoryImpl
)
GetById
(
uid
int64
)
(
*
User
,
error
)
{
func
(
repo
*
userRepositoryImpl
)
GetById
(
uid
int64
)
(
*
User
,
error
)
{
user
:=
User
{
ID
:
uid
}
user
:=
User
{
ID
:
uid
}
err
:=
repo
.
o
.
Read
(
&
user
)
err
:=
repo
.
o
.
Read
(
&
user
,
"id"
)
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
}
}
...
...
model/userLevel.go
View file @
087a30df
...
@@ -67,7 +67,7 @@ func (repo *userLevelRepositoryImpl) GetListByFilter(filters ...interface{}) []*
...
@@ -67,7 +67,7 @@ func (repo *userLevelRepositoryImpl) GetListByFilter(filters ...interface{}) []*
func
(
repo
*
userLevelRepositoryImpl
)
GetById
(
uid
int64
)
(
*
UserLevel
,
error
)
{
func
(
repo
*
userLevelRepositoryImpl
)
GetById
(
uid
int64
)
(
*
UserLevel
,
error
)
{
user
:=
UserLevel
{
ID
:
uid
}
user
:=
UserLevel
{
ID
:
uid
}
err
:=
repo
.
o
.
Read
(
&
user
)
err
:=
repo
.
o
.
Read
(
&
user
,
"id"
)
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
}
}
...
@@ -76,7 +76,7 @@ func (repo *userLevelRepositoryImpl) GetById(uid int64) (*UserLevel, error) {
...
@@ -76,7 +76,7 @@ func (repo *userLevelRepositoryImpl) GetById(uid int64) (*UserLevel, error) {
func
(
repo
*
userLevelRepositoryImpl
)
GetByLevel
(
level
int64
)
(
*
UserLevel
,
error
)
{
func
(
repo
*
userLevelRepositoryImpl
)
GetByLevel
(
level
int64
)
(
*
UserLevel
,
error
)
{
user
:=
UserLevel
{
Level
:
level
}
user
:=
UserLevel
{
Level
:
level
}
err
:=
repo
.
o
.
Read
(
&
user
)
err
:=
repo
.
o
.
Read
(
&
user
,
"level"
)
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
}
}
...
...
model/userLevelTaskType.go
View file @
087a30df
...
@@ -62,7 +62,7 @@ func (repo *userLevelTaskTypeRepositoryImpl) GetListByFilter(filters ...interfac
...
@@ -62,7 +62,7 @@ func (repo *userLevelTaskTypeRepositoryImpl) GetListByFilter(filters ...interfac
func
(
repo
*
userLevelTaskTypeRepositoryImpl
)
GetByTaskTypeAndUserLevel
(
taskType
int64
,
userLevel
int64
)
(
*
UserLevelTaskType
,
error
)
{
func
(
repo
*
userLevelTaskTypeRepositoryImpl
)
GetByTaskTypeAndUserLevel
(
taskType
int64
,
userLevel
int64
)
(
*
UserLevelTaskType
,
error
)
{
user
:=
UserLevelTaskType
{
TaskTypeId
:
taskType
,
UserLevel
:
userLevel
}
user
:=
UserLevelTaskType
{
TaskTypeId
:
taskType
,
UserLevel
:
userLevel
}
err
:=
repo
.
o
.
Read
(
&
user
)
err
:=
repo
.
o
.
Read
(
&
user
,
"task_type_id"
,
"user_level"
)
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
}
}
...
@@ -71,7 +71,7 @@ func (repo *userLevelTaskTypeRepositoryImpl) GetByTaskTypeAndUserLevel(taskType
...
@@ -71,7 +71,7 @@ func (repo *userLevelTaskTypeRepositoryImpl) GetByTaskTypeAndUserLevel(taskType
func
(
repo
*
userLevelTaskTypeRepositoryImpl
)
GetById
(
uid
int64
)
(
*
UserLevelTaskType
,
error
)
{
func
(
repo
*
userLevelTaskTypeRepositoryImpl
)
GetById
(
uid
int64
)
(
*
UserLevelTaskType
,
error
)
{
user
:=
UserLevelTaskType
{
ID
:
uid
}
user
:=
UserLevelTaskType
{
ID
:
uid
}
err
:=
repo
.
o
.
Read
(
&
user
)
err
:=
repo
.
o
.
Read
(
&
user
,
"id"
)
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
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