广告平台(站长使用)
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 
 
 
 

25 Zeilen
607 B

  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. }