router.js 1.3 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`);

// 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.get('/im/fetchHistory', chat.fetchHistory);
router.get('/getOrders', chat.getOrders);
router.get('/im/global-list', chat.queryGlobalOrder);
router.get('/im/order-list', chat.fetchOrders);
router.get('/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);// 升级公告

module.exports = router;