mirror of
https://github.com/zongzibinbin/MallChat.git
synced 2026-03-14 14:13:42 +08:00
fix:
1.登录集群改造 2.netty取消上下文
This commit is contained in:
@@ -34,6 +34,8 @@ public class ChatMessageResp {
|
||||
public static class Message {
|
||||
@ApiModelProperty("消息id")
|
||||
private Long id;
|
||||
@ApiModelProperty("房间id")
|
||||
private Long roomId;
|
||||
@ApiModelProperty("消息发送时间")
|
||||
private Date sendTime;
|
||||
@ApiModelProperty("消息类型 1正常文本 2.撤回消息")
|
||||
|
||||
@@ -20,12 +20,12 @@ public interface MQConstant {
|
||||
/**
|
||||
* (授权完成后)登录信息mq
|
||||
*/
|
||||
String LOGIN_MSG_TOPIC = "login_send_msg";
|
||||
String LOGIN_MSG_GROUP = "login_send_msg_group";
|
||||
String LOGIN_MSG_TOPIC = "user_login_send_msg";
|
||||
String LOGIN_MSG_GROUP = "user_login_send_msg_group";
|
||||
|
||||
/**
|
||||
* 扫码成功 信息发送mq
|
||||
*/
|
||||
String SCAN_MSG_TOPIC = "scan_send_msg";
|
||||
String SCAN_MSG_GROUP = "scan_send_msg_group";
|
||||
String SCAN_MSG_TOPIC = "user_scan_send_msg";
|
||||
String SCAN_MSG_GROUP = "user_scan_send_msg_group";
|
||||
}
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
package com.abin.mallchat.common.common.domain.dto;
|
||||
|
||||
import com.abin.mallchat.common.user.domain.enums.WSBaseResp;
|
||||
import com.abin.mallchat.common.user.domain.enums.WSPushTypeEnum;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@@ -15,18 +11,11 @@ import java.io.Serializable;
|
||||
* Date: 2023-08-12
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class LoginMessageDTO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 微信公众号获得扫码事件后,发送给我方的回调信息
|
||||
*/
|
||||
private WxMpXmlMessage wxMpXmlMessage ;
|
||||
|
||||
public LoginMessageDTO(WxMpXmlMessage wxMpXmlMessage) {
|
||||
this.wxMpXmlMessage = wxMpXmlMessage;
|
||||
}
|
||||
|
||||
private Long uid;
|
||||
private Integer code;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package com.abin.mallchat.common.common.domain.dto;
|
||||
|
||||
import com.abin.mallchat.common.user.domain.enums.WSBaseResp;
|
||||
import com.abin.mallchat.common.user.domain.enums.WSPushTypeEnum;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
@@ -17,17 +15,9 @@ import java.io.Serializable;
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class ScanSuccessMessageDTO implements Serializable {
|
||||
/**
|
||||
* 推送的ws消息
|
||||
*/
|
||||
private WSBaseResp<?> wsBaseMsg;
|
||||
/**
|
||||
* 推送的uid
|
||||
*/
|
||||
private Integer loginCode;
|
||||
private Integer code;
|
||||
|
||||
public ScanSuccessMessageDTO(Integer loginCode, WSBaseResp<?> wsBaseMsg) {
|
||||
this.loginCode = loginCode;
|
||||
this.wsBaseMsg = wsBaseMsg;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
package com.abin.mallchat.common.common.utils;
|
||||
|
||||
import com.github.benmanes.caffeine.cache.Cache;
|
||||
import com.github.benmanes.caffeine.cache.Caffeine;
|
||||
import io.netty.channel.Channel;
|
||||
|
||||
import java.time.Duration;
|
||||
|
||||
/**
|
||||
* Description: Cache管理器
|
||||
* Author: <a href="https://github.com/zongzibinbin">abin</a>
|
||||
* Date: 2023-04-05
|
||||
*/
|
||||
public class CacheHolder {
|
||||
|
||||
private static final Long MAX_MUM_SIZE = 10000L;
|
||||
|
||||
private static final Duration EXPIRE_TIME = Duration.ofHours(1);
|
||||
/**
|
||||
* 所有请求登录的code与channel关系
|
||||
*/
|
||||
public static final Cache<Integer, Channel> WAIT_LOGIN_MAP = Caffeine.newBuilder()
|
||||
.expireAfterWrite(EXPIRE_TIME)
|
||||
.maximumSize(MAX_MUM_SIZE)
|
||||
.build();
|
||||
}
|
||||
Reference in New Issue
Block a user