<?php
/**
 * Created by PhpStorm.
 * User: youwl
 * Date: 2021/7/7
 * Time: 10:32
 */

namespace App\Web\Providers;

use App\Providers\EventServiceProvider;
use App\Web\Components\Help\HelpList;
use App\Web\Facades\BlogFacade;
use App\Web\Facades\BlogRenderFacade;
use App\Web\Facades\DictFacade;
use App\Web\Facades\HelpFacade;
use App\Web\Facades\MeetingFacade;
use App\Web\Facades\ProductFacade;
use App\Web\Facades\SuccessCaseFacade;
use App\Web\Facades\SysGlobalConfigFacade;
use App\Web\Facades\WebFacade;
use App\Web\Services\BlogRenderService;
use App\Web\Services\BlogService;
use App\Web\Services\DictService;
use App\Web\Services\GlobalConfigService;
use App\Web\Services\HelpService;
use App\Web\Services\MeetingService;
use App\Web\Services\ProductService;
use App\Web\Services\SuccessCaseService;
use App\Web\Services\WebService;
use Illuminate\Support\Facades\Blade;

class WebServiceProvider extends EventServiceProvider
{

    /**
     * 注册绑定门面
     */
    public function register()
    {
        $this->registerBlog();
        $this->registerWeb();
        $this->registerGlobalConfig();
        $this->registerHelp();
        $this->registerSuccessCase();
        $this->registerDict();
        $this->registerProduct();
        $this->registerMeeting();
    }

    //注册文章服务
    protected function registerBlog(){

        $this->app->bind(BlogFacade::class, function () {
            return app()->make(BlogService::class);
        });

        $this->app->bind(BlogRenderFacade::class, function () {
            return app()->make(BlogRenderService::class);
        });
    }

    //注册文章服务
    protected function registerWeb(){

        $this->app->bind(WebFacade::class, function () {
            return app()->make(WebService::class);
        });
    }

    //注册全局配置
    protected function registerGlobalConfig(){

        $this->app->bind(SysGlobalConfigFacade::class, function () {
            return app()->make(GlobalConfigService::class);
        });
    }

    //注册Help
    protected function registerHelp(){

        $this->app->bind(HelpFacade::class, function () {
            return app()->make(HelpService::class);
        });
    }

    //注册Dict
    protected function registerDict(){

        $this->app->bind(DictFacade::class, function () {
            return app()->make(DictService::class);
        });
    }

    //注册SuccessCase
    protected function registerSuccessCase(){

        $this->app->bind(SuccessCaseFacade::class, function () {
            return app()->make(SuccessCaseService::class);
        });
    }


    //注册Product
    protected function registerProduct(){

        $this->app->bind(ProductFacade::class, function () {
            return app()->make(ProductService::class);
        });
    }

    //Meeting
    protected function registerMeeting(){

        $this->app->bind(MeetingFacade::class, function () {
            return app()->make(MeetingService::class);
        });
    }


}
