Skip to content

Commit

Permalink
ccore update and version return (#101)
Browse files Browse the repository at this point in the history
  • Loading branch information
xjlgod authored Jan 25, 2022
1 parent 3d273c0 commit 73071be
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 13 deletions.
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

0 comments on commit 73071be

Please sign in to comment.