feat: add HTTP API and complete client workflows

This commit is contained in:
hectorzhao
2026-07-16 11:34:06 +08:00
parent 4f07b331e5
commit dcb6162dcf
40 changed files with 2548 additions and 365 deletions
+10 -2
View File
@@ -96,9 +96,16 @@ export class OperationsService {
});
}
listUplinkMessages(query: { tenantId?: string; channelId?: string }) {
listUplinkMessages(query: { tenantId?: string; channelId?: string; applicationId?: string; phoneNumber?: string; keyword?: string; startTime?: string; endTime?: string }) {
return this.prisma.smsUplinkMessage.findMany({
where: { tenantId: query.tenantId, channelId: query.channelId },
where: {
tenantId: query.tenantId,
channelId: query.channelId,
applicationId: query.applicationId,
phoneNumber: query.phoneNumber ? { contains: query.phoneNumber } : undefined,
content: query.keyword ? { contains: query.keyword } : undefined,
receivedAt: query.startTime || query.endTime ? { gte: query.startTime ? new Date(query.startTime) : undefined, lte: query.endTime ? new Date(query.endTime) : undefined } : undefined,
},
include: {
tenant: true,
application: true,
@@ -114,6 +121,7 @@ export class OperationsService {
},
},
orderBy: { receivedAt: 'desc' },
take: 500,
});
}