|
123456789101112131415161718192021222324252627282930313233343536 |
- package utils
-
- import (
- "applet/app/cfg"
- "applet/app/utils/cache"
- "fmt"
- "github.com/gin-gonic/gin"
- )
-
- func ClearRedis(c *gin.Context) {
- var str = []string{"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"}
-
- key := fmt.Sprintf("%s:cfg_cache", c.GetString("mid"))
- cache.Del(key)
- key2 := fmt.Sprintf("%s:virtual_coin_cfg", c.GetString("mid"))
- cache.Del(key2)
- key3 := fmt.Sprintf("%s:virtual_coin_cfg_comm", c.GetString("mid"))
- cache.Del(key3)
- for _, v := range str {
- key1 := fmt.Sprintf("%s:cfg_cache:%s", c.GetString("mid"), v)
- cache.Del(key1)
- }
- if cfg.Prd == false {
- key := fmt.Sprintf("%s:cfg_cache", "22255132")
- cache.Del(key)
- key2 := fmt.Sprintf("%s:virtual_coin_cfg", "22255132")
- cache.Del(key2)
- key3 := fmt.Sprintf("%s:virtual_coin_cfg_comm", "22255132")
- cache.Del(key3)
- for _, v := range str {
- key1 := fmt.Sprintf("%s:cfg_cache:%s", "22255132", v)
- cache.Del(key1)
- }
- }
-
- }
|