wip
This commit is contained in:
parent
ac8b334eee
commit
04c101982f
6 changed files with 98 additions and 39 deletions
8
main.go
8
main.go
|
|
@ -110,7 +110,7 @@ func main() { // {{{
|
|||
|
||||
http.HandleFunc("/user/authenticate", AuthManager.AuthenticationHandler)
|
||||
|
||||
http.HandleFunc("/node/tree/{timestamp}", authenticated(actionNodeTree))
|
||||
http.HandleFunc("/node/tree/{timestamp}/{offset}", authenticated(actionNodeTree))
|
||||
http.HandleFunc("/node/retrieve/{id}", authenticated(actionNodeRetrieve))
|
||||
|
||||
http.HandleFunc("/service_worker.js", pageServiceWorker)
|
||||
|
|
@ -226,8 +226,9 @@ func pageSync(w http.ResponseWriter, r *http.Request) { // {{{
|
|||
func actionNodeTree(w http.ResponseWriter, r *http.Request) { // {{{
|
||||
user := getUser(r)
|
||||
changedFrom, _ := strconv.Atoi(r.PathValue("timestamp"))
|
||||
offset, _ := strconv.Atoi(r.PathValue("offset"))
|
||||
|
||||
nodes, maxSeq, err := NodeTree(user.ID, uint64(changedFrom))
|
||||
nodes, maxSeq, moreRowsExist, err := NodeTree(user.ID, offset, uint64(changedFrom))
|
||||
if err != nil {
|
||||
Log.Error("/node/tree", "error", err)
|
||||
httpError(w, err)
|
||||
|
|
@ -238,7 +239,8 @@ func actionNodeTree(w http.ResponseWriter, r *http.Request) { // {{{
|
|||
OK bool
|
||||
Nodes []TreeNode
|
||||
MaxSeq uint64
|
||||
}{true, nodes, maxSeq})
|
||||
Continue bool
|
||||
}{true, nodes, maxSeq, moreRowsExist})
|
||||
Log.Debug("tree", "nodes", nodes)
|
||||
w.Write(j)
|
||||
} // }}}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue