sys_group.go 740 B

123456789101112131415161718192021222324252627
  1. package models
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. "time"
  5. )
  6. type SysGroupAddReq struct {
  7. DepartmentId int `description:"部门Id"`
  8. GroupName string `description:"分组名称,多个用英文逗号隔开"`
  9. }
  10. type SysGroup struct {
  11. GroupId int `orm:"column(group_id);pk" description:"分组ID"`
  12. DepartmentId int `description:"部门Id"`
  13. ParentId int `description:"父级Id"`
  14. GroupName string `description:"分组名称"`
  15. Sort int `description:"排序"`
  16. CreateTime time.Time `description:"创建时间"`
  17. }
  18. func GetSysGroupAll() (list []*SysGroup, err error) {
  19. sql := `SELECT * FROM sys_group `
  20. o := orm.NewOrm()
  21. _, err = o.Raw(sql).QueryRows(&list)
  22. return
  23. }