mirror of
https://shylinux.com/x/enterprise
synced 2025-07-03 05:21:20 +08:00
41 lines
1.0 KiB
Go
41 lines
1.0 KiB
Go
package yingxiaotuiguang
|
|
|
|
import (
|
|
"shylinux.com/x/ice"
|
|
kit "shylinux.com/x/toolkits"
|
|
|
|
"shylinux.com/x/enterprise/src/guanlixitong"
|
|
"shylinux.com/x/enterprise/src/yingxiaotuiguang/model"
|
|
)
|
|
|
|
type Table struct {
|
|
guanlixitong.Table
|
|
list string `name:"list promotion_uid uid auto" role:"void"`
|
|
}
|
|
|
|
func (s Table) Inputs(m *ice.Message, arg ...string) {
|
|
switch arg[0] {
|
|
case model.USER_PROMOTION_ROLE:
|
|
s.InputsListRole(m, UserPromotionRoleList, arg...)
|
|
case model.PROMOTION_TYPE:
|
|
s.InputsList(m, PromotionTypeList, 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_PROMOTION_ROLE:
|
|
value = UserPromotionRole(kit.Int(value)).String()
|
|
case model.PROMOTION_TYPE:
|
|
value = PromotionType(kit.Int(value)).String()
|
|
}
|
|
return value
|
|
})
|
|
return s.Table.RewriteAppend(m)
|
|
}
|
|
|
|
type Tables struct { Table }
|
|
|
|
func (s Tables) BeforeMigrate(m *ice.Message, arg ...string) {} |