|
|
@ -62,6 +62,7 @@ import org.thingsboard.server.common.data.kv.BasicTsKvEntry; |
|
|
import org.thingsboard.server.common.data.kv.BooleanDataEntry; |
|
|
import org.thingsboard.server.common.data.kv.BooleanDataEntry; |
|
|
import org.thingsboard.server.common.data.kv.DoubleDataEntry; |
|
|
import org.thingsboard.server.common.data.kv.DoubleDataEntry; |
|
|
import org.thingsboard.server.common.data.kv.LongDataEntry; |
|
|
import org.thingsboard.server.common.data.kv.LongDataEntry; |
|
|
|
|
|
import org.thingsboard.server.common.data.page.PageDataIterable; |
|
|
import org.thingsboard.server.common.data.page.PageLink; |
|
|
import org.thingsboard.server.common.data.page.PageLink; |
|
|
import org.thingsboard.server.common.data.query.BooleanFilterPredicate; |
|
|
import org.thingsboard.server.common.data.query.BooleanFilterPredicate; |
|
|
import org.thingsboard.server.common.data.query.DynamicValue; |
|
|
import org.thingsboard.server.common.data.query.DynamicValue; |
|
|
@ -82,13 +83,13 @@ import org.thingsboard.server.common.data.tenant.profile.DefaultTenantProfileCon |
|
|
import org.thingsboard.server.common.data.tenant.profile.TenantProfileData; |
|
|
import org.thingsboard.server.common.data.tenant.profile.TenantProfileData; |
|
|
import org.thingsboard.server.common.data.tenant.profile.TenantProfileQueueConfiguration; |
|
|
import org.thingsboard.server.common.data.tenant.profile.TenantProfileQueueConfiguration; |
|
|
import org.thingsboard.server.common.data.widget.WidgetsBundle; |
|
|
import org.thingsboard.server.common.data.widget.WidgetsBundle; |
|
|
import org.thingsboard.server.service.security.auth.jwt.settings.JwtSettingsService; |
|
|
|
|
|
import org.thingsboard.server.dao.attributes.AttributesService; |
|
|
import org.thingsboard.server.dao.attributes.AttributesService; |
|
|
import org.thingsboard.server.dao.customer.CustomerService; |
|
|
import org.thingsboard.server.dao.customer.CustomerService; |
|
|
import org.thingsboard.server.dao.device.DeviceCredentialsService; |
|
|
import org.thingsboard.server.dao.device.DeviceCredentialsService; |
|
|
import org.thingsboard.server.dao.device.DeviceProfileService; |
|
|
import org.thingsboard.server.dao.device.DeviceProfileService; |
|
|
import org.thingsboard.server.dao.device.DeviceService; |
|
|
import org.thingsboard.server.dao.device.DeviceService; |
|
|
import org.thingsboard.server.dao.exception.DataValidationException; |
|
|
import org.thingsboard.server.dao.exception.DataValidationException; |
|
|
|
|
|
import org.thingsboard.server.dao.notification.NotificationSettingsService; |
|
|
import org.thingsboard.server.dao.queue.QueueService; |
|
|
import org.thingsboard.server.dao.queue.QueueService; |
|
|
import org.thingsboard.server.dao.rule.RuleChainService; |
|
|
import org.thingsboard.server.dao.rule.RuleChainService; |
|
|
import org.thingsboard.server.dao.settings.AdminSettingsService; |
|
|
import org.thingsboard.server.dao.settings.AdminSettingsService; |
|
|
@ -97,6 +98,7 @@ import org.thingsboard.server.dao.tenant.TenantService; |
|
|
import org.thingsboard.server.dao.timeseries.TimeseriesService; |
|
|
import org.thingsboard.server.dao.timeseries.TimeseriesService; |
|
|
import org.thingsboard.server.dao.user.UserService; |
|
|
import org.thingsboard.server.dao.user.UserService; |
|
|
import org.thingsboard.server.dao.widget.WidgetsBundleService; |
|
|
import org.thingsboard.server.dao.widget.WidgetsBundleService; |
|
|
|
|
|
import org.thingsboard.server.service.security.auth.jwt.settings.JwtSettingsService; |
|
|
|
|
|
|
|
|
import javax.annotation.Nullable; |
|
|
import javax.annotation.Nullable; |
|
|
import javax.annotation.PostConstruct; |
|
|
import javax.annotation.PostConstruct; |
|
|
@ -171,6 +173,9 @@ public class DefaultSystemDataLoaderService implements SystemDataLoaderService { |
|
|
@Autowired |
|
|
@Autowired |
|
|
private JwtSettingsService jwtSettingsService; |
|
|
private JwtSettingsService jwtSettingsService; |
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
private NotificationSettingsService notificationSettingsService; |
|
|
|
|
|
|
|
|
@Bean |
|
|
@Bean |
|
|
protected BCryptPasswordEncoder passwordEncoder() { |
|
|
protected BCryptPasswordEncoder passwordEncoder() { |
|
|
return new BCryptPasswordEncoder(); |
|
|
return new BCryptPasswordEncoder(); |
|
|
@ -672,8 +677,15 @@ public class DefaultSystemDataLoaderService implements SystemDataLoaderService { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public void createNotificationConfigs() { |
|
|
public void createDefaultNotificationConfigs() { |
|
|
// create default notification targets: Alarm's customer
|
|
|
PageDataIterable<TenantId> tenants = new PageDataIterable<>(tenantService::findTenantsIds, 500); |
|
|
|
|
|
for (TenantId tenantId : tenants) { |
|
|
|
|
|
try { |
|
|
|
|
|
notificationSettingsService.createDefaultNotificationConfigs(tenantId); |
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|
log.warn("Failed to create default notification configs for tenant {}: {}", tenantId, e.getMessage()); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|