12345678910111213141516171819202122232425262728293031323334353637 |
- package models
- import (
- "time"
- "github.com/beego/beego/v2/client/orm"
- )
- type SysRoleAddReq struct {
- RoleName string `description:"角色名称"`
- RoleType string `description:"角色类型"`
- }
- type SysRole struct {
- RoleId int `orm:"column(role_id);pk" description:"角色ID"`
- RoleName string `description:"角色名称"`
- RoleType string `description:"角色类型"`
- RoleTypeCode string `description:"角色类型编码"`
- CreateTime time.Time `description:"创建时间"`
- ModifyTime time.Time
- }
- type SysRoleItem struct {
- RoleId int `orm:"column(role_id);pk" description:"角色ID"`
- RoleName string `description:"角色名称"`
- RoleType string `description:"角色类型"`
- RoleTypeCode string `description:"角色类型编码"`
- CreateTime time.Time `description:"创建时间"`
- RoleLevel int `description:"角色等级:0-表示一级角色,每个账号只能绑定一个一级角色 ,1-表示二级角色,每个账号可以绑定多个二级 角色"`
- }
- func GetSysRoleAll() (items []*SysRoleItem, err error) {
- sql := `SELECT * FROM sys_role `
- o := orm.NewOrm()
- _, err = o.Raw(sql).QueryRows(&items)
- return
- }
|