Separate routes for old and new apis #730

This commit is contained in:
Ramon Gutierrez 2023-02-16 05:54:14 +08:00
parent 81d4f46930
commit 2f7e493fab
2 changed files with 362 additions and 135 deletions

View file

@ -1,227 +1,227 @@
# api # api
api_register: apiv2_register:
path: /apiv2/register path: /api/register
controller: App\Controller\CustomerAppAPI\AuthController::register controller: App\Controller\APIController::register
methods: [POST] methods: [POST]
api_confirm: apiv2_confirm:
path: /apiv2/number_confirm path: /api/number_confirm
controller: App\Controller\CustomerAppAPI\AuthController::confirmNumber controller: App\Controller\APIController::confirmNumber
methods: [POST] methods: [POST]
api_validate: apiv2_validate:
path: /apiv2/code_validate path: /api/code_validate
controller: App\Controller\CustomerAppAPI\AuthController::validateCode controller: App\Controller\APIController::validateCode
methods: [POST] methods: [POST]
api_info_get: apiv2_info_get:
path: /apiv2/info path: /api/info
controller: App\Controller\CustomerAppAPI\CustomerController::getInfo controller: App\Controller\APIController::getInfo
methods: [GET] methods: [GET]
api_info_update: apiv2_info_update:
path: /apiv2/info path: /api/info
controller: App\Controller\CustomerAppAPI\CustomerController::updateInfo controller: App\Controller\APIController::updateInfo
methods: [POST] methods: [POST]
api_status: apiv2_status:
path: /apiv2/status path: /api/status
controller: App\Controller\CustomerAppAPI\CustomerController::getStatus controller: App\Controller\APIController::getStatus
methods: [GET] methods: [GET]
api_vehicle_mfg_list: apiv2_vehicle_mfg_list:
path: /apiv2/vehicle/mfgs path: /api/vehicle/mfgs
controller: App\Controller\CustomerAppAPI\VehicleController::listVehicleManufacturers controller: App\Controller\APIController::listVehicleManufacturers
methods: [GET] methods: [GET]
api_vehicle_make_list: apiv2_vehicle_make_list:
path: /apiv2/vehicle/mfgs/{mfg_id}/makes path: /api/vehicle/mfgs/{mfg_id}/makes
controller: App\Controller\CustomerAppAPI\VehicleController::listVehicleMakes controller: App\Controller\APIController::listVehicleMakes
methods: [GET] methods: [GET]
api_cust_vehicle_add: apiv2_cust_vehicle_add:
path: /apiv2/vehicles path: /api/vehicles
controller: App\Controller\CustomerAppAPI\VehicleController::addVehicle controller: App\Controller\APIController::addVehicle
methods: [POST] methods: [POST]
api_cust_vehicle_update: apiv2_cust_vehicle_update:
path: /apiv2/vehicles/{id} path: /api/vehicles/{id}
controller: App\Controller\CustomerAppAPI\VehicleController::updateVehicle controller: App\Controller\APIController::updateVehicle
methods: [POST] methods: [POST]
api_cust_vehicle_list: apiv2_cust_vehicle_list:
path: /apiv2/vehicles path: /api/vehicles
controller: App\Controller\CustomerAppAPI\VehicleController::listVehicles controller: App\Controller\APIController::listVehicles
methods: [GET] methods: [GET]
api_promo_list: apiv2_promo_list:
path: /apiv2/promos path: /api/promos
controller: App\Controller\CustomerAppAPI\PromoController::listPromos controller: App\Controller\APIController::listPromos
methods: [GET] methods: [GET]
api_battery_list: apiv2_battery_list:
path: /apiv2/vehicles/{vid}/compatible_batteries path: /api/vehicles/{vid}/compatible_batteries
controller: App\Controller\CustomerAppAPI\VehicleController::getCompatibleBatteries controller: App\Controller\APIController::getCompatibleBatteries
methods: [GET] methods: [GET]
api_jo_request: apiv2_jo_request:
path: /apiv2/job_order path: /api/job_order
controller: App\Controller\CustomerAppAPI\JobOrderController::requestJobOrder controller: App\Controller\APIController::requestJobOrder
methods: [POST] methods: [POST]
api_estimate: apiv2_estimate:
path: /apiv2/estimate path: /api/estimate
controller: App\Controller\CustomerAppAPI\EstimateController::getEstimate controller: App\Controller\APIController::getEstimate
methods: [POST] methods: [POST]
api_ongoing: apiv2_ongoing:
path: /apiv2/job_order/ongoing path: /api/job_order/ongoing
controller: App\Controller\CustomerAppAPI\JobOrderController::getOngoing controller: App\Controller\APIController::getOngoing
methods: [GET] methods: [GET]
api_rider_status: apiv2_rider_status:
path: /apiv2/rider path: /api/rider
controller: App\Controller\CustomerAppAPI\RiderController::getRiderStatus controller: App\Controller\APIController::getRiderStatus
methods: [GET] methods: [GET]
api_rider_rating_add: apiv2_rider_rating_add:
path: /apiv2/rider_rating path: /api/rider_rating
controller: App\Controller\CustomerAppAPI\RiderController::addRiderRating controller: App\Controller\APIController::addRiderRating
methods: [POST] methods: [POST]
api_jo_cancel: apiv2_jo_cancel:
path: /apiv2/job_order/cancel path: /api/job_order/cancel
controller: App\Controller\CustomerAppAPI\JobOrderController:cancelJobOrder controller: App\Controller\APIController:cancelJobOrder
methods: [POST] methods: [POST]
api_jo_history: apiv2_jo_history:
path: /apiv2/job_order/history path: /api/job_order/history
controller: App\Controller\CustomerAppAPI\JobOrderController:getJOHistory controller: App\Controller\APIController:getJOHistory
methods: [GET] methods: [GET]
api_jo_invoice: apiv2_jo_invoice:
path: /apiv2/job_order/invoice path: /api/job_order/invoice
controller: App\Controller\CustomerAppAPI\JobOrderController:getJOInvoice controller: App\Controller\APIController:getJOInvoice
methods: [GET] methods: [GET]
api_device_id: apiv2_device_id:
path: /apiv2/device_id path: /api/device_id
controller: App\Controller\CustomerAppAPI\DeviceController:updateDeviceID controller: App\Controller\APIController:updateDeviceID
methods: [POST] methods: [POST]
api_privacy: apiv2_privacy:
path: /apiv2/privacy path: /api/privacy
controller: App\Controller\CustomerAppAPI\PrivacyController:privacySettings controller: App\Controller\APIController:privacySettings
methods: [POST] methods: [POST]
api_resend_code: apiv2_resend_code:
path: /apiv2/resend_code path: /api/resend_code
controller: App\Controller\CustomerAppAPI\AuthController:resendCode controller: App\Controller\APIController:resendCode
methods: [POST] methods: [POST]
api_location_support: apiv2_location_support:
path: /apiv2/location_support path: /api/location_support
controller: App\Controller\CustomerAppAPI\LocationController:locationSupport controller: App\Controller\APIController:locationSupport
methods: [GET] methods: [GET]
api_activate_warranty: apiv2_activate_warranty:
path: /apiv2/activate_warranty path: /api/activate_warranty
controller: App\Controller\CustomerAppAPI\WarrantyController:activateWarranty controller: App\Controller\APIController:activateWarranty
methods: [POST] methods: [POST]
api_service_list: apiv2_service_list:
path: /apiv2/services path: /api/services
controller: App\Controller\CustomerAppAPI\ServiceController:listServices controller: App\Controller\APIController:listServices
methods: [GET] methods: [GET]
api_partner_info: apiv2_partner_info:
path: /apiv2/partners/{pid} path: /api/partners/{pid}
controller: App\Controller\CustomerAppAPI\PartnerController:getPartnerInformation controller: App\Controller\APIController:getPartnerInformation
methods: [GET] methods: [GET]
api_partner: apiv2_partner:
path: /apiv2/partners path: /api/partners
controller: App\Controller\CustomerAppAPI\PartnerController:getClosestPartners controller: App\Controller\APIController:getClosestPartners
methods: [GET] methods: [GET]
api_partner_review: apiv2_partner_review:
path: /apiv2/partners/{pid}/review path: /api/partners/{pid}/review
controller: App\Controller\CustomerAppAPI\PartnerController:reviewPartner controller: App\Controller\APIController:reviewPartner
methods: [POST] methods: [POST]
api_nearest_hub_slots: apiv2_nearest_hub_slots:
path: /apiv2/hub_slots path: /api/hub_slots
controller: App\Controller\CustomerAppAPI\LocationController::getNearestHubAndSlots controller: App\Controller\APIController::getNearestHubAndSlots
methods: [GET] methods: [GET]
api_new_jo_request: apiv2_new_jo_request:
path: /apiv2/new_job_order path: /api/new_job_order
controller: App\Controller\CustomerAppAPI\JobOrderController::newRequestJobOrder controller: App\Controller\APIController::newRequestJobOrder
methods: [POST] methods: [POST]
api_version_check: apiv2_version_check:
path: /apiv2/version_check path: /api/version_check
controller: App\Controller\CustomerAppAPI\AppController::versionCheck controller: App\Controller\APIController::versionCheck
methods: [GET] methods: [GET]
api_schedule_option_status: apiv2_schedule_option_status:
path: /apiv2/schedule_option_status path: /api/schedule_option_status
controller: App\Controller\CustomerAppAPI\ScheduleController::scheduleOptionStatus controller: App\Controller\APIController::scheduleOptionStatus
methods: [GET] methods: [GET]
# paperless warranty / qr code # paperless warranty / qr code
api_warr_serial_check: apiv2_warr_serial_check:
path: /apiv2/warranty/{serial} path: /api/warranty/{serial}
controller: App\Controller\CustomerAppAPI\WarrantyController::warrantyCheck controller: App\Controller\APIController::warrantyCheck
methods: [GET] methods: [GET]
api_warr_serial_register: apiv2_warr_serial_register:
path: /apiv2/warranty/{serial} path: /api/warranty/{serial}
controller: App\Controller\CustomerAppAPI\WarrantyController::warrantyRegister controller: App\Controller\APIController::warrantyRegister
methods: [POST] methods: [POST]
api_jo_info: apiv2_jo_info:
path: /apiv2/job_order/{id}/info path: /api/job_order/{id}/info
controller: App\Controller\CustomerAppAPI\JobOrderController::getJobOrderInfo controller: App\Controller\APIController::getJobOrderInfo
methods: [GET] methods: [GET]
api_ongoing_job_orders: apiv2_ongoing_job_orders:
path: /apiv2/job_orders/ongoing path: /api/job_orders/ongoing
controller: App\Controller\CustomerAppAPI\JobOrderController::getAllOngoingJobOrders controller: App\Controller\APIController::getAllOngoingJobOrders
methods: [GET] methods: [GET]
api_ongoing_jo_count: apiv2_ongoing_jo_count:
path: /apiv2/job_orders/ongoing/count path: /api/job_orders/ongoing/count
controller: App\Controller\CustomerAppAPI\JobOrderController::getOngoingJobOrderCount controller: App\Controller\APIController::getOngoingJobOrderCount
methods: [GET] methods: [GET]
api_new_location: apiv2_new_location:
path: /apiv2/new_location path: /api/new_location
controller: App\Controller\CustomerAppAPI\LocationController::addLocation controller: App\Controller\APIController::addLocation
methods: [POST] methods: [POST]
api_locations: apiv2_locations:
path: /apiv2/locations path: /api/locations
controller: App\Controller\CustomerAppAPI\LocationController::getLocations controller: App\Controller\APIController::getLocations
methods: [GET] methods: [GET]
api_cust_vehicle_remove: apiv2_cust_vehicle_remove:
path: /apiv2/vehicles/{id}/remove path: /api/vehicles/{id}/remove
controller: App\Controller\CustomerAppAPI\VehicleController::removeVehicle controller: App\Controller\APIController::removeVehicle
methods: [POST] methods: [POST]
api_latest_job_order: apiv2_latest_job_order:
path: /apiv2/job_order/latest path: /api/job_order/latest
controller: App\Controller\CustomerAppAPI\JobOrderController::getLatestJobOrder controller: App\Controller\APIController::getLatestJobOrder
methods: [GET] methods: [GET]
api_customer_hash_get: apiv2_customer_hash_get:
path: /apiv2/customer_hash path: /api/customer_hash
controller: App\Controller\CustomerAppAPI\CustomerController::getCustomerHash controller: App\Controller\APIController::getCustomerHash
methods: [GET] methods: [GET]
#api_completed_job_orders: #apiv2_completed_job_orders:
# path: /apiv2/job_orders/completed # path: /api/job_orders/completed
# controller: App\Controller\CustomerAppAPI\JobOrderController::getCompletedJobOrders # controller: App\Controller\APIController::getCompletedJobOrders
# methods: [GET] # methods: [GET]

227
config/routes/apiv2.yaml Normal file
View file

@ -0,0 +1,227 @@
# api
api_register:
path: /apiv2/register
controller: App\Controller\CustomerAppAPI\AuthController::register
methods: [POST]
api_confirm:
path: /apiv2/number_confirm
controller: App\Controller\CustomerAppAPI\AuthController::confirmNumber
methods: [POST]
api_validate:
path: /apiv2/code_validate
controller: App\Controller\CustomerAppAPI\AuthController::validateCode
methods: [POST]
api_info_get:
path: /apiv2/info
controller: App\Controller\CustomerAppAPI\CustomerController::getInfo
methods: [GET]
api_info_update:
path: /apiv2/info
controller: App\Controller\CustomerAppAPI\CustomerController::updateInfo
methods: [POST]
api_status:
path: /apiv2/status
controller: App\Controller\CustomerAppAPI\CustomerController::getStatus
methods: [GET]
api_vehicle_mfg_list:
path: /apiv2/vehicle/mfgs
controller: App\Controller\CustomerAppAPI\VehicleController::listVehicleManufacturers
methods: [GET]
api_vehicle_make_list:
path: /apiv2/vehicle/mfgs/{mfg_id}/makes
controller: App\Controller\CustomerAppAPI\VehicleController::listVehicleMakes
methods: [GET]
api_cust_vehicle_add:
path: /apiv2/vehicles
controller: App\Controller\CustomerAppAPI\VehicleController::addVehicle
methods: [POST]
api_cust_vehicle_update:
path: /apiv2/vehicles/{id}
controller: App\Controller\CustomerAppAPI\VehicleController::updateVehicle
methods: [POST]
api_cust_vehicle_list:
path: /apiv2/vehicles
controller: App\Controller\CustomerAppAPI\VehicleController::listVehicles
methods: [GET]
api_promo_list:
path: /apiv2/promos
controller: App\Controller\CustomerAppAPI\PromoController::listPromos
methods: [GET]
api_battery_list:
path: /apiv2/vehicles/{vid}/compatible_batteries
controller: App\Controller\CustomerAppAPI\VehicleController::getCompatibleBatteries
methods: [GET]
api_jo_request:
path: /apiv2/job_order
controller: App\Controller\CustomerAppAPI\JobOrderController::requestJobOrder
methods: [POST]
api_estimate:
path: /apiv2/estimate
controller: App\Controller\CustomerAppAPI\EstimateController::getEstimate
methods: [POST]
api_ongoing:
path: /apiv2/job_order/ongoing
controller: App\Controller\CustomerAppAPI\JobOrderController::getOngoing
methods: [GET]
api_rider_status:
path: /apiv2/rider
controller: App\Controller\CustomerAppAPI\RiderController::getRiderStatus
methods: [GET]
api_rider_rating_add:
path: /apiv2/rider_rating
controller: App\Controller\CustomerAppAPI\RiderController::addRiderRating
methods: [POST]
api_jo_cancel:
path: /apiv2/job_order/cancel
controller: App\Controller\CustomerAppAPI\JobOrderController:cancelJobOrder
methods: [POST]
api_jo_history:
path: /apiv2/job_order/history
controller: App\Controller\CustomerAppAPI\JobOrderController:getJOHistory
methods: [GET]
api_jo_invoice:
path: /apiv2/job_order/invoice
controller: App\Controller\CustomerAppAPI\JobOrderController:getJOInvoice
methods: [GET]
api_device_id:
path: /apiv2/device_id
controller: App\Controller\CustomerAppAPI\DeviceController:updateDeviceID
methods: [POST]
api_privacy:
path: /apiv2/privacy
controller: App\Controller\CustomerAppAPI\PrivacyController:privacySettings
methods: [POST]
api_resend_code:
path: /apiv2/resend_code
controller: App\Controller\CustomerAppAPI\AuthController:resendCode
methods: [POST]
api_location_support:
path: /apiv2/location_support
controller: App\Controller\CustomerAppAPI\LocationController:locationSupport
methods: [GET]
api_activate_warranty:
path: /apiv2/activate_warranty
controller: App\Controller\CustomerAppAPI\WarrantyController:activateWarranty
methods: [POST]
api_service_list:
path: /apiv2/services
controller: App\Controller\CustomerAppAPI\ServiceController:listServices
methods: [GET]
api_partner_info:
path: /apiv2/partners/{pid}
controller: App\Controller\CustomerAppAPI\PartnerController:getPartnerInformation
methods: [GET]
api_partner:
path: /apiv2/partners
controller: App\Controller\CustomerAppAPI\PartnerController:getClosestPartners
methods: [GET]
api_partner_review:
path: /apiv2/partners/{pid}/review
controller: App\Controller\CustomerAppAPI\PartnerController:reviewPartner
methods: [POST]
api_nearest_hub_slots:
path: /apiv2/hub_slots
controller: App\Controller\CustomerAppAPI\LocationController::getNearestHubAndSlots
methods: [GET]
api_new_jo_request:
path: /apiv2/new_job_order
controller: App\Controller\CustomerAppAPI\JobOrderController::newRequestJobOrder
methods: [POST]
api_version_check:
path: /apiv2/version_check
controller: App\Controller\CustomerAppAPI\AppController::versionCheck
methods: [GET]
api_schedule_option_status:
path: /apiv2/schedule_option_status
controller: App\Controller\CustomerAppAPI\ScheduleController::scheduleOptionStatus
methods: [GET]
# paperless warranty / qr code
api_warr_serial_check:
path: /apiv2/warranty/{serial}
controller: App\Controller\CustomerAppAPI\WarrantyController::warrantyCheck
methods: [GET]
api_warr_serial_register:
path: /apiv2/warranty/{serial}
controller: App\Controller\CustomerAppAPI\WarrantyController::warrantyRegister
methods: [POST]
api_jo_info:
path: /apiv2/job_order/{id}/info
controller: App\Controller\CustomerAppAPI\JobOrderController::getJobOrderInfo
methods: [GET]
api_ongoing_job_orders:
path: /apiv2/job_orders/ongoing
controller: App\Controller\CustomerAppAPI\JobOrderController::getAllOngoingJobOrders
methods: [GET]
api_ongoing_jo_count:
path: /apiv2/job_orders/ongoing/count
controller: App\Controller\CustomerAppAPI\JobOrderController::getOngoingJobOrderCount
methods: [GET]
api_new_location:
path: /apiv2/new_location
controller: App\Controller\CustomerAppAPI\LocationController::addLocation
methods: [POST]
api_locations:
path: /apiv2/locations
controller: App\Controller\CustomerAppAPI\LocationController::getLocations
methods: [GET]
api_cust_vehicle_remove:
path: /apiv2/vehicles/{id}/remove
controller: App\Controller\CustomerAppAPI\VehicleController::removeVehicle
methods: [POST]
api_latest_job_order:
path: /apiv2/job_order/latest
controller: App\Controller\CustomerAppAPI\JobOrderController::getLatestJobOrder
methods: [GET]
api_customer_hash_get:
path: /apiv2/customer_hash
controller: App\Controller\CustomerAppAPI\CustomerController::getCustomerHash
methods: [GET]
#api_completed_job_orders:
# path: /apiv2/job_orders/completed
# controller: App\Controller\CustomerAppAPI\JobOrderController::getCompletedJobOrders
# methods: [GET]