feat: 修改payload

This commit is contained in:
zengxiaobo 2024-05-17 09:53:27 +08:00
parent f3c8d1e786
commit 88753f36fa
3 changed files with 3 additions and 3 deletions

View File

@ -39,7 +39,7 @@ public interface DiffablePayload extends Serializable {
public static DiffMeta DEFAULT = DiffMeta.builder()
.oldValueKey("oldValue")
.newValueKey("newValue")
.ignoreKeys(ImmutableSet.of("modifyTime"))
.ignoreKeys(ImmutableSet.of("updateAt"))
.build();
public PayloadDifferentiator toDifferentiator() {

View File

@ -100,7 +100,7 @@ public class EventHandlerRepository {
&& context.getHeaders().containsKey(DiffablePayload.DIFF_META_HEADER)) {
byte[] diffMetaHeader = context.getHeaders().get(DiffablePayload.DIFF_META_HEADER);
List<DiffablePayload.DiffMeta> diffMetas = JSON.parseObject(
new String(diffMetaHeader, Charsets.UTF_8), new TypeReference<List>() {
new String(diffMetaHeader, Charsets.UTF_8), new TypeReference<List<DiffablePayload.DiffMeta>>() {
});
differentiator = DiffablePayload.DiffMeta.toDifferentiator(diffMetas);
}

View File

@ -18,7 +18,7 @@ import java.util.stream.Collectors;
public class PayloadUtils {
public static PayloadDifferentiator buildDifferentiator() {
return buildDifferentiator("oldValue", "newValue", ImmutableSet.of("modifyTime"));
return buildDifferentiator("oldValue", "newValue", ImmutableSet.of("updateAt"));
}
public static PayloadDifferentiator buildDifferentiator(@NonNull String oldValueKey, @NonNull String newValueKey) {