controllers

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: May 23, 2018 License: Apache-2.0, Apache-2.0 Imports: 39 Imported by: 52

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RecursiveFun

func RecursiveFun(parent_id int, prefix, dpath string, this *DocumentController, book *models.BookResult, docs []*models.Document, paths *list.List)

递归生成文档序列数组.

Types

type AccountController

type AccountController struct {
	BaseController
}

AccountController 用户登录与注册.

func (*AccountController) Bind

func (this *AccountController) Bind()

用户注册.[移除用户注册,直接叫用户绑定] 注意:如果用户输入的账号密码跟现有的账号密码相一致,则表示绑定账号,否则表示注册新账号。

func (*AccountController) Captcha

func (this *AccountController) Captcha()

验证码.

func (*AccountController) FindPassword

func (this *AccountController) FindPassword()

找回密码.

func (*AccountController) Login

func (this *AccountController) Login()

Login 用户登录.

func (*AccountController) Logout

func (this *AccountController) Logout()

Logout 退出登录.

func (*AccountController) Note

func (this *AccountController) Note()

记录笔记

func (*AccountController) Oauth

func (this *AccountController) Oauth()

第三方登录回调 封装一个内部调用的函数,loginByMemberId

func (*AccountController) ValidEmail

func (this *AccountController) ValidEmail()

校验邮件并修改密码.

type BaseController

type BaseController struct {
	beego.Controller
	Member                *models.Member
	Option                map[string]string
	EnableAnonymous       bool
	EnableDocumentHistory bool
	Sitename              string
	OssDomain             string
}

func (*BaseController) BaseUrl

func (this *BaseController) BaseUrl() string

func (*BaseController) Crawl

func (this *BaseController) Crawl()

内容采集

func (*BaseController) ExecuteViewPathTemplate

func (this *BaseController) ExecuteViewPathTemplate(tplName string, data interface{}) (string, error)

ExecuteViewPathTemplate 执行指定的模板并返回执行结果.

func (*BaseController) GetSeoByPage

func (this *BaseController) GetSeoByPage(page string, defSeo map[string]string)

根据页面获取seo @param page 页面标识 @param defSeo 默认的seo的map,必须有title、keywords和description字段

func (*BaseController) JsonResult

func (this *BaseController) JsonResult(errCode int, errMsg string, data ...interface{})

JsonResult 响应 json 结果

func (*BaseController) Prepare

func (this *BaseController) Prepare()

Prepare 预处理.

func (*BaseController) Search

func (this *BaseController) Search()

搜索

func (*BaseController) SetFollow

func (this *BaseController) SetFollow()

关注或取消关注

func (*BaseController) SetMember

func (this *BaseController) SetMember(member models.Member)

SetMember 获取或设置当前登录用户信息,如果 MemberId 小于 0 则标识删除 Session

func (*BaseController) ShowErrorPage

func (this *BaseController) ShowErrorPage(errCode int, errMsg string)

显示错误信息页面.

func (*BaseController) Sitemap

func (this *BaseController) Sitemap()

站点地图

func (*BaseController) StaticFile

func (this *BaseController) StaticFile()

静态文件,这个加在路由的最后

type BookController

type BookController struct {
	BaseController
}

func (*BookController) Comment

func (this *BookController) Comment()

添加评论

func (*BookController) Create

func (this *BookController) Create()

Create 创建项目.

func (*BookController) CreateToken

func (this *BookController) CreateToken()

CreateToken 创建访问来令牌.

func (*BookController) Dashboard

func (this *BookController) Dashboard()

Dashboard 项目概要 .

func (*BookController) Delete

func (this *BookController) Delete()

Delete 删除项目.

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)

func (*BookController) PrivatelyOwned

func (this *BookController) PrivatelyOwned()

设置项目私有状态.

func (*BookController) Release

func (this *BookController) Release()

发布项目.

func (*BookController) SaveBook

func (this *BookController) SaveBook()

保存项目信息

func (*BookController) SaveSort

func (this *BookController) SaveSort()

文档排序.

func (*BookController) Score

func (this *BookController) Score()

给文档项目打分

func (*BookController) Setting

func (this *BookController) Setting()

Setting 项目设置 .

func (*BookController) Star

func (this *BookController) Star()

收藏书籍

func (*BookController) Transfer

func (this *BookController) Transfer()

Transfer 转让项目.

func (*BookController) UploadCover

func (this *BookController) UploadCover()

上传项目封面.

func (*BookController) UploadProject

func (this *BookController) UploadProject()

上传项目

func (*BookController) Users

func (this *BookController) Users()

Users 用户列表.

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)

func (*BookMemberController) RemoveMember

func (this *BookMemberController) RemoveMember()

删除参与者.

type BookmarkController

type BookmarkController struct {
	BaseController
}

func (*BookmarkController) Bookmark

func (this *BookmarkController) Bookmark()

添加或者移除书签

func (*BookmarkController) List

func (this *BookmarkController) List()

获取书签列表

func (*BookmarkController) Prepare

func (this *BookmarkController) Prepare()

type CateController

type CateController struct {
	BaseController
}

func (*CateController) List

func (this *CateController) List()

分类

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 CookieRemember

type CookieRemember struct {
	MemberId int
	Account  string
	Time     time.Time
}

type DocumentController

type DocumentController struct {
	BaseController
}

DocumentController struct.

func (*DocumentController) Compare

func (this *DocumentController) Compare()

func (*DocumentController) Content

func (this *DocumentController) Content()

获取或更新文档内容.

func (*DocumentController) Create

func (this *DocumentController) Create()

创建一个文档.

func (*DocumentController) CreateMulti

func (this *DocumentController) CreateMulti()

批量创建文档

func (*DocumentController) Delete

func (this *DocumentController) Delete()

删除文档.

func (*DocumentController) DeleteHistory

func (this *DocumentController) DeleteHistory()

func (*DocumentController) DownloadAttachment

func (this *DocumentController) DownloadAttachment()

DownloadAttachment 下载附件.

func (*DocumentController) Edit

func (this *DocumentController) Edit()

编辑文档.

func (*DocumentController) Export

func (this *DocumentController) Export()

导出文件

func (*DocumentController) History

func (this *DocumentController) History()

文档历史列表.

func (*DocumentController) Index

func (this *DocumentController) Index()

文档首页.

func (*DocumentController) QrCode

func (this *DocumentController) QrCode()

func (*DocumentController) Read

func (this *DocumentController) Read()

阅读文档.

func (*DocumentController) RemoveAttachment

func (this *DocumentController) RemoveAttachment()

删除附件.

func (*DocumentController) RestoreHistory

func (this *DocumentController) RestoreHistory()

func (*DocumentController) Search

func (this *DocumentController) Search()

项目内搜索.

func (*DocumentController) Upload

func (this *DocumentController) Upload()

上传附件或图片.

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
}

func (*LabelController) Index

func (this *LabelController) Index()

查看包含标签的文档列表.

func (*LabelController) List

func (this *LabelController) List()

func (*LabelController) Prepare

func (this *LabelController) Prepare()

type LocalhostController

type LocalhostController struct {
	BaseController
}

只有请求头的host为localhost的才能访问。

func (*LocalhostController) RenderMarkdown

func (this *LocalhostController) RenderMarkdown()

渲染markdown. 根据文档id来。

type ManagerController

type ManagerController struct {
	BaseController
}
func (this *ManagerController) AddFriendlink()

添加友链

func (*ManagerController) AttachDelete

func (this *ManagerController) AttachDelete()

删除附件.

func (*ManagerController) AttachDetailed

func (this *ManagerController) AttachDetailed()

附件详情.

func (*ManagerController) AttachList

func (this *ManagerController) AttachList()

附件列表.

func (*ManagerController) Books

func (this *ManagerController) Books()

项目列表.

func (*ManagerController) Category

func (this *ManagerController) Category()

分类管理

func (*ManagerController) ChangeMemberRole

func (this *ManagerController) ChangeMemberRole()

变更用户权限.

func (*ManagerController) Comments

func (this *ManagerController) Comments()

func (*ManagerController) CreateMember

func (this *ManagerController) CreateMember()

添加用户.

func (*ManagerController) CreateToken

func (this *ManagerController) CreateToken()

CreateToken 创建访问来令牌.

func (*ManagerController) DelCate

func (this *ManagerController) DelCate()

删除分类

func (this *ManagerController) DelFriendlink()

删除友链

func (*ManagerController) DeleteBook

func (this *ManagerController) DeleteBook()

删除项目.

func (*ManagerController) DeleteComment

func (this *ManagerController) DeleteComment()

DeleteComment 标记评论为已删除

func (*ManagerController) DeleteMember

func (this *ManagerController) DeleteMember()

删除一个用户,并将该用户的所有信息转移到超级管理员上.

func (*ManagerController) EditBook

func (this *ManagerController) EditBook()

编辑项目.

func (*ManagerController) EditMember

func (this *ManagerController) EditMember()

编辑用户信息.

func (this *ManagerController) FriendLink()

友情链接

func (*ManagerController) Index

func (this *ManagerController) Index()

func (*ManagerController) Prepare

func (this *ManagerController) Prepare()

func (*ManagerController) PrivatelyOwned

func (this *ManagerController) PrivatelyOwned()

设置项目私有状态.

func (*ManagerController) Seo

func (this *ManagerController) Seo()

SEO管理

func (*ManagerController) Setting

func (this *ManagerController) Setting()

func (*ManagerController) Sitemap

func (this *ManagerController) Sitemap()

func (*ManagerController) Transfer

func (this *ManagerController) Transfer()

Transfer 转让项目.

func (*ManagerController) UpdateBookSort

func (this *ManagerController) UpdateBookSort()

更行书籍项目的排序

func (*ManagerController) UpdateCate

func (this *ManagerController) UpdateCate()

更新分类字段内容

func (*ManagerController) UpdateCateIcon

func (this *ManagerController) UpdateCateIcon()

更新分类的图标

func (this *ManagerController) UpdateFriendlink()

更新友链

func (*ManagerController) UpdateMemberStatus

func (this *ManagerController) UpdateMemberStatus()

更新用户状态.

func (*ManagerController) Users

func (this *ManagerController) Users()

用户列表.

type RecordController

type RecordController struct {
	BaseController
}

func (*RecordController) Clear

func (this *RecordController) Clear()

重置阅读进度(清空阅读历史)

func (*RecordController) Delete

func (this *RecordController) Delete()

删除单条阅读历史

func (*RecordController) List

func (this *RecordController) List()

获取书签列表

func (*RecordController) Prepare

func (this *RecordController) Prepare()

type SearchController

type SearchController struct {
	BaseController
}

func (*SearchController) Index

func (this *SearchController) Index()

type SettingController

type SettingController struct {
	BaseController
}

func (*SettingController) Index

func (this *SettingController) Index()

基本信息

func (*SettingController) Password

func (this *SettingController) Password()

修改密码

func (*SettingController) Qrcode

func (this *SettingController) Qrcode()

二维码

func (*SettingController) Star

func (this *SettingController) Star()

收藏

func (*SettingController) Upload

func (this *SettingController) Upload()

Upload 上传图片

type Sort

type Sort struct {
	Id        int
	Pid       int
	SortOrder int
	Identify  string
}

排序

type UserController

type UserController struct {
	BaseController
	UcenterMember models.Member
}

func (*UserController) Collection

func (this *UserController) Collection()

收藏

func (*UserController) Fans

func (this *UserController) Fans()

粉丝和关注

func (*UserController) Follow

func (this *UserController) Follow()

关注

func (*UserController) Index

func (this *UserController) Index()

首页

func (*UserController) NoteList

func (this *UserController) NoteList()

笔记列表

func (*UserController) Prepare

func (this *UserController) Prepare()

Jump to

Keyboard shortcuts

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