fix: 2.0.0

1. 修复新增组配置,分区为0校验异常
This commit is contained in:
www.byteblogs.com 2023-06-20 20:39:37 +08:00 committed by byteblogs168
parent 61bf6049e2
commit f714046f2a

View File

@ -174,7 +174,7 @@ public class GroupConfigServiceImpl implements GroupConfigService {
groupConfig.setGroupPartition(HashUtil.bkdrHash(groupConfigRequestVO.getGroupName()) % totalPartition);
} else {
Assert.isTrue(totalPartition > groupConfigRequestVO.getGroupPartition(), () -> new EasyRetryServerException("分区超过最大分区. [{}]", totalPartition-1));
Assert.isTrue(groupConfigRequestVO.getGroupPartition() > 0, () -> new EasyRetryServerException("分区不能是负数."));
Assert.isTrue(groupConfigRequestVO.getGroupPartition() >= 0, () -> new EasyRetryServerException("分区不能是负数."));
}
Assert.isTrue(1 == groupConfigMapper.insert(groupConfig), () -> new EasyRetryServerException("新增组异常异常 groupConfigVO[{}]", groupConfigRequestVO));