@@ -16,23 +16,6 @@ import (
16
16
)
17
17
18
18
func ListStorages (ctx echo.Context ) error {
19
- // var req model.PageReq
20
- // if err := ctx.Bind(&req); err != nil {
21
- // return ctx.JSON(common_err.SUCCESS, model.Result{Success: common_err.CLIENT_ERROR, Message: common_err.GetMsg(common_err.CLIENT_ERROR), Data: err.Error()})
22
- // return
23
- // }
24
- // req.Validate()
25
-
26
- // logger.Info("ListStorages", zap.Any("req", req))
27
- // storages, total, err := service.MyService.Storage().GetStorages(req.Page, req.PerPage)
28
- // if err != nil {
29
- // return ctx.JSON(common_err.SUCCESS, model.Result{Success: common_err.SERVICE_ERROR, Message: common_err.GetMsg(common_err.SERVICE_ERROR), Data: err.Error()})
30
- // return
31
- // }
32
- // return ctx.JSON(common_err.SUCCESS, model.Result{Success: common_err.SUCCESS, Message: common_err.GetMsg(common_err.SUCCESS), Data: model.PageResp{
33
- // Content: storages,
34
- // Total: total,
35
- // }})
36
19
r , err := service .MyService .Storage ().GetStorages ()
37
20
if err != nil {
38
21
return ctx .JSON (common_err .SUCCESS , model.Result {Success : common_err .SERVICE_ERROR , Message : common_err .GetMsg (common_err .SERVICE_ERROR ), Data : err .Error ()})
@@ -58,12 +41,7 @@ func ListStorages(ctx echo.Context) error {
58
41
list := []httper.MountPoint {}
59
42
60
43
for _ , v := range r .MountPoints {
61
- list = append (list , httper.MountPoint {
62
- Fs : v .Fs ,
63
- Icon : v .Icon ,
64
- MountPoint : v .MountPoint ,
65
- Name : v .Name ,
66
- })
44
+ list = append (list , httper .MountPoint (v ))
67
45
}
68
46
69
47
return ctx .JSON (common_err .SUCCESS , model.Result {Success : common_err .SUCCESS , Message : common_err .GetMsg (common_err .SUCCESS ), Data : list })
0 commit comments