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

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

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

  /**
   * 查询平台渠道
   * @param paramObject 参数
   * @param callBack
   */
  getPlatformList(callBack) {
    this.http.get(environment.baseUrl + 'platform/getPlatformList').subscribe(data => {
      callBack(data);
    });
  }

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

}
