From 3e72a10e4e596451efdfebf6b0b3105a0e6da39b Mon Sep 17 00:00:00 2001
From: zhangqian <zhangqian@123.com>
Date: 星期五, 27 十月 2023 16:05:53 +0800
Subject: [PATCH] add log
---
api/v1/plc_brand.go | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/api/v1/plc_brand.go b/api/v1/plc_brand.go
index 94ada0d..2475b9f 100644
--- a/api/v1/plc_brand.go
+++ b/api/v1/plc_brand.go
@@ -7,7 +7,7 @@
"apsClient/pkg/ecode"
"apsClient/service"
"github.com/gin-gonic/gin"
- "strconv"
+ "github.com/spf13/cast"
)
type PlcBrandApi struct{}
@@ -48,7 +48,7 @@
return
}
- id, _ := strconv.Atoi(c.Param("id"))
+ id := cast.ToUint(c.Param("id"))
errCode := service.NewPlcBrandService().DeletePlcBrand(id)
if errCode != ecode.OK {
ctx.Fail(errCode)
@@ -71,10 +71,10 @@
if !ok {
return
}
- if params.Id == 0 {
+ if params.ID == 0 {
ctx.Fail(ecode.ParamsErr)
}
- params.PlcBrand.Id = params.Id
+ params.PlcBrand.ID = params.ID
errCode := service.NewPlcBrandService().UpdatePlcBrand(¶ms.PlcBrand)
if errCode != ecode.OK {
--
Gitblit v1.8.0