diff --git a/im-platform/src/main/java/com/bx/implatform/dto/MessageTotalDto.java b/im-platform/src/main/java/com/bx/implatform/dto/MessageTotalDto.java index d94fc40..2ab2f67 100644 --- a/im-platform/src/main/java/com/bx/implatform/dto/MessageTotalDto.java +++ b/im-platform/src/main/java/com/bx/implatform/dto/MessageTotalDto.java @@ -5,6 +5,7 @@ import lombok.Data; import org.springframework.format.annotation.DateTimeFormat; import java.time.LocalDateTime; +import java.util.List; @Data public class MessageTotalDto { @@ -19,6 +20,16 @@ public class MessageTotalDto { */ private Long receiveId; + /** + * 排除发送人id + */ + private List excludeSendIds; + + /** + * 排除接收人id + */ + private List excludeReceiveIds; + /** * 发送时间范围 */ diff --git a/im-platform/src/main/resources/application-dev.yml b/im-platform/src/main/resources/application-dev.yml index f358545..5e053e5 100644 --- a/im-platform/src/main/resources/application-dev.yml +++ b/im-platform/src/main/resources/application-dev.yml @@ -1,14 +1,15 @@ spring: datasource: driver-class-name: com.mysql.cj.jdbc.Driver - url: jdbc:mysql://123.157.250.162:3306/im_platform?useSSL=false&useUnicode=true&characterEncoding=utf-8&allowPublicKeyRetrieval=true + url: jdbc:mysql://139.224.25.207:3306/im_platform?useSSL=false&useUnicode=true&characterEncoding=utf-8&allowPublicKeyRetrieval=true username: im_platform password: 3tKHbkSHfycbriN7 data: redis: - host: localhost + host: 139.224.25.207 port: 6379 database: 10 + password: 179965 minio: endpoint: https://minioapi.zianxin.com #内网地址 diff --git a/im-platform/src/main/resources/application-prod.yml b/im-platform/src/main/resources/application-prod.yml index 2359bb8..38ea5ac 100644 --- a/im-platform/src/main/resources/application-prod.yml +++ b/im-platform/src/main/resources/application-prod.yml @@ -12,7 +12,7 @@ spring: database: 10 minio: - endpoint: http://192.168.0.6:9000 #内网地址 + endpoint: https://minioapi.zianxin.com #内网地址 domain: https://minioapi.zianxin.com #外网访问地址 accessKey: EnBCxtxZ9j0tJJKqjRjG secretKey: imxrsyk1hM3lZ8dSbzz2QQSrw43rH33uZvnHXFzb diff --git a/im-platform/src/main/resources/mapper/PrivateMessageMapper.xml b/im-platform/src/main/resources/mapper/PrivateMessageMapper.xml index b8e0275..5907525 100644 --- a/im-platform/src/main/resources/mapper/PrivateMessageMapper.xml +++ b/im-platform/src/main/resources/mapper/PrivateMessageMapper.xml @@ -10,6 +10,18 @@ and a.recv_id = #{dto.receiveId} + + and a.send_id not in + + #{v} + + + + and a.recv_id not in + + #{v} + + and a.send_time between #{dto.timeRange[0]} and #{dto.timeRange[1]} diff --git a/im-server/src/main/java/com/bx/imserver/netty/IMServerGroup.java b/im-server/src/main/java/com/bx/imserver/netty/IMServerGroup.java index 8c5a36a..27b68f4 100644 --- a/im-server/src/main/java/com/bx/imserver/netty/IMServerGroup.java +++ b/im-server/src/main/java/com/bx/imserver/netty/IMServerGroup.java @@ -1,14 +1,18 @@ package com.bx.imserver.netty; import com.bx.imcommon.contant.IMRedisKey; +import com.bx.imcommon.enums.IMTerminalType; import com.bx.imcommon.mq.RedisMQTemplate; +import jakarta.annotation.PostConstruct; import jakarta.annotation.PreDestroy; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.boot.CommandLineRunner; import org.springframework.stereotype.Component; +import java.util.LinkedList; import java.util.List; +import java.util.concurrent.TimeUnit; @Slf4j @Component @@ -21,6 +25,16 @@ public class IMServerGroup implements CommandLineRunner { private final List imServers; + @PostConstruct + public void init() { + for (Integer code : IMTerminalType.codes()) { + String messageUserKey = String.join(":", IMRedisKey.IM_USER_SERVER_ID, String.valueOf(-100L), String.valueOf(code)); + String serviceUserKey = String.join(":", IMRedisKey.IM_USER_SERVER_ID, String.valueOf(-200L), String.valueOf(code)); + redisMQTemplate.opsForValue().set(messageUserKey, IMServerGroup.serverId); + redisMQTemplate.opsForValue().set(serviceUserKey, IMServerGroup.serverId); + } + } + /*** * 判断服务器是否就绪 * diff --git a/im-server/src/main/resources/application-dev.yml b/im-server/src/main/resources/application-dev.yml index af0baeb..b61b951 100644 --- a/im-server/src/main/resources/application-dev.yml +++ b/im-server/src/main/resources/application-dev.yml @@ -1,6 +1,7 @@ spring: data: redis: - host: 127.0.0.1 + host: 139.224.25.207 port: 6379 + password: 179965 database: 10 \ No newline at end of file diff --git a/im-web/.env.development b/im-web/.env.development index f6fdb03..5dc974c 100644 --- a/im-web/.env.development +++ b/im-web/.env.development @@ -5,5 +5,5 @@ VUE_APP_NAME = "盒子IM" # 接口请求地址 VUE_APP_BASE_API = '/api' # ws地址 -VUE_APP_WS_URL = 'ws://127.0.0.1:8876/im' -# VUE_APP_WS_URL = 'ws://chatapp.zianxin.com/im' +# VUE_APP_WS_URL = 'ws://127.0.0.1:8876/im' +VUE_APP_WS_URL = 'ws://chatapp.zianxin.com/im' diff --git a/im-web/.env.production b/im-web/.env.production index ffdb954..3c99a3f 100644 --- a/im-web/.env.production +++ b/im-web/.env.production @@ -3,6 +3,6 @@ ENV = 'production' # app名称 VUE_APP_NAME = "盒子IM" # 接口地址 -VUE_APP_BASE_API = 'https://www.boxim.online/api' +VUE_APP_BASE_API = 'https://chatsever.zianxin.com' # ws地址 -VUE_APP_WS_URL = 'wss://www.boxim.online/im' \ No newline at end of file +VUE_APP_WS_URL = 'ws://chatapp.zianxin.com/im' \ No newline at end of file diff --git a/im-web/vue.config.js b/im-web/vue.config.js index 89096d9..5577ed2 100644 --- a/im-web/vue.config.js +++ b/im-web/vue.config.js @@ -5,7 +5,8 @@ module.exports = { devServer: { proxy: { '/api': { - target: 'http://127.0.0.1:8888', + // target: 'http://127.0.0.1:8888', + target: "http://chatsever.zianxin.com", changeOrigin: true, ws: false, pathRewrite: {