| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- <?php
- namespace App\Module\OpenAPI\Events;
- use App\Module\OpenAPI\Models\OpenApiApp;
- use Illuminate\Foundation\Events\Dispatchable;
- use Illuminate\Queue\SerializesModels;
- /**
- * 应用创建事件
- */
- class AppCreatedEvent
- {
- use Dispatchable, SerializesModels;
- /**
- * @var OpenApiApp
- */
- public OpenApiApp $app;
- /**
- * 创建新的事件实例
- *
- * @param OpenApiApp $app
- */
- public function __construct(OpenApiApp $app)
- {
- $this->app = $app;
- }
- /**
- * 获取应用信息
- *
- * @return OpenApiApp
- */
- public function getApp(): OpenApiApp
- {
- return $this->app;
- }
- /**
- * 获取应用ID
- *
- * @return string
- */
- public function getAppId(): string
- {
- return $this->app->app_id;
- }
- /**
- * 获取应用名称
- *
- * @return string
- */
- public function getAppName(): string
- {
- return $this->app->name;
- }
- /**
- * 获取创建用户ID
- *
- * @return int
- */
- public function getUserId(): int
- {
- return $this->app->user_id;
- }
- /**
- * 获取创建用户名称
- *
- * @return string
- */
- public function getUserName(): string
- {
- return $this->app->user_name;
- }
- }
|