dao.go 354 Bytes
Newer Older
kzkzzzz's avatar
kzkzzzz committed
1 2 3 4
package dao

import (
	"gomicro-base/common/mysql"
5
	"gomicro-base/common/redis"
kzkzzzz's avatar
kzkzzzz committed
6 7 8 9 10 11
	"gomicro-base/service/wallet/internal/conf"
	"gorm.io/gorm"
)

// Dao 查询数据库
type Dao struct {
12 13
	DB    *gorm.DB
	Redis *redis.WrapClient
kzkzzzz's avatar
kzkzzzz committed
14 15 16 17
}

func New(c *conf.Config) (d *Dao) {
	d = &Dao{
18 19
		DB:    mysql.NewDB(c.Mysql),
		Redis: redis.NewRedis(c.Redis),
kzkzzzz's avatar
kzkzzzz committed
20 21 22
	}
	return
}