From 556385bd6228820661baee56047b77f048c8b295 Mon Sep 17 00:00:00 2001 From: Yejin0O0 Date: Mon, 11 Nov 2024 17:10:52 +0900 Subject: [PATCH 1/8] feat: update MatchPlayerBlock design --- .../TournamentBracket/MatchPlayerBlock.tsx | 33 ++++++++++++++----- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/components/club/TournamentBracket/MatchPlayerBlock.tsx b/components/club/TournamentBracket/MatchPlayerBlock.tsx index 47e8c08..087edc2 100644 --- a/components/club/TournamentBracket/MatchPlayerBlock.tsx +++ b/components/club/TournamentBracket/MatchPlayerBlock.tsx @@ -1,4 +1,4 @@ -import { getTierWithEmoji } from "@/utils/getTierWithEmoji"; +import { getTierWithEmoji } from "@/utils/getTier"; import React from "react"; export type Player = { @@ -8,17 +8,32 @@ export type Player = { score: number; }; -interface PlayerNodeProps extends Player {} +interface MatchPlayerBlockProps extends Player {} -function PlayerNode({ imgUrl, name, tier, score }: PlayerNodeProps) { +function MatchPlayerBlock({ + imgUrl, + name, + tier, + score, +}: MatchPlayerBlockProps) { return ( -
- profile - {name} - {getTierWithEmoji(tier)} - {score} +
+ profile +
+ + {getTierWithEmoji(tier)} + + + {name} + +
+ {score}
); } -export default PlayerNode; +export default MatchPlayerBlock; From 329455482c20675e47d9b3769685d678a093f4ed Mon Sep 17 00:00:00 2001 From: Yejin0O0 Date: Mon, 11 Nov 2024 17:11:06 +0900 Subject: [PATCH 2/8] feat: add getTier --- components/club/LeagueList.tsx | 4 ++-- components/club/MemberInfo.tsx | 4 ++-- components/pages/LiveMatchList.tsx | 8 ++++---- components/pages/MyPage.tsx | 4 ++-- components/pages/club/LeagueDetail.tsx | 4 ++-- utils/{getTierWithEmoji.ts => getTier.ts} | 15 ++++++++++++++- 6 files changed, 26 insertions(+), 13 deletions(-) rename utils/{getTierWithEmoji.ts => getTier.ts} (51%) diff --git a/components/club/LeagueList.tsx b/components/club/LeagueList.tsx index af0405f..4891ad3 100644 --- a/components/club/LeagueList.tsx +++ b/components/club/LeagueList.tsx @@ -4,7 +4,7 @@ import { useGetDateLeagues } from "@/lib/api/hooks/leagueHook"; // import { useGetMyInfo } from "@/lib/api/hooks/memberHook"; import type { components } from "@/schemas/schema"; import { getLeagueType } from "@/utils/getLeagueType"; -import { getTierWithEmoji } from "@/utils/getTierWithEmoji"; +import { getTierWithEmojiAndText } from "@/utils/getTier"; import { format } from "date-fns"; import { CalendarPlus } from "lucide-react"; import Link from "next/link"; @@ -47,7 +47,7 @@ function ScheduleList(props: ScheduleListProps) {
- {getTierWithEmoji(schedule.required_tier as string)} + {getTierWithEmojiAndText(schedule.required_tier as string)}
diff --git a/components/club/MemberInfo.tsx b/components/club/MemberInfo.tsx index 795da22..f6ec32f 100644 --- a/components/club/MemberInfo.tsx +++ b/components/club/MemberInfo.tsx @@ -3,7 +3,7 @@ import MemberDropDown from "@/components/club/MemberDropdown"; import IconButton from "@/components/ui/IconButton"; import type { components } from "@/schemas/schema"; -import { getTierWithEmoji } from "@/utils/getTierWithEmoji"; +import { getTierWithEmojiAndText } from "@/utils/getTier"; import { AlignJustify } from "lucide-react"; type ClubMemberResponse = components["schemas"]["ClubMemberResponse"]; @@ -48,7 +48,7 @@ function MemberInfo({ memberData, isOpen, onToggle }: MemberInfoProps) {

- {/* {getTierWithEmoji(memberData.tier as string)} */} + {/* {getTierWithEmojiAndText(memberData.tier as string)} */}

diff --git a/components/pages/LiveMatchList.tsx b/components/pages/LiveMatchList.tsx index 0a1a546..15443a8 100644 --- a/components/pages/LiveMatchList.tsx +++ b/components/pages/LiveMatchList.tsx @@ -9,7 +9,7 @@ import { AccordionTrigger, } from "@/components/ui/accordion"; import { Badge } from "@/components/ui/badge"; -import { getTierWithEmoji } from "@/utils/getTierWithEmoji"; +import { getTierWithEmojiAndText } from "@/utils/getTier"; import { format } from "date-fns"; import Link from "next/link"; import SImage from "../ui/Image"; @@ -308,7 +308,7 @@ const renderLeagueTierBadge = (tier: LeagueTier) => { variant="outline" className="font-semibold px-2 py-0.5 text-xs rounded-full border-0 w-fit bg-yellow-200 text-yellow-800" > - {getTierWithEmoji(tier)} + {getTierWithEmojiAndText(tier)} ); } @@ -319,7 +319,7 @@ const renderLeagueTierBadge = (tier: LeagueTier) => { variant="outline" className="font-semibold px-2 py-0.5 text-xs rounded-full border-0 w-fit bg-gray-200 text-gray-700" > - {getTierWithEmoji(tier)} + {getTierWithEmojiAndText(tier)} ); } @@ -330,7 +330,7 @@ const renderLeagueTierBadge = (tier: LeagueTier) => { variant="outline" className="font-semibold px-2 py-0.5 text-xs rounded-full border-0 w-fit bg-orange-200 text-orange-800" > - {getTierWithEmoji(tier)} + {getTierWithEmojiAndText(tier)} ); } diff --git a/components/pages/MyPage.tsx b/components/pages/MyPage.tsx index 48923cd..03ab3e4 100644 --- a/components/pages/MyPage.tsx +++ b/components/pages/MyPage.tsx @@ -10,7 +10,7 @@ import { useGetMembersMyPage, } from "@/lib/api/hooks/memberHook"; import type { GetMemberMachesRecord } from "@/types/memberTypes"; -import { getTierWithEmoji } from "@/utils/getTierWithEmoji"; +import { getTierWithEmojiAndText } from "@/utils/getTier"; import { format } from "date-fns"; import { History, Inbox, Medal, Trophy, User, Users } from "lucide-react"; import Link from "next/link"; @@ -79,7 +79,7 @@ function MyPage() { {myPage?.name}

- ({getTierWithEmoji(myPage?.tier || "")} ) + ({getTierWithEmojiAndText(myPage?.tier || "")} )

{myPage?.email}

diff --git a/components/pages/club/LeagueDetail.tsx b/components/pages/club/LeagueDetail.tsx index e162317..01e0e78 100644 --- a/components/pages/club/LeagueDetail.tsx +++ b/components/pages/club/LeagueDetail.tsx @@ -10,7 +10,7 @@ import { } from "@/lib/api/hooks/leagueHook"; import { usePostMatches } from "@/lib/api/hooks/matchHook"; // import { useGetMyInfo } from "@/lib/api/hooks/memberHook"; -import { getTierWithEmoji } from "@/utils/getTierWithEmoji"; +import { getTierWithEmojiAndText } from "@/utils/getTier"; import { format } from "date-fns"; import { Award, @@ -229,7 +229,7 @@ function LeagueDetail() {

์ง€์› ํ‹ฐ์–ด

- {getTierWithEmoji(league?.required_tier || "")} + {getTierWithEmojiAndText(league?.required_tier || "")}

diff --git a/utils/getTierWithEmoji.ts b/utils/getTier.ts similarity index 51% rename from utils/getTierWithEmoji.ts rename to utils/getTier.ts index ef89ae9..6301256 100644 --- a/utils/getTierWithEmoji.ts +++ b/utils/getTier.ts @@ -1,4 +1,4 @@ -export const getTierWithEmoji = (tier: string) => { +export const getTierWithEmojiAndText = (tier: string) => { switch (tier) { case "GOLD": return "๐Ÿฅ‡ ๊ณจ๋“œ"; @@ -10,3 +10,16 @@ export const getTierWithEmoji = (tier: string) => { return ""; } }; + +export const getTierWithEmoji = (tier: string) => { + switch (tier) { + case "GOLD": + return "๐Ÿฅ‡"; + case "SILVER": + return "๐Ÿฅˆ"; + case "BRONZE": + return "๐Ÿฅ‰"; + default: + return ""; + } +}; From d8fb4d25348b2cfda4e77f8bba0519d6524fda47 Mon Sep 17 00:00:00 2001 From: Yejin0O0 Date: Thu, 14 Nov 2024 17:04:28 +0900 Subject: [PATCH 3/8] =?UTF-8?q?feat:=20=EA=B5=AC=EC=A1=B0=20=EA=B5=AC?= =?UTF-8?q?=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../club/TournamentBracket/MatchNode.tsx | 15 +- .../TournamentBracket/MatchPlayerBlock.tsx | 43 ++-- components/club/TournamentBracket/index.tsx | 60 ++++-- schemas/schema.d.ts | 193 ++++++++++++++++-- types/matchTypes.ts | 3 + 5 files changed, 245 insertions(+), 69 deletions(-) create mode 100644 types/matchTypes.ts diff --git a/components/club/TournamentBracket/MatchNode.tsx b/components/club/TournamentBracket/MatchNode.tsx index f373996..2a4ef9b 100644 --- a/components/club/TournamentBracket/MatchNode.tsx +++ b/components/club/TournamentBracket/MatchNode.tsx @@ -1,9 +1,10 @@ +import type { MatchParticipant } from "@/types/matchTypes"; import { Handle, Position } from "@xyflow/react"; -import PlayerNode, { type Player } from "./MatchPlayerBlock"; +import MatchPlayerBlock from "./MatchPlayerBlock"; export type CustomNodeData = { - player1: Player; - player2: Player; + player1: MatchParticipant; + player2: MatchParticipant; }; interface MatchNodeProps { @@ -14,10 +15,10 @@ interface MatchNodeProps { function MatchNode({ data }: MatchNodeProps) { return (
- - - - + + + +
); } diff --git a/components/club/TournamentBracket/MatchPlayerBlock.tsx b/components/club/TournamentBracket/MatchPlayerBlock.tsx index 087edc2..78c3df9 100644 --- a/components/club/TournamentBracket/MatchPlayerBlock.tsx +++ b/components/club/TournamentBracket/MatchPlayerBlock.tsx @@ -1,37 +1,32 @@ +import type { MatchParticipant } from "@/types/matchTypes"; import { getTierWithEmoji } from "@/utils/getTier"; import React from "react"; -export type Player = { - imgUrl: string; - name: string; - tier: "GOLD" | "SILVER" | "BRONZE"; - score: number; -}; - -interface MatchPlayerBlockProps extends Player {} +interface MatchPlayerBlockProps extends MatchParticipant {} function MatchPlayerBlock({ - imgUrl, + image, name, tier, - score, + participant_win_set_count, }: MatchPlayerBlockProps) { return ( -
- profile -
- - {getTierWithEmoji(tier)} - - - {name} - +
+
+ profile +
+ + {name} {getTierWithEmoji(tier || "")} + +
- {score} + + {participant_win_set_count} +
); } diff --git a/components/club/TournamentBracket/index.tsx b/components/club/TournamentBracket/index.tsx index ae956ce..3f0a688 100644 --- a/components/club/TournamentBracket/index.tsx +++ b/components/club/TournamentBracket/index.tsx @@ -13,16 +13,16 @@ const initialNodes: Node[] = [ id: "1", data: { player1: { - imgUrl: "/images/dummy-image.jpg", + image: "/images/dummy-image.jpg", name: "์œค์˜ˆ์ง„", tier: "BRONZE", - score: 0, + participant_win_set_count: 0, }, player2: { - imgUrl: "/images/dummy-image.jpg", + image: "/images/dummy-image.jpg", name: "์ด๊ฐ•๋ฏผ", tier: "BRONZE", - score: 4, + participant_win_set_count: 4, }, }, position: { x: 5, y: 5 }, @@ -32,30 +32,54 @@ const initialNodes: Node[] = [ id: "2", data: { player1: { - imgUrl: "/images/dummy-image.jpg", - name: "์œค์˜ˆ์ง„1", - tier: "BRONZE", - score: 0, + image: "/images/dummy-image.jpg", + name: "์œค์˜ˆ์ง„2", + tier: "SILVER", + participant_win_set_count: 0, }, player2: { - imgUrl: "/images/dummy-image.jpg", + image: "/images/dummy-image.jpg", name: "์ด๊ฐ•๋ฏผ2", + tier: "SILVER", + participant_win_set_count: 4, + }, + }, + position: { x: 5, y: 155 }, + type: "match", + }, + { + id: "3", + data: { + player1: { + image: "/images/dummy-image.jpg", + name: "์œค์˜ˆ์ง„3", + tier: "BRONZE", + participant_win_set_count: 0, + }, + player2: { + image: "/images/dummy-image.jpg", + name: "์ด๊ฐ•๋ฏผ3", tier: "BRONZE", - score: 4, + participant_win_set_count: 4, }, }, - position: { x: 500, y: 5 }, + position: { x: 485, y: 80 }, type: "match", }, ]; const initialEdges: Edge[] = [ { - id: "e1-2", + id: "e1-3", + source: "1", + target: "3", + type: "smoothstep", + }, + { + id: "e2-3", source: "2", - // sourceHandle: "right", - // targetHandle: "left", - target: "1", + target: "3", + type: "smoothstep", }, ]; @@ -63,11 +87,15 @@ export default function TournamentBracket() { const nodeTypes = useMemo(() => ({ match: MatchNode }), []); return ( -
+
diff --git a/schemas/schema.d.ts b/schemas/schema.d.ts index 4e8f76e..a2d0f7c 100644 --- a/schemas/schema.d.ts +++ b/schemas/schema.d.ts @@ -122,6 +122,19 @@ export interface paths { /** * ๊ฒฝ๊ธฐ๋ฅผ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค. * @description ๊ฒฝ๊ธฐ ์ƒ์„ฑํ•˜๊ณ ๋ฅผ ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค์— ์ €์žฅํ•ฉ๋‹ˆ๋‹ค. + * + * 1. ๊ฒฝ๊ธฐ ์ด๋ฆ„ 2 ~ 20 ๊ธ€์ž + * 2. ๊ฒฝ๊ธฐ ์„ค๋ช… 2 ~ 1000 ๊ธ€์ž + * 3. ๊ฒฝ๊ธฐ ์žฅ์†Œ 2 ~ 100 ๊ธ€์ž + * 4. ๊ฒฝ๊ธฐ ์‹œ๊ฐ„: ํ˜„์žฌ ์‹œ๊ฐ„ ๋ณด๋‹ค ๋’ค์— ์„ค์ • + * 5. ๋ชจ์ง‘ ๋งˆ๊ฐ ๋‚ ์งœ: ํ˜„์žฌ ์‹œ๊ฐ„ ๋ณด๋‹ค ๋’ค์—, ๊ฒฝ๊ธฐ ์‹œ๊ฐ„ ๋‚ ์งœ ๋ณด๋‹ค ์•ž์— + * 6. ์ฐธ๊ฐ€์ธ์›: + * ํ† ๋„ˆ๋จผํŠธ ์‹ฑ๊ธ€: 2์˜ ์ œ๊ณฑ + * ํ† ๋„ˆ๋จผํŠธ ๋”๋ธ”: ์ฐธ๊ฐ€์ž ์ˆ˜/2 ๊ฐ€ 2์˜ ์ œ๊ณฑ + * ํ”„๋ฆฌ ์‹ฑ๊ธ€: 2์˜ ๋ฐฐ์ˆ˜ + * ํ”„๋ฆฌ ๋”๋ธ”: 4์˜ ๋ฐฐ์ˆ˜ + * + * */ post: operations["createLeague"]; delete?: never; @@ -191,7 +204,13 @@ export interface paths { */ get: operations["getMatchSet"]; put?: never; - /** ์„ธํŠธ๋ณ„ ์ ์ˆ˜ ์ €์žฅ */ + /** + * ์„ธํŠธ๋ณ„ ์ ์ˆ˜ ์ €์žฅ + * @description + * 0~30 ์‚ฌ์ด์˜ ์ˆซ์ž๋งŒ ์ž…๋ ฅ + * + * + */ post: operations["updateSetsScore"]; delete?: never; options?: never; @@ -215,6 +234,10 @@ export interface paths { /** * ๋™ํ˜ธํšŒ ๊ฐ€์ž… ์‹ ์ฒญ * @description ๋™ํ˜ธํšŒ์— ๊ฐ€์ž…์„ ์‹ ์ฒญํ•ฉ๋‹ˆ๋‹ค. + * + * 1. ๊ฐ€์ž… ์‹ ์ฒญ ๊ธ€ 2 ~ 20์ž + * + * */ post: operations["applyClub"]; /** @@ -350,7 +373,17 @@ export interface paths { head?: never; /** * ๊ฒฝ๊ธฐ์˜ ์„ธ๋ถ€ ์ •๋ณด๋ฅผ ๋ณ€๊ฒฝํ•ฉ๋‹ˆ๋‹ค. - * @description ๊ฒฝ๊ธฐ ์ œ๋ชฉ, ๊ฒฝ๊ธฐ ์ƒํƒœ ๋“ฑ์„ ๋ณ€๊ฒฝํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. + * @description ๊ฒฝ๊ธฐ ์ด๋ฆ„, ์„ค๋ช…, ์ฐธ๊ฐ€์ž, ์‹ฑ๊ธ€/๋”๋ธ”, ํ”„๋ฆฌ/ํ† ๋„ˆ๋จผํŠธ ๋ณ€๊ฒฝ + * + * 1. ๊ฒฝ๊ธฐ ์ด๋ฆ„ 2 ~ 20 ๊ธ€์ž + * 2. ๊ฒฝ๊ธฐ ์„ค๋ช… 2 ~ 1000 ๊ธ€์ž + * 3. ์ฐธ๊ฐ€์ธ์›: + * ํ† ๋„ˆ๋จผํŠธ ์‹ฑ๊ธ€: 2์˜ ์ œ๊ณฑ + * ํ† ๋„ˆ๋จผํŠธ ๋”๋ธ”: ์ฐธ๊ฐ€์ž ์ˆ˜/2 ๊ฐ€ 2์˜ ์ œ๊ณฑ + * ํ”„๋ฆฌ ์‹ฑ๊ธ€: 2์˜ ๋ฐฐ์ˆ˜ + * ํ”„๋ฆฌ ๋”๋ธ”: 4์˜ ๋ฐฐ์ˆ˜ + * + * */ patch: operations["updateLeague"]; trace?: never; @@ -550,10 +583,7 @@ export interface paths { path?: never; cookie?: never; }; - /** - * ๋ฉ”์ธํŽ˜์ด์ง€์˜ ๊ฐ๊ฐ์˜ ๊ฒฝ๊ธฐ๋ฅผ ๋ˆŒ๋ €์„ ๋•Œ, ๊ฒฝ๊ธฐ๊ฐ€ ์ง„ํ–‰ ์ค‘์ผ ๊ฒฝ์šฐ ์ ์ˆ˜๋ฅผ ์กฐํšŒํ•œ๋‹ค. - * @description ์ ์ˆ˜๋Š” - */ + /** ๋ฉ”์ธํŽ˜์ด์ง€์˜ ๊ฐ๊ฐ์˜ ๊ฒฝ๊ธฐ๋ฅผ ๋ˆŒ๋ €์„ ๋•Œ, ๊ฒฝ๊ธฐ๊ฐ€ ์ง„ํ–‰ ์ค‘์ผ ๊ฒฝ์šฐ ์ ์ˆ˜๋ฅผ ์กฐํšŒํ•œ๋‹ค. */ get: operations["getLeagueScores"]; put?: never; post?: never; @@ -819,6 +849,7 @@ export interface components { | "LEAGUE_NOT_PARTICIPATED" | "LEAGUE_PARTICIPATION_ALREADY_CANCELED" | "CLUB_MEMBER_ALREADY_BANNED" + | "LEAGUE_ALREADY_CANCELED" | "DELETED" | "INVALID_PLAYER_COUNT" | "LEAGUE_RECRUITING_MUST_BE_COMPLETED_WHEN_BRACKET_GENERATION" @@ -831,6 +862,8 @@ export interface components { | "LEAGUE_OWNER_CANNOT_CANCEL_LEAGUE_PARTICIPATION" | "LEAGUE_CANNOT_BE_CANCELED_WHEN_IS_NOT_RECRUITING" | "LEAGUE_PARTICIPANT_POWER_OF_TWO" + | "LEAGUE_PARTICIPANTS_NOT_EXISTS" + | "SET_FINISHED" | "INTERNAL_SERVER_ERROR" | "SERVICE_UNAVAILABLE"; error_message_for_log?: string; @@ -915,6 +948,7 @@ export interface components { | "LEAGUE_NOT_PARTICIPATED" | "LEAGUE_PARTICIPATION_ALREADY_CANCELED" | "CLUB_MEMBER_ALREADY_BANNED" + | "LEAGUE_ALREADY_CANCELED" | "DELETED" | "INVALID_PLAYER_COUNT" | "LEAGUE_RECRUITING_MUST_BE_COMPLETED_WHEN_BRACKET_GENERATION" @@ -927,6 +961,8 @@ export interface components { | "LEAGUE_OWNER_CANNOT_CANCEL_LEAGUE_PARTICIPATION" | "LEAGUE_CANNOT_BE_CANCELED_WHEN_IS_NOT_RECRUITING" | "LEAGUE_PARTICIPANT_POWER_OF_TWO" + | "LEAGUE_PARTICIPANTS_NOT_EXISTS" + | "SET_FINISHED" | "INTERNAL_SERVER_ERROR" | "SERVICE_UNAVAILABLE"; error_message_for_log?: string; @@ -1017,6 +1053,7 @@ export interface components { | "LEAGUE_NOT_PARTICIPATED" | "LEAGUE_PARTICIPATION_ALREADY_CANCELED" | "CLUB_MEMBER_ALREADY_BANNED" + | "LEAGUE_ALREADY_CANCELED" | "DELETED" | "INVALID_PLAYER_COUNT" | "LEAGUE_RECRUITING_MUST_BE_COMPLETED_WHEN_BRACKET_GENERATION" @@ -1029,6 +1066,8 @@ export interface components { | "LEAGUE_OWNER_CANNOT_CANCEL_LEAGUE_PARTICIPATION" | "LEAGUE_CANNOT_BE_CANCELED_WHEN_IS_NOT_RECRUITING" | "LEAGUE_PARTICIPANT_POWER_OF_TWO" + | "LEAGUE_PARTICIPANTS_NOT_EXISTS" + | "SET_FINISHED" | "INTERNAL_SERVER_ERROR" | "SERVICE_UNAVAILABLE"; error_message_for_log?: string; @@ -1056,18 +1095,6 @@ export interface components { * @enum {string} */ tier_limit: "GOLD" | "SILVER" | "BRONZE"; - /** - * @description ๊ฒฝ๊ธฐ ์ƒํƒœ - * @example RECRUITING - * @enum {string} - */ - league_status: - | "ALL" - | "RECRUITING" - | "RECRUITING_COMPLETED" - | "PLAYING" - | "CANCELED" - | "FINISHED"; /** * @description ๊ฒฝ๊ธฐ ๋ฐฉ์‹ * @example SINGLES @@ -1076,17 +1103,17 @@ export interface components { match_type: "SINGLES" | "DOUBLES"; /** * Format: date-time - * @description ๊ฒฝ๊ธฐ ์‹œ์ž‘ ๋‚ ์งœ + * @description ๊ฒฝ๊ธฐ ์‹œ์ž‘ ๋‚ ์งœ, ๋ชจ์ง‘ ๋งˆ๊ฐ ๋‚ ์งœ๋Š” ํ˜„์žฌ ์‹œ๊ฐ„๋ณด๋‹ค ๋’ค์— ์„ค์ •๋˜์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. */ league_at: string; /** * Format: date-time - * @description ๋ชจ์ง‘ ๋งˆ๊ฐ ๋‚ ์งœ + * @description ๋ชจ์ง‘ ๋งˆ๊ฐ ๋‚ ์งœ, ๋ชจ์ง‘ ๋งˆ๊ฐ ๋‚ ์งœ๋Š” ํ˜„์žฌ ์‹œ๊ฐ„๋ณด๋‹ค ๋’ค์— ์„ค์ •๋˜์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. */ recruiting_closed_at: string; /** * Format: int32 - * @description ์ฐธ๊ฐ€์ธ์›: ํ† ๋„ˆ๋จผํŠธ ์‹ฑ๊ธ€์ด๋ฉด 2์˜ ์ œ๊ณฑ, ๋”๋ธ”์ด๋ฉด ์ฐธ๊ฐ€์ž์ˆ˜ /2 ๊ฐ€ 2์˜ ์ œ๊ณฑ + * @description ์ฐธ๊ฐ€์ธ์›: ํ† ๋„ˆ๋จผํŠธ ์‹ฑ๊ธ€์ด๋ฉด 2์˜ ์ œ๊ณฑ, ๋”๋ธ”์ด๋ฉด ์ฐธ๊ฐ€์ž์ˆ˜ /2 ๊ฐ€ 2์˜ ์ œ๊ณฑ, ํ”„๋ฆฌ ์‹ฑ๊ธ€์ด๋ฉด 2์˜ ๋ฐฐ์ˆ˜, ํ”„๋ฆฌ ๋”๋ธ”์ด๋ฉด 4์˜ ๋ฐฐ์ˆ˜ * @example 16 */ player_limit_count: number; @@ -1144,6 +1171,7 @@ export interface components { | "LEAGUE_NOT_PARTICIPATED" | "LEAGUE_PARTICIPATION_ALREADY_CANCELED" | "CLUB_MEMBER_ALREADY_BANNED" + | "LEAGUE_ALREADY_CANCELED" | "DELETED" | "INVALID_PLAYER_COUNT" | "LEAGUE_RECRUITING_MUST_BE_COMPLETED_WHEN_BRACKET_GENERATION" @@ -1156,6 +1184,8 @@ export interface components { | "LEAGUE_OWNER_CANNOT_CANCEL_LEAGUE_PARTICIPATION" | "LEAGUE_CANNOT_BE_CANCELED_WHEN_IS_NOT_RECRUITING" | "LEAGUE_PARTICIPANT_POWER_OF_TWO" + | "LEAGUE_PARTICIPANTS_NOT_EXISTS" + | "SET_FINISHED" | "INTERNAL_SERVER_ERROR" | "SERVICE_UNAVAILABLE"; error_message_for_log?: string; @@ -1269,6 +1299,7 @@ export interface components { | "LEAGUE_NOT_PARTICIPATED" | "LEAGUE_PARTICIPATION_ALREADY_CANCELED" | "CLUB_MEMBER_ALREADY_BANNED" + | "LEAGUE_ALREADY_CANCELED" | "DELETED" | "INVALID_PLAYER_COUNT" | "LEAGUE_RECRUITING_MUST_BE_COMPLETED_WHEN_BRACKET_GENERATION" @@ -1281,6 +1312,8 @@ export interface components { | "LEAGUE_OWNER_CANNOT_CANCEL_LEAGUE_PARTICIPATION" | "LEAGUE_CANNOT_BE_CANCELED_WHEN_IS_NOT_RECRUITING" | "LEAGUE_PARTICIPANT_POWER_OF_TWO" + | "LEAGUE_PARTICIPANTS_NOT_EXISTS" + | "SET_FINISHED" | "INTERNAL_SERVER_ERROR" | "SERVICE_UNAVAILABLE"; error_message_for_log?: string; @@ -1389,6 +1422,7 @@ export interface components { | "LEAGUE_NOT_PARTICIPATED" | "LEAGUE_PARTICIPATION_ALREADY_CANCELED" | "CLUB_MEMBER_ALREADY_BANNED" + | "LEAGUE_ALREADY_CANCELED" | "DELETED" | "INVALID_PLAYER_COUNT" | "LEAGUE_RECRUITING_MUST_BE_COMPLETED_WHEN_BRACKET_GENERATION" @@ -1401,6 +1435,8 @@ export interface components { | "LEAGUE_OWNER_CANNOT_CANCEL_LEAGUE_PARTICIPATION" | "LEAGUE_CANNOT_BE_CANCELED_WHEN_IS_NOT_RECRUITING" | "LEAGUE_PARTICIPANT_POWER_OF_TWO" + | "LEAGUE_PARTICIPANTS_NOT_EXISTS" + | "SET_FINISHED" | "INTERNAL_SERVER_ERROR" | "SERVICE_UNAVAILABLE"; error_message_for_log?: string; @@ -1438,6 +1474,11 @@ export interface components { name?: string; /** @description ์ฐธ๊ฐ€์ž ์ด๋ฏธ์ง€ */ image?: string; + /** + * @description ์ฐธ๊ฐ€์ž ํ‹ฐ์–ด + * @enum {string} + */ + tier?: "GOLD" | "SILVER" | "BRONZE"; /** * Format: int32 * @description ์ด๊ธด ์„ธํŠธ์ˆ˜ @@ -1518,6 +1559,7 @@ export interface components { | "LEAGUE_NOT_PARTICIPATED" | "LEAGUE_PARTICIPATION_ALREADY_CANCELED" | "CLUB_MEMBER_ALREADY_BANNED" + | "LEAGUE_ALREADY_CANCELED" | "DELETED" | "INVALID_PLAYER_COUNT" | "LEAGUE_RECRUITING_MUST_BE_COMPLETED_WHEN_BRACKET_GENERATION" @@ -1530,6 +1572,8 @@ export interface components { | "LEAGUE_OWNER_CANNOT_CANCEL_LEAGUE_PARTICIPATION" | "LEAGUE_CANNOT_BE_CANCELED_WHEN_IS_NOT_RECRUITING" | "LEAGUE_PARTICIPANT_POWER_OF_TWO" + | "LEAGUE_PARTICIPANTS_NOT_EXISTS" + | "SET_FINISHED" | "INTERNAL_SERVER_ERROR" | "SERVICE_UNAVAILABLE"; error_message_for_log?: string; @@ -1563,7 +1607,7 @@ export interface components { match_type: "SINGLES" | "DOUBLES"; }; ClubApplyRequest: { - apply_reason?: string; + apply_reason: string; }; ClubApplyResponse: { /** @@ -1626,6 +1670,7 @@ export interface components { | "LEAGUE_NOT_PARTICIPATED" | "LEAGUE_PARTICIPATION_ALREADY_CANCELED" | "CLUB_MEMBER_ALREADY_BANNED" + | "LEAGUE_ALREADY_CANCELED" | "DELETED" | "INVALID_PLAYER_COUNT" | "LEAGUE_RECRUITING_MUST_BE_COMPLETED_WHEN_BRACKET_GENERATION" @@ -1638,6 +1683,8 @@ export interface components { | "LEAGUE_OWNER_CANNOT_CANCEL_LEAGUE_PARTICIPATION" | "LEAGUE_CANNOT_BE_CANCELED_WHEN_IS_NOT_RECRUITING" | "LEAGUE_PARTICIPANT_POWER_OF_TWO" + | "LEAGUE_PARTICIPANTS_NOT_EXISTS" + | "SET_FINISHED" | "INTERNAL_SERVER_ERROR" | "SERVICE_UNAVAILABLE"; error_message_for_log?: string; @@ -1690,6 +1737,7 @@ export interface components { | "LEAGUE_NOT_PARTICIPATED" | "LEAGUE_PARTICIPATION_ALREADY_CANCELED" | "CLUB_MEMBER_ALREADY_BANNED" + | "LEAGUE_ALREADY_CANCELED" | "DELETED" | "INVALID_PLAYER_COUNT" | "LEAGUE_RECRUITING_MUST_BE_COMPLETED_WHEN_BRACKET_GENERATION" @@ -1702,6 +1750,8 @@ export interface components { | "LEAGUE_OWNER_CANNOT_CANCEL_LEAGUE_PARTICIPATION" | "LEAGUE_CANNOT_BE_CANCELED_WHEN_IS_NOT_RECRUITING" | "LEAGUE_PARTICIPANT_POWER_OF_TWO" + | "LEAGUE_PARTICIPANTS_NOT_EXISTS" + | "SET_FINISHED" | "INTERNAL_SERVER_ERROR" | "SERVICE_UNAVAILABLE"; error_message_for_log?: string; @@ -1775,6 +1825,7 @@ export interface components { | "LEAGUE_NOT_PARTICIPATED" | "LEAGUE_PARTICIPATION_ALREADY_CANCELED" | "CLUB_MEMBER_ALREADY_BANNED" + | "LEAGUE_ALREADY_CANCELED" | "DELETED" | "INVALID_PLAYER_COUNT" | "LEAGUE_RECRUITING_MUST_BE_COMPLETED_WHEN_BRACKET_GENERATION" @@ -1787,6 +1838,8 @@ export interface components { | "LEAGUE_OWNER_CANNOT_CANCEL_LEAGUE_PARTICIPATION" | "LEAGUE_CANNOT_BE_CANCELED_WHEN_IS_NOT_RECRUITING" | "LEAGUE_PARTICIPANT_POWER_OF_TWO" + | "LEAGUE_PARTICIPANTS_NOT_EXISTS" + | "SET_FINISHED" | "INTERNAL_SERVER_ERROR" | "SERVICE_UNAVAILABLE"; error_message_for_log?: string; @@ -1867,6 +1920,7 @@ export interface components { | "LEAGUE_NOT_PARTICIPATED" | "LEAGUE_PARTICIPATION_ALREADY_CANCELED" | "CLUB_MEMBER_ALREADY_BANNED" + | "LEAGUE_ALREADY_CANCELED" | "DELETED" | "INVALID_PLAYER_COUNT" | "LEAGUE_RECRUITING_MUST_BE_COMPLETED_WHEN_BRACKET_GENERATION" @@ -1879,6 +1933,8 @@ export interface components { | "LEAGUE_OWNER_CANNOT_CANCEL_LEAGUE_PARTICIPATION" | "LEAGUE_CANNOT_BE_CANCELED_WHEN_IS_NOT_RECRUITING" | "LEAGUE_PARTICIPANT_POWER_OF_TWO" + | "LEAGUE_PARTICIPANTS_NOT_EXISTS" + | "SET_FINISHED" | "INTERNAL_SERVER_ERROR" | "SERVICE_UNAVAILABLE"; error_message_for_log?: string; @@ -1961,6 +2017,7 @@ export interface components { | "LEAGUE_NOT_PARTICIPATED" | "LEAGUE_PARTICIPATION_ALREADY_CANCELED" | "CLUB_MEMBER_ALREADY_BANNED" + | "LEAGUE_ALREADY_CANCELED" | "DELETED" | "INVALID_PLAYER_COUNT" | "LEAGUE_RECRUITING_MUST_BE_COMPLETED_WHEN_BRACKET_GENERATION" @@ -1973,6 +2030,8 @@ export interface components { | "LEAGUE_OWNER_CANNOT_CANCEL_LEAGUE_PARTICIPATION" | "LEAGUE_CANNOT_BE_CANCELED_WHEN_IS_NOT_RECRUITING" | "LEAGUE_PARTICIPANT_POWER_OF_TWO" + | "LEAGUE_PARTICIPANTS_NOT_EXISTS" + | "SET_FINISHED" | "INTERNAL_SERVER_ERROR" | "SERVICE_UNAVAILABLE"; error_message_for_log?: string; @@ -2075,6 +2134,13 @@ export interface components { * @enum {string} */ tier: "GOLD" | "SILVER" | "BRONZE"; + /** @description ์ •์ง€ ์—ฌ๋ถ€ */ + is_banned?: boolean; + /** + * Format: date-time + * @description ์ •์ง€ ์ข…๋ฃŒ์ผ + */ + banned_end_date?: string; }; CommonResponseClubMemberResponse: { /** @enum {string} */ @@ -2123,6 +2189,7 @@ export interface components { | "LEAGUE_NOT_PARTICIPATED" | "LEAGUE_PARTICIPATION_ALREADY_CANCELED" | "CLUB_MEMBER_ALREADY_BANNED" + | "LEAGUE_ALREADY_CANCELED" | "DELETED" | "INVALID_PLAYER_COUNT" | "LEAGUE_RECRUITING_MUST_BE_COMPLETED_WHEN_BRACKET_GENERATION" @@ -2135,6 +2202,8 @@ export interface components { | "LEAGUE_OWNER_CANNOT_CANCEL_LEAGUE_PARTICIPATION" | "LEAGUE_CANNOT_BE_CANCELED_WHEN_IS_NOT_RECRUITING" | "LEAGUE_PARTICIPANT_POWER_OF_TWO" + | "LEAGUE_PARTICIPANTS_NOT_EXISTS" + | "SET_FINISHED" | "INTERNAL_SERVER_ERROR" | "SERVICE_UNAVAILABLE"; error_message_for_log?: string; @@ -2216,6 +2285,7 @@ export interface components { | "LEAGUE_NOT_PARTICIPATED" | "LEAGUE_PARTICIPATION_ALREADY_CANCELED" | "CLUB_MEMBER_ALREADY_BANNED" + | "LEAGUE_ALREADY_CANCELED" | "DELETED" | "INVALID_PLAYER_COUNT" | "LEAGUE_RECRUITING_MUST_BE_COMPLETED_WHEN_BRACKET_GENERATION" @@ -2228,6 +2298,8 @@ export interface components { | "LEAGUE_OWNER_CANNOT_CANCEL_LEAGUE_PARTICIPATION" | "LEAGUE_CANNOT_BE_CANCELED_WHEN_IS_NOT_RECRUITING" | "LEAGUE_PARTICIPANT_POWER_OF_TWO" + | "LEAGUE_PARTICIPANTS_NOT_EXISTS" + | "SET_FINISHED" | "INTERNAL_SERVER_ERROR" | "SERVICE_UNAVAILABLE"; error_message_for_log?: string; @@ -2285,6 +2357,7 @@ export interface components { | "LEAGUE_NOT_PARTICIPATED" | "LEAGUE_PARTICIPATION_ALREADY_CANCELED" | "CLUB_MEMBER_ALREADY_BANNED" + | "LEAGUE_ALREADY_CANCELED" | "DELETED" | "INVALID_PLAYER_COUNT" | "LEAGUE_RECRUITING_MUST_BE_COMPLETED_WHEN_BRACKET_GENERATION" @@ -2297,6 +2370,8 @@ export interface components { | "LEAGUE_OWNER_CANNOT_CANCEL_LEAGUE_PARTICIPATION" | "LEAGUE_CANNOT_BE_CANCELED_WHEN_IS_NOT_RECRUITING" | "LEAGUE_PARTICIPANT_POWER_OF_TWO" + | "LEAGUE_PARTICIPANTS_NOT_EXISTS" + | "SET_FINISHED" | "INTERNAL_SERVER_ERROR" | "SERVICE_UNAVAILABLE"; error_message_for_log?: string; @@ -2404,6 +2479,7 @@ export interface components { | "LEAGUE_NOT_PARTICIPATED" | "LEAGUE_PARTICIPATION_ALREADY_CANCELED" | "CLUB_MEMBER_ALREADY_BANNED" + | "LEAGUE_ALREADY_CANCELED" | "DELETED" | "INVALID_PLAYER_COUNT" | "LEAGUE_RECRUITING_MUST_BE_COMPLETED_WHEN_BRACKET_GENERATION" @@ -2416,6 +2492,8 @@ export interface components { | "LEAGUE_OWNER_CANNOT_CANCEL_LEAGUE_PARTICIPATION" | "LEAGUE_CANNOT_BE_CANCELED_WHEN_IS_NOT_RECRUITING" | "LEAGUE_PARTICIPANT_POWER_OF_TWO" + | "LEAGUE_PARTICIPANTS_NOT_EXISTS" + | "SET_FINISHED" | "INTERNAL_SERVER_ERROR" | "SERVICE_UNAVAILABLE"; error_message_for_log?: string; @@ -2542,6 +2620,7 @@ export interface components { | "LEAGUE_NOT_PARTICIPATED" | "LEAGUE_PARTICIPATION_ALREADY_CANCELED" | "CLUB_MEMBER_ALREADY_BANNED" + | "LEAGUE_ALREADY_CANCELED" | "DELETED" | "INVALID_PLAYER_COUNT" | "LEAGUE_RECRUITING_MUST_BE_COMPLETED_WHEN_BRACKET_GENERATION" @@ -2554,6 +2633,8 @@ export interface components { | "LEAGUE_OWNER_CANNOT_CANCEL_LEAGUE_PARTICIPATION" | "LEAGUE_CANNOT_BE_CANCELED_WHEN_IS_NOT_RECRUITING" | "LEAGUE_PARTICIPANT_POWER_OF_TWO" + | "LEAGUE_PARTICIPANTS_NOT_EXISTS" + | "SET_FINISHED" | "INTERNAL_SERVER_ERROR" | "SERVICE_UNAVAILABLE"; error_message_for_log?: string; @@ -2606,6 +2687,7 @@ export interface components { | "LEAGUE_NOT_PARTICIPATED" | "LEAGUE_PARTICIPATION_ALREADY_CANCELED" | "CLUB_MEMBER_ALREADY_BANNED" + | "LEAGUE_ALREADY_CANCELED" | "DELETED" | "INVALID_PLAYER_COUNT" | "LEAGUE_RECRUITING_MUST_BE_COMPLETED_WHEN_BRACKET_GENERATION" @@ -2618,6 +2700,8 @@ export interface components { | "LEAGUE_OWNER_CANNOT_CANCEL_LEAGUE_PARTICIPATION" | "LEAGUE_CANNOT_BE_CANCELED_WHEN_IS_NOT_RECRUITING" | "LEAGUE_PARTICIPANT_POWER_OF_TWO" + | "LEAGUE_PARTICIPANTS_NOT_EXISTS" + | "SET_FINISHED" | "INTERNAL_SERVER_ERROR" | "SERVICE_UNAVAILABLE"; error_message_for_log?: string; @@ -2773,6 +2857,7 @@ export interface components { | "LEAGUE_NOT_PARTICIPATED" | "LEAGUE_PARTICIPATION_ALREADY_CANCELED" | "CLUB_MEMBER_ALREADY_BANNED" + | "LEAGUE_ALREADY_CANCELED" | "DELETED" | "INVALID_PLAYER_COUNT" | "LEAGUE_RECRUITING_MUST_BE_COMPLETED_WHEN_BRACKET_GENERATION" @@ -2785,6 +2870,8 @@ export interface components { | "LEAGUE_OWNER_CANNOT_CANCEL_LEAGUE_PARTICIPATION" | "LEAGUE_CANNOT_BE_CANCELED_WHEN_IS_NOT_RECRUITING" | "LEAGUE_PARTICIPANT_POWER_OF_TWO" + | "LEAGUE_PARTICIPANTS_NOT_EXISTS" + | "SET_FINISHED" | "INTERNAL_SERVER_ERROR" | "SERVICE_UNAVAILABLE"; error_message_for_log?: string; @@ -2895,6 +2982,7 @@ export interface components { | "LEAGUE_NOT_PARTICIPATED" | "LEAGUE_PARTICIPATION_ALREADY_CANCELED" | "CLUB_MEMBER_ALREADY_BANNED" + | "LEAGUE_ALREADY_CANCELED" | "DELETED" | "INVALID_PLAYER_COUNT" | "LEAGUE_RECRUITING_MUST_BE_COMPLETED_WHEN_BRACKET_GENERATION" @@ -2907,6 +2995,8 @@ export interface components { | "LEAGUE_OWNER_CANNOT_CANCEL_LEAGUE_PARTICIPATION" | "LEAGUE_CANNOT_BE_CANCELED_WHEN_IS_NOT_RECRUITING" | "LEAGUE_PARTICIPANT_POWER_OF_TWO" + | "LEAGUE_PARTICIPANTS_NOT_EXISTS" + | "SET_FINISHED" | "INTERNAL_SERVER_ERROR" | "SERVICE_UNAVAILABLE"; error_message_for_log?: string; @@ -3018,6 +3108,7 @@ export interface components { | "LEAGUE_NOT_PARTICIPATED" | "LEAGUE_PARTICIPATION_ALREADY_CANCELED" | "CLUB_MEMBER_ALREADY_BANNED" + | "LEAGUE_ALREADY_CANCELED" | "DELETED" | "INVALID_PLAYER_COUNT" | "LEAGUE_RECRUITING_MUST_BE_COMPLETED_WHEN_BRACKET_GENERATION" @@ -3030,6 +3121,8 @@ export interface components { | "LEAGUE_OWNER_CANNOT_CANCEL_LEAGUE_PARTICIPATION" | "LEAGUE_CANNOT_BE_CANCELED_WHEN_IS_NOT_RECRUITING" | "LEAGUE_PARTICIPANT_POWER_OF_TWO" + | "LEAGUE_PARTICIPANTS_NOT_EXISTS" + | "SET_FINISHED" | "INTERNAL_SERVER_ERROR" | "SERVICE_UNAVAILABLE"; error_message_for_log?: string; @@ -3154,6 +3247,7 @@ export interface components { | "LEAGUE_NOT_PARTICIPATED" | "LEAGUE_PARTICIPATION_ALREADY_CANCELED" | "CLUB_MEMBER_ALREADY_BANNED" + | "LEAGUE_ALREADY_CANCELED" | "DELETED" | "INVALID_PLAYER_COUNT" | "LEAGUE_RECRUITING_MUST_BE_COMPLETED_WHEN_BRACKET_GENERATION" @@ -3166,6 +3260,8 @@ export interface components { | "LEAGUE_OWNER_CANNOT_CANCEL_LEAGUE_PARTICIPATION" | "LEAGUE_CANNOT_BE_CANCELED_WHEN_IS_NOT_RECRUITING" | "LEAGUE_PARTICIPANT_POWER_OF_TWO" + | "LEAGUE_PARTICIPANTS_NOT_EXISTS" + | "SET_FINISHED" | "INTERNAL_SERVER_ERROR" | "SERVICE_UNAVAILABLE"; error_message_for_log?: string; @@ -3218,6 +3314,7 @@ export interface components { | "LEAGUE_NOT_PARTICIPATED" | "LEAGUE_PARTICIPATION_ALREADY_CANCELED" | "CLUB_MEMBER_ALREADY_BANNED" + | "LEAGUE_ALREADY_CANCELED" | "DELETED" | "INVALID_PLAYER_COUNT" | "LEAGUE_RECRUITING_MUST_BE_COMPLETED_WHEN_BRACKET_GENERATION" @@ -3230,6 +3327,8 @@ export interface components { | "LEAGUE_OWNER_CANNOT_CANCEL_LEAGUE_PARTICIPATION" | "LEAGUE_CANNOT_BE_CANCELED_WHEN_IS_NOT_RECRUITING" | "LEAGUE_PARTICIPANT_POWER_OF_TWO" + | "LEAGUE_PARTICIPANTS_NOT_EXISTS" + | "SET_FINISHED" | "INTERNAL_SERVER_ERROR" | "SERVICE_UNAVAILABLE"; error_message_for_log?: string; @@ -3358,6 +3457,7 @@ export interface components { | "LEAGUE_NOT_PARTICIPATED" | "LEAGUE_PARTICIPATION_ALREADY_CANCELED" | "CLUB_MEMBER_ALREADY_BANNED" + | "LEAGUE_ALREADY_CANCELED" | "DELETED" | "INVALID_PLAYER_COUNT" | "LEAGUE_RECRUITING_MUST_BE_COMPLETED_WHEN_BRACKET_GENERATION" @@ -3370,6 +3470,8 @@ export interface components { | "LEAGUE_OWNER_CANNOT_CANCEL_LEAGUE_PARTICIPATION" | "LEAGUE_CANNOT_BE_CANCELED_WHEN_IS_NOT_RECRUITING" | "LEAGUE_PARTICIPANT_POWER_OF_TWO" + | "LEAGUE_PARTICIPANTS_NOT_EXISTS" + | "SET_FINISHED" | "INTERNAL_SERVER_ERROR" | "SERVICE_UNAVAILABLE"; error_message_for_log?: string; @@ -3481,6 +3583,7 @@ export interface components { | "LEAGUE_NOT_PARTICIPATED" | "LEAGUE_PARTICIPATION_ALREADY_CANCELED" | "CLUB_MEMBER_ALREADY_BANNED" + | "LEAGUE_ALREADY_CANCELED" | "DELETED" | "INVALID_PLAYER_COUNT" | "LEAGUE_RECRUITING_MUST_BE_COMPLETED_WHEN_BRACKET_GENERATION" @@ -3493,6 +3596,8 @@ export interface components { | "LEAGUE_OWNER_CANNOT_CANCEL_LEAGUE_PARTICIPATION" | "LEAGUE_CANNOT_BE_CANCELED_WHEN_IS_NOT_RECRUITING" | "LEAGUE_PARTICIPANT_POWER_OF_TWO" + | "LEAGUE_PARTICIPANTS_NOT_EXISTS" + | "SET_FINISHED" | "INTERNAL_SERVER_ERROR" | "SERVICE_UNAVAILABLE"; error_message_for_log?: string; @@ -3574,6 +3679,7 @@ export interface components { | "LEAGUE_NOT_PARTICIPATED" | "LEAGUE_PARTICIPATION_ALREADY_CANCELED" | "CLUB_MEMBER_ALREADY_BANNED" + | "LEAGUE_ALREADY_CANCELED" | "DELETED" | "INVALID_PLAYER_COUNT" | "LEAGUE_RECRUITING_MUST_BE_COMPLETED_WHEN_BRACKET_GENERATION" @@ -3586,6 +3692,8 @@ export interface components { | "LEAGUE_OWNER_CANNOT_CANCEL_LEAGUE_PARTICIPATION" | "LEAGUE_CANNOT_BE_CANCELED_WHEN_IS_NOT_RECRUITING" | "LEAGUE_PARTICIPANT_POWER_OF_TWO" + | "LEAGUE_PARTICIPANTS_NOT_EXISTS" + | "SET_FINISHED" | "INTERNAL_SERVER_ERROR" | "SERVICE_UNAVAILABLE"; error_message_for_log?: string; @@ -3660,6 +3768,7 @@ export interface components { | "LEAGUE_NOT_PARTICIPATED" | "LEAGUE_PARTICIPATION_ALREADY_CANCELED" | "CLUB_MEMBER_ALREADY_BANNED" + | "LEAGUE_ALREADY_CANCELED" | "DELETED" | "INVALID_PLAYER_COUNT" | "LEAGUE_RECRUITING_MUST_BE_COMPLETED_WHEN_BRACKET_GENERATION" @@ -3672,6 +3781,8 @@ export interface components { | "LEAGUE_OWNER_CANNOT_CANCEL_LEAGUE_PARTICIPATION" | "LEAGUE_CANNOT_BE_CANCELED_WHEN_IS_NOT_RECRUITING" | "LEAGUE_PARTICIPANT_POWER_OF_TWO" + | "LEAGUE_PARTICIPANTS_NOT_EXISTS" + | "SET_FINISHED" | "INTERNAL_SERVER_ERROR" | "SERVICE_UNAVAILABLE"; error_message_for_log?: string; @@ -3754,6 +3865,7 @@ export interface components { | "LEAGUE_NOT_PARTICIPATED" | "LEAGUE_PARTICIPATION_ALREADY_CANCELED" | "CLUB_MEMBER_ALREADY_BANNED" + | "LEAGUE_ALREADY_CANCELED" | "DELETED" | "INVALID_PLAYER_COUNT" | "LEAGUE_RECRUITING_MUST_BE_COMPLETED_WHEN_BRACKET_GENERATION" @@ -3766,6 +3878,8 @@ export interface components { | "LEAGUE_OWNER_CANNOT_CANCEL_LEAGUE_PARTICIPATION" | "LEAGUE_CANNOT_BE_CANCELED_WHEN_IS_NOT_RECRUITING" | "LEAGUE_PARTICIPANT_POWER_OF_TWO" + | "LEAGUE_PARTICIPANTS_NOT_EXISTS" + | "SET_FINISHED" | "INTERNAL_SERVER_ERROR" | "SERVICE_UNAVAILABLE"; error_message_for_log?: string; @@ -3809,6 +3923,17 @@ export interface components { * @description ํ˜„์žฌ๊นŒ์ง€ ์ฐธ์—ฌํ•œ ์ธ์› */ participant_count: number; + /** + * @description ํ˜„์žฌ ๊ฒฝ๊ธฐ ์ƒํƒœ( ALL | RECRUITING | RECRUITING_COMPLETED | PLAYING | CANCELED | FINISHED) + * @enum {string} + */ + status: + | "ALL" + | "RECRUITING" + | "RECRUITING_COMPLETED" + | "PLAYING" + | "CANCELED" + | "FINISHED"; }; ClubMemberRoleResponse: { role_owner?: components["schemas"]["ClubMemberResponse"][]; @@ -3862,6 +3987,7 @@ export interface components { | "LEAGUE_NOT_PARTICIPATED" | "LEAGUE_PARTICIPATION_ALREADY_CANCELED" | "CLUB_MEMBER_ALREADY_BANNED" + | "LEAGUE_ALREADY_CANCELED" | "DELETED" | "INVALID_PLAYER_COUNT" | "LEAGUE_RECRUITING_MUST_BE_COMPLETED_WHEN_BRACKET_GENERATION" @@ -3874,6 +4000,8 @@ export interface components { | "LEAGUE_OWNER_CANNOT_CANCEL_LEAGUE_PARTICIPATION" | "LEAGUE_CANNOT_BE_CANCELED_WHEN_IS_NOT_RECRUITING" | "LEAGUE_PARTICIPANT_POWER_OF_TWO" + | "LEAGUE_PARTICIPANTS_NOT_EXISTS" + | "SET_FINISHED" | "INTERNAL_SERVER_ERROR" | "SERVICE_UNAVAILABLE"; error_message_for_log?: string; @@ -3926,6 +4054,7 @@ export interface components { | "LEAGUE_NOT_PARTICIPATED" | "LEAGUE_PARTICIPATION_ALREADY_CANCELED" | "CLUB_MEMBER_ALREADY_BANNED" + | "LEAGUE_ALREADY_CANCELED" | "DELETED" | "INVALID_PLAYER_COUNT" | "LEAGUE_RECRUITING_MUST_BE_COMPLETED_WHEN_BRACKET_GENERATION" @@ -3938,6 +4067,8 @@ export interface components { | "LEAGUE_OWNER_CANNOT_CANCEL_LEAGUE_PARTICIPATION" | "LEAGUE_CANNOT_BE_CANCELED_WHEN_IS_NOT_RECRUITING" | "LEAGUE_PARTICIPANT_POWER_OF_TWO" + | "LEAGUE_PARTICIPANTS_NOT_EXISTS" + | "SET_FINISHED" | "INTERNAL_SERVER_ERROR" | "SERVICE_UNAVAILABLE"; error_message_for_log?: string; @@ -4020,6 +4151,7 @@ export interface components { | "LEAGUE_NOT_PARTICIPATED" | "LEAGUE_PARTICIPATION_ALREADY_CANCELED" | "CLUB_MEMBER_ALREADY_BANNED" + | "LEAGUE_ALREADY_CANCELED" | "DELETED" | "INVALID_PLAYER_COUNT" | "LEAGUE_RECRUITING_MUST_BE_COMPLETED_WHEN_BRACKET_GENERATION" @@ -4032,6 +4164,8 @@ export interface components { | "LEAGUE_OWNER_CANNOT_CANCEL_LEAGUE_PARTICIPATION" | "LEAGUE_CANNOT_BE_CANCELED_WHEN_IS_NOT_RECRUITING" | "LEAGUE_PARTICIPANT_POWER_OF_TWO" + | "LEAGUE_PARTICIPANTS_NOT_EXISTS" + | "SET_FINISHED" | "INTERNAL_SERVER_ERROR" | "SERVICE_UNAVAILABLE"; error_message_for_log?: string; @@ -4084,6 +4218,7 @@ export interface components { | "LEAGUE_NOT_PARTICIPATED" | "LEAGUE_PARTICIPATION_ALREADY_CANCELED" | "CLUB_MEMBER_ALREADY_BANNED" + | "LEAGUE_ALREADY_CANCELED" | "DELETED" | "INVALID_PLAYER_COUNT" | "LEAGUE_RECRUITING_MUST_BE_COMPLETED_WHEN_BRACKET_GENERATION" @@ -4096,6 +4231,8 @@ export interface components { | "LEAGUE_OWNER_CANNOT_CANCEL_LEAGUE_PARTICIPATION" | "LEAGUE_CANNOT_BE_CANCELED_WHEN_IS_NOT_RECRUITING" | "LEAGUE_PARTICIPANT_POWER_OF_TWO" + | "LEAGUE_PARTICIPANTS_NOT_EXISTS" + | "SET_FINISHED" | "INTERNAL_SERVER_ERROR" | "SERVICE_UNAVAILABLE"; error_message_for_log?: string; @@ -4167,6 +4304,7 @@ export interface components { | "LEAGUE_NOT_PARTICIPATED" | "LEAGUE_PARTICIPATION_ALREADY_CANCELED" | "CLUB_MEMBER_ALREADY_BANNED" + | "LEAGUE_ALREADY_CANCELED" | "DELETED" | "INVALID_PLAYER_COUNT" | "LEAGUE_RECRUITING_MUST_BE_COMPLETED_WHEN_BRACKET_GENERATION" @@ -4179,6 +4317,8 @@ export interface components { | "LEAGUE_OWNER_CANNOT_CANCEL_LEAGUE_PARTICIPATION" | "LEAGUE_CANNOT_BE_CANCELED_WHEN_IS_NOT_RECRUITING" | "LEAGUE_PARTICIPANT_POWER_OF_TWO" + | "LEAGUE_PARTICIPANTS_NOT_EXISTS" + | "SET_FINISHED" | "INTERNAL_SERVER_ERROR" | "SERVICE_UNAVAILABLE"; error_message_for_log?: string; @@ -4231,6 +4371,7 @@ export interface components { | "LEAGUE_NOT_PARTICIPATED" | "LEAGUE_PARTICIPATION_ALREADY_CANCELED" | "CLUB_MEMBER_ALREADY_BANNED" + | "LEAGUE_ALREADY_CANCELED" | "DELETED" | "INVALID_PLAYER_COUNT" | "LEAGUE_RECRUITING_MUST_BE_COMPLETED_WHEN_BRACKET_GENERATION" @@ -4243,6 +4384,8 @@ export interface components { | "LEAGUE_OWNER_CANNOT_CANCEL_LEAGUE_PARTICIPATION" | "LEAGUE_CANNOT_BE_CANCELED_WHEN_IS_NOT_RECRUITING" | "LEAGUE_PARTICIPANT_POWER_OF_TWO" + | "LEAGUE_PARTICIPANTS_NOT_EXISTS" + | "SET_FINISHED" | "INTERNAL_SERVER_ERROR" | "SERVICE_UNAVAILABLE"; error_message_for_log?: string; @@ -4313,6 +4456,7 @@ export interface components { | "LEAGUE_NOT_PARTICIPATED" | "LEAGUE_PARTICIPATION_ALREADY_CANCELED" | "CLUB_MEMBER_ALREADY_BANNED" + | "LEAGUE_ALREADY_CANCELED" | "DELETED" | "INVALID_PLAYER_COUNT" | "LEAGUE_RECRUITING_MUST_BE_COMPLETED_WHEN_BRACKET_GENERATION" @@ -4325,6 +4469,8 @@ export interface components { | "LEAGUE_OWNER_CANNOT_CANCEL_LEAGUE_PARTICIPATION" | "LEAGUE_CANNOT_BE_CANCELED_WHEN_IS_NOT_RECRUITING" | "LEAGUE_PARTICIPANT_POWER_OF_TWO" + | "LEAGUE_PARTICIPANTS_NOT_EXISTS" + | "SET_FINISHED" | "INTERNAL_SERVER_ERROR" | "SERVICE_UNAVAILABLE"; error_message_for_log?: string; @@ -4406,6 +4552,7 @@ export interface components { | "LEAGUE_NOT_PARTICIPATED" | "LEAGUE_PARTICIPATION_ALREADY_CANCELED" | "CLUB_MEMBER_ALREADY_BANNED" + | "LEAGUE_ALREADY_CANCELED" | "DELETED" | "INVALID_PLAYER_COUNT" | "LEAGUE_RECRUITING_MUST_BE_COMPLETED_WHEN_BRACKET_GENERATION" @@ -4418,6 +4565,8 @@ export interface components { | "LEAGUE_OWNER_CANNOT_CANCEL_LEAGUE_PARTICIPATION" | "LEAGUE_CANNOT_BE_CANCELED_WHEN_IS_NOT_RECRUITING" | "LEAGUE_PARTICIPANT_POWER_OF_TWO" + | "LEAGUE_PARTICIPANTS_NOT_EXISTS" + | "SET_FINISHED" | "INTERNAL_SERVER_ERROR" | "SERVICE_UNAVAILABLE"; error_message_for_log?: string; diff --git a/types/matchTypes.ts b/types/matchTypes.ts new file mode 100644 index 0000000..ae90e5d --- /dev/null +++ b/types/matchTypes.ts @@ -0,0 +1,3 @@ +import type { components } from "@/schemas/schema"; + +export type MatchParticipant = components["schemas"]["Participant"]; From 2fc388b74468660ad4ff75204613f2c0873159c1 Mon Sep 17 00:00:00 2001 From: Yejin0O0 Date: Thu, 14 Nov 2024 19:40:04 +0900 Subject: [PATCH 4/8] =?UTF-8?q?feat:=20=EB=94=94=EB=A0=89=ED=84=B0?= =?UTF-8?q?=EB=8B=98=EA=B3=BC=20=ED=8E=98=EC=96=B4=ED=94=84=EB=A1=9C?= =?UTF-8?q?=EA=B7=B8=EB=9E=98=EB=B0=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/club/TournamentBracket/index.tsx | 525 +++++++++++++++++--- types/matchTypes.ts | 2 + 2 files changed, 469 insertions(+), 58 deletions(-) diff --git a/components/club/TournamentBracket/index.tsx b/components/club/TournamentBracket/index.tsx index 3f0a688..6f39473 100644 --- a/components/club/TournamentBracket/index.tsx +++ b/components/club/TournamentBracket/index.tsx @@ -2,86 +2,494 @@ import MatchNode, { type CustomNodeData, } from "@/components/club/TournamentBracket/MatchNode"; -import { Controls, type Edge, type Node, ReactFlow } from "@xyflow/react"; +import { + Controls, + type Edge, + MiniMap, + type Node, + ReactFlow, +} from "@xyflow/react"; import React, { useMemo } from "react"; import "@xyflow/react/dist/style.css"; +import type { MatchBracketData } from "@/types/matchTypes"; -// TODO: posiiton์€ library ์‚ฌ์šฉํ•ด์„œ ์ •ํ•ด๋ณด๊ธฐ -const initialNodes: Node[] = [ - { - id: "1", - data: { - player1: { - image: "/images/dummy-image.jpg", - name: "์œค์˜ˆ์ง„", +const mockData = { + league_id: 6, + match_generation_type: "TOURNAMENT", + match_type: "SINGLES", + league_status: "FINISHED", + total_round: 4, + singles_match_response_list: [ + // Round 1 (8 matches) + { + match_id: 1, + round_number: 1, + match_status: "FINISHED", + participant1: { + member_token: "me_token_1", + name: "์ฐธ๊ฐ€์ž1", + image: "/images/profile1.jpg", + tier: "BRONZE", + participant_win_set_count: 2, + }, + participant2: { + member_token: "me_token_2", + name: "์ฐธ๊ฐ€์ž2", + image: "/images/profile2.jpg", + tier: "BRONZE", + participant_win_set_count: 0, + }, + winner_token: "me_token_1", + }, + { + match_id: 2, + round_number: 1, + match_status: "FINISHED", + participant1: { + member_token: "me_token_3", + name: "์ฐธ๊ฐ€์ž3", + image: "/images/profile3.jpg", + tier: "SILVER", + participant_win_set_count: 2, + }, + participant2: { + member_token: "me_token_4", + name: "์ฐธ๊ฐ€์ž4", + image: "/images/profile4.jpg", + tier: "SILVER", + participant_win_set_count: 1, + }, + winner_token: "me_token_3", + }, + { + match_id: 3, + round_number: 1, + match_status: "FINISHED", + participant1: { + member_token: "me_token_5", + name: "์ฐธ๊ฐ€์ž5", + image: "/images/profile5.jpg", + tier: "GOLD", + participant_win_set_count: 2, + }, + participant2: { + member_token: "me_token_6", + name: "์ฐธ๊ฐ€์ž6", + image: "/images/profile6.jpg", + tier: "GOLD", + participant_win_set_count: 1, + }, + winner_token: "me_token_5", + }, + { + match_id: 4, + round_number: 1, + match_status: "FINISHED", + participant1: { + member_token: "me_token_7", + name: "์ฐธ๊ฐ€์ž7", + image: "/images/profile7.jpg", tier: "BRONZE", + participant_win_set_count: 2, + }, + participant2: { + member_token: "me_token_8", + name: "์ฐธ๊ฐ€์ž8", + image: "/images/profile8.jpg", + tier: "SILVER", participant_win_set_count: 0, }, - player2: { - image: "/images/dummy-image.jpg", - name: "์ด๊ฐ•๋ฏผ", + winner_token: "me_token_7", + }, + { + match_id: 5, + round_number: 1, + match_status: "FINISHED", + participant1: { + member_token: "me_token_9", + name: "์ฐธ๊ฐ€์ž9", + image: "/images/profile9.jpg", + tier: "GOLD", + participant_win_set_count: 2, + }, + participant2: { + member_token: "me_token_10", + name: "์ฐธ๊ฐ€์ž10", + image: "/images/profile10.jpg", + tier: "BRONZE", + participant_win_set_count: 1, + }, + winner_token: "me_token_9", + }, + { + match_id: 6, + round_number: 1, + match_status: "FINISHED", + participant1: { + member_token: "me_token_11", + name: "์ฐธ๊ฐ€์ž11", + image: "/images/profile11.jpg", + tier: "SILVER", + participant_win_set_count: 2, + }, + participant2: { + member_token: "me_token_12", + name: "์ฐธ๊ฐ€์ž12", + image: "/images/profile12.jpg", + tier: "GOLD", + participant_win_set_count: 1, + }, + winner_token: "me_token_11", + }, + { + match_id: 7, + round_number: 1, + match_status: "FINISHED", + participant1: { + member_token: "me_token_13", + name: "์ฐธ๊ฐ€์ž13", + image: "/images/profile13.jpg", + tier: "BRONZE", + participant_win_set_count: 2, + }, + participant2: { + member_token: "me_token_14", + name: "์ฐธ๊ฐ€์ž14", + image: "/images/profile14.jpg", + tier: "SILVER", + participant_win_set_count: 1, + }, + winner_token: "me_token_13", + }, + { + match_id: 8, + round_number: 1, + match_status: "FINISHED", + participant1: { + member_token: "me_token_15", + name: "์ฐธ๊ฐ€์ž15", + image: "/images/profile15.jpg", tier: "BRONZE", - participant_win_set_count: 4, + participant_win_set_count: 2, }, + participant2: { + member_token: "me_token_16", + name: "์ฐธ๊ฐ€์ž16", + image: "/images/profile16.jpg", + tier: "GOLD", + participant_win_set_count: 0, + }, + winner_token: "me_token_15", }, - position: { x: 5, y: 5 }, - type: "match", - }, - { - id: "2", - data: { - player1: { - image: "/images/dummy-image.jpg", - name: "์œค์˜ˆ์ง„2", + + // Round 2 (4 matches) + { + match_id: 9, + round_number: 2, + match_status: "FINISHED", + participant1: { + member_token: "me_token_1", + name: "์ฐธ๊ฐ€์ž1", + image: "/images/profile1.jpg", + tier: "BRONZE", + participant_win_set_count: 2, + }, + participant2: { + member_token: "me_token_3", + name: "์ฐธ๊ฐ€์ž3", + image: "/images/profile3.jpg", tier: "SILVER", + participant_win_set_count: 1, + }, + winner_token: "me_token_1", + }, + { + match_id: 10, + round_number: 2, + match_status: "FINISHED", + participant1: { + member_token: "me_token_5", + name: "์ฐธ๊ฐ€์ž5", + image: "/images/profile5.jpg", + tier: "GOLD", + participant_win_set_count: 2, + }, + participant2: { + member_token: "me_token_7", + name: "์ฐธ๊ฐ€์ž7", + image: "/images/profile7.jpg", + tier: "BRONZE", participant_win_set_count: 0, }, - player2: { - image: "/images/dummy-image.jpg", - name: "์ด๊ฐ•๋ฏผ2", + winner_token: "me_token_5", + }, + { + match_id: 11, + round_number: 2, + match_status: "FINISHED", + participant1: { + member_token: "me_token_9", + name: "์ฐธ๊ฐ€์ž9", + image: "/images/profile9.jpg", + tier: "GOLD", + participant_win_set_count: 2, + }, + participant2: { + member_token: "me_token_11", + name: "์ฐธ๊ฐ€์ž11", + image: "/images/profile11.jpg", tier: "SILVER", - participant_win_set_count: 4, + participant_win_set_count: 1, + }, + winner_token: "me_token_9", + }, + { + match_id: 12, + round_number: 2, + match_status: "FINISHED", + participant1: { + member_token: "me_token_13", + name: "์ฐธ๊ฐ€์ž13", + image: "/images/profile13.jpg", + tier: "BRONZE", + participant_win_set_count: 2, }, + participant2: { + member_token: "me_token_15", + name: "์ฐธ๊ฐ€์ž15", + image: "/images/profile15.jpg", + tier: "BRONZE", + participant_win_set_count: 1, + }, + winner_token: "me_token_13", }, - position: { x: 5, y: 155 }, - type: "match", - }, - { - id: "3", - data: { - player1: { - image: "/images/dummy-image.jpg", - name: "์œค์˜ˆ์ง„3", + + // Round 3 (2 matches) + { + match_id: 13, + round_number: 3, + match_status: "FINISHED", + participant1: { + member_token: "me_token_1", + name: "์ฐธ๊ฐ€์ž1", + image: "/images/profile1.jpg", + tier: "BRONZE", + participant_win_set_count: 2, + }, + participant2: { + member_token: "me_token_5", + name: "์ฐธ๊ฐ€์ž5", + image: "/images/profile5.jpg", + tier: "GOLD", + participant_win_set_count: 1, + }, + winner_token: "me_token_1", + }, + { + match_id: 14, + round_number: 3, + match_status: "FINISHED", + participant1: { + member_token: "me_token_9", + name: "์ฐธ๊ฐ€์ž9", + image: "/images/profile9.jpg", + tier: "GOLD", + participant_win_set_count: 2, + }, + participant2: { + member_token: "me_token_13", + name: "์ฐธ๊ฐ€์ž13", + image: "/images/profile13.jpg", tier: "BRONZE", participant_win_set_count: 0, }, - player2: { - image: "/images/dummy-image.jpg", - name: "์ด๊ฐ•๋ฏผ3", + winner_token: "me_token_9", + }, + + // Round 4 (Final) + { + match_id: 15, + round_number: 4, + match_status: "FINISHED", + participant1: { + member_token: "me_token_1", + name: "์ฐธ๊ฐ€์ž1", + image: "/images/profile1.jpg", tier: "BRONZE", - participant_win_set_count: 4, + participant_win_set_count: 3, + }, + participant2: { + member_token: "me_token_9", + name: "์ฐธ๊ฐ€์ž9", + image: "/images/profile9.jpg", + tier: "GOLD", + participant_win_set_count: 2, }, + winner_token: "me_token_1", }, - position: { x: 485, y: 80 }, - type: "match", - }, -]; - -const initialEdges: Edge[] = [ - { - id: "e1-3", - source: "1", - target: "3", - type: "smoothstep", - }, - { - id: "e2-3", - source: "2", - target: "3", - type: "smoothstep", - }, -]; + ], +}; + +// TODO: posiiton์€ library ์‚ฌ์šฉํ•ด์„œ ์ •ํ•ด๋ณด๊ธฐ +// const initialNodes: Node[] = [ +// { +// id: "1", +// data: { +// player1: { +// image: "/images/dummy-image.jpg", +// name: "์œค์˜ˆ์ง„", +// tier: "BRONZE", +// participant_win_set_count: 0, +// }, +// player2: { +// image: "/images/dummy-image.jpg", +// name: "์ด๊ฐ•๋ฏผ", +// tier: "BRONZE", +// participant_win_set_count: 4, +// }, +// }, +// position: { x: 5, y: 5 }, +// type: "match", +// }, +// { +// id: "2", +// data: { +// player1: { +// image: "/images/dummy-image.jpg", +// name: "์œค์˜ˆ์ง„2", +// tier: "SILVER", +// participant_win_set_count: 0, +// }, +// player2: { +// image: "/images/dummy-image.jpg", +// name: "์ด๊ฐ•๋ฏผ2", +// tier: "SILVER", +// participant_win_set_count: 4, +// }, +// }, +// position: { x: 5, y: 155 }, +// type: "match", +// }, +// { +// id: "3", +// data: { +// player1: { +// image: "/images/dummy-image.jpg", +// name: "์œค์˜ˆ์ง„3", +// tier: "BRONZE", +// participant_win_set_count: 0, +// }, +// player2: { +// image: "/images/dummy-image.jpg", +// name: "์ด๊ฐ•๋ฏผ3", +// tier: "BRONZE", +// participant_win_set_count: 4, +// }, +// }, +// position: { x: 485, y: 80 }, +// type: "match", +// }, +// ]; + +function transformMatchData(data: MatchBracketData) { + const transformedData: Node[] = []; + const matchSpacingX = 480; // Horizontal spacing between rounds + const matchSpacingY = 150; // Vertical spacing within the same round + + if (data.singles_match_response_list) { + let y = 0; + for ( + let index = 0; + index < data.singles_match_response_list.length; + index++ + ) { + const prevMatch = data.singles_match_response_list[index - 1]; + const match = data.singles_match_response_list[index]; + if (!match) { + continue; + } + + if (prevMatch && prevMatch.round_number !== match.round_number) { + y = match.round_number ?? 0 * matchSpacingY; + } + + const { match_id, round_number, participant1, participant2 } = match; + y += matchSpacingY; + + transformedData.push({ + id: index.toString(), + data: { + player1: { + image: participant1?.image || "/images/dummy-image.jpg", + name: participant1?.name, + tier: participant1?.tier, + participant_win_set_count: participant1?.participant_win_set_count, + }, + player2: { + image: participant2?.image || "/images/dummy-image.jpg", + name: participant2?.name, + tier: participant2?.tier, + participant_win_set_count: participant2?.participant_win_set_count, + }, + }, + position: { + x: (round_number ?? 0 - 1) * matchSpacingX, + y: y, + }, + type: "match", + }); + } + } + + return transformedData; +} + +function generateEdges(data: MatchBracketData) { + const edges: Edge[] = []; + + if (data.singles_match_response_list) { + for ( + let index = 0; + index < data.singles_match_response_list.length; + index++ + ) { + const match = data.singles_match_response_list[index]; + if (!match) { + continue; + } + + edges.push({ + id: index.toString(), + source: index.toString(), + target: "8", + type: "smoothstep", + }); + } + } +} + +const initialNodes: Node[] = transformMatchData( + mockData as MatchBracketData, +); + +// TODO: initialEdges ์ •์˜ํ•˜๊ธฐ +const initialEdges: Edge[] = generateEdges(mockData as MatchBracketData); + +// const initialEdges: Edge[] = [ +// { +// id: "e1-3", +// source: "1", +// target: "3", +// type: "smoothstep", +// }, +// { +// id: "e2-3", +// source: "2", +// target: "3", +// type: "smoothstep", +// }, +// ]; export default function TournamentBracket() { const nodeTypes = useMemo(() => ({ match: MatchNode }), []); @@ -98,6 +506,7 @@ export default function TournamentBracket() { elementsSelectable={false} > +
); diff --git a/types/matchTypes.ts b/types/matchTypes.ts index ae90e5d..5c63f26 100644 --- a/types/matchTypes.ts +++ b/types/matchTypes.ts @@ -1,3 +1,5 @@ import type { components } from "@/schemas/schema"; export type MatchParticipant = components["schemas"]["Participant"]; + +export type MatchBracketData = components["schemas"]["BracketResponse"]; From 559e5f53a2461276eeb0173176625c4a53800675 Mon Sep 17 00:00:00 2001 From: Yejin0O0 Date: Thu, 14 Nov 2024 19:55:31 +0900 Subject: [PATCH 5/8] =?UTF-8?q?fix:=20=EA=B0=80=EC=9A=B4=EB=8D=B0=20?= =?UTF-8?q?=EC=A0=95=EB=A0=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/club/TournamentBracket/index.tsx | 137 ++++++++++++-------- 1 file changed, 83 insertions(+), 54 deletions(-) diff --git a/components/club/TournamentBracket/index.tsx b/components/club/TournamentBracket/index.tsx index 6f39473..72a094a 100644 --- a/components/club/TournamentBracket/index.tsx +++ b/components/club/TournamentBracket/index.tsx @@ -395,78 +395,107 @@ const mockData = { function transformMatchData(data: MatchBracketData) { const transformedData: Node[] = []; const matchSpacingX = 480; // Horizontal spacing between rounds - const matchSpacingY = 150; // Vertical spacing within the same round + const matchSpacingY = 150; // Vertical spacing between matches if (data.singles_match_response_list) { - let y = 0; - for ( - let index = 0; - index < data.singles_match_response_list.length; - index++ - ) { - const prevMatch = data.singles_match_response_list[index - 1]; - const match = data.singles_match_response_list[index]; - if (!match) { - continue; - } + // Group matches by rounds + const rounds = data.singles_match_response_list.reduce( + (acc, match) => { + const round = match.round_number ?? 1; + if (!acc[round]) acc[round] = []; + acc[round].push(match); + return acc; + }, + {} as Record, + ); - if (prevMatch && prevMatch.round_number !== match.round_number) { - y = match.round_number ?? 0 * matchSpacingY; - } + for (const [roundNumber, matches] of Object.entries(rounds)) { + const round = Number.parseInt(roundNumber); + const roundX = (round - 1) * matchSpacingX; + const totalHeight = matches.length * matchSpacingY; + const startY = (totalHeight / 2) * -1; // Center the nodes vertically + + for (let index = 0; index < matches.length; index++) { + const match = matches[index]; - const { match_id, round_number, participant1, participant2 } = match; - y += matchSpacingY; + if (!match) { + continue; + } + const { match_id, participant1, participant2 } = match; - transformedData.push({ - id: index.toString(), - data: { - player1: { - image: participant1?.image || "/images/dummy-image.jpg", - name: participant1?.name, - tier: participant1?.tier, - participant_win_set_count: participant1?.participant_win_set_count, + transformedData.push({ + id: match_id?.toString() || "", + data: { + player1: { + image: participant1?.image || "/images/dummy-image.jpg", + name: participant1?.name, + tier: participant1?.tier, + participant_win_set_count: + participant1?.participant_win_set_count, + }, + player2: { + image: participant2?.image || "/images/dummy-image.jpg", + name: participant2?.name, + tier: participant2?.tier, + participant_win_set_count: + participant2?.participant_win_set_count, + }, }, - player2: { - image: participant2?.image || "/images/dummy-image.jpg", - name: participant2?.name, - tier: participant2?.tier, - participant_win_set_count: participant2?.participant_win_set_count, + position: { + x: roundX, + y: startY + index * matchSpacingY, }, - }, - position: { - x: (round_number ?? 0 - 1) * matchSpacingX, - y: y, - }, - type: "match", - }); + type: "match", + }); + } } - } - return transformedData; + return transformedData; + } } function generateEdges(data: MatchBracketData) { const edges: Edge[] = []; if (data.singles_match_response_list) { - for ( - let index = 0; - index < data.singles_match_response_list.length; - index++ - ) { - const match = data.singles_match_response_list[index]; - if (!match) { - continue; - } + // Group matches by rounds + const rounds = data.singles_match_response_list.reduce( + (acc, match) => { + const round = match.round_number ?? 1; + if (!acc[round]) acc[round] = []; + acc[round].push(match); + return acc; + }, + {} as Record, + ); + + // Loop through each round to create edges to the next round + for (const roundNumber of Object.keys(rounds)) { + const currentRound = Number.parseInt(roundNumber); + const nextRound = currentRound + 1; + + // Ensure there is a next round to connect to + if (rounds[nextRound]) { + const currentRoundMatches = Object.entries(rounds[currentRound] || []); - edges.push({ - id: index.toString(), - source: index.toString(), - target: "8", - type: "smoothstep", - }); + for (const [index, match] of currentRoundMatches) { + const nextMatchIndex = Math.floor(Number(index) / 2); + const targetMatch = rounds[nextRound]?.[nextMatchIndex]; + + if (targetMatch) { + edges.push({ + id: `e${match.match_id}-${targetMatch.match_id}`, + source: match.match_id?.toString() || "", + target: targetMatch.match_id?.toString() || "", + type: "smoothstep", + }); + } + } + } } } + + return edges; } const initialNodes: Node[] = transformMatchData( From 1a5a642b5939d8389f986b6b94ccabc77bbfbac7 Mon Sep 17 00:00:00 2001 From: Yejin0O0 Date: Fri, 15 Nov 2024 11:19:43 +0900 Subject: [PATCH 6/8] =?UTF-8?q?feat:=20=EC=A3=BC=EC=84=9D=20=EC=82=AD?= =?UTF-8?q?=EC=A0=9C=20=EB=B0=8F=20=EB=A1=9C=EC=A7=81=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/club/TournamentBracket/index.tsx | 195 +++++++++----------- 1 file changed, 85 insertions(+), 110 deletions(-) diff --git a/components/club/TournamentBracket/index.tsx b/components/club/TournamentBracket/index.tsx index 72a094a..9efc90c 100644 --- a/components/club/TournamentBracket/index.tsx +++ b/components/club/TournamentBracket/index.tsx @@ -331,74 +331,12 @@ const mockData = { ], }; -// TODO: posiiton์€ library ์‚ฌ์šฉํ•ด์„œ ์ •ํ•ด๋ณด๊ธฐ -// const initialNodes: Node[] = [ -// { -// id: "1", -// data: { -// player1: { -// image: "/images/dummy-image.jpg", -// name: "์œค์˜ˆ์ง„", -// tier: "BRONZE", -// participant_win_set_count: 0, -// }, -// player2: { -// image: "/images/dummy-image.jpg", -// name: "์ด๊ฐ•๋ฏผ", -// tier: "BRONZE", -// participant_win_set_count: 4, -// }, -// }, -// position: { x: 5, y: 5 }, -// type: "match", -// }, -// { -// id: "2", -// data: { -// player1: { -// image: "/images/dummy-image.jpg", -// name: "์œค์˜ˆ์ง„2", -// tier: "SILVER", -// participant_win_set_count: 0, -// }, -// player2: { -// image: "/images/dummy-image.jpg", -// name: "์ด๊ฐ•๋ฏผ2", -// tier: "SILVER", -// participant_win_set_count: 4, -// }, -// }, -// position: { x: 5, y: 155 }, -// type: "match", -// }, -// { -// id: "3", -// data: { -// player1: { -// image: "/images/dummy-image.jpg", -// name: "์œค์˜ˆ์ง„3", -// tier: "BRONZE", -// participant_win_set_count: 0, -// }, -// player2: { -// image: "/images/dummy-image.jpg", -// name: "์ด๊ฐ•๋ฏผ3", -// tier: "BRONZE", -// participant_win_set_count: 4, -// }, -// }, -// position: { x: 485, y: 80 }, -// type: "match", -// }, -// ]; - function transformMatchData(data: MatchBracketData) { const transformedData: Node[] = []; const matchSpacingX = 480; // Horizontal spacing between rounds const matchSpacingY = 150; // Vertical spacing between matches if (data.singles_match_response_list) { - // Group matches by rounds const rounds = data.singles_match_response_list.reduce( (acc, match) => { const round = match.round_number ?? 1; @@ -409,56 +347,110 @@ function transformMatchData(data: MatchBracketData) { {} as Record, ); + let previousRoundYPositions: number[] = []; + for (const [roundNumber, matches] of Object.entries(rounds)) { const round = Number.parseInt(roundNumber); const roundX = (round - 1) * matchSpacingX; - const totalHeight = matches.length * matchSpacingY; - const startY = (totalHeight / 2) * -1; // Center the nodes vertically - for (let index = 0; index < matches.length; index++) { - const match = matches[index]; + // For the first round, simply stack the nodes + if (round === 1) { + const totalHeight = matches.length * matchSpacingY; + const startY = (totalHeight / 2) * -1; // Center the nodes vertically + + previousRoundYPositions = matches.map( + (_, index) => startY + index * matchSpacingY, + ); + + for (let index = 0; index < matches.length; index++) { + const match = matches[index]; + + if (!match) continue; - if (!match) { - continue; + const { match_id, participant1, participant2 } = match; + + transformedData.push({ + id: match_id?.toString() || "", + data: { + player1: { + image: participant1?.image || "/images/dummy-image.jpg", + name: participant1?.name, + tier: participant1?.tier, + participant_win_set_count: + participant1?.participant_win_set_count, + }, + player2: { + image: participant2?.image || "/images/dummy-image.jpg", + name: participant2?.name, + tier: participant2?.tier, + participant_win_set_count: + participant2?.participant_win_set_count, + }, + }, + position: { + x: roundX, + y: previousRoundYPositions[index] || 0, + }, + type: "match", + }); } - const { match_id, participant1, participant2 } = match; - - transformedData.push({ - id: match_id?.toString() || "", - data: { - player1: { - image: participant1?.image || "/images/dummy-image.jpg", - name: participant1?.name, - tier: participant1?.tier, - participant_win_set_count: - participant1?.participant_win_set_count, + } else { + const currentRoundYPositions: number[] = []; + + for (let index = 0; index < matches.length; index++) { + const match = matches[index]; + + if (!match) continue; + + const { match_id, participant1, participant2 } = match; + + const yPosition = + ((previousRoundYPositions[index * 2] ?? 0) + + (previousRoundYPositions[index * 2 + 1] ?? 0)) / + 2; + + transformedData.push({ + id: match_id?.toString() || "", + data: { + player1: { + image: participant1?.image || "/images/dummy-image.jpg", + name: participant1?.name, + tier: participant1?.tier, + participant_win_set_count: + participant1?.participant_win_set_count, + }, + player2: { + image: participant2?.image || "/images/dummy-image.jpg", + name: participant2?.name, + tier: participant2?.tier, + participant_win_set_count: + participant2?.participant_win_set_count, + }, }, - player2: { - image: participant2?.image || "/images/dummy-image.jpg", - name: participant2?.name, - tier: participant2?.tier, - participant_win_set_count: - participant2?.participant_win_set_count, + position: { + x: roundX, + y: yPosition, }, - }, - position: { - x: roundX, - y: startY + index * matchSpacingY, - }, - type: "match", - }); + type: "match", + }); + + // Store the y position for the next round calculation + currentRoundYPositions.push(yPosition); + } + + previousRoundYPositions = currentRoundYPositions; } } return transformedData; } + return []; } function generateEdges(data: MatchBracketData) { const edges: Edge[] = []; if (data.singles_match_response_list) { - // Group matches by rounds const rounds = data.singles_match_response_list.reduce( (acc, match) => { const round = match.round_number ?? 1; @@ -469,12 +461,10 @@ function generateEdges(data: MatchBracketData) { {} as Record, ); - // Loop through each round to create edges to the next round for (const roundNumber of Object.keys(rounds)) { const currentRound = Number.parseInt(roundNumber); const nextRound = currentRound + 1; - // Ensure there is a next round to connect to if (rounds[nextRound]) { const currentRoundMatches = Object.entries(rounds[currentRound] || []); @@ -505,21 +495,6 @@ const initialNodes: Node[] = transformMatchData( // TODO: initialEdges ์ •์˜ํ•˜๊ธฐ const initialEdges: Edge[] = generateEdges(mockData as MatchBracketData); -// const initialEdges: Edge[] = [ -// { -// id: "e1-3", -// source: "1", -// target: "3", -// type: "smoothstep", -// }, -// { -// id: "e2-3", -// source: "2", -// target: "3", -// type: "smoothstep", -// }, -// ]; - export default function TournamentBracket() { const nodeTypes = useMemo(() => ({ match: MatchNode }), []); From d4c275334a7c25846115908e4c57608433fce8e7 Mon Sep 17 00:00:00 2001 From: Yejin0O0 Date: Fri, 15 Nov 2024 11:36:28 +0900 Subject: [PATCH 7/8] =?UTF-8?q?feat:=20match=20=ED=8E=98=EC=9D=B4=EC=A7=80?= =?UTF-8?q?=EC=97=90=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../[clubId]/league/[leagueId]/match/page.tsx | 5 +- components/club/TournamentBracket/index.tsx | 2 +- components/pages/club/Match.tsx | 143 ++++++------------ 3 files changed, 53 insertions(+), 97 deletions(-) diff --git a/app/club/[clubId]/league/[leagueId]/match/page.tsx b/app/club/[clubId]/league/[leagueId]/match/page.tsx index 1490d78..4630835 100644 --- a/app/club/[clubId]/league/[leagueId]/match/page.tsx +++ b/app/club/[clubId]/league/[leagueId]/match/page.tsx @@ -1,8 +1,7 @@ -// import Match from "@/components/pages/club/Match"; +import Match from "@/components/pages/club/Match"; function MatchPage() { - return
match
; - // return ; + return ; } export default MatchPage; diff --git a/components/club/TournamentBracket/index.tsx b/components/club/TournamentBracket/index.tsx index 9efc90c..7fc0890 100644 --- a/components/club/TournamentBracket/index.tsx +++ b/components/club/TournamentBracket/index.tsx @@ -499,7 +499,7 @@ export default function TournamentBracket() { const nodeTypes = useMemo(() => ({ match: MatchNode }), []); return ( -
+
(null); - -// /* TODO: useParams๋ฅผ ์ด์šฉํ•˜์—ฌ URL id ๊ฐ€์ ธ์˜ค๊ธฐ, id ํƒ€์ž… ๋„ฃ์–ด์ฃผ๊ธฐ ๊ธฐ๋ณธ์€ string*/ -// const { data, isLoading, error } = useGetMatches( -// Number(params.clubId), -// Number(params.leagueId), -// ); - -// const [singleGames, doubleGames] = useMemo< -// [MatchResponse[], MatchResponse[]] -// >(() => { -// if (data) { -// const singleGames: MatchResponse[] = []; -// const doubleGames: MatchResponse[] = []; - -// for (const match of data) { -// if (match.match_type === "SINGLES") { -// singleGames.push(match); -// } else if (match.match_type === "DOUBLES") { -// doubleGames.push(match); -// } -// } - -// return [singleGames, doubleGames]; -// } - -// return [[], []]; -// }, [data]); - -// const toggleMatchDialog = (index: number) => { -// setMatchDialog((prevIndex) => (prevIndex === index ? null : index)); -// }; - -// if (isLoading) { -//
Loading...
; -// } - -// if (error) { -// return ( -//
๋ฐ์ดํ„ฐ๋ฅผ ๋ถˆ๋Ÿฌ์˜ค๋Š” ๋ฐ ์‹คํŒจํ–ˆ์Šต๋‹ˆ๋‹ค.
-// ); -// } - -// return ( -//
-//
-// {singleGames.map((match) => { -// if (!match.singles_match) { -// return null; -// } -// return ( -// -// ); -// })} -//
- -//
-// {doubleGames.map((match) => { -// if (!match.doubles_match) { -// return null; -// } -// return ( -// -// ); -// })} -//
-//
-// ); -// } - -// export default Match; +function Match() { + // const params = useParams(); + // const [matchDialog, setMatchDialog] = useState(null); + + // /* TODO: useParams๋ฅผ ์ด์šฉํ•˜์—ฌ URL id ๊ฐ€์ ธ์˜ค๊ธฐ, id ํƒ€์ž… ๋„ฃ์–ด์ฃผ๊ธฐ ๊ธฐ๋ณธ์€ string*/ + // const { data, isLoading, error } = useGetMatches( + // Number(params.clubId), + // Number(params.leagueId), + // ); + + // const [singleGames, doubleGames] = useMemo< + // [MatchResponse[], MatchResponse[]] + // >(() => { + // if (data) { + // const singleGames: MatchResponse[] = []; + // const doubleGames: MatchResponse[] = []; + + // for (const match of data) { + // if (match.match_type === "SINGLES") { + // singleGames.push(match); + // } else if (match.match_type === "DOUBLES") { + // doubleGames.push(match); + // } + // } + + // return [singleGames, doubleGames]; + // } + + // return [[], []]; + // }, [data]); + + // const toggleMatchDialog = (index: number) => { + // setMatchDialog((prevIndex) => (prevIndex === index ? null : index)); + // }; + + // if (isLoading) { + //
Loading...
; + // } + + // if (error) { + // return ( + //
๋ฐ์ดํ„ฐ๋ฅผ ๋ถˆ๋Ÿฌ์˜ค๋Š” ๋ฐ ์‹คํŒจํ–ˆ์Šต๋‹ˆ๋‹ค.
+ // ); + // } + + return ; +} + +export default Match; From e8060a6164c467be2ef498d253b562d7757ee39f Mon Sep 17 00:00:00 2001 From: Yejin0O0 Date: Fri, 15 Nov 2024 11:39:29 +0900 Subject: [PATCH 8/8] fix: fix tsc error --- components/club/LeagueForm.tsx | 9 +++------ types/errorCode.ts | 3 +++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/components/club/LeagueForm.tsx b/components/club/LeagueForm.tsx index dd1e660..fd5a146 100644 --- a/components/club/LeagueForm.tsx +++ b/components/club/LeagueForm.tsx @@ -151,12 +151,9 @@ function LeagueForm(props: LeagueFormProps) { data.mode = "create"; } if (data.mode === "create") { - createLeague( - { ...data, league_status: "RECRUITING" }, - { - onSuccess: () => router.push(`/club/${clubId}/league`), - }, - ); + createLeague(data, { + onSuccess: () => router.push(`/club/${clubId}/league`), + }); } else { updateLeague(data, { onSuccess: () => router.push(`/club/${clubId}/league`), diff --git a/types/errorCode.ts b/types/errorCode.ts index 3df8247..ae875e7 100644 --- a/types/errorCode.ts +++ b/types/errorCode.ts @@ -40,6 +40,7 @@ export type ErrorCode = | "LEAGUE_NOT_PARTICIPATED" | "LEAGUE_PARTICIPATION_ALREADY_CANCELED" | "CLUB_MEMBER_ALREADY_BANNED" + | "LEAGUE_ALREADY_CANCELED" | "DELETED" | "INVALID_PLAYER_COUNT" | "LEAGUE_RECRUITING_MUST_BE_COMPLETED_WHEN_BRACKET_GENERATION" @@ -52,5 +53,7 @@ export type ErrorCode = | "LEAGUE_OWNER_CANNOT_CANCEL_LEAGUE_PARTICIPATION" | "LEAGUE_CANNOT_BE_CANCELED_WHEN_IS_NOT_RECRUITING" | "LEAGUE_PARTICIPANT_POWER_OF_TWO" + | "LEAGUE_PARTICIPANTS_NOT_EXISTS" + | "SET_FINISHED" | "INTERNAL_SERVER_ERROR" | "SERVICE_UNAVAILABLE";