diff --git a/im-admin-ui/src/views/im/group/index.vue b/im-admin-ui/src/views/im/group/index.vue index 59731d8..b02035c 100644 --- a/im-admin-ui/src/views/im/group/index.vue +++ b/im-admin-ui/src/views/im/group/index.vue @@ -32,7 +32,7 @@ diff --git a/im-admin-ui/src/views/im/message/group/index.vue b/im-admin-ui/src/views/im/message/group/index.vue index 827e8dc..4c9c1fa 100644 --- a/im-admin-ui/src/views/im/message/group/index.vue +++ b/im-admin-ui/src/views/im/message/group/index.vue @@ -4,6 +4,12 @@
+ + + + + + - - - - - - diff --git a/im-admin-ui/src/views/im/message/private/index.vue b/im-admin-ui/src/views/im/message/private/index.vue index 12d62c3..ccce107 100644 --- a/im-admin-ui/src/views/im/message/private/index.vue +++ b/im-admin-ui/src/views/im/message/private/index.vue @@ -4,6 +4,12 @@
+ + + + + + - - - - - - diff --git a/im-admin-ui/src/views/im/user/index.vue b/im-admin-ui/src/views/im/user/index.vue index ae00420..87b4f6a 100644 --- a/im-admin-ui/src/views/im/user/index.vue +++ b/im-admin-ui/src/views/im/user/index.vue @@ -55,8 +55,10 @@ @@ -68,7 +70,8 @@ - + diff --git a/im-admin/pom.xml b/im-admin/pom.xml index a786b4b..0e46d8c 100644 --- a/im-admin/pom.xml +++ b/im-admin/pom.xml @@ -29,7 +29,6 @@ 3.37.0 2.2.7 4.3.1 - 1.1.2 1.4.5 0.2.0 1.18.34 @@ -53,13 +52,6 @@ - - local - - - local - - dev @@ -236,18 +228,6 @@ ${lock4j.version} - - - com.aizuda - snail-job-client-starter - ${snailjob.version} - - - com.aizuda - snail-job-client-job-core - ${snailjob.version} - - org.bouncycastle diff --git a/im-admin/ruoyi-common/ruoyi-common-mybatis/src/main/java/org/dromara/common/mybatis/config/MybatisPlusConfig.java b/im-admin/ruoyi-common/ruoyi-common-mybatis/src/main/java/org/dromara/common/mybatis/config/MybatisPlusConfig.java index 0bc5b66..761ba4c 100644 --- a/im-admin/ruoyi-common/ruoyi-common-mybatis/src/main/java/org/dromara/common/mybatis/config/MybatisPlusConfig.java +++ b/im-admin/ruoyi-common/ruoyi-common-mybatis/src/main/java/org/dromara/common/mybatis/config/MybatisPlusConfig.java @@ -25,7 +25,7 @@ import org.springframework.transaction.annotation.EnableTransactionManagement; * @author Lion Li */ @EnableTransactionManagement(proxyTargetClass = true) -@MapperScan("${mybatis-plus.mapperPackage}") +@MapperScan("org.dromara.**.mapper") @PropertySource(value = "classpath:common-mybatis.yml", factory = YmlPropertySourceFactory.class) public class MybatisPlusConfig { diff --git a/im-admin/ruoyi-im/src/main/java/org/dromara/im/service/impl/ImPrivateMessageServiceImpl.java b/im-admin/ruoyi-im/src/main/java/org/dromara/im/service/impl/ImPrivateMessageServiceImpl.java index dec3af4..0aa2fdc 100644 --- a/im-admin/ruoyi-im/src/main/java/org/dromara/im/service/impl/ImPrivateMessageServiceImpl.java +++ b/im-admin/ruoyi-im/src/main/java/org/dromara/im/service/impl/ImPrivateMessageServiceImpl.java @@ -17,6 +17,7 @@ import org.dromara.im.service.IImPrivateMessageService; import org.springframework.stereotype.Service; import java.util.Map; +import java.util.Objects; /** * 私聊消息Service业务层处理 @@ -60,11 +61,23 @@ public class ImPrivateMessageServiceImpl implements IImPrivateMessageService { private LambdaQueryWrapper buildQueryWrapper(ImPrivateMessageBo bo) { Map params = bo.getParams(); LambdaQueryWrapper wrapper = Wrappers.lambdaQuery(); - wrapper.eq(bo.getSendId() != null, ImPrivateMessage::getSendId, bo.getSendId()); - wrapper.eq(bo.getRecvId() != null, ImPrivateMessage::getRecvId, bo.getRecvId()); + if (!Objects.isNull(bo.getSendId()) && !Objects.isNull(bo.getRecvId())) { + // 指定了两个用户,返回这两个用户之间的聊天记录 + wrapper.and(wrap -> wrap.and(wp -> wp.eq(ImPrivateMessage::getSendId, bo.getSendId()) + .eq(ImPrivateMessage::getRecvId, bo.getRecvId())) + .or(wp -> wp.eq(ImPrivateMessage::getSendId, bo.getRecvId()) + .eq(ImPrivateMessage::getRecvId, bo.getSendId()))); + + } else if (!Objects.isNull(bo.getSendId())) { + wrapper.and(wp -> wp.eq(ImPrivateMessage::getSendId, bo.getSendId()).or() + .eq(ImPrivateMessage::getRecvId, bo.getSendId())); + } else if (!Objects.isNull(bo.getRecvId())) { + wrapper.and(wp -> wp.eq(ImPrivateMessage::getSendId, bo.getRecvId()).or() + .eq(ImPrivateMessage::getRecvId, bo.getRecvId())); + } wrapper.like(StringUtils.isNotBlank(bo.getContent()), ImPrivateMessage::getContent, bo.getContent()); - wrapper.eq(bo.getType() != null, ImPrivateMessage::getType, bo.getType()); - wrapper.eq(bo.getStatus() != null, ImPrivateMessage::getStatus, bo.getStatus()); + wrapper.eq(!Objects.isNull(bo.getType()), ImPrivateMessage::getType, bo.getType()); + wrapper.eq(!Objects.isNull(bo.getStatus()), ImPrivateMessage::getStatus, bo.getStatus()); wrapper.between(params.get("beginTime") != null && params.get("endTime") != null, ImPrivateMessage::getSendTime, params.get("beginTime"), params.get("endTime")); wrapper.orderByDesc(ImPrivateMessage::getId);