<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
use think\Route;


// 注册路由到index模块的News控制器的read操作
/*Route::get(['/', '/:d'], 'index/index');
Route::get(['/well', '/w'], 'index/wellCome');
Route::get('/s', 'index/wellCome');*/


//推荐这种风格 注明控制器
/*IndexController*/
/*Route::rule([
    '/' => 'index/index',
    '/well' => 'index/wellCome',
    '/re' => 'index/read'
], '', 'GET|POST');
// 检测路由规则仅GET请求有效
Route::any('new/:id','News/read',['method'=>'get']);
// 检测路由规则仅GET和POST请求有效
Route::any('new/:id','News/read',['method'=>'get|post']);

Route::get('/he/:id', 'index/hello');

/*StoreController
Route::rule([
    '/saveStore' => 'store/save'
], '', 'GET');


/*Error
Route::rule(['/city/:name' => 'error/index'] , '' ,'GET');*/

Route::group('index',[
    'member' => ['index/member.index/member',['method' => 'get']],
     'home' => ['index/member.index/home',['method' => 'get']]
]);
Route::group('api',[
    //get
    'sendSms/:phone' => ['api/member/sendSms', ['method' => 'get']],   //发送短信
    'index' => ['api/member/index', ['method' => 'get']],
    
    //get broker
    'getBroker'=> ['api/broker/index',['method'=>'get']],
    //post broker
    'appraiser'=> ['api/broker/appraiser',['method'=>'post']],

    
    //post member
    'login' => ['api/member/login',['method' => 'post']],           //c端登陆
    'register' => ['api/member/register',['method'=> 'post']],  //注册|邀请注册|编辑

    //post shop
     'shopList' => ['api/shop/getShopList', ['method' => 'post']],
     'shopDetail' => ['api/shop/getShopDetail', ['method' => 'get']],

    //get banner
    'bannerList' => ['api/banner/getBannerList', ['method' => 'get']],

    //get averagePriceAndTurnover
    'averagePriceAndTurnover' => ['api/index/averagePriceAndTurnover',['method' => 'get']]




]);

Route::miss('api/index/miss');//处理错误的url