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.
36 lines
991 B
36 lines
991 B
import {Injectable} from '@angular/core';
|
|
import {JSONRequest} from '../../interface/JSONRequest';
|
|
import {Observable} from 'rxjs';
|
|
import {UserResponse} from '../../interface/Response';
|
|
import {HttpClient} from '@angular/common/http';
|
|
import {HttpInterface} from '../../interface/HttpInterface';
|
|
import {catchError} from 'rxjs/operators';
|
|
|
|
/**
|
|
* 信用分管理服务
|
|
*/
|
|
@Injectable({
|
|
providedIn: 'root'
|
|
})
|
|
export class ScoreService extends JSONRequest {
|
|
|
|
constructor(private http: HttpClient) {
|
|
super();
|
|
}
|
|
|
|
// 加载所有用户
|
|
loadAll(body): Observable<UserResponse> {
|
|
return this.http.get(HttpInterface.user, Object.assign(this.httpOptions, {
|
|
params: body
|
|
})).pipe(
|
|
catchError(this.handleError<any>('加载访客信息'))
|
|
);
|
|
}
|
|
|
|
// 修改信用分
|
|
editScore(body): Observable<UserResponse> {
|
|
return this.http.post(HttpInterface.score, body, this.httpOptions).pipe(
|
|
catchError(this.handleError<any>('修改信用分'))
|
|
);
|
|
}
|
|
}
|
|
|