mirror of
https://github.com/yangjian102621/geekai.git
synced 2025-11-08 18:23:45 +08:00
option: replace leveldb with redis in storing message code
This commit is contained in:
@@ -2,18 +2,16 @@ package service
|
||||
|
||||
import (
|
||||
"chatplus/core/types"
|
||||
"chatplus/store"
|
||||
"fmt"
|
||||
"github.com/aliyun/alibaba-cloud-sdk-go/services/dysmsapi"
|
||||
)
|
||||
|
||||
type AliYunSmsService struct {
|
||||
config *types.AliYunSmsConfig
|
||||
db *store.LevelDB
|
||||
client *dysmsapi.Client
|
||||
}
|
||||
|
||||
func NewAliYunSmsService(config *types.AppConfig, db *store.LevelDB) (*AliYunSmsService, error) {
|
||||
func NewAliYunSmsService(config *types.AppConfig) (*AliYunSmsService, error) {
|
||||
// 创建阿里云短信客户端
|
||||
client, err := dysmsapi.NewClientWithAccessKey(
|
||||
"cn-hangzhou",
|
||||
@@ -25,7 +23,6 @@ func NewAliYunSmsService(config *types.AppConfig, db *store.LevelDB) (*AliYunSms
|
||||
|
||||
return &AliYunSmsService{
|
||||
config: &config.SmsConfig,
|
||||
db: db,
|
||||
client: client,
|
||||
}, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user