123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138 |
- 'use strict';
- // 商城路由
- module.exports = app => {
- // 管理员登录检查函数
- const webLogin = app.middleware.webLogin(app.config.jwt);
- const shops = app.controller.home;
- /**
- * [subRouter 命名空间路由]
- * @type {[type]}
- */
- const subRouter = app.router.namespace(`/${process.env.APP_CUSTOME || 'universal'}/api`);
- // 商城主要配置项
- subRouter.get('/shop/config', shops.shop.shopConfig);
- // 商城支持的支付方式
- subRouter.get('/shop/payConfig', shops.shop.payConfig);
- // 首页商品列表
- subRouter.get('/homeProducts', shops.products.homeProduct);
- // 首页商品列表
- subRouter.get('/officeHomeProducts', shops.products.officeHomeProducts);
- // 商品详情
- subRouter.get('/detail', shops.products.detail);
- // 商品搜索
- subRouter.get('/search', shops.products.search);
- // 树形分类商品
- subRouter.get('/trees', shops.productCategory.trees);
- // 分类下的商品列表
- subRouter.get('/category', shops.productCategory.category);
- // 用户微信登录
- subRouter.get('/wxlogin', shops.user.wxRegisterAdnLogin);
- // 获取用户微信登录地址
- subRouter.post('/wxlogin', shops.user.wxloginURL);
- // 用户账号登录
- subRouter.post('/login', shops.user.login);
- // 添加购物车
- subRouter.post('/cart', webLogin, shops.cart.create);
- // 更新购物车
- subRouter.put('/cart', webLogin, shops.cart.update);
- // 删除购物车
- subRouter.delete('/cart', webLogin, shops.cart.delete);
- // 查询购物车
- subRouter.get('/cart', webLogin, shops.cart.select);
- // 购物车商品件数
- subRouter.get('/cart/total', shops.cart.cartTotal);
- // 查询户收货地址操作接口
- subRouter.get('/address', webLogin, shops.address.select);
- // 添加用户收货地址操作接口
- subRouter.post('/address', webLogin, shops.address.create);
- // 更新用户收货地址操作接口
- subRouter.put('/address', webLogin, shops.address.update);
- // 删除用户收货地址操作接口
- subRouter.delete('/address', webLogin, shops.address.delete);
- // // 用户下单接口
- // subRouter.post('/order', webLogin, shops.order.create);
- // // 获取订单列表
- // subRouter.get('/order', webLogin, shops.order.select);
- // 用户下单接口v2
- subRouter.post('/v2/order', webLogin, shops.order.createV2);
- // 获取订单列表v2
- subRouter.get('/v2/order', webLogin, shops.order.select);
- // 获取订单详情
- subRouter.get('/order/info', shops.order.selectInfo);
- // 获取订单数量
- subRouter.get('/order/count', webLogin, shops.order.orderCount);
- // 用户取消订单
- subRouter.put('/order/cancel', webLogin, shops.order.cancel);
- // 用户催发货
- subRouter.put('/order/urge', webLogin, shops.order.urge);
- // 用户确认收货
- subRouter.put('/order/confirm', webLogin, shops.order.confirm);
- // 用户查询订单是否支付成功
- subRouter.get('/order/pay/query', webLogin, shops.order.orderPayFind);
- // 获取用户余额
- subRouter.get('/user/money', webLogin, shops.user.userMoney);
- // 获取用户账户余额
- subRouter.get('/user/account', webLogin, shops.user.userAccount);
- // 获取用户资金明细
- subRouter.get('/user/money/log', webLogin, shops.user.userMoneyLog);
- // 获取用户资金明细
- subRouter.get('/user/commission/log', webLogin, shops.user.userCommissionLog);
- // 获取用户餐币明细
- subRouter.get('/user/coinDetail', webLogin, shops.user.coinDetail);
- // 获取用户餐饮币账户
- subRouter.get('/user/diningCoin', webLogin, shops.user.userDiningCoin);
- // 获取新用户福利记录
- subRouter.get('/user/money/newUserBenefits', webLogin, shops.user.newUserBenefits);
- // 用户红包每日一抽
- subRouter.get('/user/money/dayLucky', webLogin, shops.user.dayLucky);
- // 更新用户信息
- subRouter.put('/user/updateUserInfo', webLogin, shops.user.updateUserInfo);
- // 查看配送信息
- subRouter.get('/order/deliver', webLogin, shops.order.orderDeliver);
- // 商品评论提交
- subRouter.post('/product/comment', webLogin, shops.products.comment);
- // 获取商品评论
- subRouter.get('/product/comment', shops.products.commentList);
- // 订单继续支付
- subRouter.get('/order/again', webLogin, shops.order.orderAgainPay);
- // 手动执行定时任务一次
- subRouter.get('/executeTask', shops.relInviter.executeSchedule);
- // 测试接口 http://test.enroll.sizhijie.com/oneshop/api/test
- subRouter.get('/test', shops.relInviter.test);
- // 查询可提现金额
- subRouter.get('/couldCash', shops.user.userCommissionCouldCash);
- // 查询商家可提现餐币金额
- subRouter.get('/couldCashCoin', webLogin, shops.user.businessDiningCoinCouldCash);
- // 查询可核销餐币
- subRouter.get('/couldTransferCoin', shops.user.userCouldTransferCoin);
- // 用户分佣坚持申请提现
- subRouter.post('/cashOut', webLogin, shops.user.userCashOut);
- // 用户分佣转电子餐费申请提现
- subRouter.post('/commission2DiningCoin', webLogin, shops.user.commission2DiningCoin);
- // 商家申请提现
- subRouter.post('/coinCashOut', webLogin, shops.user.userCoinCashOut);
- // 商家申请核销餐币
- subRouter.post('/coinTransfer', webLogin, shops.user.coinTransfer);
- // 查询代理认真申请记录
- subRouter.get('/proxyApplyLog', webLogin, shops.proxyApplyLogs.select);
- // 添加代理认真申请记录
- subRouter.post('/proxyApplyLog', webLogin, shops.proxyApplyLogs.create);
- // 更新代理认真申请记录
- subRouter.put('/proxyApplyLog', webLogin, shops.proxyApplyLogs.update);
- // 删除代理认真申请记录
- subRouter.delete('/proxyApplyLog', webLogin, shops.proxyApplyLogs.delete);
- // 2022/12/12 发送短信验证码接口
- subRouter.get('/phoneSMS', webLogin, shops.proxyApplyLogs.phoneSMS);
- // 查询合作餐店列表接口
- subRouter.get('/partnerList', shops.partnerInfo.select);
- subRouter.get('/partnerListAll', shops.partnerInfo.selectAll);
- // 2023/7/25 统计
- subRouter.post('/statisticLogs', webLogin, shops.statistic.statisticLogs);
- // 2023/7/25 用户行为记录列表
- subRouter.get('/statisticLogs', webLogin, shops.statistic.statisticLogsList);
- // 2023/7/25 活跃用户列表
- subRouter.get('/activeUsers', shops.statistic.activeUsers);
- // 2023/7/25 我邀请的活跃用户列表
- subRouter.get('/myActiveUsers', shops.statistic.myActiveUsers);
- };
|