From d39980bea920d97ca1e3374cef96a38e2f01167f Mon Sep 17 00:00:00 2001 From: xsx <825657193@qq.com> Date: Sun, 4 May 2025 16:32:02 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E7=89=88=E6=9C=AC=E6=9B=B4=E6=96=B0:v3.5.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- im-admin-ui/src/views/im/group/index.vue | 2 +- .../src/views/im/message/group/index.vue | 12 +++++------ .../src/views/im/message/private/index.vue | 12 +++++------ im-admin-ui/src/views/im/user/index.vue | 9 +++++--- im-admin/pom.xml | 20 ------------------ .../mybatis/config/MybatisPlusConfig.java | 2 +- .../impl/ImPrivateMessageServiceImpl.java | 21 +++++++++++++++---- 7 files changed, 37 insertions(+), 41 deletions(-) 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); From 03c1e4a005b4621fe7279225a27cb9fbd4fe52fd Mon Sep 17 00:00:00 2001 From: xsx <825657193@qq.com> Date: Sun, 4 May 2025 16:48:08 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E7=89=88=E6=9C=AC=E6=9B=B4=E6=96=B0:v3.5.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- im-admin-ui/src/views/im/group/index.vue | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index dd44e48..7e563a8 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ java -jar ./ruoyi-admin/target/im-admin.jar npm install npm run dev ``` -访问 http://localhost:3000 +访问 http://localhost:3000, 默认管理员账号: admin/admin123 #### 界面截图: ![输入图片说明](%E6%88%AA%E5%9B%BE/1.jpg) diff --git a/im-admin-ui/src/views/im/group/index.vue b/im-admin-ui/src/views/im/group/index.vue index b02035c..c78ee0e 100644 --- a/im-admin-ui/src/views/im/group/index.vue +++ b/im-admin-ui/src/views/im/group/index.vue @@ -32,7 +32,8 @@ @@ -56,8 +57,10 @@