refactor: 移除高优先级投标功能及相关代码

This commit is contained in:
dmy
2026-01-13 20:42:34 +08:00
parent 6825885005
commit 4f4355c1cd
7 changed files with 3 additions and 133 deletions

View File

@@ -15,11 +15,6 @@ export class BidsController {
return this.bidsService.getRecentBids();
}
@Get('high-priority')
getHighPriority() {
return this.bidsService.getHighPriorityCorrected();
}
@Get('sources')
getSources() {
return this.bidsService.getSources();

View File

@@ -17,15 +17,6 @@ export class BidItem {
@Column()
source: string;
@Column({ default: false })
isRead: boolean;
@Column({ default: 0 })
priority: number;
@Column({ nullable: true })
unit: string;
@CreateDateColumn()
createdAt: Date;

View File

@@ -33,24 +33,6 @@ export class BidsService {
return { items, total };
}
getHighPriority() {
return this.bidRepository.find({
where: { priority: LessThan(0) }, // This is just a placeholder logic, priority should be > 0
order: { priority: 'DESC', publishDate: 'DESC' },
take: 10,
});
}
// Update logic for priority
async getHighPriorityCorrected() {
return this.bidRepository.createQueryBuilder('bid')
.where('bid.priority > 0')
.orderBy('bid.priority', 'DESC')
.addOrderBy('bid.publishDate', 'DESC')
.limit(10)
.getMany();
}
async createOrUpdate(data: Partial<BidItem>) {
// Use title or a hash of title to check for duplicates
let item = await this.bidRepository.findOne({ where: { title: data.title } });

View File

@@ -112,7 +112,6 @@ export class BidCrawlerService {
url: item.url,
publishDate: item.publishDate,
source: crawler.name,
unit: '',
});
}
@@ -164,7 +163,6 @@ export class BidCrawlerService {
url: item.url,
publishDate: item.publishDate,
source: crawler.name,
unit: '',
});
}