Commit 387c0a14 authored by rakam's avatar rakam
Browse files

New API (Sync score)

parent 22565ea0
......@@ -8,8 +8,6 @@
</facet>
</component>
<component name="NewModuleRootManager" inherit-compiler-output="true">
<output url="file://$MODULE_DIR$/build/classes/main" />
<output-test url="file://$MODULE_DIR$/build/classes/test" />
<exclude-output />
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.gradle" />
......
......@@ -19,4 +19,8 @@ public class API_URLS {
return BASE_URL + "/matches/" + matchId;
}
public static String UPDATE_SCORE(int matchId) {
return BASE_URL + "/matches/" + matchId + "/score";
}
}
......@@ -131,19 +131,18 @@ public class ScoreSyncManager {
*/
private void synchronizeScore(final float key, Score score) {
JsonObject param = new JsonObject();
param.addProperty("idMatch", this.idMatch);
param.addProperty("idPoint", score.getId());
param.addProperty("pointId", score.getId());
param.addProperty("scoreA", score.getScoreA());
param.addProperty("scoreB", score.getScoreB());
param.addProperty("numeroSet", score.getNumSet() + 1);
param.addProperty("setNum", score.getNumSet() + 1);
param.addProperty("setA", score.getSetA());
param.addProperty("setB", score.getSetB());
param.addProperty("gameA", score.getGamesA());
param.addProperty("gameB", score.getGamesB());
param.addProperty("service", score.getService());
param.addProperty("server", score.getService());
Ion.with(context)
.load("POST", API_URLS.SCORE_UPDATE)
.load("POST", API_URLS.UPDATE_SCORE(idMatch))
.setTimeout(TIMEOUT_MS)
.setJsonObjectBody(param)
.asJsonObject()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment