Skip to content

Commit 2423e5e

Browse files
committed
在调conflune content相关接口时,给Ancestors参数加上space key。并把nocheck改为no-check
1 parent 30de8b2 commit 2423e5e

File tree

2 files changed

+33
-5
lines changed

2 files changed

+33
-5
lines changed

api_content.go

+32-4
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,14 @@ func (cli *Client) ContentCreateInSpace(contentType, space, parentId, title, dat
108108

109109
//设置父页面
110110
if parentId != "" {
111-
content.Ancestors = []Content{Content{Id: parentId}}
111+
content.Ancestors = []Content{
112+
{
113+
Id: parentId,
114+
Space: Space{
115+
Key: content.Space.Key,
116+
},
117+
},
118+
}
112119
}
113120

114121
resp, err := cli.ApiPOST("/content", content)
@@ -216,7 +223,14 @@ func (cli *Client) DrawFile(space, parentId, title, wikiDirPrefix, data string)
216223

217224
//设置父页面
218225
if parentId != "" {
219-
content.Ancestors = []Content{Content{Id: parentId}}
226+
content.Ancestors = []Content{
227+
{
228+
Id: parentId,
229+
Space: Space{
230+
Key: content.Space.Key,
231+
},
232+
},
233+
}
220234
}
221235

222236
return cli.ContentUpdate(content)
@@ -283,7 +297,14 @@ func (cli *Client) DrawFileWithNoteMacro(space, parentId, title, wikiDirPrefix,
283297

284298
//设置父页面
285299
if parentId != "" {
286-
content.Ancestors = []Content{Content{Id: parentId}}
300+
content.Ancestors = []Content{
301+
{
302+
Id: parentId,
303+
Space: Space{
304+
Key: content.Space.Key,
305+
},
306+
},
307+
}
287308
}
288309

289310
return cli.ContentUpdate(content)
@@ -379,7 +400,14 @@ func (cli *Client) DrawFileWithNewNoteMacro(options *DrawModifyPageOption) (Cont
379400

380401
//设置父页面
381402
if options.ParentId != "" {
382-
content.Ancestors = []Content{{Id: options.ParentId}}
403+
content.Ancestors = []Content{
404+
{
405+
Id: options.ParentId,
406+
Space: Space{
407+
Key: content.Space.Key,
408+
},
409+
},
410+
}
383411
}
384412

385413
return cli.ContentUpdate(content)

request.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ func (cli *Client) ApiPOSTFiles(path string, files []string) (*http.Response, er
114114
w.Close()
115115

116116
header := url.Values{
117-
"X-Atlassian-Token": {"nocheck"},
117+
"X-Atlassian-Token": {"no-check"},
118118
"Content-Type": {w.FormDataContentType()},
119119
}
120120

0 commit comments

Comments
 (0)