Skip to content

Commit

Permalink
Refactor (#219)
Browse files Browse the repository at this point in the history
* update: server-v2
* updata: format
  • Loading branch information
huaxiabuluo authored and hetao92 committed May 26, 2022
1 parent fd5af80 commit 23567a9
Show file tree
Hide file tree
Showing 57 changed files with 325 additions and 237 deletions.
7 changes: 5 additions & 2 deletions app/utils/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion server-v2/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ $(GOBIN)/goctl:
$(call go-get-tool,$(GOBIN)/goctl,github.com/zeromicro/go-zero/tools/[email protected])

$(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
Expand Down
2 changes: 1 addition & 1 deletion server-v2/api/studio/.goctl/api/handler.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
Expand Down
2 changes: 1 addition & 1 deletion server-v2/api/studio/etc/studio-api.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Name: studio-api
Host: 0.0.0.0
Port: 7002
Port: 9000
MaxBytes: 1073741824
Debug:
Enable: false
Expand Down
3 changes: 3 additions & 0 deletions server-v2/api/studio/internal/common/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions server-v2/api/studio/internal/handler/health/gethandler.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 11 additions & 6 deletions server-v2/api/studio/internal/handler/routes.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions server-v2/api/studio/internal/logic/file/filedestroylogic.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down
7 changes: 3 additions & 4 deletions server-v2/api/studio/internal/logic/file/filesindexlogic.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down
Loading

0 comments on commit 23567a9

Please sign in to comment.