Refactorings
This commit is contained in:
@ -6,9 +6,9 @@ import java.util.Objects;
|
||||
import java.util.TreeMap;
|
||||
|
||||
import de.svenkubiak.jpushover.enums.Param;
|
||||
import de.svenkubiak.jpushover.enums.Url;
|
||||
import de.svenkubiak.jpushover.http.PushoverRequest;
|
||||
import de.svenkubiak.jpushover.http.PushoverResponse;
|
||||
import de.svenkubiak.jpushover.utils.Urls;
|
||||
import de.svenkubiak.jpushover.utils.Validate;
|
||||
|
||||
/**
|
||||
@ -17,7 +17,6 @@ import de.svenkubiak.jpushover.utils.Validate;
|
||||
*
|
||||
*/
|
||||
public class Glance {
|
||||
private static final String GLANCE_URL = Urls.getGlanceUrl();
|
||||
private String token;
|
||||
private String user;
|
||||
private String device;
|
||||
@ -137,6 +136,6 @@ public class Glance {
|
||||
body.put(Param.PERCENT.toString(), String.valueOf(this.percent));
|
||||
|
||||
|
||||
return new PushoverRequest().push(GLANCE_URL, body, this.proxyHost, this.proxyPort);
|
||||
return new PushoverRequest().push(Url.GLANCES.toString(), body, this.proxyHost, this.proxyPort);
|
||||
}
|
||||
}
|
@ -8,9 +8,9 @@ import java.util.TreeMap;
|
||||
import de.svenkubiak.jpushover.enums.Param;
|
||||
import de.svenkubiak.jpushover.enums.Priority;
|
||||
import de.svenkubiak.jpushover.enums.Sound;
|
||||
import de.svenkubiak.jpushover.enums.Url;
|
||||
import de.svenkubiak.jpushover.http.PushoverRequest;
|
||||
import de.svenkubiak.jpushover.http.PushoverResponse;
|
||||
import de.svenkubiak.jpushover.utils.Urls;
|
||||
import de.svenkubiak.jpushover.utils.Validate;
|
||||
|
||||
/**
|
||||
@ -19,8 +19,6 @@ import de.svenkubiak.jpushover.utils.Validate;
|
||||
*
|
||||
*/
|
||||
public class Message {
|
||||
private static final String MESSAGE_URL = Urls.getMessageUrl();
|
||||
private static final String VALIDATION_URL = Urls.getValidationUrl();
|
||||
private Priority priority = Priority.NORMAL;
|
||||
private Sound sound = Sound.PUSHOVER;
|
||||
private String token;
|
||||
@ -270,7 +268,7 @@ public class Message {
|
||||
body.put(Param.TOKEN.toString(), this.token);
|
||||
body.put(Param.USER.toString(), this.user);
|
||||
|
||||
var pushoverResponse = new PushoverRequest().push(VALIDATION_URL, body, this.proxyHost, this.proxyPort);
|
||||
var pushoverResponse = new PushoverRequest().push(Url.VALIDATE.toString(), body, this.proxyHost, this.proxyPort);
|
||||
|
||||
var valid = false;
|
||||
if (pushoverResponse.getHttpStatus() == 200) {
|
||||
@ -354,7 +352,7 @@ public class Message {
|
||||
body.put(Param.EXPIRE.toString(), String.valueOf(this.expire));
|
||||
}
|
||||
|
||||
return new PushoverRequest().push(MESSAGE_URL, body, this.proxyHost, this.proxyPort);
|
||||
return new PushoverRequest().push(Url.MESSAGES.toString(), body, this.proxyHost, this.proxyPort);
|
||||
}
|
||||
|
||||
public Priority getPriority() {
|
||||
|
Reference in New Issue
Block a user