Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/#88 | 통계, 책정보 관련 api 연결 #99

Merged
merged 24 commits into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
6323783
✨ Feat: 통계 페이지 API 연결
yoonjin-C Nov 15, 2024
adb91a0
💄 UI: 캐릭터 페이지 퍼블리싱 수정사항 반영
yoonjin-C Nov 15, 2024
68ac466
✨ Feat: 캐릭터 페이지 유저 레벨 api 연결
yoonjin-C Nov 15, 2024
6a05d61
💄 UI: 레벨 정보 모달창 수정
yoonjin-C Nov 16, 2024
a83343b
✨ Feat: 통계 페이지 api 연결
yoonjin-C Nov 16, 2024
6fe077f
💄 UI: 한줄평 작성 모달창 UI 수정
yoonjin-C Nov 16, 2024
94b21e5
✨ Feat: bookInfoId 추가하여 라우팅 수정
yoonjin-C Nov 16, 2024
11deafb
✨ Feat: 책 정보 api 연결
yoonjin-C Nov 16, 2024
2528356
💄 UI: 책정보 페이지 퍼블리싱 수정
yoonjin-C Nov 16, 2024
d1ea516
💄 UI: 서재에 담겨있지 않을 경우 추가
yoonjin-C Nov 16, 2024
eed5612
💄 UI: 한줄평 별점 0.5점 단위로 수정
yoonjin-C Nov 17, 2024
6e547f7
✨ Feat: 한줄평 목록 조회 api 연결
yoonjin-C Nov 17, 2024
31d84c5
💄 UI: Divider width 수정
yoonjin-C Nov 17, 2024
3cab128
✨ Feat: 캐릭터 아이템 렌더링 구현
yoonjin-C Nov 17, 2024
d2c1d25
💚 Chore: 컬러 팔레트 추가
yoonjin-C Nov 17, 2024
09753a0
💄 UI: 키워드 6개로 수정
yoonjin-C Nov 17, 2024
c38029e
💄 UI: 정보 부족한 경우 추가
yoonjin-C Nov 17, 2024
9fae020
✨ Feat: 별점 등록 및 수정 api 연결
yoonjin-C Nov 17, 2024
c23f07f
✨ Feat: 별점 삭제 api 연결
yoonjin-C Nov 17, 2024
e73c628
✨ Feat: 한줄평 좋아요 등록/삭제 api 연결
yoonjin-C Nov 17, 2024
d6ecb37
✨ Feat: 한줄평 등록/수정/삭제 api 연결
yoonjin-C Nov 17, 2024
b2761b1
💄 UI: 캐릭터 내보내기 페이지 퍼블리싱
yoonjin-C Nov 17, 2024
16836d3
✏️ Fix: 백엔드 수정사항 반영
yoonjin-C Nov 18, 2024
9c837af
✏️ Fix: example 메서드 사용
yoonjin-C Nov 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added bookduck/public/assets/items/hairband.glb
Binary file not shown.
Binary file added bookduck/public/assets/items/safetyhat.glb
Binary file not shown.
Binary file added bookduck/public/assets/items/spanner.glb
Binary file not shown.
8 changes: 6 additions & 2 deletions bookduck/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import BookInfoPage from "./pages/BookInfoPage/BookInfoPage";
import UserCommentPage from "./pages/BookInfoPage/UserCommentPage";
import BookInfoAddedPage from "./pages/BookInfoPage/BoonInfoAddedPage";
import StatisticsPage from "./pages/StatisticsPage/StatisticsPage";
import CharacterExportPage from "./pages/StatisticsPage/CharacterExportPage";
import CardDecorationPage from "./pages/RecordingPage/CardDecorationPage";
import LibraryPage from "./pages/LibraryPage/LibraryPage";
import EnterBookCasePage from "./pages/LibraryPage/EnterBookCasePage";
Expand Down Expand Up @@ -49,15 +50,18 @@ function App() {
<Route path="/setting" element={<SettingPage />} />
<Route path="/notification" element={<NotificationPage />} />
<Route path="/statistics" element={<StatisticsPage />} />

<Route
path="/statistics/export/character"
element={<CharacterExportPage />}
/>
<Route path="/" element={<Navigate to="/home" replace />} />
<Route path="/api/oauth" element={<OAuthRedierctPage />} />
<Route path="/home" element={<MainPage />} />
<Route path="/friend" element={<FriendListPage />} />
<Route path="/search" element={<SearchMainPage />} />
<Route path="/recording" element={<RecordingPage />} />
<Route path="/search/register" element={<RegisterPage />} />
<Route path="/info/book" element={<BookInfoPage />} />
<Route path="/info/book/:bookinfoId" element={<BookInfoPage />} />
<Route path="/info/book/user" element={<BookInfoAddedPage />} />
<Route path="/info/book/comment" element={<UserCommentPage />} />
<Route path="/selectcard" element={<SelectCardPage />} />
Expand Down
130 changes: 130 additions & 0 deletions bookduck/src/api/bookinfo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
import { apiAuth } from "./api";
import { get, post, patch, put, del } from "./example";

// 한줄평,별점 목록 조회
export const getBookInfo = async ({ bookinfoId }) => {
try {
const res = await get(`/bookinfo/${bookinfoId}`);
console.log("책정보 조회 성공: ", res);
return res;
} catch (error) {
console.error("책정보 조회 실패: ", error);
throw error;
}
};

// 한줄평,별점 목록 조회
export const getOneLineRatingsInfo = async ({
bookinfoId,
orderBy,
page,
size,
}) => {
try {
// Query Parameter 생성 (값이 존재하는 경우에만 추가)
const queryParams = new URLSearchParams();
if (orderBy) queryParams.append("orderBy", orderBy);
if (page) queryParams.append("page", page);
if (size) queryParams.append("size", size);

// 최종 URL
const url = `/bookinfo/${bookinfoId}/onelineratings${
queryParams.toString() ? `?${queryParams}` : ""
}`;

const res = await get(url);
console.log("한줄평 목록 조회 성공: ", res);
return res;
} catch (error) {
console.error("한줄평 목록 조회 실패: ", error);
throw error;
}
};
// 별점 등록 및 수정
export const enrollRating = async (userbookId, rating) => {
const url = `books/${userbookId}/rating`;
const data = { rating };
try {
const res = await patch(url, data);
console.log("별점 등록 성공: ", res);
return res?.data;
} catch (error) {
console.error("별점 등록 실패:", error);
throw error;
}
};

//별점 삭제
export const deleteRating = async (userbookId) => {
const url = `books/${userbookId}/rating`;
try {
const res = await del(url);
console.log("별점 삭제 성공: ", res);
} catch (error) {
console.error("별점 삭제 실패: ", error);
throw error;
}
};

//한줄평 생성
export const enrollOneLine = async (userBookId, oneLineContent) => {
const url = `onelines`;
const data = { oneLineContent, userBookId };
try {
const res = await post(url, data);
console.log("한줄평 등록 성공: ", res);
return res?.data;
} catch (error) {
console.error("한줄평 등록 실패:", error);
throw error;
}
};
// 한줄평 수정
export const editOneLine = async (onelineId, oneLineContent) => {
const url = `onelines/${onelineId}`;
const data = { oneLineContent };
try {
const res = await put(url, data);
console.log("한줄평 수정 성공: ", res);
return res?.data;
} catch (error) {
console.error("한줄평 수정 실패:", error);
throw error;
}
};
//한줄평 삭제
export const deleteOneLine = async (onelineId) => {
const url = `onelines/${onelineId}`;
try {
const res = await del(url);
console.log("한줄평 삭제 성공: ", res);
} catch (error) {
console.error("한줄평 삭제 실패: ", error);
throw error;
}
};

//한줄평 좋아요
export const enrollLike = async (onelineId) => {
const url = `onelines/${onelineId}/like`;
try {
const res = await post(url);
console.log("한줄평 좋아요 성공: ", res);
return res;
} catch (error) {
console.error("한줄평 좋아요 실패:", error);
throw error;
}
};

//한줄평 좋아요 삭제
export const deleteLike = async (onelineId) => {
const url = `onelines/${onelineId}/like`;
try {
const res = await del(url);
console.log("한줄평 좋아요 삭제 성공: ", res);
} catch (error) {
console.error("한줄평 좋아요 삭제 실패: ", error);
throw error;
}
};
38 changes: 38 additions & 0 deletions bookduck/src/api/character.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import { apiAuth } from "./api";
import { get, post, patch, put, del } from "./example";

// 유저 정보 조회 - 닉네임, 기록 수
export const getUserInfo = async (userId) => {
try {
const res = await get(`/users/${userId}`);
console.log("유저 정보 조회 성공: ", res);
return res;
} catch (error) {
console.error("유저 정보 조회 실패: ", error);
throw error;
}
};

// 유저 레벨 정보 조회
export const getUserLevelInfo = async (userId) => {
try {
const res = await get(`/users/${userId}/growth`);
console.log("유저 레벨 정보 조회 성공: ", res);
return res;
} catch (error) {
console.error("유저 레벨 정보 조회 실패: ", error);
throw error;
}
};

// 캐릭터 아이템 조회
export const getItemLists = async () => {
try {
const res = await get(`/useritems`);
console.log("아이템 리스트 조회 성공: ", res);
return res;
} catch (error) {
console.error("아이템 리스트 조회 실패: ", error);
throw error;
}
};
26 changes: 26 additions & 0 deletions bookduck/src/api/statistics.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { apiAuth } from "./api";
import { get, post, patch, put, del } from "./example";

// 유저 정보 조회 - 닉네임, 기록 수
export const getUserInfo = async (userId) => {
try {
const res = await get(`/users/${userId}`);
console.log("유저 정보 조회 성공: ", res);
return res;
} catch (error) {
console.error("유저 정보 조회 실패: ", error);
throw error;
}
};

// 유저 독서 리포트 조회 - 통계
export const getUserStatisticsInfo = async (userId) => {
try {
const res = await get(`/users/${userId}/statistics`);
console.log("유저 통계 정보 조회 성공: ", res);
return res;
} catch (error) {
console.error("유저 통계 정보 조회 실패: ", error);
throw error;
}
};
5 changes: 5 additions & 0 deletions bookduck/src/assets/bookinfoPage/heart-no.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions bookduck/src/assets/bookinfoPage/heart-yes.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions bookduck/src/assets/bookinfoPage/star-half.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions bookduck/src/assets/bookinfoPage/star-small-half.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions bookduck/src/assets/bookinfoPage/star-small-yes.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading