package system import ( "github.com/beego/beego/v2/client/orm" "time" ) type SysDepartmentAddReq struct { DepartmentName string `description:"部门名称"` } type SysDepartment struct { DepartmentId int `orm:"column(department_id);pk" description:"部门Id"` DepartmentName string `description:"部门名称"` CreateTime time.Time `description:"创建时间"` } type SysDepartmentEditReq struct { DepartmentId int `description:"部门Id"` DepartmentName string `description:"部门名称"` } type SysDepartmentDeleteReq struct { DepartmentId int `description:"部门Id"` } type SysDepartmentList struct { DepartmentId int `orm:"column(department_id);pk" description:"部门Id"` DepartmentName string `description:"部门名称"` CreateTime time.Time `description:"创建时间"` Child []*SysGroupList `description:"分组"` IsDepartment bool `description:"true:部门,false:分组"` } func GetDepartmentList() (items []*SysDepartmentList, err error) { o := orm.NewOrm() sql := `SELECT * FROM sys_department ORDER BY create_time ASC ` _, err = o.Raw(sql).QueryRows(&items) return } type SysDepartmentListResp struct { List []*SysDepartmentList } type DepartmentGroupSellers struct { AdminId string `description:"系统用户id"` RealName string `description:"用户真实名称"` ChildrenList []DepartmentGroupSellers `description:"销售列表"` } // DepartmentGroupSellersResp 销售列表(根据部门、分组来) type DepartmentGroupSellersResp struct { List []DepartmentGroupSellers }