This repository has been archived by the owner on Jun 20, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
types.go
87 lines (78 loc) · 2.64 KB
/
types.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
package emvi
import (
"time"
)
type BaseEntity struct {
Id string `json:"id"`
DefTime time.Time `json:"def_time"`
ModTime time.Time `json:"mod_time"`
}
type Article struct {
BaseEntity
OrganizationId string `json:"organization_id"`
Views uint `json:"views"`
WIP int `json:"wip"`
Archived string `json:"archived"`
Published time.Time `json:"published"`
Pinned bool `json:"pinned"`
LatestArticleContent *ArticleContent `json:"latest_article_content"`
Tags []Tag `json:"tags"`
PreviewImage string `json:"preview_image"`
}
type ArticleContent struct {
BaseEntity
Title string `json:"title"`
Content string `json:"content"`
Version int `json:"version"`
Commit string `json:"commit"`
WIP bool `json:"wip"`
ArticleId string `json:"article_id"`
LanguageId string `json:"language_id"`
UserId string `json:"user_id"` // user who created this commit
Authors []User `json:"authors"`
}
type Tag struct {
BaseEntity
OrganizationId string `json:"organization_id"`
Name string `json:"name"`
Usages int `json:"usages"`
}
type User struct {
BaseEntity
Email string `json:"email"`
Firstname string `json:"firstname"`
Lastname string `json:"lastname"`
Language string `json:"language"`
Info string `json:"info"`
Picture string `json:"picture"`
OrganizationMember *OrganizationMember `json:"organization_member"`
}
type OrganizationMember struct {
BaseEntity
OrganizationId string `json:"organization_id"`
UserId string `json:"user_id"`
LanguageId string `json:"language_id"`
Username string `json:"username"`
Phone string `json:"phone"`
Mobile string `json:"mobile"`
Info string `json:"info"`
User *User `json:"user"`
}
type Organization struct {
BaseEntity
Name string `json:"name"`
NameNormalized string `json:"name_normalized"`
Picture string `json:"picture"`
Expert bool `json:"expert"`
CreateGroupAdmin bool `json:"create_group_admin"`
CreateGroupMod bool `json:"create_group_mod"`
MemberCount int `json:"member_count"`
ArticleCount int `json:"article_count"`
}
type Language struct {
BaseEntity
OrganizationId string `json:"organization_id"`
Name string `json:"name"`
Code string `json:"code"`
Default bool `json:"default"`
}