router.js 1.81 KB
/**
 * router of sub app service
 * @author: xuan.chen@yoho.cn<xuan.chen@yoho.cn>
 * @date: 2016/11/21
 */

'use strict';

const router = require('express').Router(); //eslint-disable-line
const cRoot = './controllers';

const chat = require(`${cRoot}/chat`);

const chatQa = require(`${cRoot}/chatQa`); // 问题搜索列表页

const system = require(`${cRoot}/systemUpdate`);

const help = require(`${cRoot}/help`);

const sitemap = require('../3party/controllers/sitemap');

// middlware

const authGuard = require('../../doraemon/middleware/auth');
const disableBFCache = require('../../doraemon/middleware/disable-BFCache');

// Your controller here
router.get('/im', disableBFCache, chat.appAdapter, authGuard, chat.page);
router.post('/im/fetchHistory', chat.fetchHistory);
router.get('/getOrders', chat.getOrders);
router.post('/im/global-list', chat.queryGlobalOrder);
router.post('/im/order-list', chat.fetchOrders);
router.post('/im/queryReasons', chat.queryReasons);
router.post('/leavemsg/save.json', chat.saveMSG);
router.post('/im/saveEvalute', chat.saveEvalute);

router.get('/chatQaList', chatQa.qaList); // 问题搜索列表页
router.get('/qaSearch', chatQa.qaSearch); // 问题搜索页
router.get('/qaDetail', chatQa.qaDetail); // 问题详情页
router.get('/keySearch', chatQa.keySearch); // 问题搜索关键词

router.get('/systemUpdate', system.systemUpdate);// 升级公告 (APP使用)
router.get('/shareorder', help.shareorder);// 晒单 (APP使用)
router.get('/limitcodeHelp', help.limitcodeHelp);// 如何获得限购码 (APP使用)
router.get('/limitcodeColSize', help.limitcodeColSize);// 选择限购码颜色和尺寸 (APP使用)
router.get('/limitcodeIntro', help.limitcodeIntro);// 什么是限购码 (APP使用)

// 站点地图
router.get(/^\/sitemap(\d*)\.xml/, sitemap.siteMap);

module.exports = router;