|
|
|
@ -136,18 +136,20 @@ public class TenantServiceImpl extends AbstractCachedEntityService<TenantId, Ten |
|
|
|
TenantId tenantId = savedTenant.getId(); |
|
|
|
publishEvictEvent(new TenantEvictEvent(tenantId, create)); |
|
|
|
|
|
|
|
if (create && defaultEntitiesCreator != null) { |
|
|
|
defaultEntitiesCreator.accept(tenantId); |
|
|
|
} |
|
|
|
|
|
|
|
eventPublisher.publishEvent(SaveEntityEvent.builder().tenantId(tenantId) |
|
|
|
.entityId(tenantId).entity(savedTenant).created(create).build()); |
|
|
|
|
|
|
|
if (create) { |
|
|
|
deviceProfileService.createDefaultDeviceProfile(tenantId); |
|
|
|
assetProfileService.createDefaultAssetProfile(tenantId); |
|
|
|
apiUsageStateService.createDefaultApiUsageState(tenantId, null); |
|
|
|
notificationSettingsService.createDefaultNotificationConfigs(tenantId); |
|
|
|
if (defaultEntitiesCreator != null) { |
|
|
|
defaultEntitiesCreator.accept(tenantId); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
eventPublisher.publishEvent(SaveEntityEvent.builder().tenantId(tenantId) |
|
|
|
.entityId(tenantId).entity(savedTenant).created(create).build()); |
|
|
|
return savedTenant; |
|
|
|
} |
|
|
|
|
|
|
|
|