Commit 2a6cd6ec authored by szh's avatar szh

update import bug

parent 466eb331
...@@ -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)
......
...@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment