Merge pull request '容器创建接口返回任务id' (#530) from zhangweiii/pcm-coordinator:master into master
This commit is contained in:
commit
7fac75cdf6
|
@ -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"`
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue