package gonganxitong import ( "shylinux.com/x/ice" "shylinux.com/x/community/src/gonganxitong/model" ) type domain struct { Table fields string `name:"name,order"` create string `name:"create name* info" role:"tech"` remove string `name:"remove" role:"tech"` list string `name:"list domain_uid auto" role:"void"` } func (s domain) Create(m *ice.Message, arg ...string) { s.Insert(m, arg...) } func (s domain) Modify(m *ice.Message, arg ...string) { s.Update(m, arg, model.UID, m.Option(model.DOMAIN_UID)) } func (s domain) Remove(m *ice.Message, arg ...string) { s.Delete(m.Options(model.UID, m.Option(model.DOMAIN_UID))) } func (s domain) List(m *ice.Message, arg ...string) { s.Fields(m, model.UID, model.NAME, "order") if len(arg) == 0 { s.Select(m).RenameAppend(model.UID, model.DOMAIN_UID).Action() m.SortInt("order") } else if len(arg) == 1 { s.SelectDetail(m, model.UID, arg[0]) } if m.IsTech() { m.PushAction(s.Remove).Action(s.Create) } } func init() { ice.TeamCtxCmd(domain{}) }