用户添加全新啊
This commit is contained in:
@@ -4,6 +4,8 @@ import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
|
||||
"git.rosy.net.cn/jx-callback/business/model"
|
||||
"git.rosy.net.cn/jx-callback/business/model/dao"
|
||||
@@ -139,9 +141,19 @@ func GetUserRole(ctx *jxcontext.Context, userID string) (userRoles []*model.User
|
||||
}
|
||||
|
||||
func UpdateUserRole(ctx *jxcontext.Context, userIDs []string, roleIDs []int) (err error) {
|
||||
// var (
|
||||
// db = dao.GetDB()
|
||||
// )
|
||||
|
||||
var (
|
||||
db = dao.GetDB()
|
||||
userRoleMap = make(map[string][]int)
|
||||
)
|
||||
userRoles, err := dao.GetUserRole(db, "")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if len(userRoles) > 0 {
|
||||
for _, v := range userRoles {
|
||||
userRoleMap[v.UserID] = append(userRoleMap[v.UserID], v.RoleID)
|
||||
}
|
||||
}
|
||||
fmt.Println("teeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee", utils.Format4Output(userRoleMap, false))
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user