mirror of
https://shylinux.com/x/community
synced 2025-04-25 17:48:06 +08:00
36 lines
1014 B
Go
36 lines
1014 B
Go
package yuehaoxitong
|
|
|
|
import (
|
|
"shylinux.com/x/ice"
|
|
kit "shylinux.com/x/toolkits"
|
|
|
|
"shylinux.com/x/community/src/yuehaoxitong/model"
|
|
)
|
|
|
|
type open struct {
|
|
Tables
|
|
volume volume
|
|
create string `name:"plan reception_uid*:select amount* begin_time*:select@date end_time*:select@date" role:"manager"`
|
|
list string `name:"list queue_uid uid auto" role:"manager"`
|
|
}
|
|
|
|
func (s open) Create(m *ice.Message, arg ...string) {
|
|
m.Cmdy(s.volume, s.Create, arg, m.OptionSimple(model.QUEUE_UID)).ProcessRefresh()
|
|
s.RecordEvent(m, m.Trans("create volume", "创建服务计划")+"\n"+s.joinKV(m, model.AMOUNT, model.BEGIN_TIME, model.END_TIME), m.Result())
|
|
}
|
|
func (s open) List(m *ice.Message, arg ...string) {
|
|
if m.Cmdy(s.volume, arg); m.Length() == 0 {
|
|
m.EchoInfoButton("", s.Create)
|
|
}
|
|
}
|
|
|
|
func init() { ice.TeamCtxCmd(open{}) }
|
|
|
|
func (s open) joinKV(m *ice.Message, arg ...string) string {
|
|
list := []string{}
|
|
for _, k := range arg {
|
|
list = append(list, k, m.Option(k))
|
|
}
|
|
return kit.JoinKV(": ", "\n", list...)
|
|
}
|