feat: 添加项目置顶功能

在仪表盘中添加置顶项目功能,包括:
- 新增置顶项目展示区域
- 为AI推荐项目添加置顶/取消置顶操作
- 后端接口支持置顶状态管理
This commit is contained in:
dmy
2026-01-13 20:56:21 +08:00
parent 4f4355c1cd
commit 50bc930663
4 changed files with 173 additions and 5 deletions

View File

@@ -1,4 +1,4 @@
import { Controller, Get, Query } from '@nestjs/common';
import { Controller, Get, Query, Patch, Param, Body } from '@nestjs/common';
import { BidsService } from '../services/bid.service';
@Controller('api/bids')
@@ -15,6 +15,11 @@ export class BidsController {
return this.bidsService.getRecentBids();
}
@Get('pinned')
getPinned() {
return this.bidsService.getPinnedBids();
}
@Get('sources')
getSources() {
return this.bidsService.getSources();
@@ -30,4 +35,9 @@ export class BidsController {
getCrawlInfoStats() {
return this.bidsService.getCrawlInfoAddStats();
}
@Patch(':title/pin')
updatePin(@Param('title') title: string, @Body() body: { pin: boolean }) {
return this.bidsService.updatePin(title, body.pin);
}
}