diff --git "a/src/apis/1) \355\232\214\354\233\220\352\260\200\354\236\205-\353\241\234\352\267\270\354\235\270/api.ts" "b/src/apis/1) \355\232\214\354\233\220\352\260\200\354\236\205-\353\241\234\352\267\270\354\235\270/api.ts" new file mode 100644 index 00000000..8f92685f --- /dev/null +++ "b/src/apis/1) \355\232\214\354\233\220\352\260\200\354\236\205-\353\241\234\352\267\270\354\235\270/api.ts" @@ -0,0 +1,112 @@ +import { axiosInstance } from "@/utils/axiosInstance"; + +export type 로그아웃Response = void; + +export type 로그아웃Request = Record; + +export interface 애플 인증 (로그인 or 가입 코드 발급)Response { + isRegistered: boolean; + nickname: null; + email: string; + profileImageUrl: null; + signUpToken: string; +} + +export type 애플 인증 (로그인 or 가입 코드 발급)Request = Record; + +export interface 엑세스 토큰 재발급Response { + accessToken: string; +} + +export type 엑세스 토큰 재발급Request = Record; + +export interface 이메일 로그인Response { + accessToken: string; + refreshToken: string; +} + +export type 이메일 로그인Request = Record; + +export interface 이메일 인증 (가입 코드 발급)Response { + signUpToken: string; +} + +export type 이메일 인증 (가입 코드 발급)Request = Record; + +export interface 카카오 인증 (로그인 or 가입 코드 발급)Response { + isRegistered: boolean; + nickname: string; + email: string; + profileImageUrl: string; + signUpToken: string; +} + +export type 카카오 인증 (로그인 or 가입 코드 발급)Request = Record; + +export type 회원 탈퇴Response = void; + +export interface 회원가입Response { + accessToken: string; + refreshToken: string; +} + +export type 회원가입Request = Record; + +export const 1) 회원가입로그인Api = { + post로그아웃: async (params: { data?: 로그아웃Request }): Promise<로그아웃Response> => { + const res = await axiosInstance.post<로그아웃Response>( + `/auth/sign-out`, params?.data + ); + return res.data; + }, + + post애플 인증 (로그인 or 가입 코드 발급): async (params: { data?: 애플 인증 (로그인 or 가입 코드 발급)Request }): Promise<애플 인증 (로그인 or 가입 코드 발급)Response> => { + const res = await axiosInstance.post<애플 인증 (로그인 or 가입 코드 발급)Response>( + `/auth/apple`, params?.data + ); + return res.data; + }, + + post엑세스 토큰 재발급: async (params: { data?: 엑세스 토큰 재발급Request }): Promise<엑세스 토큰 재발급Response> => { + const res = await axiosInstance.post<엑세스 토큰 재발급Response>( + `/auth/reissue`, params?.data + ); + return res.data; + }, + + post이메일 로그인: async (params: { data?: 이메일 로그인Request }): Promise<이메일 로그인Response> => { + const res = await axiosInstance.post<이메일 로그인Response>( + `/auth/email/sign-in`, params?.data + ); + return res.data; + }, + + post이메일 인증 (가입 코드 발급): async (params: { data?: 이메일 인증 (가입 코드 발급)Request }): Promise<이메일 인증 (가입 코드 발급)Response> => { + const res = await axiosInstance.post<이메일 인증 (가입 코드 발급)Response>( + `/auth/email/sign-up`, params?.data + ); + return res.data; + }, + + post카카오 인증 (로그인 or 가입 코드 발급): async (params: { data?: 카카오 인증 (로그인 or 가입 코드 발급)Request }): Promise<카카오 인증 (로그인 or 가입 코드 발급)Response> => { + const res = await axiosInstance.post<카카오 인증 (로그인 or 가입 코드 발급)Response>( + `/auth/kakao`, params?.data + ); + return res.data; + }, + + delete회원 탈퇴: async (): Promise<회원 탈퇴Response> => { + const res = await axiosInstance.delete<회원 탈퇴Response>( + `/auth/quit` + ); + return res.data; + }, + + post회원가입: async (params: { data?: 회원가입Request }): Promise<회원가입Response> => { + const res = await axiosInstance.post<회원가입Response>( + `/auth/sign-up`, params?.data + ); + return res.data; + }, + +}; \ No newline at end of file diff --git "a/src/apis/1) \355\232\214\354\233\220\352\260\200\354\236\205-\353\241\234\352\267\270\354\235\270/delete\355\232\214\354\233\220 \355\203\210\355\207\264.ts" "b/src/apis/1) \355\232\214\354\233\220\352\260\200\354\236\205-\353\241\234\352\267\270\354\235\270/delete\355\232\214\354\233\220 \355\203\210\355\207\264.ts" new file mode 100644 index 00000000..b2c42cad --- /dev/null +++ "b/src/apis/1) \355\232\214\354\233\220\352\260\200\354\236\205-\353\241\234\352\267\270\354\235\270/delete\355\232\214\354\233\220 \355\203\210\355\207\264.ts" @@ -0,0 +1,11 @@ +import { AxiosError } from "axios"; +import { useMutation } from "@tanstack/react-query"; +import { 1) 회원가입로그인Api, 회원 탈퇴Response, 회원 탈퇴Request } from "./api"; + +const useDelete회원 탈퇴 = () => { + return useMutation<회원 탈퇴Response, AxiosError, 회원 탈퇴Request>({ + mutationFn: (data) => 1) 회원가입로그인Api.delete회원 탈퇴({ data }), + }); +}; + +export default useDelete회원 탈퇴; \ No newline at end of file diff --git "a/src/apis/1) \355\232\214\354\233\220\352\260\200\354\236\205-\353\241\234\352\267\270\354\235\270/index.ts" "b/src/apis/1) \355\232\214\354\233\220\352\260\200\354\236\205-\353\241\234\352\267\270\354\235\270/index.ts" new file mode 100644 index 00000000..cbf48168 --- /dev/null +++ "b/src/apis/1) \355\232\214\354\233\220\352\260\200\354\236\205-\353\241\234\352\267\270\354\235\270/index.ts" @@ -0,0 +1,9 @@ +export { 1) 회원가입로그인Api } from './api'; +export { default as delete회원 탈퇴 } from './delete회원 탈퇴'; +export { default as post로그아웃 } from './post로그아웃'; +export { default as post애플 인증 (로그인 or 가입 코드 발급) } from './post애플 인증 (로그인 or 가입 코드 발급)'; +export { default as post엑세스 토큰 재발급 } from './post엑세스 토큰 재발급'; +export { default as post이메일 로그인 } from './post이메일 로그인'; +export { default as post이메일 인증 (가입 코드 발급) } from './post이메일 인증 (가입 코드 발급)'; +export { default as post카카오 인증 (로그인 or 가입 코드 발급) } from './post카카오 인증 (로그인 or 가입 코드 발급)'; +export { default as post회원가입 } from './post회원가입'; diff --git "a/src/apis/1) \355\232\214\354\233\220\352\260\200\354\236\205-\353\241\234\352\267\270\354\235\270/post\353\241\234\352\267\270\354\225\204\354\233\203.ts" "b/src/apis/1) \355\232\214\354\233\220\352\260\200\354\236\205-\353\241\234\352\267\270\354\235\270/post\353\241\234\352\267\270\354\225\204\354\233\203.ts" new file mode 100644 index 00000000..de3515c0 --- /dev/null +++ "b/src/apis/1) \355\232\214\354\233\220\352\260\200\354\236\205-\353\241\234\352\267\270\354\235\270/post\353\241\234\352\267\270\354\225\204\354\233\203.ts" @@ -0,0 +1,11 @@ +import { AxiosError } from "axios"; +import { useMutation } from "@tanstack/react-query"; +import { 1) 회원가입로그인Api, 로그아웃Response, 로그아웃Request } from "./api"; + +const usePost로그아웃 = () => { + return useMutation<로그아웃Response, AxiosError, 로그아웃Request>({ + mutationFn: (data) => 1) 회원가입로그인Api.post로그아웃({ data }), + }); +}; + +export default usePost로그아웃; \ No newline at end of file diff --git "a/src/apis/1) \355\232\214\354\233\220\352\260\200\354\236\205-\353\241\234\352\267\270\354\235\270/post\354\225\240\355\224\214 \354\235\270\354\246\235 (\353\241\234\352\267\270\354\235\270 or \352\260\200\354\236\205 \354\275\224\353\223\234 \353\260\234\352\270\211).ts" "b/src/apis/1) \355\232\214\354\233\220\352\260\200\354\236\205-\353\241\234\352\267\270\354\235\270/post\354\225\240\355\224\214 \354\235\270\354\246\235 (\353\241\234\352\267\270\354\235\270 or \352\260\200\354\236\205 \354\275\224\353\223\234 \353\260\234\352\270\211).ts" new file mode 100644 index 00000000..4d4b68e3 --- /dev/null +++ "b/src/apis/1) \355\232\214\354\233\220\352\260\200\354\236\205-\353\241\234\352\267\270\354\235\270/post\354\225\240\355\224\214 \354\235\270\354\246\235 (\353\241\234\352\267\270\354\235\270 or \352\260\200\354\236\205 \354\275\224\353\223\234 \353\260\234\352\270\211).ts" @@ -0,0 +1,11 @@ +import { AxiosError } from "axios"; +import { useMutation } from "@tanstack/react-query"; +import { 1) 회원가입로그인Api, 애플 인증 (로그인 or 가입 코드 발급)Response, 애플 인증 (로그인 or 가입 코드 발급)Request } from "./api"; + +const usePost애플 인증 (로그인 or 가입 코드 발급) = () => { + return useMutation<애플 인증 (로그인 or 가입 코드 발급)Response, AxiosError, 애플 인증 (로그인 or 가입 코드 발급)Request>({ + mutationFn: (data) => 1) 회원가입로그인Api.post애플 인증 (로그인 or 가입 코드 발급)({ data }), + }); +}; + +export default usePost애플 인증 (로그인 or 가입 코드 발급); \ No newline at end of file diff --git "a/src/apis/1) \355\232\214\354\233\220\352\260\200\354\236\205-\353\241\234\352\267\270\354\235\270/post\354\227\221\354\204\270\354\212\244 \355\206\240\355\201\260 \354\236\254\353\260\234\352\270\211.ts" "b/src/apis/1) \355\232\214\354\233\220\352\260\200\354\236\205-\353\241\234\352\267\270\354\235\270/post\354\227\221\354\204\270\354\212\244 \355\206\240\355\201\260 \354\236\254\353\260\234\352\270\211.ts" new file mode 100644 index 00000000..0d1486b3 --- /dev/null +++ "b/src/apis/1) \355\232\214\354\233\220\352\260\200\354\236\205-\353\241\234\352\267\270\354\235\270/post\354\227\221\354\204\270\354\212\244 \355\206\240\355\201\260 \354\236\254\353\260\234\352\270\211.ts" @@ -0,0 +1,11 @@ +import { AxiosError } from "axios"; +import { useMutation } from "@tanstack/react-query"; +import { 1) 회원가입로그인Api, 엑세스 토큰 재발급Response, 엑세스 토큰 재발급Request } from "./api"; + +const usePost엑세스 토큰 재발급 = () => { + return useMutation<엑세스 토큰 재발급Response, AxiosError, 엑세스 토큰 재발급Request>({ + mutationFn: (data) => 1) 회원가입로그인Api.post엑세스 토큰 재발급({ data }), + }); +}; + +export default usePost엑세스 토큰 재발급; \ No newline at end of file diff --git "a/src/apis/1) \355\232\214\354\233\220\352\260\200\354\236\205-\353\241\234\352\267\270\354\235\270/post\354\235\264\353\251\224\354\235\274 \353\241\234\352\267\270\354\235\270.ts" "b/src/apis/1) \355\232\214\354\233\220\352\260\200\354\236\205-\353\241\234\352\267\270\354\235\270/post\354\235\264\353\251\224\354\235\274 \353\241\234\352\267\270\354\235\270.ts" new file mode 100644 index 00000000..e788b538 --- /dev/null +++ "b/src/apis/1) \355\232\214\354\233\220\352\260\200\354\236\205-\353\241\234\352\267\270\354\235\270/post\354\235\264\353\251\224\354\235\274 \353\241\234\352\267\270\354\235\270.ts" @@ -0,0 +1,11 @@ +import { AxiosError } from "axios"; +import { useMutation } from "@tanstack/react-query"; +import { 1) 회원가입로그인Api, 이메일 로그인Response, 이메일 로그인Request } from "./api"; + +const usePost이메일 로그인 = () => { + return useMutation<이메일 로그인Response, AxiosError, 이메일 로그인Request>({ + mutationFn: (data) => 1) 회원가입로그인Api.post이메일 로그인({ data }), + }); +}; + +export default usePost이메일 로그인; \ No newline at end of file diff --git "a/src/apis/1) \355\232\214\354\233\220\352\260\200\354\236\205-\353\241\234\352\267\270\354\235\270/post\354\235\264\353\251\224\354\235\274 \354\235\270\354\246\235 (\352\260\200\354\236\205 \354\275\224\353\223\234 \353\260\234\352\270\211).ts" "b/src/apis/1) \355\232\214\354\233\220\352\260\200\354\236\205-\353\241\234\352\267\270\354\235\270/post\354\235\264\353\251\224\354\235\274 \354\235\270\354\246\235 (\352\260\200\354\236\205 \354\275\224\353\223\234 \353\260\234\352\270\211).ts" new file mode 100644 index 00000000..25ea4bf9 --- /dev/null +++ "b/src/apis/1) \355\232\214\354\233\220\352\260\200\354\236\205-\353\241\234\352\267\270\354\235\270/post\354\235\264\353\251\224\354\235\274 \354\235\270\354\246\235 (\352\260\200\354\236\205 \354\275\224\353\223\234 \353\260\234\352\270\211).ts" @@ -0,0 +1,11 @@ +import { AxiosError } from "axios"; +import { useMutation } from "@tanstack/react-query"; +import { 1) 회원가입로그인Api, 이메일 인증 (가입 코드 발급)Response, 이메일 인증 (가입 코드 발급)Request } from "./api"; + +const usePost이메일 인증 (가입 코드 발급) = () => { + return useMutation<이메일 인증 (가입 코드 발급)Response, AxiosError, 이메일 인증 (가입 코드 발급)Request>({ + mutationFn: (data) => 1) 회원가입로그인Api.post이메일 인증 (가입 코드 발급)({ data }), + }); +}; + +export default usePost이메일 인증 (가입 코드 발급); \ No newline at end of file diff --git "a/src/apis/1) \355\232\214\354\233\220\352\260\200\354\236\205-\353\241\234\352\267\270\354\235\270/post\354\271\264\354\271\264\354\230\244 \354\235\270\354\246\235 (\353\241\234\352\267\270\354\235\270 or \352\260\200\354\236\205 \354\275\224\353\223\234 \353\260\234\352\270\211).ts" "b/src/apis/1) \355\232\214\354\233\220\352\260\200\354\236\205-\353\241\234\352\267\270\354\235\270/post\354\271\264\354\271\264\354\230\244 \354\235\270\354\246\235 (\353\241\234\352\267\270\354\235\270 or \352\260\200\354\236\205 \354\275\224\353\223\234 \353\260\234\352\270\211).ts" new file mode 100644 index 00000000..e8a3b0e0 --- /dev/null +++ "b/src/apis/1) \355\232\214\354\233\220\352\260\200\354\236\205-\353\241\234\352\267\270\354\235\270/post\354\271\264\354\271\264\354\230\244 \354\235\270\354\246\235 (\353\241\234\352\267\270\354\235\270 or \352\260\200\354\236\205 \354\275\224\353\223\234 \353\260\234\352\270\211).ts" @@ -0,0 +1,11 @@ +import { AxiosError } from "axios"; +import { useMutation } from "@tanstack/react-query"; +import { 1) 회원가입로그인Api, 카카오 인증 (로그인 or 가입 코드 발급)Response, 카카오 인증 (로그인 or 가입 코드 발급)Request } from "./api"; + +const usePost카카오 인증 (로그인 or 가입 코드 발급) = () => { + return useMutation<카카오 인증 (로그인 or 가입 코드 발급)Response, AxiosError, 카카오 인증 (로그인 or 가입 코드 발급)Request>({ + mutationFn: (data) => 1) 회원가입로그인Api.post카카오 인증 (로그인 or 가입 코드 발급)({ data }), + }); +}; + +export default usePost카카오 인증 (로그인 or 가입 코드 발급); \ No newline at end of file diff --git "a/src/apis/1) \355\232\214\354\233\220\352\260\200\354\236\205-\353\241\234\352\267\270\354\235\270/post\355\232\214\354\233\220\352\260\200\354\236\205.ts" "b/src/apis/1) \355\232\214\354\233\220\352\260\200\354\236\205-\353\241\234\352\267\270\354\235\270/post\355\232\214\354\233\220\352\260\200\354\236\205.ts" new file mode 100644 index 00000000..c3e51541 --- /dev/null +++ "b/src/apis/1) \355\232\214\354\233\220\352\260\200\354\236\205-\353\241\234\352\267\270\354\235\270/post\355\232\214\354\233\220\352\260\200\354\236\205.ts" @@ -0,0 +1,11 @@ +import { AxiosError } from "axios"; +import { useMutation } from "@tanstack/react-query"; +import { 1) 회원가입로그인Api, 회원가입Response, 회원가입Request } from "./api"; + +const usePost회원가입 = () => { + return useMutation<회원가입Response, AxiosError, 회원가입Request>({ + mutationFn: (data) => 1) 회원가입로그인Api.post회원가입({ data }), + }); +}; + +export default usePost회원가입; \ No newline at end of file diff --git "a/src/apis/10) \354\206\214\354\213\235\354\247\200/api.ts" "b/src/apis/10) \354\206\214\354\213\235\354\247\200/api.ts" new file mode 100644 index 00000000..1dab45b4 --- /dev/null +++ "b/src/apis/10) \354\206\214\354\213\235\354\247\200/api.ts" @@ -0,0 +1,64 @@ +import { axiosInstance } from "@/utils/axiosInstance"; + +export type 소식지 목록 조회Response = void; + +export type 소식지 삭제Response = void; + +export type 소식지 수정Response = void; + +export type 소식지 수정Request = Record; + +export type 소식지 좋아요 삭제Response = void; + +export type 소식지 좋아요 추가Response = void; + +export type 소식지 좋아요 추가Request = Record; + +export type 소식지 추가Response = void; + +export type 소식지 추가Request = Record; + +export const 10) 소식지Api = { + get소식지 목록 조회: async (params: { params?: Record }): Promise<소식지 목록 조회Response> => { + const res = await axiosInstance.get<소식지 목록 조회Response>( + `/news?author-id=6`, { params: params?.params } + ); + return res.data; + }, + + delete소식지 삭제: async (params: { newsId: string | number }): Promise<소식지 삭제Response> => { + const res = await axiosInstance.delete<소식지 삭제Response>( + `/news/${params.newsId}` + ); + return res.data; + }, + + put소식지 수정: async (params: { newsId: string | number, data?: 소식지 수정Request }): Promise<소식지 수정Response> => { + const res = await axiosInstance.put<소식지 수정Response>( + `/news/${params.newsId}`, params?.data + ); + return res.data; + }, + + delete소식지 좋아요 삭제: async (params: { newsId: string | number }): Promise<소식지 좋아요 삭제Response> => { + const res = await axiosInstance.delete<소식지 좋아요 삭제Response>( + `/news/${params.newsId}/like` + ); + return res.data; + }, + + post소식지 좋아요 추가: async (params: { newsId: string | number, data?: 소식지 좋아요 추가Request }): Promise<소식지 좋아요 추가Response> => { + const res = await axiosInstance.post<소식지 좋아요 추가Response>( + `/news/${params.newsId}/like`, params?.data + ); + return res.data; + }, + + post소식지 추가: async (params: { data?: 소식지 추가Request }): Promise<소식지 추가Response> => { + const res = await axiosInstance.post<소식지 추가Response>( + `/news`, params?.data + ); + return res.data; + }, + +}; \ No newline at end of file diff --git "a/src/apis/10) \354\206\214\354\213\235\354\247\200/delete\354\206\214\354\213\235\354\247\200 \354\202\255\354\240\234.ts" "b/src/apis/10) \354\206\214\354\213\235\354\247\200/delete\354\206\214\354\213\235\354\247\200 \354\202\255\354\240\234.ts" new file mode 100644 index 00000000..023e21e1 --- /dev/null +++ "b/src/apis/10) \354\206\214\354\213\235\354\247\200/delete\354\206\214\354\213\235\354\247\200 \354\202\255\354\240\234.ts" @@ -0,0 +1,11 @@ +import { AxiosError } from "axios"; +import { useMutation } from "@tanstack/react-query"; +import { 10) 소식지Api, 소식지 삭제Response, 소식지 삭제Request } from "./api"; + +const useDelete소식지 삭제 = () => { + return useMutation<소식지 삭제Response, AxiosError, { newsId: string | number; data: 소식지 삭제Request }>({ + mutationFn: (variables) => 10) 소식지Api.delete소식지 삭제(variables), + }); +}; + +export default useDelete소식지 삭제; \ No newline at end of file diff --git "a/src/apis/10) \354\206\214\354\213\235\354\247\200/delete\354\206\214\354\213\235\354\247\200 \354\242\213\354\225\204\354\232\224 \354\202\255\354\240\234.ts" "b/src/apis/10) \354\206\214\354\213\235\354\247\200/delete\354\206\214\354\213\235\354\247\200 \354\242\213\354\225\204\354\232\224 \354\202\255\354\240\234.ts" new file mode 100644 index 00000000..38ed69b7 --- /dev/null +++ "b/src/apis/10) \354\206\214\354\213\235\354\247\200/delete\354\206\214\354\213\235\354\247\200 \354\242\213\354\225\204\354\232\224 \354\202\255\354\240\234.ts" @@ -0,0 +1,11 @@ +import { AxiosError } from "axios"; +import { useMutation } from "@tanstack/react-query"; +import { 10) 소식지Api, 소식지 좋아요 삭제Response, 소식지 좋아요 삭제Request } from "./api"; + +const useDelete소식지 좋아요 삭제 = () => { + return useMutation<소식지 좋아요 삭제Response, AxiosError, { newsId: string | number; data: 소식지 좋아요 삭제Request }>({ + mutationFn: (variables) => 10) 소식지Api.delete소식지 좋아요 삭제(variables), + }); +}; + +export default useDelete소식지 좋아요 삭제; \ No newline at end of file diff --git "a/src/apis/10) \354\206\214\354\213\235\354\247\200/get\354\206\214\354\213\235\354\247\200 \353\252\251\353\241\235 \354\241\260\355\232\214.ts" "b/src/apis/10) \354\206\214\354\213\235\354\247\200/get\354\206\214\354\213\235\354\247\200 \353\252\251\353\241\235 \354\241\260\355\232\214.ts" new file mode 100644 index 00000000..9a47dbcc --- /dev/null +++ "b/src/apis/10) \354\206\214\354\213\235\354\247\200/get\354\206\214\354\213\235\354\247\200 \353\252\251\353\241\235 \354\241\260\355\232\214.ts" @@ -0,0 +1,13 @@ +import { AxiosError } from "axios"; +import { useQuery } from "@tanstack/react-query"; +import { 10) 소식지Api, 소식지 목록 조회Response } from "./api"; +import { QueryKeys } from "../queryKeys"; + +const useGet소식지 목록 조회 = (params?: Record) => { + return useQuery<소식지 목록 조회Response, AxiosError>({ + queryKey: [QueryKeys.10) 소식지.소식지 목록 조회, params], + queryFn: () => 10) 소식지Api.get소식지 목록 조회(params ? { params } : {}), + }); +}; + +export default useGet소식지 목록 조회; \ No newline at end of file diff --git "a/src/apis/10) \354\206\214\354\213\235\354\247\200/index.ts" "b/src/apis/10) \354\206\214\354\213\235\354\247\200/index.ts" new file mode 100644 index 00000000..470cd194 --- /dev/null +++ "b/src/apis/10) \354\206\214\354\213\235\354\247\200/index.ts" @@ -0,0 +1,7 @@ +export { 10) 소식지Api } from './api'; +export { default as delete소식지 삭제 } from './delete소식지 삭제'; +export { default as delete소식지 좋아요 삭제 } from './delete소식지 좋아요 삭제'; +export { default as get소식지 목록 조회 } from './get소식지 목록 조회'; +export { default as post소식지 좋아요 추가 } from './post소식지 좋아요 추가'; +export { default as post소식지 추가 } from './post소식지 추가'; +export { default as put소식지 수정 } from './put소식지 수정'; diff --git "a/src/apis/10) \354\206\214\354\213\235\354\247\200/post\354\206\214\354\213\235\354\247\200 \354\242\213\354\225\204\354\232\224 \354\266\224\352\260\200.ts" "b/src/apis/10) \354\206\214\354\213\235\354\247\200/post\354\206\214\354\213\235\354\247\200 \354\242\213\354\225\204\354\232\224 \354\266\224\352\260\200.ts" new file mode 100644 index 00000000..cd78f130 --- /dev/null +++ "b/src/apis/10) \354\206\214\354\213\235\354\247\200/post\354\206\214\354\213\235\354\247\200 \354\242\213\354\225\204\354\232\224 \354\266\224\352\260\200.ts" @@ -0,0 +1,11 @@ +import { AxiosError } from "axios"; +import { useMutation } from "@tanstack/react-query"; +import { 10) 소식지Api, 소식지 좋아요 추가Response, 소식지 좋아요 추가Request } from "./api"; + +const usePost소식지 좋아요 추가 = () => { + return useMutation<소식지 좋아요 추가Response, AxiosError, { newsId: string | number; data: 소식지 좋아요 추가Request }>({ + mutationFn: (variables) => 10) 소식지Api.post소식지 좋아요 추가(variables), + }); +}; + +export default usePost소식지 좋아요 추가; \ No newline at end of file diff --git "a/src/apis/10) \354\206\214\354\213\235\354\247\200/post\354\206\214\354\213\235\354\247\200 \354\266\224\352\260\200.ts" "b/src/apis/10) \354\206\214\354\213\235\354\247\200/post\354\206\214\354\213\235\354\247\200 \354\266\224\352\260\200.ts" new file mode 100644 index 00000000..c1221d9f --- /dev/null +++ "b/src/apis/10) \354\206\214\354\213\235\354\247\200/post\354\206\214\354\213\235\354\247\200 \354\266\224\352\260\200.ts" @@ -0,0 +1,11 @@ +import { AxiosError } from "axios"; +import { useMutation } from "@tanstack/react-query"; +import { 10) 소식지Api, 소식지 추가Response, 소식지 추가Request } from "./api"; + +const usePost소식지 추가 = () => { + return useMutation<소식지 추가Response, AxiosError, 소식지 추가Request>({ + mutationFn: (data) => 10) 소식지Api.post소식지 추가({ data }), + }); +}; + +export default usePost소식지 추가; \ No newline at end of file diff --git "a/src/apis/10) \354\206\214\354\213\235\354\247\200/put\354\206\214\354\213\235\354\247\200 \354\210\230\354\240\225.ts" "b/src/apis/10) \354\206\214\354\213\235\354\247\200/put\354\206\214\354\213\235\354\247\200 \354\210\230\354\240\225.ts" new file mode 100644 index 00000000..c3dbde9b --- /dev/null +++ "b/src/apis/10) \354\206\214\354\213\235\354\247\200/put\354\206\214\354\213\235\354\247\200 \354\210\230\354\240\225.ts" @@ -0,0 +1,11 @@ +import { AxiosError } from "axios"; +import { useMutation } from "@tanstack/react-query"; +import { 10) 소식지Api, 소식지 수정Response, 소식지 수정Request } from "./api"; + +const usePut소식지 수정 = () => { + return useMutation<소식지 수정Response, AxiosError, { newsId: string | number; data: 소식지 수정Request }>({ + mutationFn: (variables) => 10) 소식지Api.put소식지 수정(variables), + }); +}; + +export default usePut소식지 수정; \ No newline at end of file diff --git "a/src/apis/11) \354\213\240\352\263\240/api.ts" "b/src/apis/11) \354\213\240\352\263\240/api.ts" new file mode 100644 index 00000000..db5fa4fb --- /dev/null +++ "b/src/apis/11) \354\213\240\352\263\240/api.ts" @@ -0,0 +1,15 @@ +import { axiosInstance } from "@/utils/axiosInstance"; + +export type 신고하기Response = void; + +export type 신고하기Request = Record; + +export const 11) 신고Api = { + post신고하기: async (params: { data?: 신고하기Request }): Promise<신고하기Response> => { + const res = await axiosInstance.post<신고하기Response>( + `/reports`, params?.data + ); + return res.data; + }, + +}; \ No newline at end of file diff --git "a/src/apis/11) \354\213\240\352\263\240/index.ts" "b/src/apis/11) \354\213\240\352\263\240/index.ts" new file mode 100644 index 00000000..037a66b7 --- /dev/null +++ "b/src/apis/11) \354\213\240\352\263\240/index.ts" @@ -0,0 +1,2 @@ +export { 11) 신고Api } from './api'; +export { default as post신고하기 } from './post신고하기'; diff --git "a/src/apis/11) \354\213\240\352\263\240/post\354\213\240\352\263\240\355\225\230\352\270\260.ts" "b/src/apis/11) \354\213\240\352\263\240/post\354\213\240\352\263\240\355\225\230\352\270\260.ts" new file mode 100644 index 00000000..37338443 --- /dev/null +++ "b/src/apis/11) \354\213\240\352\263\240/post\354\213\240\352\263\240\355\225\230\352\270\260.ts" @@ -0,0 +1,11 @@ +import { AxiosError } from "axios"; +import { useMutation } from "@tanstack/react-query"; +import { 11) 신고Api, 신고하기Response, 신고하기Request } from "./api"; + +const usePost신고하기 = () => { + return useMutation<신고하기Response, AxiosError, 신고하기Request>({ + mutationFn: (data) => 11) 신고Api.post신고하기({ data }), + }); +}; + +export default usePost신고하기; \ No newline at end of file diff --git "a/src/apis/11) \354\261\204\355\214\205- chat/api.ts" "b/src/apis/11) \354\261\204\355\214\205- chat/api.ts" new file mode 100644 index 00000000..3ba22dbb --- /dev/null +++ "b/src/apis/11) \354\261\204\355\214\205- chat/api.ts" @@ -0,0 +1,46 @@ +import { axiosInstance } from "@/utils/axiosInstance"; + +export type 채팅 내역 조회Response = void; + +export type 채팅방 목록 조회Response = void; + +export type 채팅방 읽음 처리Response = void; + +export type 채팅방 읽음 처리Request = Record; + +export interface 채팅방 파트너 조회Response { + partnerId: number; + nickname: string; + profileUrl: string; +} + +export const 11) 채팅 chatApi = { + get채팅 내역 조회: async (params: { roomId: string | number, defaultSize: string | number, defaultPage: string | number, params?: Record }): Promise<채팅 내역 조회Response> => { + const res = await axiosInstance.get<채팅 내역 조회Response>( + `/chats/rooms/${params.roomId}?size=${params.defaultSize}&page=${params.defaultPage}`, { params: params?.params } + ); + return res.data; + }, + + get채팅방 목록 조회: async (params: { params?: Record }): Promise<채팅방 목록 조회Response> => { + const res = await axiosInstance.get<채팅방 목록 조회Response>( + `/chats/rooms`, { params: params?.params } + ); + return res.data; + }, + + put채팅방 읽음 처리: async (params: { roomId: string | number, data?: 채팅방 읽음 처리Request }): Promise<채팅방 읽음 처리Response> => { + const res = await axiosInstance.put<채팅방 읽음 처리Response>( + `/chats/rooms/${params.roomId}/read`, params?.data + ); + return res.data; + }, + + get채팅방 파트너 조회: async (params: { roomId: string | number, params?: Record }): Promise<채팅방 파트너 조회Response> => { + const res = await axiosInstance.get<채팅방 파트너 조회Response>( + `/chats/rooms/${params.roomId}/partner`, { params: params?.params } + ); + return res.data; + }, + +}; \ No newline at end of file diff --git "a/src/apis/11) \354\261\204\355\214\205- chat/get\354\261\204\355\214\205 \353\202\264\354\227\255 \354\241\260\355\232\214.ts" "b/src/apis/11) \354\261\204\355\214\205- chat/get\354\261\204\355\214\205 \353\202\264\354\227\255 \354\241\260\355\232\214.ts" new file mode 100644 index 00000000..c90ff874 --- /dev/null +++ "b/src/apis/11) \354\261\204\355\214\205- chat/get\354\261\204\355\214\205 \353\202\264\354\227\255 \354\241\260\355\232\214.ts" @@ -0,0 +1,14 @@ +import { AxiosError } from "axios"; +import { useQuery } from "@tanstack/react-query"; +import { 11) 채팅 chatApi, 채팅 내역 조회Response } from "./api"; +import { QueryKeys } from "../queryKeys"; + +const useGet채팅 내역 조회 = (roomId: string | number, defaultSize: string | number, defaultPage: string | number, params?: Record) => { + return useQuery<채팅 내역 조회Response, AxiosError>({ + queryKey: [QueryKeys['11) 채팅- chat'].채팅 내역 조회, roomId, defaultSize, defaultPage, params], + queryFn: () => 11) 채팅 chatApi.get채팅 내역 조회({ roomId, defaultSize, defaultPage, params }), + enabled: !!roomId && !!defaultSize && !!defaultPage, + }); +}; + +export default useGet채팅 내역 조회; \ No newline at end of file diff --git "a/src/apis/11) \354\261\204\355\214\205- chat/get\354\261\204\355\214\205\353\260\251 \353\252\251\353\241\235 \354\241\260\355\232\214.ts" "b/src/apis/11) \354\261\204\355\214\205- chat/get\354\261\204\355\214\205\353\260\251 \353\252\251\353\241\235 \354\241\260\355\232\214.ts" new file mode 100644 index 00000000..cef1c14f --- /dev/null +++ "b/src/apis/11) \354\261\204\355\214\205- chat/get\354\261\204\355\214\205\353\260\251 \353\252\251\353\241\235 \354\241\260\355\232\214.ts" @@ -0,0 +1,13 @@ +import { AxiosError } from "axios"; +import { useQuery } from "@tanstack/react-query"; +import { 11) 채팅 chatApi, 채팅방 목록 조회Response } from "./api"; +import { QueryKeys } from "../queryKeys"; + +const useGet채팅방 목록 조회 = (params?: Record) => { + return useQuery<채팅방 목록 조회Response, AxiosError>({ + queryKey: [QueryKeys['11) 채팅- chat'].채팅방 목록 조회, params], + queryFn: () => 11) 채팅 chatApi.get채팅방 목록 조회(params ? { params } : {}), + }); +}; + +export default useGet채팅방 목록 조회; \ No newline at end of file diff --git "a/src/apis/11) \354\261\204\355\214\205- chat/get\354\261\204\355\214\205\353\260\251 \355\214\214\355\212\270\353\204\210 \354\241\260\355\232\214.ts" "b/src/apis/11) \354\261\204\355\214\205- chat/get\354\261\204\355\214\205\353\260\251 \355\214\214\355\212\270\353\204\210 \354\241\260\355\232\214.ts" new file mode 100644 index 00000000..25c65e58 --- /dev/null +++ "b/src/apis/11) \354\261\204\355\214\205- chat/get\354\261\204\355\214\205\353\260\251 \355\214\214\355\212\270\353\204\210 \354\241\260\355\232\214.ts" @@ -0,0 +1,14 @@ +import { AxiosError } from "axios"; +import { useQuery } from "@tanstack/react-query"; +import { 11) 채팅 chatApi, 채팅방 파트너 조회Response } from "./api"; +import { QueryKeys } from "../queryKeys"; + +const useGet채팅방 파트너 조회 = (roomId: string | number, params?: Record) => { + return useQuery<채팅방 파트너 조회Response, AxiosError>({ + queryKey: [QueryKeys['11) 채팅- chat'].채팅방 파트너 조회, roomId, params], + queryFn: () => 11) 채팅 chatApi.get채팅방 파트너 조회({ roomId, params }), + enabled: !!roomId, + }); +}; + +export default useGet채팅방 파트너 조회; \ No newline at end of file diff --git "a/src/apis/11) \354\261\204\355\214\205- chat/index.ts" "b/src/apis/11) \354\261\204\355\214\205- chat/index.ts" new file mode 100644 index 00000000..8a46fb48 --- /dev/null +++ "b/src/apis/11) \354\261\204\355\214\205- chat/index.ts" @@ -0,0 +1,5 @@ +export { 11) 채팅 chatApi } from './api'; +export { default as get채팅 내역 조회 } from './get채팅 내역 조회'; +export { default as get채팅방 목록 조회 } from './get채팅방 목록 조회'; +export { default as get채팅방 파트너 조회 } from './get채팅방 파트너 조회'; +export { default as put채팅방 읽음 처리 } from './put채팅방 읽음 처리'; diff --git "a/src/apis/11) \354\261\204\355\214\205- chat/put\354\261\204\355\214\205\353\260\251 \354\235\275\354\235\214 \354\262\230\353\246\254.ts" "b/src/apis/11) \354\261\204\355\214\205- chat/put\354\261\204\355\214\205\353\260\251 \354\235\275\354\235\214 \354\262\230\353\246\254.ts" new file mode 100644 index 00000000..0371f759 --- /dev/null +++ "b/src/apis/11) \354\261\204\355\214\205- chat/put\354\261\204\355\214\205\353\260\251 \354\235\275\354\235\214 \354\262\230\353\246\254.ts" @@ -0,0 +1,11 @@ +import { AxiosError } from "axios"; +import { useMutation } from "@tanstack/react-query"; +import { 11) 채팅 chatApi, 채팅방 읽음 처리Response, 채팅방 읽음 처리Request } from "./api"; + +const usePut채팅방 읽음 처리 = () => { + return useMutation<채팅방 읽음 처리Response, AxiosError, { roomId: string | number; data: 채팅방 읽음 처리Request }>({ + mutationFn: (variables) => 11) 채팅 chatApi.put채팅방 읽음 처리(variables), + }); +}; + +export default usePut채팅방 읽음 처리; \ No newline at end of file diff --git "a/src/apis/3) \353\247\210\354\235\264\355\216\230\354\235\264\354\247\200/api.ts" "b/src/apis/3) \353\247\210\354\235\264\355\216\230\354\235\264\354\247\200/api.ts" new file mode 100644 index 00000000..1105853a --- /dev/null +++ "b/src/apis/3) \353\247\210\354\235\264\355\216\230\354\235\264\354\247\200/api.ts" @@ -0,0 +1,56 @@ +import { axiosInstance } from "@/utils/axiosInstance"; + +export type 관심 권역국가 변경Response = void; + +export type 관심 권역국가 변경Request = Record; + +export type 내 정보 수정Response = void; + +export type 내 정보 수정Request = Record; + +export interface 내 정보 조회Response { + likedUniversityCount: number; + nickname: string; + profileImageUrl: string; + role: string; + authType: string; + email: string; + likedPostCount: number; + likedMentorCount: number; + interestedCountries: string[]; +} + +export type 비밀번호 변경Response = void; + +export type 비밀번호 변경Request = Record; + +export const 3) 마이페이지Api = { + patch관심 권역국가 변경: async (params: { data?: 관심 권역국가 변경Request }): Promise<관심 권역국가 변경Response> => { + const res = await axiosInstance.patch<관심 권역국가 변경Response>( + `/my/interested-location`, params?.data + ); + return res.data; + }, + + patch내 정보 수정: async (params: { data?: 내 정보 수정Request }): Promise<내 정보 수정Response> => { + const res = await axiosInstance.patch<내 정보 수정Response>( + `/my`, params?.data + ); + return res.data; + }, + + get내 정보 조회: async (params: { params?: Record }): Promise<내 정보 조회Response> => { + const res = await axiosInstance.get<내 정보 조회Response>( + `/my`, { params: params?.params } + ); + return res.data; + }, + + patch비밀번호 변경: async (params: { data?: 비밀번호 변경Request }): Promise<비밀번호 변경Response> => { + const res = await axiosInstance.patch<비밀번호 변경Response>( + `/my/password`, params?.data + ); + return res.data; + }, + +}; \ No newline at end of file diff --git "a/src/apis/3) \353\247\210\354\235\264\355\216\230\354\235\264\354\247\200/get\353\202\264 \354\240\225\353\263\264 \354\241\260\355\232\214.ts" "b/src/apis/3) \353\247\210\354\235\264\355\216\230\354\235\264\354\247\200/get\353\202\264 \354\240\225\353\263\264 \354\241\260\355\232\214.ts" new file mode 100644 index 00000000..1bba298d --- /dev/null +++ "b/src/apis/3) \353\247\210\354\235\264\355\216\230\354\235\264\354\247\200/get\353\202\264 \354\240\225\353\263\264 \354\241\260\355\232\214.ts" @@ -0,0 +1,13 @@ +import { AxiosError } from "axios"; +import { useQuery } from "@tanstack/react-query"; +import { 3) 마이페이지Api, 내 정보 조회Response } from "./api"; +import { QueryKeys } from "../queryKeys"; + +const useGet내 정보 조회 = (params?: Record) => { + return useQuery<내 정보 조회Response, AxiosError>({ + queryKey: [QueryKeys.3) 마이페이지.내 정보 조회, params], + queryFn: () => 3) 마이페이지Api.get내 정보 조회(params ? { params } : {}), + }); +}; + +export default useGet내 정보 조회; \ No newline at end of file diff --git "a/src/apis/3) \353\247\210\354\235\264\355\216\230\354\235\264\354\247\200/index.ts" "b/src/apis/3) \353\247\210\354\235\264\355\216\230\354\235\264\354\247\200/index.ts" new file mode 100644 index 00000000..7638dfce --- /dev/null +++ "b/src/apis/3) \353\247\210\354\235\264\355\216\230\354\235\264\354\247\200/index.ts" @@ -0,0 +1,5 @@ +export { 3) 마이페이지Api } from './api'; +export { default as get내 정보 조회 } from './get내 정보 조회'; +export { default as patch관심 권역국가 변경 } from './patch관심 권역국가 변경'; +export { default as patch내 정보 수정 } from './patch내 정보 수정'; +export { default as patch비밀번호 변경 } from './patch비밀번호 변경'; diff --git "a/src/apis/3) \353\247\210\354\235\264\355\216\230\354\235\264\354\247\200/patch\352\264\200\354\213\254 \352\266\214\354\227\255\352\265\255\352\260\200 \353\263\200\352\262\275.ts" "b/src/apis/3) \353\247\210\354\235\264\355\216\230\354\235\264\354\247\200/patch\352\264\200\354\213\254 \352\266\214\354\227\255\352\265\255\352\260\200 \353\263\200\352\262\275.ts" new file mode 100644 index 00000000..06a3d567 --- /dev/null +++ "b/src/apis/3) \353\247\210\354\235\264\355\216\230\354\235\264\354\247\200/patch\352\264\200\354\213\254 \352\266\214\354\227\255\352\265\255\352\260\200 \353\263\200\352\262\275.ts" @@ -0,0 +1,11 @@ +import { AxiosError } from "axios"; +import { useMutation } from "@tanstack/react-query"; +import { 3) 마이페이지Api, 관심 권역국가 변경Response, 관심 권역국가 변경Request } from "./api"; + +const usePatch관심 권역국가 변경 = () => { + return useMutation<관심 권역국가 변경Response, AxiosError, 관심 권역국가 변경Request>({ + mutationFn: (data) => 3) 마이페이지Api.patch관심 권역국가 변경({ data }), + }); +}; + +export default usePatch관심 권역국가 변경; \ No newline at end of file diff --git "a/src/apis/3) \353\247\210\354\235\264\355\216\230\354\235\264\354\247\200/patch\353\202\264 \354\240\225\353\263\264 \354\210\230\354\240\225.ts" "b/src/apis/3) \353\247\210\354\235\264\355\216\230\354\235\264\354\247\200/patch\353\202\264 \354\240\225\353\263\264 \354\210\230\354\240\225.ts" new file mode 100644 index 00000000..b2c470c1 --- /dev/null +++ "b/src/apis/3) \353\247\210\354\235\264\355\216\230\354\235\264\354\247\200/patch\353\202\264 \354\240\225\353\263\264 \354\210\230\354\240\225.ts" @@ -0,0 +1,11 @@ +import { AxiosError } from "axios"; +import { useMutation } from "@tanstack/react-query"; +import { 3) 마이페이지Api, 내 정보 수정Response, 내 정보 수정Request } from "./api"; + +const usePatch내 정보 수정 = () => { + return useMutation<내 정보 수정Response, AxiosError, 내 정보 수정Request>({ + mutationFn: (data) => 3) 마이페이지Api.patch내 정보 수정({ data }), + }); +}; + +export default usePatch내 정보 수정; \ No newline at end of file diff --git "a/src/apis/3) \353\247\210\354\235\264\355\216\230\354\235\264\354\247\200/patch\353\271\204\353\260\200\353\262\210\355\230\270 \353\263\200\352\262\275.ts" "b/src/apis/3) \353\247\210\354\235\264\355\216\230\354\235\264\354\247\200/patch\353\271\204\353\260\200\353\262\210\355\230\270 \353\263\200\352\262\275.ts" new file mode 100644 index 00000000..6d6b654f --- /dev/null +++ "b/src/apis/3) \353\247\210\354\235\264\355\216\230\354\235\264\354\247\200/patch\353\271\204\353\260\200\353\262\210\355\230\270 \353\263\200\352\262\275.ts" @@ -0,0 +1,11 @@ +import { AxiosError } from "axios"; +import { useMutation } from "@tanstack/react-query"; +import { 3) 마이페이지Api, 비밀번호 변경Response, 비밀번호 변경Request } from "./api"; + +const usePatch비밀번호 변경 = () => { + return useMutation<비밀번호 변경Response, AxiosError, 비밀번호 변경Request>({ + mutationFn: (data) => 3) 마이페이지Api.patch비밀번호 변경({ data }), + }); +}; + +export default usePatch비밀번호 변경; \ No newline at end of file diff --git "a/src/apis/4) \354\247\200\354\233\220\354\240\225\353\263\264/api.ts" "b/src/apis/4) \354\247\200\354\233\220\354\240\225\353\263\264/api.ts" new file mode 100644 index 00000000..83dbf6dd --- /dev/null +++ "b/src/apis/4) \354\247\200\354\233\220\354\240\225\353\263\264/api.ts" @@ -0,0 +1,43 @@ +import { axiosInstance } from "@/utils/axiosInstance"; + +export type 나의 지원과 동일한 지원자 현황 조회Response = void; + +export interface 지원서 제출ResponseAppliedUniversities { + firstChoiceUniversity: string; + secondChoiceUniversity: string; + thirdChoiceUniversity: string; +} + +export interface 지원서 제출Response { + totalApplyCount: number; + applyCount: number; + appliedUniversities: 지원서 제출ResponseAppliedUniversities; +} + +export type 지원서 제출Request = Record; + +export type 지원자 현황 조회Response = void; + +export const 4) 지원정보Api = { + get나의 지원과 동일한 지원자 현황 조회: async (params: { params?: Record }): Promise<나의 지원과 동일한 지원자 현황 조회Response> => { + const res = await axiosInstance.get<나의 지원과 동일한 지원자 현황 조회Response>( + `/applications/competitors`, { params: params?.params } + ); + return res.data; + }, + + post지원서 제출: async (params: { data?: 지원서 제출Request }): Promise<지원서 제출Response> => { + const res = await axiosInstance.post<지원서 제출Response>( + `/applications`, params?.data + ); + return res.data; + }, + + get지원자 현황 조회: async (params: { params?: Record }): Promise<지원자 현황 조회Response> => { + const res = await axiosInstance.get<지원자 현황 조회Response>( + `/applications`, { params: params?.params } + ); + return res.data; + }, + +}; \ No newline at end of file diff --git "a/src/apis/4) \354\247\200\354\233\220\354\240\225\353\263\264/get\353\202\230\354\235\230 \354\247\200\354\233\220\352\263\274 \353\217\231\354\235\274\355\225\234 \354\247\200\354\233\220\354\236\220 \355\230\204\355\231\251 \354\241\260\355\232\214.ts" "b/src/apis/4) \354\247\200\354\233\220\354\240\225\353\263\264/get\353\202\230\354\235\230 \354\247\200\354\233\220\352\263\274 \353\217\231\354\235\274\355\225\234 \354\247\200\354\233\220\354\236\220 \355\230\204\355\231\251 \354\241\260\355\232\214.ts" new file mode 100644 index 00000000..2acb8430 --- /dev/null +++ "b/src/apis/4) \354\247\200\354\233\220\354\240\225\353\263\264/get\353\202\230\354\235\230 \354\247\200\354\233\220\352\263\274 \353\217\231\354\235\274\355\225\234 \354\247\200\354\233\220\354\236\220 \355\230\204\355\231\251 \354\241\260\355\232\214.ts" @@ -0,0 +1,13 @@ +import { AxiosError } from "axios"; +import { useQuery } from "@tanstack/react-query"; +import { 4) 지원정보Api, 나의 지원과 동일한 지원자 현황 조회Response } from "./api"; +import { QueryKeys } from "../queryKeys"; + +const useGet나의 지원과 동일한 지원자 현황 조회 = (params?: Record) => { + return useQuery<나의 지원과 동일한 지원자 현황 조회Response, AxiosError>({ + queryKey: [QueryKeys.4) 지원정보.나의 지원과 동일한 지원자 현황 조회, params], + queryFn: () => 4) 지원정보Api.get나의 지원과 동일한 지원자 현황 조회(params ? { params } : {}), + }); +}; + +export default useGet나의 지원과 동일한 지원자 현황 조회; \ No newline at end of file diff --git "a/src/apis/4) \354\247\200\354\233\220\354\240\225\353\263\264/get\354\247\200\354\233\220\354\236\220 \355\230\204\355\231\251 \354\241\260\355\232\214.ts" "b/src/apis/4) \354\247\200\354\233\220\354\240\225\353\263\264/get\354\247\200\354\233\220\354\236\220 \355\230\204\355\231\251 \354\241\260\355\232\214.ts" new file mode 100644 index 00000000..c80a641b --- /dev/null +++ "b/src/apis/4) \354\247\200\354\233\220\354\240\225\353\263\264/get\354\247\200\354\233\220\354\236\220 \355\230\204\355\231\251 \354\241\260\355\232\214.ts" @@ -0,0 +1,13 @@ +import { AxiosError } from "axios"; +import { useQuery } from "@tanstack/react-query"; +import { 4) 지원정보Api, 지원자 현황 조회Response } from "./api"; +import { QueryKeys } from "../queryKeys"; + +const useGet지원자 현황 조회 = (params?: Record) => { + return useQuery<지원자 현황 조회Response, AxiosError>({ + queryKey: [QueryKeys.4) 지원정보.지원자 현황 조회, params], + queryFn: () => 4) 지원정보Api.get지원자 현황 조회(params ? { params } : {}), + }); +}; + +export default useGet지원자 현황 조회; \ No newline at end of file diff --git "a/src/apis/4) \354\247\200\354\233\220\354\240\225\353\263\264/index.ts" "b/src/apis/4) \354\247\200\354\233\220\354\240\225\353\263\264/index.ts" new file mode 100644 index 00000000..d23144c7 --- /dev/null +++ "b/src/apis/4) \354\247\200\354\233\220\354\240\225\353\263\264/index.ts" @@ -0,0 +1,4 @@ +export { 4) 지원정보Api } from './api'; +export { default as get나의 지원과 동일한 지원자 현황 조회 } from './get나의 지원과 동일한 지원자 현황 조회'; +export { default as get지원자 현황 조회 } from './get지원자 현황 조회'; +export { default as post지원서 제출 } from './post지원서 제출'; diff --git "a/src/apis/4) \354\247\200\354\233\220\354\240\225\353\263\264/post\354\247\200\354\233\220\354\204\234 \354\240\234\354\266\234.ts" "b/src/apis/4) \354\247\200\354\233\220\354\240\225\353\263\264/post\354\247\200\354\233\220\354\204\234 \354\240\234\354\266\234.ts" new file mode 100644 index 00000000..1b911958 --- /dev/null +++ "b/src/apis/4) \354\247\200\354\233\220\354\240\225\353\263\264/post\354\247\200\354\233\220\354\204\234 \354\240\234\354\266\234.ts" @@ -0,0 +1,11 @@ +import { AxiosError } from "axios"; +import { useMutation } from "@tanstack/react-query"; +import { 4) 지원정보Api, 지원서 제출Response, 지원서 제출Request } from "./api"; + +const usePost지원서 제출 = () => { + return useMutation<지원서 제출Response, AxiosError, 지원서 제출Request>({ + mutationFn: (data) => 4) 지원정보Api.post지원서 제출({ data }), + }); +}; + +export default usePost지원서 제출; \ No newline at end of file diff --git "a/src/apis/6) \354\204\261\354\240\201 \353\223\261\353\241\235/api.ts" "b/src/apis/6) \354\204\261\354\240\201 \353\223\261\353\241\235/api.ts" new file mode 100644 index 00000000..c179fda3 --- /dev/null +++ "b/src/apis/6) \354\204\261\354\240\201 \353\223\261\353\241\235/api.ts" @@ -0,0 +1,44 @@ +import { axiosInstance } from "@/utils/axiosInstance"; + +export type 어학 성적 등록Response = void; + +export type 어학 성적 등록Request = Record; + +export type 어학 성적 조회Response = void; + +export type 학점 등록Response = void; + +export type 학점 등록Request = Record; + +export type 학점 조회Response = void; + +export const 6) 성적 등록Api = { + post어학 성적 등록: async (params: { data?: 어학 성적 등록Request }): Promise<어학 성적 등록Response> => { + const res = await axiosInstance.post<어학 성적 등록Response>( + `/scores/language-tests`, params?.data + ); + return res.data; + }, + + get어학 성적 조회: async (params: { params?: Record }): Promise<어학 성적 조회Response> => { + const res = await axiosInstance.get<어학 성적 조회Response>( + `/scores/language-tests`, { params: params?.params } + ); + return res.data; + }, + + post학점 등록: async (params: { data?: 학점 등록Request }): Promise<학점 등록Response> => { + const res = await axiosInstance.post<학점 등록Response>( + `/scores/gpas`, params?.data + ); + return res.data; + }, + + get학점 조회: async (params: { params?: Record }): Promise<학점 조회Response> => { + const res = await axiosInstance.get<학점 조회Response>( + `/scores/gpas`, { params: params?.params } + ); + return res.data; + }, + +}; \ No newline at end of file diff --git "a/src/apis/6) \354\204\261\354\240\201 \353\223\261\353\241\235/get\354\226\264\355\225\231 \354\204\261\354\240\201 \354\241\260\355\232\214.ts" "b/src/apis/6) \354\204\261\354\240\201 \353\223\261\353\241\235/get\354\226\264\355\225\231 \354\204\261\354\240\201 \354\241\260\355\232\214.ts" new file mode 100644 index 00000000..d2fcdb23 --- /dev/null +++ "b/src/apis/6) \354\204\261\354\240\201 \353\223\261\353\241\235/get\354\226\264\355\225\231 \354\204\261\354\240\201 \354\241\260\355\232\214.ts" @@ -0,0 +1,13 @@ +import { AxiosError } from "axios"; +import { useQuery } from "@tanstack/react-query"; +import { 6) 성적 등록Api, 어학 성적 조회Response } from "./api"; +import { QueryKeys } from "../queryKeys"; + +const useGet어학 성적 조회 = (params?: Record) => { + return useQuery<어학 성적 조회Response, AxiosError>({ + queryKey: [QueryKeys.6) 성적 등록.어학 성적 조회, params], + queryFn: () => 6) 성적 등록Api.get어학 성적 조회(params ? { params } : {}), + }); +}; + +export default useGet어학 성적 조회; \ No newline at end of file diff --git "a/src/apis/6) \354\204\261\354\240\201 \353\223\261\353\241\235/get\355\225\231\354\240\220 \354\241\260\355\232\214.ts" "b/src/apis/6) \354\204\261\354\240\201 \353\223\261\353\241\235/get\355\225\231\354\240\220 \354\241\260\355\232\214.ts" new file mode 100644 index 00000000..1396711f --- /dev/null +++ "b/src/apis/6) \354\204\261\354\240\201 \353\223\261\353\241\235/get\355\225\231\354\240\220 \354\241\260\355\232\214.ts" @@ -0,0 +1,13 @@ +import { AxiosError } from "axios"; +import { useQuery } from "@tanstack/react-query"; +import { 6) 성적 등록Api, 학점 조회Response } from "./api"; +import { QueryKeys } from "../queryKeys"; + +const useGet학점 조회 = (params?: Record) => { + return useQuery<학점 조회Response, AxiosError>({ + queryKey: [QueryKeys.6) 성적 등록.학점 조회, params], + queryFn: () => 6) 성적 등록Api.get학점 조회(params ? { params } : {}), + }); +}; + +export default useGet학점 조회; \ No newline at end of file diff --git "a/src/apis/6) \354\204\261\354\240\201 \353\223\261\353\241\235/index.ts" "b/src/apis/6) \354\204\261\354\240\201 \353\223\261\353\241\235/index.ts" new file mode 100644 index 00000000..9f01bd39 --- /dev/null +++ "b/src/apis/6) \354\204\261\354\240\201 \353\223\261\353\241\235/index.ts" @@ -0,0 +1,5 @@ +export { 6) 성적 등록Api } from './api'; +export { default as get어학 성적 조회 } from './get어학 성적 조회'; +export { default as get학점 조회 } from './get학점 조회'; +export { default as post어학 성적 등록 } from './post어학 성적 등록'; +export { default as post학점 등록 } from './post학점 등록'; diff --git "a/src/apis/6) \354\204\261\354\240\201 \353\223\261\353\241\235/post\354\226\264\355\225\231 \354\204\261\354\240\201 \353\223\261\353\241\235.ts" "b/src/apis/6) \354\204\261\354\240\201 \353\223\261\353\241\235/post\354\226\264\355\225\231 \354\204\261\354\240\201 \353\223\261\353\241\235.ts" new file mode 100644 index 00000000..32424822 --- /dev/null +++ "b/src/apis/6) \354\204\261\354\240\201 \353\223\261\353\241\235/post\354\226\264\355\225\231 \354\204\261\354\240\201 \353\223\261\353\241\235.ts" @@ -0,0 +1,11 @@ +import { AxiosError } from "axios"; +import { useMutation } from "@tanstack/react-query"; +import { 6) 성적 등록Api, 어학 성적 등록Response, 어학 성적 등록Request } from "./api"; + +const usePost어학 성적 등록 = () => { + return useMutation<어학 성적 등록Response, AxiosError, 어학 성적 등록Request>({ + mutationFn: (data) => 6) 성적 등록Api.post어학 성적 등록({ data }), + }); +}; + +export default usePost어학 성적 등록; \ No newline at end of file diff --git "a/src/apis/6) \354\204\261\354\240\201 \353\223\261\353\241\235/post\355\225\231\354\240\220 \353\223\261\353\241\235.ts" "b/src/apis/6) \354\204\261\354\240\201 \353\223\261\353\241\235/post\355\225\231\354\240\220 \353\223\261\353\241\235.ts" new file mode 100644 index 00000000..5161fd97 --- /dev/null +++ "b/src/apis/6) \354\204\261\354\240\201 \353\223\261\353\241\235/post\355\225\231\354\240\220 \353\223\261\353\241\235.ts" @@ -0,0 +1,11 @@ +import { AxiosError } from "axios"; +import { useMutation } from "@tanstack/react-query"; +import { 6) 성적 등록Api, 학점 등록Response, 학점 등록Request } from "./api"; + +const usePost학점 등록 = () => { + return useMutation<학점 등록Response, AxiosError, 학점 등록Request>({ + mutationFn: (data) => 6) 성적 등록Api.post학점 등록({ data }), + }); +}; + +export default usePost학점 등록; \ No newline at end of file diff --git "a/src/apis/7) \354\226\264\353\223\234\353\257\274/api.ts" "b/src/apis/7) \354\226\264\353\223\234\353\257\274/api.ts" new file mode 100644 index 00000000..f66000e4 --- /dev/null +++ "b/src/apis/7) \354\226\264\353\223\234\353\257\274/api.ts" @@ -0,0 +1,50 @@ +import { axiosInstance } from "@/utils/axiosInstance"; + +export type 어학 검증 및 수정Response = void; + +export type 어학 검증 및 수정Request = Record; + +export type 어학 조회Response = void; + +export interface 학점 검증 및 수정Response { + id: number; + gpa: number; + gpaCriteria: number; + verifyStatus: string; + rejectedReason: null; +} + +export type 학점 검증 및 수정Request = Record; + +export type 학점조회Response = void; + +export const 7) 어드민Api = { + put어학 검증 및 수정: async (params: { languageTestScoreId: string | number, data?: 어학 검증 및 수정Request }): Promise<어학 검증 및 수정Response> => { + const res = await axiosInstance.put<어학 검증 및 수정Response>( + `/admin/scores/language-tests/${params.languageTestScoreId}`, params?.data + ); + return res.data; + }, + + get어학 조회: async (params: { params?: Record }): Promise<어학 조회Response> => { + const res = await axiosInstance.get<어학 조회Response>( + `/admin/scores/language-tests?page=1&size=10`, { params: params?.params } + ); + return res.data; + }, + + put학점 검증 및 수정: async (params: { gpaScoreId: string | number, data?: 학점 검증 및 수정Request }): Promise<학점 검증 및 수정Response> => { + const res = await axiosInstance.put<학점 검증 및 수정Response>( + `/admin/scores/gpas/${params.gpaScoreId}`, params?.data + ); + return res.data; + }, + + get학점조회: async (params: { params?: Record }): Promise<학점조회Response> => { + const res = await axiosInstance.get<학점조회Response>( + `/admin/scores/gpas`, { params: params?.params } + ); + return res.data; + }, + +}; \ No newline at end of file diff --git "a/src/apis/7) \354\226\264\353\223\234\353\257\274/get\354\226\264\355\225\231 \354\241\260\355\232\214.ts" "b/src/apis/7) \354\226\264\353\223\234\353\257\274/get\354\226\264\355\225\231 \354\241\260\355\232\214.ts" new file mode 100644 index 00000000..7576ec39 --- /dev/null +++ "b/src/apis/7) \354\226\264\353\223\234\353\257\274/get\354\226\264\355\225\231 \354\241\260\355\232\214.ts" @@ -0,0 +1,13 @@ +import { AxiosError } from "axios"; +import { useQuery } from "@tanstack/react-query"; +import { 7) 어드민Api, 어학 조회Response } from "./api"; +import { QueryKeys } from "../queryKeys"; + +const useGet어학 조회 = (params?: Record) => { + return useQuery<어학 조회Response, AxiosError>({ + queryKey: [QueryKeys.7) 어드민.어학 조회, params], + queryFn: () => 7) 어드민Api.get어학 조회(params ? { params } : {}), + }); +}; + +export default useGet어학 조회; \ No newline at end of file diff --git "a/src/apis/7) \354\226\264\353\223\234\353\257\274/get\355\225\231\354\240\220\354\241\260\355\232\214.ts" "b/src/apis/7) \354\226\264\353\223\234\353\257\274/get\355\225\231\354\240\220\354\241\260\355\232\214.ts" new file mode 100644 index 00000000..b45c4715 --- /dev/null +++ "b/src/apis/7) \354\226\264\353\223\234\353\257\274/get\355\225\231\354\240\220\354\241\260\355\232\214.ts" @@ -0,0 +1,13 @@ +import { AxiosError } from "axios"; +import { useQuery } from "@tanstack/react-query"; +import { 7) 어드민Api, 학점조회Response } from "./api"; +import { QueryKeys } from "../queryKeys"; + +const useGet학점조회 = (params?: Record) => { + return useQuery<학점조회Response, AxiosError>({ + queryKey: [QueryKeys.7) 어드민.학점조회, params], + queryFn: () => 7) 어드민Api.get학점조회(params ? { params } : {}), + }); +}; + +export default useGet학점조회; \ No newline at end of file diff --git "a/src/apis/7) \354\226\264\353\223\234\353\257\274/index.ts" "b/src/apis/7) \354\226\264\353\223\234\353\257\274/index.ts" new file mode 100644 index 00000000..67b06c82 --- /dev/null +++ "b/src/apis/7) \354\226\264\353\223\234\353\257\274/index.ts" @@ -0,0 +1,5 @@ +export { 7) 어드민Api } from './api'; +export { default as get어학 조회 } from './get어학 조회'; +export { default as get학점조회 } from './get학점조회'; +export { default as put어학 검증 및 수정 } from './put어학 검증 및 수정'; +export { default as put학점 검증 및 수정 } from './put학점 검증 및 수정'; diff --git "a/src/apis/7) \354\226\264\353\223\234\353\257\274/put\354\226\264\355\225\231 \352\262\200\354\246\235 \353\260\217 \354\210\230\354\240\225.ts" "b/src/apis/7) \354\226\264\353\223\234\353\257\274/put\354\226\264\355\225\231 \352\262\200\354\246\235 \353\260\217 \354\210\230\354\240\225.ts" new file mode 100644 index 00000000..7180955b --- /dev/null +++ "b/src/apis/7) \354\226\264\353\223\234\353\257\274/put\354\226\264\355\225\231 \352\262\200\354\246\235 \353\260\217 \354\210\230\354\240\225.ts" @@ -0,0 +1,11 @@ +import { AxiosError } from "axios"; +import { useMutation } from "@tanstack/react-query"; +import { 7) 어드민Api, 어학 검증 및 수정Response, 어학 검증 및 수정Request } from "./api"; + +const usePut어학 검증 및 수정 = () => { + return useMutation<어학 검증 및 수정Response, AxiosError, { languageTestScoreId: string | number; data: 어학 검증 및 수정Request }>({ + mutationFn: (variables) => 7) 어드민Api.put어학 검증 및 수정(variables), + }); +}; + +export default usePut어학 검증 및 수정; \ No newline at end of file diff --git "a/src/apis/7) \354\226\264\353\223\234\353\257\274/put\355\225\231\354\240\220 \352\262\200\354\246\235 \353\260\217 \354\210\230\354\240\225.ts" "b/src/apis/7) \354\226\264\353\223\234\353\257\274/put\355\225\231\354\240\220 \352\262\200\354\246\235 \353\260\217 \354\210\230\354\240\225.ts" new file mode 100644 index 00000000..e287f07f --- /dev/null +++ "b/src/apis/7) \354\226\264\353\223\234\353\257\274/put\355\225\231\354\240\220 \352\262\200\354\246\235 \353\260\217 \354\210\230\354\240\225.ts" @@ -0,0 +1,11 @@ +import { AxiosError } from "axios"; +import { useMutation } from "@tanstack/react-query"; +import { 7) 어드민Api, 학점 검증 및 수정Response, 학점 검증 및 수정Request } from "./api"; + +const usePut학점 검증 및 수정 = () => { + return useMutation<학점 검증 및 수정Response, AxiosError, { gpaScoreId: string | number; data: 학점 검증 및 수정Request }>({ + mutationFn: (variables) => 7) 어드민Api.put학점 검증 및 수정(variables), + }); +}; + +export default usePut학점 검증 및 수정; \ No newline at end of file diff --git "a/src/apis/8) \354\202\254\354\232\251\354\236\220/api.ts" "b/src/apis/8) \354\202\254\354\232\251\354\236\220/api.ts" new file mode 100644 index 00000000..332ba03c --- /dev/null +++ "b/src/apis/8) \354\202\254\354\232\251\354\236\220/api.ts" @@ -0,0 +1,52 @@ +import { axiosInstance } from "@/utils/axiosInstance"; + +export type 닉네임 중복 검증Response = void; + +export type 유저 차단 취소Response = void; + +export type 유저 차단Response = void; + +export type 유저 차단Request = Record; + +export interface 차단한 유저 목록 조회ResponseContentItem { + id: number; + blockedId: number; + nickname: string; + createdAt: string; +} + +export interface 차단한 유저 목록 조회Response { + content: 차단한 유저 목록 조회ResponseContentItem[]; + nextPageNumber: number; +} + +export const 8) 사용자Api = { + get닉네임 중복 검증: async (params: { params?: Record }): Promise<닉네임 중복 검증Response> => { + const res = await axiosInstance.get<닉네임 중복 검증Response>( + `/users/exists?nickname=abc`, { params: params?.params } + ); + return res.data; + }, + + delete유저 차단 취소: async (params: { blockedId: string | number }): Promise<유저 차단 취소Response> => { + const res = await axiosInstance.delete<유저 차단 취소Response>( + `/users/block/${params.blockedId}` + ); + return res.data; + }, + + post유저 차단: async (params: { blockedId: string | number, data?: 유저 차단Request }): Promise<유저 차단Response> => { + const res = await axiosInstance.post<유저 차단Response>( + `/users/block/${params.blockedId}`, params?.data + ); + return res.data; + }, + + get차단한 유저 목록 조회: async (params: { params?: Record }): Promise<차단한 유저 목록 조회Response> => { + const res = await axiosInstance.get<차단한 유저 목록 조회Response>( + `/users/blocks`, { params: params?.params } + ); + return res.data; + }, + +}; \ No newline at end of file diff --git "a/src/apis/8) \354\202\254\354\232\251\354\236\220/delete\354\234\240\354\240\200 \354\260\250\353\213\250 \354\267\250\354\206\214.ts" "b/src/apis/8) \354\202\254\354\232\251\354\236\220/delete\354\234\240\354\240\200 \354\260\250\353\213\250 \354\267\250\354\206\214.ts" new file mode 100644 index 00000000..01cef93c --- /dev/null +++ "b/src/apis/8) \354\202\254\354\232\251\354\236\220/delete\354\234\240\354\240\200 \354\260\250\353\213\250 \354\267\250\354\206\214.ts" @@ -0,0 +1,11 @@ +import { AxiosError } from "axios"; +import { useMutation } from "@tanstack/react-query"; +import { 8) 사용자Api, 유저 차단 취소Response, 유저 차단 취소Request } from "./api"; + +const useDelete유저 차단 취소 = () => { + return useMutation<유저 차단 취소Response, AxiosError, { blockedId: string | number; data: 유저 차단 취소Request }>({ + mutationFn: (variables) => 8) 사용자Api.delete유저 차단 취소(variables), + }); +}; + +export default useDelete유저 차단 취소; \ No newline at end of file diff --git "a/src/apis/8) \354\202\254\354\232\251\354\236\220/get\353\213\211\353\204\244\354\236\204 \354\244\221\353\263\265 \352\262\200\354\246\235.ts" "b/src/apis/8) \354\202\254\354\232\251\354\236\220/get\353\213\211\353\204\244\354\236\204 \354\244\221\353\263\265 \352\262\200\354\246\235.ts" new file mode 100644 index 00000000..3e375569 --- /dev/null +++ "b/src/apis/8) \354\202\254\354\232\251\354\236\220/get\353\213\211\353\204\244\354\236\204 \354\244\221\353\263\265 \352\262\200\354\246\235.ts" @@ -0,0 +1,13 @@ +import { AxiosError } from "axios"; +import { useQuery } from "@tanstack/react-query"; +import { 8) 사용자Api, 닉네임 중복 검증Response } from "./api"; +import { QueryKeys } from "../queryKeys"; + +const useGet닉네임 중복 검증 = (params?: Record) => { + return useQuery<닉네임 중복 검증Response, AxiosError>({ + queryKey: [QueryKeys.8) 사용자.닉네임 중복 검증, params], + queryFn: () => 8) 사용자Api.get닉네임 중복 검증(params ? { params } : {}), + }); +}; + +export default useGet닉네임 중복 검증; \ No newline at end of file diff --git "a/src/apis/8) \354\202\254\354\232\251\354\236\220/get\354\260\250\353\213\250\355\225\234 \354\234\240\354\240\200 \353\252\251\353\241\235 \354\241\260\355\232\214.ts" "b/src/apis/8) \354\202\254\354\232\251\354\236\220/get\354\260\250\353\213\250\355\225\234 \354\234\240\354\240\200 \353\252\251\353\241\235 \354\241\260\355\232\214.ts" new file mode 100644 index 00000000..94cd13a8 --- /dev/null +++ "b/src/apis/8) \354\202\254\354\232\251\354\236\220/get\354\260\250\353\213\250\355\225\234 \354\234\240\354\240\200 \353\252\251\353\241\235 \354\241\260\355\232\214.ts" @@ -0,0 +1,13 @@ +import { AxiosError } from "axios"; +import { useQuery } from "@tanstack/react-query"; +import { 8) 사용자Api, 차단한 유저 목록 조회Response } from "./api"; +import { QueryKeys } from "../queryKeys"; + +const useGet차단한 유저 목록 조회 = (params?: Record) => { + return useQuery<차단한 유저 목록 조회Response, AxiosError>({ + queryKey: [QueryKeys.8) 사용자.차단한 유저 목록 조회, params], + queryFn: () => 8) 사용자Api.get차단한 유저 목록 조회(params ? { params } : {}), + }); +}; + +export default useGet차단한 유저 목록 조회; \ No newline at end of file diff --git "a/src/apis/8) \354\202\254\354\232\251\354\236\220/index.ts" "b/src/apis/8) \354\202\254\354\232\251\354\236\220/index.ts" new file mode 100644 index 00000000..87b04433 --- /dev/null +++ "b/src/apis/8) \354\202\254\354\232\251\354\236\220/index.ts" @@ -0,0 +1,5 @@ +export { 8) 사용자Api } from './api'; +export { default as delete유저 차단 취소 } from './delete유저 차단 취소'; +export { default as get닉네임 중복 검증 } from './get닉네임 중복 검증'; +export { default as get차단한 유저 목록 조회 } from './get차단한 유저 목록 조회'; +export { default as post유저 차단 } from './post유저 차단'; diff --git "a/src/apis/8) \354\202\254\354\232\251\354\236\220/post\354\234\240\354\240\200 \354\260\250\353\213\250.ts" "b/src/apis/8) \354\202\254\354\232\251\354\236\220/post\354\234\240\354\240\200 \354\260\250\353\213\250.ts" new file mode 100644 index 00000000..b28e01e4 --- /dev/null +++ "b/src/apis/8) \354\202\254\354\232\251\354\236\220/post\354\234\240\354\240\200 \354\260\250\353\213\250.ts" @@ -0,0 +1,11 @@ +import { AxiosError } from "axios"; +import { useMutation } from "@tanstack/react-query"; +import { 8) 사용자Api, 유저 차단Response, 유저 차단Request } from "./api"; + +const usePost유저 차단 = () => { + return useMutation<유저 차단Response, AxiosError, { blockedId: string | number; data: 유저 차단Request }>({ + mutationFn: (variables) => 8) 사용자Api.post유저 차단(variables), + }); +}; + +export default usePost유저 차단; \ No newline at end of file diff --git "a/src/apis/99) \354\271\264\354\271\264\354\230\244 API/api.ts" "b/src/apis/99) \354\271\264\354\271\264\354\230\244 API/api.ts" new file mode 100644 index 00000000..8b33e337 --- /dev/null +++ "b/src/apis/99) \354\271\264\354\271\264\354\230\244 API/api.ts" @@ -0,0 +1,33 @@ +import { axiosInstance } from "@/utils/axiosInstance"; + +export type 사용자 id 목록 조회Response = void; + +export type 연결 끊기Response = void; + +export type 연결 끊기Request = Record; + +export type 정보 조회Response = void; + +export const 99) 카카오 APIApi = { + get사용자 id 목록 조회: async (params: { params?: Record }): Promise<사용자 id 목록 조회Response> => { + const res = await axiosInstance.get<사용자 id 목록 조회Response>( + `https://kapi.kakao.com/v1/user/ids?order=dsc`, { params: params?.params } + ); + return res.data; + }, + + post연결 끊기: async (params: { data?: 연결 끊기Request }): Promise<연결 끊기Response> => { + const res = await axiosInstance.post<연결 끊기Response>( + `https://kapi.kakao.com/v1/user/unlink?target_id_type=user_id&target_id=3715136239`, params?.data + ); + return res.data; + }, + + get정보 조회: async (params: { params?: Record }): Promise<정보 조회Response> => { + const res = await axiosInstance.get<정보 조회Response>( + `https://kapi.kakao.com/v2/user/me?property_keys=["kakao_account.email"]&target_id_type=user_id&target_id=3715136239`, { params: params?.params } + ); + return res.data; + }, + +}; \ No newline at end of file diff --git "a/src/apis/99) \354\271\264\354\271\264\354\230\244 API/get\354\202\254\354\232\251\354\236\220 id \353\252\251\353\241\235 \354\241\260\355\232\214.ts" "b/src/apis/99) \354\271\264\354\271\264\354\230\244 API/get\354\202\254\354\232\251\354\236\220 id \353\252\251\353\241\235 \354\241\260\355\232\214.ts" new file mode 100644 index 00000000..90995356 --- /dev/null +++ "b/src/apis/99) \354\271\264\354\271\264\354\230\244 API/get\354\202\254\354\232\251\354\236\220 id \353\252\251\353\241\235 \354\241\260\355\232\214.ts" @@ -0,0 +1,13 @@ +import { AxiosError } from "axios"; +import { useQuery } from "@tanstack/react-query"; +import { 99) 카카오 APIApi, 사용자 id 목록 조회Response } from "./api"; +import { QueryKeys } from "../queryKeys"; + +const useGet사용자 id 목록 조회 = (params?: Record) => { + return useQuery<사용자 id 목록 조회Response, AxiosError>({ + queryKey: [QueryKeys.99) 카카오 API.사용자 id 목록 조회, params], + queryFn: () => 99) 카카오 APIApi.get사용자 id 목록 조회(params ? { params } : {}), + }); +}; + +export default useGet사용자 id 목록 조회; \ No newline at end of file diff --git "a/src/apis/99) \354\271\264\354\271\264\354\230\244 API/get\354\240\225\353\263\264 \354\241\260\355\232\214.ts" "b/src/apis/99) \354\271\264\354\271\264\354\230\244 API/get\354\240\225\353\263\264 \354\241\260\355\232\214.ts" new file mode 100644 index 00000000..61b2a405 --- /dev/null +++ "b/src/apis/99) \354\271\264\354\271\264\354\230\244 API/get\354\240\225\353\263\264 \354\241\260\355\232\214.ts" @@ -0,0 +1,13 @@ +import { AxiosError } from "axios"; +import { useQuery } from "@tanstack/react-query"; +import { 99) 카카오 APIApi, 정보 조회Response } from "./api"; +import { QueryKeys } from "../queryKeys"; + +const useGet정보 조회 = (params?: Record) => { + return useQuery<정보 조회Response, AxiosError>({ + queryKey: [QueryKeys.99) 카카오 API.정보 조회, params], + queryFn: () => 99) 카카오 APIApi.get정보 조회(params ? { params } : {}), + }); +}; + +export default useGet정보 조회; \ No newline at end of file diff --git "a/src/apis/99) \354\271\264\354\271\264\354\230\244 API/index.ts" "b/src/apis/99) \354\271\264\354\271\264\354\230\244 API/index.ts" new file mode 100644 index 00000000..5eca4a7d --- /dev/null +++ "b/src/apis/99) \354\271\264\354\271\264\354\230\244 API/index.ts" @@ -0,0 +1,4 @@ +export { 99) 카카오 APIApi } from './api'; +export { default as get사용자 id 목록 조회 } from './get사용자 id 목록 조회'; +export { default as get정보 조회 } from './get정보 조회'; +export { default as post연결 끊기 } from './post연결 끊기'; diff --git "a/src/apis/99) \354\271\264\354\271\264\354\230\244 API/post\354\227\260\352\262\260 \353\201\212\352\270\260.ts" "b/src/apis/99) \354\271\264\354\271\264\354\230\244 API/post\354\227\260\352\262\260 \353\201\212\352\270\260.ts" new file mode 100644 index 00000000..1551826b --- /dev/null +++ "b/src/apis/99) \354\271\264\354\271\264\354\230\244 API/post\354\227\260\352\262\260 \353\201\212\352\270\260.ts" @@ -0,0 +1,11 @@ +import { AxiosError } from "axios"; +import { useMutation } from "@tanstack/react-query"; +import { 99) 카카오 APIApi, 연결 끊기Response, 연결 끊기Request } from "./api"; + +const usePost연결 끊기 = () => { + return useMutation<연결 끊기Response, AxiosError, 연결 끊기Request>({ + mutationFn: (data) => 99) 카카오 APIApi.post연결 끊기({ data }), + }); +}; + +export default usePost연결 끊기; \ No newline at end of file diff --git a/src/apis/Image Upload/api.ts b/src/apis/Image Upload/api.ts new file mode 100644 index 00000000..68618fbb --- /dev/null +++ b/src/apis/Image Upload/api.ts @@ -0,0 +1,67 @@ +import { axiosInstance } from "@/utils/axiosInstance"; + +export type 슬랙 알림Response = void; + +export type 슬랙 알림Request = Record; + +export interface 어학 성적표 업로드Response { + fileUrl: string; +} + +export type 어학 성적표 업로드Request = Record; + +export interface 프로필 사진 업로드 (가입 전)Response { + fileUrl: string; +} + +export type 프로필 사진 업로드 (가입 전)Request = Record; + +export interface 프로필 사진 업로드 (가입 후)Response { + fileUrl: string; +} + +export type 프로필 사진 업로드 (가입 후)Request = Record; + +export interface 학적 성적표 업로드Response { + fileUrl: string; +} + +export type 학적 성적표 업로드Request = Record; + +export const image UploadApi = { + post슬랙 알림: async (params: { data?: 슬랙 알림Request }): Promise<슬랙 알림Response> => { + const res = await axiosInstance.post<슬랙 알림Response>( + `https://hooks.slack.com/services/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`, params?.data + ); + return res.data; + }, + + post어학 성적표 업로드: async (params: { data?: 어학 성적표 업로드Request }): Promise<어학 성적표 업로드Response> => { + const res = await axiosInstance.post<어학 성적표 업로드Response>( + `/file/language-test`, params?.data + ); + return res.data; + }, + + post프로필 사진 업로드 (가입 전): async (params: { data?: 프로필 사진 업로드 (가입 전)Request }): Promise<프로필 사진 업로드 (가입 전)Response> => { + const res = await axiosInstance.post<프로필 사진 업로드 (가입 전)Response>( + `/file/profile/pre`, params?.data + ); + return res.data; + }, + + post프로필 사진 업로드 (가입 후): async (params: { data?: 프로필 사진 업로드 (가입 후)Request }): Promise<프로필 사진 업로드 (가입 후)Response> => { + const res = await axiosInstance.post<프로필 사진 업로드 (가입 후)Response>( + `/file/profile/post`, params?.data + ); + return res.data; + }, + + post학적 성적표 업로드: async (params: { data?: 학적 성적표 업로드Request }): Promise<학적 성적표 업로드Response> => { + const res = await axiosInstance.post<학적 성적표 업로드Response>( + `/file/gpa`, params?.data + ); + return res.data; + }, + +}; \ No newline at end of file diff --git a/src/apis/Image Upload/index.ts b/src/apis/Image Upload/index.ts new file mode 100644 index 00000000..13d0c608 --- /dev/null +++ b/src/apis/Image Upload/index.ts @@ -0,0 +1,6 @@ +export { image UploadApi } from './api'; +export { default as post슬랙 알림 } from './post슬랙 알림'; +export { default as post어학 성적표 업로드 } from './post어학 성적표 업로드'; +export { default as post프로필 사진 업로드 (가입 전) } from './post프로필 사진 업로드 (가입 전)'; +export { default as post프로필 사진 업로드 (가입 후) } from './post프로필 사진 업로드 (가입 후)'; +export { default as post학적 성적표 업로드 } from './post학적 성적표 업로드'; diff --git "a/src/apis/Image Upload/post\354\212\254\353\236\231 \354\225\214\353\246\274.ts" "b/src/apis/Image Upload/post\354\212\254\353\236\231 \354\225\214\353\246\274.ts" new file mode 100644 index 00000000..2e5d0d2c --- /dev/null +++ "b/src/apis/Image Upload/post\354\212\254\353\236\231 \354\225\214\353\246\274.ts" @@ -0,0 +1,11 @@ +import { AxiosError } from "axios"; +import { useMutation } from "@tanstack/react-query"; +import { image UploadApi, 슬랙 알림Response, 슬랙 알림Request } from "./api"; + +const usePost슬랙 알림 = () => { + return useMutation<슬랙 알림Response, AxiosError, 슬랙 알림Request>({ + mutationFn: (data) => image UploadApi.post슬랙 알림({ data }), + }); +}; + +export default usePost슬랙 알림; \ No newline at end of file diff --git "a/src/apis/Image Upload/post\354\226\264\355\225\231 \354\204\261\354\240\201\355\221\234 \354\227\205\353\241\234\353\223\234.ts" "b/src/apis/Image Upload/post\354\226\264\355\225\231 \354\204\261\354\240\201\355\221\234 \354\227\205\353\241\234\353\223\234.ts" new file mode 100644 index 00000000..97588818 --- /dev/null +++ "b/src/apis/Image Upload/post\354\226\264\355\225\231 \354\204\261\354\240\201\355\221\234 \354\227\205\353\241\234\353\223\234.ts" @@ -0,0 +1,11 @@ +import { AxiosError } from "axios"; +import { useMutation } from "@tanstack/react-query"; +import { image UploadApi, 어학 성적표 업로드Response, 어학 성적표 업로드Request } from "./api"; + +const usePost어학 성적표 업로드 = () => { + return useMutation<어학 성적표 업로드Response, AxiosError, 어학 성적표 업로드Request>({ + mutationFn: (data) => image UploadApi.post어학 성적표 업로드({ data }), + }); +}; + +export default usePost어학 성적표 업로드; \ No newline at end of file diff --git "a/src/apis/Image Upload/post\355\224\204\353\241\234\355\225\204 \354\202\254\354\247\204 \354\227\205\353\241\234\353\223\234 (\352\260\200\354\236\205 \354\240\204).ts" "b/src/apis/Image Upload/post\355\224\204\353\241\234\355\225\204 \354\202\254\354\247\204 \354\227\205\353\241\234\353\223\234 (\352\260\200\354\236\205 \354\240\204).ts" new file mode 100644 index 00000000..ce7f3316 --- /dev/null +++ "b/src/apis/Image Upload/post\355\224\204\353\241\234\355\225\204 \354\202\254\354\247\204 \354\227\205\353\241\234\353\223\234 (\352\260\200\354\236\205 \354\240\204).ts" @@ -0,0 +1,11 @@ +import { AxiosError } from "axios"; +import { useMutation } from "@tanstack/react-query"; +import { image UploadApi, 프로필 사진 업로드 (가입 전)Response, 프로필 사진 업로드 (가입 전)Request } from "./api"; + +const usePost프로필 사진 업로드 (가입 전) = () => { + return useMutation<프로필 사진 업로드 (가입 전)Response, AxiosError, 프로필 사진 업로드 (가입 전)Request>({ + mutationFn: (data) => image UploadApi.post프로필 사진 업로드 (가입 전)({ data }), + }); +}; + +export default usePost프로필 사진 업로드 (가입 전); \ No newline at end of file diff --git "a/src/apis/Image Upload/post\355\224\204\353\241\234\355\225\204 \354\202\254\354\247\204 \354\227\205\353\241\234\353\223\234 (\352\260\200\354\236\205 \355\233\204).ts" "b/src/apis/Image Upload/post\355\224\204\353\241\234\355\225\204 \354\202\254\354\247\204 \354\227\205\353\241\234\353\223\234 (\352\260\200\354\236\205 \355\233\204).ts" new file mode 100644 index 00000000..4bd63db3 --- /dev/null +++ "b/src/apis/Image Upload/post\355\224\204\353\241\234\355\225\204 \354\202\254\354\247\204 \354\227\205\353\241\234\353\223\234 (\352\260\200\354\236\205 \355\233\204).ts" @@ -0,0 +1,11 @@ +import { AxiosError } from "axios"; +import { useMutation } from "@tanstack/react-query"; +import { image UploadApi, 프로필 사진 업로드 (가입 후)Response, 프로필 사진 업로드 (가입 후)Request } from "./api"; + +const usePost프로필 사진 업로드 (가입 후) = () => { + return useMutation<프로필 사진 업로드 (가입 후)Response, AxiosError, 프로필 사진 업로드 (가입 후)Request>({ + mutationFn: (data) => image UploadApi.post프로필 사진 업로드 (가입 후)({ data }), + }); +}; + +export default usePost프로필 사진 업로드 (가입 후); \ No newline at end of file diff --git "a/src/apis/Image Upload/post\355\225\231\354\240\201 \354\204\261\354\240\201\355\221\234 \354\227\205\353\241\234\353\223\234.ts" "b/src/apis/Image Upload/post\355\225\231\354\240\201 \354\204\261\354\240\201\355\221\234 \354\227\205\353\241\234\353\223\234.ts" new file mode 100644 index 00000000..4572f29a --- /dev/null +++ "b/src/apis/Image Upload/post\355\225\231\354\240\201 \354\204\261\354\240\201\355\221\234 \354\227\205\353\241\234\353\223\234.ts" @@ -0,0 +1,11 @@ +import { AxiosError } from "axios"; +import { useMutation } from "@tanstack/react-query"; +import { image UploadApi, 학적 성적표 업로드Response, 학적 성적표 업로드Request } from "./api"; + +const usePost학적 성적표 업로드 = () => { + return useMutation<학적 성적표 업로드Response, AxiosError, 학적 성적표 업로드Request>({ + mutationFn: (data) => image UploadApi.post학적 성적표 업로드({ data }), + }); +}; + +export default usePost학적 성적표 업로드; \ No newline at end of file diff --git a/src/apis/queryKeys.ts b/src/apis/queryKeys.ts index 3963ad5a..85ce00b3 100644 --- a/src/apis/queryKeys.ts +++ b/src/apis/queryKeys.ts @@ -4,129 +4,156 @@ */ export const QueryKeys = { - Auth: { - folder: "Auth.folder" as const, - signOut: "Auth.signOut" as const, - appleAuth: "Auth.appleAuth" as const, - refreshToken: "Auth.refreshToken" as const, - emailLogin: "Auth.emailLogin" as const, - emailVerification: "Auth.emailVerification" as const, - kakaoAuth: "Auth.kakaoAuth" as const, - account: "Auth.account" as const, - signUp: "Auth.signUp" as const, - }, - news: { - folder: "news.folder" as const, - newsList: "news.newsList" as const, - news: "news.news" as const, - updateNews: "news.updateNews" as const, - likeNews: "news.likeNews" as const, - createNews: "news.createNews" as const, - }, - reports: { - folder: "reports.folder" as const, - report: "reports.report" as const, - }, - chat: { - folder: "chat.folder" as const, - chatMessages: "chat.chatMessages" as const, - chatRooms: "chat.chatRooms" as const, - readChatRoom: "chat.readChatRoom" as const, - chatPartner: "chat.chatPartner" as const, - }, - universities: { - folder: "universities.folder" as const, - recommendedUniversities: "universities.recommendedUniversities" as const, - wishList: "universities.wishList" as const, - wish: "universities.wish" as const, - addWish: "universities.addWish" as const, - isWish: "universities.isWish" as const, - universityDetail: "universities.universityDetail" as const, - searchText: "universities.searchText" as const, - searchFilter: "universities.searchFilter" as const, - byRegionCountry: "universities.byRegionCountry" as const, - }, - MyPage: { - folder: "MyPage.folder" as const, - interestedRegionCountry: "MyPage.interestedRegionCountry" as const, - profile: "MyPage.profile" as const, - password: "MyPage.password" as const, - }, - applications: { - folder: "applications.folder" as const, - competitors: "applications.competitors" as const, - submitApplication: "applications.submitApplication" as const, - applicants: "applications.applicants" as const, - }, - community: { - folder: "community.folder" as const, - boardList: "community.boardList" as const, - board: "community.board" as const, - comment: "community.comment" as const, - updateComment: "community.updateComment" as const, - createComment: "community.createComment" as const, - post: "community.post" as const, - updatePost: "community.updatePost" as const, - createPost: "community.createPost" as const, - postDetail: "community.postDetail" as const, - likePost: "community.likePost" as const, - }, - Scores: { - folder: "Scores.folder" as const, - createLanguageTest: "Scores.createLanguageTest" as const, - languageTestList: "Scores.languageTestList" as const, - createGpa: "Scores.createGpa" as const, - gpaList: "Scores.gpaList" as const, - }, - Admin: { - folder: "Admin.folder" as const, - verifyLanguageTest: "Admin.verifyLanguageTest" as const, - languageTestList: "Admin.languageTestList" as const, - verifyGpa: "Admin.verifyGpa" as const, - gpaList: "Admin.gpaList" as const, - }, - users: { - folder: "users.folder" as const, - nicknameExists: "users.nicknameExists" as const, - blockUser: "users.blockUser" as const, - unblockUser: "users.unblockUser" as const, - blockedUsers: "users.blockedUsers" as const, - }, - mentor: { - folder: "mentor.folder" as const, - matchedMentors: "mentor.matchedMentors" as const, - applyMentoring: "mentor.applyMentoring" as const, - confirmMentoring: "mentor.confirmMentoring" as const, - appliedMentorings: "mentor.appliedMentorings" as const, - mentorList: "mentor.mentorList" as const, - mentorDetail: "mentor.mentorDetail" as const, - myMentorPage: "mentor.myMentorPage" as const, - updateMyMentorPage: "mentor.updateMyMentorPage" as const, - mentoringStatus: "mentor.mentoringStatus" as const, - receivedMentorings: "mentor.receivedMentorings" as const, - unconfirmedMentoringCount: "mentor.unconfirmedMentoringCount" as const, - }, - "kakao-api": { - folder: "kakao-api.folder" as const, - kakaoUserIds: "kakao-api.kakaoUserIds" as const, - kakaoUnlink: "kakao-api.kakaoUnlink" as const, - kakaoInfo: "kakao-api.kakaoInfo" as const, - }, - "collection.bru": { - collection: "collection.bru.collection" as const, + '1) 회원가입-로그인': { + folder: '1) 회원가입-로그인.folder' as const, + 로그아웃: '1) 회원가입-로그인.로그아웃' as const, + 애플 인증 (로그인 or 가입 코드 발급): '1) 회원가입-로그인.애플 인증 (로그인 or 가입 코드 발급)' as const, + 엑세스 토큰 재발급: '1) 회원가입-로그인.엑세스 토큰 재발급' as const, + 이메일 로그인: '1) 회원가입-로그인.이메일 로그인' as const, + 이메일 인증 (가입 코드 발급): '1) 회원가입-로그인.이메일 인증 (가입 코드 발급)' as const, + 카카오 인증 (로그인 or 가입 코드 발급): '1) 회원가입-로그인.카카오 인증 (로그인 or 가입 코드 발급)' as const, + 회원 탈퇴: '1) 회원가입-로그인.회원 탈퇴' as const, + 회원가입: '1) 회원가입-로그인.회원가입' as const, + }, + 10) 소식지: { + folder: '10) 소식지.folder' as const, + 소식지 목록 조회: '10) 소식지.소식지 목록 조회' as const, + 소식지 삭제: '10) 소식지.소식지 삭제' as const, + 소식지 수정: '10) 소식지.소식지 수정' as const, + 소식지 좋아요 삭제: '10) 소식지.소식지 좋아요 삭제' as const, + 소식지 좋아요 추가: '10) 소식지.소식지 좋아요 추가' as const, + 소식지 추가: '10) 소식지.소식지 추가' as const, + }, + 11) 신고: { + folder: '11) 신고.folder' as const, + 신고하기: '11) 신고.신고하기' as const, + }, + '11) 채팅- chat': { + folder: '11) 채팅- chat.folder' as const, + 채팅 내역 조회: '11) 채팅- chat.채팅 내역 조회' as const, + 채팅방 목록 조회: '11) 채팅- chat.채팅방 목록 조회' as const, + 채팅방 읽음 처리: '11) 채팅- chat.채팅방 읽음 처리' as const, + 채팅방 파트너 조회: '11) 채팅- chat.채팅방 파트너 조회' as const, + }, + 2) 대학교 관련: { + folder: '2) 대학교 관련.folder' as const, + }, + '대학 지원 정보- univ-apply-infos': { + folder: '대학 지원 정보- univ-apply-infos.folder' as const, + 사용자 맞춤 대학 추천: '대학 지원 정보- univ-apply-infos.사용자 맞춤 대학 추천' as const, + 위시 학교 목록 조회: '대학 지원 정보- univ-apply-infos.위시 학교 목록 조회' as const, + 위시 학교 삭제: '대학 지원 정보- univ-apply-infos.위시 학교 삭제' as const, + 위시 학교 추가: '대학 지원 정보- univ-apply-infos.위시 학교 추가' as const, + 위시 학교인지 조회: '대학 지원 정보- univ-apply-infos.위시 학교인지 조회' as const, + 학교 상세 정보 조회: '대학 지원 정보- univ-apply-infos.학교 상세 정보 조회' as const, + 학교 텍스트 검색: '대학 지원 정보- univ-apply-infos.학교 텍스트 검색' as const, + }, + '대학- universities': { + folder: '대학- universities.folder' as const, + 권역국가에 해당하는 전체 대학: '대학- universities.권역국가에 해당하는 전체 대학' as const, + }, + 3) 마이페이지: { + 관심 권역국가 변경: '3) 마이페이지.관심 권역국가 변경' as const, + 내 정보 수정: '3) 마이페이지.내 정보 수정' as const, + 내 정보 조회: '3) 마이페이지.내 정보 조회' as const, + 비밀번호 변경: '3) 마이페이지.비밀번호 변경' as const, + }, + 4) 지원정보: { + folder: '4) 지원정보.folder' as const, + 나의 지원과 동일한 지원자 현황 조회: '4) 지원정보.나의 지원과 동일한 지원자 현황 조회' as const, + 지원서 제출: '4) 지원정보.지원서 제출' as const, + 지원자 현황 조회: '4) 지원정보.지원자 현황 조회' as const, + }, + 5) 커뮤니티: { + folder: '5) 커뮤니티.folder' as const, + }, + '게시글- posts': { + folder: '게시글- posts.folder' as const, + 게시글 삭제: '게시글- posts.게시글 삭제' as const, + 게시글 수정: '게시글- posts.게시글 수정' as const, + 게시글 작성: '게시글- posts.게시글 작성' as const, + 게시글 조회: '게시글- posts.게시글 조회' as const, + 게시글 좋아요 등록: '게시글- posts.게시글 좋아요 등록' as const, + 게시글 좋아요 삭제: '게시글- posts.게시글 좋아요 삭제' as const, + }, + '게시판- boards': { + folder: '게시판- boards.folder' as const, + 게시판 목록 조회: '게시판- boards.게시판 목록 조회' as const, + 게시판 조회: '게시판- boards.게시판 조회' as const, + }, + '댓글- comments': { + folder: '댓글- comments.folder' as const, + 댓글 삭제: '댓글- comments.댓글 삭제' as const, + 댓글 수정: '댓글- comments.댓글 수정' as const, + 댓글 작성: '댓글- comments.댓글 작성' as const, + }, + 6) 성적 등록: { + folder: '6) 성적 등록.folder' as const, + 어학 성적 등록: '6) 성적 등록.어학 성적 등록' as const, + 어학 성적 조회: '6) 성적 등록.어학 성적 조회' as const, + 학점 등록: '6) 성적 등록.학점 등록' as const, + 학점 조회: '6) 성적 등록.학점 조회' as const, + }, + 7) 어드민: { + folder: '7) 어드민.folder' as const, + 어학 검증 및 수정: '7) 어드민.어학 검증 및 수정' as const, + 어학 조회: '7) 어드민.어학 조회' as const, + 학점 검증 및 수정: '7) 어드민.학점 검증 및 수정' as const, + 학점조회: '7) 어드민.학점조회' as const, + }, + 8) 사용자: { + folder: '8) 사용자.folder' as const, + 닉네임 중복 검증: '8) 사용자.닉네임 중복 검증' as const, + 유저 차단 취소: '8) 사용자.유저 차단 취소' as const, + 유저 차단: '8) 사용자.유저 차단' as const, + 차단한 유저 목록 조회: '8) 사용자.차단한 유저 목록 조회' as const, + }, + 9) 멘토 관련: { + folder: '9) 멘토 관련.folder' as const, + }, + '멘토- mentor': { + folder: '멘토- mentor.folder' as const, + 멘토 목록 조회: '멘토- mentor.멘토 목록 조회' as const, + 멘토 상세 페이지: '멘토- mentor.멘토 상세 페이지' as const, + }, + 멘토만 요청 가능: { + folder: '멘토만 요청 가능.folder' as const, + 나의 멘토 페이지 수정: '멘토만 요청 가능.나의 멘토 페이지 수정' as const, + 나의 멘토 페이지 조회: '멘토만 요청 가능.나의 멘토 페이지 조회' as const, + 멘토링 수락거절: '멘토만 요청 가능.멘토링 수락거절' as const, + 멘토링 확인: '멘토만 요청 가능.멘토링 확인' as const, + 신청받은 멘토링 목록: '멘토만 요청 가능.신청받은 멘토링 목록' as const, + 확인하지 않은 멘토링 수: '멘토만 요청 가능.확인하지 않은 멘토링 수' as const, + }, + 멘티만 요청 가능: { + folder: '멘티만 요청 가능.folder' as const, + 매칭된 멘토 목록: '멘티만 요청 가능.매칭된 멘토 목록' as const, + 멘토링 신청: '멘티만 요청 가능.멘토링 신청' as const, + 멘토링 확인: '멘티만 요청 가능.멘토링 확인' as const, + 신청한 멘토링 목록: '멘티만 요청 가능.신청한 멘토링 목록' as const, + }, + 99) 카카오 API: { + folder: '99) 카카오 API.folder' as const, + 사용자 id 목록 조회: '99) 카카오 API.사용자 id 목록 조회' as const, + 연결 끊기: '99) 카카오 API.연결 끊기' as const, + 정보 조회: '99) 카카오 API.정보 조회' as const, + }, + Image Upload: { + folder: 'Image Upload.folder' as const, + 슬랙 알림: 'Image Upload.슬랙 알림' as const, + 어학 성적표 업로드: 'Image Upload.어학 성적표 업로드' as const, + 프로필 사진 업로드 (가입 전): 'Image Upload.프로필 사진 업로드 (가입 전)' as const, + 프로필 사진 업로드 (가입 후): 'Image Upload.프로필 사진 업로드 (가입 후)' as const, + 학적 성적표 업로드: 'Image Upload.학적 성적표 업로드' as const, + }, + 'collection.bru': { + collection: 'collection.bru.collection' as const, }, environments: { - dev: "environments.dev" as const, - local: "environments.local" as const, - }, - "image-upload": { - folder: "image-upload.folder" as const, - slackNotification: "image-upload.slackNotification" as const, - uploadLanguageTestReport: "image-upload.uploadLanguageTestReport" as const, - uploadProfileImage: "image-upload.uploadProfileImage" as const, - uploadProfileImageBeforeSignup: "image-upload.uploadProfileImageBeforeSignup" as const, - uploadGpaReport: "image-upload.uploadGpaReport" as const, + dev: 'environments.dev' as const, + local: 'environments.local' as const, + prod: 'environments.prod' as const, }, } as const; -export type QueryKey = (typeof QueryKeys)[keyof typeof QueryKeys]; +export type QueryKey = typeof QueryKeys[keyof typeof QueryKeys]; \ No newline at end of file diff --git "a/src/apis/\352\262\214\354\213\234\352\270\200- posts/api.ts" "b/src/apis/\352\262\214\354\213\234\352\270\200- posts/api.ts" new file mode 100644 index 00000000..5102d33a --- /dev/null +++ "b/src/apis/\352\262\214\354\213\234\352\270\200- posts/api.ts" @@ -0,0 +1,114 @@ +import { axiosInstance } from "@/utils/axiosInstance"; + +export type 게시글 삭제Response = void; + +export type 게시글 수정Response = void; + +export type 게시글 수정Request = Record; + +export type 게시글 작성Response = void; + +export type 게시글 작성Request = Record; + +export interface 게시글 조회ResponsePostFindCommentResponsesItem { + id: number; + parentId: null | number; + content: string; + isOwner: boolean; + createdAt: string; + updatedAt: string; + postFindSiteUserResponse: 게시글 조회ResponsePostFindCommentResponsesItemPostFindSiteUserResponse; +} + +export interface 게시글 조회ResponsePostFindCommentResponsesItemPostFindSiteUserResponse { + id: number; + nickname: string; + profileImageUrl: string; +} + +export interface 게시글 조회ResponsePostFindSiteUserResponse { + id: number; + nickname: string; + profileImageUrl: string; +} + +export interface 게시글 조회ResponsePostFindBoardResponse { + code: string; + koreanName: string; +} + +export interface 게시글 조회Response { + id: number; + title: string; + content: string; + isQuestion: boolean; + likeCount: number; + viewCount: number; + commentCount: number; + postCategory: string; + isOwner: boolean; + isLiked: boolean; + createdAt: string; + updatedAt: string; + postFindBoardResponse: 게시글 조회ResponsePostFindBoardResponse; + postFindSiteUserResponse: 게시글 조회ResponsePostFindSiteUserResponse; + postFindCommentResponses: 게시글 조회ResponsePostFindCommentResponsesItem[]; + postFindPostImageResponses: any[]; +} + +export interface 게시글 좋아요 등록Response { + likeCount: number; + isLiked: boolean; +} + +export type 게시글 좋아요 등록Request = Record; + +export interface 게시글 좋아요 삭제Response { + likeCount: number; + isLiked: boolean; +} + +export const 게시글 postsApi = { + delete게시글 삭제: async (params: { postId: string | number }): Promise<게시글 삭제Response> => { + const res = await axiosInstance.delete<게시글 삭제Response>( + `/posts/${params.postId}` + ); + return res.data; + }, + + patch게시글 수정: async (params: { postId: string | number, data?: 게시글 수정Request }): Promise<게시글 수정Response> => { + const res = await axiosInstance.patch<게시글 수정Response>( + `/posts/${params.postId}`, params?.data + ); + return res.data; + }, + + post게시글 작성: async (params: { data?: 게시글 작성Request }): Promise<게시글 작성Response> => { + const res = await axiosInstance.post<게시글 작성Response>( + `/posts`, params?.data + ); + return res.data; + }, + + get게시글 조회: async (params: { postId: string | number, params?: Record }): Promise<게시글 조회Response> => { + const res = await axiosInstance.get<게시글 조회Response>( + `/posts/${params.postId}`, { params: params?.params } + ); + return res.data; + }, + + post게시글 좋아요 등록: async (params: { postId: string | number, data?: 게시글 좋아요 등록Request }): Promise<게시글 좋아요 등록Response> => { + const res = await axiosInstance.post<게시글 좋아요 등록Response>( + `/posts/${params.postId}/like`, params?.data + ); + return res.data; + }, + + delete게시글 좋아요 삭제: async (params: { postId: string | number }): Promise<게시글 좋아요 삭제Response> => { + const res = await axiosInstance.delete<게시글 좋아요 삭제Response>( + `/posts/${params.postId}/like` + ); + return res.data; + }, + +}; \ No newline at end of file diff --git "a/src/apis/\352\262\214\354\213\234\352\270\200- posts/delete\352\262\214\354\213\234\352\270\200 \354\202\255\354\240\234.ts" "b/src/apis/\352\262\214\354\213\234\352\270\200- posts/delete\352\262\214\354\213\234\352\270\200 \354\202\255\354\240\234.ts" new file mode 100644 index 00000000..c431e514 --- /dev/null +++ "b/src/apis/\352\262\214\354\213\234\352\270\200- posts/delete\352\262\214\354\213\234\352\270\200 \354\202\255\354\240\234.ts" @@ -0,0 +1,11 @@ +import { AxiosError } from "axios"; +import { useMutation } from "@tanstack/react-query"; +import { 게시글 postsApi, 게시글 삭제Response, 게시글 삭제Request } from "./api"; + +const useDelete게시글 삭제 = () => { + return useMutation<게시글 삭제Response, AxiosError, { postId: string | number; data: 게시글 삭제Request }>({ + mutationFn: (variables) => 게시글 postsApi.delete게시글 삭제(variables), + }); +}; + +export default useDelete게시글 삭제; \ No newline at end of file diff --git "a/src/apis/\352\262\214\354\213\234\352\270\200- posts/delete\352\262\214\354\213\234\352\270\200 \354\242\213\354\225\204\354\232\224 \354\202\255\354\240\234.ts" "b/src/apis/\352\262\214\354\213\234\352\270\200- posts/delete\352\262\214\354\213\234\352\270\200 \354\242\213\354\225\204\354\232\224 \354\202\255\354\240\234.ts" new file mode 100644 index 00000000..77696931 --- /dev/null +++ "b/src/apis/\352\262\214\354\213\234\352\270\200- posts/delete\352\262\214\354\213\234\352\270\200 \354\242\213\354\225\204\354\232\224 \354\202\255\354\240\234.ts" @@ -0,0 +1,11 @@ +import { AxiosError } from "axios"; +import { useMutation } from "@tanstack/react-query"; +import { 게시글 postsApi, 게시글 좋아요 삭제Response, 게시글 좋아요 삭제Request } from "./api"; + +const useDelete게시글 좋아요 삭제 = () => { + return useMutation<게시글 좋아요 삭제Response, AxiosError, { postId: string | number; data: 게시글 좋아요 삭제Request }>({ + mutationFn: (variables) => 게시글 postsApi.delete게시글 좋아요 삭제(variables), + }); +}; + +export default useDelete게시글 좋아요 삭제; \ No newline at end of file diff --git "a/src/apis/\352\262\214\354\213\234\352\270\200- posts/get\352\262\214\354\213\234\352\270\200 \354\241\260\355\232\214.ts" "b/src/apis/\352\262\214\354\213\234\352\270\200- posts/get\352\262\214\354\213\234\352\270\200 \354\241\260\355\232\214.ts" new file mode 100644 index 00000000..38a12212 --- /dev/null +++ "b/src/apis/\352\262\214\354\213\234\352\270\200- posts/get\352\262\214\354\213\234\352\270\200 \354\241\260\355\232\214.ts" @@ -0,0 +1,14 @@ +import { AxiosError } from "axios"; +import { useQuery } from "@tanstack/react-query"; +import { 게시글 postsApi, 게시글 조회Response } from "./api"; +import { QueryKeys } from "../queryKeys"; + +const useGet게시글 조회 = (postId: string | number, params?: Record) => { + return useQuery<게시글 조회Response, AxiosError>({ + queryKey: [QueryKeys['게시글- posts'].게시글 조회, postId, params], + queryFn: () => 게시글 postsApi.get게시글 조회({ postId, params }), + enabled: !!postId, + }); +}; + +export default useGet게시글 조회; \ No newline at end of file diff --git "a/src/apis/\352\262\214\354\213\234\352\270\200- posts/index.ts" "b/src/apis/\352\262\214\354\213\234\352\270\200- posts/index.ts" new file mode 100644 index 00000000..955d7b15 --- /dev/null +++ "b/src/apis/\352\262\214\354\213\234\352\270\200- posts/index.ts" @@ -0,0 +1,7 @@ +export { 게시글 postsApi } from './api'; +export { default as delete게시글 삭제 } from './delete게시글 삭제'; +export { default as delete게시글 좋아요 삭제 } from './delete게시글 좋아요 삭제'; +export { default as get게시글 조회 } from './get게시글 조회'; +export { default as patch게시글 수정 } from './patch게시글 수정'; +export { default as post게시글 작성 } from './post게시글 작성'; +export { default as post게시글 좋아요 등록 } from './post게시글 좋아요 등록'; diff --git "a/src/apis/\352\262\214\354\213\234\352\270\200- posts/patch\352\262\214\354\213\234\352\270\200 \354\210\230\354\240\225.ts" "b/src/apis/\352\262\214\354\213\234\352\270\200- posts/patch\352\262\214\354\213\234\352\270\200 \354\210\230\354\240\225.ts" new file mode 100644 index 00000000..f5c79b6f --- /dev/null +++ "b/src/apis/\352\262\214\354\213\234\352\270\200- posts/patch\352\262\214\354\213\234\352\270\200 \354\210\230\354\240\225.ts" @@ -0,0 +1,11 @@ +import { AxiosError } from "axios"; +import { useMutation } from "@tanstack/react-query"; +import { 게시글 postsApi, 게시글 수정Response, 게시글 수정Request } from "./api"; + +const usePatch게시글 수정 = () => { + return useMutation<게시글 수정Response, AxiosError, { postId: string | number; data: 게시글 수정Request }>({ + mutationFn: (variables) => 게시글 postsApi.patch게시글 수정(variables), + }); +}; + +export default usePatch게시글 수정; \ No newline at end of file diff --git "a/src/apis/\352\262\214\354\213\234\352\270\200- posts/post\352\262\214\354\213\234\352\270\200 \354\236\221\354\204\261.ts" "b/src/apis/\352\262\214\354\213\234\352\270\200- posts/post\352\262\214\354\213\234\352\270\200 \354\236\221\354\204\261.ts" new file mode 100644 index 00000000..fd1a9df6 --- /dev/null +++ "b/src/apis/\352\262\214\354\213\234\352\270\200- posts/post\352\262\214\354\213\234\352\270\200 \354\236\221\354\204\261.ts" @@ -0,0 +1,11 @@ +import { AxiosError } from "axios"; +import { useMutation } from "@tanstack/react-query"; +import { 게시글 postsApi, 게시글 작성Response, 게시글 작성Request } from "./api"; + +const usePost게시글 작성 = () => { + return useMutation<게시글 작성Response, AxiosError, 게시글 작성Request>({ + mutationFn: (data) => 게시글 postsApi.post게시글 작성({ data }), + }); +}; + +export default usePost게시글 작성; \ No newline at end of file diff --git "a/src/apis/\352\262\214\354\213\234\352\270\200- posts/post\352\262\214\354\213\234\352\270\200 \354\242\213\354\225\204\354\232\224 \353\223\261\353\241\235.ts" "b/src/apis/\352\262\214\354\213\234\352\270\200- posts/post\352\262\214\354\213\234\352\270\200 \354\242\213\354\225\204\354\232\224 \353\223\261\353\241\235.ts" new file mode 100644 index 00000000..573240b6 --- /dev/null +++ "b/src/apis/\352\262\214\354\213\234\352\270\200- posts/post\352\262\214\354\213\234\352\270\200 \354\242\213\354\225\204\354\232\224 \353\223\261\353\241\235.ts" @@ -0,0 +1,11 @@ +import { AxiosError } from "axios"; +import { useMutation } from "@tanstack/react-query"; +import { 게시글 postsApi, 게시글 좋아요 등록Response, 게시글 좋아요 등록Request } from "./api"; + +const usePost게시글 좋아요 등록 = () => { + return useMutation<게시글 좋아요 등록Response, AxiosError, { postId: string | number; data: 게시글 좋아요 등록Request }>({ + mutationFn: (variables) => 게시글 postsApi.post게시글 좋아요 등록(variables), + }); +}; + +export default usePost게시글 좋아요 등록; \ No newline at end of file diff --git "a/src/apis/\352\262\214\354\213\234\355\214\220- boards/api.ts" "b/src/apis/\352\262\214\354\213\234\355\214\220- boards/api.ts" new file mode 100644 index 00000000..89c14106 --- /dev/null +++ "b/src/apis/\352\262\214\354\213\234\355\214\220- boards/api.ts" @@ -0,0 +1,22 @@ +import { axiosInstance } from "@/utils/axiosInstance"; + +export type 게시판 목록 조회Response = void; + +export type 게시판 조회Response = void; + +export const 게시판 boardsApi = { + get게시판 목록 조회: async (params: { params?: Record }): Promise<게시판 목록 조회Response> => { + const res = await axiosInstance.get<게시판 목록 조회Response>( + `/boards`, { params: params?.params } + ); + return res.data; + }, + + get게시판 조회: async (params: { boardCode: string | number, params?: Record }): Promise<게시판 조회Response> => { + const res = await axiosInstance.get<게시판 조회Response>( + `/boards/${params.boardCode}`, { params: params?.params } + ); + return res.data; + }, + +}; \ No newline at end of file diff --git "a/src/apis/\352\262\214\354\213\234\355\214\220- boards/get\352\262\214\354\213\234\355\214\220 \353\252\251\353\241\235 \354\241\260\355\232\214.ts" "b/src/apis/\352\262\214\354\213\234\355\214\220- boards/get\352\262\214\354\213\234\355\214\220 \353\252\251\353\241\235 \354\241\260\355\232\214.ts" new file mode 100644 index 00000000..01ef2d4e --- /dev/null +++ "b/src/apis/\352\262\214\354\213\234\355\214\220- boards/get\352\262\214\354\213\234\355\214\220 \353\252\251\353\241\235 \354\241\260\355\232\214.ts" @@ -0,0 +1,13 @@ +import { AxiosError } from "axios"; +import { useQuery } from "@tanstack/react-query"; +import { 게시판 boardsApi, 게시판 목록 조회Response } from "./api"; +import { QueryKeys } from "../queryKeys"; + +const useGet게시판 목록 조회 = (params?: Record) => { + return useQuery<게시판 목록 조회Response, AxiosError>({ + queryKey: [QueryKeys['게시판- boards'].게시판 목록 조회, params], + queryFn: () => 게시판 boardsApi.get게시판 목록 조회(params ? { params } : {}), + }); +}; + +export default useGet게시판 목록 조회; \ No newline at end of file diff --git "a/src/apis/\352\262\214\354\213\234\355\214\220- boards/get\352\262\214\354\213\234\355\214\220 \354\241\260\355\232\214.ts" "b/src/apis/\352\262\214\354\213\234\355\214\220- boards/get\352\262\214\354\213\234\355\214\220 \354\241\260\355\232\214.ts" new file mode 100644 index 00000000..5fccb714 --- /dev/null +++ "b/src/apis/\352\262\214\354\213\234\355\214\220- boards/get\352\262\214\354\213\234\355\214\220 \354\241\260\355\232\214.ts" @@ -0,0 +1,14 @@ +import { AxiosError } from "axios"; +import { useQuery } from "@tanstack/react-query"; +import { 게시판 boardsApi, 게시판 조회Response } from "./api"; +import { QueryKeys } from "../queryKeys"; + +const useGet게시판 조회 = (boardCode: string | number, params?: Record) => { + return useQuery<게시판 조회Response, AxiosError>({ + queryKey: [QueryKeys['게시판- boards'].게시판 조회, boardCode, params], + queryFn: () => 게시판 boardsApi.get게시판 조회({ boardCode, params }), + enabled: !!boardCode, + }); +}; + +export default useGet게시판 조회; \ No newline at end of file diff --git "a/src/apis/\352\262\214\354\213\234\355\214\220- boards/index.ts" "b/src/apis/\352\262\214\354\213\234\355\214\220- boards/index.ts" new file mode 100644 index 00000000..3bf65a52 --- /dev/null +++ "b/src/apis/\352\262\214\354\213\234\355\214\220- boards/index.ts" @@ -0,0 +1,3 @@ +export { 게시판 boardsApi } from './api'; +export { default as get게시판 목록 조회 } from './get게시판 목록 조회'; +export { default as get게시판 조회 } from './get게시판 조회'; diff --git "a/src/apis/\353\214\200\355\225\231 \354\247\200\354\233\220 \354\240\225\353\263\264- univ-apply-infos/api.ts" "b/src/apis/\353\214\200\355\225\231 \354\247\200\354\233\220 \354\240\225\353\263\264- univ-apply-infos/api.ts" new file mode 100644 index 00000000..e01ac883 --- /dev/null +++ "b/src/apis/\353\214\200\355\225\231 \354\247\200\354\233\220 \354\240\225\353\263\264- univ-apply-infos/api.ts" @@ -0,0 +1,101 @@ +import { axiosInstance } from "@/utils/axiosInstance"; + +export type 사용자 맞춤 대학 추천Response = void; + +export type 위시 학교 목록 조회Response = void; + +export type 위시 학교 삭제Response = void; + +export type 위시 학교 추가Response = void; + +export type 위시 학교 추가Request = Record; + +export type 위시 학교인지 조회Response = void; + +export interface 학교 상세 정보 조회ResponseLanguageRequirementsItem { + languageTestType: string; + minScore: string; +} + +export interface 학교 상세 정보 조회Response { + id: number; + term: string; + koreanName: string; + englishName: string; + formatName: string; + region: string; + country: string; + homepageUrl: string; + logoImageUrl: string; + backgroundImageUrl: string; + detailsForLocal: string; + studentCapacity: number; + tuitionFeeType: string; + semesterAvailableForDispatch: string; + languageRequirements: 학교 상세 정보 조회ResponseLanguageRequirementsItem[]; + detailsForLanguage: string; + gpaRequirement: string; + gpaRequirementCriteria: string; + semesterRequirement: string; + detailsForApply: null; + detailsForMajor: string; + detailsForAccommodation: null; + detailsForEnglishCourse: null; + details: string; + accommodationUrl: string; + englishCourseUrl: string; +} + +export type 학교 텍스트 검색Response = void; + +export const 대학 지원 정보 univApplyInfosApi = { + get사용자 맞춤 대학 추천: async (params: { params?: Record }): Promise<사용자 맞춤 대학 추천Response> => { + const res = await axiosInstance.get<사용자 맞춤 대학 추천Response>( + `/univ-apply-infos/recommend`, { params: params?.params } + ); + return res.data; + }, + + get위시 학교 목록 조회: async (params: { params?: Record }): Promise<위시 학교 목록 조회Response> => { + const res = await axiosInstance.get<위시 학교 목록 조회Response>( + `/univ-apply-infos/like`, { params: params?.params } + ); + return res.data; + }, + + delete위시 학교 삭제: async (params: { univApplyInfoId: string | number }): Promise<위시 학교 삭제Response> => { + const res = await axiosInstance.delete<위시 학교 삭제Response>( + `/univ-apply-infos/${params.univApplyInfoId}/like` + ); + return res.data; + }, + + post위시 학교 추가: async (params: { univApplyInfoId: string | number, data?: 위시 학교 추가Request }): Promise<위시 학교 추가Response> => { + const res = await axiosInstance.post<위시 학교 추가Response>( + `/univ-apply-infos/${params.univApplyInfoId}/like`, params?.data + ); + return res.data; + }, + + get위시 학교인지 조회: async (params: { univApplyInfoId: string | number, params?: Record }): Promise<위시 학교인지 조회Response> => { + const res = await axiosInstance.get<위시 학교인지 조회Response>( + `/univ-apply-infos/${params.univApplyInfoId}/like`, { params: params?.params } + ); + return res.data; + }, + + get학교 상세 정보 조회: async (params: { univApplyInfoId: string | number, params?: Record }): Promise<학교 상세 정보 조회Response> => { + const res = await axiosInstance.get<학교 상세 정보 조회Response>( + `/univ-apply-infos/${params.univApplyInfoId}`, { params: params?.params } + ); + return res.data; + }, + + get학교 텍스트 검색: async (params: { params?: Record }): Promise<학교 텍스트 검색Response> => { + const res = await axiosInstance.get<학교 텍스트 검색Response>( + `/univ-apply-infos/search/text?value=일본`, { params: params?.params } + ); + return res.data; + }, + +}; \ No newline at end of file diff --git "a/src/apis/\353\214\200\355\225\231 \354\247\200\354\233\220 \354\240\225\353\263\264- univ-apply-infos/delete\354\234\204\354\213\234 \355\225\231\352\265\220 \354\202\255\354\240\234.ts" "b/src/apis/\353\214\200\355\225\231 \354\247\200\354\233\220 \354\240\225\353\263\264- univ-apply-infos/delete\354\234\204\354\213\234 \355\225\231\352\265\220 \354\202\255\354\240\234.ts" new file mode 100644 index 00000000..1c631b90 --- /dev/null +++ "b/src/apis/\353\214\200\355\225\231 \354\247\200\354\233\220 \354\240\225\353\263\264- univ-apply-infos/delete\354\234\204\354\213\234 \355\225\231\352\265\220 \354\202\255\354\240\234.ts" @@ -0,0 +1,11 @@ +import { AxiosError } from "axios"; +import { useMutation } from "@tanstack/react-query"; +import { 대학 지원 정보 univApplyInfosApi, 위시 학교 삭제Response, 위시 학교 삭제Request } from "./api"; + +const useDelete위시 학교 삭제 = () => { + return useMutation<위시 학교 삭제Response, AxiosError, { univApplyInfoId: string | number; data: 위시 학교 삭제Request }>({ + mutationFn: (variables) => 대학 지원 정보 univApplyInfosApi.delete위시 학교 삭제(variables), + }); +}; + +export default useDelete위시 학교 삭제; \ No newline at end of file diff --git "a/src/apis/\353\214\200\355\225\231 \354\247\200\354\233\220 \354\240\225\353\263\264- univ-apply-infos/get\354\202\254\354\232\251\354\236\220 \353\247\236\354\266\244 \353\214\200\355\225\231 \354\266\224\354\262\234.ts" "b/src/apis/\353\214\200\355\225\231 \354\247\200\354\233\220 \354\240\225\353\263\264- univ-apply-infos/get\354\202\254\354\232\251\354\236\220 \353\247\236\354\266\244 \353\214\200\355\225\231 \354\266\224\354\262\234.ts" new file mode 100644 index 00000000..605a55b0 --- /dev/null +++ "b/src/apis/\353\214\200\355\225\231 \354\247\200\354\233\220 \354\240\225\353\263\264- univ-apply-infos/get\354\202\254\354\232\251\354\236\220 \353\247\236\354\266\244 \353\214\200\355\225\231 \354\266\224\354\262\234.ts" @@ -0,0 +1,13 @@ +import { AxiosError } from "axios"; +import { useQuery } from "@tanstack/react-query"; +import { 대학 지원 정보 univApplyInfosApi, 사용자 맞춤 대학 추천Response } from "./api"; +import { QueryKeys } from "../queryKeys"; + +const useGet사용자 맞춤 대학 추천 = (params?: Record) => { + return useQuery<사용자 맞춤 대학 추천Response, AxiosError>({ + queryKey: [QueryKeys['대학 지원 정보- univ-apply-infos'].사용자 맞춤 대학 추천, params], + queryFn: () => 대학 지원 정보 univApplyInfosApi.get사용자 맞춤 대학 추천(params ? { params } : {}), + }); +}; + +export default useGet사용자 맞춤 대학 추천; \ No newline at end of file diff --git "a/src/apis/\353\214\200\355\225\231 \354\247\200\354\233\220 \354\240\225\353\263\264- univ-apply-infos/get\354\234\204\354\213\234 \355\225\231\352\265\220 \353\252\251\353\241\235 \354\241\260\355\232\214.ts" "b/src/apis/\353\214\200\355\225\231 \354\247\200\354\233\220 \354\240\225\353\263\264- univ-apply-infos/get\354\234\204\354\213\234 \355\225\231\352\265\220 \353\252\251\353\241\235 \354\241\260\355\232\214.ts" new file mode 100644 index 00000000..4efc3fa4 --- /dev/null +++ "b/src/apis/\353\214\200\355\225\231 \354\247\200\354\233\220 \354\240\225\353\263\264- univ-apply-infos/get\354\234\204\354\213\234 \355\225\231\352\265\220 \353\252\251\353\241\235 \354\241\260\355\232\214.ts" @@ -0,0 +1,13 @@ +import { AxiosError } from "axios"; +import { useQuery } from "@tanstack/react-query"; +import { 대학 지원 정보 univApplyInfosApi, 위시 학교 목록 조회Response } from "./api"; +import { QueryKeys } from "../queryKeys"; + +const useGet위시 학교 목록 조회 = (params?: Record) => { + return useQuery<위시 학교 목록 조회Response, AxiosError>({ + queryKey: [QueryKeys['대학 지원 정보- univ-apply-infos'].위시 학교 목록 조회, params], + queryFn: () => 대학 지원 정보 univApplyInfosApi.get위시 학교 목록 조회(params ? { params } : {}), + }); +}; + +export default useGet위시 학교 목록 조회; \ No newline at end of file diff --git "a/src/apis/\353\214\200\355\225\231 \354\247\200\354\233\220 \354\240\225\353\263\264- univ-apply-infos/get\354\234\204\354\213\234 \355\225\231\352\265\220\354\235\270\354\247\200 \354\241\260\355\232\214.ts" "b/src/apis/\353\214\200\355\225\231 \354\247\200\354\233\220 \354\240\225\353\263\264- univ-apply-infos/get\354\234\204\354\213\234 \355\225\231\352\265\220\354\235\270\354\247\200 \354\241\260\355\232\214.ts" new file mode 100644 index 00000000..19b5d141 --- /dev/null +++ "b/src/apis/\353\214\200\355\225\231 \354\247\200\354\233\220 \354\240\225\353\263\264- univ-apply-infos/get\354\234\204\354\213\234 \355\225\231\352\265\220\354\235\270\354\247\200 \354\241\260\355\232\214.ts" @@ -0,0 +1,14 @@ +import { AxiosError } from "axios"; +import { useQuery } from "@tanstack/react-query"; +import { 대학 지원 정보 univApplyInfosApi, 위시 학교인지 조회Response } from "./api"; +import { QueryKeys } from "../queryKeys"; + +const useGet위시 학교인지 조회 = (univApplyInfoId: string | number, params?: Record) => { + return useQuery<위시 학교인지 조회Response, AxiosError>({ + queryKey: [QueryKeys['대학 지원 정보- univ-apply-infos'].위시 학교인지 조회, univApplyInfoId, params], + queryFn: () => 대학 지원 정보 univApplyInfosApi.get위시 학교인지 조회({ univApplyInfoId, params }), + enabled: !!univApplyInfoId, + }); +}; + +export default useGet위시 학교인지 조회; \ No newline at end of file diff --git "a/src/apis/\353\214\200\355\225\231 \354\247\200\354\233\220 \354\240\225\353\263\264- univ-apply-infos/get\355\225\231\352\265\220 \354\203\201\354\204\270 \354\240\225\353\263\264 \354\241\260\355\232\214.ts" "b/src/apis/\353\214\200\355\225\231 \354\247\200\354\233\220 \354\240\225\353\263\264- univ-apply-infos/get\355\225\231\352\265\220 \354\203\201\354\204\270 \354\240\225\353\263\264 \354\241\260\355\232\214.ts" new file mode 100644 index 00000000..587cd4f0 --- /dev/null +++ "b/src/apis/\353\214\200\355\225\231 \354\247\200\354\233\220 \354\240\225\353\263\264- univ-apply-infos/get\355\225\231\352\265\220 \354\203\201\354\204\270 \354\240\225\353\263\264 \354\241\260\355\232\214.ts" @@ -0,0 +1,14 @@ +import { AxiosError } from "axios"; +import { useQuery } from "@tanstack/react-query"; +import { 대학 지원 정보 univApplyInfosApi, 학교 상세 정보 조회Response } from "./api"; +import { QueryKeys } from "../queryKeys"; + +const useGet학교 상세 정보 조회 = (univApplyInfoId: string | number, params?: Record) => { + return useQuery<학교 상세 정보 조회Response, AxiosError>({ + queryKey: [QueryKeys['대학 지원 정보- univ-apply-infos'].학교 상세 정보 조회, univApplyInfoId, params], + queryFn: () => 대학 지원 정보 univApplyInfosApi.get학교 상세 정보 조회({ univApplyInfoId, params }), + enabled: !!univApplyInfoId, + }); +}; + +export default useGet학교 상세 정보 조회; \ No newline at end of file diff --git "a/src/apis/\353\214\200\355\225\231 \354\247\200\354\233\220 \354\240\225\353\263\264- univ-apply-infos/get\355\225\231\352\265\220 \355\205\215\354\212\244\355\212\270 \352\262\200\354\203\211.ts" "b/src/apis/\353\214\200\355\225\231 \354\247\200\354\233\220 \354\240\225\353\263\264- univ-apply-infos/get\355\225\231\352\265\220 \355\205\215\354\212\244\355\212\270 \352\262\200\354\203\211.ts" new file mode 100644 index 00000000..5b3aa064 --- /dev/null +++ "b/src/apis/\353\214\200\355\225\231 \354\247\200\354\233\220 \354\240\225\353\263\264- univ-apply-infos/get\355\225\231\352\265\220 \355\205\215\354\212\244\355\212\270 \352\262\200\354\203\211.ts" @@ -0,0 +1,13 @@ +import { AxiosError } from "axios"; +import { useQuery } from "@tanstack/react-query"; +import { 대학 지원 정보 univApplyInfosApi, 학교 텍스트 검색Response } from "./api"; +import { QueryKeys } from "../queryKeys"; + +const useGet학교 텍스트 검색 = (params?: Record) => { + return useQuery<학교 텍스트 검색Response, AxiosError>({ + queryKey: [QueryKeys['대학 지원 정보- univ-apply-infos'].학교 텍스트 검색, params], + queryFn: () => 대학 지원 정보 univApplyInfosApi.get학교 텍스트 검색(params ? { params } : {}), + }); +}; + +export default useGet학교 텍스트 검색; \ No newline at end of file diff --git "a/src/apis/\353\214\200\355\225\231 \354\247\200\354\233\220 \354\240\225\353\263\264- univ-apply-infos/index.ts" "b/src/apis/\353\214\200\355\225\231 \354\247\200\354\233\220 \354\240\225\353\263\264- univ-apply-infos/index.ts" new file mode 100644 index 00000000..33891b81 --- /dev/null +++ "b/src/apis/\353\214\200\355\225\231 \354\247\200\354\233\220 \354\240\225\353\263\264- univ-apply-infos/index.ts" @@ -0,0 +1,8 @@ +export { 대학 지원 정보 univApplyInfosApi } from './api'; +export { default as delete위시 학교 삭제 } from './delete위시 학교 삭제'; +export { default as get사용자 맞춤 대학 추천 } from './get사용자 맞춤 대학 추천'; +export { default as get위시 학교 목록 조회 } from './get위시 학교 목록 조회'; +export { default as get위시 학교인지 조회 } from './get위시 학교인지 조회'; +export { default as get학교 상세 정보 조회 } from './get학교 상세 정보 조회'; +export { default as get학교 텍스트 검색 } from './get학교 텍스트 검색'; +export { default as post위시 학교 추가 } from './post위시 학교 추가'; diff --git "a/src/apis/\353\214\200\355\225\231 \354\247\200\354\233\220 \354\240\225\353\263\264- univ-apply-infos/post\354\234\204\354\213\234 \355\225\231\352\265\220 \354\266\224\352\260\200.ts" "b/src/apis/\353\214\200\355\225\231 \354\247\200\354\233\220 \354\240\225\353\263\264- univ-apply-infos/post\354\234\204\354\213\234 \355\225\231\352\265\220 \354\266\224\352\260\200.ts" new file mode 100644 index 00000000..aae4618b --- /dev/null +++ "b/src/apis/\353\214\200\355\225\231 \354\247\200\354\233\220 \354\240\225\353\263\264- univ-apply-infos/post\354\234\204\354\213\234 \355\225\231\352\265\220 \354\266\224\352\260\200.ts" @@ -0,0 +1,11 @@ +import { AxiosError } from "axios"; +import { useMutation } from "@tanstack/react-query"; +import { 대학 지원 정보 univApplyInfosApi, 위시 학교 추가Response, 위시 학교 추가Request } from "./api"; + +const usePost위시 학교 추가 = () => { + return useMutation<위시 학교 추가Response, AxiosError, { univApplyInfoId: string | number; data: 위시 학교 추가Request }>({ + mutationFn: (variables) => 대학 지원 정보 univApplyInfosApi.post위시 학교 추가(variables), + }); +}; + +export default usePost위시 학교 추가; \ No newline at end of file diff --git "a/src/apis/\353\214\200\355\225\231- universities/api.ts" "b/src/apis/\353\214\200\355\225\231- universities/api.ts" new file mode 100644 index 00000000..3c4b0e7d --- /dev/null +++ "b/src/apis/\353\214\200\355\225\231- universities/api.ts" @@ -0,0 +1,13 @@ +import { axiosInstance } from "@/utils/axiosInstance"; + +export type 권역국가에 해당하는 전체 대학Response = void; + +export const 대학 universitiesApi = { + get권역국가에 해당하는 전체 대학: async (params: { params?: Record }): Promise<권역국가에 해당하는 전체 대학Response> => { + const res = await axiosInstance.get<권역국가에 해당하는 전체 대학Response>( + `/universities/search`, { params: params?.params } + ); + return res.data; + }, + +}; \ No newline at end of file diff --git "a/src/apis/\353\214\200\355\225\231- universities/get\352\266\214\354\227\255\352\265\255\352\260\200\354\227\220 \355\225\264\353\213\271\355\225\230\353\212\224 \354\240\204\354\262\264 \353\214\200\355\225\231.ts" "b/src/apis/\353\214\200\355\225\231- universities/get\352\266\214\354\227\255\352\265\255\352\260\200\354\227\220 \355\225\264\353\213\271\355\225\230\353\212\224 \354\240\204\354\262\264 \353\214\200\355\225\231.ts" new file mode 100644 index 00000000..825c24c6 --- /dev/null +++ "b/src/apis/\353\214\200\355\225\231- universities/get\352\266\214\354\227\255\352\265\255\352\260\200\354\227\220 \355\225\264\353\213\271\355\225\230\353\212\224 \354\240\204\354\262\264 \353\214\200\355\225\231.ts" @@ -0,0 +1,13 @@ +import { AxiosError } from "axios"; +import { useQuery } from "@tanstack/react-query"; +import { 대학 universitiesApi, 권역국가에 해당하는 전체 대학Response } from "./api"; +import { QueryKeys } from "../queryKeys"; + +const useGet권역국가에 해당하는 전체 대학 = (params?: Record) => { + return useQuery<권역국가에 해당하는 전체 대학Response, AxiosError>({ + queryKey: [QueryKeys['대학- universities'].권역국가에 해당하는 전체 대학, params], + queryFn: () => 대학 universitiesApi.get권역국가에 해당하는 전체 대학(params ? { params } : {}), + }); +}; + +export default useGet권역국가에 해당하는 전체 대학; \ No newline at end of file diff --git "a/src/apis/\353\214\200\355\225\231- universities/index.ts" "b/src/apis/\353\214\200\355\225\231- universities/index.ts" new file mode 100644 index 00000000..214d1254 --- /dev/null +++ "b/src/apis/\353\214\200\355\225\231- universities/index.ts" @@ -0,0 +1,2 @@ +export { 대학 universitiesApi } from './api'; +export { default as get권역국가에 해당하는 전체 대학 } from './get권역국가에 해당하는 전체 대학'; diff --git "a/src/apis/\353\214\223\352\270\200- comments/api.ts" "b/src/apis/\353\214\223\352\270\200- comments/api.ts" new file mode 100644 index 00000000..a1e5ed00 --- /dev/null +++ "b/src/apis/\353\214\223\352\270\200- comments/api.ts" @@ -0,0 +1,35 @@ +import { axiosInstance } from "@/utils/axiosInstance"; + +export type 댓글 삭제Response = void; + +export type 댓글 수정Response = void; + +export type 댓글 수정Request = Record; + +export type 댓글 작성Response = void; + +export type 댓글 작성Request = Record; + +export const 댓글 commentsApi = { + delete댓글 삭제: async (params: { commentId: string | number }): Promise<댓글 삭제Response> => { + const res = await axiosInstance.delete<댓글 삭제Response>( + `/comments/${params.commentId}` + ); + return res.data; + }, + + patch댓글 수정: async (params: { commentId: string | number, data?: 댓글 수정Request }): Promise<댓글 수정Response> => { + const res = await axiosInstance.patch<댓글 수정Response>( + `/comments/${params.commentId}`, params?.data + ); + return res.data; + }, + + post댓글 작성: async (params: { data?: 댓글 작성Request }): Promise<댓글 작성Response> => { + const res = await axiosInstance.post<댓글 작성Response>( + `/comments`, params?.data + ); + return res.data; + }, + +}; \ No newline at end of file diff --git "a/src/apis/\353\214\223\352\270\200- comments/delete\353\214\223\352\270\200 \354\202\255\354\240\234.ts" "b/src/apis/\353\214\223\352\270\200- comments/delete\353\214\223\352\270\200 \354\202\255\354\240\234.ts" new file mode 100644 index 00000000..6d5dc408 --- /dev/null +++ "b/src/apis/\353\214\223\352\270\200- comments/delete\353\214\223\352\270\200 \354\202\255\354\240\234.ts" @@ -0,0 +1,11 @@ +import { AxiosError } from "axios"; +import { useMutation } from "@tanstack/react-query"; +import { 댓글 commentsApi, 댓글 삭제Response, 댓글 삭제Request } from "./api"; + +const useDelete댓글 삭제 = () => { + return useMutation<댓글 삭제Response, AxiosError, { commentId: string | number; data: 댓글 삭제Request }>({ + mutationFn: (variables) => 댓글 commentsApi.delete댓글 삭제(variables), + }); +}; + +export default useDelete댓글 삭제; \ No newline at end of file diff --git "a/src/apis/\353\214\223\352\270\200- comments/index.ts" "b/src/apis/\353\214\223\352\270\200- comments/index.ts" new file mode 100644 index 00000000..dd24bc26 --- /dev/null +++ "b/src/apis/\353\214\223\352\270\200- comments/index.ts" @@ -0,0 +1,4 @@ +export { 댓글 commentsApi } from './api'; +export { default as delete댓글 삭제 } from './delete댓글 삭제'; +export { default as patch댓글 수정 } from './patch댓글 수정'; +export { default as post댓글 작성 } from './post댓글 작성'; diff --git "a/src/apis/\353\214\223\352\270\200- comments/patch\353\214\223\352\270\200 \354\210\230\354\240\225.ts" "b/src/apis/\353\214\223\352\270\200- comments/patch\353\214\223\352\270\200 \354\210\230\354\240\225.ts" new file mode 100644 index 00000000..08be169f --- /dev/null +++ "b/src/apis/\353\214\223\352\270\200- comments/patch\353\214\223\352\270\200 \354\210\230\354\240\225.ts" @@ -0,0 +1,11 @@ +import { AxiosError } from "axios"; +import { useMutation } from "@tanstack/react-query"; +import { 댓글 commentsApi, 댓글 수정Response, 댓글 수정Request } from "./api"; + +const usePatch댓글 수정 = () => { + return useMutation<댓글 수정Response, AxiosError, { commentId: string | number; data: 댓글 수정Request }>({ + mutationFn: (variables) => 댓글 commentsApi.patch댓글 수정(variables), + }); +}; + +export default usePatch댓글 수정; \ No newline at end of file diff --git "a/src/apis/\353\214\223\352\270\200- comments/post\353\214\223\352\270\200 \354\236\221\354\204\261.ts" "b/src/apis/\353\214\223\352\270\200- comments/post\353\214\223\352\270\200 \354\236\221\354\204\261.ts" new file mode 100644 index 00000000..05f1c2fb --- /dev/null +++ "b/src/apis/\353\214\223\352\270\200- comments/post\353\214\223\352\270\200 \354\236\221\354\204\261.ts" @@ -0,0 +1,11 @@ +import { AxiosError } from "axios"; +import { useMutation } from "@tanstack/react-query"; +import { 댓글 commentsApi, 댓글 작성Response, 댓글 작성Request } from "./api"; + +const usePost댓글 작성 = () => { + return useMutation<댓글 작성Response, AxiosError, 댓글 작성Request>({ + mutationFn: (data) => 댓글 commentsApi.post댓글 작성({ data }), + }); +}; + +export default usePost댓글 작성; \ No newline at end of file diff --git "a/src/apis/\353\251\230\355\206\240- mentor/api.ts" "b/src/apis/\353\251\230\355\206\240- mentor/api.ts" new file mode 100644 index 00000000..f4c4922b --- /dev/null +++ "b/src/apis/\353\251\230\355\206\240- mentor/api.ts" @@ -0,0 +1,22 @@ +import { axiosInstance } from "@/utils/axiosInstance"; + +export type 멘토 목록 조회Response = void; + +export type 멘토 상세 페이지Response = void; + +export const 멘토 mentorApi = { + get멘토 목록 조회: async (params: { defaultSize: string | number, defaultPage: string | number, params?: Record }): Promise<멘토 목록 조회Response> => { + const res = await axiosInstance.get<멘토 목록 조회Response>( + `/mentors?region=미주권&size=${params.defaultSize}&page=${params.defaultPage}`, { params: params?.params } + ); + return res.data; + }, + + get멘토 상세 페이지: async (params: { mentorId: string | number, params?: Record }): Promise<멘토 상세 페이지Response> => { + const res = await axiosInstance.get<멘토 상세 페이지Response>( + `/mentors/${params.mentorId}`, { params: params?.params } + ); + return res.data; + }, + +}; \ No newline at end of file diff --git "a/src/apis/\353\251\230\355\206\240- mentor/get\353\251\230\355\206\240 \353\252\251\353\241\235 \354\241\260\355\232\214.ts" "b/src/apis/\353\251\230\355\206\240- mentor/get\353\251\230\355\206\240 \353\252\251\353\241\235 \354\241\260\355\232\214.ts" new file mode 100644 index 00000000..2e7731c1 --- /dev/null +++ "b/src/apis/\353\251\230\355\206\240- mentor/get\353\251\230\355\206\240 \353\252\251\353\241\235 \354\241\260\355\232\214.ts" @@ -0,0 +1,14 @@ +import { AxiosError } from "axios"; +import { useQuery } from "@tanstack/react-query"; +import { 멘토 mentorApi, 멘토 목록 조회Response } from "./api"; +import { QueryKeys } from "../queryKeys"; + +const useGet멘토 목록 조회 = (defaultSize: string | number, defaultPage: string | number, params?: Record) => { + return useQuery<멘토 목록 조회Response, AxiosError>({ + queryKey: [QueryKeys['멘토- mentor'].멘토 목록 조회, defaultSize, defaultPage, params], + queryFn: () => 멘토 mentorApi.get멘토 목록 조회({ defaultSize, defaultPage, params }), + enabled: !!defaultSize && !!defaultPage, + }); +}; + +export default useGet멘토 목록 조회; \ No newline at end of file diff --git "a/src/apis/\353\251\230\355\206\240- mentor/get\353\251\230\355\206\240 \354\203\201\354\204\270 \355\216\230\354\235\264\354\247\200.ts" "b/src/apis/\353\251\230\355\206\240- mentor/get\353\251\230\355\206\240 \354\203\201\354\204\270 \355\216\230\354\235\264\354\247\200.ts" new file mode 100644 index 00000000..f811a4fb --- /dev/null +++ "b/src/apis/\353\251\230\355\206\240- mentor/get\353\251\230\355\206\240 \354\203\201\354\204\270 \355\216\230\354\235\264\354\247\200.ts" @@ -0,0 +1,14 @@ +import { AxiosError } from "axios"; +import { useQuery } from "@tanstack/react-query"; +import { 멘토 mentorApi, 멘토 상세 페이지Response } from "./api"; +import { QueryKeys } from "../queryKeys"; + +const useGet멘토 상세 페이지 = (mentorId: string | number, params?: Record) => { + return useQuery<멘토 상세 페이지Response, AxiosError>({ + queryKey: [QueryKeys['멘토- mentor'].멘토 상세 페이지, mentorId, params], + queryFn: () => 멘토 mentorApi.get멘토 상세 페이지({ mentorId, params }), + enabled: !!mentorId, + }); +}; + +export default useGet멘토 상세 페이지; \ No newline at end of file diff --git "a/src/apis/\353\251\230\355\206\240- mentor/index.ts" "b/src/apis/\353\251\230\355\206\240- mentor/index.ts" new file mode 100644 index 00000000..996531ca --- /dev/null +++ "b/src/apis/\353\251\230\355\206\240- mentor/index.ts" @@ -0,0 +1,3 @@ +export { 멘토 mentorApi } from './api'; +export { default as get멘토 목록 조회 } from './get멘토 목록 조회'; +export { default as get멘토 상세 페이지 } from './get멘토 상세 페이지'; diff --git "a/src/apis/\353\251\230\355\206\240\353\247\214 \354\232\224\354\262\255 \352\260\200\353\212\245/api.ts" "b/src/apis/\353\251\230\355\206\240\353\247\214 \354\232\224\354\262\255 \352\260\200\353\212\245/api.ts" new file mode 100644 index 00000000..566d0211 --- /dev/null +++ "b/src/apis/\353\251\230\355\206\240\353\247\214 \354\232\224\354\262\255 \352\260\200\353\212\245/api.ts" @@ -0,0 +1,99 @@ +import { axiosInstance } from "@/utils/axiosInstance"; + +export type 나의 멘토 페이지 수정Response = void; + +export type 나의 멘토 페이지 수정Request = Record; + +export interface 나의 멘토 페이지 조회ResponseChannelsItem { + type: string; + url: string; +} + +export interface 나의 멘토 페이지 조회Response { + id: number; + profileImageUrl: null; + nickname: string; + country: string; + universityName: string; + term: string; + menteeCount: number; + hasBadge: boolean; + introduction: string; + passTip: string; + channels: 나의 멘토 페이지 조회ResponseChannelsItem[]; +} + +export interface 멘토링 수락거절Response { + mentoringId: number; +} + +export type 멘토링 수락거절Request = Record; + +export interface 멘토링 확인Response { + checkedMentoringIds: number[]; +} + +export type 멘토링 확인Request = Record; + +export interface 신청받은 멘토링 목록ResponseContentItem { + mentoringId: number; + profileImageUrl: null; + nickname: string; + isChecked: boolean; + verifyStatus: string; + createdAt: string; +} + +export interface 신청받은 멘토링 목록Response { + content: 신청받은 멘토링 목록ResponseContentItem[]; + nextPageNumber: number; +} + +export interface 확인하지 않은 멘토링 수Response { + uncheckedCount: number; +} + +export const 멘토만 요청 가능Api = { + put나의 멘토 페이지 수정: async (params: { data?: 나의 멘토 페이지 수정Request }): Promise<나의 멘토 페이지 수정Response> => { + const res = await axiosInstance.put<나의 멘토 페이지 수정Response>( + `/mentor/my`, params?.data + ); + return res.data; + }, + + get나의 멘토 페이지 조회: async (params: { params?: Record }): Promise<나의 멘토 페이지 조회Response> => { + const res = await axiosInstance.get<나의 멘토 페이지 조회Response>( + `/mentor/my`, { params: params?.params } + ); + return res.data; + }, + + patch멘토링 수락거절: async (params: { mentoringId: string | number, data?: 멘토링 수락거절Request }): Promise<멘토링 수락거절Response> => { + const res = await axiosInstance.patch<멘토링 수락거절Response>( + `/mentor/mentorings/${params.mentoringId}`, params?.data + ); + return res.data; + }, + + patch멘토링 확인: async (params: { data?: 멘토링 확인Request }): Promise<멘토링 확인Response> => { + const res = await axiosInstance.patch<멘토링 확인Response>( + `/mentor/mentorings/check`, params?.data + ); + return res.data; + }, + + get신청받은 멘토링 목록: async (params: { params?: Record }): Promise<신청받은 멘토링 목록Response> => { + const res = await axiosInstance.get<신청받은 멘토링 목록Response>( + `/mentor/mentorings`, { params: params?.params } + ); + return res.data; + }, + + get확인하지 않은 멘토링 수: async (params: { params?: Record }): Promise<확인하지 않은 멘토링 수Response> => { + const res = await axiosInstance.get<확인하지 않은 멘토링 수Response>( + `/mentor/mentorings/check`, { params: params?.params } + ); + return res.data; + }, + +}; \ No newline at end of file diff --git "a/src/apis/\353\251\230\355\206\240\353\247\214 \354\232\224\354\262\255 \352\260\200\353\212\245/get\353\202\230\354\235\230 \353\251\230\355\206\240 \355\216\230\354\235\264\354\247\200 \354\241\260\355\232\214.ts" "b/src/apis/\353\251\230\355\206\240\353\247\214 \354\232\224\354\262\255 \352\260\200\353\212\245/get\353\202\230\354\235\230 \353\251\230\355\206\240 \355\216\230\354\235\264\354\247\200 \354\241\260\355\232\214.ts" new file mode 100644 index 00000000..25f45900 --- /dev/null +++ "b/src/apis/\353\251\230\355\206\240\353\247\214 \354\232\224\354\262\255 \352\260\200\353\212\245/get\353\202\230\354\235\230 \353\251\230\355\206\240 \355\216\230\354\235\264\354\247\200 \354\241\260\355\232\214.ts" @@ -0,0 +1,13 @@ +import { AxiosError } from "axios"; +import { useQuery } from "@tanstack/react-query"; +import { 멘토만 요청 가능Api, 나의 멘토 페이지 조회Response } from "./api"; +import { QueryKeys } from "../queryKeys"; + +const useGet나의 멘토 페이지 조회 = (params?: Record) => { + return useQuery<나의 멘토 페이지 조회Response, AxiosError>({ + queryKey: [QueryKeys.멘토만 요청 가능.나의 멘토 페이지 조회, params], + queryFn: () => 멘토만 요청 가능Api.get나의 멘토 페이지 조회(params ? { params } : {}), + }); +}; + +export default useGet나의 멘토 페이지 조회; \ No newline at end of file diff --git "a/src/apis/\353\251\230\355\206\240\353\247\214 \354\232\224\354\262\255 \352\260\200\353\212\245/get\354\213\240\354\262\255\353\260\233\354\235\200 \353\251\230\355\206\240\353\247\201 \353\252\251\353\241\235.ts" "b/src/apis/\353\251\230\355\206\240\353\247\214 \354\232\224\354\262\255 \352\260\200\353\212\245/get\354\213\240\354\262\255\353\260\233\354\235\200 \353\251\230\355\206\240\353\247\201 \353\252\251\353\241\235.ts" new file mode 100644 index 00000000..4a5076fd --- /dev/null +++ "b/src/apis/\353\251\230\355\206\240\353\247\214 \354\232\224\354\262\255 \352\260\200\353\212\245/get\354\213\240\354\262\255\353\260\233\354\235\200 \353\251\230\355\206\240\353\247\201 \353\252\251\353\241\235.ts" @@ -0,0 +1,13 @@ +import { AxiosError } from "axios"; +import { useQuery } from "@tanstack/react-query"; +import { 멘토만 요청 가능Api, 신청받은 멘토링 목록Response } from "./api"; +import { QueryKeys } from "../queryKeys"; + +const useGet신청받은 멘토링 목록 = (params?: Record) => { + return useQuery<신청받은 멘토링 목록Response, AxiosError>({ + queryKey: [QueryKeys.멘토만 요청 가능.신청받은 멘토링 목록, params], + queryFn: () => 멘토만 요청 가능Api.get신청받은 멘토링 목록(params ? { params } : {}), + }); +}; + +export default useGet신청받은 멘토링 목록; \ No newline at end of file diff --git "a/src/apis/\353\251\230\355\206\240\353\247\214 \354\232\224\354\262\255 \352\260\200\353\212\245/get\355\231\225\354\235\270\355\225\230\354\247\200 \354\225\212\354\235\200 \353\251\230\355\206\240\353\247\201 \354\210\230.ts" "b/src/apis/\353\251\230\355\206\240\353\247\214 \354\232\224\354\262\255 \352\260\200\353\212\245/get\355\231\225\354\235\270\355\225\230\354\247\200 \354\225\212\354\235\200 \353\251\230\355\206\240\353\247\201 \354\210\230.ts" new file mode 100644 index 00000000..70dc7d63 --- /dev/null +++ "b/src/apis/\353\251\230\355\206\240\353\247\214 \354\232\224\354\262\255 \352\260\200\353\212\245/get\355\231\225\354\235\270\355\225\230\354\247\200 \354\225\212\354\235\200 \353\251\230\355\206\240\353\247\201 \354\210\230.ts" @@ -0,0 +1,13 @@ +import { AxiosError } from "axios"; +import { useQuery } from "@tanstack/react-query"; +import { 멘토만 요청 가능Api, 확인하지 않은 멘토링 수Response } from "./api"; +import { QueryKeys } from "../queryKeys"; + +const useGet확인하지 않은 멘토링 수 = (params?: Record) => { + return useQuery<확인하지 않은 멘토링 수Response, AxiosError>({ + queryKey: [QueryKeys.멘토만 요청 가능.확인하지 않은 멘토링 수, params], + queryFn: () => 멘토만 요청 가능Api.get확인하지 않은 멘토링 수(params ? { params } : {}), + }); +}; + +export default useGet확인하지 않은 멘토링 수; \ No newline at end of file diff --git "a/src/apis/\353\251\230\355\206\240\353\247\214 \354\232\224\354\262\255 \352\260\200\353\212\245/index.ts" "b/src/apis/\353\251\230\355\206\240\353\247\214 \354\232\224\354\262\255 \352\260\200\353\212\245/index.ts" new file mode 100644 index 00000000..11780138 --- /dev/null +++ "b/src/apis/\353\251\230\355\206\240\353\247\214 \354\232\224\354\262\255 \352\260\200\353\212\245/index.ts" @@ -0,0 +1,7 @@ +export { 멘토만 요청 가능Api } from './api'; +export { default as get나의 멘토 페이지 조회 } from './get나의 멘토 페이지 조회'; +export { default as get신청받은 멘토링 목록 } from './get신청받은 멘토링 목록'; +export { default as get확인하지 않은 멘토링 수 } from './get확인하지 않은 멘토링 수'; +export { default as patch멘토링 수락거절 } from './patch멘토링 수락거절'; +export { default as patch멘토링 확인 } from './patch멘토링 확인'; +export { default as put나의 멘토 페이지 수정 } from './put나의 멘토 페이지 수정'; diff --git "a/src/apis/\353\251\230\355\206\240\353\247\214 \354\232\224\354\262\255 \352\260\200\353\212\245/patch\353\251\230\355\206\240\353\247\201 \354\210\230\353\235\275\352\261\260\354\240\210.ts" "b/src/apis/\353\251\230\355\206\240\353\247\214 \354\232\224\354\262\255 \352\260\200\353\212\245/patch\353\251\230\355\206\240\353\247\201 \354\210\230\353\235\275\352\261\260\354\240\210.ts" new file mode 100644 index 00000000..a0269cca --- /dev/null +++ "b/src/apis/\353\251\230\355\206\240\353\247\214 \354\232\224\354\262\255 \352\260\200\353\212\245/patch\353\251\230\355\206\240\353\247\201 \354\210\230\353\235\275\352\261\260\354\240\210.ts" @@ -0,0 +1,11 @@ +import { AxiosError } from "axios"; +import { useMutation } from "@tanstack/react-query"; +import { 멘토만 요청 가능Api, 멘토링 수락거절Response, 멘토링 수락거절Request } from "./api"; + +const usePatch멘토링 수락거절 = () => { + return useMutation<멘토링 수락거절Response, AxiosError, { mentoringId: string | number; data: 멘토링 수락거절Request }>({ + mutationFn: (variables) => 멘토만 요청 가능Api.patch멘토링 수락거절(variables), + }); +}; + +export default usePatch멘토링 수락거절; \ No newline at end of file diff --git "a/src/apis/\353\251\230\355\206\240\353\247\214 \354\232\224\354\262\255 \352\260\200\353\212\245/patch\353\251\230\355\206\240\353\247\201 \355\231\225\354\235\270.ts" "b/src/apis/\353\251\230\355\206\240\353\247\214 \354\232\224\354\262\255 \352\260\200\353\212\245/patch\353\251\230\355\206\240\353\247\201 \355\231\225\354\235\270.ts" new file mode 100644 index 00000000..c3a231d9 --- /dev/null +++ "b/src/apis/\353\251\230\355\206\240\353\247\214 \354\232\224\354\262\255 \352\260\200\353\212\245/patch\353\251\230\355\206\240\353\247\201 \355\231\225\354\235\270.ts" @@ -0,0 +1,11 @@ +import { AxiosError } from "axios"; +import { useMutation } from "@tanstack/react-query"; +import { 멘토만 요청 가능Api, 멘토링 확인Response, 멘토링 확인Request } from "./api"; + +const usePatch멘토링 확인 = () => { + return useMutation<멘토링 확인Response, AxiosError, 멘토링 확인Request>({ + mutationFn: (data) => 멘토만 요청 가능Api.patch멘토링 확인({ data }), + }); +}; + +export default usePatch멘토링 확인; \ No newline at end of file diff --git "a/src/apis/\353\251\230\355\206\240\353\247\214 \354\232\224\354\262\255 \352\260\200\353\212\245/put\353\202\230\354\235\230 \353\251\230\355\206\240 \355\216\230\354\235\264\354\247\200 \354\210\230\354\240\225.ts" "b/src/apis/\353\251\230\355\206\240\353\247\214 \354\232\224\354\262\255 \352\260\200\353\212\245/put\353\202\230\354\235\230 \353\251\230\355\206\240 \355\216\230\354\235\264\354\247\200 \354\210\230\354\240\225.ts" new file mode 100644 index 00000000..14b8da87 --- /dev/null +++ "b/src/apis/\353\251\230\355\206\240\353\247\214 \354\232\224\354\262\255 \352\260\200\353\212\245/put\353\202\230\354\235\230 \353\251\230\355\206\240 \355\216\230\354\235\264\354\247\200 \354\210\230\354\240\225.ts" @@ -0,0 +1,11 @@ +import { AxiosError } from "axios"; +import { useMutation } from "@tanstack/react-query"; +import { 멘토만 요청 가능Api, 나의 멘토 페이지 수정Response, 나의 멘토 페이지 수정Request } from "./api"; + +const usePut나의 멘토 페이지 수정 = () => { + return useMutation<나의 멘토 페이지 수정Response, AxiosError, 나의 멘토 페이지 수정Request>({ + mutationFn: (data) => 멘토만 요청 가능Api.put나의 멘토 페이지 수정({ data }), + }); +}; + +export default usePut나의 멘토 페이지 수정; \ No newline at end of file diff --git "a/src/apis/\353\251\230\355\213\260\353\247\214 \354\232\224\354\262\255 \352\260\200\353\212\245/api.ts" "b/src/apis/\353\251\230\355\213\260\353\247\214 \354\232\224\354\262\255 \352\260\200\353\212\245/api.ts" new file mode 100644 index 00000000..1a8d402c --- /dev/null +++ "b/src/apis/\353\251\230\355\213\260\353\247\214 \354\232\224\354\262\255 \352\260\200\353\212\245/api.ts" @@ -0,0 +1,78 @@ +import { axiosInstance } from "@/utils/axiosInstance"; + +export interface 매칭된 멘토 목록ResponseContentItem { + id: number; + roomId: number; + nickname: string; + profileImageUrl: string; + country: string; + universityName: string; + term: string; + menteeCount: number; + hasBadge: boolean; + introduction: string; + channels: any[]; + isApplied: boolean; +} + +export interface 매칭된 멘토 목록Response { + content: 매칭된 멘토 목록ResponseContentItem[]; + nextPageNumber: number; +} + +export interface 멘토링 신청Response { + mentoringId: number; +} + +export type 멘토링 신청Request = Record; + +export interface 멘토링 확인Response { + checkedMentoringIds: number[]; +} + +export type 멘토링 확인Request = Record; + +export interface 신청한 멘토링 목록ResponseContentItem { + mentoringId: number; + profileImageUrl: null; + nickname: string; + isChecked: boolean; + createdAt: string; + chatRoomId: number; +} + +export interface 신청한 멘토링 목록Response { + content: 신청한 멘토링 목록ResponseContentItem[]; + nextPageNumber: number; +} + +export const 멘티만 요청 가능Api = { + get매칭된 멘토 목록: async (params: { defaultSize: string | number, defaultPage: string | number, params?: Record }): Promise<매칭된 멘토 목록Response> => { + const res = await axiosInstance.get<매칭된 멘토 목록Response>( + `/mentee/mentorings/matched-mentors?size=${params.defaultSize}&page=${params.defaultPage}`, { params: params?.params } + ); + return res.data; + }, + + post멘토링 신청: async (params: { data?: 멘토링 신청Request }): Promise<멘토링 신청Response> => { + const res = await axiosInstance.post<멘토링 신청Response>( + `/mentee/mentorings`, params?.data + ); + return res.data; + }, + + patch멘토링 확인: async (params: { data?: 멘토링 확인Request }): Promise<멘토링 확인Response> => { + const res = await axiosInstance.patch<멘토링 확인Response>( + `/mentee/mentorings/check`, params?.data + ); + return res.data; + }, + + get신청한 멘토링 목록: async (params: { verifyStatus: string | number, defaultSize: string | number, defaultPage: string | number, params?: Record }): Promise<신청한 멘토링 목록Response> => { + const res = await axiosInstance.get<신청한 멘토링 목록Response>( + `/mentee/mentorings?verify-status=${params.verifyStatus}&size=${params.defaultSize}&page=${params.defaultPage}`, { params: params?.params } + ); + return res.data; + }, + +}; \ No newline at end of file diff --git "a/src/apis/\353\251\230\355\213\260\353\247\214 \354\232\224\354\262\255 \352\260\200\353\212\245/get\353\247\244\354\271\255\353\220\234 \353\251\230\355\206\240 \353\252\251\353\241\235.ts" "b/src/apis/\353\251\230\355\213\260\353\247\214 \354\232\224\354\262\255 \352\260\200\353\212\245/get\353\247\244\354\271\255\353\220\234 \353\251\230\355\206\240 \353\252\251\353\241\235.ts" new file mode 100644 index 00000000..467a0e60 --- /dev/null +++ "b/src/apis/\353\251\230\355\213\260\353\247\214 \354\232\224\354\262\255 \352\260\200\353\212\245/get\353\247\244\354\271\255\353\220\234 \353\251\230\355\206\240 \353\252\251\353\241\235.ts" @@ -0,0 +1,14 @@ +import { AxiosError } from "axios"; +import { useQuery } from "@tanstack/react-query"; +import { 멘티만 요청 가능Api, 매칭된 멘토 목록Response } from "./api"; +import { QueryKeys } from "../queryKeys"; + +const useGet매칭된 멘토 목록 = (defaultSize: string | number, defaultPage: string | number, params?: Record) => { + return useQuery<매칭된 멘토 목록Response, AxiosError>({ + queryKey: [QueryKeys.멘티만 요청 가능.매칭된 멘토 목록, defaultSize, defaultPage, params], + queryFn: () => 멘티만 요청 가능Api.get매칭된 멘토 목록({ defaultSize, defaultPage, params }), + enabled: !!defaultSize && !!defaultPage, + }); +}; + +export default useGet매칭된 멘토 목록; \ No newline at end of file diff --git "a/src/apis/\353\251\230\355\213\260\353\247\214 \354\232\224\354\262\255 \352\260\200\353\212\245/get\354\213\240\354\262\255\355\225\234 \353\251\230\355\206\240\353\247\201 \353\252\251\353\241\235.ts" "b/src/apis/\353\251\230\355\213\260\353\247\214 \354\232\224\354\262\255 \352\260\200\353\212\245/get\354\213\240\354\262\255\355\225\234 \353\251\230\355\206\240\353\247\201 \353\252\251\353\241\235.ts" new file mode 100644 index 00000000..c0e16502 --- /dev/null +++ "b/src/apis/\353\251\230\355\213\260\353\247\214 \354\232\224\354\262\255 \352\260\200\353\212\245/get\354\213\240\354\262\255\355\225\234 \353\251\230\355\206\240\353\247\201 \353\252\251\353\241\235.ts" @@ -0,0 +1,14 @@ +import { AxiosError } from "axios"; +import { useQuery } from "@tanstack/react-query"; +import { 멘티만 요청 가능Api, 신청한 멘토링 목록Response } from "./api"; +import { QueryKeys } from "../queryKeys"; + +const useGet신청한 멘토링 목록 = (verifyStatus: string | number, defaultSize: string | number, defaultPage: string | number, params?: Record) => { + return useQuery<신청한 멘토링 목록Response, AxiosError>({ + queryKey: [QueryKeys.멘티만 요청 가능.신청한 멘토링 목록, verifyStatus, defaultSize, defaultPage, params], + queryFn: () => 멘티만 요청 가능Api.get신청한 멘토링 목록({ verifyStatus, defaultSize, defaultPage, params }), + enabled: !!verifyStatus && !!defaultSize && !!defaultPage, + }); +}; + +export default useGet신청한 멘토링 목록; \ No newline at end of file diff --git "a/src/apis/\353\251\230\355\213\260\353\247\214 \354\232\224\354\262\255 \352\260\200\353\212\245/index.ts" "b/src/apis/\353\251\230\355\213\260\353\247\214 \354\232\224\354\262\255 \352\260\200\353\212\245/index.ts" new file mode 100644 index 00000000..484eefb6 --- /dev/null +++ "b/src/apis/\353\251\230\355\213\260\353\247\214 \354\232\224\354\262\255 \352\260\200\353\212\245/index.ts" @@ -0,0 +1,5 @@ +export { 멘티만 요청 가능Api } from './api'; +export { default as get매칭된 멘토 목록 } from './get매칭된 멘토 목록'; +export { default as get신청한 멘토링 목록 } from './get신청한 멘토링 목록'; +export { default as patch멘토링 확인 } from './patch멘토링 확인'; +export { default as post멘토링 신청 } from './post멘토링 신청'; diff --git "a/src/apis/\353\251\230\355\213\260\353\247\214 \354\232\224\354\262\255 \352\260\200\353\212\245/patch\353\251\230\355\206\240\353\247\201 \355\231\225\354\235\270.ts" "b/src/apis/\353\251\230\355\213\260\353\247\214 \354\232\224\354\262\255 \352\260\200\353\212\245/patch\353\251\230\355\206\240\353\247\201 \355\231\225\354\235\270.ts" new file mode 100644 index 00000000..cf0ccce6 --- /dev/null +++ "b/src/apis/\353\251\230\355\213\260\353\247\214 \354\232\224\354\262\255 \352\260\200\353\212\245/patch\353\251\230\355\206\240\353\247\201 \355\231\225\354\235\270.ts" @@ -0,0 +1,11 @@ +import { AxiosError } from "axios"; +import { useMutation } from "@tanstack/react-query"; +import { 멘티만 요청 가능Api, 멘토링 확인Response, 멘토링 확인Request } from "./api"; + +const usePatch멘토링 확인 = () => { + return useMutation<멘토링 확인Response, AxiosError, 멘토링 확인Request>({ + mutationFn: (data) => 멘티만 요청 가능Api.patch멘토링 확인({ data }), + }); +}; + +export default usePatch멘토링 확인; \ No newline at end of file diff --git "a/src/apis/\353\251\230\355\213\260\353\247\214 \354\232\224\354\262\255 \352\260\200\353\212\245/post\353\251\230\355\206\240\353\247\201 \354\213\240\354\262\255.ts" "b/src/apis/\353\251\230\355\213\260\353\247\214 \354\232\224\354\262\255 \352\260\200\353\212\245/post\353\251\230\355\206\240\353\247\201 \354\213\240\354\262\255.ts" new file mode 100644 index 00000000..6f37a00a --- /dev/null +++ "b/src/apis/\353\251\230\355\213\260\353\247\214 \354\232\224\354\262\255 \352\260\200\353\212\245/post\353\251\230\355\206\240\353\247\201 \354\213\240\354\262\255.ts" @@ -0,0 +1,11 @@ +import { AxiosError } from "axios"; +import { useMutation } from "@tanstack/react-query"; +import { 멘티만 요청 가능Api, 멘토링 신청Response, 멘토링 신청Request } from "./api"; + +const usePost멘토링 신청 = () => { + return useMutation<멘토링 신청Response, AxiosError, 멘토링 신청Request>({ + mutationFn: (data) => 멘티만 요청 가능Api.post멘토링 신청({ data }), + }); +}; + +export default usePost멘토링 신청; \ No newline at end of file