Skip to content

Commit 0fc34ec

Browse files
committed
delete note
1 parent 14c45d2 commit 0fc34ec

File tree

2 files changed

+0
-15
lines changed

2 files changed

+0
-15
lines changed

springboot-elasticsearch/src/main/java/cn/abel/service/NewsService.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
import java.util.List;
44
import java.util.Map;
55

6-
import cn.abel.config.DynamicDataSource;
7-
import cn.abel.config.DynamicDataSourceContextHolder;
8-
import cn.abel.enums.DatabaseTypeEnum;
96
import org.springframework.beans.factory.annotation.Autowired;
107
import org.springframework.stereotype.Service;
118

@@ -18,29 +15,24 @@ public class NewsService {
1815
private NewsDao newsDao;
1916

2017
public List<News> getByMap(Map<String, Object> map) {
21-
DynamicDataSourceContextHolder.resetDatabaseType();
2218
return newsDao.getByMap(map);
2319
}
2420

2521
public News getById(Integer id) {
26-
DynamicDataSourceContextHolder.resetDatabaseType();
2722
return newsDao.getById(id);
2823
}
2924

3025
public News create(News news) {
31-
DynamicDataSourceContextHolder.resetDatabaseType();
3226
newsDao.create(news);
3327
return news;
3428
}
3529

3630
public News update(News news) {
37-
DynamicDataSourceContextHolder.resetDatabaseType();
3831
newsDao.update(news);
3932
return news;
4033
}
4134

4235
public int delete(Integer id) {
43-
DynamicDataSourceContextHolder.resetDatabaseType();
4436
return newsDao.delete(id);
4537
}
4638

springboot-elasticsearch/src/main/java/cn/abel/service/UserService.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
import java.util.List;
44
import java.util.Map;
55

6-
import cn.abel.config.DynamicDataSourceContextHolder;
7-
import cn.abel.enums.DatabaseTypeEnum;
86
import org.springframework.beans.factory.annotation.Autowired;
97
import org.springframework.stereotype.Service;
108

@@ -17,29 +15,24 @@ public class UserService {
1715
private UserDao userDao;
1816

1917
public List<User> getByMap(Map<String,Object> map){
20-
DynamicDataSourceContextHolder.setDatabaseType(DatabaseTypeEnum.USER);
2118
return userDao.getByMap(map);
2219
}
2320

2421
public User getById(Integer id){
25-
DynamicDataSourceContextHolder.setDatabaseType(DatabaseTypeEnum.USER);
2622
return userDao.getById(id);
2723
}
2824

2925
public User create(User user){
30-
DynamicDataSourceContextHolder.setDatabaseType(DatabaseTypeEnum.USER);
3126
userDao.create(user);
3227
return user;
3328
}
3429

3530
public User update(User user){
36-
DynamicDataSourceContextHolder.setDatabaseType(DatabaseTypeEnum.USER);
3731
userDao.update(user);
3832
return user;
3933
}
4034

4135
public int delete(Integer id){
42-
DynamicDataSourceContextHolder.setDatabaseType(DatabaseTypeEnum.USER);
4336
return userDao.delete(id);
4437
}
4538

0 commit comments

Comments
 (0)