import { Injectable } from '@angular/core';
import {HttpClient} from  '@angular/common/http';
import {CommonsService} from './commons.service';
import {environment} from '../../environments/environment';

@Injectable({
  providedIn: 'root'
})
export class GasService {

  constructor(
      private http: HttpClient,
      private common: CommonsService
  ) { }

  /**
   * 查询商户油站统计
   *
   * @param  param   参数对象
   * @param  callBack   回调
   */
  public getMerGasStatistical(param: object, callBack) {
    this.http.post(environment.baseUrl + 'highGas/getMerGasStatistical', param).subscribe(data => {
      callBack(data);
    });
  }

  /**
   * 禁用油品
   *
   * @param  param   参数对象
   * @param  callBack   回调
   */
  public disabledOil(param: object, callBack) {
    this.http.post(environment.baseUrl + 'highGas/disabledOil', param).subscribe(data => {
      callBack(data);
    });
  }

  /**
   * 启用油品
   *
   * @param  param   参数对象
   * @param  callBack   回调
   */
  public enableOil(param: object, callBack) {
    this.http.post(environment.baseUrl + 'highGas/enableOil', param).subscribe(data => {
      callBack(data);
    });
  }
}
