修复节点信息API
This commit is contained in:
@@ -2,7 +2,9 @@ package handler
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"net/http"
|
||||
"strconv"
|
||||
"strings"
|
||||
@@ -197,9 +199,19 @@ func NodeTidalabSubmit(c *gin.Context) {
|
||||
|
||||
func NodeAlive(c *gin.Context) {
|
||||
node := c.MustGet("node").(*model.Server)
|
||||
setNodeLastCheck(node)
|
||||
|
||||
if c.Request.Method == http.MethodGet {
|
||||
Success(c, true)
|
||||
return
|
||||
}
|
||||
|
||||
var payload map[string][]string
|
||||
if err := c.ShouldBindJSON(&payload); err != nil {
|
||||
if errors.Is(err, io.EOF) {
|
||||
Success(c, true)
|
||||
return
|
||||
}
|
||||
Fail(c, 400, "invalid payload")
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user