-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcontent.go
40 lines (35 loc) · 1.35 KB
/
content.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package confluence
//Confluence内容
type Content struct {
Id string `json:"id,omitempty"`
Type string `json:"type,omitempty"`
Title string `json:"title,omitempty"`
Space Space `json:"space,omitempty"`
Body ContentBody `json:"body,omitempty"`
Link LinkResp `json:"_links",omitempty`
Version Version `json:"version,omitempty"`
Ancestors []Content `json:"ancestors,omitempty"`
}
const (
ContentTypePage = "page" //页面类型的Content
ContentTypeBlog = "blog" //博客类型的Content
)
//Confluence内容体
type ContentBody struct {
Storage ContentBodyStorage `json:"storage,omitempty"`
Editor interface{} `json:"editor,omitempty"`
View interface{} `json:"view,omitempty"`
ExportView interface{} `json:"export_view,omitempty"`
StyledView interface{} `json:"styled_view,omitempty"`
AnonymousExportView interface{} `json:"anonymous_export_view,omitempty"`
}
//Storage类型的内容体
type ContentBodyStorage struct {
Value string `json:"value,omitempty"`
Representation string `json:"representation,omitempty"`
}
//设置Storage类型的内容体
func (content *Content) SetStorageBody(value string) {
content.Body.Storage.Representation = "storage"
content.Body.Storage.Value = value
}