probo/pkg/models/collection.go

28 lines
481 B
Go

package models
import "encoding/json"
type Collection struct {
Meta
Name string `json:"name"`
// Filter *Filter `json:"filter"`
Quizzes []*Quiz `json:"quizzes" gorm:"many2many:collection_quizzes"`
}
func (c *Collection) String() string {
return c.Name
}
func (c *Collection) GetHash() string {
return ""
}
func (c *Collection) Marshal() ([]byte, error) {
return json.Marshal(c)
}
func (c *Collection) Unmarshal(data []byte) error {
return json.Unmarshal(data, c)
}