<?php
declare (strict_types=1);

namespace app;

use app\http\middleware\ContextMiddleware;
use app\http\middleware\HttpLogMiddleware;
use think\Service;

/**
 * 应用服务类
 */
class AppService extends Service
{
    public function register(): void
    {
        // 上下文中间件放在最前面
        $this->app->middleware->unshift(ContextMiddleware::class, 'route');
        // HTTP日志记录中间件
        $this->app->middleware->add(HttpLogMiddleware::class, 'route');
    }
}
