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.
 
 
 
 
pocketcommunityweb/src/app/visitor/visitor/visitor.service.ts

36 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(page: number): Observable<VisitorResponse> {
return this.http.get<VisitorResponse>(HttpInterface.visitor, Object.assign(this.httpOptions, {
params: {
currentPage: page,
}
})).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>('审核访客信息'))
);
}
}