feat: 修改payload
This commit is contained in:
parent
f3c8d1e786
commit
88753f36fa
@ -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() {
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
@ -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) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user