mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-11-03 17:49:40 +00:00
Removed master data import post servlet
replaced with sailingservice implementation
This commit is contained in:
1 parent
3f068e0917
commit
570dfef4be
14 files changed
+271
-229
No files matched your search
-46
@@ -1,46 +0,0 @@
|
||||
package com.sap.sailing.server.operationaltransformation;
|
||||
|
||||
import org.json.simple.JSONObject;
|
||||
|
||||
public class CreationCount {
|
||||
|
||||
private int leaderboardCount = 0;
|
||||
private int leaderboardGroupCount = 0;
|
||||
private int eventCount = 0;
|
||||
private int regattaCount = 0;
|
||||
|
||||
public void addOneLeaderboard() {
|
||||
leaderboardCount++;
|
||||
}
|
||||
|
||||
public void addOneLeaderboardGroup() {
|
||||
leaderboardGroupCount++;
|
||||
}
|
||||
|
||||
public void addOneEvent() {
|
||||
eventCount++;
|
||||
}
|
||||
|
||||
public void addOneRegatta() {
|
||||
regattaCount++;
|
||||
|
||||
}
|
||||
public JSONObject toJson() {
|
||||
JSONObject countJson = new JSONObject();
|
||||
countJson.put("leaderboards", leaderboardCount);
|
||||
countJson.put("leaderboardGroups", leaderboardGroupCount);
|
||||
countJson.put("events", eventCount);
|
||||
countJson.put("regattas", regattaCount);
|
||||
return countJson;
|
||||
}
|
||||
|
||||
public void add(CreationCount toAdd) {
|
||||
leaderboardCount = leaderboardCount + toAdd.leaderboardCount;
|
||||
leaderboardGroupCount = leaderboardGroupCount + toAdd.leaderboardGroupCount;
|
||||
eventCount = eventCount + toAdd.eventCount;
|
||||
regattaCount = regattaCount + toAdd.regattaCount;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
+4
-3
@@ -22,6 +22,7 @@ import com.sap.sailing.domain.base.impl.SeriesImpl;
|
||||
import com.sap.sailing.domain.common.MaxPointsReason;
|
||||
import com.sap.sailing.domain.common.RegattaName;
|
||||
import com.sap.sailing.domain.common.ScoringSchemeType;
|
||||
import com.sap.sailing.domain.common.impl.MasterDataImportObjectCreationCountImpl;
|
||||
import com.sap.sailing.domain.common.impl.Util.Pair;
|
||||
import com.sap.sailing.domain.leaderboard.Leaderboard;
|
||||
import com.sap.sailing.domain.leaderboard.RegattaLeaderboard;
|
||||
@@ -40,13 +41,13 @@ import com.sap.sailing.domain.racelog.RaceLogEvent;
|
||||
import com.sap.sailing.server.RacingEventService;
|
||||
import com.sap.sailing.server.RacingEventServiceOperation;
|
||||
|
||||
public class ImportMasterDataOperation extends AbstractRacingEventServiceOperation<CreationCount> {
|
||||
public class ImportMasterDataOperation extends AbstractRacingEventServiceOperation<MasterDataImportObjectCreationCountImpl> {
|
||||
|
||||
private static final long serialVersionUID = 3131715325307370303L;
|
||||
|
||||
private LeaderboardGroupMasterData masterData;
|
||||
|
||||
private CreationCount creationCount = new CreationCount();
|
||||
private MasterDataImportObjectCreationCountImpl creationCount = new MasterDataImportObjectCreationCountImpl();
|
||||
|
||||
private DomainFactory domainFactory = DomainFactory.INSTANCE;
|
||||
|
||||
@@ -55,7 +56,7 @@ public class ImportMasterDataOperation extends AbstractRacingEventServiceOperati
|
||||
}
|
||||
|
||||
@Override
|
||||
public CreationCount internalApplyTo(RacingEventService toState) throws Exception {
|
||||
public MasterDataImportObjectCreationCountImpl internalApplyTo(RacingEventService toState) throws Exception {
|
||||
createLeaderboardGroupWithAllRelatedObjects(masterData, toState);
|
||||
return creationCount;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user