#feature: add AI log analysis & some bugfix
This commit is contained in:
@@ -2,6 +2,19 @@
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use App\Clients\AgentClient;
|
||||
use App\Clients\AiClient;
|
||||
use App\Clients\MonoClient;
|
||||
use App\Clients\SlsClient;
|
||||
use App\Services\AiService;
|
||||
use App\Services\CodeContextService;
|
||||
use App\Services\ConfigService;
|
||||
use App\Services\DingTalkService;
|
||||
use App\Services\EnvService;
|
||||
use App\Services\GitMonitorService;
|
||||
use App\Services\JiraService;
|
||||
use App\Services\LogAnalysisService;
|
||||
use App\Services\SlsService;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
class AppServiceProvider extends ServiceProvider
|
||||
@@ -11,11 +24,22 @@ class AppServiceProvider extends ServiceProvider
|
||||
*/
|
||||
public function register(): void
|
||||
{
|
||||
// 注册应用服务
|
||||
$this->app->singleton(\App\Services\JiraService::class);
|
||||
$this->app->singleton(\App\Services\ConfigService::class);
|
||||
$this->app->singleton(\App\Services\DingTalkService::class);
|
||||
$this->app->singleton(\App\Services\GitMonitorService::class);
|
||||
// 注册 Clients
|
||||
$this->app->singleton(AgentClient::class);
|
||||
$this->app->singleton(MonoClient::class);
|
||||
$this->app->singleton(SlsClient::class);
|
||||
$this->app->singleton(AiClient::class, fn ($app) => new AiClient($app->make(ConfigService::class)));
|
||||
|
||||
// 注册 Services
|
||||
$this->app->singleton(ConfigService::class);
|
||||
$this->app->singleton(JiraService::class);
|
||||
$this->app->singleton(DingTalkService::class);
|
||||
$this->app->singleton(EnvService::class);
|
||||
$this->app->singleton(GitMonitorService::class);
|
||||
$this->app->singleton(SlsService::class);
|
||||
$this->app->singleton(AiService::class);
|
||||
$this->app->singleton(CodeContextService::class);
|
||||
$this->app->singleton(LogAnalysisService::class);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use App\Clients\AgentClient;
|
||||
use App\Clients\MonoClient;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
class ClientServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* Register services.
|
||||
*/
|
||||
public function register(): void
|
||||
{
|
||||
$this->app->singleton(AgentClient::class, function () {
|
||||
return new AgentClient();
|
||||
});
|
||||
|
||||
$this->app->singleton(MonoClient::class, function () {
|
||||
return new MonoClient();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Bootstrap services.
|
||||
*/
|
||||
public function boot(): void
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use App\Console\Commands\EnvCommand;
|
||||
|
||||
class EnvServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* 注册服务
|
||||
*/
|
||||
public function register(): void
|
||||
{
|
||||
// 注册环境管理服务
|
||||
$this->app->singleton(\App\Services\EnvService::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 启动服务
|
||||
*/
|
||||
public function boot(): void
|
||||
{
|
||||
// 注册Artisan命令
|
||||
if ($this->app->runningInConsole()) {
|
||||
$this->commands([
|
||||
EnvCommand::class,
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use App\Console\Commands\GitMonitorCacheCommand;
|
||||
use App\Console\Commands\GitMonitorCheckCommand;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
class GitMonitorServiceProvider extends ServiceProvider
|
||||
{
|
||||
public function register(): void
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
public function boot(): void
|
||||
{
|
||||
if ($this->app->runningInConsole()) {
|
||||
$this->commands([
|
||||
GitMonitorCheckCommand::class,
|
||||
GitMonitorCacheCommand::class,
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user