Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
plugin
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
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
link33
plugin
Commits
03065e62
Commit
03065e62
authored
Jan 04, 2019
by
张振华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
table refactor
parent
bfcd1f05
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
4 deletions
+4
-4
guessdb.go
plugin/dapp/guess/executor/guessdb.go
+1
-1
query.go
plugin/dapp/guess/executor/query.go
+1
-1
table.go
plugin/dapp/guess/types/table.go
+2
-2
No files found.
plugin/dapp/guess/executor/guessdb.go
View file @
03065e62
...
...
@@ -123,7 +123,7 @@ func Key(id string) (key []byte) {
return
key
}
//Infos 根据游戏id列表查询多个游戏详情信息
//
QueryGame
Infos 根据游戏id列表查询多个游戏详情信息
func
QueryGameInfos
(
kvdb
db
.
KVDB
,
infos
*
gty
.
QueryGuessGameInfos
)
(
types
.
Message
,
error
)
{
var
games
[]
*
gty
.
GuessGame
gameTable
:=
gty
.
NewGuessGameTable
(
kvdb
)
...
...
plugin/dapp/guess/executor/query.go
View file @
03065e62
...
...
@@ -60,7 +60,7 @@ func (g *Guess) Query_QueryGamesByAddrStatus(in *gty.QueryGuessGameInfo) (types.
return
nil
,
err
}
prefix
:=
table
.
JoinKey
([]
byte
(
fmt
.
Sprintf
(
"%s"
,
in
.
Addr
)
),
[]
byte
(
fmt
.
Sprintf
(
"%2d"
,
in
.
Status
)))
prefix
:=
table
.
JoinKey
([]
byte
(
in
.
Addr
),
[]
byte
(
fmt
.
Sprintf
(
"%2d"
,
in
.
Status
)))
return
QueryJoinTableData
(
tableJoin
,
"addr#status"
,
prefix
,
in
.
PrimaryKey
)
}
...
...
plugin/dapp/guess/types/table.go
View file @
03065e62
...
...
@@ -61,7 +61,7 @@ func (tx *GuessUserRow) Get(key string) ([]byte, error) {
if
key
==
"index"
{
return
[]
byte
(
fmt
.
Sprintf
(
"%018d"
,
tx
.
Index
)),
nil
}
else
if
key
==
"addr"
{
return
[]
byte
(
fmt
.
Sprintf
(
"%s"
,
tx
.
Addr
)
),
nil
return
[]
byte
(
tx
.
Addr
),
nil
}
else
if
key
==
"startindex"
{
return
[]
byte
(
fmt
.
Sprintf
(
"%018d"
,
tx
.
StartIndex
)),
nil
}
...
...
@@ -115,7 +115,7 @@ func (tx *GuessGameRow) Get(key string) ([]byte, error) {
if
key
==
"startindex"
{
return
[]
byte
(
fmt
.
Sprintf
(
"%018d"
,
tx
.
StartIndex
)),
nil
}
else
if
key
==
"gameid"
{
return
[]
byte
(
fmt
.
Sprintf
(
"%s"
,
tx
.
GameID
)
),
nil
return
[]
byte
(
tx
.
GameID
),
nil
}
else
if
key
==
"status"
{
return
[]
byte
(
fmt
.
Sprintf
(
"%2d"
,
tx
.
Status
)),
nil
}
else
if
key
==
"admin"
{
...
...
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