Skip to content

Commit

Permalink
Merge pull request #95 from KGU-C-Lab/develop/#28
Browse files Browse the repository at this point in the history
Members RC-1.0.0 Release
  • Loading branch information
gwansikk authored Apr 11, 2024
2 parents a33c92a + a79475d commit 85eb43a
Show file tree
Hide file tree
Showing 189 changed files with 4,617 additions and 2,243 deletions.
8 changes: 4 additions & 4 deletions apps/auth/app/constants/api.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
export const API_BASE_URL = 'https://api.clab.page';
export const API_BASE_URL = 'https://api.clab.page/api';

export const END_POINTS = {
LOGIN: '/login',
TWO_FACTOR_LOGIN: '/login/authenticator',
LOGIN: '/v1/login',
TWO_FACTOR_LOGIN: '/v1/login/authenticator',
} as const;

export const SUCCESS_MESSAGE = {
Expand All @@ -11,7 +11,7 @@ export const SUCCESS_MESSAGE = {

export const ERROR_MESSAGE = {
AUTH: '인증에 실패했습니다.',
SERVER: '오류가 발생했습니다. 잠시 후 다시 시도해주세요.',
SERVER: '로그인에 실패했습니다. 입력 정보를 다시 확인해주세요.',
} as const;

// OAuth 백엔드가 개발 전까지 임시로 사용합니다
Expand Down
1 change: 1 addition & 0 deletions apps/member/.env.example
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
VITE_MODE=환경모드
VITE_SERVER_BASE_URL=서버주소
VITE_API_BASE_URL=API주소
3 changes: 2 additions & 1 deletion apps/member/.env.production
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
VITE_MODE=production
VITE_API_BASE_URL=https://api.clab.page
VITE_SERVER_BASE_URL=https://api.clab.page/
VITE_API_BASE_URL=https://api.clab.page/api/
3 changes: 3 additions & 0 deletions apps/member/member.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"name": "C-Lab"
}
6 changes: 5 additions & 1 deletion apps/member/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,17 @@
"@gwansikk/server-chain": "^0.5.2",
"@tanstack/react-query": "^5.18.1",
"classnames": "^2.5.1",
"clsx": "^2.1.0",
"dayjs": "^1.11.10",
"entities": "^4.5.0",
"framer-motion": "^10.18.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-dropzone": "^14.2.3",
"react-icons": "^5.0.1",
"react-router-dom": "^6.21.2",
"recoil": "^0.7.7"
"recoil": "^0.7.7",
"tailwind-merge": "^2.2.2"
},
"devDependencies": {
"@clab/design-system": "workspace:^",
Expand Down
74 changes: 50 additions & 24 deletions apps/member/src/api/activity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import type {
ActivityBoardType,
ActivityGroupBoardParserType,
ActivityGroupItem,
ActivityGroupMemberMyType,
ActivityGroupStatusType,
ActivityPhotoItem,
ActivityRequestType,
Expand Down Expand Up @@ -43,35 +44,39 @@ interface PatchActivityBoardArgs {
files?: FormData;
}

// 나의 활동 일정 조회
/**
* 나의 활동 일정 조회
*/
export const getMyActivities = async (
startDateTime: string,
endDateTime: string,
startDate: string,
endDate: string,
page: number,
size: number,
) => {
const { data } = await server.get<PaginationType<ScheduleItem>>({
url: createCommonPagination(END_POINT.MY_ACTIVITY, {
startDateTime,
endDateTime,
startDate,
endDate,
page,
size,
}),
});

return data;
};

//활동 사진 조회
/**
* 활동 사진 조회
*/
export const getActivityPhoto = async (page: number, size: number) => {
const { data } = await server.get<PaginationType<ActivityPhotoItem>>({
url: createCommonPagination(END_POINT.MAIN_ACTIVITY_PHOTO, { page, size }),
});

return data;
};

// 활동 상태별 조회
/**
* 활동 상태별 조회
*/
export const getActivityGroupByStatus = async (
activityGroupStatus: ActivityGroupStatusType,
page: number,
Expand All @@ -87,8 +92,9 @@ export const getActivityGroupByStatus = async (

return data;
};

// 활동 상세 조회
/**
* 활동 상세 조회
*/
export const getActivityGroupDetail = async (id: number) => {
const { data } = await server.get<BaseResponse<ActivityGroupBoardParserType>>(
{
Expand All @@ -102,8 +108,9 @@ export const getActivityGroupDetail = async (id: number) => {

return data;
};

// 활동 신청
/**
* 활동 신청
*/
export const postActivityGroupMemberApply = async ({
activityGroupId,
body,
Expand All @@ -119,8 +126,9 @@ export const postActivityGroupMemberApply = async ({

return data;
};

// 상태별 활동 멤버 조회
/**
* 상태별 활동 멤버 조회
*/
export const getActivityGroupApplyByStatus = async (
activityGroupId: number,
page: number,
Expand All @@ -136,8 +144,22 @@ export const getActivityGroupApplyByStatus = async (

return data;
};
/**
* 나의 활동 목록 조회
*/
export const getActivityGroupMemberMy = async (page: number, size: number) => {
const { data } = await server.get<PaginationType<ActivityGroupMemberMyType>>({
url: createCommonPagination(END_POINT.ACTIVITY_GROUP_MEMBER_MY, {
page,
size,
}),
});

// 활동 신청 상태
return data;
};
/**
* 활동 신청 상태
*/
export const patchActivityGroupMemberApply = async ({
activityGroupId,
memberId,
Expand All @@ -150,8 +172,9 @@ export const patchActivityGroupMemberApply = async ({

return data;
};

// 게시판 단일 조회
/**
* 게시판 단일 조회
*/
export const getActivityBoard = async (activityGroupBoardId: number) => {
const { data } = await server.get<BaseResponse<ActivityBoardType>>({
url: createCommonPagination(END_POINT.ACTIVITY_GROUP_BOARDS, {
Expand All @@ -161,8 +184,9 @@ export const getActivityBoard = async (activityGroupBoardId: number) => {

return data;
};

// 나의 과제 제출 게시판 조회
/**
* 나의 과제 제출 게시판 조회
*/
export const getActivityBoardsMyAssignment = async (parentId: number) => {
const { data } = await server.get<BaseResponse<ActivityBoardType[]>>({
url: createCommonPagination(END_POINT.ACTIVITY_GROUP_BOARDS_MY_ASSIGNMENT, {
Expand All @@ -172,8 +196,9 @@ export const getActivityBoardsMyAssignment = async (parentId: number) => {

return data;
};

// 활동 그룹 게시판 생성
/**
* 활동 그룹 게시판 생성
*/
export const postActivityBoard = async ({
parentId,
memberId,
Expand Down Expand Up @@ -214,8 +239,9 @@ export const postActivityBoard = async ({

return data;
};

// 활동 그룹 게시판 수정
/**
* 활동 그룹 게시판 수정
*/
export const patchActivityBoard = async ({
activityGroupBoardId,
groupId,
Expand Down
25 changes: 18 additions & 7 deletions apps/member/src/api/blog.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,25 @@
import { PaginationType } from '@type/api';
import { BaseResponse, PaginationType } from '@type/api';
import { server } from './server';
import { createCommonPagination } from '@utils/api';
import { END_POINT } from '@constants/api';
import type { BlogPostItem } from '@type/blog';

// 블로그 게시글 조회
export const getMyBlog = async (page: number, size: number) => {
import type { BlogPost } from '@type/blog';
/**
* 블로그 포스트 조회
*/
export const getBlog = async (page: number, size: number) => {
const params = { page, size };
const { data } = await server.get<PaginationType<BlogPostItem>>({
url: createCommonPagination(END_POINT.MY_BLOG, params),
const { data } = await server.get<PaginationType<BlogPost>>({
url: createCommonPagination(END_POINT.BLOG, params),
});

return data;
};
/**
* 블로그 포스트 상세 조회
*/
export const getBlogDetail = async (id: number) => {
const { data } = await server.get<BaseResponse<BlogPost>>({
url: END_POINT.BLOG_DETAIL(id),
});

return data;
Expand Down
61 changes: 43 additions & 18 deletions apps/member/src/api/board.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
import { BaseResponse, PaginationType } from '@type/api';
import { server } from './server';
import { END_POINT } from '@constants/api';
import type { BoardItem } from '@type/board';
import { createCommonPagination } from '@utils/api';
import type { BoardItem } from '@type/board';
import type {
CommunityCategoryKorType,
CommunityCategoryType,
CommunityPostDetailItem,
CommunityWriteItem,
} from '@type/community';
import type { PostItem } from '@type/post';

interface PatchBoardsArgs {
id: string;
interface PatchBoardsParams {
id: number;
body: CommunityWriteItem;
}

// 내가 작성한 커뮤니티 게시글 조회
/**
* 내가 작성한 커뮤니티 게시글 조회
*/
export const getMyBoards = async (page: number, size: number) => {
const params = { page, size };
const { data } = await server.get<PaginationType<BoardItem>>({
Expand All @@ -24,45 +26,68 @@ export const getMyBoards = async (page: number, size: number) => {

return data;
};
/**
* 커뮤니티 게시글 목록 조회
*/
export const getBoards = async (page: number, size: number) => {
const { data } = await server.get<PaginationType<BoardItem>>({
url: createCommonPagination(END_POINT.BOARDS, { page, size }),
});

// 커뮤니티 게시글 카테고리별 조회
return data;
};
/**
* 커뮤니티 게시글 카테고리별 조회
*/
export const getBoardsList = async (
category: CommunityCategoryKorType,
category: CommunityCategoryType,
page: number,
size: number,
) => {
const params = { category, page, size };
const { data } = await server.get<PaginationType<PostItem>>({
url: createCommonPagination(END_POINT.BOARDS_LIST, params),
url: createCommonPagination(END_POINT.BOARDS_LIST, {
category: category.toUpperCase(),
page,
size,
}),
});

return data;
};

// 커뮤니티 게시글 작성
/**
* 커뮤니티 게시글 작성
*/
export const postBoardsWrite = async (body: CommunityWriteItem) => {
const { data } = await server.post<CommunityWriteItem, BaseResponse<number>>({
url: END_POINT.BOARDS,
body,
body: {
...body,
category: body.category.toUpperCase(),
},
});

return data;
};

// 커뮤니티 게시글 상세 조회
/**
* 커뮤니티 게시글 상세 조회
*/
export const getBoardsDetail = async (id: string) => {
const { data } = await server.get<BaseResponse<CommunityPostDetailItem>>({
url: END_POINT.BOARDERS_ITEM(id),
});

return data;
};

// 커뮤니티 게시글 수정
export const patchBoards = async ({ id, body }: PatchBoardsArgs) => {
/**
* 커뮤니티 게시글 수정
*/
export const patchBoards = async ({ id, body }: PatchBoardsParams) => {
const { data } = await server.patch<CommunityWriteItem, BaseResponse>({
url: END_POINT.BOARDERS_ITEM(id),
body,
body: {
...body,
category: body.category.toUpperCase(),
},
});

return data;
Expand Down
Loading

0 comments on commit 85eb43a

Please sign in to comment.