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

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

  /**
   * 配置商户平台号
   * @param paramObject 参数
   * @param callBack
   */
  configMerPlatformNo(paramObject: object, callBack) {
    this.http.post(environment.baseUrl + 'merPlatformNo/configMerPlatformNo', paramObject).subscribe(data => {
      callBack(data);
    });
  }

  /**
   * 查询商户平台号
   * @param merId 商户id
   * @param platformType 平台类型
   * @param callBack
   */
  getMerPlatformNo(merId: number, platformType: number, callBack) {
    this.http.get(environment.baseUrl + 'merPlatformNo/getMerPlatformNo?merId=' + merId + '&platformType=' + platformType).subscribe(data => {
      callBack(data);
    });
  }


}
