35 lines
640 B
Go
35 lines
640 B
Go
package entity
|
|
|
|
import (
|
|
"mongo.games.com/game/gamesrv/slotspkg/internal/generic/ddb"
|
|
"mongo.games.com/game/gamesrv/slotspkg/internal/generic/global"
|
|
"strings"
|
|
)
|
|
|
|
type DB struct{}
|
|
|
|
var db DB
|
|
|
|
func (DB) GetCheatData(uid int64, theme string) map[string]interface{} {
|
|
c := ddb.RedimoClient()
|
|
|
|
result, err := c.HGETALL(global.DDB.CheatSlots(uid))
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
|
|
data := make(map[string]interface{})
|
|
for key, value := range result {
|
|
index := strings.Index(key, theme)
|
|
if index != 0 {
|
|
continue
|
|
}
|
|
dataKey := key[len(theme)+1:]
|
|
if value.Present() {
|
|
data[dataKey] = value.Interface()
|
|
}
|
|
}
|
|
|
|
return data
|
|
}
|