feat: 付费体系重构 P0 - 配额独立化/简历付费下载/PDF生成
This commit is contained in:
@@ -5,6 +5,7 @@ import { Interview, InterviewDocument } from './interview.schema'
|
||||
import { Progress, ProgressDocument } from '../schemas/progress.schema'
|
||||
import { AiService } from '../ai/ai.service'
|
||||
import { UserService } from '../user/user.service'
|
||||
import { QuotaService } from '../user/quota.service'
|
||||
import { analyzeSpeech } from '../../common/utils/filler-words'
|
||||
|
||||
@Injectable()
|
||||
@@ -14,11 +15,11 @@ export class InterviewService {
|
||||
@InjectModel(Progress.name) private progressModel: Model<ProgressDocument>,
|
||||
private aiService: AiService,
|
||||
private userService: UserService,
|
||||
private quotaService: QuotaService,
|
||||
) {}
|
||||
|
||||
async create(userId: string, position: string) {
|
||||
// 扣减使用次数
|
||||
await this.userService.deductRemaining(userId)
|
||||
await this.quotaService.checkAndDeductInterview(userId)
|
||||
|
||||
const firstQuestion = await this.aiService.call({
|
||||
systemPrompt: `你是一位专业的${position}面试官。请针对校招该岗位提出第一个面试问题,要求具体且有针对性。直接输出问题,不要多余内容。`,
|
||||
|
||||
Reference in New Issue
Block a user