util.js 820 B

123456789101112131415161718
  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 = 'util';
  7. const ckey = 'util';
  8. const keyZh = '工具接口';
  9. const routes = [
  10. { method: 'post', path: `${rkey}/crk`, controller: `${ckey}.crk`, zh: `${keyZh}-创建请求key` },
  11. { method: 'get', path: `${rkey}/util`, controller: `${ckey}.util`, zh: `${keyZh}-工具` },
  12. { method: 'post', path: `${rkey}/checkCanBuy`, controller: `${ckey}.checkCanBuy`, zh: `${keyZh}-检查是否可以购买商品` },
  13. { method: 'post', path: `${rkey}/checkCartBuy`, controller: `${ckey}.checkCartBuy`, zh: `${keyZh}-检查选中的购物车商品是否可以购买` },
  14. ];
  15. module.exports = app => {
  16. routerRegister(app, routes, keyZh, rkey, ckey);
  17. };