Преглед изворни кода

refactor: comment out unused modules and endpoints in Ad and SysParams controllers

Dave пре 2 месеци
родитељ
комит
452c9ef1a7

+ 1 - 1
apps/box-app-api/src/app.module.ts

@@ -51,7 +51,7 @@ import { AuthModule } from './feature/auth/auth.module';
     HealthModule,
     VideoModule,
     AdModule,
-    HomepageModule,
+    // HomepageModule,
     SysParamsModule,
   ],
   providers: [

+ 29 - 29
apps/box-app-api/src/feature/ads/ad.controller.ts

@@ -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

+ 15 - 15
apps/box-app-api/src/feature/sys-params/sys-params.controller.ts

@@ -7,21 +7,21 @@ import { SysParamsService } from './sys-params.service';
 export class SysParamsController {
   constructor(private readonly service: SysParamsService) {}
 
-  @Get('constants')
-  @ApiOperation({
-    summary: '获取前端所需常量与枚举',
-    description:
-      '返回预定义分组的常量与枚举:homepage / ads / video / system。包含广告排序、系统参数侧、分类类型、广告槽位、推荐分类ID与名称等。',
-  })
-  @ApiResponse({ status: 200, description: '成功返回常量对象' })
-  @ApiQuery({
-    name: 'group',
-    required: false,
-    description: '常量分组(默认homepage)',
-  })
-  getConstants(@Query('group') group?: string) {
-    return this.service.getConstantsFiltered(group);
-  }
+  // @Get('constants')
+  // @ApiOperation({
+  //   summary: '获取前端所需常量与枚举',
+  //   description:
+  //     '返回预定义分组的常量与枚举:homepage / ads / video / system。包含广告排序、系统参数侧、分类类型、广告槽位、推荐分类ID与名称等。',
+  // })
+  // @ApiResponse({ status: 200, description: '成功返回常量对象' })
+  // @ApiQuery({
+  //   name: 'group',
+  //   required: false,
+  //   description: '常量分组(默认homepage)',
+  // })
+  // getConstants(@Query('group') group?: string) {
+  //   return this.service.getConstantsFiltered(group);
+  // }
 
   @Get('ad-types')
   @ApiOperation({