Forum API start.
このコミットが含まれているのは:
コミット
d02434ae7c
|
@ -0,0 +1,37 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class BoardController extends Controller {
|
||||
public function getCategories() { // /api/rpc/board/category/getcategories
|
||||
return DB::table('for_category')
|
||||
->select('*')
|
||||
->orderBy('order', 'asc')
|
||||
->get();
|
||||
}
|
||||
|
||||
public function getCategory($id) { // /api/rpc/board/category/getcategory/id
|
||||
return DB::table('for_category')
|
||||
->select('*')
|
||||
->where('id', $id)
|
||||
->get();
|
||||
}
|
||||
|
||||
public function getForums() { // /api/rpc/board/forum/getforums/
|
||||
return DB::table('for_forums')
|
||||
->select('*')
|
||||
->orderBy('order', 'asc')
|
||||
->get();
|
||||
}
|
||||
|
||||
public function getForumInCategory($cat_id) { // /api/rpc/board/forum/getforumincategory/cat_id
|
||||
return DB::table('for_forums')
|
||||
->select('*')
|
||||
->where('cat_id', $cat_id)
|
||||
->get();
|
||||
}
|
||||
}
|
|
@ -8,3 +8,11 @@
|
|||
| These are the API routes corresponding to board.
|
||||
|
|
||||
*/
|
||||
|
||||
// Category
|
||||
Route::get('/api/rpc/board/category/getcategories', 'BoardController@getCategories');
|
||||
Route::get('/api/rpc/board/category/getcategory/{id}', 'BoardController@getCategory');
|
||||
|
||||
// Forum
|
||||
Route::get('/api/rpc/board/forum/getforumincategory/{cat_id}', 'BoardController@getForumInCategory');
|
||||
Route::get('/api/rpc/board/forum/getforums', 'BoardController@getForums');
|
||||
|
|
|
@ -16,7 +16,7 @@ header('Access-Control-Allow-Headers: "Origin, X-Requested-With, Content-Type, A
|
|||
|
||||
Auth::routes();
|
||||
|
||||
// require(__DIR__.'/class/board.php');
|
||||
require(__DIR__.'/class/board.php');
|
||||
// require(__DIR__.'/class/document.php');
|
||||
// require(__DIR__.'/class/image.php');
|
||||
// require(__DIR__.'/class/odb.php');
|
||||
|
|
新しいイシューから参照