router.js 1.03 KB
/**
 * router of sub app me
 * @author: xuqi<qi.xu@yoho.cn>
 * @date: 2016/07/04
 */

'use strict';

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

// 订单
const order = require(`${cRoot}/order`);
const address = require(`${cRoot}/address`);

// 个人中心首页/订单
router.get(['/', '/order'], order.index);
router.get(['/', '/order/detail'], order.detail);
router.get('/getOrderList', order.getOrderList);
router.get('/getOrderTotal', order.getOrderTotal);
router.get('/deleteOrder', order.deleteOrder);
router.get('/cancelOrder', order.cancelOrder);
router.get('/getExpressInfo', order.getExpressInfo);

// 个人中心首页/收货地址
router.get('/address', address.index);
router.post('/address/add', address.addAddressData);
router.post('/address/update', address.updateAddressData);
router.post('/address/del', address.delAddressData);
router.post('/address/default', address.setDefaultAddress);
router.get('/address/areas/:areaId', address.getAddressData);

module.exports = router;