优化
This commit is contained in:
@@ -18,9 +18,6 @@ public final class EventTypes {
|
||||
public static final String BUSINESS_FEE_SOURCE_CHANGED = "BusinessFeeSourceChanged";
|
||||
public static final String WALLET_COMMAND_REQUESTED = "WalletCommandRequested";
|
||||
public static final String WALLET_COMMAND_COMPLETED = "WalletCommandCompleted";
|
||||
public static final String IAM_USER_STATUS_CHANGED = "IamUserStatusChanged";
|
||||
public static final String IAM_TENANT_STATUS_CHANGED = "IamTenantStatusChanged";
|
||||
public static final String IAM_PERMISSION_VERSION_CHANGED = "IamPermissionVersionChanged";
|
||||
public static final String LAST_MILE_HANDOFF_ACCEPTED = "LastMileHandoffAccepted";
|
||||
public static final String LAST_MILE_HANDOFF_REJECTED = "LastMileHandoffRejected";
|
||||
public static final String LAST_MILE_MILESTONE_CHANGED = "LastMileMilestoneChanged";
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
package com.baiyue.common.event;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.util.Set;
|
||||
|
||||
/** IAM 向海外服务发布的 V1 安全投影事件负载。 */
|
||||
public final class IamSecurityEventsV1 {
|
||||
public static final int VERSION = 1;
|
||||
|
||||
private IamSecurityEventsV1() { }
|
||||
|
||||
public record UserStatusChanged(long authUserId, long tenantId, String appCode,
|
||||
String status, long permissionVersion, Instant changedAt) { }
|
||||
|
||||
public record TenantStatusChanged(long tenantId, String status, Instant changedAt) { }
|
||||
|
||||
public record PermissionVersionChanged(long authUserId, long tenantId, String appCode,
|
||||
long permissionVersion, String reason, Instant changedAt,
|
||||
Set<String> roles, Set<String> authorities) {
|
||||
public PermissionVersionChanged {
|
||||
roles = roles == null ? Set.of() : Set.copyOf(roles);
|
||||
authorities = authorities == null ? Set.of() : Set.copyOf(authorities);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -44,6 +44,6 @@ class DeliveryAckTest {
|
||||
assertThat(EventDeliveryRoute.forEventType(EventTypes.OVERSEAS_CONTAINER_UNLOADED).serviceName()).isEqualTo("firstleg-service");
|
||||
assertThat(EventDeliveryRoute.forEventType(EventTypes.WALLET_COMMAND_COMPLETED).serviceName()).isEqualTo("lastleg-service");
|
||||
assertThatThrownBy(() -> EventDeliveryRoute.forEventType("UnknownEvent")).isInstanceOf(IllegalArgumentException.class);
|
||||
assertThatThrownBy(() -> EventDeliveryRoute.forEventType(EventTypes.IAM_USER_STATUS_CHANGED)).isInstanceOf(IllegalArgumentException.class);
|
||||
assertThatThrownBy(() -> EventDeliveryRoute.forEventType("IamUserStatusChanged")).isInstanceOf(IllegalArgumentException.class);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user