改用core核心库包
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"ems.agt/lib/core/utils/ctx"
|
||||
"ems.agt/lib/dborm"
|
||||
"ems.agt/lib/services"
|
||||
"ems.agt/restagent/config"
|
||||
@@ -89,7 +90,7 @@ func Iooptions(w http.ResponseWriter, r *http.Request) {
|
||||
func LoadMonitor(w http.ResponseWriter, r *http.Request) {
|
||||
// json 請求參數獲取
|
||||
var bodyArgs MonitorSearch
|
||||
err := services.ShouldBindJSON(r, &bodyArgs)
|
||||
err := ctx.ShouldBindJSON(r, &bodyArgs)
|
||||
if err != nil || dborm.DbClient.XEngine == nil {
|
||||
services.ResponseErrorWithJson(w, 400, err.Error())
|
||||
return
|
||||
|
||||
@@ -6,6 +6,7 @@ import (
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"ems.agt/lib/core/utils/ctx"
|
||||
"ems.agt/lib/log"
|
||||
"ems.agt/lib/services"
|
||||
"ems.agt/lib/wsinfo"
|
||||
@@ -48,7 +49,7 @@ func StopProcess(w http.ResponseWriter, r *http.Request) {
|
||||
var bodyArgs struct {
|
||||
PID int32 `json:"PID" validate:"required"`
|
||||
}
|
||||
err := services.ShouldBindJSON(r, &bodyArgs)
|
||||
err := ctx.ShouldBindJSON(r, &bodyArgs)
|
||||
if err != nil {
|
||||
log.Error("io.ReadAll is failed:", err)
|
||||
services.ResponseErrorWithJson(w, 400, err.Error())
|
||||
@@ -74,7 +75,7 @@ func Ping(w http.ResponseWriter, r *http.Request) {
|
||||
Host string `json:"host" validate:"required"`
|
||||
Port string `json:"port" validate:"required"`
|
||||
}
|
||||
err := services.ShouldBindJSON(r, &bodyArgs)
|
||||
err := ctx.ShouldBindJSON(r, &bodyArgs)
|
||||
if err != nil {
|
||||
log.Error("io.ReadAll is failed:", err)
|
||||
services.ResponseErrorWithJson(w, 400, err.Error())
|
||||
|
||||
Reference in New Issue
Block a user