router.js 1.54 KB
/**
 * 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);
const cate = require(cRoot + '/cate');
const brandController = require(`${cRoot}/brand`);

const router = express.Router(); // eslint-disable-line

router.get('/', channel.switchChannel, channel.index); // 首页,频道选择页
router.get('/boys', channel.switchChannel, channel.boys);
router.get('/girls', channel.switchChannel, channel.girls);
router.get('/kids', channel.switchChannel, channel.kids);
router.get('/lifestyle', channel.switchChannel, channel.lifestyle);
router.get('/channel/getResourceContent', channel.getResourceContent);// 获取首页,其余频道楼层

router.get('/(:channel)/bottomBanner', channel.bottomBanner);

router.get('/cate', cate.index);
router.get('/brands', brandController.index); // 品牌首页
router.get('/brands/search', brandController.search); // 品牌搜索页
router.get('/brands/getBrandList', brandController.brandList); // 获取品牌列表
router.post('/brands/searchAsync', brandController.searchAsync); // 品牌搜索异步数据
router.post('/brands/addBrandSearch', brandController.addBrandSearch); // 添加品牌搜索记录
router.get('/brands/delBrandHistory', brandController.delBrandHistory); // 删除品牌搜索记录

// 5.2新楼层功能
router.post('/channel/shopRecom', channel.shopRecom); // 店铺推荐收藏状态
router.post('/channel/userVip', channel.userVip);
module.exports = router;