<?php

Route::group(['domain'=>env('WECHAT_DOMAIN'),'namespace'=>'App\Http\Controllers\Wechat\OfficialAccount','prefix'=>'api'],function(){

    /**
    * 公众号
    */

	//获取公众号信息
    Route::any('OfficialAccount/officialAccountByAppid', 'OfficialAccountsController@officialAccountByAppid');

    //获取一个可分发的公众号
    Route::any('OfficialAccount/canUseOfficialAccountByChannelId', 'OfficialAccountsController@canUseOfficialAccountByChannelId');

    //授权公众号信息
    Route::any('OfficialAccount/authOfficialAccount','OfficialAccountsController@authOfficialAccount');

    //分销渠道ID获取服务号列表
    Route::any('OfficialAccount/allOfficialAccountBydistributionChannelId','OfficialAccountsController@allOfficialAccountBydistributionChannelId');

    //根据分销渠道ID获取授权公众号
    Route::any('OfficialAccount/officialAuthAccountBydistributionChannelId', 'OfficialAccountsController@officialAuthAccountBydistributionChannelId');

    //取消公众号授权
    Route::any('OfficialAccount/cancelAuthOfficialAccount','OfficialAccountsController@cancelAuthOfficialAccount');

    //服务号授权返回URL
    Route::any('OfficialAccount/officialAccountAuthUrl','OfficialAccountsController@officialAccountAuthUrl');

    //更新公众号信息
    Route::any('OfficialAccount/updateOfficialAccount','OfficialAccountsController@updateOfficialAccount');

    //测试发送客服消息
    Route::any('OfficialAccount/sendNewsTask','WechatCustomerMsgController@sendNewsTask');
    
    /**
     * 监控
     */
    // 检查公众号是否被封
    Route::any('OfficialAccount/check_gzh_ban', 'OfficialAccountService@check_gzh_ban');

    /**
    * 模板消息
    */

    //获取模板
    Route::any('OfficialAccount/wechatTemplateByAppidAndCommonTemplateId', 'WechatTemplatesController@wechatTemplateByAppidAndCommonTemplateId');

    //通过ID获取模板
    Route::any('OfficialAccount/wechatTemplateMsgById', 'WechatTemplatesController@wechatTemplateMsgById');

    //更新模板消息任务状态
    Route::any('OfficialAccount/updateWechatTemplateStatus', 'WechatTemplatesController@updateWechatTemplateStatus');

    //更新模板消息
    Route::any('OfficialAccount/updateWechatTemplateMsgById', 'WechatTemplatesController@updateWechatTemplateMsgById');

    //得到要开通的模板消息列表
    Route::any('OfficialAccount/wechatPublicTemplateList', 'WechatPublicTemplatesController@wechatPublicTemplateList');

    //保存模板
    Route::any('OfficialAccount/addWechatTemplate', 'WechatTemplatesController@addWechatTemplate');

    //更新模板
    Route::any('OfficialAccount/updateWechatTemplateId', 'WechatTemplatesController@updateWechatTemplateId');
    
    //发送模板消息
    Route::any('OfficialAccount/addWechatTemplateMsg', 'WechatTemplatesController@addWechatTemplateMsg');

    //测试发送模板消息
    Route::any('OfficialAccount/testAddWechatTemplateMsg', 'WechatTemplatesController@testAddWechatTemplateMsg');

    //测试RebitMQ
    Route::any('OfficialAccount/testRebitMQ', 'WechatTemplatesController@testRebitMQ');

    //个人测试发送模板消息
    Route::any('OfficialAccount/test_add_template_task', 'WechatTemplatesController@test_add_template_task');

    //获取推送模板消息
    Route::any('OfficialAccount/wechatTemplateMsgBydistributionChannelId', 'WechatTemplatesController@wechatTemplateMsgBydistributionChannelId');



    /**
    * 强制关注用户
    */

    //获取强关用户
    Route::any('OfficialAccount/forceSubscribeUsersByAppidAndOpenId', 'ForceSubscribeUsersController@forceSubscribeUsersByAppidAndOpenId');   

    //appid获取强关用户
    Route::any('OfficialAccount/forceSubscribeUsersByUid', 'ForceSubscribeUsersController@forceSubscribeUsersByUid');

    //添加强关用户
    Route::any('OfficialAccount/addForceSubscribeUsers', 'ForceSubscribeUsersController@addForceSubscribeUsers');

    //强制关注用户
    Route::any('OfficialAccount/subscribeForceSubscribeUsers', 'ForceSubscribeUsersController@subscribeForceSubscribeUsers');

    //取消强制关注
    Route::any('OfficialAccount/cancelForceSubscribeUsers', 'ForceSubscribeUsersController@cancelForceSubscribeUsers');

    //强关用户与公众号最后交互时间更新
    Route::any('OfficialAccount/forceSubscribeUsersLastTimeUpdate', 'ForceSubscribeUsersController@forceSubscribeUsersLastTimeUpdate');
    
    //强关用户uid强制更新
    Route::any('OfficialAccount/updateForceSubscribeUsers', 'ForceSubscribeUsersController@updateForceSubscribeUsers');
    
    //根据渠道号，appid，openid获取用户
    Route::any('OfficialAccount/forceSubscribeUsersByOpenidAndAppidAndChannelId', 'ForceSubscribeUsersController@forceSubscribeUsersByOpenidAndAppidAndChannelId');
    
    //根据渠道号，openid获取素材强关映射
    Route::any('OfficialAccount/getMaterialForceSubscribeMapping', 'ForceSubscribeUsersController@getMaterialForceSubscribeMapping');
    
    
    
    /**
    * ----------------------方法测试--START
    */
    //测试queue延迟队列
    Route::any('OfficialAccount/testGetSimpleChannelBook', 'WechatTestController@getSimpleChannelBook');

    //测试queue延迟队列
    Route::any('OfficialAccount/testSendMailDelayQueue', 'WechatTestController@testSendMailDelayQueue');

    //从redis中取officialaccount或者从数据库中取并更新redis
    Route::any('OfficialAccount/officialAccountByAppidTestRedis', 'WechatTestController@officialAccountByAppidTestRedis');

    //同步official_account表至Redis
    Route::any('OfficialAccount/updateOfficialToRedisTest', 'WechatTestController@updateOfficialToRedisTest');

    //从Redis中取一个公众号
    Route::any('OfficialAccount/getOfficialFromRedis', 'WechatTestController@getOfficialFromRedis');

    //从Redis中取一个客服消息
    Route::any('OfficialAccount/getWechatMsgRedis', 'WechatTestController@getWechatMsgRedis');

    //sign参数
    Route::any('OfficialAccount/getSignTest', 'WechatTestController@getSignTest');
    
    //获取渠道下所有的服务号信息
    Route::any('OfficialAccount/allOfficialAccountBydistributionChannelId', 'WechatTestController@allOfficialAccountBydistributionChannelId');

    //获取渠道的服务号数量
    Route::any('OfficialAccount/officialAccountCountByChannelId', 'WechatTestController@officialAccountCountByChannelId');
    
    //通过渠道号和时间获取用户数
    Route::any('OfficialAccount/forceSubscribeUserCountByChannelIdAndDate', 'ForceSubscribeUsersController@forceSubscribeUserCountByChannelIdAndDate');

    //通过渠道号和时间获取用户数
    Route::any('OfficialAccount/customerImgUrlByChannelId', 'ForceSubscribeUsersController@customerImgUrlByChannelId');

    //测试上传客服图片
    Route::any('OfficialAccount/uploadCustomerImgUrl', 'ForceSubscribeUsersController@uploadCustomerImgUrl');

    //根据模板消息参数获取用户
    Route::any('OfficialAccount/forceUserCountByTemplatePrams', 'WechatTemplatesController@forceUserCountByTemplatePrams');

    //测试文字格式的模板消息发送
    Route::any('OfficialAccount/testSendTextOfficialMsg', 'ForceSubscribeUsersController@testSendTextOfficialMsg');

    //客服消息开关设置
    Route::any('OfficialAccount/customMsgSwitchSetting', 'WechatCustomerMsgController@customMsgSwitchSetting');
    //客服消息开关列表获取
    Route::any('OfficialAccount/customMsgSwitchsByChannelId', 'WechatCustomerMsgController@customMsgSwitchsByChannelId');
    //获取指定客服消息开关
    Route::any('OfficialAccount/customMsgSwitchsByChannelCate', 'WechatCustomerMsgController@customMsgSwitchsByChannelCate');

    //发送客服消息列表获取
    Route::any('OfficialAccount/customSendMsgsByChannelId', 'WechatCustomerMsgController@customSendMsgsByChannelId');
    //通过ID获取指定客服消息
    Route::any('OfficialAccount/customSendMsgsById', 'WechatCustomerMsgController@customSendMsgsById');
    //停止发送客服消息
    Route::any('OfficialAccount/stopCustomSendMsgsById', 'WechatCustomerMsgController@stopCustomSendMsgsById');
    //发送客服消息
    Route::any('OfficialAccount/addCustomSendMsgs', 'WechatCustomerMsgController@addCustomSendMsgs');
    //测试发送客服消息
    Route::any('OfficialAccount/testAddCustomSendMsgs', 'WechatCustomerMsgController@testAddCustomSendMsgs');


    //测试3天回本12小时推送
    Route::any('OfficialAccount/add_news_recovery_push_hot', 'WechatCustomerMsgController@add_news_recovery_push_hot');
    //测试3天回本24小时推送
    Route::any('OfficialAccount/add_news_recovery_push_activity', 'WechatCustomerMsgController@add_news_recovery_push_activity');
    //测试发送定制书籍推送
    Route::any('OfficialAccount/add_news_point_book', 'WechatCustomerMsgController@add_news_point_book');
    //测试发送热门书籍推送
    Route::any('OfficialAccount/add_news_top_book', 'WechatCustomerMsgController@add_news_top_book');
    //测试发送未支付订单提醒
    Route::any('OfficialAccount/sendUnpaid', 'WechatCustomerMsgController@sendUnpaid');
    
    //支付用户每日推送提醒
    Route::any('OfficialAccount/add_template_pay_push_daily', 'WechatCustomerMsgController@add_template_pay_push_daily');

    //获取每日智能推送分析数据
    Route::any('OfficialAccount/customSendDayStatsByChannelAndFrom', 'CustomSendStatsController@customSendDayStatsByChannelAndFrom');
    //获取渠道下智能推送分析总数据
    Route::any('OfficialAccount/customSendStatsByChannelAndFrom', 'CustomSendStatsController@customSendStatsByChannelAndFrom');


    //获取所有图库素材
    Route::any('OfficialAccount/getAllDocumentCovers', 'WechatCustomerMsgController@getAllDocumentCovers');
    //获取所有标签文案
    Route::any('OfficialAccount/getAllHeadlinesNoType', 'WechatCustomerMsgController@getAllHeadlinesNoType');

    //获取图文链接
    Route::any('OfficialAccount/createOfficialImgTxtUrl', 'WechatCustomerMsgController@createOfficialImgTxtUrl');
    //获取图文链接列表
    Route::any('OfficialAccount/getOfficialImgTxtUrl', 'WechatCustomerMsgController@getOfficialImgTxtUrl');
    
    /**
    * ----------------------方法测试--END
    */

    /**
    * 公众号事件交互
    */

    //公众号事件交互
    Route::any('OfficialAccount/officialInteractiveEventFeedback', 'OfficialInteractiveEventController@officialInteractiveEventFeedback');



    /**
    * 公众号菜单
    */

    //获取菜单列表
    Route::any('OfficialAccount/officialMenusList', 'OfficialMenusController@officialMenusList');



    /**
    * 分销用户
    */

    //保存公众号用户
    Route::any('OfficialAccount/saveOfficialWechatUser', 'OfficialWechatUserController@saveOfficialWechatUser');

    //获取公众号用户
    Route::any('OfficialAccount/getOfficialWechatUser', 'OfficialWechatUserController@getOfficialWechatUser');


});

Route::group(['domain'=>env('WECHAT_DOMAIN'),'namespace'=>'App\Http\Controllers\Manage\DailyReport','prefix'=>'api'],function(){
    Route::any('public/getSendOrderDaliyData', 'SendOrderController@getSendOrderDaliyData');
    Route::any('public/getYeserdaySendOrderData', 'SendOrderController@getYeserdaySendOrderData');
    Route::any('public/getPromoterSendOrderData', 'SendOrderController@getPromoterSendOrderData');
    Route::any('public/exportSendOrderDaliyData', 'SendOrderController@exportSendOrderDaliyData');
    Route::any('public/updateRemark', 'SendOrderController@updateRemark');
    Route::any('public/getSendOrderMonthlyData2', 'SendOrderController@getSendOrderMonthlyData2');
});