service

package
v0.0.0-...-d274286 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2015 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Logs *logs.BeeLogger

	AdminList map[string]string
)
View Source
var (
	ErrorUserNotExist           = errors.New("没有此用户id")
	ErrorUserStatus             = errors.New("用户状态异常")
	ErrosRoleStatus             = errors.New("角色状态异常")
	ErrorUserRoleNotExist       = errors.New("用户角色无此用户")
	ErrorRolePermissnonNotExist = errors.New("角色权限无此角色")
)

Functions

func AddLog

func AddLog(mylog *model.ActionLog) (err error)

func AddUser

func AddUser(id int64, name, info, pass string) (err error)

func DelUser

func DelUser(id int64) (err error)

func EditUser

func EditUser(id int64, name, info string, status int, pass string) (err error)

func EditUserRole

func EditUserRole(userId, roleId int64) (err error)

func FormatTime

func FormatTime(t int64) string

解析时间格式

func GetPermissionByUserId

func GetPermissionByUserId(userId int64) (mp []*model.Permission, err error)

根据用户ID获得所有菜单 缓存读取

func GetUserInfoByName

func GetUserInfoByName(name, password string) (out *model.User, err error)

根据用户名和密码验证是否可以登录 从数据库读取

func GetUserRole

func GetUserRole(in int64) *model.Role

func Init

func Init(dbDsn string, num int, dbName string, debug bool, adminList map[string]string) (err error)

func Reload

func Reload() (err error)

从数据库读入缓存

func ValidatePermission

func ValidatePermission(userId int64, path 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