guest.go 798 字节
Newer Older
E
eoLinker API Management 已提交
1 2 3
package account

import (
Y
Your Name 已提交
4 5 6 7 8 9 10 11
	"github.com/eolinker/goku-api-gateway/common/pdao"
	"github.com/eolinker/goku-api-gateway/server/dao"

)

var(
	guestDao dao.GuestDao
	userDao dao.UserDao
E
eoLinker API Management 已提交
12 13
)

Y
Your Name 已提交
14 15 16 17 18
func init() {
	pdao.Need(&guestDao,&userDao)
}
 

Y
Your Name 已提交
19
//Login 登录
Y
Your Name 已提交
20 21
func  Login(loginCall, loginPassword string) (bool, int) {
	return guestDao.Login(loginCall, loginPassword)
E
eoLinker API Management 已提交
22 23 24

}

Y
Your Name 已提交
25
//CheckLogin 检查用户是否登录
Y
Your Name 已提交
26 27 28
func  CheckLogin(userToken string, userID int) bool {

	return  guestDao.CheckLogin(userToken, userID)
E
eoLinker API Management 已提交
29 30
}

Y
Your Name 已提交
31
//Register 用户注册
Y
Your Name 已提交
32 33
func  Register(loginCall, loginPassword string) bool {
	return  guestDao.Register(loginCall, loginPassword)
E
eoLinker API Management 已提交
34 35
}

Y
Your Name 已提交
36
//CheckSuperAdminCount 获取超级管理员数量
Y
Your Name 已提交
37 38
func  CheckSuperAdminCount() (int, error) {
	b, err :=  userDao.CheckSuperAdminCount()
Y
Your Name 已提交
39 40
	return b, err
}
Y
Your Name 已提交
41 42