api.php 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?php
  2. /*
  3. |--------------------------------------------------------------------------
  4. | Application Routes
  5. |--------------------------------------------------------------------------
  6. |
  7. | Here is where you can register all of the routes for an application.
  8. | It is a breeze. Simply tell Lumen the URIs it should respond to
  9. | and give it the Closure to call when that URI is requested.
  10. |
  11. */
  12. $api = app('Dingo\Api\Routing\Router');
  13. $api->version('v1', [
  14. 'namespace' => 'App\Http\Controllers\V1',
  15. ], function ($api) {
  16. //登陆
  17. $api->post('login', 'AuthController@login');
  18. //获取商户信息
  19. $api->post('getShopInfo', 'ShopController@getTokenShop');
  20. $api->get('statistics', 'IndexController@index');
  21. $api->get('statistics/sales', 'IndexController@sales');
  22. $api->group(['middleware' => 'auth:api'], function ($api) {
  23. //注册
  24. $api->post('reg', 'AuthController@register');
  25. //登出
  26. $api->post('logout', 'AuthController@logout');
  27. //刷新身份令牌
  28. $api->post('refresh', 'AuthController@refresh');
  29. });
  30. $api->group(['middleware' => 'chxq.shop_check'], function ($api) {
  31. $api->get('statistics', 'IndexController@index');
  32. $api->get('statistics/sales', 'IndexController@sales');
  33. });
  34. $api->group(['middleware' => 'jwt.chxq_auth'], function ($api) {
  35. //新增编辑
  36. $api->post('addShop', 'ShopController@addShop');
  37. //编辑
  38. $api->put('editShop', 'ShopController@editShop');
  39. //商户列表
  40. $api->get('shopList', 'ShopController@list');
  41. //用户列表
  42. //商户详情
  43. $api->get('shopView', 'ShopController@view');
  44. //修改状态
  45. $api->put('isOpen', 'ShopController@isOpen');
  46. $api->get('user', 'UserController@index');
  47. //公共配置
  48. $api->post('configIndex', 'ConfigController@index');
  49. });
  50. });