Initial commit

This commit is contained in:
Donny
2019-04-22 20:46:32 +08:00
commit 49ab8aadd1
25441 changed files with 4055000 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
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
}