mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-18 14:35:27 +01:00
🎨 localStorage 支持在多界面实例间同步 https://github.com/siyuan-note/siyuan/issues/6965
This commit is contained in:
parent
3adb7d9ad0
commit
95bb18afe1
12 changed files with 49 additions and 55 deletions
|
|
@ -24,45 +24,41 @@ import (
|
|||
type PushMode int
|
||||
|
||||
const (
|
||||
PushModeBroadcast PushMode = 0 // 所有应用所有会话广播
|
||||
PushModeSingleSelf PushMode = 1 // 自我应用会话单播
|
||||
PushModeBroadcastExcludeSelf PushMode = 2 // 非自我会话广播
|
||||
PushModeBroadcastExcludeSelfApp PushMode = 4 // 非自我应用所有会话广播
|
||||
PushModeBroadcastApp PushMode = 5 // 单个应用内所有会话广播
|
||||
PushModeBroadcastMainExcludeSelfApp PushMode = 6 // 非自我应用主会话广播
|
||||
PushModeNone PushMode = 10 // 不进行 reload
|
||||
PushModeBroadcast PushMode = 0 // 所有应用所有会话广播
|
||||
PushModeSingleSelf PushMode = 1 // 自我应用会话单播
|
||||
PushModeBroadcastExcludeSelf PushMode = 2 // 非自我会话广播
|
||||
PushModeBroadcastExcludeSelfApp PushMode = 4 // 非自我应用所有会话广播
|
||||
PushModeBroadcastApp PushMode = 5 // 单个应用内所有会话广播
|
||||
PushModeBroadcastMainExcludeSelfApp PushMode = 6 // 非自我应用主会话广播
|
||||
)
|
||||
|
||||
type Result struct {
|
||||
Cmd string `json:"cmd"`
|
||||
ReqId float64 `json:"reqId"`
|
||||
AppId string `json:"app"`
|
||||
SessionId string `json:"sid"`
|
||||
PushMode PushMode `json:"pushMode"`
|
||||
ReloadPushMode PushMode `json:"reloadPushMode"`
|
||||
Callback interface{} `json:"callback"`
|
||||
Code int `json:"code"`
|
||||
Msg string `json:"msg"`
|
||||
Data interface{} `json:"data"`
|
||||
Cmd string `json:"cmd"`
|
||||
ReqId float64 `json:"reqId"`
|
||||
AppId string `json:"app"`
|
||||
SessionId string `json:"sid"`
|
||||
PushMode PushMode `json:"pushMode"`
|
||||
Callback interface{} `json:"callback"`
|
||||
Code int `json:"code"`
|
||||
Msg string `json:"msg"`
|
||||
Data interface{} `json:"data"`
|
||||
}
|
||||
|
||||
func NewResult() *Result {
|
||||
return &Result{Cmd: "",
|
||||
ReqId: 0,
|
||||
PushMode: 0,
|
||||
ReloadPushMode: 0,
|
||||
Callback: "",
|
||||
Code: 0,
|
||||
Msg: "",
|
||||
Data: nil}
|
||||
ReqId: 0,
|
||||
PushMode: 0,
|
||||
Callback: "",
|
||||
Code: 0,
|
||||
Msg: "",
|
||||
Data: nil}
|
||||
}
|
||||
|
||||
func NewCmdResult(cmdName string, cmdId float64, pushMode, reloadPushMode PushMode) *Result {
|
||||
func NewCmdResult(cmdName string, cmdId float64, pushMode PushMode) *Result {
|
||||
ret := NewResult()
|
||||
ret.Cmd = cmdName
|
||||
ret.ReqId = cmdId
|
||||
ret.PushMode = pushMode
|
||||
ret.ReloadPushMode = reloadPushMode
|
||||
return ret
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue