version('v1', function($api) { // 来源相关api $api->group(['namespace' => 'CommentsBundle\Http\Api\V1\Action', 'middleware' => ['api.auth', 'activated', 'shoplog'], 'providers' => 'jwt'], function($api) { $api->post('/comment', ['name' => '创建评论', 'as' => 'comment.create', 'uses' => 'Comments@createComment']); $api->patch('/comment/{comment_id}', ['name' => '更新评论', 'as' => 'comment.update', 'uses' => 'Comments@updateComment']); $api->get('/comments', ['name' => '获取评论列表', 'as' => 'comments.list', 'uses' => 'Comments@getComments']); }); });