MCPcopy Create free account
hub / github.com/OpenListTeam/OpenList / getFiles

Method getFiles

drivers/febbox/util.go:98–120  ·  view source on GitHub ↗
(dirID string, page, pageLimit int64)

Source from the content-addressed store, hash-verified

96}
97
98func (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
122func (d *FebBox) getDownloadLink(id string, ip string) (string, error) {
123 var fileDownloadResp FileDownloadResp

Callers 1

listWithLimitMethod · 0.95

Calls 2

requestMethod · 0.95
UnmarshalMethod · 0.45

Tested by

no test coverage detected