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.
 
 
 

30 lines
569 B

package dao
import (
"context"
"fmt"
mc "go-common/library/cache/memcache"
"go-common/library/log"
)
const (
_walletMcKey = "wu:%d"
)
func mcKey(uid int64) string {
return fmt.Sprintf(_walletMcKey, uid)
}
// DelWalletCache 删除等级缓存
func (d *Dao) DelWalletCache(c context.Context, uid int64) (err error) {
key := mcKey(uid)
conn := d.mc.Get(c)
defer conn.Close()
if err = conn.Delete(key); err == mc.ErrNotFound {
err = nil
} else if err != nil {
log.Error("[dao.mc_wallet|DelWalletCache] conn.Delete(%s) error(%v)", key, err)
}
return
}