import { Injectable } from '@angular/core'; import {HttpClient} from '_@angular_common@9.0.7@@angular/common/http'; import {CommonsService} from './commons.service'; import {environment} from '../../environments/environment'; @Injectable({ providedIn: 'root' }) export class RechargeService { constructor( private http: HttpClient, private common: CommonsService ) { } /** * 查询列表 * * @param paramsObject 对象 * @param callBack 回调 */ public getListOutRechargePrice(paramsObject: object, callBack) { this.http.get(environment.baseUrl + 'outRechargePrice/getListOutRechargePrice?' + this.common.getWhereCondition(paramsObject)).subscribe(data => { callBack(data); }); } /** * 新增 * * @param params 上传对象 * @param callBack 回调 * @return data 返回结果 */ public insertPrice(params: object, callBack) { this.http.post(environment.baseUrl + 'outRechargePrice/insertPrice', params).subscribe(data => { callBack(data); }); } /** * 修改卡券 * * @param params 上传对象 * @param callBack 回调 * @return data 返回结果 */ public updateAgent(params: object, callBack) { this.http.post(environment.baseUrl + 'outRechargePrice/updatePrice', params).subscribe(data => { callBack(data); }); } /** * 根据id查询详情 * * @param agentId id * @param callBack 回调 */ public findByAgentId(agentId: number, callBack) { this.http.get(environment.baseUrl + 'highAgent/findByAgentId?agentId=' + agentId).subscribe(data => { callBack(data); }); } }