-
Notifications
You must be signed in to change notification settings - Fork 0
/
content_node.go
53 lines (40 loc) · 997 Bytes
/
content_node.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
41
42
43
44
45
46
47
48
49
50
51
52
53
package models
import (
"net/url"
"time"
)
// ContentNode content node
type ContentNode struct {
// title
Title string `json:"title,omitempty"`
// body
Body string `json:"body,omitempty"`
// children
// Required: true
Children []*ContentNode `json:"~parent,omitempty"`
// created
// Required: true
Created time.Time `json:"created,omitempty"`
// edited
// Required: true
Edited time.Time `json:"edited,omitempty"`
// image Uri
ImageURI *url.URL `json:"imageUri,omitempty"`
// score
// Required: true
Score float64 `json:"score,omitempty"`
// sentiment
// Required: true
Sentiment float64 `json:"sentiment,omitempty"`
// tags
Tags []Tag `json:"tags,omitempty"`
// type
DgraphType []string `json:"dgraph.type,omitempty"`
// uid
UID string `json:"uid,omitempty"`
}
// NewContentNodeNode is a struct designed to handle special parameters for creating a node in DGraph
type NewContentNodeNode struct {
ContentNode
ParentUID *Edge `json:"parent,omitempty"`
}