🎨 增加批量移除本地 kv 存储接口

This commit is contained in:
Liang Ding 2023-03-22 15:22:30 +08:00
parent a5d0a6afae
commit 0ef18f753e
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
2 changed files with 1 additions and 26 deletions

View file

@ -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)