blessing-skin-server/app/Http/routes.php

137 lines
5.4 KiB
PHP
Raw Normal View History

2016-07-21 22:01:57 +08:00
<?php
2016-08-28 10:05:21 +08:00
2016-07-21 22:01:57 +08:00
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
2016-08-28 10:05:21 +08:00
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
2016-07-21 22:01:57 +08:00
|
*/
Route::get('/', 'HomeController@index');
Route::get('/index.php', 'HomeController@index');
Route::get('/locale/{lang}', 'HomeController@locale');
2016-07-21 22:01:57 +08:00
/**
* Auth
*/
Route::group(['prefix' => 'auth'], function()
{
Route::group(['middleware' => 'App\Http\Middleware\RedirectIfAuthenticated'], function()
2016-07-21 22:01:57 +08:00
{
Route::get ('/login', 'AuthController@login');
Route::get ('/register', 'AuthController@register');
Route::get ('/forgot', 'AuthController@forgot');
Route::get ('/reset', 'AuthController@reset');
2016-07-21 22:01:57 +08:00
});
Route::any('/logout', 'AuthController@logout');
Route::any('/captcha', 'AuthController@captcha');
2016-07-21 22:01:57 +08:00
Route::post('/login', 'AuthController@handleLogin');
Route::post('/register', 'AuthController@handleRegister');
Route::post('/forgot', 'AuthController@handleForgot');
2016-07-21 22:01:57 +08:00
Route::post('/reset', 'AuthController@handleReset');
2016-07-21 22:01:57 +08:00
});
/**
* User Center
*/
2016-08-28 10:05:21 +08:00
Route::group(['middleware' => 'App\Http\Middleware\CheckAuthenticated', 'prefix' => 'user'], function()
2016-07-21 22:01:57 +08:00
{
2016-08-28 10:05:21 +08:00
Route::any ('', 'UserController@index');
Route::any ('/checkin', 'UserController@checkIn');
2016-07-21 22:01:57 +08:00
// Profile
Route::get ('/profile', 'UserController@profile');
Route::post('/profile', 'UserController@handleProfile');
Route::post('/profile/avatar', 'UserController@setAvatar');
Route::get ('/config', 'UserController@config');
// Player
2016-08-28 10:05:21 +08:00
Route::any ('/player', 'PlayerController@index');
2016-07-21 22:01:57 +08:00
Route::post('/player/add', 'PlayerController@add');
Route::post('/player/show', 'PlayerController@show');
Route::post('/player/preference', 'PlayerController@setPreference');
Route::post('/player/set', 'PlayerController@setTexture');
Route::post('/player/texture', 'PlayerController@changeTexture');
Route::post('/player/texture/clear', 'PlayerController@clearTexture');
Route::post('/player/rename', 'PlayerController@rename');
Route::post('/player/delete', 'PlayerController@delete');
// Closet
Route::get ('/closet', 'ClosetController@index');
Route::post('/closet/add', 'ClosetController@add');
Route::post('/closet/remove', 'ClosetController@remove');
});
/**
* Skin Library
*/
Route::group(['prefix' => 'skinlib'], function()
{
Route::get ('', 'SkinlibController@index');
Route::any ('/info/{tid}', 'SkinlibController@info');
Route::any ('/show', 'SkinlibController@show');
Route::any ('/search', 'SkinlibController@search');
2016-07-21 22:01:57 +08:00
Route::group(['middleware' => 'App\Http\Middleware\CheckAuthenticated'], function()
2016-07-21 22:01:57 +08:00
{
Route::get ('/upload', 'SkinlibController@upload');
Route::post('/upload', 'SkinlibController@handleUpload');
2016-07-21 22:01:57 +08:00
Route::post('/rename', 'SkinlibController@rename');
Route::post('/privacy/{tid}', 'SkinlibController@privacy');
Route::post('/delete', 'SkinlibController@delete');
2016-07-21 22:01:57 +08:00
});
});
2016-07-22 19:36:24 +08:00
/**
* Admin Panel
*/
Route::group(['middleware' => 'App\Http\Middleware\CheckAdminMiddleware', 'prefix' => 'admin'], function()
2016-07-22 19:36:24 +08:00
{
Route::get('/', 'AdminController@index');
2016-07-22 19:36:24 +08:00
Route::any('/customize', 'AdminController@customize');
Route::any('/score', 'AdminController@score');
Route::any('/options', 'AdminController@options');
Route::any('/update', 'AdminController@update');
2016-07-22 19:36:24 +08:00
Route::get('/users', 'AdminController@users');
Route::get('/players', 'AdminController@players');
2016-07-23 15:20:10 +08:00
// ajax handlers
Route::post('/users', 'AdminController@userAjaxHandler');
Route::post('/players', 'AdminController@playerAjaxHandler');
2016-07-22 19:36:24 +08:00
});
2016-07-21 22:01:57 +08:00
/**
* Resources
*/
2016-08-28 10:05:21 +08:00
Route::group(['middleware' => 'App\Http\Middleware\CheckPlayerExistMiddleware'], function()
2016-07-21 22:01:57 +08:00
{
2016-08-29 14:49:10 +08:00
// Json profile
Route::get('/{player_name}.json', 'TextureController@json');
Route::get('/{api}/{player_name}.json', 'TextureController@jsonWithApi')->where('api', 'usm|csl');
2016-08-29 14:49:10 +08:00
// Legacy links
Route::get('/skin/{player_name}.png', 'TextureController@skin');
Route::get('/skin/{model}/{pname}.png', 'TextureController@skinWithModel');
2016-08-29 14:49:10 +08:00
Route::get('/cape/{player_name}.png', 'TextureController@cape');
2016-07-21 22:01:57 +08:00
});
2016-08-28 20:33:35 +08:00
Route::get('/textures/{hash}', 'TextureController@texture');
Route::get('/{api}/textures/{hash}', 'TextureController@textureWithApi')->where('api', 'usm|csl');
2016-07-21 22:01:57 +08:00
Route::get('/avatar/{base64_email}.png', 'TextureController@avatar');
2016-08-29 14:49:10 +08:00
Route::get('/avatar/{size}/{base64_email}.png', 'TextureController@avatarWithSize');
2016-07-21 22:01:57 +08:00
Route::get('/raw/{tid}.png', 'TextureController@raw');
2016-07-21 22:01:57 +08:00
Route::get('/preview/{tid}.png', 'TextureController@preview');
Route::get('/preview/{size}/{tid}.png', 'TextureController@previewWithSize');