working commit
This commit is contained in:
+17
-10
@@ -6,7 +6,7 @@ import (
|
||||
)
|
||||
|
||||
func (hand *Handler) FileExists(rctx *router.Context) {
|
||||
hand.logg.Debugf("handle FileExists")
|
||||
hand.logg.Debugf("Handle FileExists")
|
||||
|
||||
filepath := rctx.PathMap["filepath"]
|
||||
params := &operator.FileExistsParams{
|
||||
@@ -19,21 +19,28 @@ func (hand *Handler) FileExists(rctx *router.Context) {
|
||||
}
|
||||
|
||||
func (hand *Handler) PutFile(rctx *router.Context) {
|
||||
hand.logg.Debugf("handle PutFile")
|
||||
hand.logg.Debugf("Handle PutFile")
|
||||
|
||||
contentLength := rctx.GetHeader("Content-Length")
|
||||
contentType := rctx.GetHeader("Content-Type")
|
||||
filepath := rctx.PathMap["filepath"]
|
||||
params := &operator.PutFileParams{
|
||||
Filepath: filepath,
|
||||
Source: rctx.Request.Body,
|
||||
}
|
||||
hand.logg.Debugf("filepath: %s", filepath)
|
||||
|
||||
code, _, _ := hand.oper.PutFile(params)
|
||||
params := &operator.PutFileParams{
|
||||
Filepath: filepath,
|
||||
ContentLength: contentLength,
|
||||
ContentType: contentType,
|
||||
Source: rctx.Request.Body,
|
||||
}
|
||||
code, res, err := hand.oper.PutFile(params)
|
||||
if err != nil {
|
||||
hand.logg.Errorf("Error: %v", err)
|
||||
}
|
||||
rctx.SetStatus(code)
|
||||
hand.SendResult(rctx, res)
|
||||
}
|
||||
|
||||
func (hand *Handler) GetFile(rctx *router.Context) {
|
||||
hand.logg.Debugf("handle GetFile")
|
||||
hand.logg.Debugf("Handle GetFile")
|
||||
|
||||
filepath := rctx.PathMap["filepath"]
|
||||
params := &operator.GetFileParams{
|
||||
@@ -48,7 +55,7 @@ func (hand *Handler) GetFile(rctx *router.Context) {
|
||||
}
|
||||
|
||||
func (hand *Handler) DeleteFile(rctx *router.Context) {
|
||||
hand.logg.Debugf("handle DeleteFile")
|
||||
hand.logg.Debugf("Handle DeleteFile")
|
||||
|
||||
filepath := rctx.PathMap["filepath"]
|
||||
params := &operator.DeleteFileParams{
|
||||
|
||||
Reference in New Issue
Block a user