This commit is contained in:
parent
2830575490
commit
48ac23c8de
@ -66,12 +66,13 @@ func (d *ILanZou) Drop(ctx context.Context) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (d *ILanZou) List(ctx context.Context, dir model.Obj, args model.ListArgs) ([]model.Obj, error) {
|
func (d *ILanZou) List(ctx context.Context, dir model.Obj, args model.ListArgs) ([]model.Obj, error) {
|
||||||
|
offset := 1
|
||||||
var res []ListItem
|
var res []ListItem
|
||||||
for {
|
for {
|
||||||
var resp ListResp
|
var resp ListResp
|
||||||
_, err := d.proved("/record/file/list", http.MethodGet, func(req *resty.Request) {
|
_, err := d.proved("/record/file/list", http.MethodGet, func(req *resty.Request) {
|
||||||
params := []string{
|
params := []string{
|
||||||
"offset=1",
|
"offset=" + strconv.Itoa(offset),
|
||||||
"limit=60",
|
"limit=60",
|
||||||
"folderId=" + dir.GetID(),
|
"folderId=" + dir.GetID(),
|
||||||
"type=0",
|
"type=0",
|
||||||
@ -83,7 +84,9 @@ func (d *ILanZou) List(ctx context.Context, dir model.Obj, args model.ListArgs)
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
res = append(res, resp.List...)
|
res = append(res, resp.List...)
|
||||||
if resp.TotalPage <= resp.Offset {
|
if resp.Offset < resp.TotalPage {
|
||||||
|
offset++
|
||||||
|
} else {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user