12345678910111213141516171819202122232425262728 |
- package io.renren.datasources;
- import io.renren.datasources.annotation.DataSource;
- import io.renren.modules.app.entity.UserEntity;
- import io.renren.modules.app.service.UserService;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.stereotype.Service;
- /**
- * 测试
- * @author chenshun
- * @email sunlightcs@gmail.com
- * @date 2017/9/16 23:10
- */
- @Service
- public class DataSourceTestService {
- @Autowired
- private UserService userService;
- public UserEntity queryObject(Long userId){
- return userService.queryObject(userId);
- }
- @DataSource(name = DataSourceNames.SECOND)
- public UserEntity queryObject2(Long userId){
- return userService.queryObject(userId);
- }
- }
|