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 GasChannelConfigService {

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

  /**
   * 编辑第三方
   *
   * @param  param   参数对象
   * @param  callBack   回调
   */
  public editTripartitePlatform(param: object, callBack) {
    this.http.post(environment.baseUrl + 'gasChannelConfig/editTripartitePlatform', param).subscribe(data => {
      callBack(data);
    });
  }

  /**
   * 查询详情
   *
   * @param  param   参数对象
   * @param  callBack   回调
   */
  public getDetail(channelId: number, payPlatformType: number, callBack) {
    this.http.get(environment.baseUrl + 'gasChannelConfig/getDetail?channelId=' + channelId + '&payPlatformType=' + payPlatformType).subscribe(data => {
      callBack(data);
    });
  }

}
