diff --git a/back/src/wos/wos.controller.ts b/back/src/wos/wos.controller.ts
index 71b9dcb..ccb7fb2 100644
--- a/back/src/wos/wos.controller.ts
+++ b/back/src/wos/wos.controller.ts
@@ -1,5 +1,8 @@
-import { Controller, Post, Get, Delete, Patch, Body, Param, Query, HttpCode } from '@nestjs/common';
+import { Controller, Post, Get, Delete, Patch, Body, Param, Query, HttpCode, BadRequestException, ForbiddenException } from '@nestjs/common';
import { WosService } from './wos.service';
+import axios from 'axios';
+
+const ALLIANCE_API = 'http://localhost:3005/api';
@Controller('api')
export class WosController {
@@ -59,4 +62,25 @@ export class WosController {
async deleteCoupon(@Param('id') id: string) {
return this.wosService.deleteCoupon(Number(id));
}
+
+ @Get('alliances')
+ async getAlliances() {
+ const { data } = await axios.get(`${ALLIANCE_API}/alliances`);
+ return data;
+ }
+
+ @Post('alliance-members')
+ @HttpCode(200)
+ async getAllianceMembers(@Body() body: { alliance_id: number; pin: string }) {
+ if (!body.alliance_id || !body.pin) throw new BadRequestException('alliance_id와 pin이 필요합니다');
+ try {
+ await axios.get(`${ALLIANCE_API}/alliances/${body.alliance_id}/pending`, { params: { pin: body.pin } });
+ } catch {
+ throw new ForbiddenException('PIN이 틀렸습니다');
+ }
+ const { data: members } = await axios.get(`${ALLIANCE_API}/members`, { params: { alliance_id: body.alliance_id } });
+ const wosUsers = await this.wosService.listUsers();
+ const nicknameSet = new Set(wosUsers.map((u: any) => u.nickname?.toLowerCase()));
+ return members.map((m: any) => ({ ...m, in_coupon_system: nicknameSet.has(m.nickname?.toLowerCase()) }));
+ }
}
diff --git a/front/src/components/AlliancePanel.vue b/front/src/components/AlliancePanel.vue
new file mode 100644
index 0000000..0de0ff8
--- /dev/null
+++ b/front/src/components/AlliancePanel.vue
@@ -0,0 +1,326 @@
+
+