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"` }