From e5bba51b500fdb501496d0cf0e3396dd77f1d156 Mon Sep 17 00:00:00 2001 From: qhd <1766646056@qq.com> Date: Thu, 3 Sep 2026 15:43:36 +0800 Subject: [PATCH] =?UTF-8?q?fix(model-gateway):=20=E5=A4=84=E7=90=86?= =?UTF-8?q?=E6=A8=A1=E5=9E=8B=E5=90=8D=E7=A7=B0=E9=87=8D=E5=A4=8D=E6=97=B6?= =?UTF-8?q?=E8=BF=94=E5=9B=9E=E5=B7=B2=E6=9C=89=E6=A8=A1=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 移除 replace 本地依赖,改用 common v0.0.33;重名时直接返回已存在的模型。 --- go.mod | 3 --- go.sum | 2 ++ service/model_manage_service.go | 4 +++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index fb64bd3..6fa4edb 100644 --- a/go.mod +++ b/go.mod @@ -105,6 +105,3 @@ require ( google.golang.org/protobuf v1.36.8 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) - -// 本地消费未发布的新 common(redislock/rediscount 下沉 utils 后的新增方法);发 tag 后移除 -replace gitea.redpowerfuture.com/red-future/common => ../common diff --git a/go.sum b/go.sum index c12671c..82a2248 100644 --- a/go.sum +++ b/go.sum @@ -1,4 +1,6 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +gitea.redpowerfuture.com/red-future/common v0.0.33 h1:AhWJ6l9zrjc1U0UEfyIZu8wkkVFxNe0hfuA51vOnOIo= +gitea.redpowerfuture.com/red-future/common v0.0.33/go.mod h1:FtI9KJJSKo4/K0emjVkbL8yoSIPHJdZXr27vnScQpmM= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/toml v1.5.0 h1:W5quZX/G/csjUnuI8SUYlsHs9M38FC7znL0lIO+DvMg= github.com/BurntSushi/toml v1.5.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho= diff --git a/service/model_manage_service.go b/service/model_manage_service.go index 06469f7..c0473d9 100644 --- a/service/model_manage_service.go +++ b/service/model_manage_service.go @@ -111,7 +111,9 @@ func (s *modelManageService) Update(ctx context.Context, req *dto.UpdateModelMan return } if exist != nil && exist.Id != req.Id { - return fmt.Errorf("模型名称 [%s] 已存在,同一用户下不能重复添加同名模型", req.ModelName) + res, err = s.Get(ctx, &dto.GetModelManageReq{Id: exist.Id}) + return + //return fmt.Errorf("模型名称 [%s] 已存在,同一用户下不能重复添加同名模型", req.ModelName) } }