controllers

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2021 License: GPL-2.0, GPL-2.0-or-later Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthInterceptor

func AuthInterceptor(c *revel.Controller) revel.Result

func InitService

func InitService()

最外层init.go调用 获取service, 单例

Types

type Album

type Album struct {
	BaseController
}

Album controller

func (Album) AddAlbum

func (c Album) AddAlbum(name string) revel.Result

add album

func (Album) DeleteAlbum

func (c Album) DeleteAlbum(albumId string) revel.Result

func (Album) GetAlbums

func (c Album) GetAlbums() revel.Result

all albums by userId

func (Album) Index

func (c Album) Index() revel.Result

图片管理, iframe

func (Album) UpdateAlbum

func (c Album) UpdateAlbum(albumId, name string) revel.Result

update alnum name

type Attach

type Attach struct {
	BaseController
}

附件

func (Attach) DeleteAttach

func (c Attach) DeleteAttach(attachId string) revel.Result

删除附件

func (Attach) Download

func (c Attach) Download(attachId string) revel.Result

下载附件 权限判断

func (Attach) DownloadAll

func (c Attach) DownloadAll(noteId string) revel.Result

func (Attach) GetAttachs

func (c Attach) GetAttachs(noteId string) revel.Result

get all attachs by noteId

func (Attach) UploadAttach

func (c Attach) UploadAttach(noteId string) revel.Result

上传附件

type Auth

type Auth struct {
	BaseController
}

func (Auth) Demo

func (c Auth) Demo() revel.Result

体验一下

func (Auth) DoFindPassword

func (c Auth) DoFindPassword(email string) revel.Result

func (Auth) DoLogin

func (c Auth) DoLogin(email, pwd string, captcha string) revel.Result

func (Auth) DoRegister

func (c Auth) DoRegister(email, pwd, iu string) revel.Result

func (Auth) FindPassword

func (c Auth) FindPassword() revel.Result

-------- 找回密码

func (Auth) FindPassword2

func (c Auth) FindPassword2(token string) revel.Result

点击链接后, 先验证之

func (Auth) FindPasswordUpdate

func (c Auth) FindPasswordUpdate(token, pwd string) revel.Result

找回密码修改密码

func (Auth) Login

func (c Auth) Login(email, from string) revel.Result

-------- 登录

func (Auth) Logout

func (c Auth) Logout() revel.Result

注销

func (Auth) Register

func (c Auth) Register(from, iu string) revel.Result

-------- 注册

type BaseController

type BaseController struct {
	*revel.Controller
}

公用Controller, 其它Controller继承它

func (BaseController) ClearSession

func (c BaseController) ClearSession()

func (BaseController) E404

func (c BaseController) E404() revel.Result

-------------

func (BaseController) GetEmail

func (c BaseController) GetEmail() string

func (BaseController) GetObjectUserId

func (c BaseController) GetObjectUserId() bson.ObjectId

func (BaseController) GetPage

func (c BaseController) GetPage() int

得到第几页

func (BaseController) GetSession

func (c BaseController) GetSession(key string) string

这里的session都是cookie中的, 与数据库session无关

func (BaseController) GetTotalPage

func (c BaseController) GetTotalPage(page, count int) int

func (BaseController) GetUserAndBlogUrl

func (c BaseController) GetUserAndBlogUrl() info.UserAndBlogUrl

func (BaseController) GetUserId

func (c BaseController) GetUserId() string

func (BaseController) GetUserInfo

func (c BaseController) GetUserInfo() info.User

得到用户信息

func (BaseController) GetUsername

func (c BaseController) GetUsername() string

func (BaseController) Has

func (c BaseController) Has(key string) bool

判断是否含有某参数

func (BaseController) HasLogined

func (c BaseController) HasLogined() bool

是否已登录

func (BaseController) Json

func (c BaseController) Json(i interface{}) string

返回json

func (*BaseController) Message

func (c *BaseController) Message(message string, args ...interface{}) (value string)

覆盖revel.Message

func (BaseController) RenderRe

func (c BaseController) RenderRe(re info.Re) revel.Result

json, result 为了msg msg-v1-v2-v3

func (BaseController) RenderTemplateStr

func (c BaseController) RenderTemplateStr(templatePath string) string

life 返回解析后的字符串, 只是为了解析模板得到字符串

func (BaseController) SetLocale

func (c BaseController) SetLocale() string

设置本地

func (BaseController) SetSession

func (c BaseController) SetSession(userInfo info.User)

func (BaseController) SetUserInfo

func (c BaseController) SetUserInfo() info.User

设置userInfo

func (BaseController) UpdateSession

func (c BaseController) UpdateSession(key, value string)

修改session

type Blog

type Blog struct {
	BaseController
}

func (Blog) Archives

func (c Blog) Archives(userIdOrEmail string, cateId string, year, month int) (re revel.Result)

归档

func (Blog) Cate

func (c Blog) Cate(userIdOrEmail string, notebookId string) (re revel.Result)

分类 /cate/xxxxxxxx?notebookId=1212

func (Blog) CommentPost

func (c Blog) CommentPost(noteId, content, toCommentId string, callback string) revel.Result

jsonp

func (Blog) DeleteComment

func (c Blog) DeleteComment(noteId, commentId string, callback string) revel.Result

jsonp

func (Blog) E

func (c Blog) E(userIdOrEmail, tag string) revel.Result

404

func (Blog) GetComments

func (c Blog) GetComments(noteId string, callback string) revel.Result

func (Blog) GetLikes

func (c Blog) GetLikes(noteId string, callback string) revel.Result

jsonP 我是否点过赞? 得到我的信息 所有点赞的用户列表 各个评论中是否我也点过赞?

func (Blog) GetLikesAndComments

func (c Blog) GetLikesAndComments(noteId, callback string) revel.Result

func (Blog) GetPostStat

func (c Blog) GetPostStat(noteId string) revel.Result

得到博客统计信息

func (Blog) IncReadNum

func (c Blog) IncReadNum(noteId string) revel.Result

func (Blog) Index

func (c Blog) Index(userIdOrEmail string) (re revel.Result)

func (Blog) LikeComment

func (c Blog) LikeComment(commentId string, callback string) revel.Result

jsonp

func (Blog) LikePost

func (c Blog) LikePost(noteId string, callback string) revel.Result

点赞, 要用jsonp

func (Blog) ListCateLatest

func (c Blog) ListCateLatest(notebookId, callback string) revel.Result

显示分类的最近博客, jsonp

func (Blog) Post

func (c Blog) Post(userIdOrEmail, noteId string) (re revel.Result)

func (Blog) Search

func (c Blog) Search(userIdOrEmail, keywords string) (re revel.Result)

搜索

func (Blog) Single

func (c Blog) Single(userIdOrEmail, singleId string) (re revel.Result)

func (Blog) Tag

func (c Blog) Tag(userIdOrEmail, tag string) (re revel.Result)

标签的文章页

func (Blog) Tags

func (c Blog) Tags(userIdOrEmail string) (re revel.Result)

type Ca

type Ca string

func (Ca) Apply

func (r Ca) Apply(req *revel.Request, resp *revel.Response)

type Captcha

type Captcha struct {
	BaseController
}

验证码服务

func (Captcha) Get

func (c Captcha) Get() revel.Result

type DragNotebooksInfo

type DragNotebooksInfo struct {
	CurNotebookId    string
	ParentNotebookId string
	Siblings         []string
}

调整notebooks, 可能是排序, 可能是移动到其它笔记本下

type File

type File struct {
	BaseController
}

首页

func (File) CopyHttpImage

func (c File) CopyHttpImage(src string) revel.Result

复制外网的图片 都要好好的计算大小

func (File) CopyImage

func (c File) CopyImage(userId, fileId, toUserId string) revel.Result

协作时复制图片到owner 需要计算对方大小

func (File) DeleteImage

func (c File) DeleteImage(fileId string) revel.Result

func (File) GetImages

func (c File) GetImages(albumId, key string, page int) revel.Result

get all images by userId with page

func (File) OutputImage

func (c File) OutputImage(noteId, fileId string) revel.Result

输出image 权限判断

func (File) PasteImage

func (c File) PasteImage(noteId string) revel.Result

拖拉上传, pasteImage noteId 是为了判断是否是协作的note, 如果是则需要复制一份到note owner中

func (File) UpdateImageTitle

func (c File) UpdateImageTitle(fileId, title string) revel.Result

func (File) UploadAvatar

func (c File) UploadAvatar() revel.Result

头像设置

func (c File) UploadBlogLogo() revel.Result

上传的是博客logo TODO logo不要设置权限, 另外的目录

func (File) UploadImageLeaui

func (c File) UploadImageLeaui(albumId string) revel.Result

leaui image plugin upload image

type Index

type Index struct {
	BaseController
}

func (Index) Default

func (c Index) Default() revel.Result

func (Index) Index

func (c Index) Index() revel.Result

leanote展示页, 没有登录的, 或已登录明确要进该页的

func (Index) Suggestion

func (c Index) Suggestion(addr, suggestion string) revel.Result

建议

type Note

type Note struct {
	BaseController
}

func (Note) CopyNote

func (c Note) CopyNote(noteIds []string, notebookId string) revel.Result

复制note

func (Note) CopySharedNote

func (c Note) CopySharedNote(noteIds []string, notebookId, fromUserId string) revel.Result

复制别人共享的笔记给我

func (Note) DeleteNote

func (c Note) DeleteNote(noteIds []string, isShared bool) revel.Result

删除note/ 删除别人共享给我的笔记 userId 是note.UserId

func (Note) DeleteTrash

func (c Note) DeleteTrash(noteId string) revel.Result

删除trash, 已弃用, 用DeleteNote

func (Note) ExportPdf

func (c Note) ExportPdf(noteId string) revel.Result

导出成PDF

func (Note) GetNoteAndContent

func (c Note) GetNoteAndContent(noteId string) revel.Result

得到note和内容

func (Note) GetNoteAndContentBySrc

func (c Note) GetNoteAndContentBySrc(src string) revel.Result

func (Note) GetNoteContent

func (c Note) GetNoteContent(noteId string) revel.Result

得到内容

func (Note) Index

func (c Note) Index(noteId, online string) revel.Result

笔记首页, 判断是否已登录 已登录, 得到用户基本信息(notebook, shareNotebook), 跳转到index.html中 否则, 转向登录页面

func (Note) ListNotes

func (c Note) ListNotes(notebookId string) revel.Result

首页, 判断是否已登录 已登录, 得到用户基本信息(notebook, shareNotebook), 跳转到index.html中 否则, 转向登录页面

func (Note) ListTrashNotes

func (c Note) ListTrashNotes() revel.Result

得到trash

func (Note) MoveNote

func (c Note) MoveNote(noteIds []string, notebookId string) revel.Result

移动note

func (Note) SearchNote

func (c Note) SearchNote(key string) revel.Result

------------ search 通过title搜索

func (Note) SearchNoteByTags

func (c Note) SearchNoteByTags(tags []string) revel.Result

通过tags搜索

func (Note) SetNote2Blog

func (c Note) SetNote2Blog(noteIds []string, isBlog, isTop bool) revel.Result

设置/取消Blog; 置顶

func (Note) ToPdf

func (c Note) ToPdf(noteId, appKey string) revel.Result

生成PDF

func (Note) UpdateNoteOrContent

func (c Note) UpdateNoteOrContent(noteOrContent info.NoteOrContent) revel.Result

这里不能用json, 要用post

type NoteContentHistory

type NoteContentHistory struct {
	BaseController
}

func (NoteContentHistory) ListHistories

func (c NoteContentHistory) ListHistories(noteId string) revel.Result

得到list

type Notebook

type Notebook struct {
	BaseController
}

func (Notebook) AddNotebook

func (c Notebook) AddNotebook(notebookId, title, parentNotebookId string) revel.Result

添加notebook

func (Notebook) DeleteNotebook

func (c Notebook) DeleteNotebook(notebookId string) revel.Result

func (Notebook) DragNotebooks

func (c Notebook) DragNotebooks(data string) revel.Result

传过来的data是JSON.stringfy数据

func (Notebook) GetNotebooks

func (c Notebook) GetNotebooks() revel.Result

得到用户的所有笔记本

func (Notebook) Index

func (c Notebook) Index(notebook info.Notebook, i int, name string) revel.Result

func (Notebook) SetNotebook2Blog

func (c Notebook) SetNotebook2Blog(notebookId string, isBlog bool) revel.Result

设置notebook <-> blog

func (Notebook) UpdateNotebookTitle

func (c Notebook) UpdateNotebookTitle(notebookId, title string) revel.Result

修改标题

type Preview

type Preview struct {
	Blog
}

func (Preview) Archives

func (c Preview) Archives(userIdOrEmail string, notebookId string, year, month int) revel.Result

func (Preview) Cate

func (c Preview) Cate(userIdOrEmail, notebookId string) revel.Result

func (Preview) Index

func (c Preview) Index(userIdOrEmail string, themeId string) revel.Result

func (Preview) Post

func (c Preview) Post(userIdOrEmail, noteId string) revel.Result

func (Preview) Search

func (c Preview) Search(userIdOrEmail, keywords string) revel.Result

func (Preview) Single

func (c Preview) Single(userIdOrEmail, singleId string) revel.Result

func (Preview) Tag

func (c Preview) Tag(userIdOrEmail, tag string) revel.Result

func (Preview) Tags

func (c Preview) Tags(userIdOrEmail string) revel.Result

type Share

type Share struct {
	BaseController
}

func (Share) AddShareNote

func (c Share) AddShareNote(noteId string, emails []string, perm int) revel.Result

添加共享note

func (Share) AddShareNoteGroup

func (c Share) AddShareNoteGroup(noteId, groupId string, perm int) revel.Result

将笔记分享给分组

func (Share) AddShareNotebook

func (c Share) AddShareNotebook(notebookId string, emails []string, perm int) revel.Result

添加共享notebook

func (Share) AddShareNotebookGroup

func (c Share) AddShareNotebookGroup(notebookId, groupId string, perm int) revel.Result

将笔记分享给分组

func (Share) DeleteShareNote

func (c Share) DeleteShareNote(noteId string, toUserId string) revel.Result

--------------- 删除share note

func (Share) DeleteShareNoteBySharedUser

func (c Share) DeleteShareNoteBySharedUser(noteId string, fromUserId string) revel.Result

删除share note, 被共享方删除

func (Share) DeleteShareNoteGroup

func (c Share) DeleteShareNoteGroup(noteId, groupId string) revel.Result

删除

func (Share) DeleteShareNotebook

func (c Share) DeleteShareNotebook(notebookId string, toUserId string) revel.Result

删除share notebook

func (Share) DeleteShareNotebookBySharedUser

func (c Share) DeleteShareNotebookBySharedUser(notebookId string, fromUserId string) revel.Result

删除share notebook, 被共享方删除

func (Share) DeleteShareNotebookGroup

func (c Share) DeleteShareNotebookGroup(notebookId, groupId string) revel.Result

删除

func (Share) DeleteUserShareNoteAndNotebook

func (c Share) DeleteUserShareNoteAndNotebook(fromUserId string) revel.Result

删除fromUserId分享给我的所有note, notebook

func (Share) GetShareNoteContent

func (c Share) GetShareNoteContent(noteId, sharedUserId string) revel.Result

得到内容 sharedUserId 是谁的笔记

func (Share) ListNoteShareUserInfo

func (c Share) ListNoteShareUserInfo(noteId string) revel.Result

查看note的分享信息 分享给了哪些用户和权限 ShareNotes表 userId = me, noteId = ... 还要查看该note的notebookId分享的信息

func (Share) ListNotebookShareUserInfo

func (c Share) ListNotebookShareUserInfo(notebookId string) revel.Result

func (Share) ListShareNotes

func (c Share) ListShareNotes(notebookId, userId string) revel.Result

得到notes userId 该userId分享给我的

func (Share) UpdateShareNoteGroupPerm

func (c Share) UpdateShareNoteGroupPerm(noteId, groupId string, perm int) revel.Result

更新, 也是一样, 先删后加

func (Share) UpdateShareNotePerm

func (c Share) UpdateShareNotePerm(noteId string, perm int, toUserId string) revel.Result

------------ 改变share note 权限

func (Share) UpdateShareNotebookGroupPerm

func (c Share) UpdateShareNotebookGroupPerm(notebookId, groupId string, perm int) revel.Result

更新, 也是一样, 先删后加

func (Share) UpdateShareNotebookPerm

func (c Share) UpdateShareNotebookPerm(notebookId string, perm int, toUserId string) revel.Result

改变share notebook 权限

type Tag

type Tag struct {
	BaseController
}

func (Tag) DeleteTag

func (c Tag) DeleteTag(tag string) revel.Result

删除标签

func (Tag) UpdateTag

func (c Tag) UpdateTag(tag string) revel.Result

更新Tag

type User

type User struct {
	BaseController
}

func (User) Account

func (c User) Account(tab int) revel.Result

func (User) ActiveEmail

func (c User) ActiveEmail(token string) revel.Result

注册后激活邮箱

func (User) ReSendActiveEmail

func (c User) ReSendActiveEmail() revel.Result

重新发送激活邮件

func (User) SendRegisterEmail

func (c User) SendRegisterEmail(content, toEmail string) revel.Result

发送邀请链接

func (User) UpdateColumnWidth

func (c User) UpdateColumnWidth(notebookWidth, noteListWidth, mdEditorWidth int) revel.Result

----------------- 用户偏爱

func (User) UpdateEmail

func (c User) UpdateEmail(token string) revel.Result

通过点击链接 修改邮箱

func (User) UpdateLeftIsMin

func (c User) UpdateLeftIsMin(leftIsMin bool) revel.Result

func (User) UpdatePwd

func (c User) UpdatePwd(oldPwd, pwd string) revel.Result

修改密码

func (User) UpdateTheme

func (c User) UpdateTheme(theme string) revel.Result

更新主题

func (User) UpdateUsername

func (c User) UpdateUsername(username string) revel.Result

修改用户名, 需要重置session

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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