-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
- Loading branch information
There are no files selected for viewing
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.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package datasource | ||
|
||
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/zeromicro/go-zero/core/logx" | ||
) | ||
|
||
type DatasourceAddLogic struct { | ||
logx.Logger | ||
ctx context.Context | ||
svcCtx *svc.ServiceContext | ||
} | ||
|
||
func NewDatasourceAddLogic(ctx context.Context, svcCtx *svc.ServiceContext) DatasourceAddLogic { | ||
return DatasourceAddLogic{ | ||
Logger: logx.WithContext(ctx), | ||
ctx: ctx, | ||
svcCtx: svcCtx, | ||
} | ||
} | ||
|
||
func (l *DatasourceAddLogic) DatasourceAdd(req types.DatasourceAddRequest) (resp *types.DatasourceAddData, err error) { | ||
return service.NewDatasourceService(l.ctx, l.svcCtx).Add(req) | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package datasource | ||
|
||
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/zeromicro/go-zero/core/logx" | ||
) | ||
|
||
type DatasourceListContentsLogic struct { | ||
logx.Logger | ||
ctx context.Context | ||
svcCtx *svc.ServiceContext | ||
} | ||
|
||
func NewDatasourceListContentsLogic(ctx context.Context, svcCtx *svc.ServiceContext) DatasourceListContentsLogic { | ||
return DatasourceListContentsLogic{ | ||
Logger: logx.WithContext(ctx), | ||
ctx: ctx, | ||
svcCtx: svcCtx, | ||
} | ||
} | ||
|
||
func (l *DatasourceListContentsLogic) DatasourceListContents(req types.DatasourceListContentsRequest) (resp *types.DatasourceListContentsData, err error) { | ||
return service.NewDatasourceService(l.ctx, l.svcCtx).ListContents(req) | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package datasource | ||
|
||
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/zeromicro/go-zero/core/logx" | ||
) | ||
|
||
type DatasourceListLogic struct { | ||
logx.Logger | ||
ctx context.Context | ||
svcCtx *svc.ServiceContext | ||
} | ||
|
||
func NewDatasourceListLogic(ctx context.Context, svcCtx *svc.ServiceContext) DatasourceListLogic { | ||
return DatasourceListLogic{ | ||
Logger: logx.WithContext(ctx), | ||
ctx: ctx, | ||
svcCtx: svcCtx, | ||
} | ||
} | ||
|
||
func (l *DatasourceListLogic) DatasourceList() (resp *types.DatasourceData, err error) { | ||
return service.NewDatasourceService(l.ctx, l.svcCtx).List() | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package datasource | ||
|
||
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/zeromicro/go-zero/core/logx" | ||
) | ||
|
||
type DatasourcePreviewFileLogic struct { | ||
logx.Logger | ||
ctx context.Context | ||
svcCtx *svc.ServiceContext | ||
} | ||
|
||
func NewDatasourcePreviewFileLogic(ctx context.Context, svcCtx *svc.ServiceContext) DatasourcePreviewFileLogic { | ||
return DatasourcePreviewFileLogic{ | ||
Logger: logx.WithContext(ctx), | ||
ctx: ctx, | ||
svcCtx: svcCtx, | ||
} | ||
} | ||
|
||
func (l *DatasourcePreviewFileLogic) DatasourcePreviewFile(req types.DatasourcePreviewFileRequest) (resp *types.DatasourcePreviewFileData, err error) { | ||
return service.NewDatasourceService(l.ctx, l.svcCtx).PreviewFile(req) | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package datasource | ||
|
||
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/zeromicro/go-zero/core/logx" | ||
) | ||
|
||
type DatasourceRemoveLogic struct { | ||
logx.Logger | ||
ctx context.Context | ||
svcCtx *svc.ServiceContext | ||
} | ||
|
||
func NewDatasourceRemoveLogic(ctx context.Context, svcCtx *svc.ServiceContext) DatasourceRemoveLogic { | ||
return DatasourceRemoveLogic{ | ||
Logger: logx.WithContext(ctx), | ||
ctx: ctx, | ||
svcCtx: svcCtx, | ||
} | ||
} | ||
|
||
func (l *DatasourceRemoveLogic) DatasourceRemove(req types.DatasourceRemoveRequest) error { | ||
return service.NewDatasourceService(l.ctx, l.svcCtx).Remove(req) | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package db | ||
|
||
import "time" | ||
|
||
type Datasource struct { | ||
ID int `json:"id" gorm:"primaryKey;autoIncrement"` | ||
Name string `json:"name"` | ||
Type string `json:"type"` | ||
Config string `json:"config"` | ||
Secret string `json:"secret"` | ||
Host string `json:"host"` | ||
Username string `json:"username"` | ||
CreateTime time.Time `json:"create_time" gorm:"autoCreateTime"` | ||
} |