This commit is contained in:
2026-06-30 10:33:56 +08:00
commit 6e047dc0a5
607 changed files with 65966 additions and 0 deletions
@@ -0,0 +1,21 @@
import { Injectable } from '@nestjs/common';
import { loadAppConfig } from '@dukang/shared-types';
import { ISmsProvider } from './sms.interface';
@Injectable()
export class SmsMockProvider implements ISmsProvider {
private readonly config = loadAppConfig();
async send(_phone: string, _scene: string): Promise<void> {
if (!this.config.mockSms) {
throw new Error('Real SMS not implemented in preV1');
}
}
async verify(phone: string, code: string, _scene: string): Promise<void> {
if (this.config.mockSms && code === this.config.mockSmsCode) {
return;
}
throw new Error(`Invalid verification code for ${phone}`);
}
}