Quellcode durchsuchen

Merge branch '20250522_diywebfr'

15313670163 vor 20 Stunden
Ursprung
Commit
86e776a8c6

+ 13 - 0
app/JsonRpc/PublicRpcService.php

@@ -44,6 +44,7 @@ use App\Model\WebsiteImg;
 use App\Model\SectorComponent;
 use App\Model\ComponentImg;
 use App\Model\TemplateRule;
+use App\Model\SectorType;
 
 #[RpcService(name: "PublicRpcService", protocol: "jsonrpc-http", server: "jsonrpc-http")]
 class PublicRpcService implements PublicRpcServiceInterface
@@ -2676,6 +2677,18 @@ class PublicRpcService implements PublicRpcServiceInterface
         }
         return Result::success($component_img);
     }
+    /**
+     * 自助建站-获取通栏类型
+     */
+    public function getSectorType(array $data): array
+    {
+        $sector = SectorType::get()->all();
+        if(empty($sector)){
+            return Result::error('通栏类型不存在!');
+        }
+        return Result::success($sector);
+    }
+
     /**
      * 自助建站-随机生成模板
      */

+ 2 - 0
app/JsonRpc/PublicRpcServiceInterface.php

@@ -211,6 +211,8 @@ interface PublicRpcServiceInterface
     public function updateComponentImg(array $data): array;
     //自助建站-随机生成模板
     // public function randomWebTemplate(array $data): array;
+    //自助建站-获取通栏类型
+    public function getSectorType(array $data): array;
 
 
 

+ 27 - 0
app/Model/SectorType.php

@@ -0,0 +1,27 @@
+<?php
+
+declare(strict_types=1);
+
+namespace App\Model;
+
+use Hyperf\DbConnection\Model\Model;
+
+/**
+ */
+class SectorType extends Model
+{
+    /**
+     * The table associated with the model.
+     */
+    protected ?string $table = 'sector_type';
+
+    /**
+     * The attributes that are mass assignable.
+     */
+    protected array $fillable = [];
+
+    /**
+     * The attributes that should be cast to native types.
+     */
+    protected array $casts = [];
+}