mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-14 20:40:49 +08:00
API: torrents upload/list
This commit is contained in:
44
app/Enums/ModelEventEnum.php
Normal file
44
app/Enums/ModelEventEnum.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace App\Enums;
|
||||
|
||||
use App\Events\NewsCreated;
|
||||
use App\Events\TorrentCreated;
|
||||
use App\Events\TorrentDeleted;
|
||||
use App\Events\TorrentUpdated;
|
||||
use App\Events\UserCreated;
|
||||
use App\Events\UserDeleted;
|
||||
use App\Events\UserDisabled;
|
||||
use App\Events\UserEnabled;
|
||||
use App\Events\UserUpdated;
|
||||
use App\Models\News;
|
||||
use App\Models\Torrent;
|
||||
use App\Models\User;
|
||||
|
||||
final class ModelEventEnum {
|
||||
const TORRENT_CREATED = 'torrent_created';
|
||||
const TORRENT_UPDATED = 'torrent_updated';
|
||||
const TORRENT_DELETED = 'torrent_deleted';
|
||||
|
||||
const USER_CREATED = 'user_created';
|
||||
const USER_UPDATED = 'user_updated';
|
||||
const USER_DELETED = 'user_deleted';
|
||||
const USER_ENABLED = 'user_enabled';
|
||||
const USER_DISABLED = 'user_disabled';
|
||||
|
||||
const NEWS_CREATED = 'news_created';
|
||||
|
||||
public static array $eventMaps = [
|
||||
self::TORRENT_CREATED => ['event' => TorrentCreated::class, 'model' => Torrent::class],
|
||||
self::TORRENT_UPDATED => ['event' => TorrentUpdated::class, 'model' => Torrent::class],
|
||||
self::TORRENT_DELETED => ['event' => TorrentDeleted::class, 'model' => Torrent::class],
|
||||
|
||||
self::USER_CREATED => ['event' => UserCreated::class, 'model' => User::class],
|
||||
self::USER_UPDATED => ['event' => UserUpdated::class, 'model' => User::class],
|
||||
self::USER_DELETED => ['event' => UserDeleted::class, 'model' => User::class],
|
||||
self::USER_ENABLED => ['event' => UserEnabled::class, 'model' => User::class],
|
||||
self::USER_DISABLED => ['event' => UserDisabled::class, 'model' => User::class],
|
||||
|
||||
self::NEWS_CREATED => ['event' => NewsCreated::class, 'model' => News::class],
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user