From 3ca8f1290232818ca2720fa3a9a736ca1d52a1a8 Mon Sep 17 00:00:00 2001 From: zhangqian <zhangqian@123.com> Date: 星期六, 07 十月 2023 20:42:32 +0800 Subject: [PATCH] gorm版本v2改成v1 --- api/v1/task.go | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/api/v1/task.go b/api/v1/task.go index 419316b..f0631d5 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" @@ -137,7 +137,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) @@ -197,7 +197,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) @@ -294,7 +294,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 } -- Gitblit v1.8.0