48 lines
1.3 KiB
TypeScript
48 lines
1.3 KiB
TypeScript
import { Controller, Get, Inject } from '@nestjs/common';
|
|
import { ApiOkResponse, ApiTags } from '@nestjs/swagger';
|
|
|
|
import {
|
|
BreadthResponseDto,
|
|
FundsResponseDto,
|
|
IndicesResponseDto,
|
|
SectorsResponseDto,
|
|
SummaryResponseDto,
|
|
} from './market-overview.dto';
|
|
import { MarketOverviewService } from './market-overview.service';
|
|
|
|
@ApiTags('market-overview')
|
|
@Controller('market-overview')
|
|
export class MarketOverviewController {
|
|
constructor(@Inject(MarketOverviewService) private readonly service: MarketOverviewService) {}
|
|
|
|
@Get('summary')
|
|
@ApiOkResponse({ type: SummaryResponseDto })
|
|
getSummary(): Promise<SummaryResponseDto> {
|
|
return this.service.getSummary();
|
|
}
|
|
|
|
@Get('indices')
|
|
@ApiOkResponse({ type: IndicesResponseDto })
|
|
getIndices(): Promise<IndicesResponseDto> {
|
|
return this.service.getIndices();
|
|
}
|
|
|
|
@Get('breadth')
|
|
@ApiOkResponse({ type: BreadthResponseDto })
|
|
getBreadth(): Promise<BreadthResponseDto> {
|
|
return this.service.getBreadth();
|
|
}
|
|
|
|
@Get('sectors')
|
|
@ApiOkResponse({ type: SectorsResponseDto })
|
|
getSectors(): Promise<SectorsResponseDto> {
|
|
return this.service.getSectors();
|
|
}
|
|
|
|
@Get('funds')
|
|
@ApiOkResponse({ type: FundsResponseDto })
|
|
getFunds(): Promise<FundsResponseDto> {
|
|
return this.service.getFunds();
|
|
}
|
|
}
|