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.
34 lines
1.1 KiB
34 lines
1.1 KiB
import {Injectable} from '@angular/core';
|
|
import {JSONRequest} from '../../interface/JSONRequest';
|
|
import {HttpClient} from '@angular/common/http';
|
|
import {Observable} from 'rxjs';
|
|
import {VisitorResponse} from '../../interface/Response';
|
|
import {HttpInterface} from '../../interface/HttpInterface';
|
|
import {catchError} from 'rxjs/operators';
|
|
|
|
@Injectable({
|
|
providedIn: 'root'
|
|
})
|
|
export class VisitorService extends JSONRequest {
|
|
|
|
constructor(private http: HttpClient) {
|
|
super();
|
|
}
|
|
|
|
// 加载访客信息
|
|
loadAll(queryForm: object): Observable<VisitorResponse> {
|
|
return this.http.get<VisitorResponse>(HttpInterface.visitor, Object.assign(this.httpOptions, {
|
|
params: queryForm
|
|
})).pipe(
|
|
catchError(this.handleError<any>('加载访客信息'))
|
|
);
|
|
}
|
|
|
|
// 审核访客信息
|
|
check($id: string, $status: string, $managerName: string): Observable<VisitorResponse> {
|
|
return this.http.post<VisitorResponse>(HttpInterface.visitor, {id: $id, status: $status, managerName: $managerName}, this.httpOptions)
|
|
.pipe(
|
|
catchError(this.handleError<any>('审核访客信息'))
|
|
);
|
|
}
|
|
}
|
|
|