|
@@ -37,16 +37,16 @@ func syncBlackWhiteList() {
|
|
|
res := db.GateWatMySql.Query(`SELECT * FROM front_proxy_blackWhite Where status !=0`)
|
|
|
if res != nil && len(*res) > 0 {
|
|
|
for _, data := range *res {
|
|
|
- userId := gconv.String(data["userId"])
|
|
|
+ value := gconv.String(data["value"])
|
|
|
status := gconv.Int(data["status"])
|
|
|
- if key := fmt.Sprintf(WhiteListKey, userId); status == 1 && !AllRedis.Exists(key) {
|
|
|
+ if key := fmt.Sprintf(WhiteListKey, value); status == 1 && !AllRedis.Exists(key) {
|
|
|
addWhiteNum++
|
|
|
AllRedis.Set(key, 1, -1)
|
|
|
- g.Log().Infof(gctx.New(), "同步白名单-加入%s", userId)
|
|
|
- } else if key := fmt.Sprintf(BlackListKey, userId); status == -1 && !AllRedis.Exists(key) {
|
|
|
+ g.Log().Infof(gctx.New(), "同步白名单-加入%s", value)
|
|
|
+ } else if key := fmt.Sprintf(BlackListKey, value); status == -1 && !AllRedis.Exists(key) {
|
|
|
addBlackNum++
|
|
|
AllRedis.Set(key, 1, -1)
|
|
|
- g.Log().Infof(gctx.New(), "同步黑名单-加入%s", userId)
|
|
|
+ g.Log().Infof(gctx.New(), "同步黑名单-加入%s", value)
|
|
|
}
|
|
|
}
|
|
|
}
|