DefaultController.java 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. package cn.newfeifan.mall.server.controller;
  2. import cn.newfeifan.mall.framework.common.pojo.CommonResult;
  3. import org.springframework.web.bind.annotation.RequestMapping;
  4. import org.springframework.web.bind.annotation.RestController;
  5. import static cn.newfeifan.mall.framework.common.exception.enums.GlobalErrorCodeConstants.NOT_IMPLEMENTED;
  6. /**
  7. * 默认 Controller,解决部分 module 未开启时的 404 提示。
  8. * 例如说,/bpm/** 路径,工作流
  9. *
  10. * @author 非繁源码
  11. */
  12. @RestController
  13. public class DefaultController {
  14. @RequestMapping("/admin-api/bpm/**")
  15. public CommonResult<Boolean> bpm404() {
  16. return CommonResult.error(NOT_IMPLEMENTED.getCode(),
  17. "[工作流模块 feifan-module-bpm - 已禁用][参考 https://doc.iocoder.cn/bpm/ 开启]");
  18. }
  19. @RequestMapping("/admin-api/mp/**")
  20. public CommonResult<Boolean> mp404() {
  21. return CommonResult.error(NOT_IMPLEMENTED.getCode(),
  22. "[微信公众号 feifan-module-mp - 已禁用][参考 https://doc.iocoder.cn/mp/build/ 开启]");
  23. }
  24. @RequestMapping(value = {"/admin-api/product/**", // 商品中心
  25. "/admin-api/trade/**", // 交易中心
  26. "/admin-api/promotion/**"}) // 营销中心
  27. public CommonResult<Boolean> mall404() {
  28. return CommonResult.error(NOT_IMPLEMENTED.getCode(),
  29. "[商城系统 feifan-module-mall - 已禁用][参考 https://doc.iocoder.cn/mall/build/ 开启]");
  30. }
  31. @RequestMapping(value = {"/admin-api/report/**"})
  32. public CommonResult<Boolean> report404() {
  33. return CommonResult.error(NOT_IMPLEMENTED.getCode(),
  34. "[报表模块 feifan-module-report - 已禁用][参考 https://doc.iocoder.cn/report/ 开启]");
  35. }
  36. @RequestMapping(value = {"/admin-api/pay/**"})
  37. public CommonResult<Boolean> pay404() {
  38. return CommonResult.error(NOT_IMPLEMENTED.getCode(),
  39. "[支付模块 feifan-module-pay - 已禁用][参考 https://doc.iocoder.cn/pay/build/ 开启]");
  40. }
  41. }