feat:2.4.0

1. 修复组更新失败问题
This commit is contained in:
byteblogs168 2023-11-05 23:58:08 +08:00
parent a3f6b01439
commit 21518e6e40
2 changed files with 4 additions and 2 deletions

View File

@ -1,6 +1,7 @@
package com.aizuda.easy.retry.template.datasource.persistence.po;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
@ -21,6 +22,7 @@ public class GroupConfig implements Serializable {
private Integer idGeneratorMode;
@TableField(value = "version", update= "%s+1")
private Integer version;
private Integer initScene;

View File

@ -104,9 +104,9 @@ public class GroupConfigServiceImpl implements GroupConfigService {
}
GroupConfig groupConfig = GroupConfigConverter.INSTANCE.convert(groupConfigRequestVO);
groupConfig.setVersion(groupConfig.getVersion() + 1);
groupConfig.setDescription(Optional.ofNullable(groupConfigRequestVO.getDescription()).orElse(StrUtil.EMPTY));
// 使用@TableField(value = "version", update= "%s+1") 进行更新version, 这里必须初始化一个值
groupConfig.setVersion(1);
Assert.isTrue(systemProperties.getTotalPartition() > groupConfigRequestVO.getGroupPartition(), () -> new EasyRetryServerException("分区超过最大分区. [{}]", systemProperties.getTotalPartition() - 1));
Assert.isTrue(groupConfigRequestVO.getGroupPartition() >= 0, () -> new EasyRetryServerException("分区不能是负数."));