123456789101112131415161718192021222324252627282930313233343536373839 |
- <?php
- /*
- |--------------------------------------------------------------------------
- | Application Routes
- |--------------------------------------------------------------------------
- |
- | Here is where you can register all of the routes for an application.
- | It is a breeze. Simply tell Lumen the URIs it should respond to
- | and give it the Closure to call when that URI is requested.
- |
- */
- $api = app('Dingo\Api\Routing\Router');
- $api->version('v1', [
- 'namespace' => 'App\Http\Controllers',
- ], function ($api) {
- $api->group(['namespace' => 'Post'], function ($api) {
- //发布内容
- $api->post('post', 'PostController@create');
- //内容列表
- $api->get('post', 'PostController@index');
- //内容详情
- $api->get('post/detail', 'PostController@detail');
- //推荐内容
- $api->put('post/suggest', 'PostController@suggest');
- //删除内容
- $api->delete('post/delete', 'PostController@delete');
- //隐藏内容
- $api->put('post/hide', 'PostController@hide');
- });
- $api->group(['middleware' => 'jwt.chxq_auth'], function ($api) {
- //配置
- $api->get('config', 'ConfigController@index');
- });
- });
|