123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112 |
- <?php
- use Illuminate\Http\Request;
- /*
- |--------------------------------------------------------------------------
- | API Routes
- |--------------------------------------------------------------------------
- |
- | Here is where you can register API routes for your application. These
- | routes are loaded by the RouteServiceProvider within a group which
- | is assigned the "api" middleware group. Enjoy building your API!
- |
- */
- # 接管路由
- $api = app('Dingo\Api\Routing\Router');
- /** @var TYPE_NAME $api */
- $api->version('v1', function ($api) {
- $api->group([
- 'namespace' => 'App\Http\Controllers\Api\V1',
- 'middleware' => ['serializer:array', 'cross'],//'api.throttle',
- 'limit' => config('api.rate_limits.sign.limit'),
- 'expires' => config('api.rate_limits.sign.expires'),
- ], function ($api) {
- $api->get('addttt', 'HomeController@add'); #test
- $api->get('testdata', 'HomeController@testdata'); #test
- # 授权登录-code交换openid,session_key
- $api->any('/wxappLogin', 'AuthorizationsController@wxappLogin');
- #账号密码登录
- $api->post('/store', 'AuthorizationsController@store');
- # 微信授权登录测试
- /** -------------------- 游客可以访问的接口----------------------------------------------------------------------------------------*/
- $api->get('getNotice', 'MessageController@getNotice'); # 获取网站公告
- $api->get('notification', 'MessageController@notification'); # 消息通知
- $api->get('lockDetails', 'MessageController@lockDetails'); # 获取网站公告详情
- $api->get('makeHome', 'MakeJobsController@getMakeHomeShow'); # 预约页面-时间、设备、时间段
- $api->get('banner', 'IndexController@banner'); # banner
- $api->get('introduction', 'IndexController@introduction'); # 简介
- /** -------------------- 需要 token 验证的接口 refresh 定时刷新token------------------------------------------------------------------*/
- $api->group(['middleware' => ['refresh', 'jwt.auth']], function ($api) {
- $api->get('make-page-info', 'MakeJobsController@makePageInfo'); # 当前登录用户信息
- $api->post('decrypt', 'UserCenterController@decrypt'); #解密手机号
- // $api->post('sendCode', 'UserCenterController@sendCode'); #获取手机号验证码
- $api->post('verificationCodes', 'VerificationCodesController@store')->name('api.verificationCodes.store'); # 短信验证码
- $api->post('is_verification', 'UsersController@isVerification'); # 短信验证码校验
- $api->post('setPhone', 'UserCenterController@setPhone'); # 更新手机号验证码
- # 用户信息相关
- $api->group(['prefix' => 'user'], function ($api) {
- $api->get('info', 'UsersController@me'); # 当前登录用户信息
- $api->post('set-user-info', 'UserCenterController@setUserInfo'); # 修改当前用户信息
- $api->post('my-make-list', 'MakeJobsController@myMakeList'); # 我的预约列表
- $api->post('coupons-list', 'UserTicketController@getList'); # 优惠卷列表
- $api->post('cancel-make-info', 'MakeJobsController@cancelMakeInfo'); # 取消预约
- $api->post('change-website', 'UsersController@changeUserWebsite'); # 取消预约
- });
- # 获取默认店铺
- $api->get('getShop', 'WebsitesController@getShop');
- $api->get('shops', 'WebsitesController@shops');
- //is_material 检测手机号是否存在
- $api->group(['middleware' => ['is_material']], function ($api) {
- #token 相关
- /*$api->group(['prefix' => 'authorizations'], function ($api) {
- # 刷新token
- $api->put('current', 'AuthorizationsController@update')->name('api.authorizations.update');
- # 删除token
- $api->delete('current', 'AuthorizationsController@destroy')->name('api.authorizations.destroy');
- });*/
- # 获取配置信息列表
- $api->post('make-config-list', 'MakeJobsController@makeConfigList');
- # 预约
- $api->post('make', 'MakeJobsController@make'); # 预约
- $api->post('make_detect', 'MakeJobsController@makeDetect'); # 预约 检测
- });
- $api->get('operationAnalysis', 'SiteController@operationAnalysis'); #站点经营分析
- $api->get('siteList', 'SiteController@siteList'); #站点列表
- $api->get('userManage', 'SiteController@userManage'); #学员管理
- $api->get('paymentRecords', 'SiteController@paymentRecords'); #收款记录
- });
- $api->post('authorizations', 'AuthorizationsController@store')->name('api.authorizations.store'); # 登录
- /*$api->post('verificationCodes', 'VerificationCodesController@store')->name('api.verificationCodes.store'); # 短信验证码
- $api->get('is_verification', 'UsersController@isVerification'); # 短信验证码校验
- $api->post('users', 'UsersController@store')->name('api.users.store'); # 用户注册
- $api->post('forget_password', 'UsersController@forgetPassword'); # 忘记密码
- $api->post('authorizations', 'AuthorizationsController@store')->name('api.authorizations.store'); # 登录
- */
- });
- });
|