package model import ( "github.com/Kamva/mgm/v3" ) // Article type type Article struct { mgm.DefaultModel `bson:",inline"` Title string `json:"title" bson:"title" validate:"required"` Description string `json:"description" bson:"description" validate:"required"` Content string `json:"content" bson:"content" validate:"required"` } // Articles Collection type Articles []Article // NewArticle create new Article func NewArticle(title string, desc string, content string) *Article { return &Article{ Title: title, Description: desc, Content: content, } }