1
0
mirror of https://shylinux.com/x/icebergs synced 2025-05-03 03:57:01 +08:00
This commit is contained in:
harveyshao 2021-11-10 15:53:10 +08:00
parent f0ce8e75ef
commit f25a2b4220

View File

@ -1,7 +1,11 @@
package wiki
import (
"os"
"strings"
ice "shylinux.com/x/icebergs"
"shylinux.com/x/icebergs/base/mdb"
"shylinux.com/x/icebergs/base/web"
kit "shylinux.com/x/toolkits"
)
@ -20,6 +24,10 @@ func init() {
web.UPLOAD: {Name: "upload", Help: "上传", Hand: func(m *ice.Message, arg ...string) {
_wiki_upload(m, m.CommandKey(), m.Option(kit.MDB_PATH))
}},
mdb.REMOVE: {Name: "remove", Help: "删除", Hand: func(m *ice.Message, arg ...string) {
os.Remove(strings.TrimPrefix(arg[0], "/share/local/"))
m.ProcessHold()
}},
}, Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
_wiki_list(m, m.CommandKey(), kit.Select("./", arg, 0))
}},