Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
chain33-pai
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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ligaishun
chain33-pai
Commits
2a6cd6ec
Commit
2a6cd6ec
authored
Oct 12, 2019
by
szh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update import bug
parent
466eb331
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
16 deletions
+17
-16
pai.go
routers/api/v1/pai.go
+2
-14
pai.go
service/pai_service/pai.go
+15
-2
No files found.
routers/api/v1/pai.go
View file @
2a6cd6ec
...
@@ -9,18 +9,6 @@ import (
...
@@ -9,18 +9,6 @@ import (
"chain33-pai/service/stat_service"
"chain33-pai/service/stat_service"
)
)
type
ReqTicketInfo
struct
{
Addr
string
`json:"addr" binding:"requried"`
Page
int32
`json:"page"`
Pageszie
int32
`json:"pageszie"`
Detail
bool
`json:"detail"`
}
type
ReqMineTime
struct
{
Addr
string
`json:"addr" binding:"requried"`
StartTime
int64
`json:"start_time"`
EndTime
int64
`json:"end_time"`
}
func
GetDevdetail
(
c
*
gin
.
Context
)
{
func
GetDevdetail
(
c
*
gin
.
Context
)
{
appG
:=
app
.
Gin
{
C
:
c
}
appG
:=
app
.
Gin
{
C
:
c
}
...
@@ -48,7 +36,7 @@ func GetDevstatus(c *gin.Context) {
...
@@ -48,7 +36,7 @@ func GetDevstatus(c *gin.Context) {
func
GetTicketInfo
(
c
*
gin
.
Context
)
{
func
GetTicketInfo
(
c
*
gin
.
Context
)
{
appG
:=
app
.
Gin
{
C
:
c
}
appG
:=
app
.
Gin
{
C
:
c
}
var
req
ReqTicketInfo
var
req
pai_service
.
ReqTicketInfo
c
.
BindJSON
(
&
req
)
c
.
BindJSON
(
&
req
)
if
req
.
Detail
{
if
req
.
Detail
{
if
req
.
Page
==
0
{
if
req
.
Page
==
0
{
...
@@ -69,7 +57,7 @@ func GetTicketInfo(c *gin.Context) {
...
@@ -69,7 +57,7 @@ func GetTicketInfo(c *gin.Context) {
func
RecordMineTime
(
c
*
gin
.
Context
)
{
func
RecordMineTime
(
c
*
gin
.
Context
)
{
appG
:=
app
.
Gin
{
C
:
c
}
appG
:=
app
.
Gin
{
C
:
c
}
var
req
ReqMineTime
var
req
pai_service
.
ReqMineTime
err
:=
c
.
BindJSON
(
&
req
)
err
:=
c
.
BindJSON
(
&
req
)
if
err
!=
nil
{
if
err
!=
nil
{
appG
.
Response
(
http
.
StatusOK
,
e
.
ERROR
,
nil
)
appG
.
Response
(
http
.
StatusOK
,
e
.
ERROR
,
nil
)
...
...
service/pai_service/pai.go
View file @
2a6cd6ec
...
@@ -9,7 +9,6 @@ import (
...
@@ -9,7 +9,6 @@ import (
"chain33-pai/pkg/chain33"
"chain33-pai/pkg/chain33"
"chain33-pai/pkg/logging"
"chain33-pai/pkg/logging"
"github.com/33cn/chain33/types"
"github.com/33cn/chain33/types"
"chain33-pai/routers/api/v1"
"chain33-pai/models"
"chain33-pai/models"
)
)
...
@@ -44,6 +43,20 @@ type MinedTxInfo struct {
...
@@ -44,6 +43,20 @@ type MinedTxInfo struct {
BlockTime
int64
`json:"block_time"`
BlockTime
int64
`json:"block_time"`
}
}
type
ReqTicketInfo
struct
{
Addr
string
`json:"addr" binding:"requried"`
Page
int32
`json:"page"`
Pageszie
int32
`json:"pageszie"`
Detail
bool
`json:"detail"`
}
type
ReqMineTime
struct
{
Addr
string
`json:"addr" binding:"requried"`
StartTime
int64
`json:"start_time"`
EndTime
int64
`json:"end_time"`
}
func
(
p
*
Pai
)
GetConfig
()
bool
{
func
(
p
*
Pai
)
GetConfig
()
bool
{
if
pai_serial
!=
""
{
if
pai_serial
!=
""
{
p
.
Serial
=
pai_serial
p
.
Serial
=
pai_serial
...
@@ -143,7 +156,7 @@ func getPaiConfig(command string ,arg ...string) (config map[string]string,err e
...
@@ -143,7 +156,7 @@ func getPaiConfig(command string ,arg ...string) (config map[string]string,err e
return
list
,
nil
return
list
,
nil
}
}
func
(
p
*
Pai
)
GetTicketInfo
(
req
*
v1
.
ReqTicketInfo
)
(
*
MinedInfo
,
error
)
{
func
(
p
*
Pai
)
GetTicketInfo
(
req
*
ReqTicketInfo
)
(
*
MinedInfo
,
error
)
{
var
info
MinedInfo
var
info
MinedInfo
txsList
:=
make
([]
*
MinedTxInfo
,
0
)
txsList
:=
make
([]
*
MinedTxInfo
,
0
)
stat
,
err
:=
models
.
GetAddr
(
req
.
Addr
)
stat
,
err
:=
models
.
GetAddr
(
req
.
Addr
)
...
...
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