From 7c6c3919a95c1f228eec2ac7589c6bbf4359d7f2 Mon Sep 17 00:00:00 2001 From: slhmy <1484836413@qq.com> Date: Sat, 10 Aug 2024 12:43:30 +0800 Subject: [PATCH] Tidy project structure --- index.html | 46 +++++++++---------- src/App.tsx | 6 +-- src/{index.css => Index.css} | 0 src/{index.tsx => Index.tsx} | 41 ++++++++--------- src/{routes => }/Router.tsx | 24 ++++------ src/{api => apis}/auth.ts | 12 +++-- src/{api => apis}/event.ts | 0 src/{api => apis}/judge.ts | 10 ++-- src/{api => apis}/problem.ts | 17 ++++--- src/components/JudgeVerdictTable.tsx | 2 +- src/components/i18n/LanguageMenu.tsx | 4 +- src/components/judge/JudgeDetail.tsx | 2 +- src/components/judge/JudgeTable.tsx | 10 ++-- src/components/problem/ProblemTable.tsx | 4 +- src/hooks/event.ts | 2 +- src/hooks/judge.ts | 4 +- src/hooks/problem.ts | 4 +- src/hooks/user.ts | 4 +- src/i18n/{i18n.ts => module.ts} | 4 +- src/i18n/{ => resources}/en_US.ts | 0 src/i18n/{ => resources}/zh_CN.ts | 0 src/layouts/Menu.tsx | 2 +- src/mocks/data/problem.ts | 2 +- src/mocks/{rest => handlers}/judge.ts | 2 +- src/mocks/{rest => handlers}/problem.ts | 2 +- src/mocks/{rest => handlers}/user.ts | 0 src/mocks/server.ts | 4 -- src/mocks/{handlers.ts => worker.ts} | 11 +++-- src/models/service/judge.ts | 29 ++++++++++++ src/models/service/problem.ts | 12 +++++ src/models/service/user.ts | 6 +++ src/models/view/judge.ts | 6 +++ src/pages/Login.tsx | 2 +- .../CreateProblem.tsx | 2 +- .../ProblemList.tsx | 0 src/pipes/judge.ts | 7 +-- src/react-app-env.d.ts | 1 - src/typings/judge.ts | 40 ---------------- src/typings/problem.ts | 14 ------ src/typings/user.ts | 8 ---- src/utils/{avatar_url.ts => avatarURL.ts} | 0 src/{api/client.ts => utils/axiosClient.ts} | 2 +- src/utils/environment.ts | 6 +-- src/{pipes/common.ts => utils/unit.ts} | 0 tsconfig.json | 21 +++++++-- 45 files changed, 186 insertions(+), 189 deletions(-) rename src/{index.css => Index.css} (100%) rename src/{index.tsx => Index.tsx} (51%) rename src/{routes => }/Router.tsx (69%) rename src/{api => apis}/auth.ts (64%) rename src/{api => apis}/event.ts (100%) rename src/{api => apis}/judge.ts (74%) rename src/{api => apis}/problem.ts (78%) rename src/i18n/{i18n.ts => module.ts} (90%) rename src/i18n/{ => resources}/en_US.ts (100%) rename src/i18n/{ => resources}/zh_CN.ts (100%) rename src/mocks/{rest => handlers}/judge.ts (97%) rename src/mocks/{rest => handlers}/problem.ts (97%) rename src/mocks/{rest => handlers}/user.ts (100%) delete mode 100644 src/mocks/server.ts rename src/mocks/{handlers.ts => worker.ts} (51%) create mode 100644 src/models/service/judge.ts create mode 100644 src/models/service/problem.ts create mode 100644 src/models/service/user.ts create mode 100644 src/models/view/judge.ts rename src/pages/{admin-dashboard => admin}/CreateProblem.tsx (99%) rename src/pages/{admin-dashboard => admin}/ProblemList.tsx (100%) delete mode 100644 src/react-app-env.d.ts delete mode 100644 src/typings/judge.ts delete mode 100644 src/typings/problem.ts delete mode 100644 src/typings/user.ts rename src/utils/{avatar_url.ts => avatarURL.ts} (100%) rename src/{api/client.ts => utils/axiosClient.ts} (60%) rename src/{pipes/common.ts => utils/unit.ts} (100%) diff --git a/index.html b/index.html index 658eecbe9..bc4cd407b 100644 --- a/index.html +++ b/index.html @@ -1,29 +1,28 @@ -
- - - - - - - - - - -