feat: 重构AI推荐功能并优化爬虫基础URL
重构前端AI推荐组件,移除本地过滤逻辑,改为从后端获取日期范围内的数据 新增AI服务模块,包含Prompt和推荐逻辑 为投标服务添加按日期范围查询接口 统一各爬虫服务的baseURL格式
This commit is contained in:
@@ -24,4 +24,9 @@ export class BidsController {
|
||||
getSources() {
|
||||
return this.bidsService.getSources();
|
||||
}
|
||||
|
||||
@Get('by-date-range')
|
||||
getByDateRange(@Query('startDate') startDate: string, @Query('endDate') endDate: string) {
|
||||
return this.bidsService.getBidsByDateRange(startDate, endDate);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,4 +87,22 @@ export class BidsService {
|
||||
.orderBy('bid.publishDate', 'DESC')
|
||||
.getMany();
|
||||
}
|
||||
|
||||
async getBidsByDateRange(startDate?: string, endDate?: string) {
|
||||
const qb = this.bidRepository.createQueryBuilder('bid');
|
||||
|
||||
if (startDate) {
|
||||
const start = new Date(startDate);
|
||||
start.setHours(0, 0, 0, 0);
|
||||
qb.andWhere('bid.publishDate >= :startDate', { startDate: start });
|
||||
}
|
||||
|
||||
if (endDate) {
|
||||
const end = new Date(endDate);
|
||||
end.setHours(23, 59, 59, 999);
|
||||
qb.andWhere('bid.publishDate <= :endDate', { endDate: end });
|
||||
}
|
||||
|
||||
return qb.orderBy('bid.publishDate', 'DESC').getMany();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user