From 5e4d9f05035d1153ab191dd1cb0a4922b91983b2 Mon Sep 17 00:00:00 2001
From: zhangqian <zhangqian@123.com>
Date: 星期三, 11 十月 2023 14:36:37 +0800
Subject: [PATCH] debug

---
 api/v1/task.go |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/api/v1/task.go b/api/v1/task.go
index 5604993..ce5b49d 100644
--- a/api/v1/task.go
+++ b/api/v1/task.go
@@ -9,7 +9,6 @@
 	"apsClient/model/response"
 	"apsClient/nsq"
 	"apsClient/pkg/contextx"
-	"apsClient/pkg/convertx"
 	"apsClient/pkg/ecode"
 	"apsClient/pkg/logx"
 	"apsClient/pkg/safe"
@@ -18,7 +17,8 @@
 	"errors"
 	"fmt"
 	"github.com/gin-gonic/gin"
-	"gorm.io/gorm"
+	"github.com/jinzhu/gorm"
+	"github.com/spf13/cast"
 	"sort"
 	"sync"
 	"time"
@@ -144,7 +144,7 @@
 		ctx.Fail(ecode.ParamsErr)
 		return
 	}
-	id := convertx.Atoi(idx)
+	id := cast.ToUint(idx)
 	procedure, code := service.NewTaskService().GetProcedureById(id)
 	if code != ecode.OK {
 		ctx.Fail(code)
@@ -212,7 +212,7 @@
 		ctx.Fail(ecode.ParamsErr)
 		return
 	}
-	id := convertx.Atoi(idx)
+	id := cast.ToUint(idx)
 	procedure, code := service.NewTaskService().GetProcedureById(id)
 	if code != ecode.OK {
 		ctx.Fail(code)
@@ -308,7 +308,7 @@
 		return
 	}
 	plcConfig, code := service.NewDevicePlcService().GetDevicePlc()
-	if code != ecode.OK || plcConfig.Id == 0 {
+	if code != ecode.OK || plcConfig.ID == 0 {
 		ctx.FailWithMsg(ecode.NeedConfirmedErr, "璇峰厛閰嶇疆PLC")
 		return
 	}
@@ -388,7 +388,7 @@
 	}
 
 	plcConfig, code := service.NewDevicePlcService().GetDevicePlc()
-	if code != ecode.OK || plcConfig.Id == 0 {
+	if code != ecode.OK || plcConfig.ID == 0 {
 		ctx.FailWithMsg(ecode.NeedConfirmedErr, "璇峰厛閰嶇疆PLC")
 		return
 	}

--
Gitblit v1.8.0