-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
498 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
Name: studio-api | ||
Host: 0.0.0.0 | ||
Port: 7002 | ||
MaxBytes: 1073741824 | ||
Debug: | ||
Enable: false | ||
Auth: | ||
AccessSecret: "login_secret" | ||
AccessExpire: 7200 | ||
File: | ||
UploadDir: "./upload/" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,4 +11,8 @@ type Config struct { | |
AccessSecret string | ||
AccessExpire int64 | ||
} | ||
|
||
File struct { | ||
UploadDir string | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
server-v2/api/studio/internal/handler/file/filedestroyhandler.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
17 changes: 17 additions & 0 deletions
17
server-v2/api/studio/internal/handler/file/filesindexhandler.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
17 changes: 17 additions & 0 deletions
17
server-v2/api/studio/internal/handler/file/fileuploadhandler.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
29 changes: 29 additions & 0 deletions
29
server-v2/api/studio/internal/logic/file/filedestroylogic.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
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/zeromicro/go-zero/core/logx" | ||
) | ||
|
||
type FileDestroyLogic struct { | ||
logx.Logger | ||
ctx context.Context | ||
svcCtx *svc.ServiceContext | ||
} | ||
|
||
func NewFileDestroyLogic(ctx context.Context, svcCtx *svc.ServiceContext) *FileDestroyLogic { | ||
return &FileDestroyLogic{ | ||
Logger: logx.WithContext(ctx), | ||
ctx: ctx, | ||
svcCtx: svcCtx, | ||
} | ||
} | ||
|
||
func (l *FileDestroyLogic) FileDestroy(req types.FileDestroyRequest) error { | ||
return service.NewFileService(nil, l.ctx, l.svcCtx).FileDestroy(req.Name) | ||
} |
29 changes: 29 additions & 0 deletions
29
server-v2/api/studio/internal/logic/file/filesindexlogic.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
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/zeromicro/go-zero/core/logx" | ||
) | ||
|
||
type FilesIndexLogic struct { | ||
logx.Logger | ||
ctx context.Context | ||
svcCtx *svc.ServiceContext | ||
} | ||
|
||
func NewFilesIndexLogic(ctx context.Context, svcCtx *svc.ServiceContext) *FilesIndexLogic { | ||
return &FilesIndexLogic{ | ||
Logger: logx.WithContext(ctx), | ||
ctx: ctx, | ||
svcCtx: svcCtx, | ||
} | ||
} | ||
|
||
func (l *FilesIndexLogic) FilesIndex() (resp *types.FilesIndexData, err error) { | ||
return service.NewFileService(nil, l.ctx, l.svcCtx).FilesIndex() | ||
} |
27 changes: 27 additions & 0 deletions
27
server-v2/api/studio/internal/logic/file/fileuploadlogic.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package file | ||
|
||
import ( | ||
"github.com/vesoft-inc/nebula-studio/server/api/studio/internal/service" | ||
"net/http" | ||
|
||
"github.com/vesoft-inc/nebula-studio/server/api/studio/internal/svc" | ||
"github.com/zeromicro/go-zero/core/logx" | ||
) | ||
|
||
type FileUploadLogic struct { | ||
logx.Logger | ||
r *http.Request | ||
svcCtx *svc.ServiceContext | ||
} | ||
|
||
func NewFileUploadLogic(r *http.Request, svcCtx *svc.ServiceContext) *FileUploadLogic { | ||
return &FileUploadLogic{ | ||
Logger: logx.WithContext(r.Context()), | ||
r: r, | ||
svcCtx: svcCtx, | ||
} | ||
} | ||
|
||
func (l *FileUploadLogic) FileUpload() error { | ||
return service.NewFileService(l.r, nil, l.svcCtx).FileUpload() | ||
} |
Oops, something went wrong.