mirror of
https://shylinux.com/x/community
synced 2025-04-25 09:38:06 +08:00
46 lines
1.1 KiB
Go
46 lines
1.1 KiB
Go
package yuehaoxitong
|
|
|
|
import (
|
|
"shylinux.com/x/ice"
|
|
kit "shylinux.com/x/toolkits"
|
|
|
|
"shylinux.com/x/community/src/yuehaoxitong/model"
|
|
"shylinux.com/x/enterprise/src/guanlixitong"
|
|
)
|
|
|
|
type Table struct {
|
|
guanlixitong.Table
|
|
list string `name:"list queue_uid uid auto" role:"void"`
|
|
}
|
|
|
|
func (s Table) Inputs(m *ice.Message, arg ...string) {
|
|
switch arg[0] {
|
|
case model.USER_QUEUE_ROLE:
|
|
s.InputsListRole(m, UserQueueRoleList, arg...)
|
|
case model.QUEUE_TYPE:
|
|
s.InputsList(m, QueueTypeList, arg...)
|
|
default:
|
|
s.Table.Inputs(m, arg...)
|
|
}
|
|
}
|
|
func (s Table) RewriteAppend(m *ice.Message, arg ...string) *ice.Message {
|
|
m.RewriteAppend(func(value, key string, index int) string {
|
|
switch key {
|
|
case model.USER_QUEUE_ROLE:
|
|
value = UserQueueRole(kit.Int(value)).String()
|
|
case model.QUEUE_TYPE:
|
|
value = QueueType(kit.Int(value)).String()
|
|
case model.SCHEDULE_STATUS:
|
|
value = ScheduleStatus(kit.Int(value)).String()
|
|
}
|
|
return value
|
|
})
|
|
return s.Table.RewriteAppend(m)
|
|
}
|
|
|
|
type Tables struct{ Table }
|
|
|
|
func (s Tables) BeforeMigrate(m *ice.Message, arg ...string) {}
|
|
|
|
func newTable() Table { return Table{Table: guanlixitong.NewTable(userQueue{}, queue{})} }
|