|
@@ -2,6 +2,8 @@ package alist
|
|
|
|
|
|
import (
|
|
|
"context"
|
|
|
+ "goautodownload/internal/aptTools"
|
|
|
+ "os"
|
|
|
|
|
|
"github.com/gogf/gf/v2/errors/gcode"
|
|
|
"github.com/gogf/gf/v2/errors/gerror"
|
|
@@ -10,5 +12,21 @@ import (
|
|
|
)
|
|
|
|
|
|
func (c *ControllerV1) GetList(ctx context.Context, req *v1.GetListReq) (res *v1.GetListRes, err error) {
|
|
|
- return nil, gerror.NewCode(gcode.CodeNotImplemented)
|
|
|
+ res = new(v1.GetListRes)
|
|
|
+ apiTools := aptTools.NewAlistAPI("http://203.184.131.60:5244", "admin", "nokidc123@#")
|
|
|
+ err = apiTools.Login()
|
|
|
+ if err != nil {
|
|
|
+ return nil, err
|
|
|
+ }
|
|
|
+ currentSubPath, err := os.Getwd()
|
|
|
+ if err != nil {
|
|
|
+ return nil, err
|
|
|
+ }
|
|
|
+ contents, err := apiTools.RecursiveCollectContents("/pikpak/moive", "", "", "", currentSubPath, "")
|
|
|
+ if err != nil {
|
|
|
+ return nil, err
|
|
|
+ }
|
|
|
+
|
|
|
+ res.Files = contents
|
|
|
+ return res, gerror.NewCode(gcode.CodeNotImplemented)
|
|
|
}
|