12345678910111213141516171819202122232425262728 |
- 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)
- }
|