v3数据表更改

This commit is contained in:
2026-07-01 14:36:50 +08:00
parent 638898b71e
commit aeb4ecfc84
46 changed files with 4553 additions and 918 deletions
@@ -1,4 +1,5 @@
import { Injectable } from '@nestjs/common';
import type { ClientApp } from '@prisma/client';
import { PrismaService } from '../../common/prisma/prisma.module';
@Injectable()
@@ -11,12 +12,12 @@ export class AnalyticsService {
events: Array<{ eventName: string; params?: Record<string, unknown> }>,
) {
if (!events?.length) return { count: 0 };
await this.prisma.eventLog.createMany({
await this.prisma.logUserAnalytics.createMany({
data: events.map((e) => ({
userId,
eventName: e.eventName,
params: e.params as never,
clientApp,
extraJson: e.params as never,
clientApp: clientApp as ClientApp,
})),
});
return { count: events.length };