Documentation ¶
Index ¶
- Constants
- Variables
- type Attachment
- func (a *Attachment) Delete(attachmentId string) (err error)
- func (a *Attachment) DeleteAttachmentDBFile(attachmentId string) (err error)
- func (a *Attachment) DeleteAttachmentsDBFileByDocumentId(documentId string) (err error)
- func (a *Attachment) GetAttachmentByAttachmentId(attachmentId string) (attachment map[string]string, err error)
- func (a *Attachment) GetAttachmentByAttachmentIds(attachmentIds []string) (attachments []map[string]string, err error)
- func (a *Attachment) GetAttachmentByName(name string) (attachment map[string]string, err error)
- func (a *Attachment) GetAttachments() (attachments []map[string]string, err error)
- func (a *Attachment) GetAttachmentsByDocumentId(documentId string) (attachments []map[string]string, err error)
- func (a *Attachment) GetAttachmentsByDocumentIdAndSource(documentId string, source int) (attachments []map[string]string, err error)
- func (a *Attachment) GetAttachmentsByDocumentIds(documentIds []string) (attachments []map[string]string, err error)
- func (a *Attachment) GetAttachmentsByLikeName(name string) (attachments []map[string]string, err error)
- func (a *Attachment) GetAttachmentsBySpaceId(spaceId string) (attachments []map[string]string, err error)
- func (a *Attachment) HasAttachmentName(name string) (has bool, err error)
- func (a *Attachment) HasSameName(attachmentId, name string) (has bool, err error)
- func (a *Attachment) Insert(attachmentValue map[string]interface{}) (id int64, err error)
- type Auth
- func (a *Auth) CountAuths() (count int64, err error)
- func (a *Auth) CountAuthsByKeyword(keyword string) (count int64, err error)
- func (a *Auth) Delete(authId string) (err error)
- func (a *Auth) GetAuthByAuthId(authId string) (auth map[string]string, err error)
- func (a *Auth) GetAuthByAuthIds(authIds []string) (auths []map[string]string, err error)
- func (a *Auth) GetAuthByName(name string) (auth map[string]string, err error)
- func (a *Auth) GetAuths() (auths []map[string]string, err error)
- func (a *Auth) GetAuthsByKeywordAndLimit(keyword string, limit int, number int) (auths []map[string]string, err error)
- func (a *Auth) GetAuthsByLikeName(name string) (auths []map[string]string, err error)
- func (a *Auth) GetAuthsByLimit(limit int, number int) (auths []map[string]string, err error)
- func (a *Auth) GetUsedAuth() (auth map[string]string, err error)
- func (a *Auth) HasAuthName(name string) (has bool, err error)
- func (a *Auth) HasAuthUsernamePrefix(usernamePrefix string) (has bool, err error)
- func (a *Auth) HasSameName(authId, name string) (has bool, err error)
- func (a *Auth) HasSameUsernamePrefix(authId, usernamePrefix string) (has bool, err error)
- func (a *Auth) Insert(authValue map[string]interface{}) (id int64, err error)
- func (a *Auth) SetAuthUsed(authId string) (id int64, err error)
- func (a *Auth) Update(authId string, authValue map[string]interface{}) (id int64, err error)
- type Collection
- func (c *Collection) CountCollections() (count int64, err error)
- func (c *Collection) Delete(collectionId string) (err error)
- func (c *Collection) DeleteByResourceIdType(resourceId string, collectType string) (err error)
- func (c *Collection) GetCollectionByCollectionId(collectionId string) (collection map[string]string, err error)
- func (c *Collection) GetCollectionByUserIdTypeAndResourceId(userId string, typeS int, resId string) (collection map[string]string, err error)
- func (c *Collection) GetCollectionGroupUserId(colType int) (collects []map[string]string, err error)
- func (c *Collection) GetCollections() (collections []map[string]string, err error)
- func (c *Collection) GetCollectionsByCollectionIds(collectionIds []string) (collections []map[string]string, err error)
- func (c *Collection) GetCollectionsByUserId(userId string) (collections []map[string]string, err error)
- func (c *Collection) GetCollectionsByUserIdAndType(userId string, typeS int) (collections []map[string]string, err error)
- func (c *Collection) GetResourceIdsOrderByCountLimit(limit int, collectType int) (collects []map[string]string, err error)
- func (c *Collection) Insert(collectionValue map[string]interface{}) (id int64, err error)
- type Config
- func (c *Config) GetConfigByConfigId(configId string) (config map[string]string, err error)
- func (c *Config) GetConfigByConfigIds(configIds []string) (configs []map[string]string, err error)
- func (c *Config) GetConfigByKey(key string) (config map[string]string, err error)
- func (c *Config) GetConfigs() (configs []map[string]string, err error)
- func (c *Config) Insert(insertValue map[string]interface{}) (id int64, err error)
- func (c *Config) InsertBatch(insertValues []map[string]interface{}) (id int64, err error)
- func (c *Config) Update(configId string, configValue map[string]interface{}) (id int64, err error)
- func (c *Config) UpdateByKey(key string, value string) (id int64, err error)
- type Contact
- func (c *Contact) CountContact() (count int64, err error)
- func (c *Contact) CountContactByName(name string) (count int64, err error)
- func (c *Contact) DeleteByContactId(contactId string) (affect int64, err error)
- func (c *Contact) GetAllContact() (contacts []map[string]string, err error)
- func (c *Contact) GetContactByContactId(contactId string) (contact map[string]string, err error)
- func (c *Contact) GetContactByLimit(limit, number int) (contact []map[string]string, err error)
- func (c *Contact) GetContactByLimitAndName(name string, limit, number int) (contacts []map[string]string, err error)
- func (c *Contact) Insert(contact map[string]interface{}) (contactId int64, err error)
- func (c *Contact) UpdateByContactId(contact map[string]interface{}, contactId string) (affect int64, err error)
- type Document
- func (d *Document) CountDocuments() (count int64, err error)
- func (d *Document) CountDocumentsBySpaceId(spaceId string) (count int64, err error)
- func (d *Document) CountDocumentsLikeName(name string) (count int64, err error)
- func (d *Document) DeleteDBAndFile(documentId string, userId string, pageFile string, docType string) (err error)
- func (d *Document) GetAllDocumentsByDocumentIds(documentIds []string) (documents []map[string]string, err error)
- func (d *Document) GetAllSpaceDocuments(spaceId string) (documents []map[string]string, err error)
- func (d *Document) GetCountGroupByCreateTime(startTime int64) (documents []map[string]string, err error)
- func (d *Document) GetDocumentByDocumentId(documentId string) (document map[string]string, err error)
- func (d *Document) GetDocumentByNameAndSpaceId(name string, spaceId string) (document map[string]string, err error)
- func (d *Document) GetDocumentByNameParentIdAndSpaceId(name string, parentId string, spaceId string, docType int) (document map[string]string, err error)
- func (d *Document) GetDocumentByParentIdAndSpaceId(parentId string, spaceId string, docType int) (document map[string]string, err error)
- func (d *Document) GetDocumentGroupCreateUserId() (documents []map[string]string, err error)
- func (d *Document) GetDocumentGroupEditUserId() (documents []map[string]string, err error)
- func (d *Document) GetDocumentsByDocumentIds(documentIds []string) (documents []map[string]string, err error)
- func (d *Document) GetDocumentsByLikeName(name string) (documents []map[string]string, err error)
- func (d *Document) GetDocumentsByLikeNameAndLimit(name string, limit int, number int) (documents []map[string]string, err error)
- func (d *Document) GetDocumentsByName(name string) (documents []map[string]string, err error)
- func (d *Document) GetDocumentsByParentId(parentId string) (documents []map[string]string, err error)
- func (d *Document) GetDocumentsBySpaceId(spaceId string) (documents []map[string]string, err error)
- func (d *Document) GetDocumentsBySpaceIdAndParentId(spaceId string, parentId string) (documents []map[string]string, err error)
- func (d *Document) GetParentDocumentsByDocument(document map[string]string) (parentDocuments []map[string]string, pageFile string, err error)
- func (d *Document) GetParentDocumentsByPath(path string) (parentDocuments []map[string]string, err error)
- func (d *Document) GetSpaceDefaultDocument(spaceId string) (document map[string]string, err error)
- func (d *Document) GetSpaceIdsOrderByCountDocumentLimit(limit int) (documents []map[string]string, err error)
- func (d *Document) Insert(documentValue map[string]interface{}) (id int64, err error)
- func (d *Document) MoveDBAndFile(documentId string, updateValue map[string]interface{}, oldPageFile string, ...) (id int64, err error)
- func (d *Document) Update(documentId string, documentValue map[string]interface{}, comment string) (id int64, err error)
- func (d *Document) UpdateDBAndFile(documentId string, document map[string]string, documentContent string, ...) (id int64, err error)
- type Email
- func (u *Email) CountEmails() (count int64, err error)
- func (u *Email) CountEmailsByKeyword(keyword string) (count int64, err error)
- func (u *Email) Delete(emailId string) (err error)
- func (u *Email) GetEmailByEmailId(emailId string) (email map[string]string, err error)
- func (u *Email) GetEmailByEmailIds(emailIds []string) (emails []map[string]string, err error)
- func (u *Email) GetEmailByName(name string) (email map[string]string, err error)
- func (u *Email) GetEmails() (emails []map[string]string, err error)
- func (u *Email) GetEmailsByKeywordAndLimit(keyword string, limit int, number int) (emails []map[string]string, err error)
- func (u *Email) GetEmailsByLikeName(name string) (emails []map[string]string, err error)
- func (u *Email) GetEmailsByLimit(limit int, number int) (emails []map[string]string, err error)
- func (u *Email) GetUsedEmail() (email map[string]string, err error)
- func (u *Email) HasEmailName(name string) (has bool, err error)
- func (u *Email) HasSameName(emailId, name string) (has bool, err error)
- func (u *Email) Insert(emailValue map[string]interface{}) (id int64, err error)
- func (u *Email) SetEmailUsed(emailId string) (id int64, err error)
- func (u *Email) Update(emailId string, emailValue map[string]interface{}) (id int64, err error)
- type Follow
- func (f *Follow) CountFollows() (count int64, err error)
- func (f *Follow) CountFollowsByUserIdAndType(userId string, followType int) (count int64, err error)
- func (f *Follow) CreateAutoFollowDocument(userId string, documentId string) (id int64, err error)
- func (f *Follow) Delete(followId string) (err error)
- func (f *Follow) DeleteByObjectIdType(objectId string, followType string) (err error)
- func (f *Follow) FollowDocument(userId string, documentId string) (id int64, err error)
- func (f *Follow) GetFansUserGroupUserId() (collects []map[string]string, err error)
- func (f *Follow) GetFollowByFollowId(followId string) (follow map[string]string, err error)
- func (f *Follow) GetFollowByUserIdAndTypeAndObjectId(userId string, followType int, objectId string) (follow map[string]string, err error)
- func (f *Follow) GetFollowGroupUserId(fType int) (collects []map[string]string, err error)
- func (f *Follow) GetFollows() (follows []map[string]string, err error)
- func (f *Follow) GetFollowsByFollowIds(followIds []string) (follows []map[string]string, err error)
- func (f *Follow) GetFollowsByObjectIdAndType(objectId string, followType int) (follows []map[string]string, err error)
- func (f *Follow) GetFollowsByUserIdAndType(userId string, followType int) (follows []map[string]string, err error)
- func (f *Follow) GetFollowsByUserIdTypeAndLimit(userId string, followType int, limit int, number int) (follows []map[string]string, err error)
- func (f *Follow) Insert(userId string, fType int, objectId string) (id int64, err error)
- type Link
- func (l *Link) CountLinks() (count int64, err error)
- func (l *Link) CountLinksByKeyword(keyword string) (count int64, err error)
- func (l *Link) Delete(linkId string) (err error)
- func (l *Link) GetLinkByLinkId(linkId string) (link map[string]string, err error)
- func (l *Link) GetLinkByLinkIds(linkIds []string) (links []map[string]string, err error)
- func (l *Link) GetLinkByName(name string) (link map[string]string, err error)
- func (l *Link) GetLinks() (links []map[string]string, err error)
- func (l *Link) GetLinksByKeywordAndLimit(keyword string, limit int, number int) (links []map[string]string, err error)
- func (l *Link) GetLinksByLikeName(name string) (links []map[string]string, err error)
- func (l *Link) GetLinksByLimit(limit int, number int) (links []map[string]string, err error)
- func (l *Link) GetLinksOrderBySequence() (links []map[string]string, err error)
- func (l *Link) HasLinkName(name string) (has bool, err error)
- func (l *Link) HasSameName(linkId, name string) (has bool, err error)
- func (l *Link) Insert(linkValue map[string]interface{}) (id int64, err error)
- func (l *Link) Update(linkId string, linkValue map[string]interface{}) (id int64, err error)
- type Log
- func (l *Log) CountLogs() (count int64, err error)
- func (l *Log) CountLogsByKeyword(level, message, username string) (count int64, err error)
- func (l *Log) CountLogsByLevel(level int) (count int64, err error)
- func (l *Log) GetLogByLogId(logId string) (log map[string]string, err error)
- func (l *Log) GetLogsByKeywordAndLimit(level, message, username string, limit int, number int) (logs []map[string]string, err error)
- func (l *Log) GetLogsByLimit(limit int, number int) (logs []map[string]string, err error)
- func (l *Log) Insert(log map[string]interface{}) (id int64, err error)
- func (l *Log) RecordLog(message string, level int, userId string, username string, ctx context.Context) (id int64, err error)
- type LogDocument
- func (ld *LogDocument) CountLogDocuments() (count int64, err error)
- func (ld *LogDocument) CountLogDocumentsByDocumentId(documentId string) (count int64, err error)
- func (ld *LogDocument) CountLogDocumentsByKeyword(keyword string) (count int64, err error)
- func (ld *LogDocument) CountLogDocumentsByUserId(userId string) (count int64, err error)
- func (ld *LogDocument) CountLogDocumentsByUserIdAndKeyword(userId string, keyword string) (count int64, err error)
- func (ld *LogDocument) CreateAction(userId string, documentId string) (id int64, err error)
- func (ld *LogDocument) DeleteAction(userId string, documentId string) (id int64, err error)
- func (ld *LogDocument) GetLogDocumentByLogDocumentId(logDocId string) (logDocuments map[string]string, err error)
- func (ld *LogDocument) GetLogDocumentsByDocumentId(documentId string) (logDocuments []map[string]string, err error)
- func (ld *LogDocument) GetLogDocumentsByDocumentIdAndLimit(documentId string, limit int, number int) (logDocuments []map[string]string, err error)
- func (ld *LogDocument) GetLogDocumentsByKeywordAndLimit(keyword string, limit int, number int) (logDocuments []map[string]string, err error)
- func (ld *LogDocument) GetLogDocumentsByLimit(limit int, number int) (logDocuments []map[string]string, err error)
- func (ld *LogDocument) GetLogDocumentsByUserId(userId string) (logDocuments []map[string]string, err error)
- func (ld *LogDocument) GetLogDocumentsByUserIdAndLimit(userId string, limit int, number int) (logDocuments []map[string]string, err error)
- func (ld *LogDocument) GetLogDocumentsByUserIdKeywordAndLimit(userId string, keyword string, limit int, number int) (logDocuments []map[string]string, err error)
- func (ld *LogDocument) Insert(logDocument map[string]interface{}) (id int64, err error)
- func (ld *LogDocument) UpdateAction(userId string, documentId string, comment string) (id int64, err error)
- type Privilege
- func (p *Privilege) Delete(privilegeId string) (err error)
- func (p *Privilege) GetPrivilegeByPrivilegeId(privilegeId string) (privilege map[string]string, err error)
- func (p *Privilege) GetPrivilegeByTypeControllerAndAction(ty, controller, action string) (privilege map[string]string, err error)
- func (p *Privilege) GetPrivileges() (privileges []map[string]string, err error)
- func (p *Privilege) GetTypePrivileges() (menus, controllers []map[string]string, err error)
- func (p *Privilege) GetTypePrivilegesByDisplay(display string) (menus, controllers []map[string]string, err error)
- func (p *Privilege) GetTypePrivilegesByDisplayPrivilegeIds(display string, privilegeIds []string) (menus, controllers []map[string]string, err error)
- func (p *Privilege) GetTypePrivilegesByPrivilegeIds(privilegeIds []string) (menus, controllers []map[string]string, err error)
- func (p *Privilege) GetTypePrivilegesByUserId(userId string) (menus, controllers []map[string]string, err error)
- func (p *Privilege) HasSub(privilegeId string) (has bool, err error)
- func (p *Privilege) Insert(privilege map[string]interface{}) (id int64, err error)
- func (p *Privilege) InsertNotExists(privilege map[string]interface{}) (id int64, err error)
- func (p *Privilege) Update(privilegeId string, privilege map[string]interface{}) (id int64, err error)
- type Role
- func (r *Role) CountRoles() (count int64, err error)
- func (r *Role) CountRolesByKeyword(keyword string) (count int64, err error)
- func (r *Role) Delete(roleId string) (err error)
- func (r *Role) GetRoleByLikeName(name string) (roles []map[string]string, err error)
- func (r *Role) GetRoleByName(name string) (role map[string]string, err error)
- func (r *Role) GetRoleByRoleId(roleId string) (role map[string]string, err error)
- func (r *Role) GetRoleByRoleIds(roleIds []string) (roles []map[string]string, err error)
- func (r *Role) GetRoles() (roles []map[string]string, err error)
- func (r *Role) GetRolesByKeywordAndLimit(keyword string, limit int, number int) (roles []map[string]string, err error)
- func (r *Role) GetRolesByLimit(limit int, number int) (roles []map[string]string, err error)
- func (r *Role) GetRolesNotContainRoot() (roles []map[string]string, err error)
- func (r *Role) HasRoleName(name string) (has bool, err error)
- func (r *Role) HasSameName(roleId, name string) (has bool, err error)
- func (r *Role) Insert(roleValue map[string]interface{}) (id int64, err error)
- func (r *Role) Update(roleId string, roleValue map[string]interface{}) (id int64, err error)
- func (r *Role) UpdateRoleByName(role map[string]interface{}) (affect int64, err error)
- type RolePrivilege
- func (rolePrivilege *RolePrivilege) DeleteByPrivilegeId(privilegeId string) (err error)
- func (rolePrivilege *RolePrivilege) DeleteByRoleId(roleId string) (err error)
- func (rolePrivilege *RolePrivilege) GetRolePrivilegesByRoleId(roleId string) (rolePrivileges []map[string]string, err error)
- func (rolePrivilege *RolePrivilege) GetRootRolePrivileges() (rolePrivileges []map[string]string, err error)
- func (rolePrivilege *RolePrivilege) GrantRolePrivileges(roleId string, privilegeIds []string) (res bool, err error)
- type Space
- func (s *Space) CountSpaces() (count int64, err error)
- func (s *Space) CountSpacesByKeyword(keyword string) (count int64, err error)
- func (s *Space) CountSpacesByTags(tag string) (count int64, err error)
- func (s *Space) Delete(spaceId string) (err error)
- func (s *Space) GetSpaceByLikeName(name string) (spaces []map[string]string, err error)
- func (s *Space) GetSpaceByName(name string) (space map[string]string, err error)
- func (s *Space) GetSpaceBySpaceId(spaceId string) (space map[string]string, err error)
- func (s *Space) GetSpaceBySpaceIds(spaceIds []string) (spaces []map[string]string, err error)
- func (s *Space) GetSpaces() (spaces []map[string]string, err error)
- func (s *Space) GetSpacesByKeywordAndLimit(keyword string, limit int, number int) (spaces []map[string]string, err error)
- func (s *Space) GetSpacesByLimit(limit int, number int) (spaces []map[string]string, err error)
- func (s *Space) GetSpacesByTags(tag string) (spaces []map[string]string, err error)
- func (s *Space) HasSameName(spaceId, name string) (has bool, err error)
- func (s *Space) HasSpaceName(name string) (has bool, err error)
- func (s *Space) Insert(spaceValue map[string]interface{}) (id int64, err error)
- func (s *Space) Update(spaceId string, spaceValue map[string]interface{}) (id int64, err error)
- func (s *Space) UpdateDBAndSpaceFileName(spaceId string, spaceValue map[string]interface{}, oldName string) (id int64, err error)
- func (s *Space) UpdateSpaceByName(space map[string]interface{}) (affect int64, err error)
- type SpaceUser
- func (s *SpaceUser) CountSpaceUsersBySpaceId(spaceId string) (count int64, err error)
- func (s *SpaceUser) Delete(spaceUserId string) (err error)
- func (s *SpaceUser) DeleteBySpaceId(spaceId string) (err error)
- func (s *SpaceUser) DeleteBySpaceIdAndUserId(spaceId string, userId string) (err error)
- func (s *SpaceUser) DeleteByUserId(userId string) (err error)
- func (s *SpaceUser) GetSpaceUserBySpaceIdAndUserId(spaceId string, userId string) (spaceUser map[string]string, err error)
- func (s *SpaceUser) GetSpaceUserBySpaceUserId(spaceUserId string) (spaceUser map[string]string, err error)
- func (s *SpaceUser) GetSpaceUsers() (spaceUsers []map[string]string, err error)
- func (s *SpaceUser) GetSpaceUsersBySpaceId(spaceId string) (spaceUsers []map[string]string, err error)
- func (s *SpaceUser) GetSpaceUsersBySpaceIdAndLimit(spaceId string, limit int, number int) (spaceUsers []map[string]string, err error)
- func (s *SpaceUser) GetSpaceUsersBySpaceUserIds(spaceUserIds []string) (spaceUsers []map[string]string, err error)
- func (s *SpaceUser) GetSpaceUsersByUserId(userId string) (spaceUsers []map[string]string, err error)
- func (s *SpaceUser) HasSpaceUser(spaceId string, userId string) (has bool, err error)
- func (s *SpaceUser) Insert(spaceUserValue map[string]interface{}) (id int64, err error)
- func (s *SpaceUser) Update(spaceUserId string, spaceUserValue map[string]interface{}) (id int64, err error)
- type Upgrade
- type User
- func (u *User) ChangePassword(userId, newPassword, oldPassword string) (err error)
- func (u *User) CountForbiddenUsers() (count int64, err error)
- func (u *User) CountNormalUsers() (count int64, err error)
- func (u *User) CountUsers() (count int64, err error)
- func (u *User) CountUsersByKeywords(keywords map[string]string) (count int64, err error)
- func (u *User) CountUsersByLastTime(lastTime int64) (count int64, err error)
- func (u *User) Delete(userId string) (err error)
- func (u *User) EncodePassword(password string) (passwordHash string)
- func (u *User) GetUserByLikeName(username string) (users []map[string]string, err error)
- func (u *User) GetUserByNotUserIds(userIds []string) (users []map[string]string, err error)
- func (u *User) GetUserByUserId(userId string) (user map[string]string, err error)
- func (u *User) GetUserByUsername(username string) (user map[string]string, err error)
- func (u *User) GetUsers() (users []map[string]string, err error)
- func (u *User) GetUsersByKeywordsAndLimit(keywords map[string]string, limit int, number int) (users []map[string]string, err error)
- func (u *User) GetUsersByLimit(limit int, number int) (users []map[string]string, err error)
- func (u *User) GetUsersByRoleId(roleId string) (users []map[string]string, err error)
- func (u *User) GetUsersByUserIds(userIds []string) (users []map[string]string, err error)
- func (u *User) HasSameUsername(userId, username string) (has bool, err error)
- func (u *User) HasUsername(username string) (has bool, err error)
- func (u *User) Insert(userValue map[string]interface{}) (id int64, err error)
- func (u *User) Update(userId string, userValue map[string]interface{}) (id int64, err error)
- func (u *User) UpdateUserByUsername(user map[string]interface{}) (affect int64, err error)
Constants ¶
const ( Attachment_Source_Default = 0 Attachment_Source_Image = 1 )
const ( Auth_Used_True = 1 Auth_Used_False = 0 )
const ( Collection_Type_Doc = 1 Collection_Type_Space = 2 )
const ( Config_Key_MainTitle = "main_title" Config_Key_MainDescription = "main_description" Config_Key_AutoFollowDoc = "auto_follow_doc_open" Config_Key_SendEmail = "send_email_open" Config_Key_AuthLogin = "sso_open" Config_Key_SystemVersion = "system_version" )
const ( Document_Delete_True = 1 Document_Delete_False = 0 Document_Type_Page = 1 Document_Type_Dir = 2 )
const ( Email_Used_True = 1 Email_Used_False = 0 )
const ( Follow_Type_Doc = 1 Follow_Type_User = 2 )
const ( Log_Level_Emegergency = iota Log_Level_Alaert Log_Level_Critical Log_Level_Error Log_Level_Warning Log_Level_Notice Log_Level_Info Log_Level_Debug )
const ( LogDocument_Action_Create = 1 LogDocument_Action_Update = 2 LogDocument_Action_Delete = 3 )
const ( Privilege_Type_Menu = "menu" Privilege_Type_Controller = "controller" Privilege_DisPlay_True = "1" Privilege_DisPlay_False = "0" )
const ( Role_Delete_True = 1 Role_Delete_False = 0 Role_Type_System = 1 Role_Type_Default = 0 Role_Root_Id = 1 Role_Admin_Id = 2 Role_Default_Id = 3 )
const ( Space_Download_False = 0 Space_Download_True = 1 Space_Delete_True = 1 Space_Delete_False = 0 Space_Root_Id = 1 Space_Admin_Id = 2 Space_Default_Id = 3 Space_VisitLevel_Public = "public" Space_VisitLevel_Private = "private" )
const ( SpaceUser_Privilege_Visitor = 0 SpaceUser_Privilege_Editor = 1 SpaceUser_Privilege_Manager = 2 )
const ( User_Delete_True = 1 User_Delete_False = 0 User_Forbidden_True = 1 User_Is_Forbidden_False = 0 )
const Table_Attachment_Name = "attachment"
const Table_Auth_Name = "login_auth"
const Table_Collection_Name = "collection"
const Table_Config_Name = "config"
const Table_Contact_Name = "contact"
const Table_Document_Name = "document"
const Table_Email_Name = "email"
const Table_Follow_Name = "follow"
const Table_Link_Name = "link"
const Table_LogDocument_Name = "log_document"
const Table_Log_Name = "log"
const Table_Privilege_Name = "privilege"
const Table_RolePrivilege_Name = "role_privilege"
const Table_Role_Name = "role"
const Table_SpaceUser_Name = "space_user"
const Table_Space_Name = "space"
const Table_User_Name = "user"
Variables ¶
var AttachmentModel = Attachment{}
var AuthModel = Auth{}
var CollectionModel = Collection{}
var ConfigModel = Config{}
var ContactModel = Contact{}
var DocumentModel = Document{}
var EmailModel = Email{}
var FollowModel = Follow{}
var G *mysql.DBGroup
var LinkModel = Link{}
var LogDocumentModel = LogDocument{}
var LogModel = Log{}
var PrivilegeModel = Privilege{}
var Privilege_Default_Ids = []string{"1", "2", "3", "4", "5", "6", "7", "8", "9"}
var RoleModel = Role{}
var RolePrivilegeModel = RolePrivilege{}
var SpaceModel = Space{}
var SpaceUserModel = SpaceUser{}
var (
UpgradeModel = Upgrade{}
)
var UserModel = User{}
var Version string
Functions ¶
This section is empty.
Types ¶
type Attachment ¶ added in v0.1.3
type Attachment struct { }
func (*Attachment) Delete ¶ added in v0.1.3
func (a *Attachment) Delete(attachmentId string) (err error)
delete attachment by attachment_id
func (*Attachment) DeleteAttachmentDBFile ¶ added in v0.1.3
func (a *Attachment) DeleteAttachmentDBFile(attachmentId string) (err error)
func (*Attachment) DeleteAttachmentsDBFileByDocumentId ¶ added in v0.1.3
func (a *Attachment) DeleteAttachmentsDBFileByDocumentId(documentId string) (err error)
func (*Attachment) GetAttachmentByAttachmentId ¶ added in v0.1.3
func (a *Attachment) GetAttachmentByAttachmentId(attachmentId string) (attachment map[string]string, err error)
get attachment by attachment_id
func (*Attachment) GetAttachmentByAttachmentIds ¶ added in v0.1.3
func (a *Attachment) GetAttachmentByAttachmentIds(attachmentIds []string) (attachments []map[string]string, err error)
get attachment by many attachment_id
func (*Attachment) GetAttachmentByName ¶ added in v0.1.3
func (a *Attachment) GetAttachmentByName(name string) (attachment map[string]string, err error)
get attachment by name
func (*Attachment) GetAttachments ¶ added in v0.1.3
func (a *Attachment) GetAttachments() (attachments []map[string]string, err error)
get all attachments
func (*Attachment) GetAttachmentsByDocumentId ¶ added in v0.1.3
func (a *Attachment) GetAttachmentsByDocumentId(documentId string) (attachments []map[string]string, err error)
get attachments by document_id
func (*Attachment) GetAttachmentsByDocumentIdAndSource ¶ added in v0.1.3
func (a *Attachment) GetAttachmentsByDocumentIdAndSource(documentId string, source int) (attachments []map[string]string, err error)
get attachments by document and source
func (*Attachment) GetAttachmentsByDocumentIds ¶ added in v0.1.3
func (a *Attachment) GetAttachmentsByDocumentIds(documentIds []string) (attachments []map[string]string, err error)
get attachments by document_id
func (*Attachment) GetAttachmentsByLikeName ¶ added in v0.1.3
func (a *Attachment) GetAttachmentsByLikeName(name string) (attachments []map[string]string, err error)
get attachments by like name
func (*Attachment) GetAttachmentsBySpaceId ¶ added in v0.1.3
func (a *Attachment) GetAttachmentsBySpaceId(spaceId string) (attachments []map[string]string, err error)
get attachments by space_id
func (*Attachment) HasAttachmentName ¶ added in v0.1.3
func (a *Attachment) HasAttachmentName(name string) (has bool, err error)
name is exists
func (*Attachment) HasSameName ¶ added in v0.1.3
func (a *Attachment) HasSameName(attachmentId, name string) (has bool, err error)
attachment_id and name is exists
type Auth ¶
type Auth struct { }
func (*Auth) CountAuthsByKeyword ¶
get auth count by keyword
func (*Auth) GetAuthByAuthId ¶
get auth by auth_id
func (*Auth) GetAuthByAuthIds ¶
get auth by many auth_id
func (*Auth) GetAuthByName ¶
get auth by name
func (*Auth) GetAuthsByKeywordAndLimit ¶
func (a *Auth) GetAuthsByKeywordAndLimit(keyword string, limit int, number int) (auths []map[string]string, err error)
get limit auths by search keyword
func (*Auth) GetAuthsByLikeName ¶
get auths by like name
func (*Auth) GetAuthsByLimit ¶
get limit auths
func (*Auth) GetUsedAuth ¶
get used auth
func (*Auth) HasAuthName ¶
name is exists
func (*Auth) HasAuthUsernamePrefix ¶
name is exists
func (*Auth) HasSameName ¶
auth_id and name is exists
func (*Auth) HasSameUsernamePrefix ¶
auth_id and name is exists
func (*Auth) SetAuthUsed ¶
set auth used
type Collection ¶
type Collection struct { }
func (*Collection) CountCollections ¶
func (c *Collection) CountCollections() (count int64, err error)
get collection count
func (*Collection) Delete ¶
func (c *Collection) Delete(collectionId string) (err error)
delete collection by collection_id
func (*Collection) DeleteByResourceIdType ¶
func (c *Collection) DeleteByResourceIdType(resourceId string, collectType string) (err error)
delete collection by type and object_id
func (*Collection) GetCollectionByCollectionId ¶
func (c *Collection) GetCollectionByCollectionId(collectionId string) (collection map[string]string, err error)
get collection by collection_id
func (*Collection) GetCollectionByUserIdTypeAndResourceId ¶
func (c *Collection) GetCollectionByUserIdTypeAndResourceId(userId string, typeS int, resId string) (collection map[string]string, err error)
get collections by user_id type and resource_id
func (*Collection) GetCollectionGroupUserId ¶
func (c *Collection) GetCollectionGroupUserId(colType int) (collects []map[string]string, err error)
func (*Collection) GetCollections ¶
func (c *Collection) GetCollections() (collections []map[string]string, err error)
get all collections
func (*Collection) GetCollectionsByCollectionIds ¶
func (c *Collection) GetCollectionsByCollectionIds(collectionIds []string) (collections []map[string]string, err error)
get collections by many collection_id
func (*Collection) GetCollectionsByUserId ¶
func (c *Collection) GetCollectionsByUserId(userId string) (collections []map[string]string, err error)
get collections by user_id
func (*Collection) GetCollectionsByUserIdAndType ¶
func (c *Collection) GetCollectionsByUserIdAndType(userId string, typeS int) (collections []map[string]string, err error)
get collections by user_id
func (*Collection) GetResourceIdsOrderByCountLimit ¶
type Config ¶
type Config struct { }
func (*Config) GetConfigByConfigId ¶
get config by config_id
func (*Config) GetConfigByConfigIds ¶
get config by many config_id
func (*Config) GetConfigByKey ¶
get config by config key
func (*Config) GetConfigs ¶
get all configs
func (*Config) InsertBatch ¶
insert batch configs
type Contact ¶
type Contact struct { }
func (*Contact) CountContactByName ¶
获取筛选名字查询结果条数
func (*Contact) DeleteByContactId ¶
通过 contact_id 删除联系人信息
func (*Contact) GetAllContact ¶
获取所有联系人信息
func (*Contact) GetContactByContactId ¶
通过 contact_id 获取联系人数据
func (*Contact) GetContactByLimit ¶
分页获取联系人
func (*Contact) GetContactByLimitAndName ¶
func (c *Contact) GetContactByLimitAndName(name string, limit, number int) (contacts []map[string]string, err error)
分页筛选名字查询结果
type Document ¶
type Document struct { }
func (*Document) CountDocuments ¶
get document count
func (*Document) CountDocumentsBySpaceId ¶
get document count
func (*Document) CountDocumentsLikeName ¶
count document like name
func (*Document) DeleteDBAndFile ¶
func (d *Document) DeleteDBAndFile(documentId string, userId string, pageFile string, docType string) (err error)
delete document by document_id
func (*Document) GetAllDocumentsByDocumentIds ¶
func (*Document) GetAllSpaceDocuments ¶
get document by spaceId
func (*Document) GetCountGroupByCreateTime ¶
func (*Document) GetDocumentByDocumentId ¶
func (d *Document) GetDocumentByDocumentId(documentId string) (document map[string]string, err error)
get document by document_id
func (*Document) GetDocumentByNameAndSpaceId ¶
func (d *Document) GetDocumentByNameAndSpaceId(name string, spaceId string) (document map[string]string, err error)
get document by name and spaceId
func (*Document) GetDocumentByNameParentIdAndSpaceId ¶
func (d *Document) GetDocumentByNameParentIdAndSpaceId(name string, parentId string, spaceId string, docType int) (document map[string]string, err error)
get document by name and spaceId
func (*Document) GetDocumentByParentIdAndSpaceId ¶ added in v0.1.3
func (d *Document) GetDocumentByParentIdAndSpaceId(parentId string, spaceId string, docType int) (document map[string]string, err error)
get document by name and spaceId
func (*Document) GetDocumentGroupCreateUserId ¶
func (*Document) GetDocumentGroupEditUserId ¶
func (*Document) GetDocumentsByDocumentIds ¶
func (d *Document) GetDocumentsByDocumentIds(documentIds []string) (documents []map[string]string, err error)
get document by spaceId and document_ids
func (*Document) GetDocumentsByLikeName ¶
get document by name
func (*Document) GetDocumentsByLikeNameAndLimit ¶
func (d *Document) GetDocumentsByLikeNameAndLimit(name string, limit int, number int) (documents []map[string]string, err error)
get document link name and limit
func (*Document) GetDocumentsByName ¶
get document by name
func (*Document) GetDocumentsByParentId ¶
func (d *Document) GetDocumentsByParentId(parentId string) (documents []map[string]string, err error)
get documents by parent_id
func (*Document) GetDocumentsBySpaceId ¶
get all documents
func (*Document) GetDocumentsBySpaceIdAndParentId ¶
func (d *Document) GetDocumentsBySpaceIdAndParentId(spaceId string, parentId string) (documents []map[string]string, err error)
get document by spaceId and parentId
func (*Document) GetParentDocumentsByDocument ¶
func (*Document) GetParentDocumentsByPath ¶
func (*Document) GetSpaceDefaultDocument ¶
get document by spaceId
func (*Document) GetSpaceIdsOrderByCountDocumentLimit ¶
func (*Document) MoveDBAndFile ¶
func (d *Document) MoveDBAndFile(documentId string, updateValue map[string]interface{}, oldPageFile string, newPageFile string, docType string, comment string) (id int64, err error)
move document
type Email ¶
type Email struct { }
func (*Email) CountEmailsByKeyword ¶
get email count by keyword
func (*Email) GetEmailByEmailId ¶
get email by email_id
func (*Email) GetEmailByEmailIds ¶
get email by many email_id
func (*Email) GetEmailByName ¶
get email by name
func (*Email) GetEmailsByKeywordAndLimit ¶
func (u *Email) GetEmailsByKeywordAndLimit(keyword string, limit int, number int) (emails []map[string]string, err error)
get limit emails by search keyword
func (*Email) GetEmailsByLikeName ¶
get emails by like name
func (*Email) GetEmailsByLimit ¶
get limit emails
func (*Email) GetUsedEmail ¶
get used email
func (*Email) HasEmailName ¶
name is exists
func (*Email) HasSameName ¶
email_id and name is exists
func (*Email) SetEmailUsed ¶
set email used
type Follow ¶
type Follow struct { }
func (*Follow) CountFollows ¶
get follow count
func (*Follow) CountFollowsByUserIdAndType ¶
func (f *Follow) CountFollowsByUserIdAndType(userId string, followType int) (count int64, err error)
get follow count
func (*Follow) CreateAutoFollowDocument ¶
create auto follow document
func (*Follow) DeleteByObjectIdType ¶
delete follow by type and object_id
func (*Follow) FollowDocument ¶
func (*Follow) GetFansUserGroupUserId ¶
func (*Follow) GetFollowByFollowId ¶
get follow by follow_id
func (*Follow) GetFollowByUserIdAndTypeAndObjectId ¶
func (f *Follow) GetFollowByUserIdAndTypeAndObjectId(userId string, followType int, objectId string) (follow map[string]string, err error)
get followed follow
func (*Follow) GetFollowGroupUserId ¶
func (*Follow) GetFollows ¶
get all follows
func (*Follow) GetFollowsByFollowIds ¶
get follows by many follow_id
func (*Follow) GetFollowsByObjectIdAndType ¶
func (f *Follow) GetFollowsByObjectIdAndType(objectId string, followType int) (follows []map[string]string, err error)
get followed follows
func (*Follow) GetFollowsByUserIdAndType ¶
func (f *Follow) GetFollowsByUserIdAndType(userId string, followType int) (follows []map[string]string, err error)
get follows by user_id and type
type Link ¶
type Link struct { }
func (*Link) CountLinksByKeyword ¶
get link count by keyword
func (*Link) GetLinkByLinkId ¶
get link by link_id
func (*Link) GetLinkByLinkIds ¶
get link by many link_id
func (*Link) GetLinkByName ¶
get link by name
func (*Link) GetLinksByKeywordAndLimit ¶
func (l *Link) GetLinksByKeywordAndLimit(keyword string, limit int, number int) (links []map[string]string, err error)
get limit links by search keyword
func (*Link) GetLinksByLikeName ¶
get links by like name
func (*Link) GetLinksByLimit ¶
get limit links
func (*Link) GetLinksOrderBySequence ¶
get all links by sequence
func (*Link) HasLinkName ¶
name is exists
func (*Link) HasSameName ¶
link_id and name is exists
type Log ¶
type Log struct { }
func (*Log) CountLogsByKeyword ¶
根据关键字获取日志总数
func (*Log) GetLogByLogId ¶
根据 log_id 获取日志
func (*Log) GetLogsByKeywordAndLimit ¶
func (l *Log) GetLogsByKeywordAndLimit(level, message, username string, limit int, number int) (logs []map[string]string, err error)
根据关键字分页获取日志
func (*Log) GetLogsByLimit ¶
分页获取日志
type LogDocument ¶
type LogDocument struct { }
func (*LogDocument) CountLogDocuments ¶
func (ld *LogDocument) CountLogDocuments() (count int64, err error)
func (*LogDocument) CountLogDocumentsByDocumentId ¶
func (ld *LogDocument) CountLogDocumentsByDocumentId(documentId string) (count int64, err error)
func (*LogDocument) CountLogDocumentsByKeyword ¶
func (ld *LogDocument) CountLogDocumentsByKeyword(keyword string) (count int64, err error)
func (*LogDocument) CountLogDocumentsByUserId ¶
func (ld *LogDocument) CountLogDocumentsByUserId(userId string) (count int64, err error)
func (*LogDocument) CountLogDocumentsByUserIdAndKeyword ¶
func (ld *LogDocument) CountLogDocumentsByUserIdAndKeyword(userId string, keyword string) (count int64, err error)
func (*LogDocument) CreateAction ¶
func (ld *LogDocument) CreateAction(userId string, documentId string) (id int64, err error)
func (*LogDocument) DeleteAction ¶
func (ld *LogDocument) DeleteAction(userId string, documentId string) (id int64, err error)
func (*LogDocument) GetLogDocumentByLogDocumentId ¶
func (ld *LogDocument) GetLogDocumentByLogDocumentId(logDocId string) (logDocuments map[string]string, err error)
func (*LogDocument) GetLogDocumentsByDocumentId ¶
func (ld *LogDocument) GetLogDocumentsByDocumentId(documentId string) (logDocuments []map[string]string, err error)
func (*LogDocument) GetLogDocumentsByDocumentIdAndLimit ¶
func (*LogDocument) GetLogDocumentsByKeywordAndLimit ¶
func (*LogDocument) GetLogDocumentsByLimit ¶
func (*LogDocument) GetLogDocumentsByUserId ¶
func (ld *LogDocument) GetLogDocumentsByUserId(userId string) (logDocuments []map[string]string, err error)
func (*LogDocument) GetLogDocumentsByUserIdAndLimit ¶
func (*LogDocument) GetLogDocumentsByUserIdKeywordAndLimit ¶
func (*LogDocument) Insert ¶
func (ld *LogDocument) Insert(logDocument map[string]interface{}) (id int64, err error)
func (*LogDocument) UpdateAction ¶
type Privilege ¶
type Privilege struct { }
func (*Privilege) GetPrivilegeByPrivilegeId ¶
func (*Privilege) GetPrivilegeByTypeControllerAndAction ¶ added in v0.1.2
func (*Privilege) GetPrivileges ¶
func (*Privilege) GetTypePrivileges ¶
func (*Privilege) GetTypePrivilegesByDisplay ¶
func (*Privilege) GetTypePrivilegesByDisplayPrivilegeIds ¶
func (*Privilege) GetTypePrivilegesByPrivilegeIds ¶
func (*Privilege) GetTypePrivilegesByUserId ¶
func (*Privilege) InsertNotExists ¶ added in v0.1.2
type Role ¶
type Role struct { }
func (*Role) CountRolesByKeyword ¶
get role count by keyword
func (*Role) GetRoleByLikeName ¶
get role by name
func (*Role) GetRoleByName ¶
get role by name
func (*Role) GetRoleByRoleId ¶
get role by role_id
func (*Role) GetRoleByRoleIds ¶
get role by many role_id
func (*Role) GetRolesByKeywordAndLimit ¶
func (r *Role) GetRolesByKeywordAndLimit(keyword string, limit int, number int) (roles []map[string]string, err error)
get limit roles by search keyword
func (*Role) GetRolesByLimit ¶
get limit roles
func (*Role) GetRolesNotContainRoot ¶ added in v0.1.3
get all roles not contain root
func (*Role) HasRoleName ¶
name is exists
func (*Role) HasSameName ¶
role_id and name is exists
type RolePrivilege ¶
type RolePrivilege struct { }
func (*RolePrivilege) DeleteByPrivilegeId ¶
func (rolePrivilege *RolePrivilege) DeleteByPrivilegeId(privilegeId string) (err error)
delete role privilege by privilege_id
func (*RolePrivilege) DeleteByRoleId ¶
func (rolePrivilege *RolePrivilege) DeleteByRoleId(roleId string) (err error)
delete role privilege by role_id
func (*RolePrivilege) GetRolePrivilegesByRoleId ¶
func (rolePrivilege *RolePrivilege) GetRolePrivilegesByRoleId(roleId string) (rolePrivileges []map[string]string, err error)
func (*RolePrivilege) GetRootRolePrivileges ¶
func (rolePrivilege *RolePrivilege) GetRootRolePrivileges() (rolePrivileges []map[string]string, err error)
func (*RolePrivilege) GrantRolePrivileges ¶
func (rolePrivilege *RolePrivilege) GrantRolePrivileges(roleId string, privilegeIds []string) (res bool, err error)
type Space ¶
type Space struct { }
func (*Space) CountSpacesByKeyword ¶
get space count by keyword
func (*Space) CountSpacesByTags ¶
get space count
func (*Space) GetSpaceByLikeName ¶
get space by name
func (*Space) GetSpaceByName ¶
get space by name
func (*Space) GetSpaceBySpaceId ¶
get space by space_id
func (*Space) GetSpaceBySpaceIds ¶
get space by many space_id
func (*Space) GetSpacesByKeywordAndLimit ¶
func (s *Space) GetSpacesByKeywordAndLimit(keyword string, limit int, number int) (spaces []map[string]string, err error)
get limit spaces by search keyword
func (*Space) GetSpacesByLimit ¶
get limit spaces
func (*Space) GetSpacesByTags ¶
get space count by tags
func (*Space) HasSameName ¶
space_id and name is exists
func (*Space) HasSpaceName ¶
name is exists
type SpaceUser ¶
type SpaceUser struct { }
func (*SpaceUser) CountSpaceUsersBySpaceId ¶
get space_user count by keyword
func (*SpaceUser) DeleteBySpaceId ¶
delete space_user by space_user_id
func (*SpaceUser) DeleteBySpaceIdAndUserId ¶
delete space_user by space_id and user_id
func (*SpaceUser) DeleteByUserId ¶
delete space_user by space_user_id
func (*SpaceUser) GetSpaceUserBySpaceIdAndUserId ¶
func (s *SpaceUser) GetSpaceUserBySpaceIdAndUserId(spaceId string, userId string) (spaceUser map[string]string, err error)
get space_user count by keyword
func (*SpaceUser) GetSpaceUserBySpaceUserId ¶
func (s *SpaceUser) GetSpaceUserBySpaceUserId(spaceUserId string) (spaceUser map[string]string, err error)
get space_user by space_user_id
func (*SpaceUser) GetSpaceUsers ¶
get all space_users
func (*SpaceUser) GetSpaceUsersBySpaceId ¶
func (s *SpaceUser) GetSpaceUsersBySpaceId(spaceId string) (spaceUsers []map[string]string, err error)
get space_user by name
func (*SpaceUser) GetSpaceUsersBySpaceIdAndLimit ¶
func (s *SpaceUser) GetSpaceUsersBySpaceIdAndLimit(spaceId string, limit int, number int) (spaceUsers []map[string]string, err error)
get limit space_users by spaceId
func (*SpaceUser) GetSpaceUsersBySpaceUserIds ¶
func (s *SpaceUser) GetSpaceUsersBySpaceUserIds(spaceUserIds []string) (spaceUsers []map[string]string, err error)
get space_user by many space_user_id
func (*SpaceUser) GetSpaceUsersByUserId ¶
func (s *SpaceUser) GetSpaceUsersByUserId(userId string) (spaceUsers []map[string]string, err error)
get space_user by name
func (*SpaceUser) HasSpaceUser ¶
space user is exists
type User ¶
type User struct { }
func (*User) ChangePassword ¶
update user password
func (*User) CountForbiddenUsers ¶
get forbidden user count
func (*User) CountNormalUsers ¶
get normal user count
func (*User) CountUsersByKeywords ¶
get user count by keyword
func (*User) CountUsersByLastTime ¶
get user count by lastTime
func (*User) EncodePassword ¶
encode password
func (*User) GetUserByLikeName ¶
get user by username
func (*User) GetUserByNotUserIds ¶
get user by not in user_ids
func (*User) GetUserByUserId ¶
get user by user_id
func (*User) GetUserByUsername ¶
get user by username
func (*User) GetUsersByKeywordsAndLimit ¶
func (u *User) GetUsersByKeywordsAndLimit(keywords map[string]string, limit int, number int) (users []map[string]string, err error)
get limit users by search keyword
func (*User) GetUsersByLimit ¶
get limit users
func (*User) GetUsersByRoleId ¶
get user by many user_id
func (*User) GetUsersByUserIds ¶
get user by many user_id
func (*User) HasSameUsername ¶
user_id and username is exists
func (*User) HasUsername ¶
username is exists