Files
bidding_watcher/src/bids/controllers/bid.controller.ts

34 lines
907 B
TypeScript
Raw Normal View History

2026-01-09 23:18:52 +08:00
import { Controller, Get, Query } from '@nestjs/common';
import { BidsService } from '../services/bid.service';
@Controller('api/bids')
export class BidsController {
constructor(private readonly bidsService: BidsService) {}
@Get()
findAll(@Query() query: any) {
return this.bidsService.findAll(query);
}
@Get('recent')
getRecent() {
return this.bidsService.getRecentBids();
}
@Get('sources')
getSources() {
return this.bidsService.getSources();
}
@Get('by-date-range')
getByDateRange(@Query('startDate') startDate: string, @Query('endDate') endDate?: string, @Query('keywords') keywords?: string) {
const keywordsArray = keywords ? keywords.split(',') : undefined;
return this.bidsService.getBidsByDateRange(startDate, endDate, keywordsArray);
}
@Get('crawl-info-stats')
getCrawlInfoStats() {
return this.bidsService.getCrawlInfoAddStats();
}
2026-01-09 23:18:52 +08:00
}