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

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

  /**
   * 充值
   *
   * @param params 上传对象
   * @param  callBack   回调
   * @return data 返回结果
   */
  public recharge(params: object, callBack) {
    this.http.post(environment.baseUrl + 'merAccount/recharge', params).subscribe(data => {
      callBack(data);
    });
  }
}
