<?php

use Illuminate\Support\Facades\Route;

// 用户-获取某人信息
Route::get('/user/{uid}', 'Goodnight\UserController@getUser');

// 声音-获取某个声音信息
Route::get('/voice/{voice_id}', 'Goodnight\VoiceController@get');
// 声音-创建
Route::post('voice', 'Goodnight\VoiceController@store');
// 声音-删除
Route::delete('voice/{voice_id}', 'Goodnight\VoiceController@delete');

//评论
Route::get('/voice/{voice_id}/comment', 'Goodnight\CommentController@index');
Route::post('/voice/{voice_id}/comment', 'Goodnight\CommentController@store');
Route::put('/voice/{voice_id}/comment/{comment_id}', 'Goodnight\CommentController@update');
Route::delete('/voice/{voice_id}/comment/{comment_id}', 'Goodnight\CommentController@destroy');

// 订阅
Route::put("subscribe", "Goodnight\SubscribeController@subscribe");
// 获取今日订阅晚安
Route::get('todayvoice', "Goodnight\SubscribeController@todayVoice");
// 捞一条晚安
Route::get("fishvoice", "Goodnight\SubscribeController@fishVoice");

// 点赞
Route::put("voice/{voice_id}/thumb", "Goodnight\VoiceController@thumb");
// 标记
Route::put("voice/{voice_id}/tag", "Goodnight\VoiceController@tag");

// 加急
Route::get("voice/{voice_id}/expedit", "Goodnight\VoiceController@expeditVoice");

// 邀请
Route::put('invite', 'Goodnight\InviteController@invite');
// 列表-邀请历史
Route::get('invitelist', 'Goodnight\InviteController@inviteList');

// 主页列表-我订阅的晚安
Route::get('subscribevoices', 'Goodnight\SubscribeController@voices');
// 主页列表-我录制的晚安
Route::get('myvoices', 'Goodnight\VoiceController@myvoices');
// 列表-某人录制的晚安
Route::get('user/{uid}/voices', 'Goodnight\VoiceController@uservoices');

// 后台-列表-审核声音
Route::post('admin/checklist', 'Goodnight\VoiceController@voicelist');
// 后台-推荐声音
Route::put('admin/voice/{voice_id}/commit', 'Goodnight\VoiceController@commit')->where('id', '[0-9]+');
// 后台-审核声音
Route::put('admin/voice/{voice_id}/check', 'Goodnight\VoiceController@check')->where('id', '[0-9]+');
// 后台-标记声音
Route::put('admin/voice/{voice_id}/tag', 'Goodnight\VoiceController@tag')->where('id', '[0-9]+');

Route::get('enters', 'Goodnight\EnterController@index');
Route::get('enters/{id}', 'Goodnight\EnterController@show')->where('id', '[0-9]+');
Route::post('enters', 'Goodnight\EnterController@store');
Route::get('enters/today', 'Goodnight\EnterController@today');

Route::get('rooms', 'Goodnight\RoomController@index');
Route::get('rooms/{id}', 'Goodnight\RoomController@show')->where('id', '[0-9]+');
Route::get('rooms/partners', 'Goodnight\RoomController@partners');
Route::get('rooms/{id}/messages', 'Goodnight\RoomController@messages')->where('id', '[0-9]+');
Route::get('rooms/{id}/members', 'Goodnight\RoomController@members')->where('id', '[0-9]+');
Route::post('rooms/{id}/messages', 'Goodnight\RoomController@createMessage')->where('id', '[0-9]+');
Route::post('rooms/{id}/task', 'Goodnight\RoomController@createTask')->where('id', '[0-9]+');

Route::get('topics', 'Goodnight\VoiceController@topics');

Route::get('rank/total', 'Goodnight\RankController@total');
Route::get('rank/topic', 'Goodnight\RankController@topic');
Route::get('rank/daily', 'Goodnight\RankController@daily');