mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-02 05:02:29 +08:00
🎨 提供消息提示推送 API 接口 https://github.com/siyuan-note/siyuan/issues/5102
This commit is contained in:
parent
2641a0ac07
commit
d5a2de5676
61
API.md
61
API.md
@ -35,10 +35,13 @@
|
|||||||
* [Templates](#Templates)
|
* [Templates](#Templates)
|
||||||
* [Render a template](#Render-a-template)
|
* [Render a template](#Render-a-template)
|
||||||
* [File](#File)
|
* [File](#File)
|
||||||
* [Get File](#Get-file)
|
* [Get file](#Get-file)
|
||||||
* [Put File](#Put-file)
|
* [Put file](#Put-file)
|
||||||
* [Export](#Export)
|
* [Export](#Export)
|
||||||
* [Export Markdown](#Export-Markdown)
|
* [Export Markdown](#Export-Markdown)
|
||||||
|
* [Notification](#Notification)
|
||||||
|
* [Push message](#Push-message)
|
||||||
|
* [Push error message](#Push-error-message)
|
||||||
* [System](#System)
|
* [System](#System)
|
||||||
* [Get boot progress](#Get-boot-progress)
|
* [Get boot progress](#Get-boot-progress)
|
||||||
* [Get system version](#Get-system-version)
|
* [Get system version](#Get-system-version)
|
||||||
@ -846,6 +849,60 @@ View API token in <kbd>Settings - About</kbd>, request header: `Authorization: T
|
|||||||
* `hPath`: human-readable path
|
* `hPath`: human-readable path
|
||||||
* `content`: Markdown content
|
* `content`: Markdown content
|
||||||
|
|
||||||
|
## Notification
|
||||||
|
|
||||||
|
### Push message
|
||||||
|
|
||||||
|
* `/api/notification/pushMsg`
|
||||||
|
* Parameters
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"msg": "test",
|
||||||
|
"timeout": 7000
|
||||||
|
}
|
||||||
|
```
|
||||||
|
* `timeout`: The duration of the message display in milliseconds. This field can be omitted, the default is 7000
|
||||||
|
milliseconds
|
||||||
|
* Return value
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"code": 0,
|
||||||
|
"msg": "",
|
||||||
|
"data": {
|
||||||
|
"id": "62jtmqi"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
* `id`: Message ID
|
||||||
|
|
||||||
|
### Push error message
|
||||||
|
|
||||||
|
* `/api/notification/pushErrMsg`
|
||||||
|
* Parameters
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"msg": "test",
|
||||||
|
"timeout": 7000
|
||||||
|
}
|
||||||
|
```
|
||||||
|
* `timeout`: The duration of the message display in milliseconds. This field can be omitted, the default is 7000
|
||||||
|
milliseconds
|
||||||
|
* Return value
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"code": 0,
|
||||||
|
"msg": "",
|
||||||
|
"data": {
|
||||||
|
"id": "qc9znut"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
* `id`:Message ID
|
||||||
|
|
||||||
## System
|
## System
|
||||||
|
|
||||||
### Get boot progress
|
### Get boot progress
|
||||||
|
59
API_zh_CN.md
59
API_zh_CN.md
@ -34,11 +34,14 @@
|
|||||||
* [执行 SQL 查询](#执行-SQL-查询)
|
* [执行 SQL 查询](#执行-SQL-查询)
|
||||||
* [模板](#模板)
|
* [模板](#模板)
|
||||||
* [渲染模板](#渲染模板)
|
* [渲染模板](#渲染模板)
|
||||||
* [导出](#导出)
|
|
||||||
* [导出 Markdown 文本](#导出-markdown-文本)
|
|
||||||
* [文件](#文件)
|
* [文件](#文件)
|
||||||
* [获取文件](#获取文件)
|
* [获取文件](#获取文件)
|
||||||
* [写入文件](#写入文件)
|
* [写入文件](#写入文件)
|
||||||
|
* [导出](#导出)
|
||||||
|
* [导出 Markdown 文本](#导出-markdown-文本)
|
||||||
|
* [通知](#通知)
|
||||||
|
* [推送消息](#推送消息)
|
||||||
|
* [推送报错消息](#推送报错消息)
|
||||||
* [系统](#系统)
|
* [系统](#系统)
|
||||||
* [获取启动进度](#获取启动进度)
|
* [获取启动进度](#获取启动进度)
|
||||||
* [获取系统版本](#获取系统版本)
|
* [获取系统版本](#获取系统版本)
|
||||||
@ -842,6 +845,58 @@
|
|||||||
* `hPath`:人类可读的路径
|
* `hPath`:人类可读的路径
|
||||||
* `content`:Markdown 内容
|
* `content`:Markdown 内容
|
||||||
|
|
||||||
|
## 通知
|
||||||
|
|
||||||
|
### 推送消息
|
||||||
|
|
||||||
|
* `/api/notification/pushMsg`
|
||||||
|
* 参数
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"msg": "test",
|
||||||
|
"timeout": 7000
|
||||||
|
}
|
||||||
|
```
|
||||||
|
* `timeout`:消息持续显示时间,单位为毫秒。可以不传入该字段,默认为 7000 毫秒
|
||||||
|
* 返回值
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"code": 0,
|
||||||
|
"msg": "",
|
||||||
|
"data": {
|
||||||
|
"id": "62jtmqi"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
* `id`:消息 ID
|
||||||
|
|
||||||
|
### 推送报错消息
|
||||||
|
|
||||||
|
* `/api/notification/pushErrMsg`
|
||||||
|
* 参数
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"msg": "test",
|
||||||
|
"timeout": 7000
|
||||||
|
}
|
||||||
|
```
|
||||||
|
* `timeout`:消息持续显示时间,单位为毫秒。可以不传入该字段,默认为 7000 毫秒
|
||||||
|
* 返回值
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"code": 0,
|
||||||
|
"msg": "",
|
||||||
|
"data": {
|
||||||
|
"id": "qc9znut"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
* `id`:消息 ID
|
||||||
|
|
||||||
## 系统
|
## 系统
|
||||||
|
|
||||||
### 获取启动进度
|
### 获取启动进度
|
||||||
|
Loading…
Reference in New Issue
Block a user