service

package
v0.0.0-...-a3d1081 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 13, 2018 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddAdmin

func AddAdmin(adminName string, adminPassword string, isEnable bool) bool

添加后台用户

func AddReSourceToRole

func AddReSourceToRole(roleId int, resourceId int) bool

将资源添加到角色

func AddReSourcesToRole

func AddReSourcesToRole(roleId int, resourceIds []string)

将资源集合添加到角色

func AddResource

func AddResource(parentId int, name string, controller string, action string, sort int, url string, isShow int) bool

添加资源

func AddRole

func AddRole(name string, isBase bool) bool

添加角色

func AddUserToRole

func AddUserToRole(roleId int, userId int) bool

将用户添加到角色

func AddUsersToRole

func AddUsersToRole(roleId int, users []string)

将用户集合添加到角色

func DeleteAdmin

func DeleteAdmin(id int) bool

删除后台用户

func DeleteResource

func DeleteResource(id int) bool

删除资源

func DeleteResrouce

func DeleteResrouce(id int) bool

删除后台用户

func DeleteResrouceByRoleId

func DeleteResrouceByRoleId(roleId int) bool

根据角色id删除该角色可以访问的资源

func DeleteRole

func DeleteRole(id int) bool

删除后台用户

func DeleteUserFromRole

func DeleteUserFromRole(roleId int, userId int) bool

将用户添加到角色

func DeleteUsersFromRole

func DeleteUsersFromRole(roleId int, users []string)

将用户集合添加到角色

func GetAdminName

func GetAdminName(ctx *context.Context) string

func GetAdmins

func GetAdmins(pageIndex int, pageSize int) (users []orm.ParamsList, totalCount int)

获得后台用户集合

func GetAllResources

func GetAllResources() (entitys []orm.ParamsList)

获得所有资源

func GetAllRoles

func GetAllRoles() (entitys []orm.ParamsList)

得到所有的角色集合

func GetCanShowResrouces

func GetCanShowResrouces(adminName string) (entitys []orm.ParamsList)

根据后台用户名得到可以显示的资源集合

func GetDb

func GetDb() *sql.DB

func GetFirstRoleId

func GetFirstRoleId() (firstId int)

得到用户角色管理页面默认下拉列表中的角色id

func GetGanShowResrouces

func GetGanShowResrouces(adminName string) (entitys []orm.ParamsList)

func GetInRoleAdmins

func GetInRoleAdmins(roleId int) (entitys []orm.ParamsList)

根据角色id得到在该角色的后台用户的集合

func GetNotInRoleAdmins

func GetNotInRoleAdmins(roleId int) (entitys []orm.ParamsList)

根据角色id得到不在该角色的后台用户的集合

func GetResource

func GetResource(pageIndex int, pageSize int) (entitys []orm.ParamsList, totalCount int)

获得资源集合

func GetResources

func GetResources(pageIndex int, pageSize int) (entitys []orm.ParamsList, totalCount int)

获得分页的资源集合

func GetResroucesInRole

func GetResroucesInRole(roleId int) (entitys []orm.ParamsList)

根据角色id得到该角色可以访问的资源

func GetResroucesNotInRole

func GetResroucesNotInRole(roleId int) (entitys []orm.ParamsList)

根据角色id得到该角色可以访问的资源

func GetRoles

func GetRoles(pageIndex int, pageSize int) (entitys []orm.ParamsList, totalCount int)

获得后台用户集合

func GetSubResourcesCount

func GetSubResourcesCount(resourceId int, entitys []orm.ParamsList) int

根据父资源id得到子资源id的数量

func ISResourceInRole

func ISResourceInRole(resourceId int, roleId int) bool

根据资源id判断该资源是否在角色中

func IsExistAdmin

func IsExistAdmin(adminname string) bool

判断是否存在同名后台用户

func IsExistResource

func IsExistResource(controller string, action string) bool

判断是否存在

func IsExistRole

func IsExistRole(name string) bool

判断是否存在

func LogoutAdmin

func LogoutAdmin()

管理员注销登录

func ValidateAdminLogin

func ValidateAdminLogin(adminname string, password string) bool

验证后台用户登录

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL