|
|
@@ -46,6 +46,7 @@ use App\Model\SectorComponent;
|
|
|
use App\Model\ComponentImg;
|
|
|
use App\Model\TemplateRule;
|
|
|
use App\Model\SectorType;
|
|
|
+use App\Model\StyleCode;
|
|
|
|
|
|
#[RpcService(name: "PublicRpcService", protocol: "jsonrpc-http", server: "jsonrpc-http")]
|
|
|
class PublicRpcService implements PublicRpcServiceInterface
|
|
|
@@ -2925,6 +2926,30 @@ class PublicRpcService implements PublicRpcServiceInterface
|
|
|
}
|
|
|
return Result::success($sector);
|
|
|
}
|
|
|
+ /**
|
|
|
+ * 自助建站-添加样式代码
|
|
|
+ */
|
|
|
+ public function addStyleCode(array $data): array
|
|
|
+ {
|
|
|
+ unset($data['status']);
|
|
|
+ $style_code = StyleCode::insertGetId($data);
|
|
|
+ if(empty($style_code)){
|
|
|
+ return Result::error('添加失败!');
|
|
|
+ }
|
|
|
+ return Result::success($style_code);
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * 自助建站-获取样式代码
|
|
|
+ */
|
|
|
+ public function getStyleCode(array $data): array
|
|
|
+ {
|
|
|
+ unset($data['status']);
|
|
|
+ $style_code = StyleCode::get()->all();
|
|
|
+ if(empty($style_code)){
|
|
|
+ return Result::error('样式代码不存在!');
|
|
|
+ }
|
|
|
+ return Result::success($style_code);
|
|
|
+ }
|
|
|
|
|
|
|
|
|
}
|