Compare commits

...

2 Commits

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" cloud2 "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/models/cloud"
"gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils" "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils"
"net/http" "net/http"
"strconv"
"time" "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{ param := &cloud.CreateParam{
Name: req.Name, Name: req.Name,
Description: req.Description, Description: req.Description,
@ -98,6 +99,10 @@ func (l *ContainerCreateLogic) ContainerCreate(req *container.CreateParam) (resp
if tx.Error != nil { if tx.Error != nil {
} }
resp = taskModel.Id resp.TaskId = strconv.FormatInt(taskModel.Id, 10)
return return resp, nil
}
type ContainerCreateRespStruct struct {
TaskId string `json:"taskId"`
} }