diff --git a/src/apis/httpClient/httpClient.ts b/src/apis/httpClient/httpClient.ts
index 69b86fd3..1cc7d72b 100644
--- a/src/apis/httpClient/httpClient.ts
+++ b/src/apis/httpClient/httpClient.ts
@@ -168,4 +168,5 @@ export default {
admin: new HttpClient("api/bamboo/admin", axiosConfig),
like: new HttpClient("api/likes/update", axiosConfig),
image: new HttpClient("api/image/save", axiosConfig),
+ meal: new HttpClient("api/meal", axiosConfig),
};
diff --git a/src/app/layout.tsx b/src/app/layout.tsx
index a14e64fc..b2f31747 100644
--- a/src/app/layout.tsx
+++ b/src/app/layout.tsx
@@ -1,16 +1,20 @@
+import Provider from "@/provider/Provider";
+
export const metadata = {
- title: 'Next.js',
- description: 'Generated by Next.js',
-}
+ title: "BSM",
+ description: "부산소마고 학생 정보 관리 서비스 BSM입니다.",
+};
export default function RootLayout({
children,
}: {
- children: React.ReactNode
+ children: React.ReactNode;
}) {
return (
-
{children}
+
+ {children}
+
- )
+ );
}
diff --git a/src/assets/data/emptyMealList.ts b/src/assets/data/emptyMealList.ts
new file mode 100644
index 00000000..8bd26429
--- /dev/null
+++ b/src/assets/data/emptyMealList.ts
@@ -0,0 +1,21 @@
+import { IMealList } from "@/interfaces";
+
+const emptyMealList: IMealList = {
+ data: {
+ MORNING: {
+ content: "",
+ cal: 0,
+ },
+ LUNCH: {
+ content: "",
+ cal: 0,
+ },
+ DINNER: {
+ content: "",
+ cal: 0,
+ },
+ },
+ keys: [],
+};
+
+export default emptyMealList;
diff --git a/src/assets/data/index.ts b/src/assets/data/index.ts
index 1bf7607e..f03fb369 100644
--- a/src/assets/data/index.ts
+++ b/src/assets/data/index.ts
@@ -3,3 +3,4 @@ export { default as emptyClassInfo } from "./emptyClassInfo";
export { default as emptyClassLevel } from "./emptyClassLevel";
export { default as emptyTimetable } from "./emptyTimetable";
export { default as emptyInputPost } from "./emptyInputPost";
+export { default as emptyMealList } from "./emptyMealList";
diff --git a/src/constants/key.constant.ts b/src/constants/key.constant.ts
index 7803cfc0..f1d73850 100644
--- a/src/constants/key.constant.ts
+++ b/src/constants/key.constant.ts
@@ -6,6 +6,7 @@ const KEY = {
RECOMMENT: "useRecomment",
BAMBOO: "useBamboo",
BAMBOO_ADMIN: "useBambooAdmin",
+ MEAL: "useMeal",
} as const;
export default KEY;
diff --git a/src/helpers/getMealName.helper.ts b/src/helpers/getMealName.helper.ts
new file mode 100644
index 00000000..50e2ad54
--- /dev/null
+++ b/src/helpers/getMealName.helper.ts
@@ -0,0 +1,14 @@
+const getMealName = (meal: string) => {
+ switch (meal) {
+ case "MORNING":
+ return "조식";
+ case "LUNCH":
+ return "중식";
+ case "DINNER":
+ return "석식";
+ default:
+ return meal;
+ }
+};
+
+export default getMealName;
diff --git a/src/helpers/index.ts b/src/helpers/index.ts
index 66367f2b..69300062 100644
--- a/src/helpers/index.ts
+++ b/src/helpers/index.ts
@@ -8,3 +8,4 @@ export { default as getWriteContentLabel } from "./getWriteContentLabel.helper";
export { default as checkPostValid } from "./checkPostValid.helper";
export { default as checkTextOverflow } from "./checkTextOverflow.helper";
export { default as getTextDepth } from "./getTextDepth.helper";
+export { default as getMealName } from "./getMealName.helper";
diff --git a/src/hooks/useDate.ts b/src/hooks/useDate.ts
index a312d244..eb92ecb2 100644
--- a/src/hooks/useDate.ts
+++ b/src/hooks/useDate.ts
@@ -59,6 +59,22 @@ const useDate = () => {
return formattedDate;
};
+ const getMealDate = () => {
+ return dayjs().format("YYMMDD");
+ };
+
+ const getDayOfWeek = (date: string) => {
+ return dayjs(date, "YYMMDD").locale("ko").format("dddd");
+ };
+
+ const getMealDateTitle = (date: string) => {
+ return dayjs(date, "YYMMDD").locale("ko").format("M월 D일 dddd");
+ };
+
+ const setMealDate = (date: string, day: number) => {
+ return dayjs(date, "YYMMDD").add(day, "day").format("YYMMDD");
+ };
+
const getNowWeekDay = ({ type }: DateType) => {
const today = dayjs().day();
@@ -107,6 +123,10 @@ const useDate = () => {
formatDate,
getHMSDate,
getDate,
+ getDayOfWeek,
+ getMealDate,
+ getMealDateTitle,
+ setMealDate,
getNowWeekDay,
translateDay,
getDiffDayTime,
diff --git a/src/interfaces/index.ts b/src/interfaces/index.ts
index 98e27126..abee9059 100644
--- a/src/interfaces/index.ts
+++ b/src/interfaces/index.ts
@@ -3,7 +3,7 @@ export type { default as IClassInfo } from "./classInfo.interface";
export type { default as IClassLevel } from "./classLevel.interface";
export type { default as IEmojiState } from "./emoji.interface";
export type { default as IMealList } from "./mealList.interface";
-export type { default as IMealListItem } from "./mealListItem.interface";
+export type { default as IMeal } from "./meal.interface";
export type { default as IModalState } from "./modal.interface";
export type { default as IPost } from "./post.interface";
export type { default as IPostQuery } from "./postQuery.interface";
diff --git a/src/interfaces/meal.interface.ts b/src/interfaces/meal.interface.ts
new file mode 100644
index 00000000..1248eae3
--- /dev/null
+++ b/src/interfaces/meal.interface.ts
@@ -0,0 +1,4 @@
+export default interface IMeal {
+ content: string;
+ cal: number;
+}
diff --git a/src/interfaces/mealList.interface.ts b/src/interfaces/mealList.interface.ts
index 321e63e0..6e1e2966 100644
--- a/src/interfaces/mealList.interface.ts
+++ b/src/interfaces/mealList.interface.ts
@@ -1,3 +1,8 @@
+import IMeal from "./meal.interface";
+
export default interface MealListType {
- mealList: Array