<?php

// 第三方平台维护
Route::group(['namespace'=>'Wechat\ThirdWx'],function(){
	Route::any('wx/receive_ticket', 'MsgsController@receive_component_verify_ticket');
	
	Route::any('oauth/oauth_platform', 'OauthPlatformsController@oauth_platform');
// 	Route::any('oauth/oauth_platform_callback', 'OauthPlatformsController@oauth_platform_callback');
	Route::any('oauth/{param}/oauth_platform_callback', 'OauthPlatformsController@oauth_platform_callback')->where('param', '(.*\*.*)?');
	
	Route::any('oauth/auto_set_menu_and_template_test', 'OauthPlatformsController@auto_set_menu_and_template_test');
	
});

// 菜单设置
Route::group(['namespace'=>'Wechat\Menu'],function(){
	Route::any('menu/set_menu', 'MenusController@set_menu');
});

// 模板消息设置
Route::group(['namespace'=>'Wechat\Template'],function(){
	Route::any('template/auto_set_dustry_templates', 'TemplateBasesController@auto_set_dustry_templates');
	Route::any('template/get_industry', 'TemplateBasesController@get_industry');
	Route::any('template/get_private_templates', 'TemplateBasesController@get_private_templates');
	Route::any('template/delete_private_template', 'TemplateBasesController@delete_private_template');
	Route::any('template/set_template_notices', 'TemplateBasesController@set_template_notices');
});

// 公众号消息回调
Route::group(['namespace'=>'Wechat\GzhMsg'],function(){
    // 	http://domain/$APPID$/callback
	Route::any('{appid}/callback','GzhMsgsController@index')->where('appid', '(wx.*)?');
	Route::any('{appid}/test_unit_func','GzhMsgsController@test_unit_func')->where('appid', '(wx.*)?');
	
});

// 网页授权
Route::group(['namespace'=>'Wechat\Oauth'],function(){
	Route::any('wechat/user_oauth','UserOauthsController@user_oauth');
	Route::any('user_oauth','UserOauthsController@user_oauth');
	Route::any('oauth_callback','UserOauthsController@oauth_callback');
	Route::any('oauth/show_openid','UserOauthsController@show_openid');
});

// 微信支付
Route::group(['namespace'=>'Wechat\Pay'],function(){
	Route::any('pay/create_wxpay_order','PaysController@create_wxpay_order');
	Route::any('pay/notify','PaysController@notify');
	Route::any('create_wxpay_order','PaysController@create_wxpay_order');
	Route::any('pay/index','PaysController@index');
});

// 数据统计
Route::group(['namespace'=>'Wechat\Statistic'],function(){
});

// 对外接口（被其他项目调用）
Route::group(['namespace'=>'Wechat\Api'],function(){
	Route::any('api/get_qrcode_url','WechatOuterApisController@get_qrcode_url');
	Route::any('api/upload_gzh_img','WechatOuterApisController@upload_gzh_img');
	Route::any('api/upload_gzh_article','WechatOuterApisController@upload_gzh_article');
	Route::any('api/upload_gzh_articles','WechatOuterApisController@upload_gzh_articles');
	Route::any('api/upload_material_img','WechatOuterApisController@upload_material_img');
	Route::any('api/add_public_template','WechatOuterApisController@add_public_template');
	Route::any('api/get_full_official_account_users','WechatOuterApisController@get_full_official_account_users');
	Route::any('api/check_official_account_templates','WechatOuterApisController@check_official_account_templates');
	Route::any('api/del_menu','WechatOuterApisController@del_menu');
	Route::any('api/get_userinfo','WechatOuterApisController@get_userinfo');
	Route::any('api/get_short_url','WechatOuterApisController@get_short_url');
	Route::any('api/check_template_status','WechatOuterApisController@check_template_status');
	
	Route::any('api/get_authorizer_list','WechatOpApisController@get_authorizer_list');
	
	//获取用户统计
    Route::any('api/get_gzh_statistics','WechatOuterApisController@get_gzh_statistics');

    //test
	Route::any('api/test_connect_db','TestApisController@test_connect_db');
	Route::any('api/test_connect_redis','TestApisController@test_connect_redis');
	Route::any('api/test_search','TestApisController@test_search');
	
});

// 定时调度接口
Route::group(['namespace'=>'Wechat\Command'],function(){
	Route::any('api/check_gzh_ban','GzhBanAlertController@check_gzh_ban');

});


// 消息队列
Route::group(['namespace'=>'Queue\Template'],function(){
	Route::any('queue/add_template_task','AddTemplateTasksController@add_template_task');
	Route::any('queue/test_send_template','AddTemplateTasksController@test_send_template');
	
	Route::any('queue/add_news_task','AddNewsTasksController@add_news_task');
	Route::any('queue/test_send_news','AddNewsTasksController@test_send_news');
	
	Route::any('queue/add_texts_task','AddTextsTasksController@add_texts_task');
	Route::any('queue/test_send_texts','AddTextsTasksController@test_send_texts');
	
	Route::get('queue/test','QueuedController@Test');
	
});

Route::get('/test','QueuedController@Test');

// 微信验证文件MP_verify_llzpVQoJadKcUCRR.txt
// Route::redirect('/here', '/there', 301);
Route::any('wechat/MP_verify{param}.txt', 'Wechat\Api\MPverifysController@mp_verify')->where('param', '(.*)?');
Route::any('MP_verify{param}.txt', 'Wechat\Api\MPverifysController@mp_verify')->where('param', '(.*)?');


