(dirID string, page, pageLimit int64)
| 96 | } |
| 97 | |
| 98 | func (d *FebBox) getFiles(dirID string, page, pageLimit int64) (*[]File, error) { |
| 99 | var fileList FileListResp |
| 100 | queryParams := map[string]string{ |
| 101 | "module": "file_list", |
| 102 | "parent_id": dirID, |
| 103 | "page": strconv.FormatInt(page, 10), |
| 104 | "pagelimit": strconv.FormatInt(pageLimit, 10), |
| 105 | "order": d.Addition.SortRule, |
| 106 | } |
| 107 | |
| 108 | res, err := d.request("https://api.febbox.com/oauth", http.MethodPost, func(req *resty.Request) { |
| 109 | req.SetMultipartFormData(queryParams) |
| 110 | }, &fileList) |
| 111 | if err != nil { |
| 112 | return nil, err |
| 113 | } |
| 114 | |
| 115 | if err = json.Unmarshal(res, &fileList); err != nil { |
| 116 | return nil, err |
| 117 | } |
| 118 | |
| 119 | return &fileList.Data.FileList, nil |
| 120 | } |
| 121 | |
| 122 | func (d *FebBox) getDownloadLink(id string, ip string) (string, error) { |
| 123 | var fileDownloadResp FileDownloadResp |
no test coverage detected