Merge pull request '提交超算任务接口修改clusterId参数类型' (#338) from zhangweiii/pcm-coordinator:master into master

This commit is contained in:
zhangweiii 2024-11-11 15:41:28 +08:00
commit 2f10d7d71a
5 changed files with 8 additions and 8 deletions

View File

@ -133,7 +133,7 @@ type (
type (
getClusterListReq {
Id int64 `form:"id"`
AdapterId int64 `form:"adapterId"`
}
getClusterListResp {
Clusters []ClusterInfo `json:"clusters"`

View File

@ -10,7 +10,7 @@ info(
type (
commitHpcTaskReq {
ClusterId int64 `json:"clusterId,optional"`
ClusterId string `json:"clusterId,optional"`
Name string `json:"name"`
Account string `json:"account,optional"`
Description string `json:"description,optional"`

View File

@ -25,6 +25,6 @@ func NewGetClusterListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Ge
func (l *GetClusterListLogic) GetClusterList(req *types.GetClusterListReq) (resp *types.GetClusterListResp, err error) {
resp = &types.GetClusterListResp{}
//clusters := []models.ScParticipantPhyInfo{}
l.svcCtx.DbEngin.Find(resp.Clusters).Where("id", req.Id)
l.svcCtx.DbEngin.Raw("select * from t_cluster where adapter_id = ?", req.AdapterId).Scan(&resp.Clusters)
return resp, nil
}

View File

@ -58,12 +58,12 @@ func (l *CommitHpcTaskLogic) CommitHpcTask(req *types.CommitHpcTaskReq) (resp *t
if len(adapterName) == 0 || adapterName == "" {
return nil, errors.New("no corresponding adapter found")
}
clusterId, err := strconv.ParseInt(req.ClusterId, 10, 64)
hpcInfo := models.TaskHpc{
TaskId: taskModel.Id,
AdapterId: clusterInfo.AdapterId,
AdapterName: adapterName,
ClusterId: req.ClusterId,
ClusterId: clusterId,
ClusterName: clusterInfo.Name,
Name: taskModel.Name,
CmdScript: req.CmdScript,
@ -97,7 +97,7 @@ func (l *CommitHpcTaskLogic) CommitHpcTask(req *types.CommitHpcTaskReq) (resp *t
noticeInfo := clientCore.NoticeInfo{
AdapterId: clusterInfo.AdapterId,
AdapterName: adapterName,
ClusterId: req.ClusterId,
ClusterId: clusterId,
ClusterName: clusterInfo.Name,
NoticeType: "create",
TaskName: req.Name,

View File

@ -119,7 +119,7 @@ type ClusterLoadRecord struct {
}
type GetClusterListReq struct {
Id int64 `form:"id"`
AdapterId int64 `form:"adapterId"`
}
type GetClusterListResp struct {
@ -1276,7 +1276,7 @@ type CommonResp struct {
}
type CommitHpcTaskReq struct {
ClusterId int64 `json:"clusterId,optional"`
ClusterId string `json:"clusterId,optional"`
Name string `json:"name"`
Account string `json:"account,optional"`
Description string `json:"description,optional"`