You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
370 B
22 lines
370 B
|
1 year ago
|
package bdb
|
||
|
|
|
||
|
|
import (
|
||
|
|
"encoding/json"
|
||
|
|
"server/modules/backend/values"
|
||
|
|
|
||
|
|
"github.com/liangdas/mqant/log"
|
||
|
|
)
|
||
|
|
|
||
|
|
func GetPowerByRole(role int) map[int][]int {
|
||
|
|
one := &values.Role{Role: role}
|
||
|
|
BackDB.Get(one)
|
||
|
|
ret := map[int][]int{}
|
||
|
|
if len(one.Power) > 0 {
|
||
|
|
err := json.Unmarshal([]byte(one.Power), &ret)
|
||
|
|
if err != nil {
|
||
|
|
log.Error("err:%v", err)
|
||
|
|
}
|
||
|
|
}
|
||
|
|
return ret
|
||
|
|
}
|