菜谱项目

api.php 4.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <?php
  2. /*
  3. |--------------------------------------------------------------------------
  4. | API Routes
  5. |--------------------------------------------------------------------------
  6. |
  7. | Here is where you can register API routes for your application. These
  8. | routes are loaded by the RouteServiceProvider within a group which
  9. | is assigned the "api" middleware group. Enjoy building your API!
  10. |
  11. */
  12. $api = app('Dingo\Api\Routing\Router');
  13. $api->version('v1', ['namespace' => 'App\Api\V1\Controllers'], function ($api) {
  14. // $api->group(['middleware' => 'sign.token'], function($api) {
  15. //发送验证码
  16. // $api->post('user/sendode', 'UserController@sendcode');
  17. $api->post('user/logincode', 'UserController@loginCode');
  18. //账户密码登陆
  19. $api->post('user/login', 'UserController@login');
  20. //微信登陆
  21. $api->post('user/weChatLogin', 'UserController@weChatLogin');
  22. //验证码动态登陆
  23. //Route::post('codeLogin', 'UserController@codeLogin');
  24. //注册
  25. $api->post('user/register', 'UserController@register');
  26. //检查手机号是否被注册
  27. $api->post('user/checkMobile', 'UserController@checkMobile');
  28. //发送验证码
  29. $api->post('user/sendCode', 'UserController@sendCode');
  30. //校验验证码
  31. $api->post('user/validateCode', 'UserController@validateCode');
  32. //找回密码
  33. $api->post('user/getNewPassword', 'UserController@getNewPassword');
  34. //登陆后才能使用的
  35. $api->group(['middleware' => 'token.auth'], function ($api) {
  36. // Endpoints registered here will have the "foo" middleware applied.
  37. //获取用户个人信息
  38. // $api->get('personalCenter', 'UserController@personalCenter');
  39. //修改用户信息
  40. $api->post('user/updatePersonalCenter', 'UserController@updatePersonalCenter');
  41. //修改密码
  42. $api->post('user/updatePassword', 'UserController@updatePassword');
  43. //绑定手机号
  44. $api->post('user/bindMobile', 'UserController@bindMobile');
  45. //绑定微信号
  46. $api->post('user/bindWeChat', 'UserController@bindWeChat');
  47. $api->get('user/personalcentor', 'UserController@personalCentor');
  48. $api->get('user/logout', 'UserController@logout');
  49. //用户反馈
  50. $api->post('user_message/feedBack', 'UserMessageController@feedBack');
  51. });
  52. //功能列表
  53. $api->post('features/getCategoryList', 'FeaturesController@getCategoryList');
  54. $api->post('features/getTagList', 'FeaturesController@getTagList');
  55. $api->post('features/getMenuList', 'FeaturesController@getMenuList');
  56. $api->post('features/getMenu', 'FeaturesController@getMenu');
  57. $api->post('features/getRecommend', 'FeaturesController@getRecommend');
  58. $api->post('features/getBannerRecommend', 'FeaturesController@getBannerRecommend');
  59. $api->post('features/getRecommendTag', 'FeaturesController@getRecommendTag');
  60. $api->post('features/selectIngredients', 'FeaturesController@selectIngredients');
  61. $api->post('features/selectTag', 'FeaturesController@selectTag');
  62. $api->post('features/selectAll', 'FeaturesController@selectAll');
  63. $api->post('features/getHotSearch', 'FeaturesController@getHotSearch');
  64. $api->post('features/feedBack', 'FeaturesController@feedBack');
  65. //收藏
  66. $api->post('features/addCollection', 'FeaturesController@addCollection');
  67. //2.0菜谱
  68. //早中晚专题
  69. $api->post('features/earlyMiddleAndLateTheme', 'FeaturesController@earlyMiddleAndLateTheme');
  70. //其他专题
  71. $api->post('features/otherTheme', 'FeaturesController@otherTheme');
  72. //最近50条菜谱
  73. $api->post('features/theLastRecipes', 'FeaturesController@theLastRecipes');
  74. //菜谱列表详情
  75. $api->post('features/menuList', 'FeaturesController@menuList');
  76. //菜谱详情
  77. $api->post('features/menuDetail', 'FeaturesController@menuDetail');
  78. //文章列表
  79. $api->post('features/articleList', 'FeaturesController@articleList');
  80. //文章详情
  81. $api->post('features/articleDetail', 'FeaturesController@articleDetail');
  82. //发现页面
  83. $api->post('finds/getFinds', 'FindsController@getFinds');
  84. });