From e2e0d99656380f14feeadcfa5a792dff4bcb3aff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=96=E5=85=AE=E5=86=89?= <15550273+wang-shengfa-11@user.noreply.gitee.com> Date: Mon, 6 Oct 2025 23:14:48 +0800 Subject: [PATCH] =?UTF-8?q?v1.0=20=E5=A4=A7=E6=A6=82=E7=9A=84=E6=A1=86?= =?UTF-8?q?=E6=9E=B6=E5=B7=B2=E7=BB=8F=E5=86=99=E5=A5=BD=EF=BC=8C=E6=9C=AA?= =?UTF-8?q?=E4=B8=8E=E5=90=8E=E7=AB=AF=E5=AF=B9=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 4 +- src/main/java/com/wsf/mathapp/App.java | 97 ----------- src/main/java/com/wsf/mathapp/Main.java | 17 ++ .../com/wsf/mathapp/controller/Login.fxml | 23 --- .../mathapp/controller/LoginController.java | 75 -------- .../wsf/mathapp/controller/SceneManager.java | 69 ++++++++ .../com/wsf/mathapp/service/EmailService.java | 79 +++++++++ .../wsf/mathapp/service/QuestionService.java | 34 ++++ .../com/wsf/mathapp/service/UserService.java | 81 +++++++++ .../wsf/mathapp/view/LevelSelectionView.java | 77 +++++++++ .../java/com/wsf/mathapp/view/LoginView.java | 97 +++++++++++ .../com/wsf/mathapp/view/MainMenuView.java | 112 ++++++++++++ .../wsf/mathapp/view/QuestionCountView.java | 100 +++++++++++ .../java/com/wsf/mathapp/view/QuizView.java | 148 ++++++++++++++++ .../com/wsf/mathapp/view/RegisterView.java | 160 ++++++++++++++++++ .../java/com/wsf/mathapp/view/ResultView.java | 102 +++++++++++ .../java/com/ybw/mathapp/entity/User.java | 9 +- .../com/ybw/mathapp/service/FileHandler.java | 2 +- .../mathapp/service/QuestionDeduplicator.java | 2 +- 19 files changed, 1087 insertions(+), 201 deletions(-) delete mode 100644 src/main/java/com/wsf/mathapp/App.java create mode 100644 src/main/java/com/wsf/mathapp/Main.java delete mode 100644 src/main/java/com/wsf/mathapp/controller/Login.fxml delete mode 100644 src/main/java/com/wsf/mathapp/controller/LoginController.java create mode 100644 src/main/java/com/wsf/mathapp/controller/SceneManager.java create mode 100644 src/main/java/com/wsf/mathapp/service/EmailService.java create mode 100644 src/main/java/com/wsf/mathapp/service/QuestionService.java create mode 100644 src/main/java/com/wsf/mathapp/service/UserService.java create mode 100644 src/main/java/com/wsf/mathapp/view/LevelSelectionView.java create mode 100644 src/main/java/com/wsf/mathapp/view/LoginView.java create mode 100644 src/main/java/com/wsf/mathapp/view/MainMenuView.java create mode 100644 src/main/java/com/wsf/mathapp/view/QuestionCountView.java create mode 100644 src/main/java/com/wsf/mathapp/view/QuizView.java create mode 100644 src/main/java/com/wsf/mathapp/view/RegisterView.java create mode 100644 src/main/java/com/wsf/mathapp/view/ResultView.java diff --git a/pom.xml b/pom.xml index 56d7799..67d77d6 100644 --- a/pom.xml +++ b/pom.xml @@ -156,14 +156,14 @@ 0.0.8 - com.wsf.mathapp.App + com.wsf.mathapp.Main default-cli - com.wsf.mathapp.App + com.wsf.mathapp.Main diff --git a/src/main/java/com/wsf/mathapp/App.java b/src/main/java/com/wsf/mathapp/App.java deleted file mode 100644 index 8df2322..0000000 --- a/src/main/java/com/wsf/mathapp/App.java +++ /dev/null @@ -1,97 +0,0 @@ -// src/main/java/com/wsf/mathapp/App.java -package com.wsf.mathapp; - -import com.wsf.mathapp.controller.LoginController; -import javafx.application.Application; -import javafx.fxml.FXMLLoader; -import javafx.scene.Parent; -import javafx.scene.Scene; -import javafx.stage.Stage; -import java.io.IOException; - -public class App extends Application { - - private Stage primaryStage; - - @Override - public void start(Stage primaryStage) throws IOException { - this.primaryStage = primaryStage; - this.primaryStage.setTitle("数学学习软件"); - - showLoginScene(); - } - - public void showLoginScene() throws IOException { - FXMLLoader loader = new FXMLLoader(getClass().getResource("/com/wsf/mathapp/view/fxml/login.fxml")); - Parent root = loader.load(); - LoginController controller = loader.getController(); - controller.setApp(this); - - Scene scene = new Scene(root); - scene.getStylesheets().add(getClass().getResource("/com/wsf/mathapp/view/css/styles.css").toExternalForm()); - primaryStage.setScene(scene); - primaryStage.show(); - } - - public void showRegisterScene() throws IOException { - FXMLLoader loader = new FXMLLoader(getClass().getResource("/com/wsf/mathapp/view/fxml/register.fxml")); - Parent root = loader.load(); - - Scene scene = new Scene(root); - scene.getStylesheets().add(getClass().getResource("/com/wsf/mathapp/view/css/styles.css").toExternalForm()); - primaryStage.setScene(scene); - } - - public void showSetPasswordScene(String email) throws IOException { - FXMLLoader loader = new FXMLLoader(getClass().getResource("/com/wsf/mathapp/view/fxml/set_password.fxml")); - Parent root = loader.load(); - // Pass email to SetPasswordController if needed - // SetPasswordController controller = loader.getController(); - // controller.setEmail(email); - - Scene scene = new Scene(root); - scene.getStylesheets().add(getClass().getResource("/com/wsf/mathapp/view/css/styles.css").toExternalForm()); - primaryStage.setScene(scene); - } - - public void showGradeSelectionScene() throws IOException { - FXMLLoader loader = new FXMLLoader(getClass().getResource("/com/wsf/mathapp/view/fxml/grade_selection.fxml")); - Parent root = loader.load(); - - Scene scene = new Scene(root); - scene.getStylesheets().add(getClass().getResource("/com/wsf/mathapp/view/css/styles.css").toExternalForm()); - primaryStage.setScene(scene); - } - - public void showQuestionScene(java.util.List questions) throws IOException { - FXMLLoader loader = new FXMLLoader(getClass().getResource("/com/wsf/mathapp/view/fxml/question.fxml")); - Parent root = loader.load(); - com.wsf.mathapp.controller.QuestionController controller = loader.getController(); - controller.setApp(this); - controller.setQuestions(questions); - - Scene scene = new Scene(root); - scene.getStylesheets().add(getClass().getResource("/com/wsf/mathapp/view/css/styles.css").toExternalForm()); - primaryStage.setScene(scene); - } - - public void showResultScene(com.wsf.mathapp.model.QuizResult result) throws IOException { - FXMLLoader loader = new FXMLLoader(getClass().getResource("/com/wsf/mathapp/view/fxml/result.fxml")); - Parent root = loader.load(); - com.wsf.mathapp.controller.ResultController controller = loader.getController(); - controller.setApp(this); - controller.setResult(result); - - Scene scene = new Scene(root); - scene.getStylesheets().add(getClass().getResource("/com/wsf/mathapp/view/css/styles.css").toExternalForm()); - primaryStage.setScene(scene); - } - - public Stage getPrimaryStage() { - return primaryStage; - } - - public static void main(String[] args) { - launch(); - } -} \ No newline at end of file diff --git a/src/main/java/com/wsf/mathapp/Main.java b/src/main/java/com/wsf/mathapp/Main.java new file mode 100644 index 0000000..21c2960 --- /dev/null +++ b/src/main/java/com/wsf/mathapp/Main.java @@ -0,0 +1,17 @@ +package com.wsf.mathapp; + +import com.wsf.mathapp.controller.SceneManager; +import javafx.application.Application; +import javafx.stage.Stage; + +public class Main extends Application { + @Override + public void start(Stage primaryStage) { + SceneManager sceneManager = new SceneManager(primaryStage); + sceneManager.showLoginView(); + } + + public static void main(String[] args) { + launch(args); + } +} \ No newline at end of file diff --git a/src/main/java/com/wsf/mathapp/controller/Login.fxml b/src/main/java/com/wsf/mathapp/controller/Login.fxml deleted file mode 100644 index 14309c8..0000000 --- a/src/main/java/com/wsf/mathapp/controller/Login.fxml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - -