From d5a02ee0268883cd39b8de257c089908aef2f4d6 Mon Sep 17 00:00:00 2001 From: huangzhiran <30522704+huangzhiran@users.noreply.github.com> Date: Mon, 6 Jan 2025 17:24:14 +0800 Subject: [PATCH] task path add v1 (#796) --- e2e/util.go | 4 ++-- service/apinode/api/http.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/e2e/util.go b/e2e/util.go index 32b2c1e6..0e3e28e4 100644 --- a/e2e/util.go +++ b/e2e/util.go @@ -70,7 +70,7 @@ func signMesssage(data []byte, projectID uint64, cfg *project.Config, key *ecdsa } func createTask(body []byte, apiurl string) (string, error) { - req, err := http.NewRequest("POST", fmt.Sprintf("%s/task", apiurl), bytes.NewBuffer(body)) + req, err := http.NewRequest("POST", fmt.Sprintf("%s/v1/task", apiurl), bytes.NewBuffer(body)) if err != nil { return "", err } @@ -100,7 +100,7 @@ func createTask(body []byte, apiurl string) (string, error) { } func queryTask(taskID string, apiurl string) (*api.QueryTaskResp, error) { - resp, err := http.Get(fmt.Sprintf("%s/task/%s", apiurl, taskID)) + resp, err := http.Get(fmt.Sprintf("%s/v1/task/%s", apiurl, taskID)) if err != nil { return nil, errors.Wrap(err, "failed to send request") } diff --git a/service/apinode/api/http.go b/service/apinode/api/http.go index 07e4dc70..0ae2951f 100644 --- a/service/apinode/api/http.go +++ b/service/apinode/api/http.go @@ -451,8 +451,8 @@ func Run(p *db.DB, projectManager *project.Manager, proverAddr: proverAddr, } - s.engine.POST("/task", s.createTask) - s.engine.GET("/task/:id", s.queryTask) + s.engine.POST("/v1/task", s.createTask) + s.engine.GET("/v1/task/:id", s.queryTask) metrics.RegisterMetrics(s.engine) if err := s.engine.Run(addr); err != nil {