2016-02-09 19:17:05 -06:00
|
|
|
import extend from 'extend';
|
|
|
|
|
|
2016-02-10 16:11:56 -06:00
|
|
|
const ENDPOINT = '/data/v1/energy';
|
|
|
|
|
|
2016-02-09 19:17:05 -06:00
|
|
|
class EnergyDataApi {
|
|
|
|
|
|
2016-02-22 13:45:43 -06:00
|
|
|
static index(params){
|
2016-02-09 19:17:05 -06:00
|
|
|
return jQuery.ajax({
|
2016-02-10 16:11:56 -06:00
|
|
|
url: ENDPOINT + '?' + jQuery.param(params),
|
2016-02-09 19:17:05 -06:00
|
|
|
type: 'GET',
|
|
|
|
|
dataType: 'json'
|
2016-02-10 16:11:56 -06:00
|
|
|
}).then((res)=>{
|
2016-02-09 19:17:05 -06:00
|
|
|
return res.data;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default EnergyDataApi;
|