import { Controller, Get, ParseIntPipe, Query, Req } from "@nestjs/common";
import EventsProvider from "./events.provider";
import ResponseDto from "../../dto/response.dto";
import express from "express";
import { ApiQuery } from "@nestjs/swagger";

@Controller("/api/v1/events")
export default class EventsController {

    constructor(private readonly eventsProvider: EventsProvider){}

    @ApiQuery({name: "idSkip", required: false})
    @Get("/listEvents")
    async listEvents(@Req() request: express.Request, @Query("idSkip") idSkip?: string): Promise<ResponseDto>{
        return await this.eventsProvider.listEvents(request, idSkip);
    }

}