Blame view

apps/channel/router.js 2.02 KB
毕凯 authored
1 2 3 4 5 6 7 8 9 10 11
/**
 * router of sub app channel
 * @author: Bi Kai<kai.bi@yoho.cn>
 * @date: 2016/05/09
 */

'use strict';

const express = require('express');
const cRoot = './controllers';
const channel = require(cRoot);
ccbikai authored
12
const cate = require(cRoot + '/cate');
lijing authored
13
const brandController = require(`${cRoot}/brand`);
14
const custom = require(`${cRoot}/custom`);
15
const rewrite = require('../../doraemon/middleware/rewrite');
毕凯 authored
16 17
const router = express.Router(); // eslint-disable-line
ccbikai authored
18
router.get('/', channel.switchChannel, channel.index); // 首页,频道选择页
毕凯 authored
19
router.get('/boys', channel.switchChannel, channel.boys);
20 21 22
router.get('/girls', channel.switchChannel, channel.girls);
router.get('/kids', channel.switchChannel, channel.kids);
router.get('/lifestyle', channel.switchChannel, channel.lifestyle);
23
router.get('/channel/getResourceContent', channel.getResourceContent);// 获取首页,其余频道楼层
毕凯 authored
24
zhangxiaoru authored
25
router.get('/(:channel)/bottomBanner', channel.bottomBanner);
毕凯 authored
26
ccbikai authored
27
router.get('/cate', cate.index);
28
router.get('/brands', rewrite.channel, brandController.indexRedirect); // 品牌首页
郭成尧 authored
29
router.get(/^\/(.*?)-brands/, brandController.index); // 品牌首页 SEO优化
lijing authored
30
router.get('/brands/search', brandController.search); // 品牌搜索页
沈志敏 authored
31
router.get('/brands/getBrandList', brandController.brandList); // 获取品牌列表
陈峰 authored
32
router.post('/brands/searchAsync', brandController.searchAsync); // 品牌搜索异步数据
lijing authored
33 34
router.post('/brands/addBrandSearch', brandController.addBrandSearch); // 添加品牌搜索记录
router.get('/brands/delBrandHistory', brandController.delBrandHistory); // 删除品牌搜索记录
ccbikai authored
35
zzzzzzz authored
36
// 5.2新楼层功能
zzzzzzz authored
37
router.post('/channel/shopRecom', channel.shopRecom); // 店铺推荐收藏状态
李靖 authored
38
// router.post('/channel/userVip', channel.userVip);
39
40 41 42 43
// 自定义频道,市场推广-智汇
// 此页面做的早,写死发给市场,与自定义的不兼容,所以需要写死
router.get('/channel/2fb054e8315300a1ae1f80c3a4fda862.html', custom.zhihui);
44 45 46
// 自定义频道
router.get('/channel/:id.html', custom.index);
周少峰 authored
47
毕凯 authored
48
module.exports = router;