mirror of
https://github.com/Floriansylvain/RenewCMS.git
synced 2026-08-19 11:43:22 +02:00
Added online field to Articles
This commit is contained in:
@@ -11,6 +11,7 @@ type Article struct {
|
|||||||
Date int64 `json:"date" bson:"date"`
|
Date int64 `json:"date" bson:"date"`
|
||||||
Content gin.H `json:"content" bson:"content"`
|
Content gin.H `json:"content" bson:"content"`
|
||||||
PageID string `json:"page_id" bson:"page_id"`
|
PageID string `json:"page_id" bson:"page_id"`
|
||||||
|
Online bool `json:"online" bson:"online"`
|
||||||
}
|
}
|
||||||
|
|
||||||
var articlesLocation = database.Location{Database: "gohcms", Collection: "articles"}
|
var articlesLocation = database.Location{Database: "gohcms", Collection: "articles"}
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ var Article1, _ = bson.Marshal(Article{
|
|||||||
Date: 1671482492,
|
Date: 1671482492,
|
||||||
Content: gin.H{},
|
Content: gin.H{},
|
||||||
PageID: "blog",
|
PageID: "blog",
|
||||||
|
Online: false,
|
||||||
})
|
})
|
||||||
|
|
||||||
var Article2, _ = bson.Marshal(Article{
|
var Article2, _ = bson.Marshal(Article{
|
||||||
@@ -20,6 +21,7 @@ var Article2, _ = bson.Marshal(Article{
|
|||||||
Date: 1671899112,
|
Date: 1671899112,
|
||||||
Content: gin.H{},
|
Content: gin.H{},
|
||||||
PageID: "blog",
|
PageID: "blog",
|
||||||
|
Online: false,
|
||||||
})
|
})
|
||||||
|
|
||||||
var BSONConvertedArticles = [][]byte{Article1, Article2}
|
var BSONConvertedArticles = [][]byte{Article1, Article2}
|
||||||
|
|||||||
@@ -21,6 +21,9 @@ db.createCollection('articles', {
|
|||||||
},
|
},
|
||||||
page_id: {
|
page_id: {
|
||||||
bsonType: 'string'
|
bsonType: 'string'
|
||||||
|
},
|
||||||
|
online: {
|
||||||
|
bsonType: 'bool'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user