1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-23 07:09:43 +02:00

major package structure refactoring

This commit is contained in:
Harvey Kandola 2017-07-18 21:55:17 +01:00
parent 7b8cec9a6c
commit cf58f8164d
73 changed files with 549 additions and 389 deletions

View file

@ -25,9 +25,8 @@ import (
"github.com/documize/community/core/api/util"
"github.com/documize/community/core/log"
"github.com/documize/community/core/section/provider"
"github.com/documize/community/core/utility"
"github.com/documize/community/core/streamutil"
htmldiff "github.com/documize/html-diff"
"github.com/gorilla/mux"
)
@ -54,7 +53,7 @@ func AddDocumentPage(w http.ResponseWriter, r *http.Request) {
return
}
defer utility.Close(r.Body)
defer streamutil.Close(r.Body)
body, err := ioutil.ReadAll(r.Body)
if err != nil {
@ -260,7 +259,7 @@ func GetDocumentPagesBatch(w http.ResponseWriter, r *http.Request) {
return
}
defer utility.Close(r.Body)
defer streamutil.Close(r.Body)
body, err := ioutil.ReadAll(r.Body)
if err != nil {
@ -389,7 +388,7 @@ func DeleteDocumentPages(w http.ResponseWriter, r *http.Request) {
return
}
defer utility.Close(r.Body)
defer streamutil.Close(r.Body)
body, err := ioutil.ReadAll(r.Body)
if err != nil {
writeBadRequestError(w, method, "Bad body")
@ -480,7 +479,7 @@ func UpdateDocumentPage(w http.ResponseWriter, r *http.Request) {
return
}
defer utility.Close(r.Body)
defer streamutil.Close(r.Body)
body, err := ioutil.ReadAll(r.Body)
if err != nil {
writeBadRequestError(w, method, "Bad request body")
@ -585,7 +584,7 @@ func ChangeDocumentPageSequence(w http.ResponseWriter, r *http.Request) {
return
}
defer utility.Close(r.Body)
defer streamutil.Close(r.Body)
body, err := ioutil.ReadAll(r.Body)
if err != nil {
@ -650,7 +649,7 @@ func ChangeDocumentPageLevel(w http.ResponseWriter, r *http.Request) {
return
}
defer utility.Close(r.Body)
defer streamutil.Close(r.Body)
body, err := ioutil.ReadAll(r.Body)
if err != nil {