Add: ranking - DBService
This commit is contained in:
@@ -8,6 +8,10 @@ var Ranking = {
|
||||
create: function() {
|
||||
this.dbConnectManager = new DBConnectManager();
|
||||
|
||||
this.dbService = new DBService();
|
||||
this.dbService.setMaestroID(sessionStorageManager.getMaestroID());
|
||||
this.dbService.setPlayerID(sessionStorageManager.getPlayerID());
|
||||
|
||||
this.jsonData = null;
|
||||
this.timeType = Ranking.MODE_HOUR;
|
||||
this.refreshTimeSec = Ranking.REFRESH_TIME_SEC;
|
||||
@@ -326,15 +330,37 @@ var Ranking = {
|
||||
return;
|
||||
}
|
||||
|
||||
this.dbConnectManager.requestRanking(
|
||||
this.getDateTimeType(),
|
||||
sessionStorageManager.getMaestroID(),
|
||||
this.date,
|
||||
this.time,
|
||||
(function(type, rankingRecordManager) {
|
||||
this.showRanking(rankingRecordManager);
|
||||
}).bind(this)
|
||||
);
|
||||
if(isTypingExamApp()) {
|
||||
this.dbService.requestTypingExamRanking(
|
||||
this.getDateTimeType(),
|
||||
sessionStorageManager.getWritingID(),
|
||||
this.date,
|
||||
this.time,
|
||||
|
||||
(function(type, rankingRecordManager) {
|
||||
this.showRanking(rankingRecordManager);
|
||||
}).bind(this),
|
||||
|
||||
(function(jsonData) {
|
||||
console.log(jsonData);
|
||||
}).bind(this)
|
||||
);
|
||||
} else {
|
||||
this.dbConnectManager.requestRanking(
|
||||
this.getDateTimeType(),
|
||||
sessionStorageManager.getMaestroID(),
|
||||
this.date,
|
||||
this.time,
|
||||
|
||||
(function(type, rankingRecordManager) {
|
||||
this.showRanking(rankingRecordManager);
|
||||
}).bind(this),
|
||||
|
||||
(function(jsonData) {
|
||||
console.log(jsonData);
|
||||
}).bind(this)
|
||||
);
|
||||
}
|
||||
},
|
||||
|
||||
onClickRankingHour: function() {
|
||||
|
||||
@@ -58,6 +58,7 @@
|
||||
<script src="../../game/lib/button/back_button.js"></script>
|
||||
<script src="../../game/lib/button/fullscreen_button.js"></script>
|
||||
<script src="../../game/lib/db_connect_manager.js"></script>
|
||||
<script src="../../game/lib/db_service.js"></script>
|
||||
<!-- <script src="../../game/typing/lib/animal.js"></script> -->
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user