Documentation
¶
Index ¶
- Constants
- func AuthInterceptor(c *revel.Controller) revel.Result
- func InitService()
- type ApiAuth
- type ApiBaseContrller
- type ApiFile
- type ApiNote
- func (c ApiNote) AddNote(noteOrContent info.ApiNote) revel.Result
- func (c ApiNote) DeleteTrash(noteId string, usn int) revel.Result
- func (c ApiNote) ExportPdf(noteId string) revel.Result
- func (c ApiNote) GetNote(noteId string) revel.Result
- func (c ApiNote) GetNoteAndContent(noteId string) revel.Result
- func (c ApiNote) GetNoteContent(noteId string) revel.Result
- func (c ApiNote) GetNotes(notebookId string) revel.Result
- func (c ApiNote) GetSyncNotes(afterUsn, maxEntry int) revel.Result
- func (c ApiNote) GetTrashNotes() revel.Result
- func (c ApiNote) UpdateNote(noteOrContent info.ApiNote) revel.Result
- type ApiNotebook
- func (c ApiNotebook) AddNotebook(title, parentNotebookId string, seq int) revel.Result
- func (c ApiNotebook) DeleteNotebook(notebookId string, usn int) revel.Result
- func (c ApiNotebook) GetNotebooks() revel.Result
- func (c ApiNotebook) GetSyncNotebooks(afterUsn, maxEntry int) revel.Result
- func (c ApiNotebook) UpdateNotebook(notebookId, title, parentNotebookId string, seq, usn int) revel.Result
- type ApiTag
- type ApiUser
Constants ¶
View Source
const ( S_DEFAULT = iota // 0 S_NOT_LOGIN // 1 S_WRONG_USERNAME_PASSWORD // 2 S_WRONG_CAPTCHA // 3 S_NEED_CAPTCHA // 4 S_NOT_OPEN_REGISTER // 4 )
状态
Variables ¶
This section is empty.
Functions ¶
func AuthInterceptor ¶
func AuthInterceptor(c *revel.Controller) revel.Result
这里得到token, 若不是login, logout等公用操作, 必须验证是否已登录
Types ¶
type ApiAuth ¶
type ApiAuth struct {
ApiBaseContrller
}
type ApiBaseContrller ¶
type ApiBaseContrller struct {
controllers.BaseController // 不能用*BaseController
}
公用Controller, 其它Controller继承它
type ApiNote ¶
type ApiNote struct {
ApiBaseContrller
}
func (ApiNote) DeleteTrash ¶
删除trash
func (ApiNote) GetNote ¶
get Note [OK]
{
"NoteId": "550c0bee2ec82a2eb5000000",
"NotebookId": "54a1676399c37b1c77000004",
"UserId": "54a1676399c37b1c77000002",
"Title": "asdfadsf--=",
"Desc": "",
"Tags": [
],
"Abstract": "",
"Content": "",
"IsMarkdown": false,
"IsBlog": false,
"IsTrash": false,
"Usn": 8,
"Files": [
{
"FileId": "551975d599c37b970f000000",
"LocalFileId": "",
"Type": "",
"Title": "",
"HasBody": false,
"IsAttach": false
},
{
"FileId": "551975de99c37b970f000001",
"LocalFileId": "",
"Type": "doc",
"Title": "李铁-print-en.doc",
"HasBody": false,
"IsAttach": true
},
{
"FileId": "551975de99c37b970f000002",
"LocalFileId": "",
"Type": "doc",
"Title": "李铁-print.doc",
"HasBody": false,
"IsAttach": true
}
],
"CreatedTime": "2015-03-20T20:00:52.463+08:00",
"UpdatedTime": "2015-03-31T00:12:44.967+08:00",
"PublicTime": "2015-03-20T20:00:52.463+08:00"
}
func (ApiNote) GetNoteAndContent ¶
得到note和内容 [OK]
func (ApiNote) GetSyncNotes ¶
获取同步的笔记 > afterUsn的笔记 无Desc, Abstract, 有Files
{
"NoteId": "55195fa199c37b79be000005",
"NotebookId": "55195fa199c37b79be000002",
"UserId": "55195fa199c37b79be000001",
"Title": "Leanote语法Leanote语法Leanote语法Leanote语法Leanote语法",
"Desc": "",
"Tags": null,
"Abstract": "",
"Content": "",
"IsMarkdown": true,
"IsBlog": false,
"IsTrash": false,
"Usn": 5,
"Files": [],
"CreatedTime": "2015-03-30T22:37:21.695+08:00",
"UpdatedTime": "2015-03-30T22:37:21.724+08:00",
"PublicTime": "2015-03-30T22:37:21.695+08:00"
}
type ApiNotebook ¶
type ApiNotebook struct {
ApiBaseContrller
}
func (ApiNotebook) AddNotebook ¶
func (c ApiNotebook) AddNotebook(title, parentNotebookId string, seq int) revel.Result
添加notebook [OK]
func (ApiNotebook) DeleteNotebook ¶
func (c ApiNotebook) DeleteNotebook(notebookId string, usn int) revel.Result
删除笔记本 [OK]
func (ApiNotebook) GetNotebooks ¶
func (c ApiNotebook) GetNotebooks() revel.Result
得到用户的所有笔记本 [OK] info.SubNotebooks
func (ApiNotebook) GetSyncNotebooks ¶
func (c ApiNotebook) GetSyncNotebooks(afterUsn, maxEntry int) revel.Result
获取同步的笔记本 [OK] > afterUsn的笔记 返回 {ChunkHighUsn: 本下最大的usn, 借此可以知道是否还有, Notebooks: []}
func (ApiNotebook) UpdateNotebook ¶
func (c ApiNotebook) UpdateNotebook(notebookId, title, parentNotebookId string, seq, usn int) revel.Result
修改笔记 [OK]
type ApiTag ¶
type ApiTag struct {
ApiBaseContrller
}
type ApiUser ¶
type ApiUser struct {
ApiBaseContrller
}
func (ApiUser) UpdateLogo ¶
头像设置 参数file=文件 成功返回{Logo: url} 头像新url [OK]
Click to show internal directories.
Click to hide internal directories.