user.go 1.3 KB
Newer Older
E
eoLinker API Management 已提交
1 2 3
package account

import (
黄孟柱 已提交
4
	"github.com/eolinker/goku-api-gateway/server/dao/console-mysql"
E
eoLinker API Management 已提交
5
)
Y
Your Name 已提交
6

Y
Your Name 已提交
7
//GetUserListWithPermission 获取具有编辑权限的用户列表
E
eoLinker API Management 已提交
8
func GetUserListWithPermission(operationType, operation string) (bool, []map[string]interface{}, error) {
Y
Your Name 已提交
9
	return consolemysql.GetUserListWithPermission(operationType, operation)
E
eoLinker API Management 已提交
10 11
}

Y
Your Name 已提交
12
//EditPassword 修改账户信息
E
eoLinker API Management 已提交
13
func EditPassword(oldPassword, newPassword string, userID int) (bool, string, error) {
Y
Your Name 已提交
14
	return consolemysql.EditPassword(oldPassword, newPassword, userID)
E
eoLinker API Management 已提交
15 16
}

Y
Your Name 已提交
17
//GetUserInfo 获取账户信息
E
eoLinker API Management 已提交
18
func GetUserInfo(userID int) (bool, interface{}, error) {
Y
Your Name 已提交
19
	return consolemysql.GetUserInfo(userID)
E
eoLinker API Management 已提交
20 21
}

Y
Your Name 已提交
22
//GetUserType 获取用户类型
E
eoLinker API Management 已提交
23
func GetUserType(userID int) (bool, interface{}, error) {
Y
Your Name 已提交
24
	return consolemysql.GetUserType(userID)
E
eoLinker API Management 已提交
25 26
}

Y
Your Name 已提交
27
//CheckUserIsAdmin 判断是否是管理员
E
eoLinker API Management 已提交
28
func CheckUserIsAdmin(userID int) (bool, string, error) {
Y
Your Name 已提交
29
	return consolemysql.CheckUserIsAdmin(userID)
E
eoLinker API Management 已提交
30 31
}

Y
Your Name 已提交
32
//CheckUserIsSuperAdmin 判断是否是超级管理员
E
eoLinker API Management 已提交
33
func CheckUserIsSuperAdmin(userID int) (bool, string, error) {
Y
Your Name 已提交
34
	return consolemysql.CheckUserIsSuperAdmin(userID)
E
eoLinker API Management 已提交
35 36
}

Y
Your Name 已提交
37
//CheckUserPermission 检查用户权限
E
eoLinker API Management 已提交
38
func CheckUserPermission(operationType, operation string, userID int) (bool, string, error) {
Y
Your Name 已提交
39
	return consolemysql.CheckUserPermission(operationType, operation, userID)
E
eoLinker API Management 已提交
40
}