refactor: 移除高优先级投标功能及相关代码
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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 } });
|
||||
|
||||
Reference in New Issue
Block a user