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

New API (Sync score)

parent 22565ea0
...@@ -8,8 +8,6 @@ ...@@ -8,8 +8,6 @@
</facet> </facet>
</component> </component>
<component name="NewModuleRootManager" inherit-compiler-output="true"> <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 /> <exclude-output />
<content url="file://$MODULE_DIR$"> <content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.gradle" /> <excludeFolder url="file://$MODULE_DIR$/.gradle" />
......
...@@ -19,4 +19,8 @@ public class API_URLS { ...@@ -19,4 +19,8 @@ public class API_URLS {
return BASE_URL + "/matches/" + matchId; 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 { ...@@ -131,19 +131,18 @@ public class ScoreSyncManager {
*/ */
private void synchronizeScore(final float key, Score score) { private void synchronizeScore(final float key, Score score) {
JsonObject param = new JsonObject(); JsonObject param = new JsonObject();
param.addProperty("idMatch", this.idMatch); param.addProperty("pointId", score.getId());
param.addProperty("idPoint", score.getId());
param.addProperty("scoreA", score.getScoreA()); param.addProperty("scoreA", score.getScoreA());
param.addProperty("scoreB", score.getScoreB()); param.addProperty("scoreB", score.getScoreB());
param.addProperty("numeroSet", score.getNumSet() + 1); param.addProperty("setNum", score.getNumSet() + 1);
param.addProperty("setA", score.getSetA()); param.addProperty("setA", score.getSetA());
param.addProperty("setB", score.getSetB()); param.addProperty("setB", score.getSetB());
param.addProperty("gameA", score.getGamesA()); param.addProperty("gameA", score.getGamesA());
param.addProperty("gameB", score.getGamesB()); param.addProperty("gameB", score.getGamesB());
param.addProperty("service", score.getService()); param.addProperty("server", score.getService());
Ion.with(context) Ion.with(context)
.load("POST", API_URLS.SCORE_UPDATE) .load("POST", API_URLS.UPDATE_SCORE(idMatch))
.setTimeout(TIMEOUT_MS) .setTimeout(TIMEOUT_MS)
.setJsonObjectBody(param) .setJsonObjectBody(param)
.asJsonObject() .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