cds-web/models/group.go

24 lines
656 B
Go
Raw Normal View History

package models
import "go.mongodb.org/mongo-driver/bson/primitive"
type Group struct {
2022-10-29 23:07:29 +02:00
Id primitive.ObjectID `bson:"_id" json:"id", omitempty`
2022-10-21 20:09:10 +02:00
Name string `bson:"name" json:"name"`
Desc string `bson:"desc"`
NbMax int `bson:"nbMax"`
Members []primitive.ObjectID `bson:"members"`
2022-10-21 20:09:10 +02:00
Game primitive.ObjectID `bson:"game" json:"game"`
}
func NewGroup() *Group {
return &Group{primitive.NewObjectID(), "", "", 0, []primitive.ObjectID{}, primitive.NewObjectID()}
}
func NewGroupNameDesc(name string, desc string) *Group {
ret := NewGroup()
ret.Name = name
ret.Desc = desc
return ret
}