controllers

package
v0.0.0-...-09a086b Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2023 License: Apache-2.0, Apache-2.0 Imports: 44 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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 用户登录与注册.

func (*AccountController) Note

func (c *AccountController) Note()

记录笔记

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

func (c *BaseController) Crawl()

内容采集

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

func (c *BaseController) Login()

@Title Login

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

func (c *BaseController) Prepare()

Prepare 预处理.

func (*BaseController) SetFollow

func (c *BaseController) SetFollow()

关注或取消关注

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

func (*BaseController) Signup

func (c *BaseController) Signup()

@Title Signup

func (*BaseController) Sitemap

func (c *BaseController) Sitemap()

站点地图

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

func (this *BookController) GitPull()

从Git仓库拉取书籍

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

func (this *BookController) Replace()

替换字符串

func (*BookController) SaveBook

func (this *BookController) SaveBook()

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

func (this *CateController) Index()

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

func (this *DocumentController) Abort404(bookName, bookLink string)

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

Prepare

type LocalhostController

type LocalhostController struct {
	BaseController
}

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

func (*LocalhostController) Prepare

func (c *LocalhostController) Prepare()

func (*LocalhostController) RenderCover

func (this *LocalhostController) RenderCover()

渲染生成封面截图

func (*LocalhostController) RenderMarkdown

func (this *LocalhostController) RenderMarkdown()

渲染markdown. 根据文档id来。

type ManagerController

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

添加友链

func (*ManagerController) AddTags

func (this *ManagerController) AddTags()

func (*ManagerController) Ads

func (this *ManagerController) Ads()

广告管理

func (*ManagerController) AttachDelete

func (this *ManagerController) AttachDelete()

删除附件.

func (*ManagerController) AttachDetailed

func (this *ManagerController) AttachDetailed()

附件详情.

func (*ManagerController) AttachList

func (this *ManagerController) AttachList()

附件列表.

func (*ManagerController) Banners

func (this *ManagerController) Banners()

func (*ManagerController) Books

func (this *ManagerController) Books()

书籍列表.

func (*ManagerController) Category

func (this *ManagerController) Category()

分类管理

func (*ManagerController) ChangeMemberRole

func (this *ManagerController) ChangeMemberRole()

变更用户权限.

func (*ManagerController) ClearComments

func (this *ManagerController) ClearComments()

func (*ManagerController) Comments

func (this *ManagerController) Comments()

func (*ManagerController) CreateMember

func (this *ManagerController) CreateMember()

添加用户.

func (*ManagerController) CreateToken

func (this *ManagerController) CreateToken()

CreateToken 创建访问来令牌.

func (*ManagerController) DelAds

func (this *ManagerController) DelAds()

func (*ManagerController) DelCate

func (this *ManagerController) DelCate()

删除分类

func (this *ManagerController) DelFriendlink()

删除友链

func (*ManagerController) DelTags

func (this *ManagerController) DelTags()

func (*ManagerController) DeleteBanner

func (this *ManagerController) DeleteBanner()

func (*ManagerController) DeleteBook

func (this *ManagerController) DeleteBook()

删除书籍.

func (*ManagerController) DeleteComment

func (this *ManagerController) DeleteComment()

func (*ManagerController) DeleteMember

func (this *ManagerController) DeleteMember()

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

func (*ManagerController) DeleteSubmitBook

func (this *ManagerController) DeleteSubmitBook()

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

func (this *ManagerController) RebuildAllIndex()

重建全量索引

func (*ManagerController) Seo

func (this *ManagerController) Seo()

SEO管理

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

func (this *ManagerController) Tags()

标签管理.

func (*ManagerController) Transfer

func (this *ManagerController) Transfer()

Transfer 转让书籍.

func (*ManagerController) UpdateAds

func (this *ManagerController) UpdateAds()

func (*ManagerController) UpdateBanner

func (this *ManagerController) UpdateBanner()

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

func (*ManagerController) Users

func (this *ManagerController) Users()

用户列表.

type RankController

type RankController struct {
	BaseController
}

func (*RankController) Index

func (this *RankController) Index()

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

func (this *SearchController) Result()

搜索结果页

func (*SearchController) Search

func (this *SearchController) Search()

搜索首页

type SettingController

type SettingController struct {
	BaseController
}

func (*SettingController) Index

func (this *SettingController) Index()

基本信息

func (*SettingController) Qrcode

func (this *SettingController) Qrcode()

二维码

func (*SettingController) Star

func (this *SettingController) Star()

收藏

type Sort

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

排序

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

func (this *StaticController) StaticFile()

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

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

func (this *UserController) Prepare()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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