2022-02-10 22:06:57 +00:00
|
|
|
//go:build !change
|
2020-03-19 21:57:07 +00:00
|
|
|
|
|
|
|
package models
|
|
|
|
|
|
|
|
type ID int
|
|
|
|
|
|
|
|
type AddRequest struct {
|
|
|
|
Title string `json:"title"`
|
|
|
|
Content string `json:"content"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type Todo struct {
|
|
|
|
ID ID `json:"id"`
|
|
|
|
Title string `json:"title"`
|
|
|
|
Content string `json:"content"`
|
|
|
|
Finished bool `json:"finished"`
|
|
|
|
}
|
|
|
|
|
|
|
|
func (t *Todo) MarkFinished() {
|
|
|
|
t.Finished = true
|
|
|
|
}
|
|
|
|
|
2020-03-21 23:55:52 +00:00
|
|
|
func (t *Todo) MarkUnfinished() {
|
2020-03-19 21:57:07 +00:00
|
|
|
t.Finished = false
|
|
|
|
}
|