2023-11-05 14:36:33 +01:00
|
|
|
package models
|
|
|
|
|
2023-11-21 15:12:13 +01:00
|
|
|
import (
|
|
|
|
"github.com/gocarina/gocsv"
|
|
|
|
)
|
|
|
|
|
2023-11-05 14:36:33 +01:00
|
|
|
type Group struct {
|
2023-11-21 15:12:13 +01:00
|
|
|
Meta
|
2023-11-05 14:36:33 +01:00
|
|
|
Name string
|
|
|
|
Participants []*Participant
|
|
|
|
}
|
2023-11-21 15:12:13 +01:00
|
|
|
|
|
|
|
func (g *Group) String() string {
|
|
|
|
return g.Name
|
|
|
|
}
|
|
|
|
|
|
|
|
func (g *Group) GetID() string {
|
|
|
|
return g.ID
|
|
|
|
}
|
|
|
|
|
|
|
|
func (g *Group) SetID(id string) {
|
|
|
|
g.ID = id
|
|
|
|
}
|
|
|
|
|
|
|
|
func (g *Group) GetHash() string {
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
|
|
|
|
func (g *Group) Marshal() ([]byte, error) {
|
|
|
|
return gocsv.MarshalBytes(g.Participants)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (g *Group) Unmarshal(data []byte) error {
|
2023-11-21 18:24:10 +01:00
|
|
|
return gocsv.UnmarshalBytes(data, &g.Participants)
|
2023-11-21 15:12:13 +01:00
|
|
|
}
|