当前位置: 首页 > news >正文

dedecms 一键更新网站2017年网站建设工作总结

dedecms 一键更新网站,2017年网站建设工作总结,重庆做公司网站,郴州网红打卡地有哪些背景#xff1a; 原来在springAOP的用法中#xff0c;只有代理的类才会被切入#xff0c;我们在controller层调用service的方法的时候#xff0c;是可以被切入的#xff0c;但是如果我们在service层 A方法中#xff0c;调用B方法#xff0c;切点切的是B方法#xff0c;…背景 原来在springAOP的用法中只有代理的类才会被切入我们在controller层调用service的方法的时候是可以被切入的但是如果我们在service层 A方法中调用B方法切点切的是B方法那么这时候是不会切入的解决办法就是如上所示在A方法中使用((Service)AopContext.currentProxy()).B() 来调用B方法这样一来就能切入了 原文链接https://blog.csdn.net/qq_29860591/article/details/108728150 https://blog.csdn.net/qq_29860591/article/details/108728150 声明未解决问题先记录场景。 controller层 /*** * author Li* date 2024-03-24*/ RestController RequestMapping(/peis/student) public class PeisStudentController extends BaseController {Autowiredprivate IPeisStudentService peisStudentService;Autowiredprivate IPeisDeptService peisDeptService;Autowiredprivate ApplicationContext applicationContext;/*** 获取部门树列表*/PreAuthorize(ss.hasPermi(peis:student:list))GetMapping(/deptTree)public AjaxResult deptTree(PeisDept dept){logger.info(AopContext.currentProxy().toString());//IPeisDeptService deptService applicationContext.getBean(IPeisDeptService.class);return success(peisDeptService.selectDeptTreeList(dept));} } service 层的代码 /*** Service业务层处理* author Li* date 2024-03-24*/ Service public class PeisDeptServiceImpl implements IPeisDeptService {protected final Logger logger LoggerFactory.getLogger(this.getClass());Autowiredprivate PeisDeptMapper deptMapper;/*** 查询部门管理数据** param dept 部门信息* return 部门信息集合*/Overridepublic ListPeisDept selectDeptList(PeisDept dept){return deptMapper.selectDeptList(dept);}/*** 查询部门树结构信息** param dept 部门信息* return 部门树信息集合*/Overridepublic ListPeisTreeSelect selectDeptTreeList(PeisDept dept){logger.info(AopContext.currentProxy().toString());//ListPeisDept depts SpringUtils.getAopProxy(this).selectDeptList(dept);ListPeisDept depts ((PeisDeptServiceImpl)AopContext.currentProxy()).selectDeptList(dept);return buildDeptTreeSelect(depts);} 如上所示用到了AopContext.currentProxy() 的方式进行自己类方法的调用实现被代理。代码仿照同结构生成导包无错误注解都加了debug 追踪源码发现之前的代码在controller调用service的时候会进行动态代理类的设值使得currentProxy这个属性放在threadLocal可以被刷新为service类询问gpt得到此步骤一般为spring自动执行。如下图 第二步 但是实际发现 等我研究研究spring深入后再来报仇 先用这个方法解决applicationContext.getBean(IPeisDeptService.class); 原理就是拿到代理对象嘛
http://www.zqtcl.cn/news/448263/

相关文章:

  • 企业如何做网站推广成都外贸网站建设
  • 网页设计 网站建设 哪个好佛山网站建设推广服务
  • 东莞网站建设技术支持产品推广怎么写
  • 银川app购物网站制作公司网站建设怎样提升形象与品牌价值
  • 中山城市建设集团网站信誉好的邯郸网站建设
  • 做网站很赚钱吗贵阳网站建设费用
  • 设计网站的关键点用ps做招生网站
  • 制作网站公司服务器租赁一年的费用网页动画是如何制作出来的
  • 佛山网站优化有莱芜房产网新房
  • 西安英文旅游网站建设中国建筑工程门户商城
  • 山东企业建站软件购物网站是多少
  • 外链收录网站语音识别程序代做网站
  • 天津平台网站建设公司wordpress删除页头页尾
  • 网站加入站长统计wordpress设置手机浏览器
  • 服务器网站备案怎么做网站流量竞品分析
  • 四川省建设工程信息网站上海金融网站制作公
  • php7.2 wordpress黑帽seo软件
  • 网站后台cms做网站项目团队口号
  • 云南哪几个建网站公司九江做网站哪家好
  • 时尚网站模板代码网站模板炫酷
  • 股票网站怎么做动态表格live2d看板娘wordpress
  • 班级网站建设开题报告企业创新平台建设
  • 网站建设有什么要求建设电子商务网站的步骤
  • 百度推广和哪些网站有合作专业网站开发多少钱
  • 相城区住房建设局网站做网站开发电脑配置
  • 成都网站建设制作photoshop网页制作视频教程
  • 深圳网站做的好的公司广州外贸营销网站建设公司
  • 网站你懂我意思正能量晚上不用下载直接进入微信公众号免费模板素材网站
  • 网站设计模板之家南宁seo外包平台
  • 免费舆情网站遵义市双控体系建设网站