|
|
@@ -22,39 +22,39 @@ export class AdController {
|
|
|
* Returns a single AdDto or null (if no suitable ad is found).
|
|
|
* Your global response interceptor will wrap this into the standard envelope.
|
|
|
*/
|
|
|
- @Get('placement')
|
|
|
- @ApiOperation({
|
|
|
- summary: '按位置获取广告',
|
|
|
- description:
|
|
|
- '根据场景(scene)、插槽(slot)、广告类型(adType)获取可用广告。数据来源对齐 Prisma Mongo Ads 模型。示例:/ads/placement?scene=home&slot=top&adType=BANNER',
|
|
|
- })
|
|
|
- @ApiResponse({ status: 200, description: '成功返回广告或null', type: AdDto })
|
|
|
- async getAdForPlacement(
|
|
|
- @Query() query: GetAdPlacementQueryDto,
|
|
|
- ): Promise<AdDto | null> {
|
|
|
- const { scene, slot, adType, maxTries } = query;
|
|
|
+ // @Get('placement')
|
|
|
+ // @ApiOperation({
|
|
|
+ // summary: '按位置获取广告',
|
|
|
+ // description:
|
|
|
+ // '根据场景(scene)、插槽(slot)、广告类型(adType)获取可用广告。数据来源对齐 Prisma Mongo Ads 模型。示例:/ads/placement?scene=home&slot=top&adType=BANNER',
|
|
|
+ // })
|
|
|
+ // @ApiResponse({ status: 200, description: '成功返回广告或null', type: AdDto })
|
|
|
+ // async getAdForPlacement(
|
|
|
+ // @Query() query: GetAdPlacementQueryDto,
|
|
|
+ // ): Promise<AdDto | null> {
|
|
|
+ // const { scene, slot, adType, maxTries } = query;
|
|
|
|
|
|
- const maxTriesNum =
|
|
|
- maxTries != null ? Number.parseInt(maxTries, 10) || 3 : 3;
|
|
|
+ // const maxTriesNum =
|
|
|
+ // maxTries != null ? Number.parseInt(maxTries, 10) || 3 : 3;
|
|
|
|
|
|
- const ad = await this.adService.getAdForPlacement({
|
|
|
- scene,
|
|
|
- slot,
|
|
|
- adType,
|
|
|
- maxTries: maxTriesNum,
|
|
|
- });
|
|
|
+ // const ad = await this.adService.getAdForPlacement({
|
|
|
+ // scene,
|
|
|
+ // slot,
|
|
|
+ // adType,
|
|
|
+ // maxTries: maxTriesNum,
|
|
|
+ // });
|
|
|
|
|
|
- // Optional logging for debugging / analytics:
|
|
|
- if (!ad) {
|
|
|
- this.logger.debug(
|
|
|
- `No ad returned for scene=${scene}, slot=${slot}, adType=${adType}`,
|
|
|
- );
|
|
|
- }
|
|
|
+ // // Optional logging for debugging / analytics:
|
|
|
+ // if (!ad) {
|
|
|
+ // this.logger.debug(
|
|
|
+ // `No ad returned for scene=${scene}, slot=${slot}, adType=${adType}`,
|
|
|
+ // );
|
|
|
+ // }
|
|
|
|
|
|
- // Let your global response interceptor wrap this into:
|
|
|
- // { status, code, data, error, timestamp, ... }
|
|
|
- return ad;
|
|
|
- }
|
|
|
+ // // Let your global response interceptor wrap this into:
|
|
|
+ // // { status, code, data, error, timestamp, ... }
|
|
|
+ // return ad;
|
|
|
+ // }
|
|
|
|
|
|
/**
|
|
|
* POST /api/v1/ads/list
|