Entry post shizzle.

このコミットが含まれているのは:
テクニカル諏訪子 2018-02-01 04:47:29 +09:00
コミット ca8463a615
2個のファイルの変更34行の追加7行の削除

ファイルの表示

@ -178,6 +178,36 @@ class FileController extends Controller {
->get();
}
public function insertEntry(Request $request) { // /api/rpc/file/insert
return;
}
public function updateEntry(Request $request) { // /api/rpc/file/update
return DB::table('str_file')
->where('id', $request->id)
->update([
'cat_id' => $request->cat_id,
'title' => $request->title,
'version' => $request->version,
'description' => $request->description,
'changelog' => $request->changelog,
'warningnote' => $request->warningnote,
'last_date' => $request->last_date
]);
}
public function restoreEntry(Request $request) { // /api/rpc/file/restore
return DB::table('str_file')
->where('id', $request->id)
->update(['isApproved', 1]);
}
public function removeEntry(Request $request) { // /api/rpc/file/remove
return DB::table('str_file')
->where('id', $request->id)
->update(['isApproved', 0]);
}
public function entry($file_id) { // /entry/file_id
return view('entry', compact('file_id'));
}

ファイルの表示

@ -47,6 +47,10 @@ Route::get('/api/rpc/file/getfiletitle/{id}', 'FileController@getFileTitle');
Route::get('/api/rpc/file/getfiledescription/{id}', 'FileController@getFileDescription');
Route::get('/api/rpc/file/getfilechangelog/{id}', 'FileController@getFileChangelog');
Route::get('/api/rpc/file/getfilesincategory/{cat_id}', 'FileController@getFilesInCategory');
Route::post('/api/rpc/file/insert', 'FileController@insertEntry');
Route::post('/api/rpc/file/update', 'FileController@updateEntry');
Route::post('/api/rpc/file/restore', 'FileController@restoreEntry');
Route::post('/api/rpc/file/remove', 'FileController@removeEntry');
// Owners
Route::get('/api/rpc/owner/countownersoffile/{id}', 'OwnerController@countOwnersOfFile');
@ -89,10 +93,3 @@ Route::get('/js/lang.js', function () {
echo('window.i18n = ' . json_encode($strings) . ';');
exit();
})->name('assets.lang');
/*Route::get('/api/rpc/example/getusers', 'ExampleController@getUsers');
Route::get('/api/rpc/example/getuser/{id}', 'ExampleController@getUser');
Route::post('/api/rpc/example/adduser', 'ExampleController@addUser');
Route::post('/api/rpc/example/edituser', 'ExampleController@editUser');
Route::post('/api/rpc/example/deleteuser', 'ExampleController@deleteUser');
Route::post('/api/rpc/example/browse', 'ExampleController@browse');*/