initial crm server

This commit is contained in:
zchengo
2022-11-28 16:38:30 +08:00
parent 61122aef6a
commit af7cd0c44c
36 changed files with 2615 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
package initialize
import (
"crm/global"
"fmt"
"github.com/go-redis/redis/v9"
)
// 初始化Redis数据库
func Redis() {
r := global.Config.Redis
rdb := redis.NewClient(&redis.Options{
Addr: fmt.Sprintf("%s:%v", r.Host, r.Port),
Password: r.Password,
DB: r.Database,
})
global.Rdb = rdb
}