Files
checky/template.go

44 lines
655 B
Go
Raw Permalink Normal View History

2022-03-15 04:43:03 +00:00
package main
2022-03-16 00:03:27 +00:00
import "time"
2022-03-15 04:43:03 +00:00
type Template struct {
2022-03-16 00:03:27 +00:00
Id string `json:"id"`
2022-03-18 05:22:16 +00:00
Title string `json:"title"`
2022-03-16 00:03:27 +00:00
Items []*Item `json:"items"`
}
type Item struct {
Id string `json:"id"`
Check *Check `json:"check,omitempty"`
}
type Check struct {
Text string `json:"text"`
Owner string `json:"owner"`
Completed *time.Time `json:"completed"`
2022-03-15 04:43:03 +00:00
}
2022-03-17 04:08:08 +00:00
func NewTemplate() *Template {
return &Template{
Items: []*Item{},
}
}
2022-03-15 04:43:03 +00:00
func (t *Template) GetType() string {
2022-03-15 16:27:52 +00:00
return "template"
2022-03-15 04:43:03 +00:00
}
func (t *Template) GetId() string {
2022-03-15 16:27:52 +00:00
return t.Id
2022-03-15 04:43:03 +00:00
}
2022-03-17 04:08:08 +00:00
2022-03-22 06:02:35 +00:00
func (t *Template) SetId(id string) {
t.Id = id
}
2022-03-17 04:08:08 +00:00
func (t *Template) IsValid() bool {
return true
}