Browse Source

[智价云] 消息推送调试

tangyuanwang 3 days ago
parent
commit
a55cf617e7
2 changed files with 17 additions and 0 deletions
  1. 15 0
      app/Http/Controllers/Api/Wechat/OfficialNotify.php
  2. 2 0
      routes/api.php

+ 15 - 0
app/Http/Controllers/Api/Wechat/OfficialNotify.php

@@ -6,6 +6,7 @@ use App\Http\Controllers\Controller;
 use App\Models\Api\Personnel\EmployeeOpenid as EmployeeOpenidModel;
 use App\Facades\Servers\Logs\Log;
 use App\Servers\Wechat\Official;
+use App\Jobs\Manager\Process\SubscriptionJobs;
 
 class OfficialNotify extends Controller
 {
@@ -188,4 +189,18 @@ class OfficialNotify extends Controller
 
         return $array ?: [];
     }
+
+
+    /**
+     * 公众号测试消息订阅推送
+     * @author 唐远望
+     * @version 1.0
+     * @date 2026-03-10
+     */
+    public function test()
+    {
+        $message_data = ['notice_type'=>'low_price_goods'];
+        $response_data = SubscriptionJobs::dispatchSync($message_data);
+        return json_send(['code' => 'success', 'msg' => '执行成功', 'data' => $response_data]);
+    }
 }

+ 2 - 0
routes/api.php

@@ -31,6 +31,8 @@ Route::any('login/wechat_phone', [App\Http\Controllers\Api\Login::class, 'wechat
 
 //公众号订阅回调通知
 Route::any('wechat/official/callback', [App\Http\Controllers\Api\Wechat\OfficialNotify::class, 'callback']);
+//公众号测试推送
+Route::any('wechat/official/test', [App\Http\Controllers\Api\Wechat\OfficialNotify::class, 'test']);
 
 // ------违规处理------
 // 低价挂网商品违规处理-列表