diff --git a/backend/app/Http/Controllers/UserScoreController.php b/backend/app/Http/Controllers/UserScoreController.php new file mode 100644 index 00000000..07bebbe0 --- /dev/null +++ b/backend/app/Http/Controllers/UserScoreController.php @@ -0,0 +1,19 @@ + 'required|exists:categories,id', + ]; + } +} \ No newline at end of file diff --git a/backend/app/Services/UserScoreService.php b/backend/app/Services/UserScoreService.php new file mode 100644 index 00000000..f9ef9aca --- /dev/null +++ b/backend/app/Services/UserScoreService.php @@ -0,0 +1,19 @@ +where('isVerified', true)->first(); + } + + function sendResponse($error = false, $code = 200, $msg = "", $data = ["" => ""]): JsonResponse + { + return response()->json(["error" => $error, "code" => $code, "message" => $msg, "data" => $data], $code); + } +} \ No newline at end of file diff --git a/backend/routes/api.php b/backend/routes/api.php index c1e631d7..0cd8c771 100644 --- a/backend/routes/api.php +++ b/backend/routes/api.php @@ -3,9 +3,10 @@ use Illuminate\Http\Request; use Illuminate\Support\Facades\Route; use App\Http\Controllers\UserController; +use App\Http\Controllers\UserScoreController; // util functions -require_once "../util/sendResponse.php"; +// require_once "../util/sendResponse.php"; /* |-------------------------------------------------------------------------- @@ -23,11 +24,19 @@ }); // other route functions here -Route::get("/test", function(){ +Route::get("/test", function () { // execute the function - return sendResponse(false, 200, "Test case pass", null); + return sendResponse(false, 200, "Test case pass", null); }); -Route::prefix("users")->group(function(){ +Route::prefix("users")->group(function () { Route::get('verified/{userId}', [UserController::class, 'getVerifiedUserById']); +}); + +//USERSCORE +Route::prefix("UserScorce")->group(function () { + Route::controller(UserScoreController::class)->group(function () { + Route::get('permissions', 'index'); + Route::post('new_permission', 'store'); + }); }); \ No newline at end of file