From b651be292e5638b674e0e6de29373b6b96c5f703 Mon Sep 17 00:00:00 2001 From: hyoseung930 <35983843+hyoseung930@users.noreply.github.com> Date: Fri, 17 Apr 2026 10:30:40 +0900 Subject: [PATCH] =?UTF-8?q?=EC=BF=A0=ED=8F=B0=20=EC=9E=90=EB=8F=99=20?= =?UTF-8?q?=EC=9E=85=EB=A0=A5=20=EC=82=AC=EC=9D=B4=ED=8A=B8=20=EC=9E=91?= =?UTF-8?q?=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 배포 완료. 이제: - **FID 탭**: FID 직접 입력 → WOS API 호출 → DB 저장 → 쿠폰 자동 지급 - **닉네임 탭**: 닉네임 입력 시 DB에서 실시간 검색 → 선택하면 자동으로 FID 조회 및 쿠폰 지급 --- back/src/wos/wos.controller.ts | 8 ++- back/src/wos/wos.service.ts | 9 +++ front/src/views/HomeView.vue | 106 ++++++++++++++++++++++++++++++++- 3 files changed, 120 insertions(+), 3 deletions(-) diff --git a/back/src/wos/wos.controller.ts b/back/src/wos/wos.controller.ts index 29fd751..71b9dcb 100644 --- a/back/src/wos/wos.controller.ts +++ b/back/src/wos/wos.controller.ts @@ -1,4 +1,4 @@ -import { Controller, Post, Get, Delete, Patch, Body, Param, HttpCode } from '@nestjs/common'; +import { Controller, Post, Get, Delete, Patch, Body, Param, Query, HttpCode } from '@nestjs/common'; import { WosService } from './wos.service'; @Controller('api') @@ -28,6 +28,12 @@ export class WosController { return this.wosService.listUsers(); } + @Get('users/search') + async searchUsers(@Query('q') q: string) { + if (!q || q.trim().length === 0) return []; + return this.wosService.searchUsersByNickname(q.trim()); + } + @Get('history/:fid') async getHistory(@Param('fid') fid: string) { return this.wosService.getHistory(fid); diff --git a/back/src/wos/wos.service.ts b/back/src/wos/wos.service.ts index eaef255..e41543d 100644 --- a/back/src/wos/wos.service.ts +++ b/back/src/wos/wos.service.ts @@ -228,6 +228,15 @@ export class WosService { return this.wosUserRepo.find({ order: { created_at: 'DESC' } }); } + async searchUsersByNickname(nickname: string) { + return this.wosUserRepo + .createQueryBuilder('u') + .where('u.nickname LIKE :q', { q: `%${nickname}%` }) + .orderBy('u.nickname', 'ASC') + .limit(20) + .getMany(); + } + async listCoupons() { return this.wosCouponRepo.find({ order: { created_at: 'DESC' } }); } diff --git a/front/src/views/HomeView.vue b/front/src/views/HomeView.vue index a1743da..d919a53 100644 --- a/front/src/views/HomeView.vue +++ b/front/src/views/HomeView.vue @@ -27,7 +27,12 @@
-
+
+ + +
+ +
🎁 쿠폰 받기
+ +
+
+ +
+ +
+
+
+

{{ store.errorMsg }}

@@ -61,13 +93,18 @@