Skip to content

Commit 5eab6ec

Browse files
chore: sync API from Bruno
1 parent 35c3f05 commit 5eab6ec

107 files changed

Lines changed: 2418 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/apis/Admin/api.ts

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
import { axiosInstance } from "@/utils/axiosInstance";
2+
3+
export interface VerifyLanguageTestResponse {
4+
id: number;
5+
languageTestType: string;
6+
languageTestScore: string;
7+
verifyStatus: string;
8+
rejectedReason: null;
9+
}
10+
11+
export type VerifyLanguageTestRequest = Record<string, never>;
12+
13+
export interface ContentItem {
14+
languageTestScoreStatusResponse: LanguageTestScoreStatusResponse;
15+
siteUserResponse: SiteUserResponse;
16+
}
17+
18+
export interface LanguageTestListResponse {
19+
content: ContentItem[];
20+
pageable: Pageable;
21+
totalElements: number;
22+
totalPages: number;
23+
last: boolean;
24+
size: number;
25+
number: number;
26+
sort: Sort;
27+
numberOfElements: number;
28+
first: boolean;
29+
empty: boolean;
30+
}
31+
32+
export interface VerifyGpaResponse {
33+
id: number;
34+
gpa: number;
35+
gpaCriteria: number;
36+
verifyStatus: string;
37+
rejectedReason: null;
38+
}
39+
40+
export type VerifyGpaRequest = Record<string, never>;
41+
42+
export interface ContentItem {
43+
gpaScoreStatusResponse: GpaScoreStatusResponse;
44+
siteUserResponse: SiteUserResponse;
45+
}
46+
47+
export interface GpaListResponse {
48+
content: ContentItem[];
49+
pageable: Pageable;
50+
totalElements: number;
51+
totalPages: number;
52+
last: boolean;
53+
size: number;
54+
number: number;
55+
sort: Sort;
56+
numberOfElements: number;
57+
first: boolean;
58+
empty: boolean;
59+
}
60+
61+
export const adminApi = {
62+
putVerifyLanguageTest: async (params: { data?: VerifyLanguageTestRequest }): Promise<VerifyLanguageTestResponse> => {
63+
const res = await axiosInstance.put<VerifyLanguageTestResponse>(
64+
`{`, params?.data
65+
);
66+
return res.data;
67+
},
68+
69+
getLanguageTestList: async (params: { params?: Record<string, any> }): Promise<LanguageTestListResponse> => {
70+
const res = await axiosInstance.get<LanguageTestListResponse>(
71+
`{`, { params: params?.params }
72+
);
73+
return res.data;
74+
},
75+
76+
putVerifyGpa: async (params: { data?: VerifyGpaRequest }): Promise<VerifyGpaResponse> => {
77+
const res = await axiosInstance.put<VerifyGpaResponse>(
78+
`{`, params?.data
79+
);
80+
return res.data;
81+
},
82+
83+
getGpaList: async (params: { params?: Record<string, any> }): Promise<GpaListResponse> => {
84+
const res = await axiosInstance.get<GpaListResponse>(
85+
`{`, { params: params?.params }
86+
);
87+
return res.data;
88+
},
89+
90+
};

src/apis/Admin/get-getGpaList.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { AxiosError } from "axios";
2+
import { useQuery } from "@tanstack/react-query";
3+
import { adminApi } from "./api";
4+
import { QueryKeys } from "../queryKeys";
5+
6+
const useGetGpaList = (params?: Record<string, any>) => {
7+
return useQuery<GpaListResponse, AxiosError>({
8+
queryKey: [QueryKeys.admin.getGpaList, params],
9+
queryFn: () => adminApi.getGpaList({ params }),
10+
});
11+
};
12+
13+
export default useGetGpaList;
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { AxiosError } from "axios";
2+
import { useQuery } from "@tanstack/react-query";
3+
import { adminApi } from "./api";
4+
import { QueryKeys } from "../queryKeys";
5+
6+
const useGetLanguageTestList = (params?: Record<string, any>) => {
7+
return useQuery<LanguageTestListResponse, AxiosError>({
8+
queryKey: [QueryKeys.admin.getLanguageTestList, params],
9+
queryFn: () => adminApi.getLanguageTestList({ params }),
10+
});
11+
};
12+
13+
export default useGetLanguageTestList;

src/apis/Admin/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export { default as api } from './api';
2+
export { default as get-getGpaList } from './get-getGpaList';
3+
export { default as get-getLanguageTestList } from './get-getLanguageTestList';
4+
export { default as put-putVerifyGpa } from './put-putVerifyGpa';
5+
export { default as put-putVerifyLanguageTest } from './put-putVerifyLanguageTest';

src/apis/Admin/put-putVerifyGpa.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { AxiosError } from "axios";
2+
import { useMutation } from "@tanstack/react-query";
3+
import { adminApi } from "./api";
4+
5+
const usePutVerifyGpa = () => {
6+
return useMutation<VerifyGpaResponse, AxiosError, VerifyGpaRequest>({
7+
mutationFn: (data) => adminApi.putVerifyGpa({ data }),
8+
});
9+
};
10+
11+
export default usePutVerifyGpa;
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { AxiosError } from "axios";
2+
import { useMutation } from "@tanstack/react-query";
3+
import { adminApi } from "./api";
4+
5+
const usePutVerifyLanguageTest = () => {
6+
return useMutation<VerifyLanguageTestResponse, AxiosError, VerifyLanguageTestRequest>({
7+
mutationFn: (data) => adminApi.putVerifyLanguageTest({ data }),
8+
});
9+
};
10+
11+
export default usePutVerifyLanguageTest;

src/apis/Auth/api.ts

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
import { axiosInstance } from "@/utils/axiosInstance";
2+
3+
export type SignOutResponse = Record<string, never>;
4+
5+
export type SignOutRequest = Record<string, never>;
6+
7+
export interface AppleAuthResponse {
8+
isRegistered: boolean;
9+
nickname: null;
10+
email: string;
11+
profileImageUrl: null;
12+
signUpToken: string;
13+
}
14+
15+
export type AppleAuthRequest = Record<string, never>;
16+
17+
export interface RefreshTokenResponse {
18+
accessToken: string;
19+
}
20+
21+
export type RefreshTokenRequest = Record<string, never>;
22+
23+
export interface EmailLoginResponse {
24+
accessToken: string;
25+
refreshToken: string;
26+
}
27+
28+
export type EmailLoginRequest = Record<string, never>;
29+
30+
export interface EmailVerificationResponse {
31+
signUpToken: string;
32+
}
33+
34+
export type EmailVerificationRequest = Record<string, never>;
35+
36+
export interface KakaoAuthResponse {
37+
isRegistered: boolean;
38+
nickname: string;
39+
email: string;
40+
profileImageUrl: string;
41+
signUpToken: string;
42+
}
43+
44+
export type KakaoAuthRequest = Record<string, never>;
45+
46+
export type AccountResponse = void;
47+
48+
export interface SignUpResponse {
49+
accessToken: string;
50+
refreshToken: string;
51+
}
52+
53+
export type SignUpRequest = Record<string, never>;
54+
55+
export const authApi = {
56+
postSignOut: async (params: { data?: SignOutRequest }): Promise<SignOutResponse> => {
57+
const res = await axiosInstance.post<SignOutResponse>(
58+
`{`, params?.data
59+
);
60+
return res.data;
61+
},
62+
63+
postAppleAuth: async (params: { data?: AppleAuthRequest }): Promise<AppleAuthResponse> => {
64+
const res = await axiosInstance.post<AppleAuthResponse>(
65+
`{`, params?.data
66+
);
67+
return res.data;
68+
},
69+
70+
postRefreshToken: async (params: { data?: RefreshTokenRequest }): Promise<RefreshTokenResponse> => {
71+
const res = await axiosInstance.post<RefreshTokenResponse>(
72+
`{`, params?.data
73+
);
74+
return res.data;
75+
},
76+
77+
postEmailLogin: async (params: { data?: EmailLoginRequest }): Promise<EmailLoginResponse> => {
78+
const res = await axiosInstance.post<EmailLoginResponse>(
79+
`{`, params?.data
80+
);
81+
return res.data;
82+
},
83+
84+
postEmailVerification: async (params: { data?: EmailVerificationRequest }): Promise<EmailVerificationResponse> => {
85+
const res = await axiosInstance.post<EmailVerificationResponse>(
86+
`{`, params?.data
87+
);
88+
return res.data;
89+
},
90+
91+
postKakaoAuth: async (params: { data?: KakaoAuthRequest }): Promise<KakaoAuthResponse> => {
92+
const res = await axiosInstance.post<KakaoAuthResponse>(
93+
`{`, params?.data
94+
);
95+
return res.data;
96+
},
97+
98+
deleteAccount: async (): Promise<AccountResponse> => {
99+
const res = await axiosInstance.delete<AccountResponse>(
100+
`{`
101+
);
102+
return res.data;
103+
},
104+
105+
postSignUp: async (params: { data?: SignUpRequest }): Promise<SignUpResponse> => {
106+
const res = await axiosInstance.post<SignUpResponse>(
107+
`{`, params?.data
108+
);
109+
return res.data;
110+
},
111+
112+
};
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { AxiosError } from "axios";
2+
import { useMutation } from "@tanstack/react-query";
3+
import { authApi } from "./api";
4+
5+
const useDeleteAccount = () => {
6+
return useMutation<AccountResponse, AxiosError, AccountRequest>({
7+
mutationFn: (data) => authApi.deleteAccount({ data }),
8+
});
9+
};
10+
11+
export default useDeleteAccount;

src/apis/Auth/index.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
export { default as api } from './api';
2+
export { default as delete-deleteAccount } from './delete-deleteAccount';
3+
export { default as post-postAppleAuth } from './post-postAppleAuth';
4+
export { default as post-postEmailLogin } from './post-postEmailLogin';
5+
export { default as post-postEmailVerification } from './post-postEmailVerification';
6+
export { default as post-postKakaoAuth } from './post-postKakaoAuth';
7+
export { default as post-postRefreshToken } from './post-postRefreshToken';
8+
export { default as post-postSignOut } from './post-postSignOut';
9+
export { default as post-postSignUp } from './post-postSignUp';
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { AxiosError } from "axios";
2+
import { useMutation } from "@tanstack/react-query";
3+
import { authApi } from "./api";
4+
5+
const usePostAppleAuth = () => {
6+
return useMutation<AppleAuthResponse, AxiosError, AppleAuthRequest>({
7+
mutationFn: (data) => authApi.postAppleAuth({ data }),
8+
});
9+
};
10+
11+
export default usePostAppleAuth;

0 commit comments

Comments
 (0)