mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
bring back language to json (EDU-882)
This commit is contained in:
@@ -26,7 +26,7 @@ public class Course {
|
||||
@Expose @SerializedName("summary") private String description;
|
||||
@Expose @SerializedName("title") private String name;
|
||||
|
||||
transient private String myLanguage = "Python";
|
||||
@Expose @SerializedName("language") private String myLanguage = "Python";
|
||||
|
||||
//this field is used to distinguish ordinary and CheckIO projects,
|
||||
//"PyCharm" is used here for historical reasons
|
||||
|
||||
@@ -25,7 +25,6 @@ import org.jetbrains.annotations.NotNull;
|
||||
import javax.net.ssl.SSLContext;
|
||||
import javax.net.ssl.TrustManager;
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Modifier;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.net.Proxy;
|
||||
import java.net.URI;
|
||||
@@ -70,10 +69,10 @@ public class EduStepicClient {
|
||||
}
|
||||
|
||||
static <T> T deserializeStepicResponse(Class<T> container, String responseString) {
|
||||
Gson gson = new GsonBuilder().registerTypeAdapter(StepicWrappers.StepOptions.class, new StudySerializationUtils.Json.StepicStepOptionsAdapter()).
|
||||
excludeFieldsWithModifiers(Modifier.TRANSIENT).
|
||||
setDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'").
|
||||
setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES).create();
|
||||
Gson gson =
|
||||
new GsonBuilder().registerTypeAdapter(StepicWrappers.StepOptions.class, new StudySerializationUtils.Json.StepicStepOptionsAdapter()).
|
||||
setDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'").
|
||||
setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES).create();
|
||||
return gson.fromJson(responseString, container);
|
||||
}
|
||||
|
||||
@@ -116,7 +115,8 @@ public class EduStepicClient {
|
||||
CloseableHttpClient httpClient = getBuilder().setDefaultHeaders(headers).build();
|
||||
|
||||
try {
|
||||
final StepicWrappers.AuthorWrapper wrapper = getFromStepic(EduStepicNames.CURRENT_USER, StepicWrappers.AuthorWrapper.class, httpClient);
|
||||
final StepicWrappers.AuthorWrapper wrapper =
|
||||
getFromStepic(EduStepicNames.CURRENT_USER, StepicWrappers.AuthorWrapper.class, httpClient);
|
||||
if (wrapper != null && !wrapper.users.isEmpty()) {
|
||||
StepicUser user = wrapper.users.get(0);
|
||||
return user != null && !user.isGuest();
|
||||
|
||||
Reference in New Issue
Block a user