
想将其他模块的 Entity、Mapper 和 Service 集中到 Common 模块中?
使用 Spring Cloud Alibaba 2021.0.1 Spring Boot 2.6.4,如何让其他业务模块的 Entity、Mapper 和 Service 都集中管理在 Common 模块中?
问题的尝试和解决
正确的配置
根据描述的情况,在 merchant 模块和 supply 模块中,配置如下:
此外,统一异常处理只允许存在于一个模块中。
其他建议
将 Common 模块编写成一个 Spring-Boot-Starter 也是一个可行的方案,这样可以避免包扫描问题。
以上就是Spring Cloud Alibaba中如何集中管理Common模块的Entity、Mapper和Service?的详细内容,更多请关注php中文网其它相关文章!
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号