Moar API stuff.
このコミットが含まれているのは:
コミット
e0649b0fa7
|
@ -52,6 +52,81 @@ class FileController extends Controller {
|
|||
->get();
|
||||
}
|
||||
|
||||
public function getFilesPageAll($cat, $from, $to) { // /api/rpc/file/getfilespageall/cat/from/to
|
||||
return DB::table('str_file')
|
||||
->select(
|
||||
'id',
|
||||
'title',
|
||||
'version',
|
||||
'description',
|
||||
'submit_date',
|
||||
'last_date',
|
||||
'views',
|
||||
'downloads'
|
||||
)
|
||||
->where('cat_id', $cat)
|
||||
->offset($from)
|
||||
->limit($to)
|
||||
->get();
|
||||
}
|
||||
|
||||
public function getFilesPageApproved($cat, $from, $to) { // /api/rpc/file/getfilespageapproved/cat/from/to
|
||||
return DB::table('str_file')
|
||||
->select(
|
||||
'id',
|
||||
'title',
|
||||
'version',
|
||||
'description',
|
||||
'submit_date',
|
||||
'last_date',
|
||||
'views',
|
||||
'downloads'
|
||||
)
|
||||
->where('cat_id', $cat)
|
||||
->where('isApproved', 1)
|
||||
->offset($from)
|
||||
->limit($to)
|
||||
->get();
|
||||
}
|
||||
|
||||
public function getFilesPagePopularView($cat, $from, $to) { // /api/rpc/file/getfilespagepopularview/cat/from/to
|
||||
return DB::table('str_file')
|
||||
->select(
|
||||
'id',
|
||||
'title',
|
||||
'version',
|
||||
'description',
|
||||
'submit_date',
|
||||
'last_date',
|
||||
'views',
|
||||
'downloads'
|
||||
)
|
||||
->where('cat_id', $cat)
|
||||
->where('views', '>', 1000)
|
||||
->offset($from)
|
||||
->limit($to)
|
||||
->get();
|
||||
}
|
||||
|
||||
public function getFilesPagePopularDownload($cat, $from, $to) { // /api/rpc/file/getfilespagepopulardownload/cat/from/to
|
||||
return DB::table('str_file')
|
||||
->select(
|
||||
'id',
|
||||
'title',
|
||||
'version',
|
||||
'description',
|
||||
'submit_date',
|
||||
'last_date',
|
||||
'views',
|
||||
'downloads'
|
||||
)
|
||||
->where('cat_id', $cat)
|
||||
->where('downloads', '>', 1000)
|
||||
->offset($from)
|
||||
->limit($to)
|
||||
->get();
|
||||
}
|
||||
|
||||
public function getFile($id) { // /api/rpc/file/getfile/id
|
||||
return DB::table('str_file')
|
||||
->select('*')
|
||||
|
|
|
@ -38,6 +38,10 @@ Route::get('/api/rpc/file/getallbrokenfiles', 'FileController@getAllBrokenFiles'
|
|||
Route::get('/api/rpc/file/getallpendingfiles', 'FileController@getAllPendingFiles');
|
||||
Route::get('/api/rpc/file/getnewfiles', 'FileController@getNewFiles');
|
||||
Route::get('/api/rpc/file/gethotfiles', 'FileController@getHotFiles');
|
||||
Route::get('/api/rpc/file/getfilespageall/{cat}/{from}/{to}', 'FileController@getFilesPageAll');
|
||||
Route::get('/api/rpc/file/getfilespageapproved/{cat}/{from}/{to}', 'FileController@getFilesPageApproved');
|
||||
Route::get('/api/rpc/file/getfilespagepopularview/{cat}/{from}/{to}', 'FileController@getFilesPagePopularView');
|
||||
Route::get('/api/rpc/file/getfilespagepopulardownload/{cat}/{from}/{to}', 'FileController@getFilesPagePopularDownload');
|
||||
Route::get('/api/rpc/file/getfile/{id}', 'FileController@getFile');
|
||||
Route::get('/api/rpc/file/getfiletitle/{id}', 'FileController@getFileTitle');
|
||||
Route::get('/api/rpc/file/getfiledescription/{id}', 'FileController@getFileDescription');
|
||||
|
|
新しいイシューから参照