Documentation ¶
Index ¶
- func BackendUserTBName() string
- func CourseBatchDelete(ids []int) (int64, error)
- func CourseTBName() string
- func DataReset() (bool, error)
- func ResourceTBName() string
- func RoleBackendUserRelTBName() string
- func RoleBatchDelete(ids []int) (int64, error)
- func RoleResourceRelTBName() string
- func RoleTBName() string
- func TableName(name string) string
- type BackendUser
- type BackendUserQueryParam
- type BaseQueryParam
- type Course
- type CourseQueryParam
- type JsonResult
- type Resource
- type Role
- type RoleBackendUserRel
- type RoleQueryParam
- type RoleResourceRel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CourseTBName ¶
func CourseTBName() string
func RoleBackendUserRelTBName ¶
func RoleBackendUserRelTBName() string
RoleBackendUserRelTBName 角色与用户多对多关系表
Types ¶
type BackendUser ¶
type BackendUser struct { Id int RealName string `orm:"size(32)"` UserName string `orm:"size(24)"` UserPwd string `json:"-"` IsSuper bool Status int Mobile string `orm:"size(16)"` Email string `orm:"size(256)"` Avatar string `orm:"size(256)"` RoleIds []int `orm:"-" form:"RoleIds"` RoleBackendUserRel []*RoleBackendUserRel `orm:"reverse(many)"` // 设置一对多的反向关系 ResourceUrlForList []string `orm:"-"` }
BackendUser 实体类
func BackendUserOneByUserName ¶
func BackendUserOneByUserName(username, userpwd string) (*BackendUser, error)
BackendUserOneByUserName 根据用户名密码获取单条
func BackendUserPageList ¶
func BackendUserPageList(params *BackendUserQueryParam) ([]*BackendUser, int64)
BackendUserPageList 获取分页数据
type BackendUserQueryParam ¶
type BackendUserQueryParam struct { BaseQueryParam UserNameLike string //模糊查询 RealNameLike string //模糊查询 Mobile string //精确查询 SearchStatus string //为空不查询,有值精确查询 }
BackendUserQueryParam 用于查询的类
type BaseQueryParam ¶
type BaseQueryParam struct { Sort string `json:"sort"` Order string `json:"order"` Offset int64 `json:"offset"` Limit int `json:"limit"` }
BaseQueryParam 用于查询的类
type Course ¶
type Course struct { Id int Name string `orm:"size(32)"` ShortName string `orm:"size(8)"` Price float32 RealPrice float32 Img string `orm:"size(256)"` StartTime time.Time EndTime time.Time Seq int Creator *BackendUser `orm:"rel(fk)"` //设置一对多关系 }
Course 实体类
func CoursePageList ¶
func CoursePageList(params *CourseQueryParam) ([]*Course, int64)
CoursePageList 获取分页数据
type CourseQueryParam ¶
type CourseQueryParam struct { BaseQueryParam NameLike string }
CourseQueryParam 用于搜索的类
type JsonResult ¶
type JsonResult struct { Code enums.JsonResultCode `json:"code"` Msg string `json:"msg"` Obj interface{} `json:"obj"` }
JsonResult 用于返回ajax请求的基类
type Resource ¶
type Resource struct { Id int Name string `orm:"size(64)"` Parent *Resource `orm:"null;rel(fk)"` // RelForeignKey relation Rtype int Seq int Sons []*Resource `orm:"reverse(many)"` // fk 的反向关系 SonNum int `orm:"-"` Icon string `orm:"size(32)"` LinkUrl string `orm:"-"` UrlFor string `orm:"size(256)" Json:"-"` HtmlDisabled int `orm:"-"` //在html里应用时是否可用 Level int `orm:"-"` //第几级,从0开始 RoleResourceRel []*RoleResourceRel `orm:"reverse(many)"` // 设置一对多的反向关系 }
Resource 权限控制资源表
func ResourceTreeGrid4Parent ¶
ResourceTreeGrid4Parent 获取可以成为某个节点父节点的列表
func ResourceTreeGridByUserId ¶
ResourceTreeGridByUserId 根据用户获取有权管理的资源列表,并整理成teegrid格式
type Role ¶
type Role struct { Id int `form:"Id"` Name string `form:"Name"` Seq int RoleResourceRel []*RoleResourceRel `orm:"reverse(many)" json:"-"` // 设置一对多的反向关系 RoleBackendUserRel []*RoleBackendUserRel `orm:"reverse(many)" json:"-"` // 设置一对多的反向关系 }
Role 用户角色 实体类
type RoleBackendUserRel ¶
type RoleBackendUserRel struct { Id int Role *Role `orm:"rel(fk)"` //外键 BackendUser *BackendUser `orm:"rel(fk)" ` // 外键 Created time.Time `orm:"auto_now_add;type(datetime)"` }
RoleBackendUserRel 角色与用户关系
func (*RoleBackendUserRel) TableName ¶
func (a *RoleBackendUserRel) TableName() string
TableName 设置表名
type RoleQueryParam ¶
type RoleQueryParam struct { BaseQueryParam NameLike string }
RoleQueryParam 用于搜索的类
Click to show internal directories.
Click to hide internal directories.