router.js 1.19 KB
/**
 * router of sub app cart
 * @author: xuan.chen@yoho.cn<xuan.chen@yoho.cn>
 * @date: 2016/09/26
 */

'use strict';

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

const seckill = require(cRoot + '/seckill');
const order = require(cRoot + '/order');
const countController = require(`${cRoot}/count`);
const payController = require(`${cRoot}/pay`);

// Your controller here
router.all('/index/seckill/', authMW);
router.all('/index/seckill/*', authMW);
router.get('/index/seckill/', seckill.ensure);
router.post('/index/seckill/compute', seckill.compute);
router.post('/index/seckill/submit', seckill.submit);

router.get('/index/count', countController.cartCount);
router.get('/paySuccess/payCod', payController.payCod);// 支付成功,货到付款
router.get('/shopping/pay/aliwapreturn', payController.payAli);// 支付成功,支付宝付款

router.get('/index/new/orderEnsure', authMW, order.orderEnsure); // 订单结算
router.get('/index/new/selectAddress', authMW, ()=>{}); // 选择地址
router.get('/index/new/selectCoupon', authMW, ()=>{}); // 选择优惠券


module.exports = router;