bianjunhui 3 روز پیش
والد
کامیت
01c5f9a9fc

+ 7 - 5
packages/Longyi/Wholesale/README.md

@@ -144,7 +144,7 @@ Content-Type: application/json
 ```json
 {
     "success": true,
-    "message": "您的询盘已提交成功。",
+    "message": "Your enquiry has been submitted successfully.",
     "data": {
         "id": 1
     }
@@ -156,11 +156,13 @@ Content-Type: application/json
 ```json
 {
     "success": false,
-    "message": "错误信息",
+    "message": "Error message",
     "data": []
 }
 ```
 
+> 前台 API 的所有提示信息统一使用英文,不随当前语言(locale)变化。
+
 ### 防恶意提交
 
 接口内置了双重防护,防止恶意重复提交:
@@ -173,7 +175,7 @@ Content-Type: application/json
 ```json
 {
     "success": false,
-    "message": "提交过于频繁,请稍后再试。",
+    "message": "Too many requests. Please try again later.",
     "data": []
 }
 ```
@@ -183,12 +185,12 @@ Content-Type: application/json
 ```json
 {
     "success": false,
-    "message": "您已提交过询盘,请勿重复提交。",
+    "message": "You have already submitted an enquiry. Please try again later.",
     "data": []
 }
 ```
 
-> 阈值与窗口期通过 `WholesaleController` 中的常量 `MAX_ATTEMPTS`、`DECAY_SECONDS`、`DUPLICATE_SECONDS` 配置。
+> 阈值与窗口期通过 `WholesaleController` 中的常量 `MAX_ATTEMPTS`、`DECAY_SECONDS`、`DAILY_MAX_ATTEMPTS`、`DAILY_DECAY_SECONDS`、`DUPLICATE_SECONDS` 配置。
 
 ### 统一返回格式
 

+ 4 - 4
packages/Longyi/Wholesale/src/Http/Controllers/WholesaleController.php

@@ -50,7 +50,7 @@ class WholesaleController extends Controller
 
         if (RateLimiter::tooManyAttempts($throttleKey, self::MAX_ATTEMPTS)) {
             return ApiResponse::error(
-                trans('wholesale::app.shop.too-many-attempts'),
+                'Too many requests. Please try again later.',
                 [],
                 429
             );
@@ -61,7 +61,7 @@ class WholesaleController extends Controller
 
         if (RateLimiter::tooManyAttempts($dailyThrottleKey, self::DAILY_MAX_ATTEMPTS)) {
             return ApiResponse::error(
-                trans('wholesale::app.shop.too-many-attempts'),
+                'Too many requests. Please try again later.',
                 [],
                 429
             );
@@ -75,7 +75,7 @@ class WholesaleController extends Controller
 
         if (cache()->has($duplicateKey)) {
             return ApiResponse::error(
-                trans('wholesale::app.shop.duplicate-submission'),
+                'You have already submitted an enquiry. Please try again later.',
                 [],
                 429
             );
@@ -107,7 +107,7 @@ class WholesaleController extends Controller
 
             return ApiResponse::success([
                 'id' => $message->message_id,
-            ], trans('wholesale::app.shop.success'));
+            ], 'Your enquiry has been submitted successfully.');
         } catch (\Exception $e) {
             return ApiResponse::error($e->getMessage());
         }

+ 0 - 6
packages/Longyi/Wholesale/src/Resources/lang/en/app.php

@@ -1,12 +1,6 @@
 <?php
 
 return [
-    'shop' => [
-        'success'              => 'Your enquiry has been submitted successfully.',
-        'too-many-attempts'    => 'Too many submissions. Please try again later.',
-        'duplicate-submission' => 'You have already submitted an enquiry. Please wait before submitting again.',
-    ],
-
     'admin' => [
         'menu-title'     => 'Wholesale',
         'page-title'     => 'Wholesale Enquiries',

+ 0 - 6
packages/Longyi/Wholesale/src/Resources/lang/zh_CN/app.php

@@ -1,12 +1,6 @@
 <?php
 
 return [
-    'shop' => [
-        'success'              => '您的询盘已提交成功。',
-        'too-many-attempts'    => '提交过于频繁,请稍后再试。',
-        'duplicate-submission' => '您已提交过询盘,请勿重复提交。',
-    ],
-
     'admin' => [
         'menu-title'     => '批发询盘',
         'page-title'     => '批发询盘列表',