add log and post postgres repos.
continuous-integration/drone/push Build is passing

This commit is contained in:
2021-03-28 15:10:56 +02:00
parent e4761ad4a0
commit 6748ff8bc2
32 changed files with 862 additions and 99 deletions
+19 -1
View File
@@ -15,6 +15,24 @@ type Log struct {
CharacterIDs []string `bson:"characterIds"`
}
func (log *Log) ApplyUpdate(update LogUpdate) {
if update.Open != nil {
log.Open = *update.Open
}
if update.EventName != nil {
log.EventName = *update.EventName
}
if update.Title != nil {
log.Title = *update.Title
}
if update.Description != nil {
log.Description = *update.Description
}
if update.CharacterIDs != nil {
log.CharacterIDs = update.CharacterIDs
}
}
// A LogSuggestion is a suggestion for a log.
type LogSuggestion struct {
Log *Log
@@ -31,13 +49,13 @@ func (*Log) IsChangeObject() {
// A LogFilter is a filter that can be used to list logs.
type LogFilter struct {
Search *string
Open *bool
Characters []string
Channels []string
Events []string
MinDate *time.Time
MaxDate *time.Time
Search *string
Limit int
}
+15
View File
@@ -13,6 +13,21 @@ type Post struct {
Position int `bson:"position"`
}
func (post *Post) ApplyUpdate(update PostUpdate) {
if update.Time != nil {
post.Time = *update.Time
}
if update.Kind != nil {
post.Kind = *update.Kind
}
if update.Nick != nil {
post.Nick = *update.Nick
}
if update.Text != nil {
post.Text = *update.Text
}
}
// IsChangeObject is an interface implementation to identify it as a valid
// ChangeObject in GQL.
func (*Post) IsChangeObject() {