mirror of
https://github.com/documize/community.git
synced 2025-07-22 06:39:43 +02:00
refactored unique ID generator package
This commit is contained in:
parent
cf58f8164d
commit
fe05cf7bb5
16 changed files with 69 additions and 64 deletions
|
@ -26,6 +26,7 @@ import (
|
|||
"github.com/documize/community/core/log"
|
||||
"github.com/documize/community/core/section/provider"
|
||||
"github.com/documize/community/core/streamutil"
|
||||
"github.com/documize/community/core/uniqueid"
|
||||
htmldiff "github.com/documize/html-diff"
|
||||
"github.com/gorilla/mux"
|
||||
)
|
||||
|
@ -79,7 +80,7 @@ func AddDocumentPage(w http.ResponseWriter, r *http.Request) {
|
|||
return
|
||||
}
|
||||
|
||||
pageID := util.UniqueID()
|
||||
pageID := uniqueid.Generate()
|
||||
model.Page.RefID = pageID
|
||||
model.Meta.PageID = pageID
|
||||
model.Meta.OrgID = p.Context.OrgID // required for Render call below
|
||||
|
@ -530,7 +531,7 @@ func UpdateDocumentPage(w http.ResponseWriter, r *http.Request) {
|
|||
var skipRevision bool
|
||||
skipRevision, err = strconv.ParseBool(r.URL.Query().Get("r"))
|
||||
|
||||
refID := util.UniqueID()
|
||||
refID := uniqueid.Generate()
|
||||
err = p.UpdatePage(model.Page, refID, p.Context.UserID, skipRevision)
|
||||
if err != nil {
|
||||
writeGeneralSQLError(w, method, err)
|
||||
|
@ -1001,7 +1002,7 @@ func RollbackDocumentPage(w http.ResponseWriter, r *http.Request) {
|
|||
|
||||
// roll back page
|
||||
page.Body = revision.Body
|
||||
refID := util.UniqueID()
|
||||
refID := uniqueid.Generate()
|
||||
|
||||
err = p.UpdatePage(page, refID, p.Context.UserID, false)
|
||||
if err != nil {
|
||||
|
@ -1101,7 +1102,7 @@ func CopyPage(w http.ResponseWriter, r *http.Request) {
|
|||
return
|
||||
}
|
||||
|
||||
newPageID := util.UniqueID()
|
||||
newPageID := uniqueid.Generate()
|
||||
page.RefID = newPageID
|
||||
page.Level = 1
|
||||
page.Sequence = 0
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue