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()
|
public static DiffMeta DEFAULT = DiffMeta.builder()
|
||||||
.oldValueKey("oldValue")
|
.oldValueKey("oldValue")
|
||||||
.newValueKey("newValue")
|
.newValueKey("newValue")
|
||||||
.ignoreKeys(ImmutableSet.of("modifyTime"))
|
.ignoreKeys(ImmutableSet.of("updateAt"))
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
public PayloadDifferentiator toDifferentiator() {
|
public PayloadDifferentiator toDifferentiator() {
|
||||||
|
|||||||
@ -100,7 +100,7 @@ public class EventHandlerRepository {
|
|||||||
&& context.getHeaders().containsKey(DiffablePayload.DIFF_META_HEADER)) {
|
&& context.getHeaders().containsKey(DiffablePayload.DIFF_META_HEADER)) {
|
||||||
byte[] diffMetaHeader = context.getHeaders().get(DiffablePayload.DIFF_META_HEADER);
|
byte[] diffMetaHeader = context.getHeaders().get(DiffablePayload.DIFF_META_HEADER);
|
||||||
List<DiffablePayload.DiffMeta> diffMetas = JSON.parseObject(
|
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);
|
differentiator = DiffablePayload.DiffMeta.toDifferentiator(diffMetas);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -18,7 +18,7 @@ import java.util.stream.Collectors;
|
|||||||
public class PayloadUtils {
|
public class PayloadUtils {
|
||||||
|
|
||||||
public static PayloadDifferentiator buildDifferentiator() {
|
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) {
|
public static PayloadDifferentiator buildDifferentiator(@NonNull String oldValueKey, @NonNull String newValueKey) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user