有时在项目中想要调用当前Controller或者其他Controller的接口,极其简洁高效的方式就是用注入Bean的方式注入Controller,这样非常的简单方便,也不用考虑请求头。
@Autowired
private SaveReviewController saveReviewController;
//注入之后调用
AjaxResult info = saveReviewController.getInfo(wmsInboundAudit);
本文介绍了一种在项目开发中通过@Autowired注解注入Controller以简化API调用的方法,无需关注请求头,提高了代码的简洁性和效率。
有时在项目中想要调用当前Controller或者其他Controller的接口,极其简洁高效的方式就是用注入Bean的方式注入Controller,这样非常的简单方便,也不用考虑请求头。
@Autowired
private SaveReviewController saveReviewController;
//注入之后调用
AjaxResult info = saveReviewController.getInfo(wmsInboundAudit);
5935
2107
3085

被折叠的 条评论
为什么被折叠?
