members
This commit is contained in:
29
costly-api/src/group-events/api/group-events.controller.ts
Normal file
29
costly-api/src/group-events/api/group-events.controller.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import { Body, Controller, Get, Param, Post } from '@nestjs/common';
|
||||
import { GroupEventsService } from '../application/group-events.service';
|
||||
import { IncomingGroupEventDto } from '../dto/group-event.dto';
|
||||
|
||||
@Controller('group-events')
|
||||
export class GroupEventsController {
|
||||
|
||||
constructor(private readonly groupsEventsService: GroupEventsService) {}
|
||||
|
||||
|
||||
@Post(':groupId/events/batch')
|
||||
ingest(
|
||||
@Param('groupId') groupId: string,
|
||||
@Body() events: IncomingGroupEventDto[],
|
||||
) {
|
||||
return this.groupsEventsService.ingestEvents(groupId, events);
|
||||
}
|
||||
|
||||
@Get()
|
||||
getEvents() {
|
||||
return this.groupsEventsService.getLastTenEvents();
|
||||
}
|
||||
|
||||
@Get(':groupdId')
|
||||
getGroupEvents(@Param('groupId') groupId: string) {
|
||||
return this.groupsEventsService.getLastTenEvents(groupId);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user