<?php
$app = app()->router;
$languagePath = '';
if(config('app.language_path')) {
    $languagePath = config('app.language_path');
}
$app->group([
    'namespace' => 'App\Web\Controllers',
    'prefix' => $languagePath
], function () use ($app) {
    $app->get('/','IndexController@index');
    $app->get('/blade','IndexController@blade'); //获取渲染后的组件html内容
    //模块路由
    $app->get('/{module}[.html]',[
        'as' => 'moduleIndex', 'uses' => 'IndexController@index'
    ]);
    //点击广告位
    $app->post('/api/ad/ad-click', ['uses' => 'WebController@adClick']);
    // 获取手机验证码
    $app->get('/api/mail/test', 'WebController@mailTest');

    // 获取手机验证码
    $app->post('/api/web/get-phone-code', 'WebController@getPhoneCode');
    // 清除页面缓存
    $app->get('/api/page/clear-cache', ['uses' => 'WebController@clearPageCache']);
    // 更新文章阅读量
    $app->post('/api/blog/up-blog-pv', ['uses' => 'BlogController@upBlogPv']);

    // 访客获取文章列表
    $app->post('/api/blog/visitor-get-list-by-type', ['uses' => 'BlogController@getPublishBlogListByTypeId']);
    $app->post('/api/blog/visitor-get-list-by-tag', ['uses' => 'BlogController@getPublishBlogListByTagId']);
    // 查询文章列表
    $app->get('/api/blog/visitor-query-list', ['uses' => 'BlogController@getSearchBlogList']);
    // 全站搜索
    $app->get('/api/query/all', ['uses' => 'WebController@queryAllWebsite']);
    // 更新帮助阅读量
    $app->post('/api/help/up-help-pv', ['uses' => 'HelpController@upHelpPv']);
    // 更新会议阅读量
    $app->post('/api/meeting/update-pv', ['uses' => 'MeetingController@upMeetingPv']);
    // 根据条件筛选会议内容
    $app->get('/api/meeting/global-filter-list', ['uses' => 'MeetingController@globalFilterFade']);
    // 访客获取帮助列表
    $app->get('/api/help/visitor-get-list-by-type', ['uses' => 'HelpController@getPublishHelpListByTypeId']);
    $app->get('/api/help/visitor-get-list-by-tag', ['uses' => 'HelpController@getPublishHelpListByTagId']);
    // 查询帮助列表
    $app->get('/api/help/visitor-query-list', ['uses' => 'HelpController@getSearchHelpList']);
    // 查询成功案例列表
    $app->get('/api/case/render-list', ['uses' => 'SuccessCaseController@getSearchCaseList']);
    // 文件上传接口
    $app->post('/api/attachment/upload-custom-image', ['uses' => 'WebController@uploadCustomImage']);
    // 统计utm
    $app->get('/cron/web-utm/persistence', ['uses' => 'WebUtmController@persistenceUtm']);
    // 获取系统邮件通知地址
    $app->get('/api/notification/mp-notify-emails',['uses' => 'SysGlobalController@notificationEmail']);
});


app()->router->group([
    'middleware' => ['admin.auth'],
    'namespace' => 'App\Web\Controllers',
    'prefix' => ($languagePath ? $languagePath.'/' : ''). 'api',
], function ($router) {


    // 文章国家列表
    $router->get('blog/get-country-list', ['uses' => 'BlogController@getCountryListFade']);
    // 文章类型列表
    $router->get('blog/get-type-list', ['uses' => 'BlogController@getBlogTypeList']);
    // 文章类型保存
    $router->post('blog/save-type', ['uses' => 'BlogController@saveBlogType']);
    // 更改类型状态
    $router->post('blog/change-type-status', ['uses' => 'BlogController@changeBlogTypeStatus']);
    // 文章类型关系保存
    $router->post('blog/type-relation-save', ['uses' => 'BlogController@typeRelationSave']);
    // 根据类型id及文章id 删除关联关系
    $router->post('blog/type-relation-del', ['uses' => 'BlogController@delTypeRelation']);
    // 根据文章类型 保存文章关系
    $router->post('blog/type-relation-by-id', ['uses' => 'BlogController@addRelationByTypeId']);

    // 文章标签列表
    $router->get('blog/get-tag-list', ['uses' => 'BlogController@getBlogTagList']);
    // 文章标签保存
    $router->post('blog/save-tag', ['uses' => 'BlogController@saveBlogTag']);
    // 更改标签状态
    $router->post('blog/change-tag-status', ['uses' => 'BlogController@changeBlogTagStatus']);
    // 文章标签关系保存
    $router->post('blog/tag-relation-save', ['uses' => 'BlogController@tagRelationSave']);
    // 根据标签id及文章id 删除关联关系
    $router->post('blog/tag-relation-del', ['uses' => 'BlogController@delTagRelation']);
    // 根据文章标签 保存文章关系
    $router->post('blog/tag-relation-by-id', ['uses' => 'BlogController@addRelationByTagId']);

    // 文章板块列表
    $router->get('blog/get-plate-list', ['uses' => 'BlogController@getBlogPlateList']);
    // 文章板块保存
    $router->post('blog/save-plate', ['uses' => 'BlogController@saveBlogPlate']);
    // 更改板块状态
    $router->post('blog/change-plate-status', ['uses' => 'BlogController@changeBlogPlateStatus']);


    // 文章列表
    $router->get('blog/get-list', ['uses' => 'BlogController@getBlogList']);
    // 获取文章分类未关联的文章
    $router->get('blog/get-unrelated-type-list', ['uses' => 'BlogController@getUnrelatedBlogByTypeIds']);
    // 获取文章标签未关联的文章
    $router->get('blog/get-unrelated-tag-list', ['uses' => 'BlogController@getUnrelatedBlogByTagIds']);
    // 根据类型id 获取文章列表
    $router->get('blog/get-list-by-type', ['uses' => 'BlogController@getBlogListByType']);
    // 根据标签id 获取文章列表
    $router->get('blog/get-list-by-tag', ['uses' => 'BlogController@getBlogListByTag']);
    // 文章详情
    $router->get('blog/info', ['uses' => 'BlogController@getBlogInfo']);
    // 文章保存
    $router->post('blog/save', ['uses' => 'BlogController@saveBlog']);
    // 更改文章状态
    $router->post('blog/change-status', ['uses' => 'BlogController@changeBlogStatus']);
    // 更改阅读量
    $router->post('blog/up-virtual-pv', ['uses' => 'BlogController@upBlogPv']);
    // 文章排序
    $router->post('blog/change-sort',['uses' =>'BlogController@changeBlogSort']);

    //批量修改类型
    $router->post('blog/type-plural-edit',['uses' =>'BlogController@typePluralEdit']);
    //批量修改标签
    $router->post('blog/tag-plural-edit',['uses' =>'BlogController@tagPluralEdit']);
    //批量删除
    $router->post('blog/batch-delete-news',['uses' =>'BlogController@batchDeleteNews']);
    //批量修改状态
    $router->post('blog/batch-status-news',['uses' =>'BlogController@batchStatusNews']);

    // 文章设置推荐
    $router->post('blog/set-recommend',['uses' =>'BlogController@recommendSet']);
    //previewBlog
    // 产品类型列表
    $router->get('product/get-type-list', ['uses' => 'ProductController@getProductTypeList']);
    // 产品获取树类型列表
    $router->get('product/get-tree-type-list', ['uses' => 'ProductController@getTreeProductList']);
    // 产品类型排序
    $router->post('product/sort-type', ['uses' => 'ProductController@sortProductTypes']);
    // 产品类型保存
    $router->post('product/save-type', ['uses' => 'ProductController@saveProductType']);
    // 更改类型状态
    $router->post('product/change-type-status', ['uses' => 'ProductController@changeProductTypeStatus']);
    // 产品类型关系保存
    $router->post('product/type-relation-save', ['uses' => 'ProductController@typeRelationSave']);
    // 根据类型id及产品id 删除关联关系
    $router->post('product/type-relation-del', ['uses' => 'ProductController@delTypeRelation']);
    // 根据产品类型 保存产品关系
    $router->post('product/type-relation-by-id', ['uses' => 'ProductController@addRelationByTypeId']);

    // 产品标签列表
    $router->get('product/get-tag-list', ['uses' => 'ProductController@getProductTagList']);
    // 产品标签保存
    $router->post('product/save-tag', ['uses' => 'ProductController@saveProductTag']);
    // 更改标签状态
    $router->post('product/change-tag-status', ['uses' => 'ProductController@changeProductTagStatus']);
    // 产品标签关系保存
    $router->post('product/tag-relation-save', ['uses' => 'ProductController@tagRelationSave']);
    // 根据标签id及产品id 删除关联关系
    $router->post('product/tag-relation-del', ['uses' => 'ProductController@delTagRelation']);
    // 根据产品标签 保存产品关系
    $router->post('product/tag-relation-by-id', ['uses' => 'ProductController@addRelationByTagId']);

    // 产品板块列表
    $router->get('product/get-plate-list', ['uses' => 'ProductController@getProductPlateList']);
    // 产品板块保存
    $router->post('product/save-plate', ['uses' => 'ProductController@saveProductPlate']);
    // 更改板块状态
    $router->post('product/change-plate-status', ['uses' => 'ProductController@changeProductPlateStatus']);


    // 产品列表
    $router->get('product/get-list', ['uses' => 'ProductController@getProductList']);
    // 获取产品分类未关联的产品
    $router->get('product/get-unrelated-type-list', ['uses' => 'ProductController@getUnrelatedProductByTypeIds']);
    // 获取产品标签未关联的产品
    $router->get('product/get-unrelated-tag-list', ['uses' => 'ProductController@getUnrelatedProductByTagIds']);
    // 根据类型id 获取产品列表
    $router->get('product/get-list-by-type', ['uses' => 'ProductController@getAdminProductListByType']);
    // 根据标签id 获取产品列表
    $router->get('product/get-list-by-tag', ['uses' => 'ProductController@getProductListByTag']);
    // 产品详情
    $router->get('product/info', ['uses' => 'ProductController@getProductInfo']);
    // 产品保存
    $router->post('product/save', ['uses' => 'ProductController@saveProduct']);
    // 更改产品状态
    $router->post('product/change-status', ['uses' => 'ProductController@changeProductStatus']);
    $router->post('product/change-type-status', ['uses' => 'ProductController@changeProductTypeStatus']);
    // 更改阅读量
    $router->post('product/up-virtual-pv', ['uses' => 'ProductController@upProductPv']);
    // 产品排序
    $router->post('product/change-sort',['uses' =>'ProductController@changeProductSort']);

    // 产品设置推荐
    $router->post('product/set-recommend',['uses' =>'ProductController@recommendSet']);

    // 批量修改类型
    $router->post('product/type-plural-edit', 'ProductController@typePluralEdit');
    // 批量修改标签
    $router->post('product/tag-plural-edit', 'ProductController@tagPluralEdit');
    // 批量删除
    $router->post('product/batch-delete-product', 'ProductController@batchDeleteProduct');
    // 批量修改状态
    $router->post('product/batch-status-product', 'ProductController@batchStatusProduct');

    // 会议活动
    // 会议活动类型列表
    $router->get('meeting/get-type-list', ['uses' => 'MeetingController@getMeetingTypeList']);
    // 会议活动类型保存
    $router->post('meeting/save-type', ['uses' => 'MeetingController@saveMeetingType']);
    // 更改类型状态
    $router->post('meeting/change-type-status', ['uses' => 'MeetingController@changeMeetingTypeStatus']);
    // 会议活动类型关系保存
    $router->post('meeting/type-relation-save', ['uses' => 'MeetingController@typeRelationSave']);
    // 根据类型id及会议活动id 删除关联关系
    $router->post('meeting/type-relation-del', ['uses' => 'MeetingController@delTypeRelation']);
    // 根据会议活动类型 保存会议活动关系
    $router->post('meeting/type-relation-by-id', ['uses' => 'MeetingController@addRelationByTypeId']);

    // 会议活动标签列表
    $router->get('meeting/get-tag-list', ['uses' => 'MeetingController@getMeetingTagList']);
    // 会议活动标签保存
    $router->post('meeting/save-tag', ['uses' => 'MeetingController@saveMeetingTag']);
    // 更改标签状态
    $router->post('meeting/change-tag-status', ['uses' => 'MeetingController@changeMeetingTagStatus']);
    // 会议活动标签关系保存
    $router->post('meeting/tag-relation-save', ['uses' => 'MeetingController@tagRelationSave']);
    // 根据标签id及会议活动id 删除关联关系
    $router->post('meeting/tag-relation-del', ['uses' => 'MeetingController@delTagRelation']);
    // 根据会议活动标签 保存会议活动关系
    $router->post('meeting/tag-relation-by-id', ['uses' => 'MeetingController@addRelationByTagId']);

    // 会议活动板块列表
    $router->get('meeting/get-plate-list', ['uses' => 'MeetingController@getMeetingPlateList']);
    // 会议活动板块保存
    $router->post('meeting/save-plate', ['uses' => 'MeetingController@saveMeetingPlate']);
    // 更改板块状态
    $router->post('meeting/change-plate-status', ['uses' => 'MeetingController@changeMeetingPlateStatus']);


    // 会议活动列表
    $router->get('meeting/get-list', ['uses' => 'MeetingController@getMeetingList']);
    // 获取会议活动分类未关联的会议活动
    $router->get('meeting/get-unrelated-type-list', ['uses' => 'MeetingController@getUnrelatedMeetingByTypeIds']);
    // 获取会议活动标签未关联的会议活动
    $router->get('meeting/get-unrelated-tag-list', ['uses' => 'MeetingController@getUnrelatedMeetingByTagIds']);
    // 根据类型id 获取会议活动列表
    $router->get('meeting/get-list-by-type', ['uses' => 'MeetingController@getMeetingListByType']);
    // 根据标签id 获取会议活动列表
    $router->get('meeting/get-list-by-tag', ['uses' => 'MeetingController@getMeetingListByTag']);
    // 会议活动详情
    $router->get('meeting/info', ['uses' => 'MeetingController@getMeetingInfo']);
    // 会议活动保存
    $router->post('meeting/save', ['uses' => 'MeetingController@saveMeeting']);
    // 更改会议活动状态
    $router->post('meeting/change-status', ['uses' => 'MeetingController@changeMeetingStatus']);
    // 更改阅读量
    $router->post('meeting/up-virtual-pv', ['uses' => 'MeetingController@upMeetingPv']);
    // 会议活动排序
    $router->post('meeting/change-sort',['uses' =>'MeetingController@changeMeetingSort']);

    // 会议活动设置推荐
    $router->post('meeting/set-recommend',['uses' =>'MeetingController@recommendSet']);

    // 批量修改类型
    $router->post('meeting/type-plural-edit', 'MeetingController@typePluralEdit');
    // 批量修改标签
    $router->post('meeting/tag-plural-edit', 'MeetingController@tagPluralEdit');
    //批量删除
    $router->post('meeting/batch-delete-meeting', 'MeetingController@batchDeleteMeeting');
    //批量修改状态
    $router->post('meeting/batch-status-meeting', 'MeetingController@batchStatusMeeting');

    // 帮助中心
    // 帮助类型列表
    $router->get('help/get-type-list', ['uses' => 'HelpController@getHelpTypeList']);
    // 帮助类型保存
    $router->post('help/save-type', ['uses' => 'HelpController@saveHelpType']);
    // 更改类型状态
    $router->post('help/change-type-status', ['uses' => 'HelpController@changeHelpTypeStatus']);
    // 帮助类型关系保存
    $router->post('help/type-relation-save', ['uses' => 'HelpController@typeRelationSave']);
    // 根据类型id及帮助id 删除关联关系
    $router->post('help/type-relation-del', ['uses' => 'HelpController@delTypeRelation']);
    // 根据帮助类型 保存帮助关系
    $router->post('help/type-relation-by-id', ['uses' => 'HelpController@addRelationByTypeId']);


    // 帮助标签列表
    $router->get('help/get-tag-list', ['uses' => 'HelpController@getHelpTagList']);
    // 帮助标签保存
    $router->post('help/save-tag', ['uses' => 'HelpController@saveHelpTag']);
    // 更改标签状态
    $router->post('help/change-tag-status', ['uses' => 'HelpController@changeHelpTagStatus']);
    // 帮助标签关系保存
    $router->post('help/tag-relation-save', ['uses' => 'HelpController@tagRelationSave']);
    // 根据标签id及帮助id 删除关联关系
    $router->post('help/tag-relation-del', ['uses' => 'HelpController@delTagRelation']);
    // 根据标签id 获取文章列表
    $router->get('help/get-list-by-tag', ['uses' => 'HelpController@getHelpListByTag']);
    // 根据帮助标签 保存帮助关系
    $router->post('help/tag-relation-by-id', ['uses' => 'HelpController@addRelationByTagId']);

    // 获取帮助中心列表
    $router->get('help/get-list', ['uses' => 'HelpController@getHelpList']);
    // 根据类型id 获取帮助列表
    $router->get('help/get-list-by-type', ['uses' => 'HelpController@getHelpListByType']);
    // 获取帮助分类未关联的文章
    $router->get('help/get-unrelated-type-list', ['uses' => 'HelpController@getUnrelatedHelpByTypeIds']);
    // 获取帮助标签未关联的文章
    $router->get('help/get-unrelated-tag-list', ['uses' => 'HelpController@getUnrelatedHelpByTagIds']);
    // 帮助中心保存
    $router->post('help/save', ['uses' => 'HelpController@saveHelp']);
    // 更改帮助中心状态
    $router->post('help/change-status', ['uses' => 'HelpController@changeHelpStatus']);
    // 获取帮助中心详情
    $router->get('help/info', ['uses' => 'HelpController@getHelpInfo']);
    // 帮助排序
    $router->post('help/change-sort',['uses' =>'HelpController@changeHelpSort']);
    // 更改阅读量
    $router->post('help/up-virtual-pv', ['uses' => 'HelpController@upHelpPv']);

    // 成功案例
    // 成功案例列表
    $router->get('case/get-list', ['uses' => 'SuccessCaseController@getSuccessCaseList']);
    // 成功案例详情
    $router->get('case/info', ['uses' => 'SuccessCaseController@getSuccessCaseInfo']);
    // 成功案例保存
    $router->post('case/save', ['uses' => 'SuccessCaseController@saveSuccessCase']);
    // 更改成功案例状态
    $router->post('case/change-status', ['uses' => 'SuccessCaseController@changeSuccessCaseStatus']);
    // 更改成功案例阅读量
    $router->post('case/up-virtual-pv', ['uses' => 'SuccessCaseController@upSuccessCasePv']);
    // 成功案例排序
    $router->post('case/change-sort',['uses' =>'SuccessCaseController@changeSuccessCaseSort']);
    // 成功案例设置精选
    $router->post('case/set-handpick',['uses' =>'SuccessCaseController@handpickSet']);
    //previewBlog


    // 字典
    // 获取功能列表
    $router->get('dict/get-func-list', ['uses' => 'DictController@getDictFunctionList']);
    // 功能保存
    $router->post('dict/func-save', ['uses' => 'DictController@saveDictFunction']);
    // 更改功能状态
    $router->post('dict/func-change-status', ['uses' => 'DictController@changeDictFunctionStatus']);
    // 获取行业列表
    $router->get('dict/get-industry-list', ['uses' => 'DictController@getDictIndustryList']);
    // 行业保存
    $router->post('dict/industry-save', ['uses' => 'DictController@saveDictIndustry']);
    // 更改行业状态
    $router->post('dict/industry-change-status', ['uses' => 'DictController@changeDictIndustryStatus']);

    //静态页面管理
    // 静态页面列表
    $router->get('static-page/get-list', ['uses' => 'WebController@getStaticPageList']);
    // 获取静态页面项
    $router->get('static-page/get-info', ['uses' => 'WebController@getStaticPageInfo']);
    // 获取菜单导航
    $router->get('static-page/get-menu-info', ['uses' => 'WebController@getPageMenuInfo']);
    // 静态页面保存
    $router->post('static-page/save', ['uses' => 'WebController@saveStaticPageData']);
    // 更改静态页面状态
    $router->post('static-page/change-status', ['uses' => 'WebController@changeStaticPageStatus']);


    // 全局配置
    // 获取全局配置列表
    $router->get('global/list', ['uses' => 'WebController@getGlobalConfig']);
    // 文章全局配置数据保存
    $router->post('global/save', ['uses' => 'WebController@saveGlobalConfigData']);

    //utm List
    $router->get('/web-utm/get-list', ['uses' => 'WebUtmController@getUtmList']);
    //utm one
    $router->get('/web-utm/info', ['uses' => 'WebUtmController@getUtmInfo']);
    //utm save
    $router->post('/web-utm/info', ['uses' => 'WebUtmController@addOrModUtm']);
    //utm del
    $router->delete('/web-utm/info', ['uses' => 'WebUtmController@delUtm']);

    $router->post('/sync/product-center-goods', 'ProductController@productSync');

    $router->get('/web/page/export-seo-list', ['uses' => 'WebController@exportSEOSetting']);
    $router->post('/web/page/import-seo-list', ['uses' => 'WebController@importSEOSetting']);
    $router->post('/web/page/confirm-import-dup-seo', ['uses' => 'WebController@confirmImportSEOSetting']);
    $router->post('/web/page/update-trans-status', ['uses' => 'WebController@updateTransStatus']);

    //更新seo信息
    $router->post('/web/seo/update-seo', ['uses' => 'WebController@updateSeoData']);
});
