<?php
/**
 *
 * @author：llbjj
 * @DateTime：2022/5/4 19:28
 * @Description：
 *
 */
namespace Application;

use Application\Factory\RedisExtendFactory;
use Application\Factory\ServiceFactory;
use Application\Service\Baidu\Ocr;
use Application\Service\Extension\Helper\SDMHelper;
use Application\Service\Extension\Wechat\WechatWork;
use Application\Service\Extension\Formatter\Formatter;
use Application\Service\Extension\HttpException;
use Application\Service\Extension\Identity\Identity;
use Application\Service\Extension\Sms\SmsApplication;
use Application\Service\Extension\Uploader\ImageUploader;
use Application\Service\Extension\CommonServiceFactory;
use Application\Service\Extension\Wechat\Wechat;
use Application\Service\HttpSv;
use Application\Service\Logic\form\CheckFormLogic;
use Application\Service\Login\LoginClient;
use Application\Service\Logs;
use Application\Service\OA\OaClient;
use Application\Service\ToolSys\SyncOcrAnnex;
use Application\Service\ToolSys\ToolSys;
use Zend\Stdlib\ArrayUtils;
use Application\SdmWork\WorkUser;

$dbServerConfig = include __DIR__ . "/db.server.config.php";
$CommandServiceConfig = include __DIR__ . "/command.service.config.php";
$serverConfig = [
    'aliases'  => [
        'redisExtend' => Service\Redis\RedisExtend::class,
        'imageUploader' => ImageUploader::class,
        'wechat' => Wechat::class,
        'sms' => SmsApplication::class,
        'identity' => Identity::class,
        'formatter' => Formatter::class,
        'log' => Logs::class,
        'httpSv' => HttpSv::class,
        'wechatWork' => WechatWork::class,
        'workUser' => WorkUser::class,
        'ocr' => Ocr::class,
        'toolSys' => ToolSys::class,
        'syncOcrAnnex' => SyncOcrAnnex::class,
        'SDMHelper' => SDMHelper::class,
        'OAClient' => OaClient::class,
        'CheckFormLogic' => CheckFormLogic::class,
        'loginClient' => LoginClient::class,
    ],
    'factories' => [
        // 全局的异常处理
        'HttpExceptionStrategy'=> HttpException::class,
        Wechat::class => CommonServiceFactory::class,
        SmsApplication::class => CommonServiceFactory::class,
        Service\Redis\RedisExtend::class => RedisExtendFactory::class,
        ImageUploader::class => CommonServiceFactory::class,
        Identity::class => CommonServiceFactory::class,
        Logs::class => ServiceFactory::class,
        Formatter::class => CommonServiceFactory::class,
        HttpSv::class => ServiceFactory::class,
        WechatWork::class => ServiceFactory::class,
        WorkUser::class => ServiceFactory::class,
        Ocr::class => ServiceFactory::class,
        ToolSys::class =>ServiceFactory::class,
        SyncOcrAnnex::class => ServiceFactory::class,
        SDMHelper::class => ServiceFactory::class,
        OaClient::class => ServiceFactory::class,
        CheckFormLogic::class => ServiceFactory::class,
        LoginClient::class => ServiceFactory::class,
    ]
];

$serverConfig = ArrayUtils::merge($serverConfig, $dbServerConfig);
return ArrayUtils::merge($serverConfig, $CommandServiceConfig);
