You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
107 lines
2.5 KiB
107 lines
2.5 KiB
4 years ago
|
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 AgentService {
|
||
|
|
||
|
|
||
|
constructor(
|
||
|
private http: HttpClient,
|
||
|
private common: CommonsService
|
||
|
) { }
|
||
|
|
||
|
/**
|
||
|
* 查询列表
|
||
|
*
|
||
|
* @param paramsObject 对象
|
||
|
* @param callBack 回调
|
||
|
*/
|
||
|
public getListAgent(paramsObject: object, callBack) {
|
||
|
this.http.get(environment.baseUrl + 'highAgent/getListAgent?' + this.common.getWhereCondition(paramsObject)).subscribe(data => {
|
||
|
callBack(data);
|
||
|
});
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* 新增
|
||
|
*
|
||
|
* @param params 上传对象
|
||
|
* @param callBack 回调
|
||
|
* @return data 返回结果
|
||
|
*/
|
||
|
public insertAgent(params: object, callBack) {
|
||
|
this.http.post(environment.baseUrl + 'highAgent/insertAgent', params).subscribe(data => {
|
||
|
callBack(data);
|
||
|
});
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* 修改卡券
|
||
|
*
|
||
|
* @param params 上传对象
|
||
|
* @param callBack 回调
|
||
|
* @return data 返回结果
|
||
|
*/
|
||
|
public updateAgent(params: object, callBack) {
|
||
|
this.http.post(environment.baseUrl + 'highAgent/updateAgent', 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);
|
||
|
});
|
||
|
}
|
||
|
|
||
|
|
||
|
/**
|
||
|
* 修改公司状态
|
||
|
*
|
||
|
* @param id 用户id
|
||
|
* @param status status
|
||
|
* @param callBack 返回参数
|
||
|
*/
|
||
|
public editStatus(id: number, callBack) {
|
||
|
this.http.get(environment.baseUrl + 'highAgent/forbiddenUser?agentId=' + id ).subscribe(data => {
|
||
|
callBack(data);
|
||
|
});
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* 分配优惠券给代理商
|
||
|
*
|
||
|
* @param params 上传对象
|
||
|
* @param callBack 回调
|
||
|
* @return data 返回结果
|
||
|
*/
|
||
|
public insertDiscountAgent(params: object, callBack) {
|
||
|
this.http.post(environment.baseUrl + 'discountAgentRel/insertDiscountAgent', params).subscribe(data => {
|
||
|
callBack(data);
|
||
|
});
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* 查询列表
|
||
|
*
|
||
|
* @param paramsObject 对象
|
||
|
* @param callBack 回调
|
||
|
*/
|
||
|
public getDiscountAgentList(paramsObject: object, callBack) {
|
||
|
this.http.get(environment.baseUrl + 'discountAgentRel/getDiscountAgentList?' + this.common.getWhereCondition(paramsObject)).subscribe(data => {
|
||
|
callBack(data);
|
||
|
});
|
||
|
}
|
||
|
|
||
|
}
|