router.js 1.19 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`); // 问题搜索列表页

// 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); // 问题搜索关键词

module.exports = router;