1
0
forked from x/icebergs
This commit is contained in:
IT 老营长 @云轩领航-创始人 2024-07-08 19:46:17 +08:00
parent af0d446abc
commit 3e63a8c243

View File

@ -1,6 +1,8 @@
package web package web
import ( import (
"strings"
ice "shylinux.com/x/icebergs" ice "shylinux.com/x/icebergs"
"shylinux.com/x/icebergs/base/ctx" "shylinux.com/x/icebergs/base/ctx"
"shylinux.com/x/icebergs/base/mdb" "shylinux.com/x/icebergs/base/mdb"
@ -18,5 +20,8 @@ func init() {
} }
func AddPortalProduct(m *ice.Message, name, text string, order float64, arg ...string) { func AddPortalProduct(m *ice.Message, name, text string, order float64, arg ...string) {
m.Cmd("web.product", mdb.CREATE, mdb.NAME, name, mdb.TEXT, text, mdb.ORDER, order, ctx.INDEX, m.PrefixKey(), ctx.ARGS, kit.Format(arg)) msg := m.Spawn()
m.GoSleep("300ms", func() {
msg.Cmd("web.product", mdb.CREATE, mdb.NAME, name, mdb.TEXT, strings.TrimSpace(text), mdb.ORDER, order, ctx.INDEX, msg.PrefixKey(), ctx.ARGS, kit.Format(arg))
})
} }