diff --git a/adaptor/PCM-HPC/PCM-AC/rpc/internal/logic/listhistoryjoblogic.go b/adaptor/PCM-HPC/PCM-AC/rpc/internal/logic/listhistoryjoblogic.go index 5459a4a8..63b14232 100644 --- a/adaptor/PCM-HPC/PCM-AC/rpc/internal/logic/listhistoryjoblogic.go +++ b/adaptor/PCM-HPC/PCM-AC/rpc/internal/logic/listhistoryjoblogic.go @@ -32,7 +32,7 @@ func NewListHistoryJobLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Li func (l *ListHistoryJobLogic) ListHistoryJob(in *hpcAC.ListHistoryJobReq) (*hpcAC.ListHistoryJobResp, error) { var resp hpcAC.ListHistoryJobResp - historyJobUrl := "hpc/openapi/v2/historyjobs?" + //historyJobUrl := "hpc/openapi/v2/historyjobs?" getTokenLogic := NewGetACTokenLogic(l.ctx, l.svcCtx) 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("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 { 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.Msg = jsonResult.Get("msg").MustString() - resp.Data.List = Jobs + resp.Msg = jsonResult.Get("data").Get("msg").MustString() + data := hpcAC.HistoryJobData{} + data.List = Jobs + resp.Data = &data return &resp, nil }