Submit a task
This commit is contained in:
@@ -1,14 +1,32 @@
|
||||
package ajax
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"local/todo-server/server/ajax/list"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
type List struct{}
|
||||
|
||||
func (a *Ajax) loadLists(w http.ResponseWriter, r *http.Request) error {
|
||||
return errors.New("not impl")
|
||||
lists, err := a.storageListLists()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
// TODO
|
||||
lists = append(lists, &list.List{
|
||||
ID: "Todo",
|
||||
UUID: "Todo",
|
||||
})
|
||||
if err := a.storageSetList(lists[0].ID, lists[0]); err != nil {
|
||||
return err
|
||||
}
|
||||
// /TODO
|
||||
return json.NewEncoder(w).Encode(map[string]interface{}{
|
||||
"total": len(lists),
|
||||
"list": lists,
|
||||
})
|
||||
}
|
||||
|
||||
func (a *Ajax) changeOrder(w http.ResponseWriter, r *http.Request) error {
|
||||
@@ -16,6 +34,7 @@ func (a *Ajax) changeOrder(w http.ResponseWriter, r *http.Request) error {
|
||||
}
|
||||
|
||||
func (a *Ajax) addList(w http.ResponseWriter, r *http.Request) error {
|
||||
// {"total":1,"list":[{"id":"21","name":"abc","sort":0,"published":0,"showCompl":0,"showNotes":0,"hidden":0}]}
|
||||
return errors.New("not impl")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user