Renaming SaveEntityEvent variable from added to created. Fix test
This commit is contained in:
parent
67fe8067b7
commit
54ee0677ad
@ -79,10 +79,10 @@ public class EdgeEventSourcingListener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
log.trace("[{}] SaveEntityEvent called: {}", event.getTenantId(), event);
|
log.trace("[{}] SaveEntityEvent called: {}", event.getTenantId(), event);
|
||||||
boolean isAdded = Boolean.TRUE.equals(event.getAdded());
|
boolean isCreated = Boolean.TRUE.equals(event.getCreated());
|
||||||
String body = getBodyMsgForEntityEvent(event.getEntity());
|
String body = getBodyMsgForEntityEvent(event.getEntity());
|
||||||
EdgeEventType type = getEdgeEventTypeForEntityEvent(event.getEntity());
|
EdgeEventType type = getEdgeEventTypeForEntityEvent(event.getEntity());
|
||||||
EdgeEventActionType action = getActionForEntityEvent(event.getEntity(), isAdded);
|
EdgeEventActionType action = getActionForEntityEvent(event.getEntity(), isCreated);
|
||||||
tbClusterService.sendNotificationMsgToEdge(event.getTenantId(), null, event.getEntityId(),
|
tbClusterService.sendNotificationMsgToEdge(event.getTenantId(), null, event.getEntityId(),
|
||||||
body, type, action, edgeSynchronizationManager.getEdgeId().get());
|
body, type, action, edgeSynchronizationManager.getEdgeId().get());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@ -200,10 +200,10 @@ public class EdgeEventSourcingListener {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private EdgeEventActionType getActionForEntityEvent(Object entity, boolean isAdded) {
|
private EdgeEventActionType getActionForEntityEvent(Object entity, boolean isCreated) {
|
||||||
if (entity instanceof AlarmComment) {
|
if (entity instanceof AlarmComment) {
|
||||||
return isAdded ? EdgeEventActionType.ADDED_COMMENT : EdgeEventActionType.UPDATED_COMMENT;
|
return isCreated ? EdgeEventActionType.ADDED_COMMENT : EdgeEventActionType.UPDATED_COMMENT;
|
||||||
}
|
}
|
||||||
return isAdded ? EdgeEventActionType.ADDED : EdgeEventActionType.UPDATED;
|
return isCreated ? EdgeEventActionType.ADDED : EdgeEventActionType.UPDATED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -92,6 +92,7 @@ public class AlarmEdgeTest extends AbstractEdgeTest {
|
|||||||
alarm.setType("alarm");
|
alarm.setType("alarm");
|
||||||
alarm.setSeverity(AlarmSeverity.CRITICAL);
|
alarm.setSeverity(AlarmSeverity.CRITICAL);
|
||||||
Alarm savedAlarm = doPost("/api/alarm", alarm, Alarm.class);
|
Alarm savedAlarm = doPost("/api/alarm", alarm, Alarm.class);
|
||||||
|
edgeImitator.ignoreType(AlarmCommentUpdateMsg.class);
|
||||||
|
|
||||||
// ack alarm
|
// ack alarm
|
||||||
edgeImitator.expectMessageAmount(1);
|
edgeImitator.expectMessageAmount(1);
|
||||||
@ -135,6 +136,7 @@ public class AlarmEdgeTest extends AbstractEdgeTest {
|
|||||||
Assert.assertEquals(savedAlarm.getType(), alarmMsg.getType());
|
Assert.assertEquals(savedAlarm.getType(), alarmMsg.getType());
|
||||||
Assert.assertEquals(savedAlarm.getName(), alarmMsg.getName());
|
Assert.assertEquals(savedAlarm.getName(), alarmMsg.getName());
|
||||||
Assert.assertEquals(AlarmStatus.CLEARED_ACK, alarmMsg.getStatus());
|
Assert.assertEquals(AlarmStatus.CLEARED_ACK, alarmMsg.getStatus());
|
||||||
|
edgeImitator.allowIgnoredTypes();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
@ -61,7 +61,7 @@ public class BaseAlarmCommentService extends AbstractEntityService implements Al
|
|||||||
}
|
}
|
||||||
if (result != null) {
|
if (result != null) {
|
||||||
eventPublisher.publishEvent(SaveEntityEvent.builder().tenantId(tenantId).entity(result)
|
eventPublisher.publishEvent(SaveEntityEvent.builder().tenantId(tenantId).entity(result)
|
||||||
.entityId(result.getAlarmId()).added(isCreated).build());
|
.entityId(result.getAlarmId()).created(isCreated).build());
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -135,7 +135,7 @@ public class BaseAlarmService extends AbstractCachedEntityService<TenantId, Page
|
|||||||
}
|
}
|
||||||
if (result.getAlarm() != null) {
|
if (result.getAlarm() != null) {
|
||||||
eventPublisher.publishEvent(SaveEntityEvent.builder().tenantId(result.getAlarm().getTenantId())
|
eventPublisher.publishEvent(SaveEntityEvent.builder().tenantId(result.getAlarm().getTenantId())
|
||||||
.entityId(result.getAlarm().getId()).entity(result).added(true).build());
|
.entityId(result.getAlarm().getId()).entity(result).created(true).build());
|
||||||
publishEvictEvent(new AlarmTypesCacheEvictEvent(request.getTenantId()));
|
publishEvictEvent(new AlarmTypesCacheEvictEvent(request.getTenantId()));
|
||||||
}
|
}
|
||||||
return withPropagated(result);
|
return withPropagated(result);
|
||||||
|
|||||||
@ -153,7 +153,7 @@ public class AssetProfileServiceImpl extends AbstractCachedEntityService<AssetPr
|
|||||||
publishEvictEvent(new AssetProfileEvictEvent(savedAssetProfile.getTenantId(), savedAssetProfile.getName(),
|
publishEvictEvent(new AssetProfileEvictEvent(savedAssetProfile.getTenantId(), savedAssetProfile.getName(),
|
||||||
oldAssetProfile != null ? oldAssetProfile.getName() : null, savedAssetProfile.getId(), savedAssetProfile.isDefault()));
|
oldAssetProfile != null ? oldAssetProfile.getName() : null, savedAssetProfile.getId(), savedAssetProfile.isDefault()));
|
||||||
eventPublisher.publishEvent(SaveEntityEvent.builder().tenantId(savedAssetProfile.getTenantId()).entityId(savedAssetProfile.getId())
|
eventPublisher.publishEvent(SaveEntityEvent.builder().tenantId(savedAssetProfile.getTenantId()).entityId(savedAssetProfile.getId())
|
||||||
.added(oldAssetProfile == null).build());
|
.created(oldAssetProfile == null).build());
|
||||||
} catch (Exception t) {
|
} catch (Exception t) {
|
||||||
handleEvictEvent(new AssetProfileEvictEvent(assetProfile.getTenantId(), assetProfile.getName(),
|
handleEvictEvent(new AssetProfileEvictEvent(assetProfile.getTenantId(), assetProfile.getName(),
|
||||||
oldAssetProfile != null ? oldAssetProfile.getName() : null, null, assetProfile.isDefault()));
|
oldAssetProfile != null ? oldAssetProfile.getName() : null, null, assetProfile.isDefault()));
|
||||||
|
|||||||
@ -172,7 +172,7 @@ public class BaseAssetService extends AbstractCachedEntityService<AssetCacheKey,
|
|||||||
savedAsset = assetDao.saveAndFlush(asset.getTenantId(), asset);
|
savedAsset = assetDao.saveAndFlush(asset.getTenantId(), asset);
|
||||||
publishEvictEvent(evictEvent);
|
publishEvictEvent(evictEvent);
|
||||||
eventPublisher.publishEvent(SaveEntityEvent.builder().tenantId(savedAsset.getTenantId())
|
eventPublisher.publishEvent(SaveEntityEvent.builder().tenantId(savedAsset.getTenantId())
|
||||||
.entityId(savedAsset.getId()).added(asset.getId() == null).build());
|
.entityId(savedAsset.getId()).created(asset.getId() == null).build());
|
||||||
if (asset.getId() == null) {
|
if (asset.getId() == null) {
|
||||||
countService.publishCountEntityEvictEvent(savedAsset.getTenantId(), EntityType.ASSET);
|
countService.publishCountEntityEvictEvent(savedAsset.getTenantId(), EntityType.ASSET);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -113,7 +113,7 @@ public class CustomerServiceImpl extends AbstractEntityService implements Custom
|
|||||||
countService.publishCountEntityEvictEvent(savedCustomer.getTenantId(), EntityType.CUSTOMER);
|
countService.publishCountEntityEvictEvent(savedCustomer.getTenantId(), EntityType.CUSTOMER);
|
||||||
}
|
}
|
||||||
eventPublisher.publishEvent(SaveEntityEvent.builder().tenantId(savedCustomer.getTenantId())
|
eventPublisher.publishEvent(SaveEntityEvent.builder().tenantId(savedCustomer.getTenantId())
|
||||||
.entityId(savedCustomer.getId()).added(customer.getId() == null).build());
|
.entityId(savedCustomer.getId()).created(customer.getId() == null).build());
|
||||||
return savedCustomer;
|
return savedCustomer;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
checkConstraintViolation(e, "customer_external_id_unq_key", "Customer with such external id already exists!");
|
checkConstraintViolation(e, "customer_external_id_unq_key", "Customer with such external id already exists!");
|
||||||
|
|||||||
@ -161,7 +161,7 @@ public class DashboardServiceImpl extends AbstractEntityService implements Dashb
|
|||||||
var saved = dashboardDao.save(dashboard.getTenantId(), dashboard);
|
var saved = dashboardDao.save(dashboard.getTenantId(), dashboard);
|
||||||
publishEvictEvent(new DashboardTitleEvictEvent(saved.getId()));
|
publishEvictEvent(new DashboardTitleEvictEvent(saved.getId()));
|
||||||
eventPublisher.publishEvent(SaveEntityEvent.builder().tenantId(saved.getTenantId())
|
eventPublisher.publishEvent(SaveEntityEvent.builder().tenantId(saved.getTenantId())
|
||||||
.entityId(saved.getId()).added(dashboard.getId() == null).build());
|
.entityId(saved.getId()).created(dashboard.getId() == null).build());
|
||||||
if (dashboard.getId() == null) {
|
if (dashboard.getId() == null) {
|
||||||
countService.publishCountEntityEvictEvent(saved.getTenantId(), EntityType.DASHBOARD);
|
countService.publishCountEntityEvictEvent(saved.getTenantId(), EntityType.DASHBOARD);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -191,7 +191,7 @@ public class DeviceProfileServiceImpl extends AbstractCachedEntityService<Device
|
|||||||
oldDeviceProfile != null ? oldDeviceProfile.getName() : null, savedDeviceProfile.getId(), savedDeviceProfile.isDefault(),
|
oldDeviceProfile != null ? oldDeviceProfile.getName() : null, savedDeviceProfile.getId(), savedDeviceProfile.isDefault(),
|
||||||
oldDeviceProfile != null ? oldDeviceProfile.getProvisionDeviceKey() : null));
|
oldDeviceProfile != null ? oldDeviceProfile.getProvisionDeviceKey() : null));
|
||||||
eventPublisher.publishEvent(SaveEntityEvent.builder().tenantId(savedDeviceProfile.getTenantId())
|
eventPublisher.publishEvent(SaveEntityEvent.builder().tenantId(savedDeviceProfile.getTenantId())
|
||||||
.entityId(savedDeviceProfile.getId()).added(oldDeviceProfile == null).build());
|
.entityId(savedDeviceProfile.getId()).created(oldDeviceProfile == null).build());
|
||||||
} catch (Exception t) {
|
} catch (Exception t) {
|
||||||
handleEvictEvent(new DeviceProfileEvictEvent(deviceProfile.getTenantId(), deviceProfile.getName(),
|
handleEvictEvent(new DeviceProfileEvictEvent(deviceProfile.getTenantId(), deviceProfile.getName(),
|
||||||
oldDeviceProfile != null ? oldDeviceProfile.getName() : null, null, deviceProfile.isDefault(),
|
oldDeviceProfile != null ? oldDeviceProfile.getName() : null, null, deviceProfile.isDefault(),
|
||||||
|
|||||||
@ -79,7 +79,6 @@ import org.thingsboard.server.dao.service.DataValidator;
|
|||||||
import org.thingsboard.server.dao.service.PaginatedRemover;
|
import org.thingsboard.server.dao.service.PaginatedRemover;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Comparator;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
@ -239,7 +238,7 @@ public class DeviceServiceImpl extends AbstractCachedEntityService<DeviceCacheKe
|
|||||||
countService.publishCountEntityEvictEvent(result.getTenantId(), EntityType.DEVICE);
|
countService.publishCountEntityEvictEvent(result.getTenantId(), EntityType.DEVICE);
|
||||||
}
|
}
|
||||||
eventPublisher.publishEvent(SaveEntityEvent.builder().tenantId(result.getTenantId())
|
eventPublisher.publishEvent(SaveEntityEvent.builder().tenantId(result.getTenantId())
|
||||||
.entityId(result.getId()).added(device.getId() == null).build());
|
.entityId(result.getId()).created(device.getId() == null).build());
|
||||||
return result;
|
return result;
|
||||||
} catch (Exception t) {
|
} catch (Exception t) {
|
||||||
handleEvictEvent(deviceCacheEvictEvent);
|
handleEvictEvent(deviceCacheEvictEvent);
|
||||||
|
|||||||
@ -123,7 +123,7 @@ public class EntityViewServiceImpl extends AbstractCachedEntityService<EntityVie
|
|||||||
EntityView saved = entityViewDao.save(entityView.getTenantId(), entityView);
|
EntityView saved = entityViewDao.save(entityView.getTenantId(), entityView);
|
||||||
publishEvictEvent(new EntityViewEvictEvent(saved.getTenantId(), saved.getId(), saved.getEntityId(), old != null ? old.getEntityId() : null, saved.getName(), old != null ? old.getName() : null));
|
publishEvictEvent(new EntityViewEvictEvent(saved.getTenantId(), saved.getId(), saved.getEntityId(), old != null ? old.getEntityId() : null, saved.getName(), old != null ? old.getName() : null));
|
||||||
eventPublisher.publishEvent(SaveEntityEvent.builder().tenantId(saved.getTenantId())
|
eventPublisher.publishEvent(SaveEntityEvent.builder().tenantId(saved.getTenantId())
|
||||||
.entityId(saved.getId()).added(entityView.getId() == null).build());
|
.entityId(saved.getId()).created(entityView.getId() == null).build());
|
||||||
return saved;
|
return saved;
|
||||||
} catch (Exception t) {
|
} catch (Exception t) {
|
||||||
checkConstraintViolation(t,
|
checkConstraintViolation(t,
|
||||||
|
|||||||
@ -27,5 +27,5 @@ public class SaveEntityEvent<T> {
|
|||||||
private final T entity;
|
private final T entity;
|
||||||
private final T oldEntity;
|
private final T oldEntity;
|
||||||
private final EntityId entityId;
|
private final EntityId entityId;
|
||||||
private final Boolean added;
|
private final Boolean created;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -84,7 +84,7 @@ public class BaseOtaPackageService extends AbstractCachedEntityService<OtaPackag
|
|||||||
publishEvictEvent(new OtaPackageCacheEvictEvent(otaPackageId));
|
publishEvictEvent(new OtaPackageCacheEvictEvent(otaPackageId));
|
||||||
}
|
}
|
||||||
eventPublisher.publishEvent(SaveEntityEvent.builder().tenantId(result.getTenantId()).entity(result)
|
eventPublisher.publishEvent(SaveEntityEvent.builder().tenantId(result.getTenantId()).entity(result)
|
||||||
.entityId(result.getId()).added(otaPackageId == null).build());
|
.entityId(result.getId()).created(otaPackageId == null).build());
|
||||||
return result;
|
return result;
|
||||||
} catch (Exception t) {
|
} catch (Exception t) {
|
||||||
if (otaPackageId != null) {
|
if (otaPackageId != null) {
|
||||||
@ -110,7 +110,7 @@ public class BaseOtaPackageService extends AbstractCachedEntityService<OtaPackag
|
|||||||
publishEvictEvent(new OtaPackageCacheEvictEvent(otaPackageId));
|
publishEvictEvent(new OtaPackageCacheEvictEvent(otaPackageId));
|
||||||
}
|
}
|
||||||
eventPublisher.publishEvent(SaveEntityEvent.builder().tenantId(result.getTenantId())
|
eventPublisher.publishEvent(SaveEntityEvent.builder().tenantId(result.getTenantId())
|
||||||
.entityId(result.getId()).added(otaPackageId == null).build());
|
.entityId(result.getId()).created(otaPackageId == null).build());
|
||||||
return result;
|
return result;
|
||||||
} catch (Exception t) {
|
} catch (Exception t) {
|
||||||
if (otaPackageId != null) {
|
if (otaPackageId != null) {
|
||||||
|
|||||||
@ -66,7 +66,7 @@ public class BaseQueueService extends AbstractEntityService implements QueueServ
|
|||||||
queueValidator.validate(queue, Queue::getTenantId);
|
queueValidator.validate(queue, Queue::getTenantId);
|
||||||
Queue savedQueue = queueDao.save(queue.getTenantId(), queue);
|
Queue savedQueue = queueDao.save(queue.getTenantId(), queue);
|
||||||
eventPublisher.publishEvent(SaveEntityEvent.builder().tenantId(savedQueue.getTenantId())
|
eventPublisher.publishEvent(SaveEntityEvent.builder().tenantId(savedQueue.getTenantId())
|
||||||
.entityId(savedQueue.getId()).added(queue.getId() == null).build());
|
.entityId(savedQueue.getId()).created(queue.getId() == null).build());
|
||||||
return savedQueue;
|
return savedQueue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -90,7 +90,7 @@ public class BaseResourceService extends AbstractCachedEntityService<ResourceInf
|
|||||||
}
|
}
|
||||||
publishEvictEvent(new ResourceInfoEvictEvent(tenantId, resource.getId()));
|
publishEvictEvent(new ResourceInfoEvictEvent(tenantId, resource.getId()));
|
||||||
eventPublisher.publishEvent(SaveEntityEvent.builder().tenantId(saved.getTenantId())
|
eventPublisher.publishEvent(SaveEntityEvent.builder().tenantId(saved.getTenantId())
|
||||||
.entityId(saved.getId()).added(resource.getId() == null).build());
|
.entityId(saved.getId()).created(resource.getId() == null).build());
|
||||||
return saved;
|
return saved;
|
||||||
} catch (Exception t) {
|
} catch (Exception t) {
|
||||||
publishEvictEvent(new ResourceInfoEvictEvent(tenantId, resource.getId()));
|
publishEvictEvent(new ResourceInfoEvictEvent(tenantId, resource.getId()));
|
||||||
|
|||||||
@ -116,7 +116,7 @@ public class BaseRuleChainService extends AbstractEntityService implements RuleC
|
|||||||
entityCountService.publishCountEntityEvictEvent(ruleChain.getTenantId(), EntityType.RULE_CHAIN);
|
entityCountService.publishCountEntityEvictEvent(ruleChain.getTenantId(), EntityType.RULE_CHAIN);
|
||||||
}
|
}
|
||||||
eventPublisher.publishEvent(SaveEntityEvent.builder().tenantId(savedRuleChain.getTenantId())
|
eventPublisher.publishEvent(SaveEntityEvent.builder().tenantId(savedRuleChain.getTenantId())
|
||||||
.entity(savedRuleChain).entityId(savedRuleChain.getId()).added(ruleChain.getId() == null).build());
|
.entity(savedRuleChain).entityId(savedRuleChain.getId()).created(ruleChain.getId() == null).build());
|
||||||
return savedRuleChain;
|
return savedRuleChain;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
checkConstraintViolation(e, "rule_chain_external_id_unq_key", "Rule Chain with such external id already exists!");
|
checkConstraintViolation(e, "rule_chain_external_id_unq_key", "Rule Chain with such external id already exists!");
|
||||||
|
|||||||
@ -95,7 +95,7 @@ public class TenantProfileServiceImpl extends AbstractCachedEntityService<Tenant
|
|||||||
savedTenantProfile = tenantProfileDao.save(tenantId, tenantProfile);
|
savedTenantProfile = tenantProfileDao.save(tenantId, tenantProfile);
|
||||||
publishEvictEvent(new TenantProfileEvictEvent(savedTenantProfile.getId(), savedTenantProfile.isDefault()));
|
publishEvictEvent(new TenantProfileEvictEvent(savedTenantProfile.getId(), savedTenantProfile.isDefault()));
|
||||||
eventPublisher.publishEvent(SaveEntityEvent.builder().tenantId(tenantId)
|
eventPublisher.publishEvent(SaveEntityEvent.builder().tenantId(tenantId)
|
||||||
.entityId(savedTenantProfile.getId()).added(tenantProfile.getId() == null).build());
|
.entityId(savedTenantProfile.getId()).created(tenantProfile.getId() == null).build());
|
||||||
} catch (Exception t) {
|
} catch (Exception t) {
|
||||||
handleEvictEvent(new TenantProfileEvictEvent(null, tenantProfile.isDefault()));
|
handleEvictEvent(new TenantProfileEvictEvent(null, tenantProfile.isDefault()));
|
||||||
ConstraintViolationException e = extractConstraintViolationException(t).orElse(null);
|
ConstraintViolationException e = extractConstraintViolationException(t).orElse(null);
|
||||||
|
|||||||
@ -197,7 +197,7 @@ public class TenantServiceImpl extends AbstractCachedEntityService<TenantId, Ten
|
|||||||
boolean create = tenant.getId() == null;
|
boolean create = tenant.getId() == null;
|
||||||
Tenant savedTenant = tenantDao.save(tenant.getId(), tenant);
|
Tenant savedTenant = tenantDao.save(tenant.getId(), tenant);
|
||||||
publishEvictEvent(new TenantEvictEvent(savedTenant.getId(), create));
|
publishEvictEvent(new TenantEvictEvent(savedTenant.getId(), create));
|
||||||
eventPublisher.publishEvent(SaveEntityEvent.builder().tenantId(savedTenant.getId()).entityId(savedTenant.getId()).added(create).build());
|
eventPublisher.publishEvent(SaveEntityEvent.builder().tenantId(savedTenant.getId()).entityId(savedTenant.getId()).created(create).build());
|
||||||
if (tenant.getId() == null) {
|
if (tenant.getId() == null) {
|
||||||
deviceProfileService.createDefaultDeviceProfile(savedTenant.getId());
|
deviceProfileService.createDefaultDeviceProfile(savedTenant.getId());
|
||||||
assetProfileService.createDefaultAssetProfile(savedTenant.getId());
|
assetProfileService.createDefaultAssetProfile(savedTenant.getId());
|
||||||
|
|||||||
@ -145,7 +145,7 @@ public class UserServiceImpl extends AbstractEntityService implements UserServic
|
|||||||
.entity(savedUser)
|
.entity(savedUser)
|
||||||
.oldEntity(oldUser)
|
.oldEntity(oldUser)
|
||||||
.entityId(savedUser.getId())
|
.entityId(savedUser.getId())
|
||||||
.added(user.getId() == null).build());
|
.created(user.getId() == null).build());
|
||||||
return savedUser;
|
return savedUser;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -97,7 +97,7 @@ public class WidgetTypeServiceImpl implements WidgetTypeService {
|
|||||||
imageService.replaceBase64WithImageUrl(widgetTypeDetails);
|
imageService.replaceBase64WithImageUrl(widgetTypeDetails);
|
||||||
WidgetTypeDetails result = widgetTypeDao.save(widgetTypeDetails.getTenantId(), widgetTypeDetails);
|
WidgetTypeDetails result = widgetTypeDao.save(widgetTypeDetails.getTenantId(), widgetTypeDetails);
|
||||||
eventPublisher.publishEvent(SaveEntityEvent.builder().tenantId(result.getTenantId())
|
eventPublisher.publishEvent(SaveEntityEvent.builder().tenantId(result.getTenantId())
|
||||||
.entityId(result.getId()).added(widgetTypeDetails.getId() == null).build());
|
.entityId(result.getId()).created(widgetTypeDetails.getId() == null).build());
|
||||||
return result;
|
return result;
|
||||||
} catch (Exception t) {
|
} catch (Exception t) {
|
||||||
AbstractCachedEntityService.checkConstraintViolation(t,
|
AbstractCachedEntityService.checkConstraintViolation(t,
|
||||||
@ -209,7 +209,7 @@ public class WidgetTypeServiceImpl implements WidgetTypeService {
|
|||||||
widgetTypeDao.saveWidgetsBundleWidget(widgetsBundleWidget);
|
widgetTypeDao.saveWidgetsBundleWidget(widgetsBundleWidget);
|
||||||
}
|
}
|
||||||
eventPublisher.publishEvent(SaveEntityEvent.builder().tenantId(tenantId)
|
eventPublisher.publishEvent(SaveEntityEvent.builder().tenantId(tenantId)
|
||||||
.entityId(widgetsBundleId).added(false).build());
|
.entityId(widgetsBundleId).created(false).build());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@ -78,7 +78,7 @@ public class WidgetsBundleServiceImpl implements WidgetsBundleService {
|
|||||||
imageService.replaceBase64WithImageUrl(widgetsBundle, "bundle");
|
imageService.replaceBase64WithImageUrl(widgetsBundle, "bundle");
|
||||||
WidgetsBundle result = widgetsBundleDao.save(widgetsBundle.getTenantId(), widgetsBundle);
|
WidgetsBundle result = widgetsBundleDao.save(widgetsBundle.getTenantId(), widgetsBundle);
|
||||||
eventPublisher.publishEvent(SaveEntityEvent.builder().tenantId(result.getTenantId())
|
eventPublisher.publishEvent(SaveEntityEvent.builder().tenantId(result.getTenantId())
|
||||||
.entityId(result.getId()).added(widgetsBundle.getId() == null).build());
|
.entityId(result.getId()).created(widgetsBundle.getId() == null).build());
|
||||||
return result;
|
return result;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
AbstractCachedEntityService.checkConstraintViolation(e,
|
AbstractCachedEntityService.checkConstraintViolation(e,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user