广告平台(站长使用)
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.

svc_redis.go 607 B

2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
123456789101112131415161718192021222324
  1. package svc
  2. import (
  3. "applet/app/utils/cache"
  4. "fmt"
  5. "github.com/gin-gonic/gin"
  6. )
  7. func ClearRedis(c *gin.Context, masterId, key string) {
  8. key1 := fmt.Sprintf("%s:cfg_cache:%s", masterId, key)
  9. cache.Del(key1)
  10. }
  11. func ClearAllRedis(c *gin.Context, masterId string) {
  12. 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", "%!s(MISSING)"}
  13. for _, v := range str {
  14. key1 := fmt.Sprintf("%s:cfg_cache:%s", masterId, v)
  15. cache.Del(key1)
  16. key2 := fmt.Sprintf("%s:cfg_cache:%s", "", v)
  17. cache.Del(key2)
  18. }
  19. }