Browse Source

added get balance api

Former-commit-id: 2c8df40865
pull/188/head
tzwang 1 year ago
parent
commit
130b116b52
3 changed files with 17 additions and 0 deletions
  1. +3
    -0
      api/desc/pcm.api
  2. +9
    -0
      api/desc/schedule/pcm-schedule.api
  3. +5
    -0
      api/internal/logic/core/pagelisttasklogic.go

+ 3
- 0
api/desc/pcm.api View File

@@ -978,6 +978,9 @@ service pcm {

@handler GetComputeCardsByClusterHandler
get /schedule/getComputeCardsByCluster/:adapterId/:clusterId (GetComputeCardsByClusterReq) returns (GetComputeCardsByClusterResp)

@handler GetClusterBalanceByIdHandler
get /schedule/getClusterBalanceById/:adapterId/:clusterId (GetClusterBalanceByIdReq) returns (GetClusterBalanceByIdResp)
}

@server(


+ 9
- 0
api/desc/schedule/pcm-schedule.api View File

@@ -141,4 +141,13 @@ type (
GetComputeCardsByClusterResp {
Cards []string `json:"cards"`
}

GetClusterBalanceByIdReq{
AdapterId string `path:"adapterId"`
ClusterId string `path:"clusterId"`
}

GetClusterBalanceByIdResp{
Balance float64 `json:"balance"`
}
)

+ 5
- 0
api/internal/logic/core/pagelisttasklogic.go View File

@@ -143,6 +143,11 @@ func (l *PageListTaskLogic) updateTaskStatus(tasks []*types.TaskModel, ch chan<-
}
}

if len(aiTask) == 0 {
ch <- struct{}{}
return
}

start, _ := time.ParseInLocation(constants.Layout, aiTask[0].StartTime, time.Local)
end, _ := time.ParseInLocation(constants.Layout, aiTask[0].EndTime, time.Local)



Loading…
Cancel
Save