forked from Steven/DeepJ
Merged Classes
Fixed repetitive auth key usage
This commit is contained in:
parent
50d01058aa
commit
2c276acaf9
@ -1,5 +1,16 @@
|
|||||||
|
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::://
|
||||||
|
// ███████╗ ██████╗ ██╗ ██╗ ██╗██████╗ ██████╗ █████╗ ████████╗███████╗██████╗ ██████╗ ███████╗███████╗██████╗ ██╗ //
|
||||||
|
// ██╔════╝██╔════╝ ██║ ██║ ██║██╔══██╗██╔══██╗██╔══██╗╚══██╔══╝██╔════╝██╔══██╗ ██╔══██╗██╔════╝██╔════╝██╔══██╗ ██║ //
|
||||||
|
// ███████╗██║ ███╗██║ ██║ ██║██████╔╝██║ ██║███████║ ██║ █████╗ ██║ ██║ ██║ ██║█████╗ █████╗ ██████╔╝ ██║ //
|
||||||
|
// ╚════██║██║ ██║██║ ██║ ██║██╔═══╝ ██║ ██║██╔══██║ ██║ ██╔══╝ ██║ ██║ ██║ ██║██╔══╝ ██╔══╝ ██╔═══╝██ ██║ //
|
||||||
|
// ███████║╚██████╔╝██║ ╚██████╔╝██║ ██████╔╝██║ ██║ ██║ ███████╗██████╔╝ ██████╔╝███████╗███████╗██║ ╚█████╔╝ //
|
||||||
|
// ╚══════╝ ╚═════╝ ╚═╝ ╚═════╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ ╚══════╝╚═════╝ ╚═════╝ ╚══════╝╚══════╝╚═╝ ╚════╝ //
|
||||||
|
// █▀█ █▀█ █ █▀▀ █ █▄ █ ▄▀█ █ █▄▄ █▄█ █▀ ▀█▀ █▀▀ █ █ █▀▀ █▄ █ //
|
||||||
|
// █▄█ █▀▄ █ █▄█ █ █ ▀█ █▀█ █▄▄ █▄█ █ ▄█ █ ██▄ ▀▄▀ ██▄ █ ▀█ //
|
||||||
|
// //
|
||||||
|
// DeepJ is a Java Wrapper for the DeepL Free Public API. This was originally made by Steven (Forked From) and Updated by 5gi //
|
||||||
|
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::://
|
||||||
package tech.nevets.deepj;
|
package tech.nevets.deepj;
|
||||||
|
|
||||||
import org.json.JSONArray;
|
import org.json.JSONArray;
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@ -9,7 +20,6 @@ import java.net.http.HttpClient;
|
|||||||
import java.net.http.HttpRequest;
|
import java.net.http.HttpRequest;
|
||||||
import java.net.http.HttpResponse;
|
import java.net.http.HttpResponse;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
|
|
||||||
public class Translator {
|
public class Translator {
|
||||||
Request request;
|
Request request;
|
||||||
public Translator(String authKey) {
|
public Translator(String authKey) {
|
||||||
@ -32,8 +42,7 @@ public class Translator {
|
|||||||
}
|
}
|
||||||
return message;
|
return message;
|
||||||
}
|
}
|
||||||
private static class Request {
|
protected static class Request {
|
||||||
|
|
||||||
private final String authKey;
|
private final String authKey;
|
||||||
public Request(String authKey) {
|
public Request(String authKey) {
|
||||||
this.authKey = authKey;
|
this.authKey = authKey;
|
||||||
@ -90,4 +99,15 @@ public class Translator {
|
|||||||
ZH
|
ZH
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::://
|
||||||
|
// ███████╗ ██████╗ ██╗ ██╗ ██╗██████╗ ██████╗ █████╗ ████████╗███████╗██████╗ ██████╗ ███████╗███████╗██████╗ ██╗ //
|
||||||
|
// ██╔════╝██╔════╝ ██║ ██║ ██║██╔══██╗██╔══██╗██╔══██╗╚══██╔══╝██╔════╝██╔══██╗ ██╔══██╗██╔════╝██╔════╝██╔══██╗ ██║ //
|
||||||
|
// ███████╗██║ ███╗██║ ██║ ██║██████╔╝██║ ██║███████║ ██║ █████╗ ██║ ██║ ██║ ██║█████╗ █████╗ ██████╔╝ ██║ //
|
||||||
|
// ╚════██║██║ ██║██║ ██║ ██║██╔═══╝ ██║ ██║██╔══██║ ██║ ██╔══╝ ██║ ██║ ██║ ██║██╔══╝ ██╔══╝ ██╔═══╝██ ██║ //
|
||||||
|
// ███████║╚██████╔╝██║ ╚██████╔╝██║ ██████╔╝██║ ██║ ██║ ███████╗██████╔╝ ██████╔╝███████╗███████╗██║ ╚█████╔╝ //
|
||||||
|
// ╚══════╝ ╚═════╝ ╚═╝ ╚═════╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ ╚══════╝╚═════╝ ╚═════╝ ╚══════╝╚══════╝╚═╝ ╚════╝ //
|
||||||
|
// █▀█ █▀█ █ █▀▀ █ █▄ █ ▄▀█ █ █▄▄ █▄█ █▀ ▀█▀ █▀▀ █ █ █▀▀ █▄ █ //
|
||||||
|
// █▄█ █▀▄ █ █▄█ █ █ ▀█ █▀█ █▄▄ █▄█ █ ▄█ █ ██▄ ▀▄▀ ██▄ █ ▀█ //
|
||||||
|
// //
|
||||||
|
// DeepJ is a Java Wrapper for the DeepL Free Public API. This was originally made by Steven (Forked From) and Updated by 5gi //
|
||||||
|
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::://
|
Loading…
Reference in New Issue
Block a user