From 23567a99c0d048a6adf4fb9ff8885b0805246cb7 Mon Sep 17 00:00:00 2001 From: Xiaolong Lu Date: Mon, 23 May 2022 10:22:35 +0800 Subject: [PATCH] Refactor (#219) * update: server-v2 * updata: format --- app/utils/http.ts | 7 +- server-v2/Makefile | 2 +- server-v2/api/studio/.goctl/api/handler.tpl | 2 +- server-v2/api/studio/etc/studio-api.yaml | 2 +- server-v2/api/studio/internal/common/utils.go | 3 + .../handler/file/filedestroyhandler.go | 8 +- .../handler/file/filesindexhandler.go | 4 +- .../handler/file/fileuploadhandler.go | 4 +- .../handler/gateway/batchexecngqlhandler.go | 8 +- .../handler/gateway/connecthandler.go | 8 +- .../handler/gateway/disonnecthandler.go | 8 +- .../handler/gateway/execngqlhandler.go | 8 +- .../internal/handler/health/gethandler.go | 4 +- .../importtask/createimporttaskhandler.go | 8 +- .../importtask/deleteimporttaskhandler.go | 8 +- .../importtask/downloadconfighandler.go | 8 +- .../handler/importtask/downloadlogshandler.go | 8 +- .../importtask/getimporttaskhandler.go | 8 +- .../getimporttasklognameshandler.go | 8 +- .../importtask/getmanyimporttaskhandler.go | 8 +- .../importtask/getmanyimporttaskloghandler.go | 8 +- .../importtask/getworkingdirhandler.go | 17 ++++ .../importtask/stopimporttaskhandler.go | 8 +- .../api/studio/internal/handler/routes.go | 17 ++-- .../internal/logic/file/filedestroylogic.go | 6 +- .../internal/logic/file/filesindexlogic.go | 7 +- .../internal/logic/file/fileuploadlogic.go | 4 +- .../logic/gateway/batchexecngqllogic.go | 6 +- .../internal/logic/gateway/connectlogic.go | 6 +- .../internal/logic/gateway/disonnectlogic.go | 6 +- .../internal/logic/gateway/execngqllogic.go | 6 +- .../studio/internal/logic/health/getlogic.go | 6 +- .../logic/importtask/createimporttasklogic.go | 6 +- .../logic/importtask/deleteimporttasklogic.go | 6 +- .../logic/importtask/downloadconfiglogic.go | 6 +- .../logic/importtask/downloadlogslogic.go | 6 +- .../logic/importtask/getimporttasklogic.go | 6 +- .../importtask/getimporttasklognameslogic.go | 6 +- .../importtask/getmanyimporttasklogic.go | 6 +- .../importtask/getmanyimporttaskloglogic.go | 6 +- .../logic/importtask/getworkingdirlogic.go | 29 +++++++ .../logic/importtask/stopimporttasklogic.go | 6 +- server-v2/api/studio/internal/service/file.go | 13 ++- .../api/studio/internal/service/gateway.go | 52 ++++++++++-- .../api/studio/internal/service/health.go | 4 +- .../api/studio/internal/service/import.go | 18 +++-- .../internal/service/importer/importer.go | 6 +- .../studio/internal/service/importer/task.go | 4 +- .../internal/service/importer/taskmgr.go | 4 +- .../api/studio/internal/svc/servicecontext.go | 6 +- server-v2/api/studio/internal/types/types.go | 21 +++-- server-v2/api/studio/pkg/auth/authorize.go | 79 ++++--------------- server-v2/api/studio/pkg/utils/http.go | 10 +++ server-v2/api/studio/restapi/file.api | 4 +- server-v2/api/studio/restapi/import.api | 17 ++++ server-v2/api/studio/studio.go | 18 ++--- server-v2/go.mod | 2 +- 57 files changed, 325 insertions(+), 237 deletions(-) create mode 100644 server-v2/api/studio/internal/handler/importtask/getworkingdirhandler.go create mode 100644 server-v2/api/studio/internal/logic/importtask/getworkingdirlogic.go diff --git a/app/utils/http.ts b/app/utils/http.ts index eff4ee22..5053da59 100644 --- a/app/utils/http.ts +++ b/app/utils/http.ts @@ -43,8 +43,11 @@ service.interceptors.request.use(config => { service.interceptors.response.use( (response: any) => { - const isExecReq = /api-nebula\/db\/(exec|batchExec)$/.test(response.config?.url); - return isExecReq ? response.data?.data : response.data; + // const isExecReq = /api-nebula\/db\/(exec|batchExec)$/.test(response.config?.url); + if (response.data?.data?.data) { + response.data.data = response.data.data.data; + } + return response.data; }, (error: any) => { if (error.response?.status) { diff --git a/server-v2/Makefile b/server-v2/Makefile index 6340124e..dd3c2007 100644 --- a/server-v2/Makefile +++ b/server-v2/Makefile @@ -67,7 +67,7 @@ $(GOBIN)/goctl: $(call go-get-tool,$(GOBIN)/goctl,github.com/zeromicro/go-zero/tools/goctl@v1.3.2) $(GOBIN)/modelconst-gen: - $(call go-get-tool,$(GOBIN)/modelconst-gen,github.com/vesoft-inc/nebula-studio/server/tools/modelconst-gen) + $(call go-get-tool,$(GOBIN)/modelconst-gen,github.com/vesoft-inc/nebula-studio/server-v2/tools/modelconst-gen) # go-get-tool will 'go get' any package $2 and install it to $1. define go-get-tool diff --git a/server-v2/api/studio/.goctl/api/handler.tpl b/server-v2/api/studio/.goctl/api/handler.tpl index 05881c01..403fe236 100644 --- a/server-v2/api/studio/.goctl/api/handler.tpl +++ b/server-v2/api/studio/.goctl/api/handler.tpl @@ -5,7 +5,7 @@ import ( "net/http" {{if .HasRequest}}"github.com/vesoft-inc/go-pkg/validator" - "github.com/vesoft-inc/nebula-studio/server/api/studio/pkg/ecode" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/pkg/ecode" {{end}}{{if .HasRequest}}"github.com/zeromicro/go-zero/rest/httpx"{{end}} {{.ImportPackages}} diff --git a/server-v2/api/studio/etc/studio-api.yaml b/server-v2/api/studio/etc/studio-api.yaml index 8cbe778a..fa8e2011 100644 --- a/server-v2/api/studio/etc/studio-api.yaml +++ b/server-v2/api/studio/etc/studio-api.yaml @@ -1,6 +1,6 @@ Name: studio-api Host: 0.0.0.0 -Port: 7002 +Port: 9000 MaxBytes: 1073741824 Debug: Enable: false diff --git a/server-v2/api/studio/internal/common/utils.go b/server-v2/api/studio/internal/common/utils.go index 58e64c9c..bdc527d4 100644 --- a/server-v2/api/studio/internal/common/utils.go +++ b/server-v2/api/studio/internal/common/utils.go @@ -7,10 +7,13 @@ import ( var ( ReserveRequestRoutes = []string{ + "/api-nebula/db/disconnect", "/api/files", "/api/import-tasks", } ReserveResponseRoutes = []string{ + "/api-nebula/db/connect", + "/api-nebula/db/disconnect", "/api/import-tasks", } IgnoreHandlerBodyPatterns = []*regexp.Regexp{ diff --git a/server-v2/api/studio/internal/handler/file/filedestroyhandler.go b/server-v2/api/studio/internal/handler/file/filedestroyhandler.go index fc84a36a..710c6e52 100644 --- a/server-v2/api/studio/internal/handler/file/filedestroyhandler.go +++ b/server-v2/api/studio/internal/handler/file/filedestroyhandler.go @@ -5,11 +5,11 @@ import ( "net/http" "github.com/vesoft-inc/go-pkg/validator" - "github.com/vesoft-inc/nebula-studio/server/api/studio/pkg/ecode" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/pkg/ecode" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/logic/file" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/svc" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/types" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/logic/file" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/svc" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/types" "github.com/zeromicro/go-zero/rest/httpx" ) diff --git a/server-v2/api/studio/internal/handler/file/filesindexhandler.go b/server-v2/api/studio/internal/handler/file/filesindexhandler.go index c8ce0aaf..f59964c6 100644 --- a/server-v2/api/studio/internal/handler/file/filesindexhandler.go +++ b/server-v2/api/studio/internal/handler/file/filesindexhandler.go @@ -4,8 +4,8 @@ package file import ( "net/http" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/logic/file" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/svc" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/logic/file" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/svc" ) func FilesIndexHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { diff --git a/server-v2/api/studio/internal/handler/file/fileuploadhandler.go b/server-v2/api/studio/internal/handler/file/fileuploadhandler.go index 93cc8169..a12ec85f 100644 --- a/server-v2/api/studio/internal/handler/file/fileuploadhandler.go +++ b/server-v2/api/studio/internal/handler/file/fileuploadhandler.go @@ -4,8 +4,8 @@ package file import ( "net/http" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/logic/file" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/svc" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/logic/file" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/svc" ) func FileUploadHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { diff --git a/server-v2/api/studio/internal/handler/gateway/batchexecngqlhandler.go b/server-v2/api/studio/internal/handler/gateway/batchexecngqlhandler.go index 56338b7f..c5048d2b 100644 --- a/server-v2/api/studio/internal/handler/gateway/batchexecngqlhandler.go +++ b/server-v2/api/studio/internal/handler/gateway/batchexecngqlhandler.go @@ -5,11 +5,11 @@ import ( "net/http" "github.com/vesoft-inc/go-pkg/validator" - "github.com/vesoft-inc/nebula-studio/server/api/studio/pkg/ecode" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/pkg/ecode" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/logic/gateway" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/svc" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/types" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/logic/gateway" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/svc" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/types" "github.com/zeromicro/go-zero/rest/httpx" ) diff --git a/server-v2/api/studio/internal/handler/gateway/connecthandler.go b/server-v2/api/studio/internal/handler/gateway/connecthandler.go index 66c7096e..8c5353d9 100644 --- a/server-v2/api/studio/internal/handler/gateway/connecthandler.go +++ b/server-v2/api/studio/internal/handler/gateway/connecthandler.go @@ -5,11 +5,11 @@ import ( "net/http" "github.com/vesoft-inc/go-pkg/validator" - "github.com/vesoft-inc/nebula-studio/server/api/studio/pkg/ecode" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/pkg/ecode" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/logic/gateway" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/svc" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/types" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/logic/gateway" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/svc" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/types" "github.com/zeromicro/go-zero/rest/httpx" ) diff --git a/server-v2/api/studio/internal/handler/gateway/disonnecthandler.go b/server-v2/api/studio/internal/handler/gateway/disonnecthandler.go index ef7418dd..c8f02d91 100644 --- a/server-v2/api/studio/internal/handler/gateway/disonnecthandler.go +++ b/server-v2/api/studio/internal/handler/gateway/disonnecthandler.go @@ -5,11 +5,11 @@ import ( "net/http" "github.com/vesoft-inc/go-pkg/validator" - "github.com/vesoft-inc/nebula-studio/server/api/studio/pkg/ecode" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/pkg/ecode" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/logic/gateway" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/svc" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/types" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/logic/gateway" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/svc" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/types" "github.com/zeromicro/go-zero/rest/httpx" ) diff --git a/server-v2/api/studio/internal/handler/gateway/execngqlhandler.go b/server-v2/api/studio/internal/handler/gateway/execngqlhandler.go index 4528908c..6a0541c6 100644 --- a/server-v2/api/studio/internal/handler/gateway/execngqlhandler.go +++ b/server-v2/api/studio/internal/handler/gateway/execngqlhandler.go @@ -5,11 +5,11 @@ import ( "net/http" "github.com/vesoft-inc/go-pkg/validator" - "github.com/vesoft-inc/nebula-studio/server/api/studio/pkg/ecode" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/pkg/ecode" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/logic/gateway" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/svc" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/types" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/logic/gateway" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/svc" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/types" "github.com/zeromicro/go-zero/rest/httpx" ) diff --git a/server-v2/api/studio/internal/handler/health/gethandler.go b/server-v2/api/studio/internal/handler/health/gethandler.go index eab69c84..ce2ff3a9 100644 --- a/server-v2/api/studio/internal/handler/health/gethandler.go +++ b/server-v2/api/studio/internal/handler/health/gethandler.go @@ -4,8 +4,8 @@ package health import ( "net/http" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/logic/health" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/svc" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/logic/health" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/svc" ) func GetHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { diff --git a/server-v2/api/studio/internal/handler/importtask/createimporttaskhandler.go b/server-v2/api/studio/internal/handler/importtask/createimporttaskhandler.go index e043a6f5..5c9255a0 100644 --- a/server-v2/api/studio/internal/handler/importtask/createimporttaskhandler.go +++ b/server-v2/api/studio/internal/handler/importtask/createimporttaskhandler.go @@ -5,11 +5,11 @@ import ( "net/http" "github.com/vesoft-inc/go-pkg/validator" - "github.com/vesoft-inc/nebula-studio/server/api/studio/pkg/ecode" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/pkg/ecode" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/logic/importtask" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/svc" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/types" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/logic/importtask" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/svc" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/types" "github.com/zeromicro/go-zero/rest/httpx" ) diff --git a/server-v2/api/studio/internal/handler/importtask/deleteimporttaskhandler.go b/server-v2/api/studio/internal/handler/importtask/deleteimporttaskhandler.go index c6a12618..9a8a0d1b 100644 --- a/server-v2/api/studio/internal/handler/importtask/deleteimporttaskhandler.go +++ b/server-v2/api/studio/internal/handler/importtask/deleteimporttaskhandler.go @@ -5,11 +5,11 @@ import ( "net/http" "github.com/vesoft-inc/go-pkg/validator" - "github.com/vesoft-inc/nebula-studio/server/api/studio/pkg/ecode" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/pkg/ecode" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/logic/importtask" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/svc" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/types" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/logic/importtask" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/svc" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/types" "github.com/zeromicro/go-zero/rest/httpx" ) diff --git a/server-v2/api/studio/internal/handler/importtask/downloadconfighandler.go b/server-v2/api/studio/internal/handler/importtask/downloadconfighandler.go index 0400faaf..e6616d98 100644 --- a/server-v2/api/studio/internal/handler/importtask/downloadconfighandler.go +++ b/server-v2/api/studio/internal/handler/importtask/downloadconfighandler.go @@ -5,11 +5,11 @@ import ( "net/http" "github.com/vesoft-inc/go-pkg/validator" - "github.com/vesoft-inc/nebula-studio/server/api/studio/pkg/ecode" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/pkg/ecode" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/logic/importtask" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/svc" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/types" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/logic/importtask" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/svc" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/types" "github.com/zeromicro/go-zero/rest/httpx" ) diff --git a/server-v2/api/studio/internal/handler/importtask/downloadlogshandler.go b/server-v2/api/studio/internal/handler/importtask/downloadlogshandler.go index cb4d4b34..fc07c0ab 100644 --- a/server-v2/api/studio/internal/handler/importtask/downloadlogshandler.go +++ b/server-v2/api/studio/internal/handler/importtask/downloadlogshandler.go @@ -5,11 +5,11 @@ import ( "net/http" "github.com/vesoft-inc/go-pkg/validator" - "github.com/vesoft-inc/nebula-studio/server/api/studio/pkg/ecode" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/pkg/ecode" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/logic/importtask" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/svc" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/types" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/logic/importtask" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/svc" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/types" "github.com/zeromicro/go-zero/rest/httpx" ) diff --git a/server-v2/api/studio/internal/handler/importtask/getimporttaskhandler.go b/server-v2/api/studio/internal/handler/importtask/getimporttaskhandler.go index cb53642c..7fb4c089 100644 --- a/server-v2/api/studio/internal/handler/importtask/getimporttaskhandler.go +++ b/server-v2/api/studio/internal/handler/importtask/getimporttaskhandler.go @@ -5,11 +5,11 @@ import ( "net/http" "github.com/vesoft-inc/go-pkg/validator" - "github.com/vesoft-inc/nebula-studio/server/api/studio/pkg/ecode" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/pkg/ecode" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/logic/importtask" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/svc" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/types" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/logic/importtask" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/svc" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/types" "github.com/zeromicro/go-zero/rest/httpx" ) diff --git a/server-v2/api/studio/internal/handler/importtask/getimporttasklognameshandler.go b/server-v2/api/studio/internal/handler/importtask/getimporttasklognameshandler.go index 84aa1e01..fc671658 100644 --- a/server-v2/api/studio/internal/handler/importtask/getimporttasklognameshandler.go +++ b/server-v2/api/studio/internal/handler/importtask/getimporttasklognameshandler.go @@ -5,11 +5,11 @@ import ( "net/http" "github.com/vesoft-inc/go-pkg/validator" - "github.com/vesoft-inc/nebula-studio/server/api/studio/pkg/ecode" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/pkg/ecode" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/logic/importtask" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/svc" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/types" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/logic/importtask" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/svc" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/types" "github.com/zeromicro/go-zero/rest/httpx" ) diff --git a/server-v2/api/studio/internal/handler/importtask/getmanyimporttaskhandler.go b/server-v2/api/studio/internal/handler/importtask/getmanyimporttaskhandler.go index 0937d48c..6ae28c27 100644 --- a/server-v2/api/studio/internal/handler/importtask/getmanyimporttaskhandler.go +++ b/server-v2/api/studio/internal/handler/importtask/getmanyimporttaskhandler.go @@ -5,11 +5,11 @@ import ( "net/http" "github.com/vesoft-inc/go-pkg/validator" - "github.com/vesoft-inc/nebula-studio/server/api/studio/pkg/ecode" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/pkg/ecode" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/logic/importtask" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/svc" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/types" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/logic/importtask" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/svc" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/types" "github.com/zeromicro/go-zero/rest/httpx" ) diff --git a/server-v2/api/studio/internal/handler/importtask/getmanyimporttaskloghandler.go b/server-v2/api/studio/internal/handler/importtask/getmanyimporttaskloghandler.go index b030ea08..56eab629 100644 --- a/server-v2/api/studio/internal/handler/importtask/getmanyimporttaskloghandler.go +++ b/server-v2/api/studio/internal/handler/importtask/getmanyimporttaskloghandler.go @@ -5,11 +5,11 @@ import ( "net/http" "github.com/vesoft-inc/go-pkg/validator" - "github.com/vesoft-inc/nebula-studio/server/api/studio/pkg/ecode" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/pkg/ecode" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/logic/importtask" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/svc" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/types" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/logic/importtask" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/svc" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/types" "github.com/zeromicro/go-zero/rest/httpx" ) diff --git a/server-v2/api/studio/internal/handler/importtask/getworkingdirhandler.go b/server-v2/api/studio/internal/handler/importtask/getworkingdirhandler.go new file mode 100644 index 00000000..112a0fa5 --- /dev/null +++ b/server-v2/api/studio/internal/handler/importtask/getworkingdirhandler.go @@ -0,0 +1,17 @@ +// Code generated by goctl. DO NOT EDIT. +package importtask + +import ( + "net/http" + + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/logic/importtask" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/svc" +) + +func GetWorkingDirHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + l := importtask.NewGetWorkingDirLogic(r.Context(), svcCtx) + data, err := l.GetWorkingDir() + svcCtx.ResponseHandler.Handle(w, r, data, err) + } +} diff --git a/server-v2/api/studio/internal/handler/importtask/stopimporttaskhandler.go b/server-v2/api/studio/internal/handler/importtask/stopimporttaskhandler.go index 3c5d4928..09066c87 100644 --- a/server-v2/api/studio/internal/handler/importtask/stopimporttaskhandler.go +++ b/server-v2/api/studio/internal/handler/importtask/stopimporttaskhandler.go @@ -5,11 +5,11 @@ import ( "net/http" "github.com/vesoft-inc/go-pkg/validator" - "github.com/vesoft-inc/nebula-studio/server/api/studio/pkg/ecode" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/pkg/ecode" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/logic/importtask" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/svc" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/types" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/logic/importtask" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/svc" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/types" "github.com/zeromicro/go-zero/rest/httpx" ) diff --git a/server-v2/api/studio/internal/handler/routes.go b/server-v2/api/studio/internal/handler/routes.go index e2708fb7..e2d71359 100644 --- a/server-v2/api/studio/internal/handler/routes.go +++ b/server-v2/api/studio/internal/handler/routes.go @@ -4,11 +4,11 @@ package handler import ( "net/http" - file "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/handler/file" - gateway "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/handler/gateway" - health "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/handler/health" - importtask "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/handler/importtask" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/svc" + file "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/handler/file" + gateway "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/handler/gateway" + health "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/handler/health" + importtask "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/handler/importtask" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/svc" "github.com/zeromicro/go-zero/rest" ) @@ -59,7 +59,7 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { server.AddRoutes( []rest.Route{ { - Method: http.MethodPost, + Method: http.MethodPut, Path: "/api/files", Handler: file.FileUploadHandler(serverCtx), }, @@ -123,6 +123,11 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { Path: "/api/import-tasks/:id/download-config", Handler: importtask.DownloadConfigHandler(serverCtx), }, + { + Method: http.MethodGet, + Path: "/api/import-tasks/working-dir", + Handler: importtask.GetWorkingDirHandler(serverCtx), + }, }, ) } diff --git a/server-v2/api/studio/internal/logic/file/filedestroylogic.go b/server-v2/api/studio/internal/logic/file/filedestroylogic.go index 4f551c77..a7f3cb58 100644 --- a/server-v2/api/studio/internal/logic/file/filedestroylogic.go +++ b/server-v2/api/studio/internal/logic/file/filedestroylogic.go @@ -3,10 +3,10 @@ package file import ( "context" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/service" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/service" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/svc" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/types" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/svc" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/types" "github.com/zeromicro/go-zero/core/logx" ) diff --git a/server-v2/api/studio/internal/logic/file/filesindexlogic.go b/server-v2/api/studio/internal/logic/file/filesindexlogic.go index 6ca16117..964849d0 100644 --- a/server-v2/api/studio/internal/logic/file/filesindexlogic.go +++ b/server-v2/api/studio/internal/logic/file/filesindexlogic.go @@ -3,10 +3,9 @@ package file import ( "context" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/service" - - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/svc" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/types" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/service" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/svc" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/types" "github.com/zeromicro/go-zero/core/logx" ) diff --git a/server-v2/api/studio/internal/logic/file/fileuploadlogic.go b/server-v2/api/studio/internal/logic/file/fileuploadlogic.go index f2460962..e636b3fb 100644 --- a/server-v2/api/studio/internal/logic/file/fileuploadlogic.go +++ b/server-v2/api/studio/internal/logic/file/fileuploadlogic.go @@ -3,8 +3,8 @@ package file import ( "context" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/service" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/svc" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/service" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/svc" "github.com/zeromicro/go-zero/core/logx" ) diff --git a/server-v2/api/studio/internal/logic/gateway/batchexecngqllogic.go b/server-v2/api/studio/internal/logic/gateway/batchexecngqllogic.go index 9d9d52f0..595de7a8 100644 --- a/server-v2/api/studio/internal/logic/gateway/batchexecngqllogic.go +++ b/server-v2/api/studio/internal/logic/gateway/batchexecngqllogic.go @@ -3,9 +3,9 @@ package gateway import ( "context" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/service" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/svc" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/types" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/service" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/svc" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/types" "github.com/zeromicro/go-zero/core/logx" ) diff --git a/server-v2/api/studio/internal/logic/gateway/connectlogic.go b/server-v2/api/studio/internal/logic/gateway/connectlogic.go index 289e19df..ed5fbab6 100644 --- a/server-v2/api/studio/internal/logic/gateway/connectlogic.go +++ b/server-v2/api/studio/internal/logic/gateway/connectlogic.go @@ -3,9 +3,9 @@ package gateway import ( "context" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/service" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/svc" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/types" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/service" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/svc" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/types" "github.com/zeromicro/go-zero/core/logx" ) diff --git a/server-v2/api/studio/internal/logic/gateway/disonnectlogic.go b/server-v2/api/studio/internal/logic/gateway/disonnectlogic.go index a49cd1aa..085e4a36 100644 --- a/server-v2/api/studio/internal/logic/gateway/disonnectlogic.go +++ b/server-v2/api/studio/internal/logic/gateway/disonnectlogic.go @@ -3,9 +3,9 @@ package gateway import ( "context" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/service" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/svc" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/types" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/service" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/svc" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/types" "github.com/zeromicro/go-zero/core/logx" ) diff --git a/server-v2/api/studio/internal/logic/gateway/execngqllogic.go b/server-v2/api/studio/internal/logic/gateway/execngqllogic.go index f16f31b4..d9d0854c 100644 --- a/server-v2/api/studio/internal/logic/gateway/execngqllogic.go +++ b/server-v2/api/studio/internal/logic/gateway/execngqllogic.go @@ -3,9 +3,9 @@ package gateway import ( "context" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/service" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/svc" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/types" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/service" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/svc" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/types" "github.com/zeromicro/go-zero/core/logx" ) diff --git a/server-v2/api/studio/internal/logic/health/getlogic.go b/server-v2/api/studio/internal/logic/health/getlogic.go index 8bbcabd8..0980db32 100644 --- a/server-v2/api/studio/internal/logic/health/getlogic.go +++ b/server-v2/api/studio/internal/logic/health/getlogic.go @@ -3,9 +3,9 @@ package health import ( "context" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/service" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/svc" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/types" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/service" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/svc" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/types" "github.com/zeromicro/go-zero/core/logx" ) diff --git a/server-v2/api/studio/internal/logic/importtask/createimporttasklogic.go b/server-v2/api/studio/internal/logic/importtask/createimporttasklogic.go index 1a99734a..a7ce2893 100644 --- a/server-v2/api/studio/internal/logic/importtask/createimporttasklogic.go +++ b/server-v2/api/studio/internal/logic/importtask/createimporttasklogic.go @@ -3,9 +3,9 @@ package importtask import ( "context" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/service" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/svc" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/types" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/service" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/svc" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/types" "github.com/zeromicro/go-zero/core/logx" ) diff --git a/server-v2/api/studio/internal/logic/importtask/deleteimporttasklogic.go b/server-v2/api/studio/internal/logic/importtask/deleteimporttasklogic.go index 989550fb..4233ce38 100644 --- a/server-v2/api/studio/internal/logic/importtask/deleteimporttasklogic.go +++ b/server-v2/api/studio/internal/logic/importtask/deleteimporttasklogic.go @@ -3,9 +3,9 @@ package importtask import ( "context" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/service" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/svc" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/types" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/service" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/svc" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/types" "github.com/zeromicro/go-zero/core/logx" ) diff --git a/server-v2/api/studio/internal/logic/importtask/downloadconfiglogic.go b/server-v2/api/studio/internal/logic/importtask/downloadconfiglogic.go index c0a95510..2e6d26d6 100644 --- a/server-v2/api/studio/internal/logic/importtask/downloadconfiglogic.go +++ b/server-v2/api/studio/internal/logic/importtask/downloadconfiglogic.go @@ -3,10 +3,10 @@ package importtask import ( "context" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/service" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/service" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/svc" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/types" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/svc" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/types" "github.com/zeromicro/go-zero/core/logx" ) diff --git a/server-v2/api/studio/internal/logic/importtask/downloadlogslogic.go b/server-v2/api/studio/internal/logic/importtask/downloadlogslogic.go index 56f31258..4e285517 100644 --- a/server-v2/api/studio/internal/logic/importtask/downloadlogslogic.go +++ b/server-v2/api/studio/internal/logic/importtask/downloadlogslogic.go @@ -3,10 +3,10 @@ package importtask import ( "context" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/service" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/service" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/svc" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/types" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/svc" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/types" "github.com/zeromicro/go-zero/core/logx" ) diff --git a/server-v2/api/studio/internal/logic/importtask/getimporttasklogic.go b/server-v2/api/studio/internal/logic/importtask/getimporttasklogic.go index f0c51417..ac528dca 100644 --- a/server-v2/api/studio/internal/logic/importtask/getimporttasklogic.go +++ b/server-v2/api/studio/internal/logic/importtask/getimporttasklogic.go @@ -3,9 +3,9 @@ package importtask import ( "context" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/service" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/svc" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/types" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/service" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/svc" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/types" "github.com/zeromicro/go-zero/core/logx" ) diff --git a/server-v2/api/studio/internal/logic/importtask/getimporttasklognameslogic.go b/server-v2/api/studio/internal/logic/importtask/getimporttasklognameslogic.go index 0c5b409e..f907469e 100644 --- a/server-v2/api/studio/internal/logic/importtask/getimporttasklognameslogic.go +++ b/server-v2/api/studio/internal/logic/importtask/getimporttasklognameslogic.go @@ -3,9 +3,9 @@ package importtask import ( "context" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/service" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/svc" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/types" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/service" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/svc" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/types" "github.com/zeromicro/go-zero/core/logx" ) diff --git a/server-v2/api/studio/internal/logic/importtask/getmanyimporttasklogic.go b/server-v2/api/studio/internal/logic/importtask/getmanyimporttasklogic.go index a85f3ce5..3c0bc4d5 100644 --- a/server-v2/api/studio/internal/logic/importtask/getmanyimporttasklogic.go +++ b/server-v2/api/studio/internal/logic/importtask/getmanyimporttasklogic.go @@ -3,9 +3,9 @@ package importtask import ( "context" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/service" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/svc" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/types" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/service" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/svc" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/types" "github.com/zeromicro/go-zero/core/logx" ) diff --git a/server-v2/api/studio/internal/logic/importtask/getmanyimporttaskloglogic.go b/server-v2/api/studio/internal/logic/importtask/getmanyimporttaskloglogic.go index 3d08d666..5081977f 100644 --- a/server-v2/api/studio/internal/logic/importtask/getmanyimporttaskloglogic.go +++ b/server-v2/api/studio/internal/logic/importtask/getmanyimporttaskloglogic.go @@ -3,10 +3,10 @@ package importtask import ( "context" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/service" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/service" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/svc" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/types" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/svc" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/types" "github.com/zeromicro/go-zero/core/logx" ) diff --git a/server-v2/api/studio/internal/logic/importtask/getworkingdirlogic.go b/server-v2/api/studio/internal/logic/importtask/getworkingdirlogic.go new file mode 100644 index 00000000..9e98a667 --- /dev/null +++ b/server-v2/api/studio/internal/logic/importtask/getworkingdirlogic.go @@ -0,0 +1,29 @@ +package importtask + +import ( + "context" + + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/service" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/svc" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/types" + + "github.com/zeromicro/go-zero/core/logx" +) + +type GetWorkingDirLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewGetWorkingDirLogic(ctx context.Context, svcCtx *svc.ServiceContext) GetWorkingDirLogic { + return GetWorkingDirLogic{ + Logger: logx.WithContext(ctx), + ctx: ctx, + svcCtx: svcCtx, + } +} + +func (l *GetWorkingDirLogic) GetWorkingDir() (resp *types.GetWorkingDirResult, err error) { + return service.NewImportService(l.ctx, l.svcCtx).GetWorkingDir() +} diff --git a/server-v2/api/studio/internal/logic/importtask/stopimporttasklogic.go b/server-v2/api/studio/internal/logic/importtask/stopimporttasklogic.go index 3cc15853..5b3792c1 100644 --- a/server-v2/api/studio/internal/logic/importtask/stopimporttasklogic.go +++ b/server-v2/api/studio/internal/logic/importtask/stopimporttasklogic.go @@ -3,10 +3,10 @@ package importtask import ( "context" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/service" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/service" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/svc" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/types" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/svc" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/types" "github.com/zeromicro/go-zero/core/logx" ) diff --git a/server-v2/api/studio/internal/service/file.go b/server-v2/api/studio/internal/service/file.go index 32969d9a..a1f843c9 100644 --- a/server-v2/api/studio/internal/service/file.go +++ b/server-v2/api/studio/internal/service/file.go @@ -17,9 +17,9 @@ import ( "github.com/axgle/mahonia" "github.com/saintfish/chardet" "github.com/vesoft-inc/go-pkg/middleware" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/svc" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/types" - "github.com/vesoft-inc/nebula-studio/server/api/studio/pkg/ecode" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/svc" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/types" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/pkg/ecode" "github.com/zeromicro/go-zero/core/logx" "go.uber.org/zap" ) @@ -29,7 +29,7 @@ const ( ) var ( - noCharsetErr = errors.New("this charset can not be changed") + errNoCharset = errors.New("this charset can not be changed") _ FileService = (*fileService)(nil) ) @@ -132,7 +132,6 @@ func (f *fileService) FileUpload() error { return ecode.WithInternalServer(fmt.Errorf("unset KeepRequest")) } - logx.Infof("dir:", dir) files, _, err := UploadFormFiles(httpReq, dir) if err != nil { logx.Infof("upload file error:%v", err) @@ -232,7 +231,7 @@ func changeFileCharset2UTF8(filePath string, charSet string) error { decoder := mahonia.NewDecoder(charSet) // this charset can not be changed if decoder == nil { - return noCharsetErr + return errNoCharset } decodeReader := decoder.NewReader(reader) fileUTF8, err := os.OpenFile(fileUTF8Path, os.O_RDONLY|os.O_CREATE|os.O_WRONLY, 0o666) @@ -254,7 +253,7 @@ func changeFileCharset2UTF8(filePath string, charSet string) error { zap.L().Warn(fmt.Sprintf("remove file %s fail", fileUTF8Path), zap.Error(removeErr)) } } - if err == noCharsetErr { + if err == errNoCharset { return nil } return err diff --git a/server-v2/api/studio/internal/service/gateway.go b/server-v2/api/studio/internal/service/gateway.go index fdbc6218..9104b458 100644 --- a/server-v2/api/studio/internal/service/gateway.go +++ b/server-v2/api/studio/internal/service/gateway.go @@ -2,13 +2,17 @@ package service import ( "context" + "net/http" "strings" + "github.com/vesoft-inc/go-pkg/middleware" "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/gateway/dao" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/svc" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/types" - "github.com/vesoft-inc/nebula-studio/server/api/studio/pkg/base" - "github.com/vesoft-inc/nebula-studio/server/api/studio/pkg/ecode" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/svc" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/types" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/pkg/auth" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/pkg/base" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/pkg/ecode" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/pkg/utils" "github.com/zeromicro/go-zero/core/logx" ) @@ -39,15 +43,49 @@ func NewGatewayService(ctx context.Context, svcCtx *svc.ServiceContext) GatewayS } func (s *gatewayService) ConnectDB(request *types.ConnectDBParams) (*types.ConnectDBResult, error) { + httpRes, _ := middleware.GetResponseWriter(s.ctx) + + tokenString, clientInfo, err := auth.ParseConnectDBParams(request, &s.svcCtx.Config) + if err != nil { + return nil, ecode.WithCode(ecode.ErrBadRequest, err, "parse request failed") + } + + configAuth := s.svcCtx.Config.Auth + tokenCookie := http.Cookie{ + Name: auth.TokenName, + Value: tokenString, + Path: "/", + HttpOnly: true, + MaxAge: int(configAuth.AccessExpire), + } + NSIDCookie := http.Cookie{ + Name: auth.NSIDName, + Value: clientInfo.ClientID, + Path: "/", + HttpOnly: true, + MaxAge: int(configAuth.AccessExpire), + } + + httpRes.Header().Add("Set-Cookie", tokenCookie.String()) + httpRes.Header().Add("Set-Cookie", NSIDCookie.String()) + return &types.ConnectDBResult{ - Version: string(request.NebulaVersion), + Version: string(clientInfo.NebulaVersion), }, nil } func (s *gatewayService) DisconnectDB(request *types.DisconnectDBParams) (*types.AnyResponse, error) { - if request.NSID != "" { - dao.Disconnect(request.NSID) + httpReq, _ := middleware.GetRequest(s.ctx) + httpRes, _ := middleware.GetResponseWriter(s.ctx) + + NSIDCookie, NSIDErr := httpReq.Cookie(auth.NSIDName) + if NSIDErr == nil && NSIDCookie.Value != "" { + dao.Disconnect(NSIDCookie.Value) } + + httpRes.Header().Set("Set-Cookie", utils.DisabledCookie(auth.TokenName).String()) + httpRes.Header().Add("Set-Cookie", utils.DisabledCookie(auth.NSIDName).String()) + return nil, nil } diff --git a/server-v2/api/studio/internal/service/health.go b/server-v2/api/studio/internal/service/health.go index 1e82dd98..c32275e0 100644 --- a/server-v2/api/studio/internal/service/health.go +++ b/server-v2/api/studio/internal/service/health.go @@ -3,8 +3,8 @@ package service import ( "context" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/svc" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/types" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/svc" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/types" "github.com/zeromicro/go-zero/core/logx" ) diff --git a/server-v2/api/studio/internal/service/import.go b/server-v2/api/studio/internal/service/import.go index ba3f25f6..0d9c0a0c 100644 --- a/server-v2/api/studio/internal/service/import.go +++ b/server-v2/api/studio/internal/service/import.go @@ -15,11 +15,11 @@ import ( "github.com/vesoft-inc/go-pkg/middleware" importconfig "github.com/vesoft-inc/nebula-importer/pkg/config" importererrors "github.com/vesoft-inc/nebula-importer/pkg/errors" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/service/importer" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/svc" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/types" - "github.com/vesoft-inc/nebula-studio/server/api/studio/pkg/ecode" - "github.com/vesoft-inc/nebula-studio/server/api/studio/pkg/utils" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/service/importer" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/svc" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/types" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/pkg/ecode" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/pkg/utils" "github.com/zeromicro/go-zero/core/logx" "go.uber.org/zap" ) @@ -45,6 +45,7 @@ type ( GetManyImportTask(request *types.GetManyImportTaskRequest) (*types.GetManyImportTaskData, error) GetImportTaskLogNames(request *types.GetImportTaskLogNamesRequest) (*types.GetImportTaskLogNamesData, error) GetManyImportTaskLog(request *types.GetManyImportTaskLogRequest) (*types.GetManyImportTaskLogData, error) + GetWorkingDir() (*types.GetWorkingDirResult, error) } importService struct { @@ -274,6 +275,13 @@ func (i *importService) GetManyImportTaskLog(req *types.GetManyImportTaskLogRequ return data, nil } +func (i *importService) GetWorkingDir() (*types.GetWorkingDirResult, error) { + return &types.GetWorkingDirResult{ + TaskDir: i.svcCtx.Config.File.TasksDir, + UploadDir: i.svcCtx.Config.File.UploadDir, + }, nil +} + func validClientParams(conf *importconfig.YAMLConfig) error { if conf.NebulaClientSettings.Connection == nil || conf.NebulaClientSettings.Connection.Address == nil || diff --git a/server-v2/api/studio/internal/service/importer/importer.go b/server-v2/api/studio/internal/service/importer/importer.go index 3e3d34fb..2316a7a6 100644 --- a/server-v2/api/studio/internal/service/importer/importer.go +++ b/server-v2/api/studio/internal/service/importer/importer.go @@ -11,8 +11,8 @@ import ( importconfig "github.com/vesoft-inc/nebula-importer/pkg/config" importerErrors "github.com/vesoft-inc/nebula-importer/pkg/errors" "github.com/vesoft-inc/nebula-importer/pkg/logger" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/types" - "github.com/vesoft-inc/nebula-studio/server/api/studio/pkg/utils" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/types" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/pkg/utils" "go.uber.org/zap" "gopkg.in/yaml.v2" @@ -39,7 +39,7 @@ func GetNewTaskDir(tasksDir string) (string, error) { func CreateConfigFile(uploadDir, taskdir string, config importconfig.YAMLConfig) error { fileName := "config.yaml" - err := utils.CreateDir(taskdir) + // err := utils.CreateDir(taskdir) if err := utils.CreateDir(taskdir); err != nil { return err } diff --git a/server-v2/api/studio/internal/service/importer/task.go b/server-v2/api/studio/internal/service/importer/task.go index 58b9c1ee..1e12700e 100644 --- a/server-v2/api/studio/internal/service/importer/task.go +++ b/server-v2/api/studio/internal/service/importer/task.go @@ -6,12 +6,12 @@ import ( ) type Task struct { - runner *cmd.Runner `json:"runner,omitempty"` + Runner *cmd.Runner `json:"runner,omitempty"` TaskInfo *TaskInfo `json:"task_info,omitempty"` } func (t *Task) UpdateQueryStats() error { - stats, err := t.runner.QueryStats() + stats, err := t.Runner.QueryStats() if err != nil { logx.Infof("query import stats fail: %s", err) return err diff --git a/server-v2/api/studio/internal/service/importer/taskmgr.go b/server-v2/api/studio/internal/service/importer/taskmgr.go index 38f66533..bd10f7b7 100644 --- a/server-v2/api/studio/internal/service/importer/taskmgr.go +++ b/server-v2/api/studio/internal/service/importer/taskmgr.go @@ -32,7 +32,7 @@ type TaskMgr struct { func newTask(nebulaAddress string, user string, name string, space string) *Task { timeUnix := time.Now().Unix() return &Task{ - runner: &cmd.Runner{}, + Runner: &cmd.Runner{}, TaskInfo: &TaskInfo{ Name: name, Space: space, @@ -46,7 +46,7 @@ func newTask(nebulaAddress string, user string, name string, space string) *Task } func (task *Task) GetRunner() *cmd.Runner { - return task.runner + return task.Runner } func (mgr *TaskMgr) NewTaskID() (string, error) { diff --git a/server-v2/api/studio/internal/svc/servicecontext.go b/server-v2/api/studio/internal/svc/servicecontext.go index 9a7f3650..878d9f38 100644 --- a/server-v2/api/studio/internal/svc/servicecontext.go +++ b/server-v2/api/studio/internal/svc/servicecontext.go @@ -8,9 +8,9 @@ import ( "github.com/vesoft-inc/go-pkg/httpclient" "github.com/vesoft-inc/go-pkg/response" "github.com/vesoft-inc/go-pkg/validator" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/common" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/config" - "github.com/vesoft-inc/nebula-studio/server/api/studio/pkg/ecode" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/common" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/config" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/pkg/ecode" "github.com/zeromicro/go-zero/core/logx" ) diff --git a/server-v2/api/studio/internal/types/types.go b/server-v2/api/studio/internal/types/types.go index 3ed1ca25..5196306a 100644 --- a/server-v2/api/studio/internal/types/types.go +++ b/server-v2/api/studio/internal/types/types.go @@ -49,7 +49,7 @@ type FileStat struct { } type FilesIndexData struct { - List []FileStat `json:"list"` + List []FileStat `json:"data"` } type ImportTaskConnection struct { @@ -127,7 +127,7 @@ type ImportTaskEdge struct { Name string `json:"name" validate:"required"` SrcVID ImportTaskEdgeID `json:"srcVID" validate:"required"` DstVID ImportTaskEdgeID `json:"dstVID" validate:"required"` - Rank ImportTaskEdgeRank `json:"rank, optional"` + Rank ImportTaskEdgeRank `json:"rank,optional"` Props []ImportTaskEdgeProp `json:"props" validate:"required"` } @@ -141,8 +141,8 @@ type ImportTaskFile struct { Path string `json:"path" validate:"required"` FailDataPath string `json:"failDataPath" validate:"required"` BatchSize int `json:"batchSize,optional"` - Limit int `json:"limit, optional"` - InOrder bool `json:"inOrder, optional"` + Limit int `json:"limit,optional"` + InOrder bool `json:"inOrder,optional"` Type string `json:"type" validate:"required"` CSV ImportTaskCSV `json:"csv" validate:"required"` Schema ImportTaskSchema `json:"schema" validate:"required"` @@ -205,7 +205,7 @@ type GetManyImportTaskRequest struct { type GetManyImportTaskData struct { Total int64 `json:"total"` - List []GetImportTaskData `json:"list"` + List []GetImportTaskData `json:"data"` } type GetManyImportTaskLogRequest struct { @@ -216,15 +216,15 @@ type GetManyImportTaskLogRequest struct { } type GetManyImportTaskLogData struct { - Logs []string `json:"logs"` + Logs []string `json:"data"` } type GetImportTaskLogNamesRequest struct { - Id string `path:"id" validate:"required""` + Id string `path:"id" validate:"required"` } type GetImportTaskLogNamesData struct { - Names []string `json:"names"` + Names []string `json:"data"` } type DeleteImportTaskRequest struct { @@ -249,3 +249,8 @@ type DownloadLogsRequest struct { type DownloadConfigsRequest struct { Id string `path:"id" validate:"required"` } + +type GetWorkingDirResult struct { + TaskDir string `json:"taskDir,omitempty"` + UploadDir string `json:"uploadDir,omitempty"` +} diff --git a/server-v2/api/studio/pkg/auth/authorize.go b/server-v2/api/studio/pkg/auth/authorize.go index 62d4710c..70444273 100644 --- a/server-v2/api/studio/pkg/auth/authorize.go +++ b/server-v2/api/studio/pkg/auth/authorize.go @@ -11,13 +11,12 @@ import ( "github.com/golang-jwt/jwt/v4" "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/gateway/dao" "github.com/vesoft-inc/nebula-http-gateway/ccore/nebula/gateway/pool" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/config" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/svc" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/types" - "github.com/vesoft-inc/nebula-studio/server/api/studio/pkg/ecode" - "github.com/vesoft-inc/nebula-studio/server/api/studio/pkg/utils" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/config" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/svc" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/types" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/pkg/ecode" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/pkg/utils" "github.com/zeromicro/go-zero/rest" - "github.com/zeromicro/go-zero/rest/httpx" ) type ( @@ -36,14 +35,13 @@ type ( ) var ( - tokenName = "explorer_token" - nsidName = "explorer_nsid" + TokenName = "explorer_token" + NSIDName = "explorer_nsid" ) func CreateToken(authData *AuthData, config *config.Config) (string, error) { now := time.Now() expiresAt := now.Add(time.Duration(config.Auth.AccessExpire) * time.Second).Unix() - token := jwt.NewWithClaims(jwt.SigningMethodHS256, authClaims{ AuthData: authData, @@ -85,7 +83,7 @@ func Decode(tokenString, secret string) (*AuthData, error) { return auth.AuthData, nil } -func parseConnectDBParams(params *types.ConnectDBParams, config *config.Config) (string, *pool.ClientInfo, error) { +func ParseConnectDBParams(params *types.ConnectDBParams, config *config.Config) (string, *pool.ClientInfo, error) { tokenSplit := strings.Split(params.Authorization, " ") if len(tokenSplit) != 2 { return "", nil, ecode.WithCode(ecode.ErrParam, nil, "invalid authorization") @@ -121,70 +119,27 @@ func parseConnectDBParams(params *types.ConnectDBParams, config *config.Config) func AuthMiddlewareWithCtx(svcCtx *svc.ServiceContext) rest.Middleware { return func(next http.HandlerFunc) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { - configAuth := svcCtx.Config.Auth - - // login handler - if strings.HasSuffix(r.URL.Path, "/connect") { - var req types.ConnectDBParams - rClone := utils.CopyHttpRequest(r) - err := httpx.Parse(rClone, &req) - if err != nil { - http.Error(w, err.Error(), http.StatusBadRequest) - return - } - - tokenString, clientInfo, err := parseConnectDBParams(&req, &svcCtx.Config) - if err != nil { - http.Error(w, err.Error(), http.StatusBadRequest) - return - } - - token := http.Cookie{ - Name: tokenName, - Value: tokenString, - Path: "/", - HttpOnly: true, - MaxAge: int(configAuth.AccessExpire), - } - NSID := http.Cookie{ - Name: nsidName, - Value: clientInfo.ClientID, - Path: "/", - HttpOnly: true, - MaxAge: int(configAuth.AccessExpire), - } - - utils.AddQueryParams(r, map[string]string{"nebulaVersion": string(clientInfo.NebulaVersion)}) - - w.Header().Set("Set-Cookie", token.String()) - w.Header().Add("Set-Cookie", NSID.String()) - + if utils.PathHasPrefix(r.URL.Path, []string{"/api-nebula/db/connect", "/api-nebula/db/disconnect"}) { next(w, r) return } - NSIDCookie, NSIDErr := r.Cookie(nsidName) + NSIDCookie, NSIDErr := r.Cookie(NSIDName) if NSIDErr == nil { // Add NSID to request query utils.AddQueryParams(r, map[string]string{"NSID": NSIDCookie.Value}) } - if strings.HasSuffix(r.URL.Path, "/disconnect") { - w.Header().Set("Set-Cookie", utils.DisabledCookie(tokenName).String()) - w.Header().Add("Set-Cookie", utils.DisabledCookie(nsidName).String()) - next(w, r) + tokenCookie, tokenErr := r.Cookie(TokenName) + if NSIDErr != nil { + svcCtx.ResponseHandler.Handle(w, r, nil, ecode.WithSessionMessage(NSIDErr)) + return + } else if tokenErr != nil { + svcCtx.ResponseHandler.Handle(w, r, nil, ecode.WithSessionMessage(tokenErr)) return } - tokenCookie, tokenErr := r.Cookie(tokenName) - if NSIDErr != nil || tokenErr != nil { - if NSIDErr != nil { - svcCtx.ResponseHandler.Handle(w, r, nil, ecode.WithSessionMessage(NSIDErr)) - return - } - } - - auth, authErr := Decode(tokenCookie.Value, configAuth.AccessSecret) + auth, authErr := Decode(tokenCookie.Value, svcCtx.Config.Auth.AccessSecret) if authErr != nil { svcCtx.ResponseHandler.Handle(w, r, nil, ecode.WithSessionMessage(authErr)) return diff --git a/server-v2/api/studio/pkg/utils/http.go b/server-v2/api/studio/pkg/utils/http.go index 0ad3b8cb..b02d6636 100644 --- a/server-v2/api/studio/pkg/utils/http.go +++ b/server-v2/api/studio/pkg/utils/http.go @@ -5,6 +5,7 @@ import ( "io" "io/ioutil" "net/http" + "strings" ) const MIMEOctetStream = "application/octet-stream" @@ -54,3 +55,12 @@ func AddQueryParams(r *http.Request, params map[string]string) { } r.URL, _ = r.URL.Parse(r.URL.Path + "?" + query.Encode()) } + +func PathHasPrefix(path string, routes []string) bool { + for _, route := range routes { + if strings.HasPrefix(path, route) { + return true + } + } + return false +} diff --git a/server-v2/api/studio/restapi/file.api b/server-v2/api/studio/restapi/file.api index f0f1778c..30aa76e5 100644 --- a/server-v2/api/studio/restapi/file.api +++ b/server-v2/api/studio/restapi/file.api @@ -14,7 +14,7 @@ type ( } FilesIndexData { - List []FileStat `json:"list"` + List []FileStat `json:"data"` } ) @@ -25,7 +25,7 @@ type ( service studio-api { @doc "Upload File" @handler FileUpload - post /api/files + put /api/files @doc "delete file" @handler FileDestroy delete /api/files/:name(FileDestroyRequest) diff --git a/server-v2/api/studio/restapi/import.api b/server-v2/api/studio/restapi/import.api index 2013b8fc..785b06aa 100644 --- a/server-v2/api/studio/restapi/import.api +++ b/server-v2/api/studio/restapi/import.api @@ -198,6 +198,11 @@ type ( DownloadConfigsRequest { Id string `path:"id" validate:"required"` } + + GetWorkingDirResult { + TaskDir string `json:"taskDir,omitempty"` + UploadDir string `json:"uploadDir,omitempty"` + } ) @server( @@ -208,28 +213,40 @@ service studio-api { @doc "Create Import Task" @handler CreateImportTask post /api/import-tasks(CreateImportTaskRequest) returns(CreateImportTaskData) + @doc "Get Import Task" @handler GetImportTask get /api/import-tasks/:id(GetImportTaskRequest) returns(GetImportTaskData) + @doc "Get Many Import Task" @handler GetManyImportTask get /api/import-tasks(GetManyImportTaskRequest) returns(GetManyImportTaskData) + @doc "Get Many Import Task Log" @handler GetManyImportTaskLog get /api/import-tasks/:id/logs(GetManyImportTaskLogRequest) returns(GetManyImportTaskLogData) + @doc "Get all logs file name of a Task" @handler GetImportTaskLogNames get /api/import-tasks/:id/task-log-names(GetImportTaskLogNamesRequest) returns(GetImportTaskLogNamesData) + @doc "Delete Import Task" @handler DeleteImportTask delete /api/import-tasks/:id(DeleteImportTaskRequest) + @doc "Stop Import Task" @handler StopImportTask get /api/import-tasks/:id/stop(StopImportTaskRequest) + @doc "Download logs" @handler DownloadLogs get /api/import-tasks/:id/download-logs(DownloadLogsRequest) + @doc "Download Config" @handler DownloadConfig get /api/import-tasks/:id/download-config(DownloadConfigsRequest) + + @doc "Get Working Dir" + @handler GetWorkingDir + get /api/import-tasks/working-dir returns(GetWorkingDirResult) } \ No newline at end of file diff --git a/server-v2/api/studio/studio.go b/server-v2/api/studio/studio.go index 14711bc5..6048dacc 100644 --- a/server-v2/api/studio/studio.go +++ b/server-v2/api/studio/studio.go @@ -6,19 +6,19 @@ import ( "fmt" "net/http" - "github.com/vesoft-inc/go-pkg/middleware" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/common" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/config" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/handler" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/service/importer" - "github.com/vesoft-inc/nebula-studio/server/api/studio/internal/svc" - "github.com/vesoft-inc/nebula-studio/server/api/studio/pkg/auth" - "github.com/vesoft-inc/nebula-studio/server/api/studio/pkg/logging" - "go.uber.org/zap" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/common" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/config" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/handler" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/service/importer" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/internal/svc" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/pkg/auth" + "github.com/vesoft-inc/nebula-studio/server-v2/api/studio/pkg/logging" + "github.com/vesoft-inc/go-pkg/middleware" "github.com/zeromicro/go-zero/core/conf" "github.com/zeromicro/go-zero/rest" "github.com/zeromicro/go-zero/rest/httpx" + "go.uber.org/zap" ) //go:embed assets/* diff --git a/server-v2/go.mod b/server-v2/go.mod index 7808475b..60da9849 100644 --- a/server-v2/go.mod +++ b/server-v2/go.mod @@ -1,4 +1,4 @@ -module github.com/vesoft-inc/nebula-studio/server +module github.com/vesoft-inc/nebula-studio/server-v2 go 1.17