rest-api/model/article.go
Piotr Biernat e1019a5ecc
All checks were successful
continuous-integration/drone/push Build is passing
Some refactor. Rewritted to Echo Framework
2020-09-26 23:01:44 +02:00

26 lines
592 B
Go

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 func
func NewArticle(title string, desc string, content string) *Article {
return &Article{
Title: title,
Description: desc,
Content: content,
}
}