add sortByFictionalDate field to Story, and sorting by fictional date if set.
continuous-integration/drone/push Build is passing
continuous-integration/drone/push Build is passing
This commit is contained in:
+19
-17
@@ -5,16 +5,17 @@ import "time"
|
||||
// A Story is user content that does not have a wiki-suitable format. Documents, new stories, short stories, and so on.
|
||||
// The story model is a container for multiple chapters this time, in contrast to the previous version.
|
||||
type Story struct {
|
||||
ID string `bson:"_id"`
|
||||
Author string `bson:"author"`
|
||||
Name string `bson:"name"`
|
||||
Category StoryCategory `bson:"category"`
|
||||
Open bool `bson:"open"`
|
||||
Listed bool `bson:"listed"`
|
||||
Tags []Tag `bson:"tags"`
|
||||
CreatedDate time.Time `bson:"createdDate"`
|
||||
FictionalDate time.Time `bson:"fictionalDate,omitempty"`
|
||||
UpdatedDate time.Time `bson:"updatedDate"`
|
||||
ID string `bson:"_id"`
|
||||
Author string `bson:"author"`
|
||||
Name string `bson:"name"`
|
||||
Category StoryCategory `bson:"category"`
|
||||
Open bool `bson:"open"`
|
||||
Listed bool `bson:"listed"`
|
||||
Tags []Tag `bson:"tags"`
|
||||
CreatedDate time.Time `bson:"createdDate"`
|
||||
FictionalDate time.Time `bson:"fictionalDate,omitempty"`
|
||||
UpdatedDate time.Time `bson:"updatedDate"`
|
||||
SortByFictionalDate bool `bson:"sortByFictionalDate"`
|
||||
}
|
||||
|
||||
// IsChangeObject is an interface implementation to identify it as a valid
|
||||
@@ -35,11 +36,12 @@ type StoryFilter struct {
|
||||
}
|
||||
|
||||
type StoryUpdate struct {
|
||||
Name *string
|
||||
Category *StoryCategory
|
||||
Author *string
|
||||
Open *bool
|
||||
Listed *bool
|
||||
FictionalDate *time.Time
|
||||
UpdatedDate *time.Time
|
||||
Name *string
|
||||
Category *StoryCategory
|
||||
Author *string
|
||||
Open *bool
|
||||
Listed *bool
|
||||
FictionalDate *time.Time
|
||||
UpdatedDate *time.Time
|
||||
SortByFictionalDate *bool
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user