Initial commit

This commit is contained in:
Donny
2019-04-22 20:46:32 +08:00
commit 49ab8aadd1
25441 changed files with 4055000 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
package manager
import (
"context"
"database/sql"
"go-common/library/log"
)
const (
_getUserRoleSQL = "SELECT `role` FROM `auth_role` WHERE uid = ?"
)
// GetUserRole 用户角色
func (d *Dao) GetUserRole(c context.Context, uid int64) (role int8, err error) {
err = d.managerDB.QueryRow(c, _getUserRoleSQL, uid).Scan(&role)
if err != nil && err != sql.ErrNoRows {
log.Error("d.managerDB.Query error(%v)", err)
return
}
return role, nil
}