mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-01 14:28:49 +01:00
🎨 增加批量移除本地 kv 存储接口
This commit is contained in:
parent
a5d0a6afae
commit
0ef18f753e
2 changed files with 1 additions and 26 deletions
|
|
@ -118,36 +118,12 @@ func removeLocalStorageVals(c *gin.Context) {
|
|||
}
|
||||
|
||||
app := arg["app"].(string)
|
||||
evt := util.NewCmdResult("removeLocalStorageVal", 0, util.PushModeBroadcastMainExcludeSelfApp)
|
||||
evt := util.NewCmdResult("removeLocalStorageVals", 0, util.PushModeBroadcastMainExcludeSelfApp)
|
||||
evt.AppId = app
|
||||
evt.Data = map[string]interface{}{"keys": keys}
|
||||
util.PushEvent(evt)
|
||||
}
|
||||
|
||||
func removeLocalStorageVal(c *gin.Context) {
|
||||
ret := gulu.Ret.NewResult()
|
||||
defer c.JSON(http.StatusOK, ret)
|
||||
|
||||
arg, ok := util.JsonArg(c, ret)
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
|
||||
key := arg["key"].(string)
|
||||
err := model.RemoveLocalStorageVals([]string{key})
|
||||
if nil != err {
|
||||
ret.Code = -1
|
||||
ret.Msg = err.Error()
|
||||
return
|
||||
}
|
||||
|
||||
app := arg["app"].(string)
|
||||
evt := util.NewCmdResult("removeLocalStorageVal", 0, util.PushModeBroadcastMainExcludeSelfApp)
|
||||
evt.AppId = app
|
||||
evt.Data = map[string]interface{}{"key": key}
|
||||
util.PushEvent(evt)
|
||||
}
|
||||
|
||||
func setLocalStorageVal(c *gin.Context) {
|
||||
ret := gulu.Ret.NewResult()
|
||||
defer c.JSON(http.StatusOK, ret)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue