!71 优化 BaseMapperX & fix websocket 未删除会话缓存bug
Merge pull request !71 from 陈晨成/master
This commit is contained in:
commit
c3c191ec6a
@ -121,8 +121,8 @@ public interface BaseMapperX<T> extends MPJBaseMapper<T> {
|
|||||||
*
|
*
|
||||||
* @param entities 实体们
|
* @param entities 实体们
|
||||||
*/
|
*/
|
||||||
default void insertBatch(Collection<T> entities) {
|
default Boolean insertBatch(Collection<T> entities) {
|
||||||
Db.saveBatch(entities);
|
return Db.saveBatch(entities);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -131,28 +131,28 @@ public interface BaseMapperX<T> extends MPJBaseMapper<T> {
|
|||||||
* @param entities 实体们
|
* @param entities 实体们
|
||||||
* @param size 插入数量 Db.saveBatch 默认为 1000
|
* @param size 插入数量 Db.saveBatch 默认为 1000
|
||||||
*/
|
*/
|
||||||
default void insertBatch(Collection<T> entities, int size) {
|
default Boolean insertBatch(Collection<T> entities, int size) {
|
||||||
Db.saveBatch(entities, size);
|
return Db.saveBatch(entities, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
default void updateBatch(T update) {
|
default int updateBatch(T update) {
|
||||||
update(update, new QueryWrapper<>());
|
return update(update, new QueryWrapper<>());
|
||||||
}
|
}
|
||||||
|
|
||||||
default void updateBatch(Collection<T> entities) {
|
default Boolean updateBatch(Collection<T> entities) {
|
||||||
Db.updateBatchById(entities);
|
return Db.updateBatchById(entities);
|
||||||
}
|
}
|
||||||
|
|
||||||
default void updateBatch(Collection<T> entities, int size) {
|
default Boolean updateBatch(Collection<T> entities, int size) {
|
||||||
Db.updateBatchById(entities, size);
|
return Db.updateBatchById(entities, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
default void insertOrUpdate(T entity) {
|
default Boolean insertOrUpdate(T entity) {
|
||||||
Db.saveOrUpdate(entity);
|
return Db.saveOrUpdate(entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
default void insertOrUpdateBatch(Collection<T> collection) {
|
default Boolean insertOrUpdateBatch(Collection<T> collection) {
|
||||||
Db.saveOrUpdateBatch(collection);
|
return Db.saveOrUpdateBatch(collection);
|
||||||
}
|
}
|
||||||
|
|
||||||
default int delete(String field, String value) {
|
default int delete(String field, String value) {
|
||||||
|
@ -66,7 +66,7 @@ public class WebSocketSessionManagerImpl implements WebSocketSessionManager {
|
|||||||
@Override
|
@Override
|
||||||
public void removeSession(WebSocketSession session) {
|
public void removeSession(WebSocketSession session) {
|
||||||
// 移除从 idSessions 中
|
// 移除从 idSessions 中
|
||||||
idSessions.remove(session.getId(), session);
|
idSessions.remove(session.getId());
|
||||||
// 移除从 idSessions 中
|
// 移除从 idSessions 中
|
||||||
LoginUser user = WebSocketFrameworkUtils.getLoginUser(session);
|
LoginUser user = WebSocketFrameworkUtils.getLoginUser(session);
|
||||||
if (user == null) {
|
if (user == null) {
|
||||||
|
Loading…
Reference in New Issue
Block a user