seven há 6 dias atrás
pai
commit
e1a3d826a6
2 ficheiros alterados com 11 adições e 5 exclusões
  1. 3 3
      app/Http/Controllers/admin/GameplayRule.php
  2. 8 2
      routes/admin.php

+ 3 - 3
app/Http/Controllers/admin/GameplayRule.php

@@ -41,8 +41,8 @@ class GameplayRule extends Controller
     {
         try {
             request()->validate([
-                'title' => ['nullable', 'string'],
-                'permission_name' => ['nullable', 'string'],
+                'group' => ['nullable', 'string'],
+                'keywords' => ['nullable', 'string'],
             ]);
             $search = request()->all();
             $result = GameplayRuleService::paginate($search);
@@ -112,7 +112,7 @@ class GameplayRule extends Controller
         // 示例:通过 ID 删除菜单
         $info = GameplayRuleService::findOne(['id' => $id]);
         if (!$info) {
-            return $this->error(0, '角色不存在');
+            return $this->error(0, '玩法不存在');
         }
         GameplayRuleService::clearCache($info->keywords);
         $info->delete();

+ 8 - 2
routes/admin.php

@@ -28,8 +28,7 @@ Route::prefix('/sync')->group(function () {
     Route::get('/settle', [Sync::class, 'settle']);
 });
 
-Route::post('/gameplayRule', [GameplayRule::class, 'store']); // 游戏规则写入
-Route::get('/gameplayRule/cache', [GameplayRule::class, 'info']); // 游戏规则缓存读取
+
 Route::middleware(['admin.jwt'])->group(function () {
 
 
@@ -60,6 +59,13 @@ Route::middleware(['admin.jwt'])->group(function () {
             Route::post('/delete', [Issue::class, 'destroy']); // 删除
         });
 
+        // 玩法规则路由
+        Route::prefix('/gameplayRule')->group(function () {
+            Route::get('/', [GameplayRule::class, 'index']);
+            Route::post('/', [GameplayRule::class, 'store']); // 游戏规则写入
+            Route::get('/cache', [GameplayRule::class, 'info']); // 游戏规则缓存读取
+            Route::post('/delete', [GameplayRule::class, 'destroy']); // 删除
+        });
 
         Route::prefix('/withdraw')->group(function () {
             Route::get('/', [Withdraw::class, 'index']);