2019-04-23 10:05:58 +08:00
|
|
|
<?php
|
|
|
|
|
2020-01-13 08:37:57 +08:00
|
|
|
Route::any('', 'HomeController@apiRoot');
|
2019-05-01 10:14:14 +08:00
|
|
|
|
2021-01-30 16:43:14 +08:00
|
|
|
Route::prefix('user')->middleware('auth:oauth')->group(function () {
|
2021-04-18 15:31:57 +08:00
|
|
|
Route::get('', 'UserController@user')->middleware(['scope:User.Read']);
|
2020-05-08 23:16:13 +08:00
|
|
|
|
2021-04-18 15:31:57 +08:00
|
|
|
Route::middleware(['scope:Notification.Read'])->group(function () {
|
|
|
|
Route::get('notifications', 'NotificationsController@all');
|
|
|
|
Route::post('notifications/{id}', 'NotificationsController@read');
|
|
|
|
});
|
2019-04-23 10:05:58 +08:00
|
|
|
});
|
|
|
|
|
2021-01-30 16:43:14 +08:00
|
|
|
Route::prefix('players')->middleware('auth:oauth')->group(function () {
|
2021-04-18 15:31:57 +08:00
|
|
|
Route::get('', 'PlayerController@list')->middleware(['scope:Player.Read,Player.ReadWrite']);
|
|
|
|
|
|
|
|
Route::middleware(['scope:Player.ReadWrite'])->group(function () {
|
|
|
|
Route::post('', 'PlayerController@add');
|
|
|
|
Route::delete('{player}', 'PlayerController@delete');
|
|
|
|
Route::put('{player}/name', 'PlayerController@rename');
|
|
|
|
Route::put('{player}/textures', 'PlayerController@setTexture');
|
|
|
|
Route::delete('{player}/textures', 'PlayerController@clearTexture');
|
|
|
|
});
|
2019-04-25 13:31:45 +08:00
|
|
|
});
|
2019-04-28 11:38:38 +08:00
|
|
|
|
2021-01-30 16:43:14 +08:00
|
|
|
Route::prefix('closet')->middleware('auth:oauth')->group(function () {
|
2021-04-18 15:31:57 +08:00
|
|
|
Route::get('', 'ClosetController@getClosetData')->middleware(['scope:Closet.Read,Closet.ReadWrite']);
|
|
|
|
|
|
|
|
Route::middleware(['scope:Closet.ReadWrite'])->group(function () {
|
|
|
|
Route::post('', 'ClosetController@add');
|
|
|
|
Route::put('{tid}', 'ClosetController@rename');
|
|
|
|
Route::delete('{tid}', 'ClosetController@remove');
|
|
|
|
});
|
2019-04-28 11:38:38 +08:00
|
|
|
});
|
2020-05-01 08:34:47 +08:00
|
|
|
|
|
|
|
Route::prefix('admin')
|
2021-01-30 16:43:14 +08:00
|
|
|
->middleware(['auth:oauth', 'role:admin'])
|
2020-05-01 08:34:47 +08:00
|
|
|
->group(function () {
|
2020-05-13 18:12:01 +08:00
|
|
|
Route::prefix('users')->group(function () {
|
2021-04-18 15:31:57 +08:00
|
|
|
Route::get('', 'UsersManagementController@list')->name('list')->middleware(['scope:UsersManagement.Read,UsersManagement.ReadWrite']);
|
|
|
|
Route::prefix('{user}')->middleware(['scope:UsersManagement.ReadWrite'])->group(function () {
|
2020-05-13 18:12:01 +08:00
|
|
|
Route::put('email', 'UsersManagementController@email')->name('email');
|
|
|
|
Route::put('verification', 'UsersManagementController@verification')->name('verification');
|
|
|
|
Route::put('nickname', 'UsersManagementController@nickname')->name('nickname');
|
|
|
|
Route::put('password', 'UsersManagementController@password')->name('password');
|
|
|
|
Route::put('score', 'UsersManagementController@score')->name('score');
|
|
|
|
Route::put('permission', 'UsersManagementController@permission')->name('permission');
|
|
|
|
Route::delete('', 'UsersManagementController@delete')->name('delete');
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2020-05-01 08:34:47 +08:00
|
|
|
Route::prefix('players')->group(function () {
|
2021-04-18 15:31:57 +08:00
|
|
|
Route::get('', 'PlayersManagementController@list')->middleware(['scope:PlayersManagement.Read,PlayersManagement.ReadWrite']);
|
|
|
|
|
|
|
|
Route::middleware(['scope:PlayersManagement.ReadWrite'])->group(function () {
|
|
|
|
Route::put('{player}/name', 'PlayersManagementController@name');
|
|
|
|
Route::put('{player}/owner', 'PlayersManagementController@owner');
|
|
|
|
Route::put('{player}/textures', 'PlayersManagementController@texture');
|
|
|
|
Route::delete('{player}', 'PlayersManagementController@delete');
|
|
|
|
});
|
2020-05-01 08:34:47 +08:00
|
|
|
});
|
2020-05-01 22:52:43 +08:00
|
|
|
|
|
|
|
Route::prefix('closet')->group(function () {
|
2021-04-18 15:31:57 +08:00
|
|
|
Route::get('{user}', 'ClosetManagementController@list')->middleware(['scope:ClosetManagement.Read,ClosetManagement.ReadWrite']);
|
|
|
|
Route::middleware(['scope:ClosetManagement.ReadWrite'])->group(function () {
|
|
|
|
Route::post('{user}', 'ClosetManagementController@add');
|
|
|
|
Route::delete('{user}', 'ClosetManagementController@remove');
|
|
|
|
});
|
2020-05-01 22:52:43 +08:00
|
|
|
});
|
2020-05-08 23:16:13 +08:00
|
|
|
|
2020-05-15 11:05:04 +08:00
|
|
|
Route::prefix('reports')->group(function () {
|
2021-04-18 15:31:57 +08:00
|
|
|
Route::get('', 'ReportController@manage')->middleware(['scope:ReportsManagement.Read,ReportsManagement.ReadWrite']);
|
|
|
|
Route::put('{report}', 'ReportController@review')->middleware(['scope:ReportsManagement.ReadWrite']);
|
2020-05-15 11:05:04 +08:00
|
|
|
});
|
|
|
|
|
2021-04-18 15:31:57 +08:00
|
|
|
Route::post('notifications', 'NotificationsController@send')->middleware(['scope:Notification.ReadWrite']);
|
2020-05-01 08:34:47 +08:00
|
|
|
});
|