order.js 1.3 KB

12345678910111213141516171819202122
  1. 'use strict';
  2. // 路由配置
  3. const path = require('path');
  4. const regPath = path.resolve('app', 'public', 'routerRegister');
  5. const routerRegister = require(regPath);
  6. const rkey = 'order';
  7. const ckey = 'trade.order';
  8. const keyZh = '总订单';
  9. const routes = [
  10. { method: 'post', path: `${rkey}/cancel`, controller: `${ckey}.cancel`, name: `${ckey}cancel`, zh: '取消订单' },
  11. { method: 'post', path: `${rkey}/toMakeOrder`, controller: `${ckey}.toMakeOrder`, name: `${ckey}toMakeOrder`, zh: '组织下单页数据' },
  12. { method: 'post', path: `${rkey}/fromGoodsToOrder`, controller: `${ckey}.fromGoodsToOrder`, name: `${ckey}fromGoodsToOrder`, zh: '直接购买' },
  13. { method: 'get', path: `${rkey}`, controller: `${ckey}.index`, name: `${ckey}Query`, zh: `${keyZh}列表查询` },
  14. { method: 'get', path: `${rkey}/:id`, controller: `${ckey}.show`, name: `${ckey}Show`, zh: `${keyZh}查询` },
  15. { method: 'post', path: `${rkey}`, controller: `${ckey}.create`, name: `${ckey}Create`, zh: `创建${keyZh}` },
  16. { method: 'post', path: `${rkey}/:id`, controller: `${ckey}.update`, name: `${ckey}Update`, zh: `修改${keyZh}` },
  17. // { method: 'delete', path: `${rkey}/:id`, controller: `${ckey}.destroy`, name: `${ckey}Delete`, zh: `删除${keyZh}` },
  18. ];
  19. module.exports = app => {
  20. routerRegister(app, routes, keyZh, rkey, ckey);
  21. };