Use Autowired in TenantServiceImpl
This commit is contained in:
parent
a576a73b86
commit
fc865252a8
@ -42,7 +42,6 @@ public class AssetProfileDataValidator extends DataValidator<AssetProfile> {
|
|||||||
@Lazy
|
@Lazy
|
||||||
private AssetProfileService assetProfileService;
|
private AssetProfileService assetProfileService;
|
||||||
@Autowired
|
@Autowired
|
||||||
@Lazy
|
|
||||||
private TenantService tenantService;
|
private TenantService tenantService;
|
||||||
@Lazy
|
@Lazy
|
||||||
@Autowired
|
@Autowired
|
||||||
|
|||||||
@ -16,7 +16,6 @@
|
|||||||
package org.thingsboard.server.dao.service.validator;
|
package org.thingsboard.server.dao.service.validator;
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.context.annotation.Lazy;
|
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import org.thingsboard.server.common.data.Dashboard;
|
import org.thingsboard.server.common.data.Dashboard;
|
||||||
import org.thingsboard.server.common.data.EntityType;
|
import org.thingsboard.server.common.data.EntityType;
|
||||||
@ -29,7 +28,6 @@ import org.thingsboard.server.dao.tenant.TenantService;
|
|||||||
public class DashboardDataValidator extends DataValidator<Dashboard> {
|
public class DashboardDataValidator extends DataValidator<Dashboard> {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
@Lazy
|
|
||||||
private TenantService tenantService;
|
private TenantService tenantService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@ -16,7 +16,6 @@
|
|||||||
package org.thingsboard.server.dao.service.validator;
|
package org.thingsboard.server.dao.service.validator;
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.context.annotation.Lazy;
|
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import org.thingsboard.server.common.data.Customer;
|
import org.thingsboard.server.common.data.Customer;
|
||||||
import org.thingsboard.server.common.data.Device;
|
import org.thingsboard.server.common.data.Device;
|
||||||
@ -40,7 +39,6 @@ public class DeviceDataValidator extends AbstractHasOtaPackageValidator<Device>
|
|||||||
private DeviceDao deviceDao;
|
private DeviceDao deviceDao;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
@Lazy
|
|
||||||
private TenantService tenantService;
|
private TenantService tenantService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
|||||||
@ -86,7 +86,6 @@ public class DeviceProfileDataValidator extends AbstractHasOtaPackageValidator<D
|
|||||||
@Autowired
|
@Autowired
|
||||||
private DeviceDao deviceDao;
|
private DeviceDao deviceDao;
|
||||||
@Autowired
|
@Autowired
|
||||||
@Lazy
|
|
||||||
private TenantService tenantService;
|
private TenantService tenantService;
|
||||||
@Lazy
|
@Lazy
|
||||||
@Autowired
|
@Autowired
|
||||||
|
|||||||
@ -49,7 +49,6 @@ public class ResourceDataValidator extends DataValidator<TbResource> {
|
|||||||
private WidgetTypeDao widgetTypeDao;
|
private WidgetTypeDao widgetTypeDao;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
@Lazy
|
|
||||||
private TenantService tenantService;
|
private TenantService tenantService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
|||||||
@ -53,7 +53,6 @@ public class RuleChainDataValidator extends DataValidator<RuleChain> {
|
|||||||
private RuleChainService ruleChainService;
|
private RuleChainService ruleChainService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
@Lazy
|
|
||||||
private TenantService tenantService;
|
private TenantService tenantService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@ -18,6 +18,8 @@ package org.thingsboard.server.dao.tenant;
|
|||||||
import com.google.common.util.concurrent.ListenableFuture;
|
import com.google.common.util.concurrent.ListenableFuture;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.context.annotation.Lazy;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.transaction.event.TransactionalEventListener;
|
import org.springframework.transaction.event.TransactionalEventListener;
|
||||||
@ -38,9 +40,9 @@ import org.thingsboard.server.dao.entity.AbstractCachedEntityService;
|
|||||||
import org.thingsboard.server.dao.eventsourcing.DeleteEntityEvent;
|
import org.thingsboard.server.dao.eventsourcing.DeleteEntityEvent;
|
||||||
import org.thingsboard.server.dao.eventsourcing.SaveEntityEvent;
|
import org.thingsboard.server.dao.eventsourcing.SaveEntityEvent;
|
||||||
import org.thingsboard.server.dao.notification.NotificationSettingsService;
|
import org.thingsboard.server.dao.notification.NotificationSettingsService;
|
||||||
import org.thingsboard.server.dao.service.DataValidator;
|
|
||||||
import org.thingsboard.server.dao.service.PaginatedRemover;
|
import org.thingsboard.server.dao.service.PaginatedRemover;
|
||||||
import org.thingsboard.server.dao.service.Validator;
|
import org.thingsboard.server.dao.service.Validator;
|
||||||
|
import org.thingsboard.server.dao.service.validator.TenantDataValidator;
|
||||||
import org.thingsboard.server.dao.settings.AdminSettingsService;
|
import org.thingsboard.server.dao.settings.AdminSettingsService;
|
||||||
import org.thingsboard.server.dao.usagerecord.ApiUsageStateService;
|
import org.thingsboard.server.dao.usagerecord.ApiUsageStateService;
|
||||||
import org.thingsboard.server.dao.user.UserService;
|
import org.thingsboard.server.dao.user.UserService;
|
||||||
@ -58,16 +60,28 @@ public class TenantServiceImpl extends AbstractCachedEntityService<TenantId, Ten
|
|||||||
private static final String DEFAULT_TENANT_REGION = "Global";
|
private static final String DEFAULT_TENANT_REGION = "Global";
|
||||||
public static final String INCORRECT_TENANT_ID = "Incorrect tenantId ";
|
public static final String INCORRECT_TENANT_ID = "Incorrect tenantId ";
|
||||||
|
|
||||||
private final TenantDao tenantDao;
|
@Autowired
|
||||||
private final TenantProfileService tenantProfileService;
|
private TenantDao tenantDao;
|
||||||
private final UserService userService;
|
@Autowired
|
||||||
private final AssetProfileService assetProfileService;
|
private TenantProfileService tenantProfileService;
|
||||||
private final DeviceProfileService deviceProfileService;
|
@Autowired
|
||||||
private final ApiUsageStateService apiUsageStateService;
|
@Lazy
|
||||||
private final AdminSettingsService adminSettingsService;
|
private UserService userService;
|
||||||
private final NotificationSettingsService notificationSettingsService;
|
@Autowired
|
||||||
private final DataValidator<Tenant> tenantValidator;
|
private AssetProfileService assetProfileService;
|
||||||
private final TbTransactionalCache<TenantId, Boolean> existsTenantCache;
|
@Autowired
|
||||||
|
private DeviceProfileService deviceProfileService;
|
||||||
|
@Lazy
|
||||||
|
@Autowired
|
||||||
|
private ApiUsageStateService apiUsageStateService;
|
||||||
|
@Autowired
|
||||||
|
private AdminSettingsService adminSettingsService;
|
||||||
|
@Autowired
|
||||||
|
private NotificationSettingsService notificationSettingsService;
|
||||||
|
@Autowired
|
||||||
|
private TenantDataValidator tenantValidator;
|
||||||
|
@Autowired
|
||||||
|
protected TbTransactionalCache<TenantId, Boolean> existsTenantCache;
|
||||||
|
|
||||||
@TransactionalEventListener(classes = TenantEvictEvent.class)
|
@TransactionalEventListener(classes = TenantEvictEvent.class)
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@ -59,7 +59,7 @@ public class ApiUsageStateServiceImpl extends AbstractEntityService implements A
|
|||||||
private final DataValidator<ApiUsageState> apiUsageStateValidator;
|
private final DataValidator<ApiUsageState> apiUsageStateValidator;
|
||||||
|
|
||||||
public ApiUsageStateServiceImpl(ApiUsageStateDao apiUsageStateDao, TenantProfileDao tenantProfileDao,
|
public ApiUsageStateServiceImpl(ApiUsageStateDao apiUsageStateDao, TenantProfileDao tenantProfileDao,
|
||||||
@Lazy TenantService tenantService, @Lazy TimeseriesService tsService,
|
TenantService tenantService, @Lazy TimeseriesService tsService,
|
||||||
DataValidator<ApiUsageState> apiUsageStateValidator) {
|
DataValidator<ApiUsageState> apiUsageStateValidator) {
|
||||||
this.apiUsageStateDao = apiUsageStateDao;
|
this.apiUsageStateDao = apiUsageStateDao;
|
||||||
this.tenantProfileDao = tenantProfileDao;
|
this.tenantProfileDao = tenantProfileDao;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user