v3数据表更改
This commit is contained in:
@@ -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 };
|
||||
|
||||
Reference in New Issue
Block a user