reorganized packages
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
package com.vaessl.app.connection;
|
||||
|
||||
import java.time.Instant;
|
||||
|
||||
public record AuthResponse(String serviceType, Instant expiresAt) {}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.vaessl.app.connection;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
|
||||
public record ConnectionRequest(
|
||||
@NotBlank(message = "App URL is mandatory") String appUrl,
|
||||
@NotBlank(message = "Service type is mandatory") String serviceType,
|
||||
String username,
|
||||
String password,
|
||||
String apiKey,
|
||||
@JsonProperty(defaultValue = "false") Boolean stayLoggedIn) {
|
||||
|
||||
public ConnectionRequest {
|
||||
if (stayLoggedIn == null) {
|
||||
stayLoggedIn = false;
|
||||
}
|
||||
}
|
||||
|
||||
public ConnectionRequest(String appUrl, String serviceType, String username, String password,
|
||||
Boolean stayLoggedIn) {
|
||||
this(appUrl, serviceType, username, password, null, stayLoggedIn);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.vaessl.app.connection;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.util.Map;
|
||||
|
||||
public record ConnectionResponse(String token, Instant expiresAt, Map<String, Object> extraResponseData) {
|
||||
|
||||
public String getExtraVar(String key) {
|
||||
if(extraResponseData == null) {
|
||||
return null;
|
||||
} else {
|
||||
Object value = extraResponseData.get(key);
|
||||
|
||||
return value != null ? String.valueOf(value) : null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.vaessl.app.connection;
|
||||
|
||||
import java.time.Instant;
|
||||
|
||||
public record ConnectionStatusResponse(
|
||||
String serviceType,
|
||||
String appUrl,
|
||||
String username,
|
||||
Instant expiresAt,
|
||||
boolean connected) {}
|
||||
@@ -0,0 +1,5 @@
|
||||
package com.vaessl.app.connection;
|
||||
|
||||
import java.time.Instant;
|
||||
|
||||
public record LoginResult(Long connectionId, Instant expiresAt) {}
|
||||
Reference in New Issue
Block a user