diff --git a/api/game/apis.ts b/api/game/apis.ts index 7b63651..f693c41 100644 --- a/api/game/apis.ts +++ b/api/game/apis.ts @@ -1,10 +1,6 @@ -const BASE_URL = process.env.NEXT_PUBLIC_API_KEY; - export async function getMonthSchedules(params: string) { try { - const res = await fetch( - `${BASE_URL}/game/monthschedule?yearMonth=${params}` - ); + const res = await fetch(`/api/game/monthschedule?yearMonth=${params}`); if (!res.ok) { throw new Error("네트워크 문제 발생"); @@ -20,9 +16,7 @@ export async function getMonthSchedules(params: string) { export async function getAllSchedules(params: string) { try { - const res = await fetch( - `${BASE_URL}/game/allgameschedule?yearMonth=${params}` - ); + const res = await fetch(`/api/game/allgameschedule?yearMonth=${params}`); if (!res.ok) { throw new Error("네트워크 문제 발생"); @@ -36,12 +30,11 @@ export async function getAllSchedules(params: string) { } } -export const fetchBoxscore = async (gameDate?: number, gmkey?: string) => { +export const getBoxscore = async ( + queryparams: string +): Promise => { try { - const queryparams = - gameDate && gmkey ? `?gameDate=${gameDate}&gmkey=${gmkey}` : ""; - - const URL = `${BASE_URL}/game/boxscore${queryparams}`; + const URL = `/api/game/boxscore${queryparams}`; const response = await fetch(URL); diff --git a/api/main/apis.ts b/api/main/apis.ts new file mode 100644 index 0000000..3b1ce6f --- /dev/null +++ b/api/main/apis.ts @@ -0,0 +1,15 @@ +export const getKtwizRank = async (): Promise => { + try { + const response = await fetch("/api/game/ktwizteamrank"); + + if (!response.ok) { + throw new Error("Network response was not ok"); + } + + const result = await response.json(); + return result.data.ktWizTeamRank; + } catch (error) { + console.error("API 요청 에러:", error); + throw error; + } +}; diff --git a/api/news/apis.ts b/api/news/apis.ts new file mode 100644 index 0000000..6684d27 --- /dev/null +++ b/api/news/apis.ts @@ -0,0 +1,16 @@ +// news-detail +const BASE_URL = process.env.NEXT_PUBLIC_API_KEY; +export const getNewsDetail = async ( + artcSeq: string +): Promise => { + const queryparam = artcSeq ? `newsdetail?artcSeq=${artcSeq}` : ""; + const url = `http://${BASE_URL}/api/article/${queryparam}`; + const res = await fetch(url); + + if (!res.ok) { + throw new Error("Failed to fetch news detail"); + } + + const response: ArticleContentsResponse = await res.json(); + return response.data; +}; diff --git a/api/news/types.ts b/api/news/types.ts new file mode 100644 index 0000000..c54df87 --- /dev/null +++ b/api/news/types.ts @@ -0,0 +1,5 @@ +type ArticleContentsResponse = { + data: { + article: ArticleContentsType; + }; +}; diff --git a/api/player/apis.ts b/api/player/apis.ts index f99ac80..1ee50fb 100644 --- a/api/player/apis.ts +++ b/api/player/apis.ts @@ -1,10 +1,14 @@ -import { CoachDetailResponse, CoachResponse, PitcherResponse } from "./types"; +import { + CoachDetailResponse, + CoachResponse, + PitcherDetailResponse, + PitcherResponse, +} from "./types"; const BASE_URL = process.env.NEXT_PUBLIC_API_KEY; - // player - 코치 리스트 export const getCoachList = async (): Promise => { - const url = `${BASE_URL}/player/coachlist`; + const url = `http://${BASE_URL}/api/player/coachlist`; const res = await fetch(url); if (!res.ok) { @@ -17,7 +21,7 @@ export const getCoachList = async (): Promise => { // player - 투수 리스트 export const getPitcherList = async (): Promise => { - const url = `${BASE_URL}/player/pitcherlist`; + const url = `http://${BASE_URL}/api/player/pitcherlist`; const res = await fetch(url, { method: "GET" }); if (!res.ok) { throw new Error("Failed to fetch coach list"); @@ -32,7 +36,7 @@ export const getCoachDetail = async ( pcode: string ): Promise => { const queryparam = pcode ? `coachdetail?pcode=${pcode}` : ""; - const url = `${BASE_URL}/player/${queryparam}`; + const url = `http://${BASE_URL}/api/player/${queryparam}`; const response = await fetch(url, { method: "GET" }); if (!response.ok) { @@ -42,3 +46,19 @@ export const getCoachDetail = async ( const data = await response.json(); return data.data; }; + +// player - 투수 디테일 +export const getPitcherDetail = async ( + pcode: string +): Promise => { + const queryparam = pcode ? `pitcherdetail?pcode=${pcode}` : ""; + const url = `http://${BASE_URL}/api/player/${queryparam}`; + const response = await fetch(url, { method: "GET" }); + + if (!response.ok) { + throw new Error("투수의 디테일한 정보를 가져올수 없음"); + } + + const data = await response.json(); + return data.data; +}; diff --git a/api/player/types.ts b/api/player/types.ts index a3f1911..abd9c91 100644 --- a/api/player/types.ts +++ b/api/player/types.ts @@ -31,3 +31,14 @@ export type CoachDetailResponse = { }; }; }; + +export type PitcherDetailResponse = { + data: { + gameplayer: PitcherPersonalInfo; + recentgamerecordlist: PitcherGameRecord[]; + recentgamerecordlistfutures: PitcherGameRecord[]; + seasonsummary: PitcherSeasonSummary; + seasonsummaryfutures: PitcherSeasonSummary; + yearrecordlist: PitcherYearRecord[]; + }; +}; diff --git a/app/(menu)/ktwiz/bi/page.tsx b/app/(menu)/ktwiz/bi/page.tsx index 974c7c3..9af758a 100644 --- a/app/(menu)/ktwiz/bi/page.tsx +++ b/app/(menu)/ktwiz/bi/page.tsx @@ -1,3 +1,29 @@ +import { Bi_Symbol_items } from "@/components/ktwiz/bi/bi-items"; + export default function page() { - return
page입니다
; + return ( +
+
+
+

심볼마크

+
+

+ kt wiz는 구단명의 이니셜을 상징화한 '이니셜 심볼'과 +
+ 그림을 정상화한 '이미지 심볼' 두 개의 심볼마크를 동시에 + 사용합니다. +

+ +
+ +
+ +
+ ); } diff --git a/app/(menu)/ktwiz/wallpaper/page.tsx b/app/(menu)/ktwiz/wallpaper/page.tsx index 974c7c3..03f6a5e 100644 --- a/app/(menu)/ktwiz/wallpaper/page.tsx +++ b/app/(menu)/ktwiz/wallpaper/page.tsx @@ -1,3 +1,14 @@ +import Image from "next/image"; +import { wallpaper_img } from "@/assets/images/@index"; + export default function page() { - return
page입니다
; + return ( + wallpaper_img + ); } diff --git a/app/(menu)/media/news/[artcSeq]/page.tsx b/app/(menu)/media/news/[artcSeq]/page.tsx new file mode 100644 index 0000000..5b3192f --- /dev/null +++ b/app/(menu)/media/news/[artcSeq]/page.tsx @@ -0,0 +1,7 @@ +import { getNewsDetail } from "@/api/news/apis"; +import { NewsDetail } from "@/components/media/news-detail"; + +export default async function page() { + const { article } = await getNewsDetail("190048"); //임시 + return ; +} diff --git a/app/(menu)/player/coach/[pcode]/page.tsx b/app/(menu)/player/coach/[pcode]/page.tsx index 49a3326..e48adb7 100644 --- a/app/(menu)/player/coach/[pcode]/page.tsx +++ b/app/(menu)/player/coach/[pcode]/page.tsx @@ -1,5 +1,5 @@ import { getCoachDetail } from "@/api/player/apis"; -import { CoachDetail } from "@/components/player/coach-detail"; +import { CoachDetail } from "@/components/player/coach/coach-detail"; export default async function Page({ params, diff --git a/app/(menu)/player/coach/page.tsx b/app/(menu)/player/coach/page.tsx index 8bd19e6..ed880e0 100644 --- a/app/(menu)/player/coach/page.tsx +++ b/app/(menu)/player/coach/page.tsx @@ -1,5 +1,5 @@ import { getCoachList } from "@/api/player/apis"; -import { CoachList } from "@/components/player/coach-list"; +import { CoachList } from "@/components/player/coach/coach-list"; export const dynamic = "force-dynamic"; export default async function Page() { const coachList = await getCoachList(); diff --git a/app/(menu)/player/pitcher/[pcode]/page.tsx b/app/(menu)/player/pitcher/[pcode]/page.tsx index c10ae0e..42a2050 100644 --- a/app/(menu)/player/pitcher/[pcode]/page.tsx +++ b/app/(menu)/player/pitcher/[pcode]/page.tsx @@ -1,8 +1,18 @@ -export default async function Page() { +import { getPitcherDetail } from "@/api/player/apis"; +import { PitcherDetail } from "@/components/player/pitcher/pitcher-detail"; + +export default async function Page({ + params, +}: { + params: { + pcode: string; + }; +}) { + const { pcode } = params; + const data = await getPitcherDetail(pcode); return ( <> -
투수 디테일 페이지
- {/* */} + ); } diff --git a/app/(menu)/player/pitcher/page.tsx b/app/(menu)/player/pitcher/page.tsx index fa05e03..d1a370d 100644 --- a/app/(menu)/player/pitcher/page.tsx +++ b/app/(menu)/player/pitcher/page.tsx @@ -1,5 +1,5 @@ import { getPitcherList } from "@/api/player/apis"; -import PitcherList from "@/components/player/pitcher-list"; +import PitcherList from "@/components/player/pitcher/pitcher-list"; export const dynamic = "force-dynamic"; export default async function page() { const pitcherList = await getPitcherList(); diff --git a/app/(menu)/wizpark/iksan/page.tsx b/app/(menu)/wizpark/iksan/page.tsx index 6cb094c..c46b405 100644 --- a/app/(menu)/wizpark/iksan/page.tsx +++ b/app/(menu)/wizpark/iksan/page.tsx @@ -7,7 +7,6 @@ import { BusRouteInfo } from "@/components/wizpark/iksan/bus-route-info"; import { IKSAN_IMAGES, IKSAN_LOCATION } from "@/constants/stadium"; import { Bus, ExternalLink, Images, Map, MapPin } from "lucide-react"; import Link from "next/link"; -import Script from "next/script"; export default function page() { return ( @@ -32,10 +31,6 @@ export default function page() { -