From 85ea357901da4a7306fad397201cd09655588b6e Mon Sep 17 00:00:00 2001 From: Bruce Date: Tue, 17 May 2022 16:23:56 +0800 Subject: [PATCH] mody: go mod --- .gitignore | 1 + .../handler/file/fileuploadhandler.go | 2 +- server-v2/api/studio/internal/service/file.go | 8 -------- .../internal/service/importer/importer.go | 9 +++++---- .../internal/service/importer/taskmgr.go | 7 ++++--- server-v2/go.mod | 13 ++++++++++++- server-v2/go.sum | 19 +++++++++++++++++-- 7 files changed, 40 insertions(+), 19 deletions(-) diff --git a/.gitignore b/.gitignore index 21bfa6d0..7111f107 100644 --- a/.gitignore +++ b/.gitignore @@ -23,5 +23,6 @@ dist/ !app/**/*.js tmp server/data +server-v2/api/*/data assets/ bin/ \ No newline at end of file diff --git a/server-v2/api/studio/internal/handler/file/fileuploadhandler.go b/server-v2/api/studio/internal/handler/file/fileuploadhandler.go index 93cc8169..e379481b 100644 --- a/server-v2/api/studio/internal/handler/file/fileuploadhandler.go +++ b/server-v2/api/studio/internal/handler/file/fileuploadhandler.go @@ -10,7 +10,7 @@ import ( func FileUploadHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { - l := file.NewFileUploadLogic(r.Context(), svcCtx) + l := file.NewFileUploadLogic(r, svcCtx) err := l.FileUpload() svcCtx.ResponseHandler.Handle(w, r, nil, err) } diff --git a/server-v2/api/studio/internal/service/file.go b/server-v2/api/studio/internal/service/file.go index 72812261..f9743fa7 100644 --- a/server-v2/api/studio/internal/service/file.go +++ b/server-v2/api/studio/internal/service/file.go @@ -64,14 +64,6 @@ func NewFileService(r *http.Request, ctx context.Context, svcCtx *svc.ServiceCon } } -func NewFileService(ctx context.Context, svcCtx *svc.ServiceContext) FileService { - return &fileService{ - Logger: logx.WithContext(ctx), - ctx: ctx, - svcCtx: svcCtx, - } -} - func (f *fileService) FileDestroy(name string) error { dir := f.svcCtx.Config.File.UploadDir target := filepath.Join(dir, name) diff --git a/server-v2/api/studio/internal/service/importer/importer.go b/server-v2/api/studio/internal/service/importer/importer.go index b4de26ca..719223f3 100644 --- a/server-v2/api/studio/internal/service/importer/importer.go +++ b/server-v2/api/studio/internal/service/importer/importer.go @@ -3,6 +3,11 @@ package importer import ( "errors" "fmt" + "os" + "path/filepath" + "strconv" + "time" + 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" @@ -10,10 +15,6 @@ import ( Config "github.com/vesoft-inc/nebula-studio/server/api/studio/pkg/config" "github.com/vesoft-inc/nebula-studio/server/api/studio/pkg/utils" "go.uber.org/zap" - "os" - "path/filepath" - "strconv" - "time" "gopkg.in/yaml.v2" ) diff --git a/server-v2/api/studio/internal/service/importer/taskmgr.go b/server-v2/api/studio/internal/service/importer/taskmgr.go index 7c20ebeb..bf2f06ac 100644 --- a/server-v2/api/studio/internal/service/importer/taskmgr.go +++ b/server-v2/api/studio/internal/service/importer/taskmgr.go @@ -3,15 +3,16 @@ package importer import ( "errors" "fmt" - "github.com/vesoft-inc/nebula-importer/pkg/cmd" - Config "github.com/vesoft-inc/nebula-studio/server/api/studio/pkg/config" - "github.com/zeromicro/go-zero/core/logx" "os" "path/filepath" "strconv" "sync" "time" + "github.com/vesoft-inc/nebula-importer/pkg/cmd" + Config "github.com/vesoft-inc/nebula-studio/server/api/studio/pkg/config" + "github.com/zeromicro/go-zero/core/logx" + _ "github.com/mattn/go-sqlite3" ) diff --git a/server-v2/go.mod b/server-v2/go.mod index 1bafbe9b..7808475b 100644 --- a/server-v2/go.mod +++ b/server-v2/go.mod @@ -3,10 +3,20 @@ module github.com/vesoft-inc/nebula-studio/server go 1.17 require ( - github.com/vesoft-inc/go-pkg v0.0.0-20220511092334-a180a9379d8d + github.com/vesoft-inc/go-pkg v0.0.0-20220516090733-5ce93ad3254b + github.com/vesoft-inc/nebula-importer v1.0.1-0.20220505095506-93febd41c2be github.com/zeromicro/go-zero v1.3.3 ) +require github.com/vesoft-inc/nebula-go/v3 v3.0.0-20220425030225-cdb52399b40a // indirect + +require ( + github.com/jinzhu/inflection v1.0.0 // indirect + github.com/jinzhu/now v1.1.5 // indirect + github.com/mattn/go-sqlite3 v1.14.12 + gorm.io/gorm v1.23.4 +) + require ( github.com/facebook/fbthrift v0.31.1-0.20211129061412-801ed7f9f295 // indirect github.com/satori/go.uuid v1.2.1-0.20181028125025-b2ce2384e17b // indirect @@ -53,4 +63,5 @@ require ( google.golang.org/grpc v1.46.0 // indirect google.golang.org/protobuf v1.28.0 // indirect gopkg.in/yaml.v2 v2.4.0 + gorm.io/driver/sqlite v1.3.2 ) diff --git a/server-v2/go.sum b/server-v2/go.sum index f6c28bf6..c513edad 100644 --- a/server-v2/go.sum +++ b/server-v2/go.sum @@ -250,6 +250,11 @@ github.com/jcmturner/gofork v1.0.0/go.mod h1:MK8+TM0La+2rjBD4jE12Kj1pCCxK7d2LK/U github.com/jcmturner/goidentity/v6 v6.0.1/go.mod h1:X1YW3bgtvwAXju7V3LCIMpY0Gbxyjn/mY9zx4tFonSg= github.com/jcmturner/gokrb5/v8 v8.4.2/go.mod h1:sb+Xq/fTY5yktf/VxLsE3wlfPqQjp0aWNYyvBVK62bc= github.com/jcmturner/rpc/v2 v2.0.3/go.mod h1:VUJYCIDm3PVOEHw8sgt091/20OJjskO/YJki3ELg/Hc= +github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= +github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= +github.com/jinzhu/now v1.1.4/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= +github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ= +github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= github.com/jmoiron/sqlx v1.2.0/go.mod h1:1FEQNm3xlJgrMD+FBdI9+xvCksHtbpVBBw5dYhBSsks= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= @@ -289,6 +294,8 @@ github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Ky github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/mattn/go-sqlite3 v1.9.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= +github.com/mattn/go-sqlite3 v1.14.12 h1:TJ1bhYJPV44phC+IMu1u2K/i5RriLTPe+yc68XDJ1Z0= +github.com/mattn/go-sqlite3 v1.14.12/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 h1:I0XW9+e1XWDxdcEniV4rQAIOPUGDq67JSCiRCgGCZLI= github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= @@ -391,10 +398,14 @@ github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMT github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI= -github.com/vesoft-inc/go-pkg v0.0.0-20220511092334-a180a9379d8d h1:Q/eVc0H8CuQNmviD43vAxtJKyB3aFd9R8Z7pOdxokoA= -github.com/vesoft-inc/go-pkg v0.0.0-20220511092334-a180a9379d8d/go.mod h1:HCAXRhF2io+nPLQnl+RQ6XyVcp1Xdv6NgslXRBBCiEU= +github.com/vesoft-inc/go-pkg v0.0.0-20220516090733-5ce93ad3254b h1:MVAkGU2YH1p3PhWN0T+r0bkv+gn5b33J2tEdnXXZAUE= +github.com/vesoft-inc/go-pkg v0.0.0-20220516090733-5ce93ad3254b/go.mod h1:HCAXRhF2io+nPLQnl+RQ6XyVcp1Xdv6NgslXRBBCiEU= +github.com/vesoft-inc/nebula-go/v3 v3.0.0-20220425030225-cdb52399b40a h1:/8l9RT6gU0cUS1Cgzqv3A9dKto19VQBjVk1BqAAqqvM= +github.com/vesoft-inc/nebula-go/v3 v3.0.0-20220425030225-cdb52399b40a/go.mod h1:+sXv05jYQBARdTbTcIEsWVXCnF/6ttOlDK35xQ6m54s= github.com/vesoft-inc/nebula-http-gateway/ccore v0.0.0-20220413113447-a3f4c56287d8 h1:iL92Uk6hAe4vUBK/L99wf5295HYOtnD4plctVA5xek0= github.com/vesoft-inc/nebula-http-gateway/ccore v0.0.0-20220413113447-a3f4c56287d8/go.mod h1:sFEvE+cY4TgwqWx6H6msOqAUzRhsEHHKaaMgIZENHuQ= +github.com/vesoft-inc/nebula-importer v1.0.1-0.20220505095506-93febd41c2be h1:7YGSREZ6uS1WjCdKTlHEvhSeYURJFY7UXQZ008+EB2Y= +github.com/vesoft-inc/nebula-importer v1.0.1-0.20220505095506-93febd41c2be/go.mod h1:8xAQi6KI2qe40Dop/GqDXmBEurt7qGp5Pjd1MESAVNA= github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= github.com/xdg-go/scram v1.0.2/go.mod h1:1WAq6h33pAW+iRreB34OORO2Nf7qel3VV3fjBj+hCSs= github.com/xdg-go/stringprep v1.0.2/go.mod h1:8F9zXuvzgwmyT5DUm4GUfZGDdT3W+LCvS6+da4O5kxM= @@ -790,6 +801,10 @@ gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gorm.io/driver/sqlite v1.3.2 h1:nWTy4cE52K6nnMhv23wLmur9Y3qWbZvOBz+V4PrGAxg= +gorm.io/driver/sqlite v1.3.2/go.mod h1:B+8GyC9K7VgzJAcrcXMRPdnMcck+8FgJynEehEPM16U= +gorm.io/gorm v1.23.4 h1:1BKWM67O6CflSLcwGQR7ccfmC4ebOxQrTfOQGRE9wjg= +gorm.io/gorm v1.23.4/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=