mirror of
https://shylinux.com/x/education
synced 2025-04-25 10:08:05 +08:00
46 lines
1.1 KiB
Go
46 lines
1.1 KiB
Go
package jiaocaiziliao
|
|
|
|
import (
|
|
"shylinux.com/x/ice"
|
|
kit "shylinux.com/x/toolkits"
|
|
|
|
"shylinux.com/x/education/src/jiaocaiziliao/model"
|
|
"shylinux.com/x/education/src/jiaowuxitong"
|
|
)
|
|
|
|
type Table struct {
|
|
jiaowuxitong.Table
|
|
list string `name:"list library_uid uid auto" role:"void"`
|
|
}
|
|
|
|
func (s Table) Inputs(m *ice.Message, arg ...string) {
|
|
switch arg[0] {
|
|
case model.USER_LIBRARY_ROLE:
|
|
s.InputsListRole(m, UserLibraryRoleList, arg...)
|
|
case model.LIBRARY_TYPE:
|
|
s.InputsList(m, LibraryTypeList, arg...)
|
|
case model.DOCUMENT_TYPE:
|
|
s.InputsList(m, DocumentTypeList, 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_LIBRARY_ROLE:
|
|
value = UserLibraryRole(kit.Int(value)).String()
|
|
case model.LIBRARY_TYPE:
|
|
value = LibraryType(kit.Int(value)).String()
|
|
case model.DOCUMENT_TYPE:
|
|
value = DocumentType(kit.Int(value)).String()
|
|
}
|
|
return value
|
|
})
|
|
return s.Table.RewriteAppend(m)
|
|
}
|
|
|
|
type Tables struct{ Table }
|
|
|
|
func (s Tables) BeforeMigrate(m *ice.Message, arg ...string) {}
|