mirror of
https://github.com/documize/community.git
synced 2025-07-24 07: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
|
@ -16,9 +16,9 @@ import (
|
|||
"time"
|
||||
|
||||
"github.com/documize/community/core/api/entity"
|
||||
"github.com/documize/community/core/api/util"
|
||||
"github.com/documize/community/core/log"
|
||||
"github.com/documize/community/core/streamutil"
|
||||
"github.com/documize/community/core/uniqueid"
|
||||
)
|
||||
|
||||
// AddContentLink inserts wiki-link into the store.
|
||||
|
@ -74,7 +74,7 @@ func (p *Persister) SearchLinkCandidates(keywords string) (docs []entity.LinkCan
|
|||
|
||||
for _, r := range temp {
|
||||
c := entity.LinkCandidate{
|
||||
RefID: util.UniqueID(),
|
||||
RefID: uniqueid.Generate(),
|
||||
FolderID: r.FolderID,
|
||||
DocumentID: r.DocumentID,
|
||||
TargetID: r.DocumentID,
|
||||
|
@ -113,7 +113,7 @@ func (p *Persister) SearchLinkCandidates(keywords string) (docs []entity.LinkCan
|
|||
|
||||
for _, r := range temp {
|
||||
c := entity.LinkCandidate{
|
||||
RefID: util.UniqueID(),
|
||||
RefID: uniqueid.Generate(),
|
||||
FolderID: r.FolderID,
|
||||
DocumentID: r.DocumentID,
|
||||
TargetID: r.TargetID,
|
||||
|
@ -152,7 +152,7 @@ func (p *Persister) SearchLinkCandidates(keywords string) (docs []entity.LinkCan
|
|||
|
||||
for _, r := range temp {
|
||||
c := entity.LinkCandidate{
|
||||
RefID: util.UniqueID(),
|
||||
RefID: uniqueid.Generate(),
|
||||
FolderID: r.FolderID,
|
||||
DocumentID: r.DocumentID,
|
||||
TargetID: r.TargetID,
|
||||
|
|
|
@ -15,19 +15,19 @@ package request
|
|||
|
||||
import (
|
||||
"github.com/documize/community/core/api/entity"
|
||||
"github.com/documize/community/core/api/util"
|
||||
"github.com/documize/community/core/uniqueid"
|
||||
)
|
||||
|
||||
// SetupPersister prepares context for database activity.
|
||||
func SetupPersister() (*Persister, error) {
|
||||
var err error
|
||||
c := Context{
|
||||
Authenticated: true, // bool
|
||||
Guest: false, // bool
|
||||
Administrator: true, // bool
|
||||
Editor: true, // bool
|
||||
UserID: util.UniqueID(), // string
|
||||
OrgID: util.UniqueID(), // string
|
||||
Authenticated: true, // bool
|
||||
Guest: false, // bool
|
||||
Administrator: true, // bool
|
||||
Editor: true, // bool
|
||||
UserID: uniqueid.Generate(), // string
|
||||
OrgID: uniqueid.Generate(), // string
|
||||
//OrgURL: "http://wwww.test.org", // string
|
||||
//OrgName: "TestOrgName", // string
|
||||
AllowAnonymousAccess: false, // bool
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue