feat: wechat module

This commit is contained in:
ilhamtahir committed 2024-11-17 23:20:49 +08:00
1 parent bbf5360ef7
commit 966f60d483
3 files changed
+86

No files matched your search

+23
View File
@@ -0,0 +1,23 @@
import { Module } from '@nestjs/common';
import { RedisCache, WeChatModule } from 'nest-wechat';
import { ConfigModule, ConfigService } from '@nestjs/config';
@Module({
imports: [
WeChatModule.forRootAsync({
imports: [ConfigModule],
inject: [ConfigService],
useFactory: (configService: ConfigService, cache: Cache) => ({
appId: configService.get('WX_APPID'),
secret: configService.get('WX_SECRET'),
token: configService.get('WX_TOKEN'),
encodingAESKey: configService.get('WX_AESKEY'),
cacheAdapter: new RedisCache(cache),
debug: true,
}),
}),
],
controllers: [],
providers: [],
})
export class MiniProgramModule {}