package models import ( "github.com/beego/beego/v2/client/orm" "time" ) type SysGroupAddReq struct { DepartmentId int `description:"部门Id"` GroupName string `description:"分组名称,多个用英文逗号隔开"` } type SysGroup struct { GroupId int `orm:"column(group_id);pk" description:"分组ID"` DepartmentId int `description:"部门Id"` ParentId int `description:"父级Id"` GroupName string `description:"分组名称"` Sort int `description:"排序"` CreateTime time.Time `description:"创建时间"` } func GetSysGroupAll() (list []*SysGroup, err error) { sql := `SELECT * FROM sys_group ` o := orm.NewOrm() _, err = o.Raw(sql).QueryRows(&list) return }