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
1
Merge Requests
1
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
szh
chain33-pai
Commits
9a8f6a45
Commit
9a8f6a45
authored
Aug 04, 2020
by
szh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加通用节点操作接口
parent
41c3a614
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
0 deletions
+23
-0
raspberryChan.go
pkg/app/raspberryChan.go
+3
-0
node.go
routers/api/v1/node.go
+18
-0
router.go
routers/router.go
+2
-0
No files found.
pkg/app/raspberryChan.go
View file @
9a8f6a45
...
@@ -89,6 +89,9 @@ func RaspberryChan() {
...
@@ -89,6 +89,9 @@ func RaspberryChan() {
}
}
updateJobMap
(
value
.
JobID
,
err
)
updateJobMap
(
value
.
JobID
,
err
)
tlog
.
Info
(
"RaspberryChan resetWallet success"
,
"err"
,
nil
)
tlog
.
Info
(
"RaspberryChan resetWallet success"
,
"err"
,
nil
)
default
:
tlog
.
Error
(
"RaspberryChan not support type"
,
"msg"
,
value
.
Name
)
updateJobMap
(
value
.
JobID
,
errors
.
New
(
"RaspberryChan not support type"
))
}
}
}
}
...
...
routers/api/v1/node.go
View file @
9a8f6a45
...
@@ -615,3 +615,20 @@ func JobStatus(c *gin.Context) {
...
@@ -615,3 +615,20 @@ func JobStatus(c *gin.Context) {
}
}
appG
.
Response
(
http
.
StatusOK
,
e
.
JOB_NOT_DONE
,
nil
)
appG
.
Response
(
http
.
StatusOK
,
e
.
JOB_NOT_DONE
,
nil
)
}
}
func
BityuanJob
(
c
*
gin
.
Context
)
{
type
JReq
struct
{
JobMsg
string
`json:"job_msg" binding:"required"`
}
var
req
JReq
appG
:=
app
.
Gin
{
C
:
c
}
err
:=
appG
.
C
.
ShouldBindJSON
(
&
req
)
if
err
!=
nil
{
appG
.
Response
(
http
.
StatusOK
,
e
.
INVALID_PARAMS
,
nil
)
tlog
.
Info
(
"invalid params"
)
return
}
util
.
AddValue
(
&
app
.
JobID
,
1
)
app
.
JobChan
<-
app
.
MsgType
{
Name
:
req
.
JobMsg
,
JobID
:
app
.
JobID
}
appG
.
Response
(
http
.
StatusOK
,
e
.
SUCCESS
,
app
.
JobID
)
}
\ No newline at end of file
routers/router.go
View file @
9a8f6a45
...
@@ -67,6 +67,8 @@ func InitRouter() *gin.Engine {
...
@@ -67,6 +67,8 @@ func InitRouter() *gin.Engine {
apiv1
.
POST
(
"/delbackup"
,
v1
.
DelBackup
)
apiv1
.
POST
(
"/delbackup"
,
v1
.
DelBackup
)
//是否备份
//是否备份
apiv1
.
POST
(
"/isbackup"
,
v1
.
CheckBackup
)
apiv1
.
POST
(
"/isbackup"
,
v1
.
CheckBackup
)
//节点操作通用接口
apiv1
.
POST
(
"/bityuanjob"
,
v1
.
BityuanJob
)
//获取任务完成情况
//获取任务完成情况
apiv1
.
POST
(
"/jobstatus"
,
v1
.
JobStatus
)
apiv1
.
POST
(
"/jobstatus"
,
v1
.
JobStatus
)
return
r
return
r
...
...
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