api.php 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. use Illuminate\Http\Request;
  3. use Illuminate\Support\Facades\Route;
  4. /*
  5. |--------------------------------------------------------------------------
  6. | API Routes
  7. |--------------------------------------------------------------------------
  8. |
  9. | Here is where you can register API routes for your application. These
  10. | routes are loaded by the RouteServiceProvider within a group which
  11. | is assigned the "api" middleware group. Enjoy building your API!
  12. |
  13. */
  14. Route::get("getUserInfo", 'LoginController@getUserInfo')->middleware("access.restriction");
  15. Route::get("resetNameOrPwd", 'LoginController@resetNameOrPwd')->middleware("access.restriction");
  16. Route::prefix("v1")->group(function (){
  17. Route::middleware('throttle:' . config('api.rate_limits.sign'))
  18. ->group(function () {
  19. //登录
  20. Route::POST('login', 'LoginController@login');
  21. });
  22. Route::middleware(['throttle:' . config('api.rate_limits.access'),"authorizing"])
  23. ->group(function () {
  24. Route::prefix("waybill")->group(function () {
  25. Route::prefix("dispatch")->group(function () {
  26. Route::GET('/', 'WaybillController@getData');
  27. Route::POST('/', 'WaybillController@dispatch');
  28. Route::POST('dailyBilling', 'WaybillController@dailyBilling');
  29. });
  30. });
  31. Route::prefix("order")->group(function () {
  32. Route::GET('batchRecover', 'OrderController@recoverBatch');
  33. });
  34. Route::prefix("inventory")->group(function () {
  35. Route::get('inventoryTask', 'InventoryController@getInventoryTask');
  36. Route::POST('locationInvPro', 'InventoryController@locationInvPro');
  37. Route::POST('getInventoryDetail', 'InventoryController@getInventoryDetail');
  38. Route::POST('stockInventory', 'InventoryController@stockInventory');
  39. Route::POST('skipInventory', 'InventoryController@skipInventory');
  40. });
  41. });
  42. });