added sonarqube config #41
@@ -52,7 +52,8 @@ public class ConnectionService {
|
|||||||
return new LoginResult(saved.getId(), response.expiresAt());
|
return new LoginResult(saved.getId(), response.expiresAt());
|
||||||
}
|
}
|
||||||
|
|
||||||
public ConnectionStatusResponse getConnectionStatus(ServiceType serviceType, Long connectionId) {
|
public ConnectionStatusResponse getConnectionStatus(ServiceType serviceType,
|
||||||
|
Long connectionId) {
|
||||||
ConnectionEntity entity = cRepository.findById(connectionId).orElse(null);
|
ConnectionEntity entity = cRepository.findById(connectionId).orElse(null);
|
||||||
if (entity == null)
|
if (entity == null)
|
||||||
return null;
|
return null;
|
||||||
@@ -61,7 +62,7 @@ public class ConnectionService {
|
|||||||
Instant expiresAt = (provider != null) ? provider.getTokenExpiry(entity) : null;
|
Instant expiresAt = (provider != null) ? provider.getTokenExpiry(entity) : null;
|
||||||
boolean connected = expiresAt == null || expiresAt.isAfter(Instant.now());
|
boolean connected = expiresAt == null || expiresAt.isAfter(Instant.now());
|
||||||
|
|
||||||
return new ConnectionStatusResponse(serviceType.name(), entity.getAppUrl(), entity.getUsername(),
|
return new ConnectionStatusResponse(serviceType.name(), entity.getAppUrl(),
|
||||||
expiresAt, connected);
|
entity.getUsername(), expiresAt, connected);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user