Browse Source

补充公告信息

master
xie.bx 2 years ago
parent
commit
7543047e0b
  1. 6
      im-platform/src/main/java/com/bx/implatform/controller/UserController.java
  2. 2
      im-platform/src/main/java/com/bx/implatform/service/IUserService.java
  3. 2
      im-platform/src/main/java/com/bx/implatform/service/impl/GroupMessageServiceImpl.java
  4. 2
      im-platform/src/main/java/com/bx/implatform/service/impl/PrivateMessageServiceImpl.java
  5. 12
      im-platform/src/main/java/com/bx/implatform/service/impl/UserServiceImpl.java
  6. 10
      im-ui/src/components/chat/ChatBox.vue
  7. 12
      im-ui/src/view/Login.vue

6
im-platform/src/main/java/com/bx/implatform/controller/UserController.java

@ -28,12 +28,6 @@ public class UserController {
private IUserService userService; private IUserService userService;
@GetMapping("/online")
@ApiOperation(value = "判断用户是否在线",notes="返回在线的用户id集合")
public Result checkOnline(@NotEmpty @RequestParam("userIds") String userIds){
List<Long> onlineIds = userService.checkOnline(userIds);
return ResultUtils.success(onlineIds);
}
@GetMapping("/terminal/online") @GetMapping("/terminal/online")
@ApiOperation(value = "判断用户哪个终端在线",notes="返回在线的用户id的终端集合") @ApiOperation(value = "判断用户哪个终端在线",notes="返回在线的用户id的终端集合")

2
im-platform/src/main/java/com/bx/implatform/service/IUserService.java

@ -30,8 +30,6 @@ public interface IUserService extends IService<User> {
List<UserVO> findUserByName(String name); List<UserVO> findUserByName(String name);
List<Long> checkOnline(String userIds);
List<OnlineTerminalVO> getOnlineTerminals(String userIds); List<OnlineTerminalVO> getOnlineTerminals(String userIds);

2
im-platform/src/main/java/com/bx/implatform/service/impl/GroupMessageServiceImpl.java

@ -198,7 +198,7 @@ public class GroupMessageServiceImpl extends ServiceImpl<GroupMessageMapper, Gro
List<GroupMember> members = groupMemberService.findByUserId(session.getUserId()); List<GroupMember> members = groupMemberService.findByUserId(session.getUserId());
List<Long> ids = members.stream().map(GroupMember::getGroupId).collect(Collectors.toList()); List<Long> ids = members.stream().map(GroupMember::getGroupId).collect(Collectors.toList());
// 只能拉取最近3个月的 // 只能拉取最近3个月的
Date minDate = DateTimeUtils.addMonths(new Date(), -1); Date minDate = DateTimeUtils.addMonths(new Date(), -3);
LambdaQueryWrapper<GroupMessage> wrapper = Wrappers.lambdaQuery(); LambdaQueryWrapper<GroupMessage> wrapper = Wrappers.lambdaQuery();
wrapper.gt(GroupMessage::getId, minId) wrapper.gt(GroupMessage::getId, minId)
.gt(GroupMessage::getSendTime, minDate) .gt(GroupMessage::getSendTime, minDate)

2
im-platform/src/main/java/com/bx/implatform/service/impl/PrivateMessageServiceImpl.java

@ -205,7 +205,7 @@ public class PrivateMessageServiceImpl extends ServiceImpl<PrivateMessageMapper,
// 获取当前用户的消息 // 获取当前用户的消息
LambdaQueryWrapper<PrivateMessage> queryWrapper = Wrappers.lambdaQuery(); LambdaQueryWrapper<PrivateMessage> queryWrapper = Wrappers.lambdaQuery();
// 只能拉取最近6个月的 // 只能拉取最近6个月的
Date minDate = DateTimeUtils.addMonths(new Date(), -1); Date minDate = DateTimeUtils.addMonths(new Date(), -3);
queryWrapper.gt(PrivateMessage::getId, minId) queryWrapper.gt(PrivateMessage::getId, minId)
.ge(PrivateMessage::getSendTime, minDate) .ge(PrivateMessage::getSendTime, minDate)
.ne(PrivateMessage::getStatus, MessageStatus.RECALL.code()) .ne(PrivateMessage::getStatus, MessageStatus.RECALL.code())

12
im-platform/src/main/java/com/bx/implatform/service/impl/UserServiceImpl.java

@ -246,18 +246,6 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
}).collect(Collectors.toList()); }).collect(Collectors.toList());
} }
/**
* 判断用户是否在线返回在线的用户id列表
*
* @param userIds 用户id多个用,分割
* @return 在线用户id列表
*/
@Override
public List<Long> checkOnline(String userIds) {
List<Long> userIdList = Arrays.stream(userIds.split(","))
.map(Long::parseLong).collect(Collectors.toList());
return imClient.getOnlineUser(userIdList);
}
/** /**

10
im-ui/src/components/chat/ChatBox.vue

@ -242,16 +242,12 @@
this.showMinIdx = this.showMinIdx > 10 ? this.showMinIdx - 10 : 0; this.showMinIdx = this.showMinIdx > 10 ? this.showMinIdx - 10 : 0;
}, },
handleScroll(e) { handleScroll(e) {
let scrollElement = e.target let scrollElement = e.target
let scrollTop = scrollElement.scrollTop let scrollTop = scrollElement.scrollTop
if (scrollTop <30 ) { // 在顶部,不滚动的情况 if (scrollTop < 30 ) { // ,
console.log("next")
// 20 // 20
this.showMinIdx = this.showMinIdx > 20 ? this.showMinIdx - 20 : 0; this.showMinIdx = this.showMinIdx > 20 ? this.showMinIdx - 20 : 0;
} }
}, },
switchEmotionBox() { switchEmotionBox() {
this.showEmotion = !this.showEmotion; this.showEmotion = !this.showEmotion;
@ -508,14 +504,16 @@
handler(newChat, oldChat) { handler(newChat, oldChat) {
if (newChat.targetId > 0 && (!oldChat || newChat.type != oldChat.type || if (newChat.targetId > 0 && (!oldChat || newChat.type != oldChat.type ||
newChat.targetId != oldChat.targetId)) { newChat.targetId != oldChat.targetId)) {
if (this.chat.type == "GROUP") { if (this.chat.type == "GROUP") {
this.loadGroup(this.chat.targetId); this.loadGroup(this.chat.targetId);
} else { } else {
this.loadFriend(this.chat.targetId); this.loadFriend(this.chat.targetId);
} }
//
this.scrollToBottom(); this.scrollToBottom();
this.sendText = ""; this.sendText = "";
//
this.readedMessage()
// 30 // 30
let size = this.chat.messages.length; let size = this.chat.messages.length;
this.showMinIdx = size > 30 ? size - 30 : 0; this.showMinIdx = size > 30 ? size - 30 : 0;

12
im-ui/src/view/Login.vue

@ -1,8 +1,6 @@
<template> <template>
<div class="login-view"> <div class="login-view">
<div class="login-intro"> <div class="login-intro">
<!--<img src="@/assets/image/login.gif"/>-->
<div class="login-title"></div>
<div> <div>
<h3>盒子IM 2.0版本正式发布</h3> <h3>盒子IM 2.0版本正式发布</h3>
<ul> <ul>
@ -11,6 +9,14 @@
<li>页面风格升级表情包更新自动生成文字头像等</li> <li>页面风格升级表情包更新自动生成文字头像等</li>
</ul> </ul>
</div> </div>
<div>
<h3>最近更新(2023-11-05)</h3>
<ul>
<li>聊天输入框支持粘贴截图</li>
<li>聊天消息支持显示已读未读状态</li>
<li>修改拉取离线消息机制:用户登录后,自动从服务器同步最近3个月的消息</li>
</ul>
</div>
<div> <div>
<h3>项目依旧完全开源可内网部署如果项目对您有帮助,请帮忙点个star:</h3> <h3>项目依旧完全开源可内网部署如果项目对您有帮助,请帮忙点个star:</h3>
</div> </div>
@ -26,7 +32,6 @@
</a> </a>
</div> </div>
</div> </div>
<el-form class="login-form" :model="loginForm" status-icon :rules="rules" ref="loginForm" label-width="60px" <el-form class="login-form" :model="loginForm" status-icon :rules="rules" ref="loginForm" label-width="60px"
@keyup.enter.native="submitForm('loginForm')"> @keyup.enter.native="submitForm('loginForm')">
@ -163,7 +168,6 @@
.login-intro { .login-intro {
flex: 1; flex: 1;
height: 300px;
padding: 40px; padding: 40px;
max-width: 600px; max-width: 600px;
.login-title { .login-title {

Loading…
Cancel
Save