Bladeren bron

fix(api-v13): para 段落内容改为与 chapter 一致的 JSON 结构

visuddhinanda 5 dagen geleden
bovenliggende
commit
8e997a9e5a
1 gewijzigde bestanden met toevoegingen van 7 en 1 verwijderingen
  1. 7 1
      api-v13/app/Http/Controllers/CorpusController.php

+ 7 - 1
api-v13/app/Http/Controllers/CorpusController.php

@@ -18,6 +18,7 @@ use App\Models\SentSimIndex;
 use App\Models\Wbw;
 use App\Models\Wbw;
 use App\Models\WbwBlock;
 use App\Models\WbwBlock;
 use App\Services\AuthService;
 use App\Services\AuthService;
+use App\Services\PaliContentService;
 use Illuminate\Http\Request;
 use Illuminate\Http\Request;
 use Illuminate\Http\Response;
 use Illuminate\Http\Response;
 use Illuminate\Support\Arr;
 use Illuminate\Support\Arr;
@@ -356,7 +357,12 @@ class CorpusController extends Controller
         if (count($record) === 0) {
         if (count($record) === 0) {
             $this->result['content'] = '<span>No Data</span>';
             $this->result['content'] = '<span>No Data</span>';
         } else {
         } else {
-            $this->result['content'] = $this->makeContent($record, $request->get('mode', 'read'), $indexChannel, $indexedHeading, false, true);
+            $paliService = app(PaliContentService::class);
+            $this->result['content'] = json_encode(
+                $paliService->makeContentObj($record, $request->get('mode', 'read'), $indexChannel),
+                JSON_UNESCAPED_UNICODE
+            );
+            $this->result['content_type'] = 'json';
         }
         }
 
 
         return $this->ok($this->result);
         return $this->ok($this->result);