Article directory
1. The controller cannot be scanned under multi-module mode.
1.1 Question
In the Ruoyi framework, you can see that there are controller and application under the ruoyi-admin module. Under the same package, application can scan the controller, but cannot scan the controller under rs-admin. When the front-end sends a request, 404 will appear.
1.2 Solution
1.2.1 Add module dependencies
Add your own dependencies in ruoyi-admin
1.2.2 Add scanBasePackages
Add the scanning package in @SpringBootApplication of Ruoyi's startup class. Pay attention to add Ruoyi's package name and the module package name written by yourself.
2. Mapper cannot scan multiple modules
2.1 Question
The controller can be accessed in the self-defined module, but the mapper cannot be scanned
2.2 Solution
Add annotation @MapperScan to the startup class
3. Unable to map entities in mapper.xml
3.1 Questions
The type in xml cannot be mapped successfully
3.2 Solution
3.2.1 Write the full package name
3.2.2 Modify typeAliasesPackage in yml
Add the package name of your own defined module to achieve automatic mapping