Skip to content

Commit d0777d1

Browse files
committed
修改获取附件列表的个数,从默认的50到指定的1000
1 parent 9e48e35 commit d0777d1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

api_attachment.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"encoding/json"
55
"fmt"
66
"net/http"
7+
"net/url"
78
"path/filepath"
89
)
910

@@ -107,7 +108,9 @@ func (cli *Client) AttachmentUpdate(contentId, attachmentId, file string) ([]Con
107108

108109
// 获取指定页面的所有附件
109110
func (cli *Client) AttachmentsByContentId(contentId string) ([]Content, error) {
110-
resp, err := cli.ApiGET("/content/"+contentId+"/child/attachment", nil)
111+
query := url.Values{}
112+
query.Add("limit", "1000")
113+
resp, err := cli.ApiGET("/content/"+contentId+"/child/attachment", query)
111114
if err != nil {
112115
return nil, fmt.Errorf("执行请求失败: %s", err)
113116
}

0 commit comments

Comments
 (0)