models

package
v0.0.0-...-d95f0ed Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 15, 2020 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Attachment_Source_Default = 0
	Attachment_Source_Image   = 1
)
View Source
const (
	Auth_Used_True  = 1
	Auth_Used_False = 0
)
View Source
const (
	Collection_Type_Doc   = 1
	Collection_Type_Space = 2
)
View Source
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"
)
View Source
const (
	Document_Delete_True  = 1
	Document_Delete_False = 0

	Document_Type_Page = 1
	Document_Type_Dir  = 2
)
View Source
const (
	Email_Used_True  = 1
	Email_Used_False = 0
)
View Source
const (
	Follow_Type_Doc  = 1
	Follow_Type_User = 2
)
View Source
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
)
View Source
const (
	LogDocument_Action_Create = 1
	LogDocument_Action_Update = 2
	LogDocument_Action_Delete = 3
)
View Source
const (
	Privilege_Type_Menu       = "menu"
	Privilege_Type_Controller = "controller"

	Privilege_DisPlay_True  = "1"
	Privilege_DisPlay_False = "0"
)
View Source
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 // 普通用户
)
View Source
const (
	Space_Share_False = 0
	Space_Share_True  = 1

	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"
)
View Source
const (
	SpaceUser_Privilege_Visitor = 0
	SpaceUser_Privilege_Editor  = 1
	SpaceUser_Privilege_Manager = 2
)
View Source
const (
	User_Delete_True  = 1
	User_Delete_False = 0

	User_Forbidden_True     = 1
	User_Is_Forbidden_False = 0
)
View Source
const Table_Attachment_Name = "attachment"
View Source
const Table_Auth_Name = "login_auth"
View Source
const Table_Collection_Name = "collection"
View Source
const Table_Config_Name = "config"
View Source
const Table_Contact_Name = "contact"
View Source
const Table_Document_Name = "document"
View Source
const Table_Document_Tag = "document_tag"
View Source
const Table_Email_Name = "email"
View Source
const Table_Follow_Name = "follow"
View Source
const Table_Link_Name = "link"
View Source
const Table_LogDocument_Name = "log_document"
View Source
const Table_Log_Name = "log"
View Source
const Table_Privilege_Name = "privilege"
View Source
const Table_RolePrivilege_Name = "role_privilege"
View Source
const Table_Role_Name = "role"
View Source
const Table_SpaceUser_Name = "space_user"
View Source
const Table_Space_Name = "space"
View Source
const Table_Tag_Name = "document_tag"
View Source
const Table_User_Name = "user"

Variables

View Source
var AttachmentModel = Attachment{}
View Source
var AuthModel = Auth{}
View Source
var CollectionModel = Collection{}
View Source
var ConfigModel = Config{}
View Source
var ContactModel = Contact{}
View Source
var DocumentModel = Document{}
View Source
var EmailModel = Email{}
View Source
var FollowModel = Follow{}
View Source
var G *mysql.DBGroup
View Source
var LinkModel = Link{}
View Source
var LogDocumentModel = LogDocument{}
View Source
var LogModel = Log{}
View Source
var PrivilegeModel = Privilege{}
View Source
var Privilege_Default_Ids = []string{"1", "2", "3", "4", "5", "6", "7", "8", "9"}
View Source
var RoleModel = Role{}
View Source
var RolePrivilegeModel = RolePrivilege{}
View Source
var SpaceModel = Space{}
View Source
var SpaceUserModel = SpaceUser{}
View Source
var TagModel = Tag{}
View Source
var (
	UpgradeModel = Upgrade{}
)
View Source
var UserModel = User{}

Functions

This section is empty.

Types

type Attachment

type Attachment struct {
}

func (*Attachment) Delete

func (a *Attachment) Delete(attachmentId string) (err error)

delete attachment by attachment_id

func (*Attachment) DeleteAttachmentDBFile

func (a *Attachment) DeleteAttachmentDBFile(attachmentId string) (err error)

func (*Attachment) DeleteAttachmentsDBFileByDocumentId

func (a *Attachment) DeleteAttachmentsDBFileByDocumentId(documentId string) (err error)

func (*Attachment) GetAttachmentByAttachmentId

func (a *Attachment) GetAttachmentByAttachmentId(attachmentId string) (attachment map[string]string, err error)

get attachment by attachment_id

func (*Attachment) GetAttachmentByAttachmentIds

func (a *Attachment) GetAttachmentByAttachmentIds(attachmentIds []string) (attachments []map[string]string, err error)

get attachment by many attachment_id

func (*Attachment) GetAttachmentByName

func (a *Attachment) GetAttachmentByName(name string) (attachment map[string]string, err error)

get attachment by name

func (*Attachment) GetAttachments

func (a *Attachment) GetAttachments() (attachments []map[string]string, err error)

get all attachments

func (*Attachment) GetAttachmentsByDocumentId

func (a *Attachment) GetAttachmentsByDocumentId(documentId string) (attachments []map[string]string, err error)

get attachments by document_id

func (*Attachment) GetAttachmentsByDocumentIdAndSource

func (a *Attachment) GetAttachmentsByDocumentIdAndSource(documentId string, source int) (attachments []map[string]string, err error)

get attachments by document and source

func (*Attachment) GetAttachmentsByDocumentIds

func (a *Attachment) GetAttachmentsByDocumentIds(documentIds []string) (attachments []map[string]string, err error)

get attachments by document_id

func (*Attachment) GetAttachmentsByLikeName

func (a *Attachment) GetAttachmentsByLikeName(name string) (attachments []map[string]string, err error)

get attachments by like name

func (*Attachment) GetAttachmentsBySpaceId

func (a *Attachment) GetAttachmentsBySpaceId(spaceId string) (attachments []map[string]string, err error)

get attachments by space_id

func (*Attachment) HasAttachmentName

func (a *Attachment) HasAttachmentName(name string) (has bool, err error)

name is exists

func (*Attachment) HasSameName

func (a *Attachment) HasSameName(attachmentId, name string) (has bool, err error)

attachment_id and name is exists

func (*Attachment) Insert

func (a *Attachment) Insert(attachmentValue map[string]interface{}) (id int64, err error)

insert attachment

type Auth

type Auth struct {
}

func (*Auth) CountAuths

func (a *Auth) CountAuths() (count int64, err error)

get auth count

func (*Auth) CountAuthsByKeyword

func (a *Auth) CountAuthsByKeyword(keyword string) (count int64, err error)

get auth count by keyword

func (*Auth) Delete

func (a *Auth) Delete(authId string) (err error)

delete auth by auth_id

func (*Auth) GetAuthByAuthId

func (a *Auth) GetAuthByAuthId(authId string) (auth map[string]string, err error)

get auth by auth_id

func (*Auth) GetAuthByAuthIds

func (a *Auth) GetAuthByAuthIds(authIds []string) (auths []map[string]string, err error)

get auth by many auth_id

func (*Auth) GetAuthByName

func (a *Auth) GetAuthByName(name string) (auth map[string]string, err error)

get auth by name

func (*Auth) GetAuths

func (a *Auth) GetAuths() (auths []map[string]string, err error)

get all auths

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

func (a *Auth) GetAuthsByLikeName(name string) (auths []map[string]string, err error)

get auths by like name

func (*Auth) GetAuthsByLimit

func (a *Auth) GetAuthsByLimit(limit int, number int) (auths []map[string]string, err error)

get limit auths

func (*Auth) GetUsedAuth

func (a *Auth) GetUsedAuth() (auth map[string]string, err error)

get used auth

func (*Auth) HasAuthName

func (a *Auth) HasAuthName(name string) (has bool, err error)

name is exists

func (*Auth) HasAuthUsernamePrefix

func (a *Auth) HasAuthUsernamePrefix(usernamePrefix string) (has bool, err error)

name is exists

func (*Auth) HasSameName

func (a *Auth) HasSameName(authId, name string) (has bool, err error)

auth_id and name is exists

func (*Auth) HasSameUsernamePrefix

func (a *Auth) HasSameUsernamePrefix(authId, usernamePrefix string) (has bool, err error)

auth_id and name is exists

func (*Auth) Insert

func (a *Auth) Insert(authValue map[string]interface{}) (id int64, err error)

insert auth

func (*Auth) SetAuthUsed

func (a *Auth) SetAuthUsed(authId string) (id int64, err error)

set auth used

func (*Auth) Update

func (a *Auth) Update(authId string, authValue map[string]interface{}) (id int64, err error)

update auth by auth_id

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

func (c *Collection) GetResourceIdsOrderByCountLimit(limit int, collectType int) (collects []map[string]string, err error)

func (*Collection) Insert

func (c *Collection) Insert(collectionValue map[string]interface{}) (id int64, err error)

insert collection

type Config

type Config struct {
}

func (*Config) GetConfigByConfigId

func (c *Config) GetConfigByConfigId(configId string) (config map[string]string, err error)

get config by config_id

func (*Config) GetConfigByConfigIds

func (c *Config) GetConfigByConfigIds(configIds []string) (configs []map[string]string, err error)

get config by many config_id

func (*Config) GetConfigByKey

func (c *Config) GetConfigByKey(key string) (config map[string]string, err error)

get config by config key

func (*Config) GetConfigs

func (c *Config) GetConfigs() (configs []map[string]string, err error)

get all configs

func (*Config) Insert

func (c *Config) Insert(insertValue map[string]interface{}) (id int64, err error)

insert config

func (*Config) InsertBatch

func (c *Config) InsertBatch(insertValues []map[string]interface{}) (id int64, err error)

insert batch configs

func (*Config) Update

func (c *Config) Update(configId string, configValue map[string]interface{}) (id int64, err error)

update config by config_id

func (*Config) UpdateByKey

func (c *Config) UpdateByKey(key string, value string) (id int64, err error)

update config by key

type Contact

type Contact struct {
}

func (*Contact) CountContact

func (c *Contact) CountContact() (count int64, err error)

获取联系人总数

func (*Contact) CountContactByName

func (c *Contact) CountContactByName(name string) (count int64, err error)

获取筛选名字查询结果条数

func (*Contact) DeleteByContactId

func (c *Contact) DeleteByContactId(contactId string) (affect int64, err error)

通过 contact_id 删除联系人信息

func (*Contact) GetAllContact

func (c *Contact) GetAllContact() (contacts []map[string]string, err error)

获取所有联系人信息

func (*Contact) GetContactByContactId

func (c *Contact) GetContactByContactId(contactId string) (contact map[string]string, err error)

通过 contact_id 获取联系人数据

func (*Contact) GetContactByLimit

func (c *Contact) GetContactByLimit(limit, number int) (contact []map[string]string, err error)

分页获取联系人

func (*Contact) GetContactByLimitAndName

func (c *Contact) GetContactByLimitAndName(name string, limit, number int) (contacts []map[string]string, err error)

分页筛选名字查询结果

func (*Contact) Insert

func (c *Contact) Insert(contact map[string]interface{}) (contactId int64, err error)

通过 contact_id 更新联系人信息

func (*Contact) UpdateByContactId

func (c *Contact) UpdateByContactId(contact map[string]interface{}, contactId string) (affect int64, err error)

通过 contact_id 更新联系人信息

type Document

type Document struct {
}

func (*Document) CountDocuments

func (d *Document) CountDocuments() (count int64, err error)

get document count

func (*Document) CountDocumentsBySpaceId

func (d *Document) CountDocumentsBySpaceId(spaceId string) (count int64, err error)

get document count

func (*Document) CountDocumentsLikeName

func (d *Document) CountDocumentsLikeName(name string) (count int64, err error)

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) GetAllDocuments

func (d *Document) GetAllDocuments() (documents []map[string]string, err error)

func (*Document) GetAllDocumentsByDocumentIds

func (d *Document) GetAllDocumentsByDocumentIds(documentIds []string) (documents []map[string]string, err error)

func (*Document) GetAllSpaceDocuments

func (d *Document) GetAllSpaceDocuments(spaceId string) (documents []map[string]string, err error)

get document by spaceId

func (*Document) GetCountGroupByCreateTime

func (d *Document) GetCountGroupByCreateTime(startTime int64) (documents []map[string]string, err error)

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

func (d *Document) GetDocumentByParentIdAndSpaceId(parentId string, spaceId string, docType int) (document map[string]string, err error)

get document by name and spaceId

func (*Document) GetDocumentContentByDocument

func (d *Document) GetDocumentContentByDocument(doc map[string]string) (content string, pageFile string, err error)

根据文档信息获取文档内容和文件地址

func (*Document) GetDocumentGroupCreateUserId

func (d *Document) GetDocumentGroupCreateUserId() (documents []map[string]string, err error)

func (*Document) GetDocumentGroupEditUserId

func (d *Document) GetDocumentGroupEditUserId() (documents []map[string]string, err error)

func (*Document) GetDocumentMaxSequence

func (d *Document) GetDocumentMaxSequence(parentId string, spaceId string) (sequence int, err error)

get max sequence

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

func (d *Document) GetDocumentsByLikeName(name string) (documents []map[string]string, err error)

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

func (d *Document) GetDocumentsByName(name string) (documents []map[string]string, err error)

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) GetDocumentsByParentIdAndSpaceIdOnly

func (d *Document) GetDocumentsByParentIdAndSpaceIdOnly(parentId string, spaceId string) (document []map[string]string, err error)

get document by name and spaceId

func (*Document) GetDocumentsBySpaceId

func (d *Document) GetDocumentsBySpaceId(spaceId string) (documents []map[string]string, err error)

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) GetDocumetAllTags

func (d *Document) GetDocumetAllTags() (tags map[string]string, err error)

获取文档的所有可用标签信息

func (*Document) GetParentDocumentsByDocument

func (d *Document) GetParentDocumentsByDocument(document map[string]string) (parentDocuments []map[string]string, pageFile string, err error)

func (*Document) GetParentDocumentsByPath

func (d *Document) GetParentDocumentsByPath(path string) (parentDocuments []map[string]string, err error)

func (*Document) GetSpaceDefaultDocument

func (d *Document) GetSpaceDefaultDocument(spaceId string) (document map[string]string, err error)

get document by spaceId

func (*Document) GetSpaceIdsOrderByCountDocumentLimit

func (d *Document) GetSpaceIdsOrderByCountDocumentLimit(limit int) (documents []map[string]string, err error)

func (*Document) Insert

func (d *Document) Insert(documentValue map[string]interface{}) (id int64, err error)

insert document

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

func (*Document) MoveSequenceBySpaceIdAndGtSequence

func (d *Document) MoveSequenceBySpaceIdAndGtSequence(spaceId string, startSequence int, n int) (id int64, err error)

update document by spaceId and >= sequence 批量移动更新文档序号

func (*Document) Update

func (d *Document) Update(documentId string, documentValue map[string]interface{}, comment string) (id int64, err error)

update document by document_id

func (*Document) UpdateDBAndFile

func (d *Document) UpdateDBAndFile(documentId string, document map[string]string, documentContent string, updateValue map[string]interface{}, comment string) (id int64, err error)

update document by document_id

type Email

type Email struct {
}

func (*Email) CountEmails

func (u *Email) CountEmails() (count int64, err error)

get email count

func (*Email) CountEmailsByKeyword

func (u *Email) CountEmailsByKeyword(keyword string) (count int64, err error)

get email count by keyword

func (*Email) Delete

func (u *Email) Delete(emailId string) (err error)

delete email by email_id

func (*Email) GetEmailByEmailId

func (u *Email) GetEmailByEmailId(emailId string) (email map[string]string, err error)

get email by email_id

func (*Email) GetEmailByEmailIds

func (u *Email) GetEmailByEmailIds(emailIds []string) (emails []map[string]string, err error)

get email by many email_id

func (*Email) GetEmailByName

func (u *Email) GetEmailByName(name string) (email map[string]string, err error)

get email by name

func (*Email) GetEmails

func (u *Email) GetEmails() (emails []map[string]string, err error)

get all emails

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

func (u *Email) GetEmailsByLikeName(name string) (emails []map[string]string, err error)

get emails by like name

func (*Email) GetEmailsByLimit

func (u *Email) GetEmailsByLimit(limit int, number int) (emails []map[string]string, err error)

get limit emails

func (*Email) GetUsedEmail

func (u *Email) GetUsedEmail() (email map[string]string, err error)

get used email

func (*Email) HasEmailName

func (u *Email) HasEmailName(name string) (has bool, err error)

name is exists

func (*Email) HasSameName

func (u *Email) HasSameName(emailId, name string) (has bool, err error)

email_id and name is exists

func (*Email) Insert

func (u *Email) Insert(emailValue map[string]interface{}) (id int64, err error)

insert email

func (*Email) SetEmailUsed

func (u *Email) SetEmailUsed(emailId string) (id int64, err error)

set email used

func (*Email) Update

func (u *Email) Update(emailId string, emailValue map[string]interface{}) (id int64, err error)

update email by email_id

type Follow

type Follow struct {
}

func (*Follow) CountFollows

func (f *Follow) CountFollows() (count int64, err error)

get follow count

func (*Follow) CountFollowsByUserIdAndType

func (f *Follow) CountFollowsByUserIdAndType(userId string, followType int) (count int64, err error)

get follow count

func (*Follow) CreateAutoFollowDocument

func (f *Follow) CreateAutoFollowDocument(userId string, documentId string) (id int64, err error)

create auto follow document

func (*Follow) Delete

func (f *Follow) Delete(followId string) (err error)

delete follow by follow_id

func (*Follow) DeleteByObjectIdType

func (f *Follow) DeleteByObjectIdType(objectId string, followType string) (err error)

delete follow by type and object_id

func (*Follow) FollowDocument

func (f *Follow) FollowDocument(userId string, documentId string) (id int64, err error)

func (*Follow) GetFansUserGroupUserId

func (f *Follow) GetFansUserGroupUserId() (collects []map[string]string, err error)

func (*Follow) GetFollowByFollowId

func (f *Follow) GetFollowByFollowId(followId string) (follow map[string]string, err error)

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 (f *Follow) GetFollowGroupUserId(fType int) (collects []map[string]string, err error)

func (*Follow) GetFollows

func (f *Follow) GetFollows() (follows []map[string]string, err error)

get all follows

func (*Follow) GetFollowsByFollowIds

func (f *Follow) GetFollowsByFollowIds(followIds []string) (follows []map[string]string, err error)

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

func (*Follow) GetFollowsByUserIdTypeAndLimit

func (f *Follow) GetFollowsByUserIdTypeAndLimit(userId string, followType int, limit int, number int) (follows []map[string]string, err error)

get follows by user_id and type limit

func (*Follow) Insert

func (f *Follow) Insert(userId string, fType int, objectId string) (id int64, err error)

insert follow user

type Link struct {
}
func (l *Link) CountLinks() (count int64, err error)

get link count

func (*Link) CountLinksByKeyword

func (l *Link) CountLinksByKeyword(keyword string) (count int64, err error)

get link count by keyword

func (*Link) Delete

func (l *Link) Delete(linkId string) (err error)

delete link by link_id

func (*Link) GetLinkByLinkId

func (l *Link) GetLinkByLinkId(linkId string) (link map[string]string, err error)

get link by link_id

func (*Link) GetLinkByLinkIds

func (l *Link) GetLinkByLinkIds(linkIds []string) (links []map[string]string, err error)

get link by many link_id

func (*Link) GetLinkByName

func (l *Link) GetLinkByName(name string) (link map[string]string, err error)

get link by name

func (l *Link) GetLinks() (links []map[string]string, err error)

get all links

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

func (l *Link) GetLinksByLikeName(name string) (links []map[string]string, err error)

get links by like name

func (*Link) GetLinksByLimit

func (l *Link) GetLinksByLimit(limit int, number int) (links []map[string]string, err error)

get limit links

func (*Link) GetLinksOrderBySequence

func (l *Link) GetLinksOrderBySequence() (links []map[string]string, err error)

get all links by sequence

func (*Link) HasLinkName

func (l *Link) HasLinkName(name string) (has bool, err error)

name is exists

func (*Link) HasSameName

func (l *Link) HasSameName(linkId, name string) (has bool, err error)

link_id and name is exists

func (*Link) Insert

func (l *Link) Insert(linkValue map[string]interface{}) (id int64, err error)

insert link

func (*Link) Update

func (l *Link) Update(linkId string, linkValue map[string]interface{}) (id int64, err error)

update link by link_id

type Log

type Log struct {
}

func (*Log) CountLogs

func (l *Log) CountLogs() (count int64, err error)

获取日志总数

func (*Log) CountLogsByKeyword

func (l *Log) CountLogsByKeyword(level, message, username string) (count int64, err error)

根据关键字获取日志总数

func (*Log) CountLogsByLevel

func (l *Log) CountLogsByLevel(level int) (count int64, err error)

func (*Log) GetLogByLogId

func (l *Log) GetLogByLogId(logId string) (log map[string]string, err error)

根据 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

func (l *Log) GetLogsByLimit(limit int, number int) (logs []map[string]string, err error)

分页获取日志

func (*Log) Insert

func (l *Log) Insert(log map[string]interface{}) (id int64, err error)

插入

func (*Log) RecordLog

func (l *Log) RecordLog(message string, level int, userId string, username string, ctx context.Context) (id int64, err error)

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, spaceId 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 (ld *LogDocument) GetLogDocumentsByDocumentIdAndLimit(documentId string, limit int, number int) (logDocuments []map[string]string, err error)

func (*LogDocument) GetLogDocumentsByKeywordAndLimit

func (ld *LogDocument) GetLogDocumentsByKeywordAndLimit(keyword string, limit int, number int) (logDocuments []map[string]string, err error)

func (*LogDocument) GetLogDocumentsByLimit

func (ld *LogDocument) GetLogDocumentsByLimit(userId string, limit int, number int) (logDocuments []map[string]string, err error)

func (*LogDocument) GetLogDocumentsByUserId

func (ld *LogDocument) GetLogDocumentsByUserId(userId string) (logDocuments []map[string]string, err error)

func (*LogDocument) GetLogDocumentsByUserIdAndLimit

func (ld *LogDocument) GetLogDocumentsByUserIdAndLimit(userId string, limit int, number int) (logDocuments []map[string]string, err error)

func (*LogDocument) GetLogDocumentsByUserIdKeywordAndLimit

func (ld *LogDocument) GetLogDocumentsByUserIdKeywordAndLimit(userId string, keyword string, limit int, number int) (logDocuments []map[string]string, err error)

func (*LogDocument) Insert

func (ld *LogDocument) Insert(logDocument map[string]interface{}) (id int64, err error)

func (*LogDocument) UpdateAction

func (ld *LogDocument) UpdateAction(userId string, documentId string, comment string) (id int64, err error)

type Privilege

type Privilege struct {
}

func (*Privilege) Delete

func (p *Privilege) Delete(privilegeId string) (err error)

func (*Privilege) GetPrivilegeByPrivilegeId

func (p *Privilege) GetPrivilegeByPrivilegeId(privilegeId string) (privilege map[string]string, err error)

func (*Privilege) GetPrivilegeByTypeControllerAndAction

func (p *Privilege) GetPrivilegeByTypeControllerAndAction(ty, controller, action string) (privilege map[string]string, err error)

func (*Privilege) GetPrivileges

func (p *Privilege) GetPrivileges() (privileges []map[string]string, err error)

func (*Privilege) GetTypePrivileges

func (p *Privilege) GetTypePrivileges() (menus, controllers []map[string]string, err error)

func (*Privilege) GetTypePrivilegesByDisplay

func (p *Privilege) GetTypePrivilegesByDisplay(display string) (menus, controllers []map[string]string, err error)

func (*Privilege) GetTypePrivilegesByDisplayPrivilegeIds

func (p *Privilege) GetTypePrivilegesByDisplayPrivilegeIds(display string, privilegeIds []string) (menus, controllers []map[string]string, err error)

func (*Privilege) GetTypePrivilegesByPrivilegeIds

func (p *Privilege) GetTypePrivilegesByPrivilegeIds(privilegeIds []string) (menus, controllers []map[string]string, err error)

func (*Privilege) GetTypePrivilegesByUserId

func (p *Privilege) GetTypePrivilegesByUserId(userId string) (menus, controllers []map[string]string, err error)

func (*Privilege) HasSub

func (p *Privilege) HasSub(privilegeId string) (has bool, err error)

func (*Privilege) Insert

func (p *Privilege) Insert(privilege map[string]interface{}) (id int64, err error)

func (*Privilege) InsertNotExists

func (p *Privilege) InsertNotExists(privilege map[string]interface{}) (id int64, err error)

func (*Privilege) Update

func (p *Privilege) Update(privilegeId string, privilege map[string]interface{}) (id int64, err error)

type Role

type Role struct {
}

func (*Role) CountRoles

func (r *Role) CountRoles() (count int64, err error)

get role count

func (*Role) CountRolesByKeyword

func (r *Role) CountRolesByKeyword(keyword string) (count int64, err error)

get role count by keyword

func (*Role) Delete

func (r *Role) Delete(roleId string) (err error)

delete role by role_id

func (*Role) GetRoleByLikeName

func (r *Role) GetRoleByLikeName(name string) (roles []map[string]string, err error)

get role by name

func (*Role) GetRoleByName

func (r *Role) GetRoleByName(name string) (role map[string]string, err error)

get role by name

func (*Role) GetRoleByRoleId

func (r *Role) GetRoleByRoleId(roleId string) (role map[string]string, err error)

get role by role_id

func (*Role) GetRoleByRoleIds

func (r *Role) GetRoleByRoleIds(roleIds []string) (roles []map[string]string, err error)

get role by many role_id

func (*Role) GetRoles

func (r *Role) GetRoles() (roles []map[string]string, err error)

get all roles

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

func (r *Role) GetRolesByLimit(limit int, number int) (roles []map[string]string, err error)

get limit roles

func (*Role) GetRolesNotContainRoot

func (r *Role) GetRolesNotContainRoot() (roles []map[string]string, err error)

get all roles not contain root

func (*Role) HasRoleName

func (r *Role) HasRoleName(name string) (has bool, err error)

name is exists

func (*Role) HasSameName

func (r *Role) HasSameName(roleId, name string) (has bool, err error)

role_id and name is exists

func (*Role) Insert

func (r *Role) Insert(roleValue map[string]interface{}) (id int64, err error)

insert role

func (*Role) Update

func (r *Role) Update(roleId string, roleValue map[string]interface{}) (id int64, err error)

update role by role_id

func (*Role) UpdateRoleByName

func (r *Role) UpdateRoleByName(role map[string]interface{}) (affect int64, err error)

update role by name

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) CountSpaces

func (s *Space) CountSpaces() (count int64, err error)

get space count

func (*Space) CountSpacesByKeyword

func (s *Space) CountSpacesByKeyword(keyword string) (count int64, err error)

get space count by keyword

func (*Space) CountSpacesByTags

func (s *Space) CountSpacesByTags(tag string) (count int64, err error)

get space count

func (*Space) Delete

func (s *Space) Delete(spaceId string) (err error)

delete space by space_id

func (*Space) GetSpaceByLikeName

func (s *Space) GetSpaceByLikeName(name string) (spaces []map[string]string, err error)

get space by name

func (*Space) GetSpaceByName

func (s *Space) GetSpaceByName(name string) (space map[string]string, err error)

get space by name

func (*Space) GetSpaceBySpaceId

func (s *Space) GetSpaceBySpaceId(spaceId string) (space map[string]string, err error)

get space by space_id

func (*Space) GetSpaceBySpaceIds

func (s *Space) GetSpaceBySpaceIds(spaceIds []string) (spaces []map[string]string, err error)

get space by many space_id

func (*Space) GetSpaces

func (s *Space) GetSpaces() (spaces []map[string]string, err error)

get all spaces

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

func (s *Space) GetSpacesByLimit(limit int, number int) (spaces []map[string]string, err error)

get limit spaces

func (*Space) GetSpacesByTags

func (s *Space) GetSpacesByTags(tag string) (spaces []map[string]string, err error)

get space count by tags

func (*Space) GetSpacesByVisitLevel

func (s *Space) GetSpacesByVisitLevel(visitLevel string) (spaces []map[string]string, err error)

get spaces by visitLevel

func (*Space) HasSameName

func (s *Space) HasSameName(spaceId, name string) (has bool, err error)

space_id and name is exists

func (*Space) HasSpaceName

func (s *Space) HasSpaceName(name string) (has bool, err error)

name is exists

func (*Space) Insert

func (s *Space) Insert(spaceValue map[string]interface{}) (id int64, err error)

insert space

func (*Space) Update

func (s *Space) Update(spaceId string, spaceValue map[string]interface{}) (id int64, err error)

update space by space_id

func (*Space) UpdateDBAndSpaceFileName

func (s *Space) UpdateDBAndSpaceFileName(spaceId string, spaceValue map[string]interface{}, oldName string) (id int64, err error)

update space db and file name by space_id

func (*Space) UpdateSpaceByName

func (s *Space) UpdateSpaceByName(space map[string]interface{}) (affect int64, err error)

update space by name

type SpaceUser

type SpaceUser struct {
}

func (*SpaceUser) CountSpaceUsersBySpaceId

func (s *SpaceUser) CountSpaceUsersBySpaceId(spaceId string) (count int64, err error)

get space_user count by keyword

func (*SpaceUser) Delete

func (s *SpaceUser) Delete(spaceUserId string) (err error)

delete space_user by space_user_id

func (*SpaceUser) DeleteBySpaceId

func (s *SpaceUser) DeleteBySpaceId(spaceId string) (err error)

delete space_user by space_user_id

func (*SpaceUser) DeleteBySpaceIdAndUserId

func (s *SpaceUser) DeleteBySpaceIdAndUserId(spaceId string, userId string) (err error)

delete space_user by space_id and user_id

func (*SpaceUser) DeleteByUserId

func (s *SpaceUser) DeleteByUserId(userId string) (err error)

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

func (s *SpaceUser) GetSpaceUsers() (spaceUsers []map[string]string, err error)

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

func (s *SpaceUser) HasSpaceUser(spaceId string, userId string) (has bool, err error)

space user is exists

func (*SpaceUser) Insert

func (s *SpaceUser) Insert(spaceUserValue map[string]interface{}) (id int64, err error)

insert space_user

func (*SpaceUser) Update

func (s *SpaceUser) Update(spaceUserId string, spaceUserValue map[string]interface{}) (id int64, err error)

update space_user by space_user_id

type Tag

type Tag struct {
}

func (*Tag) CountTags

func (l *Tag) CountTags() (count int64, err error)

func (*Tag) CountTagsByKeyword

func (l *Tag) CountTagsByKeyword(keyword string) (count int64, err error)

func (*Tag) Delete

func (l *Tag) Delete(tagId string) (err error)

func (*Tag) GetTagByTagIds

func (l *Tag) GetTagByTagIds(tagId string) (tags []map[string]string, err error)

func (*Tag) GetTagsByKeywordAndLimit

func (l *Tag) GetTagsByKeywordAndLimit(keyword string, limit int, number int) (tags []map[string]string, err error)

func (*Tag) GetTagsByLimit

func (l *Tag) GetTagsByLimit(limit int, number int) (tags []map[string]string, err error)

func (*Tag) HasTagName

func (l *Tag) HasTagName(tag string) (has bool, err error)

func (*Tag) Insert

func (l *Tag) Insert(tagValue map[string]interface{}) (id int64, err error)

type Upgrade

type Upgrade struct {
}

func (*Upgrade) Start

func (up *Upgrade) Start(dbVersion string) (err error)

upgrade start

type User

type User struct {
}

func (*User) ChangePassword

func (u *User) ChangePassword(userId, newPassword, oldPassword string) (err error)

update user password

func (*User) CountForbiddenUsers

func (u *User) CountForbiddenUsers() (count int64, err error)

get forbidden user count

func (*User) CountNormalUsers

func (u *User) CountNormalUsers() (count int64, err error)

get normal user count

func (*User) CountUsers

func (u *User) CountUsers() (count int64, err error)

get user count

func (*User) CountUsersByKeywords

func (u *User) CountUsersByKeywords(keywords map[string]string) (count int64, err error)

get user count by keyword

func (*User) CountUsersByLastTime

func (u *User) CountUsersByLastTime(lastTime int64) (count int64, err error)

get user count by lastTime

func (*User) Delete

func (u *User) Delete(userId string) (err error)

delete user by user_id

func (*User) EncodePassword

func (u *User) EncodePassword(password string) (passwordHash string)

encode password

func (*User) GetUserByLikeName

func (u *User) GetUserByLikeName(username string) (users []map[string]string, err error)

get user by username

func (*User) GetUserByNotUserIds

func (u *User) GetUserByNotUserIds(userIds []string) (users []map[string]string, err error)

get user by not in user_ids

func (*User) GetUserByUserId

func (u *User) GetUserByUserId(userId string) (user map[string]string, err error)

get user by user_id

func (*User) GetUserByUsername

func (u *User) GetUserByUsername(username string) (user map[string]string, err error)

get user by username

func (*User) GetUsers

func (u *User) GetUsers() (users []map[string]string, err error)

get all users

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

func (u *User) GetUsersByLimit(limit int, number int) (users []map[string]string, err error)

get limit users

func (*User) GetUsersByRoleId

func (u *User) GetUsersByRoleId(roleId string) (users []map[string]string, err error)

get user by many user_id

func (*User) GetUsersByUserIds

func (u *User) GetUsersByUserIds(userIds []string) (users []map[string]string, err error)

get user by many user_id

func (*User) HasSameUsername

func (u *User) HasSameUsername(userId, username string) (has bool, err error)

user_id and username is exists

func (*User) HasUsername

func (u *User) HasUsername(username string) (has bool, err error)

username is exists

func (*User) Insert

func (u *User) Insert(userValue map[string]interface{}) (id int64, err error)

insert user

func (*User) Update

func (u *User) Update(userId string, userValue map[string]interface{}) (id int64, err error)

update user by user_id

func (*User) UpdateUserByUsername

func (u *User) UpdateUserByUsername(user map[string]interface{}) (affect int64, err error)

update user by username

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL