Files
lelong/routes/api.php
T
2022-12-13 18:59:38 +08:00

140 lines
5.8 KiB
PHP

<?php
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;
use App\Http\Controllers\AuthMobile\AuthController;
use App\Http\Controllers\Mobile\UserController;
use App\Http\Controllers\Mobile\LelongMobileController;
use App\Http\Controllers\Mobile\ForgotPasswordController;
use App\Http\Controllers\Mobile\ResetPasswordController;
use App\Http\Controllers\CartController;
use App\Http\Controllers\ApiController;
/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/
//Public routes
Route::post('/register', [AuthController::class, 'register']);
Route::post('/user/login', [AuthController::class, 'loginUser']);
Route::post('/password/email', [ForgotPasswordController::class, 'sendResetLinkEmail']);
// Route::post('/feepayment', [ApiController::class, 'feepayment']);
// Route::get('/callback', [ApiController::class, 'feepayment']);
Route::post('/feepayment', [ApiController::class, 'feepayment'])->name('feepayment');
Route::post('/bidpayment', [ApiController::class, 'bidpayment'])->name('bidpayment');
//Protected routes
Route::group(['middleware' => ['auth:sanctum']], function () {
// User
Route::post('/user/logout', [AuthController::class, 'logoutUser']);
Route::get('/user/profile/{nokp}', [UserController::class, 'getProfileUser']);
Route::post('/password/reset', [ResetPasswordController::class, 'reset']);
// User Profile
Route::get('/user/profile', [UserController::class, 'getProfileUser']);
Route::put('/userUpdate/profile', [UserController::class, 'updateProfileUser']);
//============HOME===========================
//today's auction
Route::get('/listcawlelongtoday', [LelongMobileController::class, 'listCawLelongToday']);
//next auction
Route::get('/listcawlelongnext', [LelongMobileController::class, 'listCawLelongNext']);
//============LIST LELONG===========================
//list cawangan started lelong
Route::get('/listcawlelongtodaystarted', [LelongMobileController::class, 'listCawLelongTodayStarted']);
//list surat exclude in cart and bid-record
Route::get('/lelongDetails/listSuratLelong', [LelongMobileController::class, 'listSuratLelong']);
//list lelong online
Route::get('/lelongOnline', [LelongMobileController::class, 'lelongOnline']);
//photo marhun
Route::get('/photoMarhun',[LelongMobileController::class, 'photoMarhun']);
//============CART===========================
//get cart group by cawangan
Route::get('/cartByCawangan/{userId}', [CartController::class, 'getCartByCawangan']);
//add item to cart
Route::post('/addToCart', [CartController::class, 'addToCart']);
//update item in cart
Route::post('/updateItem', [CartController::class, 'updateItem']);
//delete item in cart
Route::post('/deleteItem', [CartController::class, 'deleteItem']);
//number of item in cart
Route::get('/itemInCart', [LelongMobileController::class, 'itemInCart']);
//===========STALE CART=====================
Route::post('/removeFromCart', [CartController::class, 'removeFromCart']);
Route::get('/cart/{userid}', [CartController::class, 'getCart']);
Route::get('/deleteItem/{id}', [CartController::class, 'deleteCart']);
//===========BID RECORD======================
//get bid record group by cawangan
Route::get('/bidRecordByCawangan/{userId}', [LelongMobileController::class, 'bidRecordByCawangan']);
//===========STALE BID RECORD=================
Route::get('/bidder/bidrecord', [LelongMobileController::class, 'bidRecord']);
//===========RESULT======================
//get all result
Route::get('/resultLelong', [LelongMobileController::class, 'resultLelong']);
//get status result
Route::get('/resultStatus/{userId}/{lelongId}', [LelongMobileController::class, 'resultStatus']);
//===========PAY======================
//get invoice detail
Route::get('/invoice', [LelongMobileController::class, 'getInvoiceId']);
// Lelong
Route::get('/lelongDetails/today', [LelongMobileController::class, 'getlelongdetails']);
Route::get('/lelongDetails/cawangan', [LelongMobileController::class, 'searchLelByCaw']);
Route::get('/lelong/cawangan', [LelongMobileController::class, 'searchLelongByCawangan']);
Route::get('/karat', [LelongMobileController::class, 'getListKarat']);
Route::get('/result/{user_id}', [LelongMobileController::class, 'bidresult']);
Route::get('/bayar/{user_id}/{lelong_id}', [LelongMobileController::class, 'bidresults']);
Route::get('/bayarBaki/{user_id}/{lelong_id}', [LelongMobileController::class, 'bidPayRemaining']);
Route::get('/history/{user_id}', [LelongMobileController::class, 'history']);
Route::post('/bayarcdm', [LelongMobileController::class, 'bayarCdm']);
Route::post('/updateresit', [LelongMobileController::class, 'updateResit']);
// Lelong => Bidder
Route::post('/bidder/biditem', [LelongMobileController::class, 'bidderSelectBidItem']);
Route::get('/bidder/listbiditem', [LelongMobileController::class, 'listBidItem']);
Route::get('/bidder/listBidItemWeb/{user_id}', [LelongMobileController::class, 'listBidItemWeb']);
Route::get('/bidder/historyFeePay', [LelongMobileController::class, 'historyFeePay']);
Route::post('/bidder/updatebiditem', [LelongMobileController::class, 'updatebiditem']);
});
Route::get('/item','ApiController@biditem');
Route::get('/jeniskarat','ApiController@karat');
// Route::get('/item',['as'=>'lelong.biditem','uses'=>'LelongController@biditem']);
// Route::get('/lelongstop/{id}',['as'=>'lelong.stop','uses'=>'LelongController@stop']);