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