浏览代码

调整沙盘模块返回值处理移除了AddSandbox函数中不必要的lastId返回值,因为在当前的业务逻辑中未使用该值。相应地,调整了调用AddSandbox时的代码逻辑,确保错误处理正常进行,而不返回具体的ID值。

Roc 6 月之前
父节点
当前提交
0d48e1487a
共有 2 个文件被更改,包括 3 次插入4 次删除
  1. 1 1
      models/sandbox/sandbox.go
  2. 2 3
      services/sandbox/sandbox.go

+ 1 - 1
models/sandbox/sandbox.go

@@ -331,7 +331,7 @@ type SandboxListResp struct {
 	List   []*SandboxListItems
 }
 
-func AddSandbox(item *Sandbox) (lastId int64, err error) {
+func AddSandbox(item *Sandbox) (err error) {
 	//o := orm.NewOrmUsingDB("data")
 	//lastId, err = o.Insert(item)
 	err = global.DmSQL["data"].Create(item).Error

+ 2 - 3
services/sandbox/sandbox.go

@@ -805,11 +805,10 @@ func AddSandboxV2(req request.AddAndEditSandboxV2, opUserId int, opUserName stri
 	}
 
 	//新增沙盘
-	id, err := sandbox.AddSandbox(sandboxInfo)
+	err = sandbox.AddSandbox(sandboxInfo)
 	if err != nil {
 		return
 	}
-	sandboxInfo.SandboxId = int(id)
 	resp.Sandbox = sandboxInfo
 	return
 }
@@ -976,4 +975,4 @@ func GetSandBoxClassifyChildIds(classifyId int, classifymap map[int]*sandbox.San
 			GetSandBoxClassifyChildIds(item.SandboxClassifyId, classifymap, childIds)
 		}
 	}
-}
+}