client/docs/cloud/note.md

335 lines
8.4 KiB
Markdown

# Note
笔记服务
- [/cloud.Note/CreateNote](#cloudnotecreatenote)
- [/cloud.Note/GetNote](#cloudnotegetnote)
- [/cloud.Note/UpdateNote](#cloudnoteupdatenote)
- [/cloud.Note/DeleteNote](#cloudnotedeletenote)
- [/cloud.Note/ListNotes](#cloudnotelistnotes)
- [/cloud.Note/TogglePin](#cloudnotetogglepin)
- [/cloud.Note/IncrementViews](#cloudnoteincrementviews)
- [/cloud.Note/SearchNotes](#cloudnotesearchnotes)
- [/cloud.Note/InsertAttachment](#cloudnoteinsertattachment)
- [/cloud.Note/DeleteAttachment](#cloudnotedeleteattachment)
## /cloud.Note/CreateNote
创建笔记
### Request
```javascript
{
cloud_id: "0", // type<uint64>
cloud_identity: "", // type<string>
title: "", // type<string>, 标题
content: "", // type<string>, 内容
category: "", // type<string>, 分类
tags: "", // type<string>, 标签,逗号分隔
is_markdown: false, // type<bool>, 是否是markdown格式
is_pinned: false, // type<bool>, 是否是置顶
is_private: false, // type<bool>, 是否是私有
}
```
### Reply
```javascript
{
code: 0, // type<int32>, 状态码
message: "", // type<string>, 状态说明
details: "", // type<string>, 数据
timeseq: "0", // type<int64>, 响应时间序列
}
```
## /cloud.Note/GetNote
获取笔记详情
### Request
```javascript
{
id: "0", // type<int64>, 唯一ID
identity: "", // type<string>, 唯一码
}
```
### Reply
```javascript
{
id: "0", // type<uint64>
identity: "", // type<string>
title: "", // type<string>, 标题
content: "", // type<string>, 内容
category: "", // type<string>, 分类
tags: "", // type<string>, 标签,逗号分隔
is_markdown: false, // type<bool>, 是否是markdown格式
is_pinned: false, // type<bool>, 是否是置顶
is_private: false, // type<bool>, 是否是私有
views: 0, // type<int32>, 浏览次数
created_at: "", // type<string>
updated_at: "", // type<string>
// 关联关系
attachments: [{
id: "0", // type<uint64>
note_id: "0", // type<uint64>, 笔记ID
file_name: "", // type<string>, 文件名
file_path: "", // type<string>, 文件路径
file_size: "0", // type<int64>, 文件大小
mime_type: "", // type<string>, 文件类型
created_at: "", // type<string>, 创建时间
}], // list<NoteAttachmentItem>
}
```
## /cloud.Note/UpdateNote
更新笔记
### Request
```javascript
{
id: "0", // type<uint64>
identity: "", // type<string>
title: "", // type<string>, 标题
content: "", // type<string>, 内容
category: "", // type<string>, 分类
tags: "", // type<string>, 标签,逗号分隔
is_markdown: false, // type<bool>, 是否是markdown格式
is_pinned: false, // type<bool>, 是否是置顶
is_private: false, // type<bool>, 是否是私有
views: 0, // type<int32>, 浏览次数
created_at: "", // type<string>
updated_at: "", // type<string>
// 关联关系
attachments: [{
id: "0", // type<uint64>
note_id: "0", // type<uint64>, 笔记ID
file_name: "", // type<string>, 文件名
file_path: "", // type<string>, 文件路径
file_size: "0", // type<int64>, 文件大小
mime_type: "", // type<string>, 文件类型
created_at: "", // type<string>, 创建时间
}], // list<NoteAttachmentItem>
}
```
### Reply
```javascript
{
code: 0, // type<int32>, 状态码
message: "", // type<string>, 状态说明
details: "", // type<string>, 数据
timeseq: "0", // type<int64>, 响应时间序列
}
```
## /cloud.Note/DeleteNote
删除笔记
### Request
```javascript
{
id: "0", // type<int64>, 唯一ID
identity: "", // type<string>, 唯一码
}
```
### Reply
```javascript
{
code: 0, // type<int32>, 状态码
message: "", // type<string>, 状态说明
details: "", // type<string>, 数据
timeseq: "0", // type<int64>, 响应时间序列
}
```
## /cloud.Note/ListNotes
获取笔记列表
### Request
```javascript
{
page_no: "0", // type<int64>, 页数
page_size: "0", // type<int64>, 每页记录数
params: {
"": ""
}, // map<string,string>, 条件参数,key=val,eg key:category_id=?,vlaue=11
}
```
### Reply
```javascript
{
notes: [{
id: "0", // type<uint64>
identity: "", // type<string>
title: "", // type<string>, 标题
content: "", // type<string>, 内容
category: "", // type<string>, 分类
tags: "", // type<string>, 标签,逗号分隔
is_markdown: false, // type<bool>, 是否是markdown格式
is_pinned: false, // type<bool>, 是否是置顶
is_private: false, // type<bool>, 是否是私有
views: 0, // type<int32>, 浏览次数
created_at: "", // type<string>
updated_at: "", // type<string>
// 关联关系
attachments: [{
id: "0", // type<uint64>
note_id: "0", // type<uint64>, 笔记ID
file_name: "", // type<string>, 文件名
file_path: "", // type<string>, 文件路径
file_size: "0", // type<int64>, 文件大小
mime_type: "", // type<string>, 文件类型
created_at: "", // type<string>, 创建时间
}], // list<NoteAttachmentItem>
}], // list<CloudNoteItem>
total: "0", // type<int64>
}
```
## /cloud.Note/TogglePin
置顶/取消置顶笔记
### Request
```javascript
{
id: "0", // type<uint64>
is_pinned: false, // type<bool>
}
```
### Reply
```javascript
{
code: 0, // type<int32>, 状态码
message: "", // type<string>, 状态说明
details: "", // type<string>, 数据
timeseq: "0", // type<int64>, 响应时间序列
}
```
## /cloud.Note/IncrementViews
增加浏览次数
### Request
```javascript
{
id: "0", // type<int64>, 唯一ID
identity: "", // type<string>, 唯一码
}
```
### Reply
```javascript
{
code: 0, // type<int32>, 状态码
message: "", // type<string>, 状态说明
details: "", // type<string>, 数据
timeseq: "0", // type<int64>, 响应时间序列
}
```
## /cloud.Note/SearchNotes
搜索笔记
### Request
```javascript
{
page_no: "0", // type<int64>, 页数
page_size: "0", // type<int64>, 每页记录数
params: {
"": ""
}, // map<string,string>, 条件参数,key=val,eg key:category_id=?,vlaue=11
}
```
### Reply
```javascript
{
notes: [{
id: "0", // type<uint64>
identity: "", // type<string>
title: "", // type<string>, 标题
content: "", // type<string>, 内容
category: "", // type<string>, 分类
tags: "", // type<string>, 标签,逗号分隔
is_markdown: false, // type<bool>, 是否是markdown格式
is_pinned: false, // type<bool>, 是否是置顶
is_private: false, // type<bool>, 是否是私有
views: 0, // type<int32>, 浏览次数
created_at: "", // type<string>
updated_at: "", // type<string>
// 关联关系
attachments: [{
id: "0", // type<uint64>
note_id: "0", // type<uint64>, 笔记ID
file_name: "", // type<string>, 文件名
file_path: "", // type<string>, 文件路径
file_size: "0", // type<int64>, 文件大小
mime_type: "", // type<string>, 文件类型
created_at: "", // type<string>, 创建时间
}], // list<NoteAttachmentItem>
}], // list<CloudNoteItem>
total: "0", // type<int64>
}
```
## /cloud.Note/InsertAttachment
上传附件
### Request
```javascript
{
id: "0", // type<uint64>
note_id: "0", // type<uint64>, 笔记ID
file_name: "", // type<string>, 文件名
file_path: "", // type<string>, 文件路径
file_size: "0", // type<int64>, 文件大小
mime_type: "", // type<string>, 文件类型
created_at: "", // type<string>, 创建时间
}
```
### Reply
```javascript
{
code: 0, // type<int32>, 状态码
message: "", // type<string>, 状态说明
details: "", // type<string>, 数据
timeseq: "0", // type<int64>, 响应时间序列
}
```
## /cloud.Note/DeleteAttachment
删除附件
### Request
```javascript
{
id: "0", // type<int64>, 唯一ID
identity: "", // type<string>, 唯一码
}
```
### Reply
```javascript
{
code: 0, // type<int32>, 状态码
message: "", // type<string>, 状态说明
details: "", // type<string>, 数据
timeseq: "0", // type<int64>, 响应时间序列
}
```