working commit
This commit is contained in:
+4
-1
@@ -108,6 +108,9 @@ func (hand *Handler) DeleteFile(rctx *router.Context) {
|
||||
func (hand *Handler) ListFiles(rctx *router.Context) {
|
||||
|
||||
filepath, _ := rctx.GetSubpath("filepath")
|
||||
if filepath == "" {
|
||||
filepath = "/"
|
||||
}
|
||||
params := &operator.ListFilesParams{
|
||||
Filepath: filepath,
|
||||
}
|
||||
@@ -119,5 +122,5 @@ func (hand *Handler) ListFiles(rctx *router.Context) {
|
||||
rctx.SetStatus(code)
|
||||
return
|
||||
}
|
||||
rctx.SendJSON(code, res)
|
||||
rctx.SendJSON(code, res.Files)
|
||||
}
|
||||
|
||||
@@ -10,8 +10,6 @@
|
||||
package handler
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"mstore/app/operator"
|
||||
"mstore/app/router"
|
||||
)
|
||||
@@ -19,6 +17,5 @@ import (
|
||||
func (hand *Handler) SendHello(rctx *router.Context) {
|
||||
params := &operator.SendHelloParams{}
|
||||
res, _ := hand.oper.SendHello(params)
|
||||
rctx.SetStatus(http.StatusOK)
|
||||
hand.SendResult(rctx, res)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user