-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
34182fb
commit 1ff5df8
Showing
6 changed files
with
1,177 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
...in/java/com/techolution/mauritius/smartwater/supply/controller/LeakageDataController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package com.techolution.mauritius.smartwater.supply.controller; | ||
|
||
import java.util.List; | ||
|
||
import org.apache.commons.logging.Log; | ||
import org.apache.commons.logging.LogFactory; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.web.bind.annotation.CrossOrigin; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RequestMethod; | ||
import org.springframework.web.bind.annotation.ResponseBody; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
import com.techolution.mauritius.smartwater.supply.domain.ConsumptionLeakage; | ||
import com.techolution.mauritius.smartwater.supply.domain.LeakageData; | ||
import com.techolution.mauritius.smartwater.supply.service.SupplyAnalyticsService; | ||
|
||
@CrossOrigin(origins = {"*"}) | ||
@RestController | ||
@RequestMapping(value="/leakage") | ||
|
||
public class LeakageDataController { | ||
|
||
private Log log = LogFactory.getLog(LeakageDataController.class); | ||
|
||
@Autowired | ||
SupplyAnalyticsService analyticService; | ||
|
||
@RequestMapping(method=RequestMethod.GET,value="/daily/metrics") | ||
public @ResponseBody LeakageData getDailyLeakageStats() | ||
{ | ||
log.info("Entering LeakageDataController.getDailyLeakageStats"); | ||
LeakageData resultdata=analyticService.getCurrentDayLeakageData(); | ||
log.info("Exiting LeakageDataController.getDailyLeakageStats"); | ||
return resultdata; | ||
} | ||
@RequestMapping(method=RequestMethod.GET,value="/daily/consumerleakage") | ||
public @ResponseBody List<ConsumptionLeakage> getDailyConsumerLeakageStats() | ||
{ | ||
log.info("Entering LeakageDataController.getDailyConsumerLeakageStats"); | ||
List<ConsumptionLeakage> resultList=analyticService.getCurrentDayConsumerLeakage(); | ||
log.info("Exiting LeakageDataController.getDailyConsumerLeakageStats"); | ||
return resultList; | ||
} | ||
|
||
|
||
} |
35 changes: 35 additions & 0 deletions
35
.../src/main/java/com/techolution/mauritius/smartwater/supply/domain/ConsumptionLeakage.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package com.techolution.mauritius.smartwater.supply.domain; | ||
|
||
import java.io.Serializable; | ||
import java.util.Date; | ||
|
||
public class ConsumptionLeakage implements Serializable { | ||
|
||
/** | ||
* | ||
*/ | ||
private static final long serialVersionUID = 1L; | ||
private String meterId; | ||
private Date date; | ||
private double leakage; | ||
|
||
public String getMeterId() { | ||
return meterId; | ||
} | ||
public void setMeterId(String meterId) { | ||
this.meterId = meterId; | ||
} | ||
public Date getDate() { | ||
return date; | ||
} | ||
public void setDate(Date date) { | ||
this.date = date; | ||
} | ||
public double getLeakage() { | ||
return leakage; | ||
} | ||
public void setLeakage(double leakage) { | ||
this.leakage = leakage; | ||
} | ||
|
||
} |
39 changes: 39 additions & 0 deletions
39
...service/src/main/java/com/techolution/mauritius/smartwater/supply/domain/LeakageData.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package com.techolution.mauritius.smartwater.supply.domain; | ||
|
||
import java.io.Serializable; | ||
import java.util.Date; | ||
|
||
public class LeakageData implements Serializable { | ||
|
||
private Date metricsDate; | ||
|
||
private double consumptionLeakage; | ||
|
||
private double networkLeakage; | ||
|
||
public Date getMetricsDate() { | ||
return metricsDate; | ||
} | ||
|
||
public void setMetricsDate(Date metricsDate) { | ||
this.metricsDate = metricsDate; | ||
} | ||
|
||
public double getConsumptionLeakage() { | ||
return consumptionLeakage; | ||
} | ||
|
||
public void setConsumptionLeakage(double consumptionLeakage) { | ||
this.consumptionLeakage = consumptionLeakage; | ||
} | ||
|
||
public double getNetworkLeakage() { | ||
return networkLeakage; | ||
} | ||
|
||
public void setNetworkLeakage(double networkLeakage) { | ||
this.networkLeakage = networkLeakage; | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.