From a34168ef759d06b739f7fef09c453834797f4ecb Mon Sep 17 00:00:00 2001 From: meowrain Date: Mon, 26 Jan 2026 23:12:53 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E6=B5=81=E6=8E=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/CoolRequestCommonStatePersistent.xml | 2 +- .idea/dataSources.xml | 20 +++++++++++++++++++ .idea/db-forest-config.xml | 2 +- .idea/easyCodeTableSettingEncode.xml | 10 ++++++++++ .idea/mybatisx/templates.xml | 4 ++-- .../controller/QuestionSubmitController.java | 8 ++++++-- 6 files changed, 40 insertions(+), 6 deletions(-) create mode 100644 .idea/easyCodeTableSettingEncode.xml diff --git a/.idea/CoolRequestCommonStatePersistent.xml b/.idea/CoolRequestCommonStatePersistent.xml index 3977fa2..0c78ed0 100644 --- a/.idea/CoolRequestCommonStatePersistent.xml +++ b/.idea/CoolRequestCommonStatePersistent.xml @@ -1,6 +1,6 @@ - \ No newline at end of file diff --git a/.idea/dataSources.xml b/.idea/dataSources.xml index 51539bf..0a00e03 100644 --- a/.idea/dataSources.xml +++ b/.idea/dataSources.xml @@ -81,5 +81,25 @@ jdbc:mysql://10.0.0.10/aioj_dev $ProjectFileDir$ + + mysql.8 + true + com.mysql.cj.jdbc.Driver + jdbc:mysql://10.0.0.10:3306 + + + + + + $ProjectFileDir$ + + + mysql.8 + true + true + com.mysql.cj.jdbc.Driver + jdbc:mysql://10.0.0.10/aioj_dev + $ProjectFileDir$ + \ No newline at end of file diff --git a/.idea/db-forest-config.xml b/.idea/db-forest-config.xml index b949d63..a5a136e 100644 --- a/.idea/db-forest-config.xml +++ b/.idea/db-forest-config.xml @@ -1,6 +1,6 @@ - \ No newline at end of file diff --git a/.idea/easyCodeTableSettingEncode.xml b/.idea/easyCodeTableSettingEncode.xml new file mode 100644 index 0000000..9cff99a --- /dev/null +++ b/.idea/easyCodeTableSettingEncode.xml @@ -0,0 +1,10 @@ + + + + + + \ No newline at end of file diff --git a/.idea/mybatisx/templates.xml b/.idea/mybatisx/templates.xml index 404329d..884182e 100644 --- a/.idea/mybatisx/templates.xml +++ b/.idea/mybatisx/templates.xml @@ -68,8 +68,8 @@ diff --git a/aioj-backend-question-service/src/main/java/cn/meowrain/aioj/backend/question/controller/QuestionSubmitController.java b/aioj-backend-question-service/src/main/java/cn/meowrain/aioj/backend/question/controller/QuestionSubmitController.java index abaf9d6..8e84bb3 100644 --- a/aioj-backend-question-service/src/main/java/cn/meowrain/aioj/backend/question/controller/QuestionSubmitController.java +++ b/aioj-backend-question-service/src/main/java/cn/meowrain/aioj/backend/question/controller/QuestionSubmitController.java @@ -1,5 +1,6 @@ package cn.meowrain.aioj.backend.question.controller; +import cn.meowrain.aioj.backend.framework.core.errorcode.ErrorCode; import cn.meowrain.aioj.backend.framework.core.web.Result; import cn.meowrain.aioj.backend.framework.core.web.Results; import cn.meowrain.aioj.backend.question.dao.entity.QuestionSubmit; @@ -42,9 +43,12 @@ public class QuestionSubmitController { return Results.success(submitId); } - public String handleException(BlockException ex) { + public Result handleException(QuestionSubmitRequestDTO request, BlockException ex) { System.out.println("被限流了: " + ex.getClass().getCanonicalName()); - return "系统繁忙,请稍后再试!(这是自定义的限流提示)"; + + // 假设你的 Results 工具类支持返回错误信息 + // 这里的 code (比如 429) 和 message 根据你的 Result 结构来定 + return Results.failure(ErrorCode.API_REQUEST_ERROR.code(),"系统繁忙,请稍后再试!(这是自定义的限流提示)"); } /**