Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ccore update and version return #101

Merged
merged 1 commit into from
Jan 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ $ ./nebula-studio-server -studio-config="./config/example-config.yaml"

| Name | Path | Method |
| ------------------ | ------------------------- | -------- |
| ExecNGQL | /api-nebula/db/connect | POST |
| ConnectDB | /api-nebula/db/exec | POST |
| ExecNGQL | /api-nebula/db/exec | POST |
| ConnectDB | /api-nebula/db/connect | POST |
| DisconnectDB | /api-nebula/db/disconnect | POST |
| ImportData | /api-nebula/task/import | POST |
| HandleImportAction | /api-nebula/import/action | POST |
Expand Down Expand Up @@ -74,13 +74,13 @@ Response:

```json
{
"code": 0,
"message": "",
"data": {
"nsid": "ae50dc65-0ef4-48f3-8f55-6a562a7e2ed7"
}
"code": 0,
"message": "",
"data": {
"nsid": "e870674d-6ebc-4d9d-a1f7-bf59fdca24e8",
"version": "v2.6"
}
}

```

#### DisconnectDB API
Expand Down
2 changes: 1 addition & 1 deletion server/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.17
require (
github.com/kataras/iris/v12 v12.2.0-alpha4
github.com/mattn/go-sqlite3 v2.0.3+incompatible
github.com/vesoft-inc/nebula-http-gateway/ccore v0.0.0-20220119025135-9c14441ae6d0
github.com/vesoft-inc/nebula-http-gateway/ccore v0.0.0-20220124093655-f7f5b4c63e6a
github.com/vesoft-inc/nebula-importer v1.0.1-0.20211213064541-05a8646be295
go.uber.org/zap v1.17.0
gopkg.in/yaml.v2 v2.4.0
Expand Down
4 changes: 2 additions & 2 deletions server/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,8 @@ github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6Kllzaw
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
github.com/vesoft-inc/nebula-go/v2 v2.5.2-0.20211210024917-9461e07cdca2 h1:ivN82oSpM/kNCZVdzoCSj1IT4ZDW7Xi2juhAZvh7eF8=
github.com/vesoft-inc/nebula-go/v2 v2.5.2-0.20211210024917-9461e07cdca2/go.mod h1:fehDUs97/mpmxXi9WezhznX0Dg7hmQRUoOWgDZv9zG0=
github.com/vesoft-inc/nebula-http-gateway/ccore v0.0.0-20220119025135-9c14441ae6d0 h1:hA8blKE64P2MbQcYlpqI0Lf28xpD2idmB+oCKoPXM78=
github.com/vesoft-inc/nebula-http-gateway/ccore v0.0.0-20220119025135-9c14441ae6d0/go.mod h1:sFEvE+cY4TgwqWx6H6msOqAUzRhsEHHKaaMgIZENHuQ=
github.com/vesoft-inc/nebula-http-gateway/ccore v0.0.0-20220124093655-f7f5b4c63e6a h1:tirwUK05V3LPsIFaLa0cHmVqFD3F1Tb8PlDTK7YWQGc=
github.com/vesoft-inc/nebula-http-gateway/ccore v0.0.0-20220124093655-f7f5b4c63e6a/go.mod h1:sFEvE+cY4TgwqWx6H6msOqAUzRhsEHHKaaMgIZENHuQ=
github.com/vesoft-inc/nebula-importer v1.0.1-0.20211213064541-05a8646be295 h1:YdBNGn+5YyIuQ6cWjIPCvSJW/3qj5ck5UIWGeh4hXNI=
github.com/vesoft-inc/nebula-importer v1.0.1-0.20211213064541-05a8646be295/go.mod h1:0nHCbr2/nckhfxAA8sDbwxkNzA9YyXazWKyVMT/PfPo=
github.com/vmihailenco/msgpack/v5 v5.3.4 h1:qMKAwOV+meBw2Y8k9cVwAy7qErtYCwBzZ2ellBfvnqc=
Expand Down
9 changes: 7 additions & 2 deletions server/pkg/webserver/controller/gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,10 @@ func ConnectDB(ctx iris.Context) base.Result {
Message: err.Error(),
}
}
nsid, err := dao.Connect(params.Address, params.Port, params.Username, params.Password)
//sessions.Get(ctx).Set("nsid", nsid)
clientInfo, err := dao.Connect(params.Address, params.Port, params.Username, params.Password)
if err != nil {
return nil
}
if err != nil {
zap.L().Warn("connect DB fail", zap.Error(err))
return base.Response{
Expand All @@ -85,7 +87,10 @@ func ConnectDB(ctx iris.Context) base.Result {
}
}
data := make(map[string]string)
nsid := clientInfo.ClientID
version := clientInfo.NebulaVersion
data["nsid"] = nsid
data["version"] = string(version)
ctx.SetCookieKV("nsid", nsid)
return base.Response{
Code: base.Success,
Expand Down