system.php 4.27 KB
<?php

use App\Http\Container\AdminSection\Controllers\System\BannerController;
use App\Http\Container\AdminSection\Controllers\System\Broker\PushConfigController;
use App\Http\Container\AdminSection\Controllers\System\Broker\PushLevelRecordController;
use App\Http\Container\AdminSection\Controllers\System\Broker\PushMatchRecordController;
use App\Http\Container\AdminSection\Controllers\System\Broker\UserConfigController;
use App\Http\Container\AdminSection\Controllers\System\ConfigController;
use App\Http\Container\AdminSection\Controllers\System\MaterialController;
use App\Http\Container\AdminSection\Controllers\System\NotificationController;
use App\Http\Container\AdminSection\Controllers\System\OperationLogController;
use App\Http\Container\AdminSection\Controllers\System\PermissionController;
use App\Http\Container\AdminSection\Controllers\System\ReportController;
use App\Http\Container\AdminSection\Controllers\System\RoleController;
use App\Http\Container\AdminSection\Controllers\System\TagController;
use App\Http\Container\AdminSection\Controllers\System\UserTagController;
use App\Http\Container\AdminSection\Controllers\System\VersionController;


Route::apiResource('tags', TagController::class)->except('show');
Route::apiResource('versions', VersionController::class)->except('show');
Route::apiResource('banners', BannerController::class)->except('show');
Route::apiResource('reports', ReportController::class)->only(['index', 'update']);
Route::put('banners/{banner}/change-status', [BannerController::class, 'changeStatus'])->whereNumber('banner');

Route::apiResource('user_tags', UserTagController::class)->except('show')->middleware('emptyToNull');


Route::apiResource('materials', MaterialController::class)->except('show');
Route::apiResource('roles', RoleController::class)->except('show');
Route::put('roles/{role}/change-status', [RoleController::class, 'changeStatus'])->whereNumber('role');
Route::put('roles/{role}/change-permission', [RoleController::class, 'changePermission'])->whereNumber('role');

Route::apiResource('permissions', PermissionController::class)->only('index');

Route::apiResource('notification', NotificationController::class)->except('destroy');
Route::get('notification/{notification}/users', [NotificationController::class, 'user'])->whereNumber('notification');
Route::put('notification/{notification}/send', [NotificationController::class, 'send'])->whereNumber('notification');
Route::put('notification/{notification}/cancel', [NotificationController::class, 'cancel'])->whereNumber('notification');
Route::put('notification/{notification}/rollback', [NotificationController::class, 'rollback'])->whereNumber('notification');

Route::apiResource('configs', ConfigController::class);
Route::put('configs/{config}/change-status', [ConfigController::class, 'changeStatus'])->whereNumber('config');

Route::prefix('broker')->group(function () {
    Route::apiResource('push-configs', PushConfigController::class)->except('show');
    Route::apiResource('user-configs', UserConfigController::class);
    Route::post('user-configs/{userConfig}/level', [UserConfigController::class, 'storeLevelRecord'])->whereNumber('userConfig');
    Route::post('user-configs/upload', [UserConfigController::class, 'upload']);

    Route::get('push-match-records', [PushMatchRecordController::class, 'index']);
    Route::post('push-match-records/{record}/send', [PushMatchRecordController::class, 'send'])->whereNumber('record');
    Route::post('push-match-records/{record}/rollback', [PushMatchRecordController::class, 'rollback'])->whereNumber('record');

    Route::get('push-level-records', [PushLevelRecordController::class, 'index']);
    Route::put('push-level-records/{record}', [PushLevelRecordController::class, 'update'])->whereNumber('record');
    Route::delete('push-level-records/{record}', [PushLevelRecordController::class, 'destroy'])->whereNumber('record');
    Route::get('push-level-records/{record}/children', [PushLevelRecordController::class, 'children'])->whereNumber('record');
    Route::post('push-level-records/{record}/send', [PushLevelRecordController::class, 'send'])->whereNumber('record');
    Route::post('push-level-records/{record}/rollback', [PushLevelRecordController::class, 'rollback'])->whereNumber('record');
});

Route::get('operation-logs', OperationLogController::class);