系统过滤重复的请求

This commit is contained in:
2023-12-25 15:12:34 +08:00
parent 471f84af10
commit 894eccb186
3 changed files with 47 additions and 26 deletions

View File

@@ -74,4 +74,19 @@ public abstract class AbstractHandler implements InitializingBean {
PileChannelEntity.checkChannel(pileSn, channel);
}
/**
* 阻止重复帧
*/
protected boolean verifyTheDuplicateRequest(YKCDataProtocol ykcDataProtocol, Channel channel) {
// 获取序列号域
int serialNumber = BytesUtil.bytesToIntLittle(ykcDataProtocol.getSerialNumber());
// 获取channelId
String channelId = channel.id().asShortText();
String redisKey = "Request_" + channelId + "_" + serialNumber;
return false;
}
}