add field id in group

This commit is contained in:
rick 2022-10-29 23:07:29 +02:00
parent 0e7dde9a9f
commit 52fb59cc01
Signed by: Rick
GPG key ID: 4A6223D66294EB20
2 changed files with 2 additions and 1 deletions

View file

@ -29,6 +29,7 @@ struct Game {
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)] #[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
pub struct Group { pub struct Group {
pub id: String,
pub name: String, pub name: String,
pub game: String, pub game: String,
} }

View file

@ -3,7 +3,7 @@ package models
import "go.mongodb.org/mongo-driver/bson/primitive" import "go.mongodb.org/mongo-driver/bson/primitive"
type Group struct { type Group struct {
Id primitive.ObjectID `bson:"_id", omitempty` Id primitive.ObjectID `bson:"_id" json:"id", omitempty`
Name string `bson:"name" json:"name"` Name string `bson:"name" json:"name"`
Desc string `bson:"desc"` Desc string `bson:"desc"`
NbMax int `bson:"nbMax"` NbMax int `bson:"nbMax"`