diff --git a/pom.xml b/pom.xml index cecc3837e..be91403e4 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ 11 UTF-8 - 2.0.53 + 2.0.62 5.5.7.Final 9.4.31.v20200723 5.3.18 diff --git a/src/main/java/ai/elimu/rest/v2/JpaToGsonConverter.java b/src/main/java/ai/elimu/rest/v2/JpaToGsonConverter.java index e15a619c2..a3b0b6177 100644 --- a/src/main/java/ai/elimu/rest/v2/JpaToGsonConverter.java +++ b/src/main/java/ai/elimu/rest/v2/JpaToGsonConverter.java @@ -24,7 +24,7 @@ import ai.elimu.model.v2.gson.content.EmojiGson; import ai.elimu.model.v2.gson.content.ImageGson; import ai.elimu.model.v2.gson.content.LetterGson; -import ai.elimu.model.v2.gson.content.LetterSoundCorrespondenceGson; +import ai.elimu.model.v2.gson.content.LetterSoundGson; import ai.elimu.model.v2.gson.content.NumberGson; import ai.elimu.model.v2.gson.content.StoryBookChapterGson; import ai.elimu.model.v2.gson.content.StoryBookGson; @@ -88,11 +88,11 @@ public static SoundGson getSoundGson(Sound sound) { } } - public static LetterSoundCorrespondenceGson getLetterSoundGson(LetterSoundCorrespondence letterSound) { + public static LetterSoundGson getLetterSoundGson(LetterSoundCorrespondence letterSound) { if (letterSound == null) { return null; } else { - LetterSoundCorrespondenceGson letterSoundGson = new LetterSoundCorrespondenceGson(); + LetterSoundGson letterSoundGson = new LetterSoundGson(); // BaseEntity letterSoundGson.setId(letterSound.getId()); @@ -131,12 +131,12 @@ public static WordGson getWordGson(Word word) { // Word wordGson.setText(word.getText()); - List letterSounds = new ArrayList<>(); + List letterSounds = new ArrayList<>(); for (LetterSoundCorrespondence letterSound : word.getLetterSoundCorrespondences()) { - LetterSoundCorrespondenceGson letterSoundGson = getLetterSoundGson(letterSound); + LetterSoundGson letterSoundGson = getLetterSoundGson(letterSound); letterSounds.add(letterSoundGson); } - wordGson.setLetterSoundCorrespondences(letterSounds); + wordGson.setLetterSounds(letterSounds); wordGson.setWordType(word.getWordType()); return wordGson; diff --git a/src/main/java/ai/elimu/rest/v2/content/LetterSoundsRestController.java b/src/main/java/ai/elimu/rest/v2/content/LetterSoundsRestController.java index 7e0437617..b9fadffbf 100644 --- a/src/main/java/ai/elimu/rest/v2/content/LetterSoundsRestController.java +++ b/src/main/java/ai/elimu/rest/v2/content/LetterSoundsRestController.java @@ -1,7 +1,7 @@ package ai.elimu.rest.v2.content; import ai.elimu.model.content.LetterSoundCorrespondence; -import ai.elimu.model.v2.gson.content.LetterSoundCorrespondenceGson; +import ai.elimu.model.v2.gson.content.LetterSoundGson; import ai.elimu.rest.v2.JpaToGsonConverter; import com.google.gson.Gson; import org.apache.logging.log4j.LogManager; @@ -30,7 +30,7 @@ public String handleGetRequest() { JSONArray letterSoundsJsonArray = new JSONArray(); for (LetterSoundCorrespondence letterSound : letterSoundDao.readAllOrderedByUsage()) { - LetterSoundCorrespondenceGson letterSoundGson = JpaToGsonConverter.getLetterSoundGson(letterSound); + LetterSoundGson letterSoundGson = JpaToGsonConverter.getLetterSoundGson(letterSound); String json = new Gson().toJson(letterSoundGson); letterSoundsJsonArray.put(new JSONObject(json)); } diff --git a/src/main/java/ai/elimu/rest/v2/crowdsource/WordContributionRestController.java b/src/main/java/ai/elimu/rest/v2/crowdsource/WordContributionRestController.java index 28b837195..6b055397f 100644 --- a/src/main/java/ai/elimu/rest/v2/crowdsource/WordContributionRestController.java +++ b/src/main/java/ai/elimu/rest/v2/crowdsource/WordContributionRestController.java @@ -5,7 +5,7 @@ import ai.elimu.model.contributor.Contributor; import ai.elimu.model.contributor.WordContributionEvent; import ai.elimu.model.enums.Platform; -import ai.elimu.model.v2.gson.content.LetterSoundCorrespondenceGson; +import ai.elimu.model.v2.gson.content.LetterSoundGson; import ai.elimu.model.v2.gson.content.WordGson; import ai.elimu.model.v2.gson.crowdsource.WordContributionEventGson; import ai.elimu.rest.v2.JpaToGsonConverter; @@ -63,7 +63,7 @@ public String getLetterSoundCorrespondences(HttpServletRequest request, HttpServ JSONArray letterSoundCorrespondencesJsonArray = new JSONArray(); for (LetterSoundCorrespondence letterSoundCorrespondence : letterSoundDao.readAllOrderedByUsage()) { - LetterSoundCorrespondenceGson letterSoundCorrespondenceGson = + LetterSoundGson letterSoundCorrespondenceGson = JpaToGsonConverter.getLetterSoundGson(letterSoundCorrespondence); String json = new Gson().toJson(letterSoundCorrespondenceGson); letterSoundCorrespondencesJsonArray.put(new JSONObject(json)); @@ -144,9 +144,9 @@ public String postWordContribution( Word word = new Word(); word.setWordType(wordGson.getWordType()); word.setText(wordGson.getText().toLowerCase()); - List letterSoundCorrespondencesGsons = wordGson.getLetterSoundCorrespondences(); + List letterSoundCorrespondencesGsons = wordGson.getLetterSounds(); List letterSoundCorrespondences = new ArrayList<>(); - for (LetterSoundCorrespondenceGson letterSoundCorrespondenceGson : letterSoundCorrespondencesGsons) { + for (LetterSoundGson letterSoundCorrespondenceGson : letterSoundCorrespondencesGsons) { LetterSoundCorrespondence letterSoundCorrespondence = letterSoundDao.read(letterSoundCorrespondenceGson.getId()); letterSoundCorrespondences.add(letterSoundCorrespondence);