package dbmodel import ( "encoding/json" "github.com/astaxie/beego/orm" ) type TGdAdminRbacNode struct { Id int `json:"id"` Name string `json:"name"` Router string `json:"router"` Method string `json:"method"` Resource string `json:"resource"` Object string `json:"object"` Pid int `json:"pid"` } func (p *TGdAdminRbacNode) TableName() string { return "t_gd_admin_rbac_node" } func (p TGdAdminRbacNode) String() string { vals, _ := json.Marshal(p) return string(vals) } func (p *TGdAdminRbacNode) FetchAll(db orm.Ormer, mapFilter map[string]interface{}, cols []string) (lists []TGdAdminRbacNode, err error) { qa := db.QueryTable(p.TableName()) for k, v := range mapFilter { qa = qa.Filter(k, v) } _, err = qa.All(&lists, cols...) return }