go_dreamfactory/sys/cache/mail.go

31 lines
720 B
Go

package cache
import (
"go_dreamfactory/pb"
"go_dreamfactory/sys/db"
)
// 邮件暂时不写redis
const ( //Redis
Redis_MailCache string = "mail:%s"
)
type IMail interface {
QueryUserMail(uId string) (mail []*pb.DB_MailData, err error)
}
// 查询玩家邮件数据
func (this *Cache) QueryUserMail(uId string) (mail []*pb.DB_MailData, err error) {
// var result []interface{}
// if result, err = this.redis.HGetAll(fmt.Sprintf(Redis_MailCache, uId), reflect.TypeOf(&pb.DB_MailData{})); err != nil {
// return
// } else {
// mail = make([]*pb.DB_MailData, len(result))
// for i, v := range result {
// mail[i] = v.(*pb.DB_MailData)
// }
// }
mail, _ = db.Defsys.Mail_QueryUserMail(uId)
return
}