ac listhitoryjob
This commit is contained in:
parent
231524986d
commit
aae80f97e2
|
@ -32,7 +32,7 @@ func NewListHistoryJobLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Li
|
||||||
func (l *ListHistoryJobLogic) ListHistoryJob(in *hpcAC.ListHistoryJobReq) (*hpcAC.ListHistoryJobResp, error) {
|
func (l *ListHistoryJobLogic) ListHistoryJob(in *hpcAC.ListHistoryJobReq) (*hpcAC.ListHistoryJobResp, error) {
|
||||||
|
|
||||||
var resp hpcAC.ListHistoryJobResp
|
var resp hpcAC.ListHistoryJobResp
|
||||||
historyJobUrl := "hpc/openapi/v2/historyjobs?"
|
//historyJobUrl := "hpc/openapi/v2/historyjobs?"
|
||||||
|
|
||||||
getTokenLogic := NewGetACTokenLogic(l.ctx, l.svcCtx)
|
getTokenLogic := NewGetACTokenLogic(l.ctx, l.svcCtx)
|
||||||
tokenResp, _ := getTokenLogic.GetACToken(&hpcAC.ACTokenReq{})
|
tokenResp, _ := getTokenLogic.GetACToken(&hpcAC.ACTokenReq{})
|
||||||
|
@ -53,8 +53,8 @@ func (l *ListHistoryJobLogic) ListHistoryJob(in *hpcAC.ListHistoryJobReq) (*hpcA
|
||||||
params.Add("limit", string(in.Limit))
|
params.Add("limit", string(in.Limit))
|
||||||
params.Add("isQueryByQueueTime", in.IsQueryByQueueTime)
|
params.Add("isQueryByQueueTime", in.IsQueryByQueueTime)
|
||||||
|
|
||||||
reqUrl, err := http.NewRequest("GET", "https://api01.hpccube.com:65106/"+historyJobUrl+params.Encode(), nil)
|
//reqUrl, err := http.NewRequest("GET", "https://api01.hpccube.com:65106/"+historyJobUrl+params.Encode(), nil)
|
||||||
|
reqUrl, err := http.NewRequest("GET", "https://api01.hpccube.com:65106/hpc/openapi/v2/historyjobs?strClusterNameList=1638523853&startTime=2022-12-05+01%3A01%3A01&endTime=2023-12-08+01%3A01%3A01&timeType=CUSTOM&start=0&limit=25&isQueryByQueueTime=true", nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
|
@ -119,11 +119,13 @@ func (l *ListHistoryJobLogic) ListHistoryJob(in *hpcAC.ListHistoryJobReq) (*hpcA
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if jsonResult.Get("code").MustInt() == 0 {
|
if jsonResult.Get("data").Get("code").MustInt() == 0 {
|
||||||
resp.Code = "200"
|
resp.Code = "200"
|
||||||
}
|
}
|
||||||
resp.Msg = jsonResult.Get("msg").MustString()
|
resp.Msg = jsonResult.Get("data").Get("msg").MustString()
|
||||||
resp.Data.List = Jobs
|
data := hpcAC.HistoryJobData{}
|
||||||
|
data.List = Jobs
|
||||||
|
resp.Data = &data
|
||||||
|
|
||||||
return &resp, nil
|
return &resp, nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue