创建任务添加user_id
This commit is contained in:
parent
dd2141de25
commit
cdff8aeb0c
|
@ -13,6 +13,7 @@ import (
|
|||
"k8s.io/apimachinery/pkg/util/json"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
|
@ -65,7 +66,9 @@ func (l *CreateClusterLogic) CreateCluster(req *types.ClusterCreateReq) (resp *t
|
|||
return nil, errors.New("cluster create failed")
|
||||
}
|
||||
// 创建资源价格信息
|
||||
clusterId, _ := strconv.ParseInt(cluster.Id, 10, 64)
|
||||
resourcePrice := &types.ResourcePrice{
|
||||
ResourceID: clusterId,
|
||||
Price: req.Price,
|
||||
ResourceType: constants.CLUSTER,
|
||||
CostType: req.CostType,
|
||||
|
|
|
@ -99,6 +99,7 @@ func (l *CommitGeneralTaskLogic) CommitGeneralTask(req *types.GeneralTaskReq) er
|
|||
AdapterTypeDict: "0",
|
||||
SynergyStatus: synergyStatus,
|
||||
Strategy: strategy,
|
||||
UserId: req.UserId,
|
||||
}
|
||||
var taskClouds []cloud.TaskCloudModel
|
||||
adapterName := ""
|
||||
|
|
|
@ -48,6 +48,7 @@ func (l *CommitHpcTaskLogic) CommitHpcTask(req *types.CommitHpcTaskReq) (resp *t
|
|||
CommitTime: time.Now(),
|
||||
Status: "Running",
|
||||
AdapterTypeDict: "2",
|
||||
UserId: req.UserId,
|
||||
}
|
||||
|
||||
// 保存任务数据到数据库
|
||||
|
|
|
@ -51,6 +51,7 @@ type (
|
|||
NsID string `db:"ns_id" json:"nsID"`
|
||||
AdapterTypeDict string `db:"adapter_type_dict" json:"adapterTypeDict"` //任务类型(对应字典表的值)
|
||||
TaskTypeDict string `db:"task_type_dict" json:"taskTypeDict"`
|
||||
UserId int64 `db:"user_id" json:"userId"`
|
||||
}
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in New Issue