WebSettingHtmlController.php 1.1 KB
<?php

namespace App\Http\Controllers\Bside\Setting;

use App\Enums\Common\Code;
use App\Http\Controllers\Bside\BaseController;
use App\Http\Logic\Bside\Setting\WebSettingHtmlLogic;

/**
 * @name:第三方代码设置
 */
class WebSettingHtmlController extends BaseController
{
    /**
     * @name   :(获取并设置第三方代码)read
     * @param  :(head_html,body_html,footer_html)
     * @author :lyh
     * @method :post
     * @time   :2023/4/28 14:45
     */
    public function save(WebSettingHtmlLogic $webSettingHtmlLogic){
        if(isset($this->param) && !empty($this->param)){
            $this->request->validate([
                'head_html'=>'required',
                'body_html'=>'required',
                'footer_html'=>'required'
            ],[
                'head_html.required' => 'head_html不能为空',
                'body_html.required' => 'body_html不能为空',
                'footer_html.required' => 'footer_html不能为空'
            ]);
        }
        $info = $webSettingHtmlLogic->setting_html_save();
        $this->response('success',Code::SUCCESS,$info);
    }
}