mirror of
https://github.com/AlistGo/alist.git
synced 2025-11-25 03:15:10 +08:00
- Implement new driver for 123 Open service, enabling file operations such as listing, uploading, moving, and removing files. - Introduce token management for authentication and authorization. - Add API integration for various file operations and actions. - Include utility functions for handling API requests and responses. - Register the new driver in the existing drivers' list.
21 lines
489 B
Go
21 lines
489 B
Go
package _123Open
|
|
|
|
import (
|
|
"fmt"
|
|
"net/http"
|
|
)
|
|
|
|
func (d *Open123) getFiles(parentFileId int64, limit int, lastFileId int64) (*FileListResp, error) {
|
|
var result FileListResp
|
|
url := fmt.Sprintf("%s?parentFileId=%d&limit=%d&lastFileId=%d", ApiFileList, parentFileId, limit, lastFileId)
|
|
|
|
_, err := d.Request(url, http.MethodGet, nil, &result)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
if result.Code != 0 {
|
|
return nil, fmt.Errorf("list error: %s", result.Message)
|
|
}
|
|
return &result, nil
|
|
}
|