From a1f8e46fec072225edd203c184b9cf8a5011ea77 Mon Sep 17 00:00:00 2001 From: zhangwei <894646498@qq.com> Date: Wed, 30 Jul 2025 15:41:51 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=B9=E5=99=A8=E5=88=9B=E5=BB=BA=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E8=BF=94=E5=9B=9E=E4=BB=BB=E5=8A=A1id?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/logic/cloud/containercreatelogic.go | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/internal/logic/cloud/containercreatelogic.go b/internal/logic/cloud/containercreatelogic.go index c0549e248..a268c58a6 100644 --- a/internal/logic/cloud/containercreatelogic.go +++ b/internal/logic/cloud/containercreatelogic.go @@ -26,6 +26,7 @@ import ( cloud2 "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/models/cloud" "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils" "net/http" + "strconv" "time" ) @@ -43,8 +44,8 @@ func NewContainerCreateLogic(ctx context.Context, svcCtx *svc.ServiceContext) *C } } -func (l *ContainerCreateLogic) ContainerCreate(req *container.CreateParam) (resp interface{}, err error) { - +func (l *ContainerCreateLogic) ContainerCreate(req *container.CreateParam) (resp *ContainerCreateRespStruct, err error) { + resp = &ContainerCreateRespStruct{} param := &cloud.CreateParam{ Name: req.Name, Description: req.Description, @@ -98,6 +99,10 @@ func (l *ContainerCreateLogic) ContainerCreate(req *container.CreateParam) (resp if tx.Error != nil { } - resp = taskModel.Id - return + resp.TaskId = strconv.FormatInt(taskModel.Id, 10) + return resp, nil +} + +type ContainerCreateRespStruct struct { + TaskId string `json:"taskId"` }