Documentation ¶
Index ¶
- Variables
- func InitAuthConfig()
- func RecursiveFun(parentId int, prefix, dpath string, this *DocumentController, ...)
- type AccountController
- type BaseController
- func (c *BaseController) BaseUrl() string
- func (c *BaseController) Callback()
- func (c *BaseController) Crawl()
- func (c *BaseController) ExecuteViewPathTemplate(tplName string, data interface{}) (string, error)
- func (c *BaseController) GetSeoByPage(page string, defSeo map[string]string)
- func (c *BaseController) GetSessionClaims() *auth.Claims
- func (c *BaseController) JsonResult(errCode int, errMsg string, data ...interface{})
- func (c *BaseController) Login()
- func (c *BaseController) Logout()
- func (c *BaseController) Prepare()
- func (c *BaseController) SetFollow()
- func (c *BaseController) SetMember(member models.Member)
- func (c *BaseController) SetSessionClaims(claims *auth.Claims)
- func (c *BaseController) ShowErrorPage(errCode int, errMsg string)
- func (c *BaseController) SignToday()
- func (c *BaseController) Signup()
- func (c *BaseController) Sitemap()
- type BookController
- func (this *BookController) Comment()
- func (this *BookController) Create()
- func (this *BookController) CreateToken()
- func (this *BookController) Dashboard()
- func (this *BookController) Delete()
- func (this *BookController) DownloadProject()
- func (this *BookController) Generate()
- func (this *BookController) GitPull()
- func (this *BookController) Index()
- func (this *BookController) IsPermission() (*models.BookResult, error)
- func (this *BookController) PrivatelyOwned()
- func (this *BookController) Release()
- func (this *BookController) Replace()
- func (this *BookController) SaveBook()
- func (this *BookController) SaveSort()
- func (this *BookController) Score()
- func (this *BookController) Setting()
- func (this *BookController) Star()
- func (this *BookController) Transfer()
- func (this *BookController) UploadCover()
- func (this *BookController) UploadProject()
- func (this *BookController) Users()
- type BookMemberController
- type BookmarkController
- type CateController
- type CommentController
- type CookieRemember
- type DocumentController
- func (this *DocumentController) Abort404(bookName, bookLink string)
- func (this *DocumentController) Compare()
- func (this *DocumentController) Content()
- func (this *DocumentController) Create()
- func (this *DocumentController) CreateMulti()
- func (this *DocumentController) Delete()
- func (this *DocumentController) DeleteHistory()
- func (this *DocumentController) DownloadAttachment()
- func (this *DocumentController) Edit()
- func (this *DocumentController) Export()
- func (this *DocumentController) History()
- func (this *DocumentController) Index()
- func (this *DocumentController) QrCode()
- func (this *DocumentController) Read()
- func (this *DocumentController) RemoveAttachment()
- func (this *DocumentController) RestoreHistory()
- func (this *DocumentController) Search()
- func (this *DocumentController) Upload()
- type ErrorController
- type HomeController
- type LabelController
- type LocalhostController
- type ManagerController
- func (this *ManagerController) AddFriendlink()
- func (this *ManagerController) AddTags()
- func (this *ManagerController) Ads()
- func (this *ManagerController) AttachDelete()
- func (this *ManagerController) AttachDetailed()
- func (this *ManagerController) AttachList()
- func (this *ManagerController) Banners()
- func (this *ManagerController) Books()
- func (this *ManagerController) Category()
- func (this *ManagerController) ChangeMemberRole()
- func (this *ManagerController) ClearComments()
- func (this *ManagerController) Comments()
- func (this *ManagerController) CreateMember()
- func (this *ManagerController) CreateToken()
- func (this *ManagerController) DelAds()
- func (this *ManagerController) DelCate()
- func (this *ManagerController) DelFriendlink()
- func (this *ManagerController) DelTags()
- func (this *ManagerController) DeleteBanner()
- func (this *ManagerController) DeleteBook()
- func (this *ManagerController) DeleteComment()
- func (this *ManagerController) DeleteMember()
- func (this *ManagerController) DeleteSubmitBook()
- func (this *ManagerController) EditBook()
- func (this *ManagerController) EditMember()
- func (this *ManagerController) FriendLink()
- func (this *ManagerController) Index()
- func (this *ManagerController) Prepare()
- func (this *ManagerController) PrivatelyOwned()
- func (this *ManagerController) RebuildAllIndex()
- func (this *ManagerController) Seo()
- func (this *ManagerController) SetCommentStatus()
- func (this *ManagerController) Setting()
- func (this *ManagerController) Sitemap()
- func (this *ManagerController) SubmitBook()
- func (this *ManagerController) Tags()
- func (this *ManagerController) Transfer()
- func (this *ManagerController) UpdateAds()
- func (this *ManagerController) UpdateBanner()
- func (this *ManagerController) UpdateBookSort()
- func (this *ManagerController) UpdateCate()
- func (this *ManagerController) UpdateCateIcon()
- func (this *ManagerController) UpdateFriendlink()
- func (this *ManagerController) UpdateMemberNoRank()
- func (this *ManagerController) UpdateMemberStatus()
- func (this *ManagerController) UpdateSubmitBook()
- func (this *ManagerController) UploadBanner()
- func (this *ManagerController) Users()
- type RankController
- type RecordController
- type SearchController
- type SettingController
- type Sort
- type StaticController
- type SubmitController
- type UserController
Constants ¶
This section is empty.
Variables ¶
var JwtPublicKey string
Functions ¶
func InitAuthConfig ¶
func InitAuthConfig()
func RecursiveFun ¶
func RecursiveFun(parentId int, prefix, dpath string, this *DocumentController, book *models.BookResult, docs []*models.Document, paths *list.List)
递归生成文档序列数组.
Types ¶
type AccountController ¶
type AccountController struct {
BaseController
}
AccountController 用户登录与注册.
type BaseController ¶
type BaseController struct { beego.Controller Member *models.Member Option map[string]string EnableAnonymous bool AllowRegister bool EnableDocumentHistory int Sitename string IsMobile bool OssDomain string StaticDomain string NoNeedLoginRouter bool }
func (*BaseController) BaseUrl ¶
func (c *BaseController) BaseUrl() string
func (*BaseController) Callback ¶
func (c *BaseController) Callback()
@Title Callback @Description sign in as a member
func (*BaseController) ExecuteViewPathTemplate ¶
func (c *BaseController) ExecuteViewPathTemplate(tplName string, data interface{}) (string, error)
ExecuteViewPathTemplate 执行指定的模板并返回执行结果.
func (*BaseController) GetSeoByPage ¶
func (c *BaseController) GetSeoByPage(page string, defSeo map[string]string)
根据页面获取seo @param page 页面标识 @param defSeo 默认的seo的map,必须有title、keywords和description字段
func (*BaseController) GetSessionClaims ¶
func (c *BaseController) GetSessionClaims() *auth.Claims
func (*BaseController) JsonResult ¶
func (c *BaseController) JsonResult(errCode int, errMsg string, data ...interface{})
JsonResult 响应 json 结果
func (*BaseController) Logout ¶
func (c *BaseController) Logout()
@Title Signout @Description sign out the current member @Success 200 {object} controllers.api_controller.Response The Response object @router /signout [post] @Tag Account API
func (*BaseController) SetMember ¶
func (c *BaseController) SetMember(member models.Member)
SetMember 获取或设置当前登录用户信息,如果 MemberId 小于 0 则标识删除 Session
func (*BaseController) SetSessionClaims ¶
func (c *BaseController) SetSessionClaims(claims *auth.Claims)
func (*BaseController) ShowErrorPage ¶
func (c *BaseController) ShowErrorPage(errCode int, errMsg string)
显示错误信息页面.
func (*BaseController) SignToday ¶
func (c *BaseController) SignToday()
type BookController ¶
type BookController struct {
BaseController
}
func (*BookController) DownloadProject ¶
func (this *BookController) DownloadProject()
从github等拉取下载markdown书籍
func (*BookController) Generate ¶
func (this *BookController) Generate()
生成下载文档 加锁,防止用户不停地点击生成下载文档造成服务器资源开销.
func (*BookController) Index ¶
func (this *BookController) Index()
func (*BookController) IsPermission ¶
func (this *BookController) IsPermission() (*models.BookResult, error)
判断是否具有管理员或管理员以上权限
type BookMemberController ¶
type BookMemberController struct {
BaseController
}
func (*BookMemberController) AddMember ¶
func (this *BookMemberController) AddMember()
AddMember 参加参与用户.
func (*BookMemberController) ChangeRole ¶
func (this *BookMemberController) ChangeRole()
变更指定用户在指定书籍中的权限
func (*BookMemberController) IsPermission ¶
func (this *BookMemberController) IsPermission() (*models.BookResult, error)
type BookmarkController ¶
type BookmarkController struct {
BaseController
}
func (*BookmarkController) Prepare ¶
func (this *BookmarkController) Prepare()
type CateController ¶
type CateController struct {
BaseController
}
func (*CateController) Index ¶
func (this *CateController) Index()
type CommentController ¶
type CommentController struct {
BaseController
}
func (*CommentController) Create ¶
func (c *CommentController) Create()
func (*CommentController) Index ¶
func (c *CommentController) Index()
func (*CommentController) Lists ¶
func (c *CommentController) Lists()
type DocumentController ¶
type DocumentController struct {
BaseController
}
DocumentController struct.
func (*DocumentController) Abort404 ¶
func (this *DocumentController) Abort404(bookName, bookLink string)
func (*DocumentController) Compare ¶
func (this *DocumentController) Compare()
func (*DocumentController) DeleteHistory ¶
func (this *DocumentController) DeleteHistory()
func (*DocumentController) DownloadAttachment ¶
func (this *DocumentController) DownloadAttachment()
DownloadAttachment 下载附件.
func (*DocumentController) QrCode ¶
func (this *DocumentController) QrCode()
func (*DocumentController) RemoveAttachment ¶
func (this *DocumentController) RemoveAttachment()
删除附件.
func (*DocumentController) RestoreHistory ¶
func (this *DocumentController) RestoreHistory()
type ErrorController ¶
type ErrorController struct {
BaseController
}
func (*ErrorController) Error403 ¶
func (this *ErrorController) Error403()
func (*ErrorController) Error404 ¶
func (this *ErrorController) Error404()
func (*ErrorController) Error500 ¶
func (this *ErrorController) Error500()
type HomeController ¶
type HomeController struct {
BaseController
}
func (*HomeController) Index ¶
func (this *HomeController) Index()
type LabelController ¶
type LabelController struct {
BaseController
}
type LocalhostController ¶
type LocalhostController struct {
BaseController
}
只有请求头的host为localhost的才能访问。
func (*LocalhostController) Prepare ¶
func (c *LocalhostController) Prepare()
func (*LocalhostController) RenderMarkdown ¶
func (this *LocalhostController) RenderMarkdown()
渲染markdown. 根据文档id来。
type ManagerController ¶
type ManagerController struct {
BaseController
}
func (*ManagerController) AddTags ¶
func (this *ManagerController) AddTags()
func (*ManagerController) Banners ¶
func (this *ManagerController) Banners()
func (*ManagerController) ChangeMemberRole ¶
func (this *ManagerController) ChangeMemberRole()
变更用户权限.
func (*ManagerController) ClearComments ¶
func (this *ManagerController) ClearComments()
func (*ManagerController) Comments ¶
func (this *ManagerController) Comments()
func (*ManagerController) CreateToken ¶
func (this *ManagerController) CreateToken()
CreateToken 创建访问来令牌.
func (*ManagerController) DelAds ¶
func (this *ManagerController) DelAds()
func (*ManagerController) DelTags ¶
func (this *ManagerController) DelTags()
func (*ManagerController) DeleteBanner ¶
func (this *ManagerController) DeleteBanner()
func (*ManagerController) DeleteComment ¶
func (this *ManagerController) DeleteComment()
func (*ManagerController) DeleteMember ¶
func (this *ManagerController) DeleteMember()
删除一个用户,并将该用户的所有信息转移到超级管理员上.
func (*ManagerController) DeleteSubmitBook ¶
func (this *ManagerController) DeleteSubmitBook()
func (*ManagerController) Index ¶
func (this *ManagerController) Index()
func (*ManagerController) Prepare ¶
func (this *ManagerController) Prepare()
func (*ManagerController) PrivatelyOwned ¶
func (this *ManagerController) PrivatelyOwned()
设置书籍私有状态.
func (*ManagerController) SetCommentStatus ¶
func (this *ManagerController) SetCommentStatus()
func (*ManagerController) Setting ¶
func (this *ManagerController) Setting()
func (*ManagerController) Sitemap ¶
func (this *ManagerController) Sitemap()
func (*ManagerController) SubmitBook ¶
func (this *ManagerController) SubmitBook()
func (*ManagerController) UpdateAds ¶
func (this *ManagerController) UpdateAds()
func (*ManagerController) UpdateBanner ¶
func (this *ManagerController) UpdateBanner()
func (*ManagerController) UpdateBookSort ¶
func (this *ManagerController) UpdateBookSort()
更行书籍书籍的排序
func (*ManagerController) UpdateMemberNoRank ¶
func (this *ManagerController) UpdateMemberNoRank()
func (*ManagerController) UpdateMemberStatus ¶
func (this *ManagerController) UpdateMemberStatus()
更新用户状态.
func (*ManagerController) UpdateSubmitBook ¶
func (this *ManagerController) UpdateSubmitBook()
func (*ManagerController) UploadBanner ¶
func (this *ManagerController) UploadBanner()
type RankController ¶
type RankController struct {
BaseController
}
func (*RankController) Index ¶
func (this *RankController) Index()
type RecordController ¶
type RecordController struct {
BaseController
}
func (*RecordController) Prepare ¶
func (this *RecordController) Prepare()
type SearchController ¶
type SearchController struct {
BaseController
}
type SettingController ¶
type SettingController struct {
BaseController
}
type StaticController ¶
type StaticController struct { beego.Controller OssDomain string }
func (*StaticController) APP ¶
func (this *StaticController) APP()
func (*StaticController) Prepare ¶
func (this *StaticController) Prepare()
func (*StaticController) ProjectsFile ¶
func (this *StaticController) ProjectsFile()
ProjectsFile 书籍静态文件
func (*StaticController) Uploads ¶
func (this *StaticController) Uploads()
Uploads 查询上传的静态资源。 如果是音频和视频文件,需要根据后台设置而判断是否加密处理 如果使用了OSS存储,则需要将文件处理好
type SubmitController ¶
type SubmitController struct {
BaseController
}
func (*SubmitController) Index ¶
func (this *SubmitController) Index()
func (*SubmitController) Post ¶
func (this *SubmitController) Post()
type UserController ¶
type UserController struct { BaseController UcenterMember models.Member }
func (*UserController) Prepare ¶
func (this *UserController) Prepare()
Source Files ¶
- AcountController.go
- BaseController.go
- BookController.go
- BookMemberController.go
- BookmarkController.go
- CateController.go
- CommentController.go
- DocumentController.go
- ErrorController.go
- HomeController.go
- LabelController.go
- LocalhostController.go
- ManagerController.go
- RankController.go
- RecordController.go
- SearchController.go
- SettingController.go
- StaticController.go
- SubmitController.go
- UserController.go