滿天的星座2017-04-28 09:05:32
Configure two data sources, and use one of the following two solutions, which can also be used in combination:
1. Customize annotation classes, annotate specified methods in the service layer, and use spring aop to perform aspects to control the data source
2. Implementation Dynamically switch data sources and use spring aop for slicing to control the data source
Reference: http://www.boboface.com/wiki, DB reading and writing are separated in the wiki tree. As for how the program connects to mongodb, you can find out by yourself. This is just to give you ideas on how to solve your problem