Explorar o código

chore(ad.controller): comment out getAdUrl method and its related decorators
chore(auth.service): comment out startupAdWithoutUrl logic in login response

Dave hai 2 meses
pai
achega
934bba858b

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

@@ -89,54 +89,54 @@ export class AdController {
    *
    * Example: GET /ads/507f1f77bcf86cd799439011/url
    */
-  @Get(':id/url')
-  @UseGuards(JwtAuthGuard)
-  @ApiBearerAuth()
-  @ApiOperation({
-    summary: '获取广告URL',
-    description:
-      '通过广告ID获取广告链接。需要JWT认证。返回广告URL并记录点击事件。',
-  })
-  @ApiResponse({
-    status: 200,
-    description: '成功返回广告URL',
-    type: AdUrlResponseDto,
-  })
-  @ApiResponse({ status: 401, description: '未授权 - 需要JWT token' })
-  @ApiResponse({ status: 404, description: '广告不存在或已过期' })
-  async getAdUrl(
-    @Param('id') adsId: string,
-    @Req() req: RequestWithUser,
-  ): Promise<AdUrlResponseDto> {
-    const uid = req.user?.uid;
-
-    if (!uid) {
-      this.logger.error('JWT payload missing uid');
-      throw new NotFoundException('User not authenticated');
-    }
-
-    // Extract client IP
-    const ip =
-      (req.headers['x-forwarded-for'] as string)?.split(',')[0]?.trim() ||
-      (req.headers['x-real-ip'] as string) ||
-      req.ip ||
-      'unknown';
-
-    // Extract optional headers
-    const userAgent = req.headers['user-agent'];
-    const appVersion = req.headers['app-version'] as string | undefined;
-    const os = req.headers['os'] as string | undefined;
-
-    // Delegate to service for business logic
-    return this.adService.getAdUrlAndPublishClick(
-      adsId,
-      uid,
-      ip,
-      userAgent,
-      appVersion,
-      os,
-    );
-  }
+  // @Get(':id/url')
+  // @UseGuards(JwtAuthGuard)
+  // @ApiBearerAuth()
+  // @ApiOperation({
+  //   summary: '获取广告URL',
+  //   description:
+  //     '通过广告ID获取广告链接。需要JWT认证。返回广告URL并记录点击事件。',
+  // })
+  // @ApiResponse({
+  //   status: 200,
+  //   description: '成功返回广告URL',
+  //   type: AdUrlResponseDto,
+  // })
+  // @ApiResponse({ status: 401, description: '未授权 - 需要JWT token' })
+  // @ApiResponse({ status: 404, description: '广告不存在或已过期' })
+  // async getAdUrl(
+  //   @Param('id') adsId: string,
+  //   @Req() req: RequestWithUser,
+  // ): Promise<AdUrlResponseDto> {
+  //   const uid = req.user?.uid;
+
+  //   if (!uid) {
+  //     this.logger.error('JWT payload missing uid');
+  //     throw new NotFoundException('User not authenticated');
+  //   }
+
+  //   // Extract client IP
+  //   const ip =
+  //     (req.headers['x-forwarded-for'] as string)?.split(',')[0]?.trim() ||
+  //     (req.headers['x-real-ip'] as string) ||
+  //     req.ip ||
+  //     'unknown';
+
+  //   // Extract optional headers
+  //   const userAgent = req.headers['user-agent'];
+  //   const appVersion = req.headers['app-version'] as string | undefined;
+  //   const os = req.headers['os'] as string | undefined;
+
+  //   // Delegate to service for business logic
+  //   return this.adService.getAdUrlAndPublishClick(
+  //     adsId,
+  //     uid,
+  //     ip,
+  //     userAgent,
+  //     appVersion,
+  //     os,
+  //   );
+  // }
 
   /**
    * POST /ads/click

+ 6 - 6
apps/box-app-api/src/feature/auth/auth.service.ts

@@ -79,13 +79,13 @@ export class AuthService {
     } catch (err) {
       this.logger.error('Failed to get startup ad for login', err);
     }
-    let startupAdWithoutUrl: Omit<AdPayload, 'adsUrl'> | null = null;
+    // let startupAdWithoutUrl: Omit<AdPayload, 'adsUrl'> | null = null;
 
-    if (startupAd) {
-      const { adsUrl, ...rest } = startupAd;
-      startupAdWithoutUrl = rest;
-    }
+    // if (startupAd) {
+    //   const { adsUrl, ...rest } = startupAd;
+    //   startupAdWithoutUrl = rest;
+    // }
 
-    return { accessToken, startupAd: startupAdWithoutUrl };
+    return { accessToken, startupAd };
   }
 }