容器创建接口返回任务id #530

Merged
zhangweiii merged 1 commits from zhangweiii/pcm-coordinator:master into master 2025-07-30 15:41:24 +08:00
1 changed files with 9 additions and 4 deletions

View File

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